	.file	"372582.c"
	.intel_syntax noprefix
	.text
	.local	width
	.comm	width,4,4
	.local	height
	.comm	height,4,4
	.local	bitmap
	.comm	bitmap,4194304,32
	.local	oldColor
	.comm	oldColor,1,1
	.local	newColor
	.comm	newColor,1,1
	.globl	floodFill
	.type	floodFill, @function
floodFill:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	cmp	DWORD PTR -4[rbp], 0
	js	.L3
	mov	eax, DWORD PTR height[rip]
	cmp	DWORD PTR -4[rbp], eax
	jge	.L3
	cmp	DWORD PTR -8[rbp], 0
	js	.L3
	mov	eax, DWORD PTR width[rip]
	cmp	DWORD PTR -8[rbp], eax
	jge	.L3
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 11
	add	rdx, rax
	lea	rax, bitmap[rip]
	add	rax, rdx
	movzx	edx, BYTE PTR [rax]
	movzx	eax, BYTE PTR oldColor[rip]
	cmp	dl, al
	jne	.L3
	movzx	eax, BYTE PTR newColor[rip]
	mov	edx, DWORD PTR -8[rbp]
	movsx	rcx, edx
	mov	edx, DWORD PTR -4[rbp]
	movsx	rdx, edx
	sal	rdx, 11
	add	rcx, rdx
	lea	rdx, bitmap[rip]
	add	rdx, rcx
	mov	BYTE PTR [rdx], al
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	mov	edi, edx
	call	floodFill
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, 1[rax]
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	mov	edi, edx
	call	floodFill
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, edx
	mov	edi, eax
	call	floodFill
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, 1[rax]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, edx
	mov	edi, eax
	call	floodFill
.L3:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	floodFill, .-floodFill
	.globl	skipLine
	.type	skipLine, @function
skipLine:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	nop
.L6:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	ferror@PLT
	test	eax, eax
	jne	.L7
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	jne	.L7
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	cmp	eax, 10
	jne	.L6
.L7:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	skipLine, .-skipLine
	.globl	skipCommentLines
	.type	skipCommentLines, @function
skipCommentLines:
.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	DWORD PTR -8[rbp], 35
	jmp	.L9
.L10:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	skipLine
.L9:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	je	.L10
	mov	rdx, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	ungetc@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	skipCommentLines, .-skipCommentLines
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%1d"
	.text
	.globl	readPortableBitMap
	.type	readPortableBitMap, @function
