	.file	"392594.c"
	.intel_syntax noprefix
	.text
	.globl	INPUT_FILE
	.section	.rodata
	.type	INPUT_FILE, @object
	.size	INPUT_FILE, 6
INPUT_FILE:
	.string	"input"
	.globl	width
	.bss
	.align 4
	.type	width, @object
	.size	width, 4
width:
	.zero	4
	.globl	height
	.align 4
	.type	height, @object
	.size	height, 4
height:
	.zero	4
	.text
	.globl	get_basin
	.type	get_basin, @function
get_basin:
.LFB6:
	.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, 40
	.cfi_offset 3, -24
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	DWORD PTR -48[rbp], edx
	mov	eax, DWORD PTR height[rip]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -24[rbp], rdx
	movsx	rdx, eax
	mov	rcx, rdx
	mov	ebx, 0
	cmp	DWORD PTR -44[rbp], 0
	js	.L2
	cmp	DWORD PTR -48[rbp], 0
	js	.L2
	mov	edx, DWORD PTR width[rip]
	cmp	DWORD PTR -44[rbp], edx
	jge	.L2
	mov	edx, DWORD PTR height[rip]
	cmp	DWORD PTR -48[rbp], edx
	jl	.L3
.L2:
	mov	eax, 0
	jmp	.L4
.L3:
	mov	edx, DWORD PTR -44[rbp]
	movsx	rcx, edx
	movsx	rdx, eax
	imul	rdx, rcx
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -40[rbp]
	add	rcx, rdx
	mov	edx, DWORD PTR -48[rbp]
	movsx	rdx, edx
	mov	edx, DWORD PTR [rcx+rdx*4]
	cmp	edx, 9
	jne	.L5
	mov	eax, 0
	jmp	.L4
.L5:
	mov	edx, DWORD PTR -44[rbp]
	movsx	rcx, edx
	movsx	rdx, eax
	imul	rdx, rcx
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -40[rbp]
	add	rcx, rdx
	mov	edx, DWORD PTR -48[rbp]
	movsx	rdx, edx
	mov	edx, DWORD PTR [rcx+rdx*4]
	cmp	edx, -1
	jne	.L6
	mov	eax, 0
	jmp	.L4
