	.file	"148577358.c"
	.intel_syntax noprefix
	.text
	.globl	do_mosaic
	.type	do_mosaic, @function
do_mosaic:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	QWORD PTR -56[rbp], rdi
	mov	DWORD PTR -60[rbp], esi
	mov	DWORD PTR -64[rbp], edx
	mov	DWORD PTR -68[rbp], ecx
	mov	DWORD PTR -72[rbp], r8d
	mov	DWORD PTR -76[rbp], r9d
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -72[rbp]
	sub	eax, DWORD PTR -64[rbp]
	imul	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 1374389535
	shr	rdx, 32
	sar	edx, 5
	sar	eax, 31
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -76[rbp]
	sub	eax, DWORD PTR -68[rbp]
	imul	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 1374389535
	shr	rdx, 32
	sar	edx, 5
	sar	eax, 31
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -24[rbp], eax
	mov	WORD PTR -11[rbp], 0
	mov	BYTE PTR -9[rbp], 0
	mov	eax, DWORD PTR -68[rbp]
	mov	DWORD PTR -36[rbp], eax
	jmp	.L2
.L8:
	mov	eax, DWORD PTR -64[rbp]
	mov	DWORD PTR -32[rbp], eax
	jmp	.L3
.L7:
	mov	eax, DWORD PTR -36[rbp]
	imul	eax, DWORD PTR 16[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -32[rbp]
	add	eax, edx
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	sub	eax, DWORD PTR -68[rbp]
	cdq
	idiv	DWORD PTR -24[rbp]
	mov	eax, edx
	test	eax, eax
	jne	.L4
	mov	eax, DWORD PTR -32[rbp]
	sub	eax, DWORD PTR -64[rbp]
	cdq
	idiv	DWORD PTR -28[rbp]
	mov	eax, edx
	test	eax, eax
	jne	.L5
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	movzx	edx, WORD PTR [rax]
	mov	WORD PTR -11[rbp], dx
	movzx	eax, BYTE PTR 2[rax]
	mov	BYTE PTR -9[rbp], al
	jmp	.L6
.L5:
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	movzx	edx, WORD PTR -11[rbp]
	mov	WORD PTR [rax], dx
	movzx	edx, BYTE PTR -9[rbp]
	mov	BYTE PTR 2[rax], dl
	jmp	.L6
.L4:
	mov	eax, DWORD PTR -36[rbp]
	sub	eax, 1
	imul	eax, DWORD PTR 16[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -32[rbp]
	add	eax, edx
	mov	DWORD PTR -16[rbp], eax
	mov	edx, DWORD PTR -16[rbp]
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -56[rbp]
	lea	rcx, [rdx+rax]
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	edx, 3
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
.L6:
	add	DWORD PTR -32[rbp], 1
.L3:
	mov	eax, DWORD PTR -32[rbp]
	cmp	eax, DWORD PTR -72[rbp]
	jl	.L7
	add	DWORD PTR -36[rbp], 1
.L2:
	mov	eax, DWORD PTR -36[rbp]
	cmp	eax, DWORD PTR -76[rbp]
	jl	.L8
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	do_mosaic, .-do_mosaic
	.section	.rodata
	.align 8
.LC0:
	.string	"%s input.rgb24 output.rgb24 width height, level\n"
.LC1:
	.string	"r"
.LC2:
	.string	"w"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	cmp	DWORD PTR -52[rbp], 6
	je	.L11
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L12
.L11:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -44[rbp], eax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -40[rbp], eax
	mov	eax, DWORD PTR -44[rbp]
	imul	eax, DWORD PTR -40[rbp]
	mov	edx, eax
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR -44[rbp]
	imul	eax, DWORD PTR -40[rbp]
	mov	edx, eax
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	movsx	rsi, eax
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	DWORD PTR -36[rbp], 625
	mov	DWORD PTR -32[rbp], 279
	mov	DWORD PTR -28[rbp], 1071
	mov	DWORD PTR -24[rbp], 724
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 40
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -20[rbp], eax
	mov	r9d, DWORD PTR -24[rbp]
	mov	r8d, DWORD PTR -28[rbp]
	mov	ecx, DWORD PTR -32[rbp]
	mov	edx, DWORD PTR -36[rbp]
	mov	esi, DWORD PTR -20[rbp]
	mov	rax, QWORD PTR -8[rbp]
	sub	rsp, 8
	mov	edi, DWORD PTR -44[rbp]
	push	rdi
	mov	rdi, rax
	call	do_mosaic
	add	rsp, 16
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	eax, DWORD PTR -44[rbp]
	imul	eax, DWORD PTR -40[rbp]
	mov	edx, eax
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	movsx	rsi, eax
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"148577358.c"
	.text
	.global	__aeabi_idivmod
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\000\000"
	.space	1
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	do_mosaic
	.syntax unified
	.arm
	.fpu softvfp
	.type	do_mosaic, %function
do_mosaic:
	@ args = 12, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	str	r2, [fp, #-48]
	str	r3, [fp, #-52]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r2, [fp, #4]
	ldr	r3, [fp, #-48]
	sub	r3, r2, r3
	ldr	r2, [fp, #-44]
	mul	r3, r2, r3
	ldr	r2, .L10+4
	smull	r1, r2, r3, r2
	asr	r2, r2, #5
	asr	r3, r3, #31
	sub	r3, r2, r3
	str	r3, [fp, #-28]
	ldr	r2, [fp, #8]
	ldr	r3, [fp, #-52]
	sub	r3, r2, r3
	ldr	r2, [fp, #-44]
	mul	r3, r2, r3
	ldr	r2, .L10+4
	smull	r1, r2, r3, r2
	asr	r2, r2, #5
	asr	r3, r3, #31
	sub	r3, r2, r3
	str	r3, [fp, #-24]
	ldr	r3, .L10+8
	ldrh	r3, [r3]	@ movhi
	strh	r3, [fp, #-12]	@ movhi
	mov	r3, #0
	strb	r3, [fp, #-10]
	ldr	r3, [fp, #-52]
	str	r3, [fp, #-36]
	b	.L2
.L8:
	ldr	r3, [fp, #-48]
	str	r3, [fp, #-32]
	b	.L3
.L7:
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #12]
	mul	r3, r2, r3
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-52]
	sub	r3, r2, r3
	ldr	r1, [fp, #-24]
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	cmp	r3, #0
	bne	.L4
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-48]
	sub	r3, r2, r3
	ldr	r1, [fp, #-28]
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	cmp	r3, #0
	bne	.L5
	ldr	r2, [fp, #-20]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r2, r3, r2
	sub	r3, fp, #12
	mov	r1, r2
	mov	r2, #3
	mov	r0, r3
	bl	memcpy
	b	.L6
.L5:
	ldr	r2, [fp, #-20]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	mov	r0, r3
	sub	r3, fp, #12
	mov	r2, #3
	mov	r1, r3
	bl	memcpy
	b	.L6
.L4:
	ldr	r3, [fp, #-36]
	sub	r3, r3, #1
	ldr	r2, [fp, #12]
	mul	r3, r2, r3
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-20]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r0, r3, r2
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	mov	r2, #3
	mov	r1, r3
	bl	memcpy
.L6:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L3:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #4]
	cmp	r2, r3
	blt	.L7
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L2:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #8]
	cmp	r2, r3
	blt	.L8
	nop
	ldr	r3, .L10
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC1
	.word	1374389535
	.word	.LC0
	.size	do_mosaic, .-do_mosaic
	.section	.rodata
	.align	2
.LC2:
	.ascii	"%s input.rgb24 output.rgb24 width height, level\012"
	.ascii	"\000"
	.align	2
.LC3:
	.ascii	"r\000"
	.align	2
.LC4:
	.ascii	"w\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, [fp, #-48]
	cmp	r3, #6
	beq	.L13
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L15
	bl	printf
	mvn	r3, #0
	b	.L14
.L13:
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L15+4
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-52]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-52]
	add	r3, r3, #16
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-32]
	mul	r2, r3, r2
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-32]
	mul	r2, r3, r2
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	mov	r1, r3
	ldr	r3, [fp, #-40]
	mov	r2, #1
	ldr	r0, [fp, #-28]
	bl	fread
	ldr	r0, [fp, #-40]
	bl	fclose
	ldr	r3, .L15+8
	str	r3, [fp, #-24]
	ldr	r3, .L15+12
	str	r3, [fp, #-20]
	ldr	r3, .L15+16
	str	r3, [fp, #-16]
	mov	r3, #724
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-52]
	add	r3, r3, #20
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-36]
	str	r3, [sp, #8]
	ldr	r3, [fp, #-12]
	str	r3, [sp, #4]
	ldr	r3, [fp, #-16]
	str	r3, [sp]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-28]
	bl	do_mosaic
	ldr	r3, [fp, #-52]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L15+20
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-32]
	mul	r2, r3, r2
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	mov	r1, r3
	ldr	r3, [fp, #-40]
	mov	r2, #1
	ldr	r0, [fp, #-28]
	bl	fwrite
	ldr	r0, [fp, #-40]
	bl	fclose
	ldr	r0, [fp, #-28]
	bl	free
	mov	r3, #0
.L14:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC2
	.word	.LC3
	.word	625
	.word	279
	.word	1071
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