readPortableBitMap:
.LFB9:
	.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 -24[rbp]
	mov	rdi, rax
	call	skipLine
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	skipCommentLines
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, width[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	skipCommentLines
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, height[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	skipCommentLines
	mov	eax, DWORD PTR width[rip]
	cmp	eax, 2048
	jg	.L12
	mov	eax, DWORD PTR height[rip]
	cmp	eax, 2048
	jg	.L12
	mov	DWORD PTR -8[rbp], 0
	jmp	.L13
.L16:
	mov	DWORD PTR -4[rbp], 0
	jmp	.L14
.L15:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 11
	add	rdx, rax
	lea	rax, bitmap[rip]
	add	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	add	DWORD PTR -4[rbp], 1
.L14:
	mov	eax, DWORD PTR width[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L15
	add	DWORD PTR -8[rbp], 1
.L13:
	mov	eax, DWORD PTR height[rip]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L16
	jmp	.L18
.L12:
	mov	edi, 1
	call	exit@PLT
.L18:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	readPortableBitMap, .-readPortableBitMap
	.section	.rodata
.LC2:
	.string	"P1\n"
.LC3:
	.string	"%d %d\n"
	.text
	.globl	writePortableBitMap
	.type	writePortableBitMap, @function
writePortableBitMap:
.LFB10:
	.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 -24[rbp]
	mov	rcx, rax
	mov	edx, 3
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	ecx, DWORD PTR height[rip]
	mov	edx, DWORD PTR width[rip]
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	DWORD PTR -8[rbp], 0
	jmp	.L20
.L23:
	mov	DWORD PTR -4[rbp], 0
	jmp	.L21
.L22:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 11
	add	rdx, rax
	lea	rax, bitmap[rip]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	edx, al
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -4[rbp], 1
.L21:
	mov	eax, DWORD PTR width[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L22
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	mov	edi, 10
	call	fputc@PLT
	add	DWORD PTR -8[rbp], 1
.L20:
	mov	eax, DWORD PTR height[rip]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L23
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	writePortableBitMap, .-writePortableBitMap
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	BYTE PTR oldColor[rip], 1
	movzx	eax, BYTE PTR oldColor[rip]
	test	al, al
	sete	al
	mov	BYTE PTR newColor[rip], al
	mov	rax, QWORD PTR stdin[rip]
	mov	rdi, rax
	call	readPortableBitMap
	mov	eax, DWORD PTR width[rip]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	edx, eax
	mov	eax, DWORD PTR height[rip]
	mov	ecx, eax
	shr	ecx, 31
	add	eax, ecx
	sar	eax
	mov	esi, edx
	mov	edi, eax
	call	floodFill
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	writePortableBitMap
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	"372582.c"
	.text
	.local	width
	.comm	width,4,4
	.local	height
	.comm	height,4,4
	.local	bitmap
	.comm	bitmap,4194304,4
	.local	oldColor
	.comm	oldColor,1,1
	.local	newColor
	.comm	newColor,1,1
	.align	2
	.global	floodFill
	.syntax unified
	.arm
	.fpu softvfp
	.type	floodFill, %function
floodFill:
	@ 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	r3, [fp, #-8]
	cmp	r3, #0
	blt	.L3
	ldr	r3, .L4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bge	.L3
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	blt	.L3
	ldr	r3, .L4+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bge	.L3
	ldr	r2, .L4+8
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #11
	add	r2, r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, .L4+12
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r2, r3
	bne	.L3
	ldr	r3, .L4+16
	ldrb	r1, [r3]	@ zero_extendqisi2
	ldr	r2, .L4+8
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #11
	add	r2, r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	ldr	r1, [fp, #-12]
	mov	r0, r3
	bl	floodFill
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r1, [fp, #-12]
	mov	r0, r3
	bl	floodFill
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	floodFill
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	floodFill
.L3:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	height
	.word	width
	.word	bitmap
	.word	oldColor
	.word	newColor
	.size	floodFill, .-floodFill
	.align	2
	.global	skipLine
	.syntax unified
	.arm
	.fpu softvfp
	.type	skipLine, %function
skipLine:
	@ 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]
	nop
.L8:
	ldr	r0, [fp, #-8]
	bl	ferror
	mov	r3, r0
	cmp	r3, #0
	bne	.L9
	ldr	r0, [fp, #-8]
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	bne	.L9
	ldr	r0, [fp, #-8]
	bl	fgetc
	mov	r3, r0
	cmp	r3, #10
	bne	.L8
.L9:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	skipLine, .-skipLine
	.align	2
	.global	skipCommentLines
	.syntax unified
	.arm
	.fpu softvfp
	.type	skipCommentLines, %function
skipCommentLines:
	@ 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]
	mov	r3, #35
	str	r3, [fp, #-12]
	b	.L11
.L12:
	ldr	r0, [fp, #-16]
	bl	skipLine
.L11:
	ldr	r0, [fp, #-16]
	bl	fgetc
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	beq	.L12
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-8]
	bl	ungetc
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	skipCommentLines, .-skipCommentLines
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d\000"
	.align	2
.LC1:
	.ascii	"%1d\000"
	.text
	.align	2
	.global	readPortableBitMap
	.syntax unified
	.arm
	.fpu softvfp
	.type	readPortableBitMap, %function
readPortableBitMap:
	@ 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	r0, [fp, #-16]
	bl	skipLine
	ldr	r0, [fp, #-16]
	bl	skipCommentLines
	ldr	r2, .L21
	ldr	r1, .L21+4
	ldr	r0, [fp, #-16]
	bl	__isoc99_fscanf
	ldr	r0, [fp, #-16]
	bl	skipCommentLines
	ldr	r2, .L21+8
	ldr	r1, .L21+4
	ldr	r0, [fp, #-16]
	bl	__isoc99_fscanf
	ldr	r0, [fp, #-16]
	bl	skipCommentLines
	ldr	r3, .L21
	ldr	r3, [r3]
	cmp	r3, #2048
	bgt	.L14
	ldr	r3, .L21+8
	ldr	r3, [r3]
	cmp	r3, #2048
	bgt	.L14
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L15
.L18:
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L16
.L17:
	ldr	r3, [fp, #-12]
	lsl	r2, r3, #11
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, .L21+12
	add	r3, r3, r2
	mov	r2, r3
	ldr	r1, .L21+16
	ldr	r0, [fp, #-16]
	bl	__isoc99_fscanf
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L16:
	ldr	r3, .L21
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L17
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L15:
	ldr	r3, .L21+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L18
	b	.L20
.L14:
	mov	r0, #1
	bl	exit
.L20:
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	width
	.word	.LC0
	.word	height
	.word	bitmap
	.word	.LC1
	.size	readPortableBitMap, .-readPortableBitMap
	.section	.rodata
	.align	2
.LC2:
	.ascii	"P1\012\000"
	.align	2
.LC3:
	.ascii	"%d %d\012\000"
	.text
	.align	2
	.global	writePortableBitMap
	.syntax unified
	.arm
	.fpu softvfp
	.type	writePortableBitMap, %function
writePortableBitMap:
	@ 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, [fp, #-16]
	mov	r2, #3
	mov	r1, #1
	ldr	r0, .L28
	bl	fwrite
	ldr	r3, .L28+4
	ldr	r2, [r3]
	ldr	r3, .L28+8
	ldr	r3, [r3]
	ldr	r1, .L28+12
	ldr	r0, [fp, #-16]
	bl	fprintf
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L24
.L27:
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L25
.L26:
	ldr	r2, .L28+16
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #11
	add	r2, r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r1, .L28+20
	ldr	r0, [fp, #-16]
	bl	fprintf
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L25:
	ldr	r3, .L28+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L26
	ldr	r1, [fp, #-16]
	mov	r0, #10
	bl	fputc
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L24:
	ldr	r3, .L28+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L27
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC2
	.word	width
	.word	height
	.word	.LC3
	.word	bitmap
	.word	.LC1
	.size	writePortableBitMap, .-writePortableBitMap
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L32
	mov	r2, #1
	strb	r2, [r3]
	ldr	r3, .L32
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	ldr	r3, .L32+4
	strb	r2, [r3]
	ldr	r3, .L32+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	readPortableBitMap
	ldr	r3, .L32+12
	ldr	r3, [r3]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r0, r3
	ldr	r3, .L32+16
	ldr	r3, [r3]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r1, r3
	bl	floodFill
	ldr	r3, .L32+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	writePortableBitMap
	mov	r3, #0
	mov	r0, r3
	pop	{fp, pc}
.L33:
	.align	2
.L32:
	.word	oldColor
	.word	newColor
	.word	stdin
	.word	height
	.word	width
	.word	stdout
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