.L6:
	mov	edx, DWORD PTR -44[rbp]
	movsx	rdx, edx
	cdqe
	imul	rax, rdx
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	mov	DWORD PTR [rdx+rax*4], -1
	mov	DWORD PTR -28[rbp], 1
	mov	eax, DWORD PTR -44[rbp]
	lea	ecx, 1[rax]
	mov	edx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	get_basin
	add	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -44[rbp]
	lea	ecx, -1[rax]
	mov	edx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	get_basin
	add	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -48[rbp]
	lea	edx, 1[rax]
	mov	ecx, DWORD PTR -44[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	get_basin
	add	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -48[rbp]
	lea	edx, -1[rax]
	mov	ecx, DWORD PTR -44[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	get_basin
	add	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
.L4:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_basin, .-get_basin
	.section	.rodata
.LC0:
	.string	"%02d "
	.text
	.globl	print_map
	.type	print_map, @function
print_map:
.LFB7:
	.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, 40
	.cfi_offset 3, -24
	mov	QWORD PTR -40[rbp], rdi
	mov	ebx, DWORD PTR height[rip]
	movsx	rax, ebx
	sub	rax, 1
	mov	QWORD PTR -24[rbp], rax
	movsx	rax, ebx
	mov	r8, rax
	mov	r9d, 0
	mov	DWORD PTR -28[rbp], 0
	jmp	.L8
.L11:
	mov	DWORD PTR -32[rbp], 0
	jmp	.L9
.L10:
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	movsx	rax, ebx
	imul	rax, rdx
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	mov	eax, DWORD PTR [rdx+rax*4]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -32[rbp], 1
.L9:
	mov	eax, DWORD PTR width[rip]
	cmp	DWORD PTR -32[rbp], eax
	jl	.L10
	mov	edi, 10
	call	putchar@PLT
	add	DWORD PTR -28[rbp], 1
.L8:
	mov	eax, DWORD PTR height[rip]
	cmp	DWORD PTR -28[rbp], eax
	jl	.L11
	nop
	nop
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	print_map, .-print_map
	.section	.rodata
.LC1:
	.string	"r"
.LC2:
	.string	"res: %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 472
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	lea	rsi, .LC1[rip]
	lea	rdi, INPUT_FILE[rip]
	call	fopen@PLT
	mov	QWORD PTR -328[rbp], rax
	cmp	QWORD PTR -328[rbp], 0
	jne	.L15
	mov	eax, 1
	jmp	.L43
.L16:
	lea	rax, -256[rbp]
	mov	rdi, rax
	call	strlen@PLT
	sub	eax, 1
	mov	DWORD PTR width[rip], eax
	mov	eax, DWORD PTR height[rip]
	add	eax, 1
	mov	DWORD PTR height[rip], eax
.L15:
	mov	rax, QWORD PTR -328[rbp]
	lea	rcx, -256[rbp]
	mov	rdx, rax
	mov	esi, 200
	mov	rdi, rcx
	call	fgets@PLT
	test	rax, rax
	jne	.L16
	mov	rax, QWORD PTR -328[rbp]
	mov	rdi, rax
	call	rewind@PLT
	mov	esi, DWORD PTR height[rip]
	mov	edi, DWORD PTR width[rip]
	mov	rax, rsp
	mov	QWORD PTR -504[rbp], rax
	movsx	rax, esi
	sub	rax, 1
	mov	QWORD PTR -320[rbp], rax
	movsx	rax, esi
	mov	QWORD PTR -384[rbp], rax
	mov	QWORD PTR -376[rbp], 0
	movsx	rax, esi
	sal	rax, 2
	mov	QWORD PTR -384[rbp], rax
	movsx	rax, edi
	sub	rax, 1
	mov	QWORD PTR -312[rbp], rax
	movsx	rax, esi
	mov	r14, rax
	mov	r15d, 0
	movsx	rax, edi
	mov	r12, rax
	mov	r13d, 0
	mov	rdx, r15
	imul	rdx, r12
	mov	rax, r13
	imul	rax, r14
	lea	rcx, [rdx+rax]
	mov	rax, r14
	mul	r12
	add	rcx, rdx
	mov	rdx, rcx
	movsx	rax, esi
	mov	QWORD PTR -400[rbp], rax
	mov	QWORD PTR -392[rbp], 0
	movsx	rax, edi
	mov	QWORD PTR -416[rbp], rax
	mov	QWORD PTR -408[rbp], 0
	mov	r8, QWORD PTR -400[rbp]
	mov	r9, QWORD PTR -392[rbp]
	mov	rdx, r9
	mov	r10, QWORD PTR -416[rbp]
	mov	r11, QWORD PTR -408[rbp]
	imul	rdx, r10
	mov	rax, r11
	imul	rax, r8
	lea	rcx, [rdx+rax]
	mov	rax, r8
	mul	r10
	add	rcx, rdx
	mov	rdx, rcx
	movsx	rdx, esi
	movsx	rax, edi
	imul	rax, rdx
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	ebx, 16
	mov	edx, 0
	div	rbx
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L17:
	cmp	rsp, rdx
	je	.L18
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L17
.L18:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L19
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L19:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -304[rbp], rax
	mov	DWORD PTR -340[rbp], 0
	jmp	.L20
.L23:
	mov	DWORD PTR -344[rbp], 0
	jmp	.L21
.L22:
	mov	rax, QWORD PTR -328[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -357[rbp], al
	mov	rbx, QWORD PTR -384[rbp]
	shr	rbx, 2
	lea	rax, -357[rbp]
	mov	rdi, rax
	call	atoi@PLT
	mov	edx, eax
	mov	rsi, QWORD PTR -304[rbp]
	mov	eax, DWORD PTR -340[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -344[rbp]
	cdqe
	imul	rax, rbx
	add	rax, rcx
	mov	DWORD PTR [rsi+rax*4], edx
	add	DWORD PTR -344[rbp], 1
.L21:
	mov	eax, DWORD PTR width[rip]
	cmp	DWORD PTR -344[rbp], eax
	jl	.L22
	mov	rax, QWORD PTR -328[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	add	DWORD PTR -340[rbp], 1
.L20:
	mov	eax, DWORD PTR height[rip]
	cmp	DWORD PTR -340[rbp], eax
	jl	.L23
	mov	QWORD PTR -268[rbp], 0
	mov	DWORD PTR -260[rbp], 0
	mov	DWORD PTR -348[rbp], 0
	jmp	.L24
.L42:
	mov	DWORD PTR -352[rbp], 0
	jmp	.L25
.L41:
	mov	DWORD PTR -356[rbp], 0
	mov	rdx, QWORD PTR -384[rbp]
	shr	rdx, 2
	mov	rcx, QWORD PTR -304[rbp]
	mov	eax, DWORD PTR -348[rbp]
	movsx	rsi, eax
	mov	eax, DWORD PTR -352[rbp]
	cdqe
	imul	rax, rdx
	add	rax, rsi
	mov	eax, DWORD PTR [rcx+rax*4]
	mov	DWORD PTR -336[rbp], eax
	cmp	DWORD PTR -352[rbp], 0
	jne	.L26
	add	DWORD PTR -356[rbp], 1
.L26:
	mov	eax, DWORD PTR width[rip]
	sub	eax, 1
	cmp	DWORD PTR -352[rbp], eax
	jne	.L27
	add	DWORD PTR -356[rbp], 1
.L27:
	cmp	DWORD PTR -348[rbp], 0
	jne	.L28
	add	DWORD PTR -356[rbp], 1
.L28:
	mov	eax, DWORD PTR height[rip]
	sub	eax, 1
	cmp	DWORD PTR -348[rbp], eax
	jne	.L29
	add	DWORD PTR -356[rbp], 1
.L29:
	cmp	DWORD PTR -352[rbp], 0
	jle	.L30
	mov	rcx, QWORD PTR -384[rbp]
	shr	rcx, 2
	mov	eax, DWORD PTR -352[rbp]
	lea	edx, -1[rax]
	mov	rsi, QWORD PTR -304[rbp]
	mov	eax, DWORD PTR -348[rbp]
	movsx	rdi, eax
	movsx	rax, edx
	imul	rax, rcx
	add	rax, rdi
	mov	eax, DWORD PTR [rsi+rax*4]
	cmp	DWORD PTR -336[rbp], eax
	jge	.L30
	add	DWORD PTR -356[rbp], 1
.L30:
	mov	eax, DWORD PTR width[rip]
	sub	eax, 1
	cmp	DWORD PTR -352[rbp], eax
	jge	.L31
	mov	rcx, QWORD PTR -384[rbp]
	shr	rcx, 2
	mov	eax, DWORD PTR -352[rbp]
	lea	edx, 1[rax]
	mov	rsi, QWORD PTR -304[rbp]
	mov	eax, DWORD PTR -348[rbp]
	movsx	rdi, eax
	movsx	rax, edx
	imul	rax, rcx
	add	rax, rdi
	mov	eax, DWORD PTR [rsi+rax*4]
	cmp	DWORD PTR -336[rbp], eax
	jge	.L31
	add	DWORD PTR -356[rbp], 1
.L31:
	cmp	DWORD PTR -348[rbp], 0
	jle	.L32
	mov	rdx, QWORD PTR -384[rbp]
	shr	rdx, 2
	mov	eax, DWORD PTR -348[rbp]
	sub	eax, 1
	mov	rcx, QWORD PTR -304[rbp]
	movsx	rsi, eax
	mov	eax, DWORD PTR -352[rbp]
	cdqe
	imul	rax, rdx
	add	rax, rsi
	mov	eax, DWORD PTR [rcx+rax*4]
	cmp	DWORD PTR -336[rbp], eax
	jge	.L32
	add	DWORD PTR -356[rbp], 1
.L32:
	mov	eax, DWORD PTR height[rip]
	sub	eax, 1
	cmp	DWORD PTR -348[rbp], eax
	jge	.L33
	mov	rdx, QWORD PTR -384[rbp]
	shr	rdx, 2
	mov	eax, DWORD PTR -348[rbp]
	add	eax, 1
	mov	rcx, QWORD PTR -304[rbp]
	movsx	rsi, eax
	mov	eax, DWORD PTR -352[rbp]
	cdqe
	imul	rax, rdx
	add	rax, rsi
	mov	eax, DWORD PTR [rcx+rax*4]
	cmp	DWORD PTR -336[rbp], eax
	jge	.L33
	add	DWORD PTR -356[rbp], 1
.L33:
	cmp	DWORD PTR -356[rbp], 4
	jne	.L34
	mov	rax, rsp
	mov	rbx, rax
	mov	esi, DWORD PTR height[rip]
	mov	edi, DWORD PTR width[rip]
	movsx	rax, esi
	sub	rax, 1
	mov	QWORD PTR -296[rbp], rax
	movsx	rax, esi
	mov	QWORD PTR -496[rbp], rax
	mov	QWORD PTR -488[rbp], 0
	movsx	rax, edi
	sub	rax, 1
	mov	QWORD PTR -288[rbp], rax
	movsx	rax, esi
	mov	QWORD PTR -432[rbp], rax
	mov	QWORD PTR -424[rbp], 0
	movsx	rax, edi
	mov	QWORD PTR -448[rbp], rax
	mov	QWORD PTR -440[rbp], 0
	mov	r10, QWORD PTR -432[rbp]
	mov	r11, QWORD PTR -424[rbp]
	mov	rdx, r11
	mov	r8, QWORD PTR -448[rbp]
	mov	r9, QWORD PTR -440[rbp]
	imul	rdx, r8
	mov	rax, r9
	imul	rax, r10
	lea	rcx, [rdx+rax]
	mov	rax, r10
	mul	r8
	add	rcx, rdx
	mov	rdx, rcx
	movsx	rax, esi
	mov	QWORD PTR -464[rbp], rax
	mov	QWORD PTR -456[rbp], 0
	movsx	rax, edi
	mov	QWORD PTR -480[rbp], rax
	mov	QWORD PTR -472[rbp], 0
	mov	r8, QWORD PTR -464[rbp]
	mov	r9, QWORD PTR -456[rbp]
	mov	rdx, r9
	mov	r14, QWORD PTR -480[rbp]
	mov	r15, QWORD PTR -472[rbp]
	imul	rdx, r14
	mov	rax, r15
	imul	rax, r8
	lea	rcx, [rdx+rax]
	mov	rax, r8
	mul	r14
	add	rcx, rdx
	mov	rdx, rcx
	movsx	rdx, esi
	movsx	rax, edi
	imul	rax, rdx
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	edi, 16
	mov	edx, 0
	div	rdi
	imul	rdx, rax, 16
	mov	rax, rdx
	and	rax, -4096
	mov	rcx, rsp
	sub	rcx, rax
.L35:
	cmp	rsp, rcx
	je	.L36
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L35
.L36:
	mov	rax, rdx
	and	eax, 4095
	sub	rsp, rax
	mov	rax, rdx
	and	eax, 4095
	test	rax, rax
	je	.L37
	mov	rax, rdx
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L37:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -280[rbp], rax
	mov	edx, DWORD PTR width[rip]
	mov	eax, DWORD PTR height[rip]
	imul	eax, edx
	cdqe
	sal	rax, 2
	mov	rsi, QWORD PTR -304[rbp]
	mov	rcx, QWORD PTR -280[rbp]
	mov	rdx, rax
	mov	rdi, rcx
	call	memcpy@PLT
	mov	eax, DWORD PTR -348[rbp]
	mov	esi, DWORD PTR -352[rbp]
	mov	rcx, QWORD PTR -280[rbp]
	mov	edx, eax
	mov	rdi, rcx
	call	get_basin
	mov	DWORD PTR -332[rbp], eax
	mov	eax, DWORD PTR -268[rbp]
	cmp	DWORD PTR -332[rbp], eax
	jle	.L38
	mov	eax, DWORD PTR -264[rbp]
	mov	DWORD PTR -260[rbp], eax
	mov	eax, DWORD PTR -268[rbp]
	mov	DWORD PTR -264[rbp], eax
	mov	eax, DWORD PTR -332[rbp]
	mov	DWORD PTR -268[rbp], eax
	jmp	.L39
.L38:
	mov	eax, DWORD PTR -264[rbp]
	cmp	DWORD PTR -332[rbp], eax
	jle	.L40
	mov	eax, DWORD PTR -264[rbp]
	mov	DWORD PTR -260[rbp], eax
	mov	eax, DWORD PTR -332[rbp]
	mov	DWORD PTR -264[rbp], eax
	jmp	.L39
.L40:
	mov	eax, DWORD PTR -260[rbp]
	cmp	DWORD PTR -332[rbp], eax
	jle	.L39
	mov	eax, DWORD PTR -332[rbp]
	mov	DWORD PTR -260[rbp], eax
.L39:
	mov	rsp, rbx
.L34:
	add	DWORD PTR -352[rbp], 1
.L25:
	mov	eax, DWORD PTR width[rip]
	cmp	DWORD PTR -352[rbp], eax
	jl	.L41
	add	DWORD PTR -348[rbp], 1
.L24:
	mov	eax, DWORD PTR height[rip]
	cmp	DWORD PTR -348[rbp], eax
	jl	.L42
	mov	edx, DWORD PTR -268[rbp]
	mov	eax, DWORD PTR -264[rbp]
	imul	edx, eax
	mov	eax, DWORD PTR -260[rbp]
	imul	eax, edx
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rsp, QWORD PTR -504[rbp]
.L43:
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"392594.c"
	.text
	.global	INPUT_FILE
	.section	.rodata
	.align	2
	.type	INPUT_FILE, %object
	.size	INPUT_FILE, 6
INPUT_FILE:
	.ascii	"input\000"
	.global	width
	.bss
	.align	2
	.type	width, %object
	.size	width, 4
width:
	.space	4
	.global	height
	.align	2
	.type	height, %object
	.size	height, 4
height:
	.space	4
	.text
	.align	2
	.global	get_basin
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_basin, %function
get_basin:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, .L7
	ldr	ip, [r3]
	sub	r3, ip, #1
	str	r3, [fp, #-12]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	blt	.L2
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	blt	.L2
	ldr	r3, .L7+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bge	.L2
	ldr	r3, .L7
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L3
.L2:
	mov	r3, #0
	b	.L4
.L3:
	mov	r2, ip
	ldr	r3, [fp, #-20]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [fp, #-24]
	ldr	r3, [r3, r2, lsl #2]
	cmp	r3, #9
	bne	.L5
	mov	r3, #0
	b	.L4
.L5:
	mov	r2, ip
	ldr	r3, [fp, #-20]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [fp, #-24]
	ldr	r3, [r3, r2, lsl #2]
	cmn	r3, #1
	bne	.L6
	mov	r3, #0
	b	.L4
.L6:
	mov	r2, ip
	ldr	r3, [fp, #-20]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [fp, #-24]
	mvn	r1, #0
	str	r1, [r3, r2, lsl #2]
	mov	r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	ldr	r2, [fp, #-24]
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	get_basin
	mov	r2, r0
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	get_basin
	mov	r2, r0
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	get_basin
	mov	r2, r0
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	sub	r3, r3, #1
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	get_basin
	mov	r2, r0
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
.L4:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	height
	.word	width
	.size	get_basin, .-get_basin
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%02d \000"
	.text
	.align	2
	.global	print_map
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_map, %function
print_map:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-32]
	ldr	r3, .L14
	ldr	r4, [r3]
	sub	r3, r4, #1
	str	r3, [fp, #-16]
	mov	r3, r4
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L10
.L13:
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L11
.L12:
	mov	r2, r4
	ldr	r3, [fp, #-24]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, r3
	ldr	r0, .L14+4
	bl	printf
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L11:
	ldr	r3, .L14+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L12
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L10:
	ldr	r3, .L14
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L13
	nop
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L15:
	.align	2
.L14:
	.word	height
	.word	.LC0
	.word	width
	.size	print_map, .-print_map
	.section	.rodata
	.align	2
.LC1:
	.ascii	"r\000"
	.align	2
.LC2:
	.ascii	"res: %d\012\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 280
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #280
	ldr	r3, .L43
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	ldr	r1, .L43+4
	ldr	r0, .L43+8
	bl	fopen
	str	r0, [fp, #-280]
	ldr	r3, [fp, #-280]
	cmp	r3, #0
	bne	.L19
	mov	r3, #1
	b	.L41
.L20:
	sub	r3, fp, #232
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	mov	r2, r3
	ldr	r3, .L43+12
	str	r2, [r3]
	ldr	r3, .L43+16
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L43+16
	str	r3, [r2]
.L19:
	sub	r3, fp, #232
	ldr	r2, [fp, #-280]
	mov	r1, #200
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L20
	ldr	r0, [fp, #-280]
	bl	rewind
	ldr	r3, .L43+16
	ldr	ip, [r3]
	ldr	r3, .L43+12
	ldr	lr, [r3]
	mov	r3, sp
	mov	r8, r3
	sub	r3, ip, #1
	str	r3, [fp, #-276]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r6, r3, #2
	sub	r3, lr, #1
	str	r3, [fp, #-272]
	mov	r3, ip
	mov	r4, r3
	mov	r5, #0
	mov	r3, lr
	mov	r0, r3
	mov	r1, #0
	mul	r2, r0, r5
	mul	r3, r4, r1
	add	r7, r2, r3
	umull	r2, r3, r4, r0
	add	r1, r7, r3
	mov	r3, r1
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #5
	orr	r1, r1, r2, lsr #27
	lsl	r0, r2, #5
	mov	r3, ip
	mov	r4, r3
	mov	r5, #0
	mov	r3, lr
	mov	r0, r3
	mov	r1, #0
	mul	r2, r0, r5
	mul	r3, r4, r1
	add	r7, r2, r3
	umull	r2, r3, r4, r0
	add	r1, r7, r3
	mov	r3, r1
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #5
	orr	r1, r1, r2, lsr #27
	lsl	r0, r2, #5
	mov	r3, ip
	mov	r2, lr
	mul	r3, r2, r3
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-268]
	mov	r3, #0
	str	r3, [fp, #-284]
	b	.L21
.L24:
	mov	r3, #0
	str	r3, [fp, #-288]
	b	.L22
.L23:
	ldr	r0, [fp, #-280]
	bl	fgetc
	mov	r3, r0
	and	r3, r3, #255
	strb	r3, [fp, #-301]
	lsr	r4, r6, #2
	sub	r3, fp, #300
	sub	r3, r3, #1
	mov	r0, r3
	bl	atoi
	ldr	r3, [fp, #-268]
	ldr	r2, [fp, #-288]
	mul	r1, r2, r4
	ldr	r2, [fp, #-284]
	add	r2, r1, r2
	str	r0, [r3, r2, lsl #2]
	ldr	r3, [fp, #-288]
	add	r3, r3, #1
	str	r3, [fp, #-288]
.L22:
	ldr	r3, .L43+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-288]
	cmp	r2, r3
	blt	.L23
	ldr	r0, [fp, #-280]
	bl	fgetc
	ldr	r3, [fp, #-284]
	add	r3, r3, #1
	str	r3, [fp, #-284]
.L21:
	ldr	r3, .L43+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-284]
	cmp	r2, r3
	blt	.L24
	sub	r3, fp, #244
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
	str	r2, [r3, #8]
	mov	r3, #0
	str	r3, [fp, #-292]
	b	.L25
.L40:
	mov	r3, #0
	str	r3, [fp, #-296]
	b	.L26
.L39:
	mov	r3, #0
	str	r3, [fp, #-300]
	lsr	r2, r6, #2
	ldr	r3, [fp, #-268]
	ldr	r1, [fp, #-296]
	mul	r1, r2, r1
	ldr	r2, [fp, #-292]
	add	r2, r1, r2
	ldr	r3, [r3, r2, lsl #2]
	str	r3, [fp, #-264]
	ldr	r3, [fp, #-296]
	cmp	r3, #0
	bne	.L27
	ldr	r3, [fp, #-300]
	add	r3, r3, #1
	str	r3, [fp, #-300]
.L27:
	ldr	r3, .L43+12
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, [fp, #-296]
	cmp	r2, r3
	bne	.L28
	ldr	r3, [fp, #-300]
	add	r3, r3, #1
	str	r3, [fp, #-300]
.L28:
	ldr	r3, [fp, #-292]
	cmp	r3, #0
	bne	.L29
	ldr	r3, [fp, #-300]
	add	r3, r3, #1
	str	r3, [fp, #-300]
.L29:
	ldr	r3, .L43+16
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, [fp, #-292]
	cmp	r2, r3
	bne	.L30
	ldr	r3, [fp, #-300]
	add	r3, r3, #1
	str	r3, [fp, #-300]
.L30:
	ldr	r3, [fp, #-296]
	cmp	r3, #0
	ble	.L31
	lsr	r2, r6, #2
	ldr	r3, [fp, #-296]
	sub	r1, r3, #1
	ldr	r3, [fp, #-268]
	mul	r1, r2, r1
	ldr	r2, [fp, #-292]
	add	r2, r1, r2
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, [fp, #-264]
	cmp	r2, r3
	bge	.L31
	ldr	r3, [fp, #-300]
	add	r3, r3, #1
	str	r3, [fp, #-300]
.L31:
	ldr	r3, .L43+12
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, [fp, #-296]
	cmp	r2, r3
	bge	.L32
	lsr	r2, r6, #2
	ldr	r3, [fp, #-296]
	add	r1, r3, #1
	ldr	r3, [fp, #-268]
	mul	r1, r2, r1
	ldr	r2, [fp, #-292]
	add	r2, r1, r2
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, [fp, #-264]
	cmp	r2, r3
	bge	.L32
	ldr	r3, [fp, #-300]
	add	r3, r3, #1
	str	r3, [fp, #-300]
.L32:
	ldr	r3, [fp, #-292]
	cmp	r3, #0
	ble	.L33
	lsr	r1, r6, #2
	ldr	r3, [fp, #-292]
	sub	r2, r3, #1
	ldr	r3, [fp, #-268]
	ldr	r0, [fp, #-296]
	mul	r1, r0, r1
	add	r2, r1, r2
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, [fp, #-264]
	cmp	r2, r3
	bge	.L33
	ldr	r3, [fp, #-300]
	add	r3, r3, #1
	str	r3, [fp, #-300]
.L33:
	ldr	r3, .L43+16
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, [fp, #-292]
	cmp	r2, r3
	bge	.L34
	lsr	r1, r6, #2
	ldr	r3, [fp, #-292]
	add	r2, r3, #1
	ldr	r3, [fp, #-268]
	ldr	r0, [fp, #-296]
	mul	r1, r0, r1
	add	r2, r1, r2
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, [fp, #-264]
	cmp	r2, r3
	bge	.L34
	ldr	r3, [fp, #-300]
	add	r3, r3, #1
	str	r3, [fp, #-300]
.L34:
	ldr	r3, [fp, #-300]
	cmp	r3, #4
	bne	.L35
	mov	r3, sp
	mov	r9, r3
	ldr	r3, .L43+16
	ldr	ip, [r3]
	ldr	r3, .L43+12
	ldr	lr, [r3]
	sub	r3, ip, #1
	str	r3, [fp, #-260]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	sub	r3, lr, #1
	str	r3, [fp, #-256]
	mov	r3, ip
	mov	r4, r3
	mov	r5, #0
	mov	r3, lr
	mov	r0, r3
	mov	r1, #0
	mul	r2, r0, r5
	mul	r3, r4, r1
	add	r7, r2, r3
	umull	r2, r3, r4, r0
	add	r1, r7, r3
	mov	r3, r1
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #5
	orr	r1, r1, r2, lsr #27
	lsl	r0, r2, #5
	mov	r3, ip
	mov	r4, r3
	mov	r5, #0
	mov	r3, lr
	mov	r0, r3
	mov	r1, #0
	mul	r2, r0, r5
	mul	r3, r4, r1
	add	r7, r2, r3
	umull	r2, r3, r4, r0
	add	r1, r7, r3
	mov	r3, r1
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #5
	orr	r1, r1, r2, lsr #27
	lsl	r0, r2, #5
	mov	r3, ip
	mov	r2, lr
	mul	r3, r2, r3
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-252]
	ldr	r3, .L43+12
	ldr	r3, [r3]
	ldr	r2, .L43+16
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r1, [fp, #-268]
	ldr	r0, [fp, #-252]
	bl	memcpy
	ldr	r2, [fp, #-292]
	ldr	r1, [fp, #-296]
	ldr	r0, [fp, #-252]
	bl	get_basin
	str	r0, [fp, #-248]
	ldr	r3, [fp, #-244]
	ldr	r2, [fp, #-248]
	cmp	r2, r3
	ble	.L36
	ldr	r3, [fp, #-240]
	str	r3, [fp, #-236]
	ldr	r3, [fp, #-244]
	str	r3, [fp, #-240]
	ldr	r3, [fp, #-248]
	str	r3, [fp, #-244]
	b	.L37
.L36:
	ldr	r3, [fp, #-240]
	ldr	r2, [fp, #-248]
	cmp	r2, r3
	ble	.L38
	ldr	r3, [fp, #-240]
	str	r3, [fp, #-236]
	ldr	r3, [fp, #-248]
	str	r3, [fp, #-240]
	b	.L37
.L38:
	ldr	r3, [fp, #-236]
	ldr	r2, [fp, #-248]
	cmp	r2, r3
	ble	.L37
	ldr	r3, [fp, #-248]
	str	r3, [fp, #-236]
.L37:
	mov	sp, r9
.L35:
	ldr	r3, [fp, #-296]
	add	r3, r3, #1
	str	r3, [fp, #-296]
.L26:
	ldr	r3, .L43+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-296]
	cmp	r2, r3
	blt	.L39
	ldr	r3, [fp, #-292]
	add	r3, r3, #1
	str	r3, [fp, #-292]
.L25:
	ldr	r3, .L43+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-292]
	cmp	r2, r3
	blt	.L40
	ldr	r3, [fp, #-244]
	ldr	r2, [fp, #-240]
	mul	r3, r2, r3
	ldr	r2, [fp, #-236]
	mul	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L43+20
	bl	printf
	mov	r3, #0
	mov	sp, r8
.L41:
	ldr	r2, .L43
	ldr	r1, [r2]
	ldr	r2, [fp, #-32]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L42
	bl	__stack_chk_fail
.L42:
	mov	r0, r3
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L44:
	.align	2
.L43:
	.word	.LC3
	.word	.LC1
	.word	INPUT_FILE
	.word	width
	.word	height
	.word	.LC2
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
