	.file	"231588.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"w"
.LC1:
	.string	"P6\n%d %d\n255\n"
	.text
	.globl	write_ppm
	.type	write_ppm, @function
write_ppm:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L2
	mov	eax, 0
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -24[rbp]
	mov	ecx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	cdqe
	imul	rdx, rax
	mov	rax, rdx
	add	rax, rax
	lea	rsi, [rax+rdx]
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -8[rbp]
	mov	rcx, rdx
	mov	rdx, rsi
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 1
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	write_ppm, .-write_ppm
	.globl	img_new
	.type	img_new, @function
img_new:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	add	rax, 2
	lea	rcx, 0[0+rax*8]
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	imul	rdx, rax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	add	rax, rcx
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -24[rbp]
	mov	DWORD PTR 4[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 16[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rdx, rcx
	mov	QWORD PTR [rax], rdx
	mov	DWORD PTR -12[rbp], 1
	jmp	.L5
.L6:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 3
	sub	rax, 8
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	lea	rsi, [rax+rdx]
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	lea	rdx, [rcx+rsi]
	mov	QWORD PTR [rax], rdx
	add	DWORD PTR -12[rbp], 1
.L5:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -24[rbp]
	jl	.L6
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	img_new, .-img_new
	.section	.rodata
.LC2:
	.string	"%d "
	.text
	.globl	read_num
	.type	read_num, @function
read_num:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	jmp	.L9
.L15:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, 35
	jne	.L10
	jmp	.L11
.L13:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, -1
	je	.L18
.L11:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, 10
	jne	.L13
	jmp	.L12
.L18:
	nop
.L12:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, 10
	jmp	.L9
.L10:
	mov	eax, 0
	jmp	.L16
.L9:
	lea	rdx, -12[rbp]
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	test	eax, eax
	je	.L15
	mov	eax, DWORD PTR -12[rbp]
.L16:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	read_num, .-read_num
	.section	.rodata
.LC3:
	.string	"r"
	.text
	.globl	read_ppm
	.type	read_ppm, @function
read_ppm:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 56
	.cfi_offset 3, -24
	mov	QWORD PTR -56[rbp], rdi
	mov	rax, QWORD PTR -56[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	QWORD PTR -32[rbp], 0
	cmp	QWORD PTR -24[rbp], 0
	jne	.L20
	mov	eax, 0
	jmp	.L21
.L20:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	cmp	eax, 80
	jne	.L28
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	cmp	eax, 54
	jne	.L28
	call	__ctype_b_loc@PLT
	mov	rbx, QWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	cdqe
	add	rax, rax
	add	rax, rbx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 8192
	test	eax, eax
	je	.L28
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	read_num
	mov	DWORD PTR -44[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	read_num
	mov	DWORD PTR -40[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	read_num
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	je	.L29
	cmp	DWORD PTR -40[rbp], 0
	je	.L29
	cmp	DWORD PTR -36[rbp], 0
	je	.L29
	mov	edx, DWORD PTR -40[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, edx
	mov	edi, eax
	call	img_new
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	imul	rdx, rax
	mov	rax, rdx
	add	rax, rax
	lea	rsi, [rax+rdx]
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rcx, rdx
	mov	rdx, rsi
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	jmp	.L24
.L28:
	nop
	jmp	.L24
.L29:
	nop
.L24:
	cmp	QWORD PTR -24[rbp], 0
	je	.L27
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L27:
	mov	rax, QWORD PTR -32[rbp]
.L21:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	read_ppm, .-read_ppm
	.globl	del_pixels
	.type	del_pixels, @function
del_pixels:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	DWORD PTR -36[rbp], ecx
	mov	QWORD PTR -48[rbp], r8
	cmp	DWORD PTR -32[rbp], 0
	js	.L38
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jge	.L38
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, DWORD PTR -36[rbp]
	mov	DWORD PTR -12[rbp], eax
	jmp	.L34
.L37:
	cmp	DWORD PTR -12[rbp], 0
	js	.L39
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	add	rax, rcx
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	rdx, QWORD PTR -48[rbp]
	movsx	rcx, eax
	mov	edx, DWORD PTR [rdx+rcx*4]
	lea	ecx, -1[rdx]
	mov	rdx, QWORD PTR -48[rbp]
	cdqe
	mov	DWORD PTR [rdx+rax*4], ecx
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR 1[rax]
	movzx	eax, al
	mov	rdx, QWORD PTR -48[rbp]
	movsx	rcx, eax
	add	rcx, 256
	mov	edx, DWORD PTR [rdx+rcx*4]
	lea	ecx, -1[rdx]
	mov	rdx, QWORD PTR -48[rbp]
	cdqe
	add	rax, 256
	mov	DWORD PTR [rdx+rax*4], ecx
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR 2[rax]
	movzx	eax, al
	mov	rdx, QWORD PTR -48[rbp]
	movsx	rcx, eax
	add	rcx, 512
	mov	edx, DWORD PTR [rdx+rcx*4]
	lea	ecx, -1[rdx]
	mov	rdx, QWORD PTR -48[rbp]
	cdqe
	add	rax, 512
	mov	DWORD PTR [rdx+rax*4], ecx
	mov	rax, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR 3072[rax]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -48[rbp]
	mov	DWORD PTR 3072[rax], edx
	jmp	.L36
.L39:
	nop
.L36:
	add	DWORD PTR -12[rbp], 1
.L34:
	mov	edx, DWORD PTR -28[rbp]
	mov	eax, DWORD PTR -36[rbp]
	add	eax, edx
	cmp	DWORD PTR -12[rbp], eax
	jg	.L30
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	DWORD PTR -12[rbp], eax
	jl	.L37
	jmp	.L30
.L38:
	nop
.L30:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	del_pixels, .-del_pixels
	.globl	add_pixels
	.type	add_pixels, @function
add_pixels:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	DWORD PTR -36[rbp], ecx
	mov	QWORD PTR -48[rbp], r8
	cmp	DWORD PTR -32[rbp], 0
	js	.L48
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jge	.L48
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, DWORD PTR -36[rbp]
	mov	DWORD PTR -12[rbp], eax
	jmp	.L44
.L47:
	cmp	DWORD PTR -12[rbp], 0
	js	.L49
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	add	rax, rcx
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	rdx, QWORD PTR -48[rbp]
	movsx	rcx, eax
	mov	edx, DWORD PTR [rdx+rcx*4]
	lea	ecx, 1[rdx]
	mov	rdx, QWORD PTR -48[rbp]
	cdqe
	mov	DWORD PTR [rdx+rax*4], ecx
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR 1[rax]
	movzx	eax, al
	mov	rdx, QWORD PTR -48[rbp]
	movsx	rcx, eax
	add	rcx, 256
	mov	edx, DWORD PTR [rdx+rcx*4]
	lea	ecx, 1[rdx]
	mov	rdx, QWORD PTR -48[rbp]
	cdqe
	add	rax, 256
	mov	DWORD PTR [rdx+rax*4], ecx
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR 2[rax]
	movzx	eax, al
	mov	rdx, QWORD PTR -48[rbp]
	movsx	rcx, eax
	add	rcx, 512
	mov	edx, DWORD PTR [rdx+rcx*4]
	lea	ecx, 1[rdx]
	mov	rdx, QWORD PTR -48[rbp]
	cdqe
	add	rax, 512
	mov	DWORD PTR [rdx+rax*4], ecx
	mov	rax, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR 3072[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -48[rbp]
	mov	DWORD PTR 3072[rax], edx
	jmp	.L46
.L49:
	nop
.L46:
	add	DWORD PTR -12[rbp], 1
.L44:
	mov	edx, DWORD PTR -28[rbp]
	mov	eax, DWORD PTR -36[rbp]
	add	eax, edx
	cmp	DWORD PTR -12[rbp], eax
	jg	.L40
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	DWORD PTR -12[rbp], eax
	jl	.L47
	jmp	.L40
.L48:
	nop
.L40:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	add_pixels, .-add_pixels
	.globl	init_histo
	.type	init_histo, @function
init_histo:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	QWORD PTR -40[rbp], rcx
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 3076
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L51
.L53:
	mov	rdi, QWORD PTR -40[rbp]
	mov	ecx, DWORD PTR -32[rbp]
	mov	edx, DWORD PTR -4[rbp]
	mov	esi, DWORD PTR -28[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	r8, rdi
	mov	rdi, rax
	call	add_pixels
	add	DWORD PTR -4[rbp], 1
.L51:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -32[rbp]
	jge	.L54
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L53
.L54:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	init_histo, .-init_histo
	.globl	median
	.type	median, @function
median:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -28[rbp], eax
	mov	DWORD PTR -4[rbp], 0
	jmp	.L56
.L58:
	add	DWORD PTR -4[rbp], 1
.L56:
	cmp	DWORD PTR -4[rbp], 255
	jg	.L57
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	sub	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jg	.L58
.L57:
	mov	eax, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	median, .-median
	.globl	median_color
	.type	median_color, @function
median_color:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 3072[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	median
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 3072[rax]
	mov	rdx, QWORD PTR -16[rbp]
	add	rdx, 1024
	mov	esi, eax
	mov	rdi, rdx
	call	median
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 1[rax], dl
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 3072[rax]
	mov	rdx, QWORD PTR -16[rbp]
	add	rdx, 2048
	mov	esi, eax
	mov	rdi, rdx
	call	median
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 2[rax], dl
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	median_color, .-median_color
	.globl	median_filter
	.type	median_filter, @function
median_filter:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 3120
	mov	QWORD PTR -3112[rbp], rdi
	mov	DWORD PTR -3116[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -3112[rbp]
	mov	edx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR -3112[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, edx
	mov	edi, eax
	call	img_new
	mov	QWORD PTR -3096[rbp], rax
	mov	DWORD PTR -3104[rbp], 0
	jmp	.L62
.L67:
	mov	DWORD PTR -3100[rbp], 0
	jmp	.L63
.L66:
	cmp	DWORD PTR -3100[rbp], 0
	jne	.L64
	lea	rcx, -3088[rbp]
	mov	edx, DWORD PTR -3116[rbp]
	mov	esi, DWORD PTR -3104[rbp]
	mov	rax, QWORD PTR -3112[rbp]
	mov	rdi, rax
	call	init_histo
	jmp	.L65
.L64:
	mov	eax, DWORD PTR -3100[rbp]
	sub	eax, DWORD PTR -3116[rbp]
	mov	edx, eax
	lea	rdi, -3088[rbp]
	mov	ecx, DWORD PTR -3116[rbp]
	mov	esi, DWORD PTR -3104[rbp]
	mov	rax, QWORD PTR -3112[rbp]
	mov	r8, rdi
	mov	rdi, rax
	call	del_pixels
	mov	edx, DWORD PTR -3100[rbp]
	mov	eax, DWORD PTR -3116[rbp]
	lea	edi, [rdx+rax]
	lea	rcx, -3088[rbp]
	mov	edx, DWORD PTR -3116[rbp]
	mov	esi, DWORD PTR -3104[rbp]
	mov	rax, QWORD PTR -3112[rbp]
	mov	r8, rcx
	mov	ecx, edx
	mov	edx, edi
	mov	rdi, rax
	call	add_pixels
.L65:
	mov	rax, QWORD PTR -3096[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	eax, DWORD PTR -3104[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -3100[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	lea	rdx, [rcx+rax]
	lea	rax, -3088[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	median_color
	add	DWORD PTR -3100[rbp], 1
.L63:
	mov	rax, QWORD PTR -3112[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -3100[rbp], eax
	jl	.L66
	add	DWORD PTR -3104[rbp], 1
.L62:
	mov	rax, QWORD PTR -3112[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	DWORD PTR -3104[rbp], eax
	jl	.L67
	mov	rax, QWORD PTR -3096[rbp]
	mov	rdi, QWORD PTR -8[rbp]
	sub	rdi, QWORD PTR fs:40
	je	.L69
	call	__stack_chk_fail@PLT
.L69:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	median_filter, .-median_filter
	.section	.rodata
	.align 8
.LC4:
	.string	"Usage: %s size ppm_in ppm_out\n"
.LC5:
	.string	"filter size %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB16:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	cmp	DWORD PTR -36[rbp], 3
	jg	.L71
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	jmp	.L72
.L71:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -20[rbp], 0
	jns	.L73
	mov	DWORD PTR -20[rbp], 1
.L73:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	read_ppm
	mov	QWORD PTR -16[rbp], rax
	mov	edx, DWORD PTR -20[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	median_filter
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 24
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	write_ppm
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
.L72:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.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	"231588.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"w\000"
	.align	2
.LC1:
	.ascii	"P6\012%d %d\012255\012\000"
	.text
	.align	2
	.global	write_ppm
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_ppm, %function
write_ppm:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r1, .L4
	ldr	r0, [fp, #-20]
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L2
	mov	r3, #0
	b	.L3
.L2:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	ldr	r1, .L4+4
	ldr	r0, [fp, #-8]
	bl	fprintf
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #8]
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	mul	r2, r3, r2
	mov	r3, r2
	lsl	r3, r3, #1
	add	r2, r3, r2
	ldr	r3, [fp, #-8]
	mov	r1, #1
	bl	fwrite
	ldr	r0, [fp, #-8]
	bl	fclose
	mov	r3, #1
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	.LC0
	.word	.LC1
	.size	write_ppm, .-write_ppm
	.align	2
	.global	img_new
	.syntax unified
	.arm
	.fpu softvfp
	.type	img_new, %function
img_new:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-20]
	add	r3, r3, #3
	lsl	r1, r3, #2
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-20]
	mul	r2, r3, r2
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	add	r3, r1, r3
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	add	r2, r3, #12
	ldr	r3, [fp, #-8]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-20]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	add	r2, r1, r2
	str	r2, [r3]
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L7
.L8:
	ldr	r3, [fp, #-8]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r2, r3, r2
	ldr	r3, [fp, #-8]
	ldr	r0, [r3, #8]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r0, r3
	add	r2, r1, r2
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L7:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	blt	.L8
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	img_new, .-img_new
	.section	.rodata
	.align	2
.LC2:
	.ascii	"%d \000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_num
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_num, %function
read_num:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	b	.L11
.L17:
	ldr	r0, [fp, #-16]
	bl	fgetc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #35
	bne	.L12
	b	.L13
.L15:
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L20
.L13:
	ldr	r0, [fp, #-16]
	bl	fgetc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #10
	bne	.L15
	b	.L14
.L20:
	nop
.L14:
	ldr	r3, [fp, #-12]
	cmp	r3, #10
	b	.L11
.L12:
	mov	r3, #0
	b	.L18
.L11:
	sub	r3, fp, #12
	mov	r2, r3
	ldr	r1, .L21+4
	ldr	r0, [fp, #-16]
	bl	__isoc99_fscanf
	mov	r3, r0
	cmp	r3, #0
	beq	.L17
	ldr	r3, [fp, #-12]
.L18:
	ldr	r2, .L21
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC3
	.word	.LC2
	.size	read_num, .-read_num
	.section	.rodata
	.align	2
.LC4:
	.ascii	"r\000"
	.text
	.align	2
	.global	read_ppm
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_ppm, %function
read_ppm:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #36
	str	r0, [fp, #-40]
	ldr	r1, .L34
	ldr	r0, [fp, #-40]
	bl	fopen
	str	r0, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L24
	mov	r3, #0
	b	.L25
.L24:
	ldr	r0, [fp, #-28]
	bl	fgetc
	mov	r3, r0
	cmp	r3, #80
	bne	.L32
	ldr	r0, [fp, #-28]
	bl	fgetc
	mov	r3, r0
	cmp	r3, #54
	bne	.L32
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r4, [r3]
	ldr	r0, [fp, #-28]
	bl	fgetc
	mov	r3, r0
	lsl	r3, r3, #1
	add	r3, r4, r3
	ldrh	r3, [r3]
	and	r3, r3, #8192
	cmp	r3, #0
	beq	.L32
	ldr	r0, [fp, #-28]
	bl	read_num
	str	r0, [fp, #-24]
	ldr	r0, [fp, #-28]
	bl	read_num
	str	r0, [fp, #-20]
	ldr	r0, [fp, #-28]
	bl	read_num
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L33
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L33
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L33
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-24]
	bl	img_new
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	ldr	r3, [r3, #8]
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-20]
	mul	r2, r3, r2
	mov	r3, r2
	lsl	r3, r3, #1
	add	r2, r3, r2
	ldr	r3, [fp, #-28]
	mov	r1, #1
	bl	fread
	b	.L28
.L32:
	nop
	b	.L28
.L33:
	nop
.L28:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L31
	ldr	r0, [fp, #-28]
	bl	fclose
.L31:
	ldr	r3, [fp, #-32]
.L25:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L35:
	.align	2
.L34:
	.word	.LC4
	.size	read_ppm, .-read_ppm
	.align	2
	.global	del_pixels
	.syntax unified
	.arm
	.fpu softvfp
	.type	del_pixels, %function
del_pixels:
	@ args = 4, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	blt	.L44
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bge	.L44
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-28]
	sub	r3, r2, r3
	str	r3, [fp, #-12]
	b	.L40
.L43:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	blt	.L45
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	add	r3, r1, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	ldr	r2, [fp, #4]
	ldr	r2, [r2, r3, lsl #2]
	sub	r1, r2, #1
	ldr	r2, [fp, #4]
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3, #1]	@ zero_extendqisi2
	ldr	r2, [fp, #4]
	add	r1, r3, #256
	ldr	r2, [r2, r1, lsl #2]
	sub	r1, r2, #1
	ldr	r2, [fp, #4]
	add	r3, r3, #256
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3, #2]	@ zero_extendqisi2
	ldr	r2, [fp, #4]
	add	r1, r3, #512
	ldr	r2, [r2, r1, lsl #2]
	sub	r1, r2, #1
	ldr	r2, [fp, #4]
	add	r3, r3, #512
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #4]
	ldr	r3, [r3, #3072]
	sub	r2, r3, #1
	ldr	r3, [fp, #4]
	str	r2, [r3, #3072]
	b	.L42
.L45:
	nop
.L42:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L40:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-28]
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bgt	.L36
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L43
	b	.L36
.L44:
	nop
.L36:
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	del_pixels, .-del_pixels
	.align	2
	.global	add_pixels
	.syntax unified
	.arm
	.fpu softvfp
	.type	add_pixels, %function
add_pixels:
	@ args = 4, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	blt	.L54
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bge	.L54
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-28]
	sub	r3, r2, r3
	str	r3, [fp, #-12]
	b	.L50
.L53:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	blt	.L55
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	add	r3, r1, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	ldr	r2, [fp, #4]
	ldr	r2, [r2, r3, lsl #2]
	add	r1, r2, #1
	ldr	r2, [fp, #4]
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3, #1]	@ zero_extendqisi2
	ldr	r2, [fp, #4]
	add	r1, r3, #256
	ldr	r2, [r2, r1, lsl #2]
	add	r1, r2, #1
	ldr	r2, [fp, #4]
	add	r3, r3, #256
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3, #2]	@ zero_extendqisi2
	ldr	r2, [fp, #4]
	add	r1, r3, #512
	ldr	r2, [r2, r1, lsl #2]
	add	r1, r2, #1
	ldr	r2, [fp, #4]
	add	r3, r3, #512
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #4]
	ldr	r3, [r3, #3072]
	add	r2, r3, #1
	ldr	r3, [fp, #4]
	str	r2, [r3, #3072]
	b	.L52
.L55:
	nop
.L52:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L50:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-28]
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bgt	.L46
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L53
	b	.L46
.L54:
	nop
.L46:
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	add_pixels, .-add_pixels
	.align	2
	.global	init_histo
	.syntax unified
	.arm
	.fpu softvfp
	.type	init_histo, %function
init_histo:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	str	r3, [fp, #-28]
	ldr	r2, .L61
	mov	r1, #0
	ldr	r0, [fp, #-28]
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L57
.L59:
	ldr	r3, [fp, #-28]
	str	r3, [sp]
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	add_pixels
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L57:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	bge	.L60
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L59
.L60:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L62:
	.align	2
.L61:
	.word	3076
	.size	init_histo, .-init_histo
	.align	2
	.global	median
	.syntax unified
	.arm
	.fpu softvfp
	.type	median, %function
median:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-20]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L64
.L66:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L64:
	ldr	r3, [fp, #-8]
	cmp	r3, #255
	bgt	.L65
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	sub	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bgt	.L66
.L65:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	median, .-median
	.align	2
	.global	median_color
	.syntax unified
	.arm
	.fpu softvfp
	.type	median_color, %function
median_color:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #3072]
	mov	r1, r3
	mov	r0, r2
	bl	median
	mov	r3, r0
	and	r2, r3, #255
	ldr	r3, [fp, #-8]
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r2, r3, #1024
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #3072]
	mov	r1, r3
	mov	r0, r2
	bl	median
	mov	r3, r0
	and	r2, r3, #255
	ldr	r3, [fp, #-8]
	strb	r2, [r3, #1]
	ldr	r3, [fp, #-12]
	add	r2, r3, #2048
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #3072]
	mov	r1, r3
	mov	r0, r2
	bl	median
	mov	r3, r0
	and	r2, r3, #255
	ldr	r3, [fp, #-8]
	strb	r2, [r3, #2]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	median_color, .-median_color
	.section	.rodata
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	median_filter
	.syntax unified
	.arm
	.fpu softvfp
	.type	median_filter, %function
median_filter:
	@ args = 0, pretend = 0, frame = 3104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #3104
	sub	sp, sp, #8
	str	r0, [fp, #-3104]
	str	r1, [fp, #-3108]
	ldr	r3, .L78
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-3104]
	ldr	r2, [r3]
	ldr	r3, [fp, #-3104]
	ldr	r3, [r3, #4]
	mov	r1, r3
	mov	r0, r2
	bl	img_new
	str	r0, [fp, #-3088]
	mov	r3, #0
	str	r3, [fp, #-3096]
	b	.L70
.L75:
	mov	r3, #0
	str	r3, [fp, #-3092]
	b	.L71
.L74:
	ldr	r3, [fp, #-3092]
	cmp	r3, #0
	bne	.L72
	sub	r3, fp, #3072
	sub	r3, r3, #4
	sub	r3, r3, #8
	ldr	r2, [fp, #-3108]
	ldr	r1, [fp, #-3096]
	ldr	r0, [fp, #-3104]
	bl	init_histo
	b	.L73
.L72:
	ldr	r2, [fp, #-3092]
	ldr	r3, [fp, #-3108]
	sub	r2, r2, r3
	sub	r3, fp, #3072
	sub	r3, r3, #4
	sub	r3, r3, #8
	str	r3, [sp]
	ldr	r3, [fp, #-3108]
	ldr	r1, [fp, #-3096]
	ldr	r0, [fp, #-3104]
	bl	del_pixels
	ldr	r2, [fp, #-3092]
	ldr	r3, [fp, #-3108]
	add	r2, r2, r3
	sub	r3, fp, #3072
	sub	r3, r3, #4
	sub	r3, r3, #8
	str	r3, [sp]
	ldr	r3, [fp, #-3108]
	ldr	r1, [fp, #-3096]
	ldr	r0, [fp, #-3104]
	bl	add_pixels
.L73:
	ldr	r3, [fp, #-3088]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-3096]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-3092]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	add	r2, r1, r3
	sub	r3, fp, #3072
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r1, r3
	mov	r0, r2
	bl	median_color
	ldr	r3, [fp, #-3092]
	add	r3, r3, #1
	str	r3, [fp, #-3092]
.L71:
	ldr	r3, [fp, #-3104]
	ldr	r3, [r3]
	ldr	r2, [fp, #-3092]
	cmp	r2, r3
	blt	.L74
	ldr	r3, [fp, #-3096]
	add	r3, r3, #1
	str	r3, [fp, #-3096]
.L70:
	ldr	r3, [fp, #-3104]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-3096]
	cmp	r2, r3
	blt	.L75
	ldr	r3, [fp, #-3088]
	ldr	r2, .L78
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L77
	bl	__stack_chk_fail
.L77:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L79:
	.align	2
.L78:
	.word	.LC5
	.size	median_filter, .-median_filter
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Usage: %s size ppm_in ppm_out\012\000"
	.align	2
.LC7:
	.ascii	"filter size %d\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-24]
	cmp	r3, #3
	bgt	.L81
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L84
	bl	printf
	mov	r3, #0
	b	.L82
.L81:
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-16]
	ldr	r1, [fp, #-16]
	ldr	r0, .L84+4
	bl	printf
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L83
	mov	r3, #1
	str	r3, [fp, #-16]
.L83:
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	read_ppm
	str	r0, [fp, #-12]
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-12]
	bl	median_filter
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-28]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	write_ppm
	ldr	r0, [fp, #-12]
	bl	free
	ldr	r0, [fp, #-8]
	bl	free
	mov	r3, #0
.L82:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L85:
	.align	2
.L84:
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
