	.file	"1050073.c"
	.intel_syntax noprefix
	.text
	.globl	main
	.type	main, @function
main:
.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, 136
	.cfi_offset 3, -24
	mov	DWORD PTR -132[rbp], edi
	mov	QWORD PTR -144[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rax, -88[rbp]
	mov	rdi, rax
	call	read_size
	mov	rax, QWORD PTR -88[rbp]
	mov	rdi, rax
	call	create_a_new_map
	mov	QWORD PTR -112[rbp], rax
	lea	rax, -120[rbp]
	mov	rdi, rax
	call	read_loc_supplied
	mov	QWORD PTR -104[rbp], rax
	mov	edi, DWORD PTR -120[rbp]
	mov	rcx, QWORD PTR -104[rbp]
	mov	rdx, QWORD PTR -112[rbp]
	mov	rsi, QWORD PTR -88[rbp]
	lea	rax, -80[rbp]
	mov	r8d, edi
	mov	rdi, rax
	call	stage1_data
	sub	rsp, 48
	mov	rax, rsp
	mov	rcx, QWORD PTR -80[rbp]
	mov	rbx, QWORD PTR -72[rbp]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR -64[rbp]
	mov	rbx, QWORD PTR -56[rbp]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	rdx, QWORD PTR -48[rbp]
	mov	QWORD PTR 32[rax], rdx
	mov	edx, DWORD PTR -40[rbp]
	mov	DWORD PTR 40[rax], edx
	call	print_stage1
	add	rsp, 48
	mov	rdx, QWORD PTR -88[rbp]
	mov	rax, QWORD PTR -112[rbp]
	mov	rcx, QWORD PTR -104[rbp]
	mov	rsi, rax
	mov	rdi, QWORD PTR [rcx]
	call	best_cost
	mov	QWORD PTR -112[rbp], rax
	mov	DWORD PTR -116[rbp], 1
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -104[rbp]
	add	rdx, rax
	mov	rcx, QWORD PTR -104[rbp]
	mov	rax, QWORD PTR -112[rbp]
	mov	rdx, QWORD PTR [rdx]
	mov	rsi, QWORD PTR [rcx]
	mov	rdi, rax
	call	navigator_one_route
	mov	QWORD PTR -96[rbp], rax
	mov	rax, QWORD PTR -96[rbp]
	mov	rdi, rax
	call	print_one_route
	add	DWORD PTR -116[rbp], 1
.L2:
	mov	eax, DWORD PTR -120[rbp]
	cmp	DWORD PTR -116[rbp], eax
	jl	.L3
	mov	edi, 10
	call	putchar@PLT
	mov	rax, QWORD PTR -112[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR -112[rbp], 0
	mov	rax, QWORD PTR -104[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR -104[rbp], 0
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC0:
	.string	"%d%d"
	.text
	.globl	read_size
	.type	read_size, @function
read_size:
.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	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdx, -12[rbp]
	lea	rax, -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	edx, DWORD PTR -16[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR [rax], edx
	mov	edx, DWORD PTR -12[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 4[rax], edx
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	read_size, .-read_size
	.section	.rodata
.LC1:
	.string	"%d%c%d%d%d%d"
	.text
	.globl	create_a_new_map
	.type	create_a_new_map, @function
create_a_new_map:
.LFB8:
	.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, 88
	.cfi_offset 3, -24
	mov	QWORD PTR -88[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -88[rbp]
	mov	DWORD PTR -40[rbp], eax
	mov	eax, DWORD PTR -84[rbp]
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	DWORD PTR -48[rbp], 0
	jmp	.L10
.L13:
	mov	eax, DWORD PTR -40[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	lea	rbx, [rcx+rax]
	mov	rdi, rdx
	call	malloc@PLT
	mov	QWORD PTR [rbx], rax
	mov	DWORD PTR -44[rbp], 0
	jmp	.L11
.L12:
	lea	r8, -56[rbp]
	lea	rdi, -60[rbp]
	lea	rcx, -64[rbp]
	lea	rdx, -69[rbp]
	lea	rax, -68[rbp]
	sub	rsp, 8
	lea	rsi, -52[rbp]
	push	rsi
	mov	r9, r8
	mov	r8, rdi
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	rsp, 16
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdx, [rcx+rax]
	mov	eax, DWORD PTR -68[rbp]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdx, [rcx+rax]
	movzx	eax, BYTE PTR -69[rbp]
	mov	BYTE PTR 4[rdx], al
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdx, [rcx+rax]
	mov	eax, DWORD PTR -64[rbp]
	mov	DWORD PTR 16[rdx], eax
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdx, [rcx+rax]
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR 20[rdx], eax
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdx, [rcx+rax]
	mov	eax, DWORD PTR -56[rbp]
	mov	DWORD PTR 24[rdx], eax
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdx, [rcx+rax]
	mov	eax, DWORD PTR -52[rbp]
	mov	DWORD PTR 28[rdx], eax
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	DWORD PTR 32[rax], 999
	add	DWORD PTR -44[rbp], 1
.L11:
	mov	eax, DWORD PTR -44[rbp]
	cmp	eax, DWORD PTR -40[rbp]
	jl	.L12
	add	DWORD PTR -48[rbp], 1
.L10:
	mov	eax, DWORD PTR -48[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jl	.L13
	mov	rax, QWORD PTR -32[rbp]
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	create_a_new_map, .-create_a_new_map
	.section	.rodata
.LC2:
	.string	"%d %c"
	.text
	.globl	read_loc_supplied
	.type	read_loc_supplied, @function
read_loc_supplied:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -24[rbp], 1
	mov	DWORD PTR -20[rbp], 0
	mov	edi, 8
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	jmp	.L17
.L19:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, DWORD PTR -24[rbp]
	jne	.L18
	sal	DWORD PTR -24[rbp]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -16[rbp], rax
.L18:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -28[rbp]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR -29[rbp]
	mov	BYTE PTR 4[rdx], al
	add	DWORD PTR -20[rbp], 1
.L17:
	lea	rdx, -29[rbp]
	lea	rax, -28[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	cmp	eax, 2
	je	.L19
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	read_loc_supplied, .-read_loc_supplied
	.globl	count
	.type	count, @function
count:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	QWORD PTR -24[rbp], rdx
	cmp	DWORD PTR -4[rbp], 999
	jne	.L23
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR [rax], edx
	jmp	.L25
.L23:
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -4[rbp]
	add	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR [rax], edx
.L25:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	count, .-count
	.globl	stage1_data
	.type	stage1_data, @function
stage1_data:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 96
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	QWORD PTR -72[rbp], rdx
	mov	QWORD PTR -80[rbp], rcx
	mov	DWORD PTR -84[rbp], r8d
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -48[rbp], 0
	mov	DWORD PTR -44[rbp], 0
	mov	eax, DWORD PTR -64[rbp]
	mov	DWORD PTR -32[rbp], eax
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR -28[rbp], eax
	mov	DWORD PTR -40[rbp], 0
	jmp	.L27
.L30:
	mov	DWORD PTR -36[rbp], 0
	jmp	.L28
.L29:
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR 16[rax]
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR 20[rax]
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR 24[rax]
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR 28[rax]
	mov	DWORD PTR -12[rbp], eax
	lea	rdx, -44[rbp]
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	count
	lea	rdx, -44[rbp]
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	count
	lea	rdx, -44[rbp]
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	count
	lea	rdx, -44[rbp]
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	count
	add	DWORD PTR -36[rbp], 1
.L28:
	mov	eax, DWORD PTR -36[rbp]
	cmp	eax, DWORD PTR -32[rbp]
	jl	.L29
	add	DWORD PTR -40[rbp], 1
.L27:
	mov	eax, DWORD PTR -40[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jl	.L30
	mov	edx, DWORD PTR -64[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	DWORD PTR [rax], edx
	mov	edx, DWORD PTR -60[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	DWORD PTR 4[rax], edx
	mov	rax, QWORD PTR -56[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR 4[rax]
	imul	edx, eax
	mov	rax, QWORD PTR -56[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	rax, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR 8[rax]
	lea	edx, 0[0+rax*4]
	mov	rax, QWORD PTR -56[rbp]
	mov	DWORD PTR 12[rax], edx
	mov	edx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	DWORD PTR 16[rax], edx
	mov	edx, DWORD PTR -44[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	DWORD PTR 20[rax], edx
	mov	rax, QWORD PTR -56[rbp]
	mov	edx, DWORD PTR -84[rbp]
	mov	DWORD PTR 24[rax], edx
	cmp	QWORD PTR -80[rbp], 0
	je	.L31
	mov	rax, QWORD PTR -56[rbp]
	mov	rdx, QWORD PTR -80[rbp]
	mov	rdx, QWORD PTR [rdx]
	mov	QWORD PTR 28[rax], rdx
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	sal	rax, 3
	lea	rdx, -8[rax]
	mov	rax, QWORD PTR -80[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -56[rbp]
	mov	rdx, QWORD PTR [rdx]
	mov	QWORD PTR 36[rax], rdx
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L34
	jmp	.L35
.L31:
	mov	edi, 1
	call	exit@PLT
.L35:
	call	__stack_chk_fail@PLT
.L34:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	stage1_data, .-stage1_data
	.section	.rodata
	.align 8
.LC3:
	.string	"S1: grid is %d x %d, and has %d intersections\n"
	.align 8
.LC4:
	.string	"S1: of %d possibilities, %d of them cannot be used\n"
	.align 8
.LC5:
	.string	"S1: total cost of remaining possibilities is %d seconds\n"
	.align 8
.LC6:
	.string	"S1: %d grid locations supplied, first one is %d%c, last one is %d%c\n"
	.text
	.globl	print_stage1
	.type	print_stage1, @function
print_stage1:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	ecx, DWORD PTR 24[rbp]
	mov	edx, DWORD PTR 20[rbp]
	mov	eax, DWORD PTR 16[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, DWORD PTR 32[rbp]
	mov	eax, DWORD PTR 28[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR 36[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	movzx	eax, BYTE PTR 56[rbp]
	movsx	edi, al
	mov	esi, DWORD PTR 52[rbp]
	movzx	eax, BYTE PTR 48[rbp]
	movsx	ecx, al
	mov	edx, DWORD PTR 44[rbp]
	mov	eax, DWORD PTR 40[rbp]
	mov	r9d, edi
	mov	r8d, esi
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 10
	call	putchar@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	print_stage1, .-print_stage1
	.globl	compare_loc
	.type	compare_loc, @function
compare_loc:
.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	QWORD PTR -32[rbp], rsi
	mov	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	mov	DWORD PTR -4[rbp], eax
	movzx	eax, BYTE PTR -20[rbp]
	mov	BYTE PTR -10[rbp], al
	movzx	eax, BYTE PTR -28[rbp]
	mov	BYTE PTR -9[rbp], al
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jge	.L38
	mov	eax, 1
	jmp	.L39
.L38:
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jne	.L40
	movzx	eax, BYTE PTR -10[rbp]
	cmp	al, BYTE PTR -9[rbp]
	jge	.L40
	mov	eax, 1
	jmp	.L39
.L40:
	mov	eax, 0
.L39:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	compare_loc, .-compare_loc
	.globl	update_location_info
	.type	update_location_info, @function
update_location_info:
.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, 48
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	QWORD PTR -32[rbp], rdx
	mov	QWORD PTR -40[rbp], rcx
	mov	QWORD PTR -48[rbp], r8
	mov	edx, DWORD PTR -24[rbp]
	mov	eax, DWORD PTR -20[rbp]
	add	eax, edx
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -8[rbp], rax
	cmp	DWORD PTR -24[rbp], 999
	jne	.L42
	mov	eax, 0
	jmp	.L47
.L42:
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -12[rbp], eax
	jle	.L44
	mov	eax, 0
	jmp	.L47
.L44:
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -12[rbp], eax
	jne	.L45
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	compare_loc
	test	eax, eax
	jne	.L45
	mov	eax, 0
	jmp	.L47
.L45:
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -12[rbp], eax
	jne	.L46
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	compare_loc
	test	eax, eax
	je	.L46
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, DWORD PTR -12[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR [rax], rdx
	mov	eax, 1
	jmp	.L47
.L46:
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, DWORD PTR -12[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR [rax], rdx
	mov	eax, 1
.L47:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	update_location_info, .-update_location_info
	.globl	is_location_exist
	.type	is_location_exist, @function
is_location_exist:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	mov	QWORD PTR -16[rbp], rdx
	mov	eax, DWORD PTR -16[rbp]
	cmp	DWORD PTR -4[rbp], eax
	jge	.L49
	cmp	DWORD PTR -4[rbp], 0
	js	.L49
	mov	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -8[rbp], eax
	jge	.L49
	cmp	DWORD PTR -8[rbp], 0
	js	.L49
	mov	eax, 1
	jmp	.L50
.L49:
	mov	eax, 0
.L50:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	is_location_exist, .-is_location_exist
	.globl	best_cost
	.type	best_cost, @function
best_cost:
.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, 56
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -56[rbp], rdx
	mov	eax, DWORD PTR -40[rbp]
	mov	DWORD PTR -28[rbp], eax
	movzx	eax, BYTE PTR -36[rbp]
	movsx	eax, al
	sub	eax, 97
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -56[rbp]
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -52[rbp]
	mov	DWORD PTR -8[rbp], eax
	mov	DWORD PTR -4[rbp], 1
	mov	DWORD PTR -16[rbp], 1
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	DWORD PTR 32[rax], 0
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdx, [rcx+rax]
	mov	eax, DWORD PTR -40[rbp]
	mov	DWORD PTR 8[rdx], eax
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdx, [rcx+rax]
	movzx	eax, BYTE PTR -36[rbp]
	mov	BYTE PTR 12[rdx], al
	jmp	.L52
.L61:
	mov	DWORD PTR -20[rbp], 0
	mov	DWORD PTR -24[rbp], 0
	jmp	.L53
.L60:
	mov	DWORD PTR -28[rbp], 0
	jmp	.L54
.L59:
	mov	eax, DWORD PTR -28[rbp]
	lea	ecx, 1[rax]
	mov	rdx, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, eax
	mov	edi, ecx
	call	is_location_exist
	test	eax, eax
	je	.L55
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	lea	r8, 8[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdi, [rcx+rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	lea	rdx, 32[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	rsi, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	sal	rax, 3
	add	rax, rcx
	sal	rax, 2
	add	rax, rsi
	mov	esi, DWORD PTR 16[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	r9, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	sal	rax, 3
	add	rax, rcx
	sal	rax, 2
	add	rax, r9
	mov	eax, DWORD PTR 32[rax]
	mov	rcx, QWORD PTR [rdi]
	mov	edi, eax
	call	update_location_info
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	add	DWORD PTR -20[rbp], eax
.L55:
	mov	eax, DWORD PTR -24[rbp]
	lea	ecx, -1[rax]
	mov	rdx, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	is_location_exist
	test	eax, eax
	je	.L56
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	sal	rax, 3
	lea	rdx, -8[rax]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	lea	r8, 8[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdi, [rcx+rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	sal	rax, 3
	lea	rdx, -8[rax]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	lea	rdx, 32[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	rsi, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	sal	rax, 3
	add	rax, rcx
	sal	rax, 2
	add	rax, rsi
	mov	esi, DWORD PTR 20[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	r9, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	sal	rax, 3
	add	rax, rcx
	sal	rax, 2
	add	rax, r9
	mov	eax, DWORD PTR 32[rax]
	mov	rcx, QWORD PTR [rdi]
	mov	edi, eax
	call	update_location_info
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	add	DWORD PTR -20[rbp], eax
.L56:
	mov	eax, DWORD PTR -28[rbp]
	lea	ecx, -1[rax]
	mov	rdx, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, eax
	mov	edi, ecx
	call	is_location_exist
	test	eax, eax
	je	.L57
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	sub	rax, 36
	add	rax, rcx
	lea	r8, 8[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdi, [rcx+rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	sub	rax, 36
	add	rax, rcx
	lea	rdx, 32[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	rsi, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	sal	rax, 3
	add	rax, rcx
	sal	rax, 2
	add	rax, rsi
	mov	esi, DWORD PTR 24[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	r9, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	sal	rax, 3
	add	rax, rcx
	sal	rax, 2
	add	rax, r9
	mov	eax, DWORD PTR 32[rax]
	mov	rcx, QWORD PTR [rdi]
	mov	edi, eax
	call	update_location_info
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	add	DWORD PTR -20[rbp], eax
.L57:
	mov	eax, DWORD PTR -24[rbp]
	lea	ecx, 1[rax]
	mov	rdx, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	is_location_exist
	test	eax, eax
	je	.L58
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	lea	r8, 8[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rdi, [rcx+rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	lea	rdx, 32[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	rsi, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	sal	rax, 3
	add	rax, rcx
	sal	rax, 2
	add	rax, rsi
	mov	esi, DWORD PTR 28[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	r9, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	sal	rax, 3
	add	rax, rcx
	sal	rax, 2
	add	rax, r9
	mov	eax, DWORD PTR 32[rax]
	mov	rcx, QWORD PTR [rdi]
	mov	edi, eax
	call	update_location_info
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	add	DWORD PTR -20[rbp], eax
.L58:
	add	DWORD PTR -28[rbp], 1
.L54:
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -12[rbp]
	jl	.L59
	add	DWORD PTR -24[rbp], 1
.L53:
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jl	.L60
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -16[rbp], eax
.L52:
	cmp	DWORD PTR -16[rbp], 0
	jne	.L61
	mov	rax, QWORD PTR -48[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	best_cost, .-best_cost
	.globl	recursive_add
	.type	recursive_add, @function
recursive_add:
.LFB17:
	.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	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	QWORD PTR -48[rbp], rcx
	mov	QWORD PTR -56[rbp], r8
	mov	QWORD PTR -64[rbp], r9
	mov	eax, DWORD PTR -48[rbp]
	mov	DWORD PTR -8[rbp], eax
	movzx	eax, BYTE PTR -44[rbp]
	movsx	eax, al
	sub	eax, 97
	mov	DWORD PTR -4[rbp], eax
	movzx	eax, BYTE PTR -44[rbp]
	mov	BYTE PTR -9[rbp], al
	mov	eax, DWORD PTR -40[rbp]
	cmp	DWORD PTR -8[rbp], eax
	jne	.L64
	movzx	eax, BYTE PTR -36[rbp]
	cmp	BYTE PTR -9[rbp], al
	je	.L65
.L64:
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jne	.L66
	mov	rax, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, [rax+rax]
	mov	rax, QWORD PTR -56[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -24[rbp], rax
.L66:
	mov	rax, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -8[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR -9[rbp]
	mov	BYTE PTR 4[rdx], al
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rcx, rax
	mov	rax, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR 32[rcx]
	mov	DWORD PTR 8[rdx], eax
	mov	rax, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -64[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	r8, QWORD PTR -64[rbp]
	mov	rdi, QWORD PTR -56[rbp]
	mov	rcx, QWORD PTR 8[rax]
	mov	rdx, QWORD PTR -40[rbp]
	mov	rsi, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	r9, r8
	mov	r8, rdi
	mov	rdi, rax
	call	recursive_add
	jmp	.L67
.L65:
	mov	rax, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -8[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR -9[rbp]
	mov	BYTE PTR 4[rdx], al
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	add	rcx, rax
	mov	rax, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR 32[rcx]
	mov	DWORD PTR 8[rdx], eax
	mov	rax, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 12[rax], edx
	mov	rax, QWORD PTR -24[rbp]
.L67:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	recursive_add, .-recursive_add
	.globl	navigator_one_route
	.type	navigator_one_route, @function
navigator_one_route:
.LFB18:
	.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	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -56[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -24[rbp], 0
	mov	DWORD PTR -20[rbp], 1
	mov	edi, 16
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	lea	r8, -24[rbp]
	lea	rdi, -20[rbp]
	mov	rcx, QWORD PTR -56[rbp]
	mov	rdx, QWORD PTR -48[rbp]
	mov	rsi, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	r9, r8
	mov	r8, rdi
	mov	rdi, rax
	call	recursive_add
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L70
	call	__stack_chk_fail@PLT
.L70:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE18:
	.size	navigator_one_route, .-navigator_one_route
	.section	.rodata
	.align 8
.LC7:
	.string	"S2: start at grid %d%c, cost of %d\n"
	.align 8
.LC8:
	.string	"S2:       then to %d%c, cost of %d\n"
	.text
	.globl	print_one_route
	.type	print_one_route, @function
print_one_route:
.LFB19:
	.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	eax, DWORD PTR 12[rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 4
	lea	rdx, -16[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	ecx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 4
	lea	rdx, -16[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR 4[rax]
	movsx	edx, al
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 4
	lea	rsi, -16[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rsi
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 12[rax]
	sub	eax, 2
	mov	DWORD PTR -8[rbp], eax
	jmp	.L72
.L73:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	ecx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR 4[rax]
	movsx	edx, al
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 4
	mov	rsi, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rsi
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	sub	DWORD PTR -8[rbp], 1
.L72:
	cmp	DWORD PTR -8[rbp], 0
	jns	.L73
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE19:
	.size	print_one_route, .-print_one_route
	.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	"1050073.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 88
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #120
	str	r0, [fp, #-88]
	str	r1, [fp, #-92]
	ldr	r3, .L6
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #60
	mov	r0, r3
	bl	read_size
	sub	r3, fp, #60
	ldm	r3, {r0, r1}
	bl	create_a_new_map
	str	r0, [fp, #-72]
	sub	r3, fp, #80
	mov	r0, r3
	bl	read_loc_supplied
	str	r0, [fp, #-68]
	ldr	r3, [fp, #-80]
	sub	r0, fp, #52
	str	r3, [sp, #4]
	ldr	r3, [fp, #-68]
	str	r3, [sp]
	ldr	r3, [fp, #-72]
	sub	r2, fp, #60
	ldm	r2, {r1, r2}
	bl	stage1_data
	mov	lr, sp
	sub	ip, fp, #36
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	sub	r3, fp, #52
	ldm	r3, {r0, r1, r2, r3}
	bl	print_stage1
	ldr	r1, [fp, #-68]
	ldr	r3, [fp, #-56]
	str	r3, [sp]
	ldr	r3, [fp, #-60]
	ldr	r2, [fp, #-72]
	ldm	r1, {r0, r1}
	bl	best_cost
	str	r0, [fp, #-72]
	mov	r3, #1
	str	r3, [fp, #-76]
	b	.L2
.L3:
	ldr	r3, [fp, #-76]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-68]
	add	r3, r2, r3
	ldr	r2, [fp, #-68]
	ldr	r1, [r3, #4]
	str	r1, [sp]
	ldr	r3, [r3]
	ldm	r2, {r1, r2}
	ldr	r0, [fp, #-72]
	bl	navigator_one_route
	str	r0, [fp, #-64]
	ldr	r0, [fp, #-64]
	bl	print_one_route
	ldr	r3, [fp, #-76]
	add	r3, r3, #1
	str	r3, [fp, #-76]
.L2:
	ldr	r3, [fp, #-80]
	ldr	r2, [fp, #-76]
	cmp	r2, r3
	blt	.L3
	mov	r0, #10
	bl	putchar
	ldr	r0, [fp, #-72]
	bl	free
	mov	r3, #0
	str	r3, [fp, #-72]
	ldr	r0, [fp, #-68]
	bl	free
	mov	r3, #0
	str	r3, [fp, #-68]
	mov	r3, #0
	ldr	r2, .L6
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L5
	bl	__stack_chk_fail
.L5:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.size	main, .-main
	.section	.rodata
	.align	2
.LC1:
	.ascii	"%d%d\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_size
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_size, %function
read_size:
	@ 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]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r2, fp, #12
	sub	r3, fp, #16
	mov	r1, r3
	ldr	r0, .L11+4
	bl	__isoc99_scanf
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	str	r2, [r3]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-24]
	str	r2, [r3, #4]
	nop
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC2
	.word	.LC1
	.size	read_size, .-read_size
	.section	.rodata
	.align	2
.LC3:
	.ascii	"%d%c%d%d%d%d\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	create_a_new_map
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_a_new_map, %function
create_a_new_map:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #76
	sub	r3, fp, #68
	stm	r3, {r0, r1}
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-68]
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-64]
	str	r3, [fp, #-24]
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L14
.L17:
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r1, r3
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r4, r2, r3
	mov	r0, r1
	bl	malloc
	mov	r3, r0
	str	r3, [r4]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L15
.L16:
	sub	r0, fp, #52
	sub	r2, fp, #57
	sub	r1, fp, #56
	sub	r3, fp, #40
	str	r3, [sp, #8]
	sub	r3, fp, #44
	str	r3, [sp, #4]
	sub	r3, fp, #48
	str	r3, [sp]
	mov	r3, r0
	ldr	r0, .L20+4
	bl	__isoc99_scanf
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-32]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r2, [fp, #-56]
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-32]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldrb	r2, [fp, #-57]	@ zero_extendqisi2
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-32]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r2, [fp, #-52]
	str	r2, [r3, #16]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-32]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r2, [fp, #-48]
	str	r2, [r3, #20]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-32]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r2, [fp, #-44]
	str	r2, [r3, #24]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-32]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r2, [fp, #-40]
	str	r2, [r3, #28]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-32]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r2, .L20+8
	str	r2, [r3, #32]
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L15:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L16
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L14:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L17
	ldr	r3, [fp, #-20]
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC4
	.word	.LC3
	.word	999
	.size	create_a_new_map, .-create_a_new_map
	.section	.rodata
	.align	2
.LC5:
	.ascii	"%d %c\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_loc_supplied
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_loc_supplied, %function
read_loc_supplied:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	ldr	r3, .L28
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r0, #8
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	b	.L23
.L25:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	bne	.L24
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #3
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	realloc
	str	r0, [fp, #-12]
.L24:
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	ldr	r2, [fp, #-24]
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	ldrb	r2, [fp, #-25]	@ zero_extendqisi2
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L23:
	sub	r2, fp, #25
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, .L28+4
	bl	__isoc99_scanf
	mov	r3, r0
	cmp	r3, #2
	beq	.L25
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, .L28
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L27
	bl	__stack_chk_fail
.L27:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC6
	.word	.LC5
	.size	read_loc_supplied, .-read_loc_supplied
	.align	2
	.global	count
	.syntax unified
	.arm
	.fpu softvfp
	.type	count, %function
count:
	@ 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, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	ldr	r2, .L34
	cmp	r3, r2
	bne	.L31
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-12]
	str	r2, [r3]
	b	.L33
.L31:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r2, r2, r3
	ldr	r3, [fp, #-16]
	str	r2, [r3]
.L33:
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L35:
	.align	2
.L34:
	.word	999
	.size	count, .-count
	.section	.rodata
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	stage1_data
	.syntax unified
	.arm
	.fpu softvfp
	.type	stage1_data, %function
stage1_data:
	@ args = 8, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	str	r0, [fp, #-56]
	sub	r0, fp, #64
	stm	r0, {r1, r2}
	str	r3, [fp, #-68]
	ldr	r3, [fp, #4]
	str	r3, [fp, #-72]
	ldr	r3, .L46
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-64]
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-60]
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L37
.L40:
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L38
.L39:
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-68]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-36]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r3, [r3, #16]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-68]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-36]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r3, [r3, #20]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-68]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-36]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r3, [r3, #24]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-68]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-36]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r3, [r3, #28]
	str	r3, [fp, #-12]
	sub	r2, fp, #44
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	count
	sub	r2, fp, #44
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, [fp, #-20]
	bl	count
	sub	r2, fp, #44
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	count
	sub	r2, fp, #44
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	count
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L38:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	blt	.L39
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L37:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L40
	ldr	r2, [fp, #-64]
	ldr	r3, [fp, #-56]
	str	r2, [r3]
	ldr	r2, [fp, #-60]
	ldr	r3, [fp, #-56]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-56]
	ldr	r3, [r3]
	ldr	r2, [fp, #-56]
	ldr	r2, [r2, #4]
	mul	r2, r3, r2
	ldr	r3, [fp, #-56]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-56]
	ldr	r3, [r3, #8]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-56]
	str	r2, [r3, #12]
	ldr	r2, [fp, #-48]
	ldr	r3, [fp, #-56]
	str	r2, [r3, #16]
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-56]
	str	r2, [r3, #20]
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #8]
	str	r2, [r3, #24]
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	beq	.L41
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-72]
	add	r3, r3, #28
	ldm	r2, {r0, r1}
	stm	r3, {r0, r1}
	ldr	r3, [fp, #8]
	sub	r3, r3, #-536870911
	lsl	r3, r3, #3
	ldr	r2, [fp, #-72]
	add	r2, r2, r3
	ldr	r3, [fp, #-56]
	add	r3, r3, #36
	ldm	r2, {r0, r1}
	stm	r3, {r0, r1}
	nop
	ldr	r3, .L46
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L44
	b	.L45
.L41:
	mov	r0, #1
	bl	exit
.L45:
	bl	__stack_chk_fail
.L44:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L47:
	.align	2
.L46:
	.word	.LC7
	.size	stage1_data, .-stage1_data
	.section	.rodata
	.align	2
.LC8:
	.ascii	"S1: grid is %d x %d, and has %d intersections\012\000"
	.align	2
.LC9:
	.ascii	"S1: of %d possibilities, %d of them cannot be used\012"
	.ascii	"\000"
	.align	2
.LC10:
	.ascii	"S1: total cost of remaining possibilities is %d sec"
	.ascii	"onds\012\000"
	.align	2
.LC11:
	.ascii	"S1: %d grid locations supplied, first one is %d%c, "
	.ascii	"last one is %d%c\012\000"
	.text
	.align	2
	.global	print_stage1
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_stage1, %function
print_stage1:
	@ args = 44, pretend = 16, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #16
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	add	ip, fp, #4
	stm	ip, {r0, r1, r2, r3}
	ldr	r1, [fp, #4]
	ldr	r2, [fp, #8]
	ldr	r3, [fp, #12]
	ldr	r0, .L49
	bl	printf
	ldr	r3, [fp, #16]
	ldr	r2, [fp, #20]
	mov	r1, r3
	ldr	r0, .L49+4
	bl	printf
	ldr	r3, [fp, #24]
	mov	r1, r3
	ldr	r0, .L49+8
	bl	printf
	ldr	r1, [fp, #28]
	ldr	r2, [fp, #32]
	ldrb	r3, [fp, #36]	@ zero_extendqisi2
	mov	ip, r3
	ldr	r3, [fp, #40]
	ldrb	r0, [fp, #44]	@ zero_extendqisi2
	str	r0, [sp, #4]
	str	r3, [sp]
	mov	r3, ip
	ldr	r0, .L49+12
	bl	printf
	mov	r0, #10
	bl	putchar
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, lr}
	add	sp, sp, #16
	bx	lr
.L50:
	.align	2
.L49:
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	print_stage1, .-print_stage1
	.align	2
	.global	compare_loc
	.syntax unified
	.arm
	.fpu softvfp
	.type	compare_loc, %function
compare_loc:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #36
	sub	ip, fp, #28
	stm	ip, {r0, r1}
	sub	r1, fp, #36
	stm	r1, {r2, r3}
	ldr	r3, [fp, #-28]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-36]
	str	r3, [fp, #-8]
	ldrb	r3, [fp, #-24]
	strb	r3, [fp, #-14]
	ldrb	r3, [fp, #-32]
	strb	r3, [fp, #-13]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	bge	.L52
	mov	r3, #1
	b	.L53
.L52:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	bne	.L54
	ldrb	r2, [fp, #-14]	@ zero_extendqisi2
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	cmp	r2, r3
	bcs	.L54
	mov	r3, #1
	b	.L53
.L54:
	mov	r3, #0
.L53:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	compare_loc, .-compare_loc
	.align	2
	.global	update_location_info
	.syntax unified
	.arm
	.fpu softvfp
	.type	update_location_info, %function
update_location_info:
	@ args = 16, pretend = 8, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #8
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	str	r3, [fp, #8]
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r2, [fp, #16]
	sub	r3, fp, #12
	ldm	r2, {r0, r1}
	stm	r3, {r0, r1}
	ldr	r3, [fp, #-28]
	ldr	r2, .L62
	cmp	r3, r2
	bne	.L56
	mov	r3, #0
	b	.L61
.L56:
	ldr	r3, [fp, #-32]
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	ble	.L58
	mov	r3, #0
	b	.L61
.L58:
	ldr	r3, [fp, #-32]
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bne	.L59
	sub	r3, fp, #12
	ldm	r3, {r2, r3}
	add	r1, fp, #8
	ldm	r1, {r0, r1}
	bl	compare_loc
	mov	r3, r0
	cmp	r3, #0
	bne	.L59
	mov	r3, #0
	b	.L61
.L59:
	ldr	r3, [fp, #-32]
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bne	.L60
	sub	r3, fp, #12
	ldm	r3, {r2, r3}
	add	r1, fp, #8
	ldm	r1, {r0, r1}
	bl	compare_loc
	mov	r3, r0
	cmp	r3, #0
	beq	.L60
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #16]
	mov	r2, r3
	add	r3, fp, #8
	ldm	r3, {r0, r1}
	stm	r2, {r0, r1}
	mov	r3, #1
	b	.L61
.L60:
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #16]
	mov	r2, r3
	add	r3, fp, #8
	ldm	r3, {r0, r1}
	stm	r2, {r0, r1}
	mov	r3, #1
.L61:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, lr}
	add	sp, sp, #8
	bx	lr
.L63:
	.align	2
.L62:
	.word	999
	.size	update_location_info, .-update_location_info
	.align	2
	.global	is_location_exist
	.syntax unified
	.arm
	.fpu softvfp
	.type	is_location_exist, %function
is_location_exist:
	@ 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, #-8]
	str	r1, [fp, #-12]
	sub	r1, fp, #20
	stm	r1, {r2, r3}
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bge	.L65
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	blt	.L65
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bge	.L65
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	blt	.L65
	mov	r3, #1
	b	.L66
.L65:
	mov	r3, #0
.L66:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	is_location_exist, .-is_location_exist
	.align	2
	.global	best_cost
	.syntax unified
	.arm
	.fpu softvfp
	.type	best_cost, %function
best_cost:
	@ args = 12, pretend = 8, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #8
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #60
	sub	ip, fp, #52
	stm	ip, {r0, r1}
	str	r2, [fp, #-56]
	str	r3, [fp, #8]
	ldr	r3, [fp, #-52]
	str	r3, [fp, #-40]
	ldrb	r3, [fp, #-48]	@ zero_extendqisi2
	sub	r3, r3, #97
	str	r3, [fp, #-36]
	ldr	r3, [fp, #8]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #12]
	str	r3, [fp, #-20]
	mov	r3, #1
	str	r3, [fp, #-16]
	mov	r3, #1
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	mov	r2, #0
	str	r2, [r3, #32]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r2, [fp, #-52]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldrb	r2, [fp, #-48]	@ zero_extendqisi2
	strb	r2, [r3, #12]
	b	.L68
.L77:
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L69
.L76:
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L70
.L75:
	ldr	r3, [fp, #-40]
	add	r0, r3, #1
	add	r3, fp, #8
	ldm	r3, {r2, r3}
	ldr	r1, [fp, #-36]
	bl	is_location_exist
	mov	r3, r0
	cmp	r3, #0
	beq	.L71
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	ip, [r3, #32]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	lr, [r3, #16]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-40]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	add	r4, r3, #32
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r2, r1, r3
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-56]
	add	r3, r1, r3
	ldr	r0, [r3]
	ldr	r3, [fp, #-40]
	add	r1, r3, #1
	mov	r3, r1
	lsl	r3, r3, #3
	add	r3, r3, r1
	lsl	r3, r3, #2
	add	r3, r0, r3
	add	r3, r3, #8
	str	r3, [sp, #4]
	ldr	r3, [r2, #4]
	str	r3, [sp]
	ldr	r3, [r2]
	mov	r2, r4
	mov	r1, lr
	mov	r0, ip
	bl	update_location_info
	str	r0, [fp, #-16]
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-32]
.L71:
	ldr	r3, [fp, #-36]
	sub	r1, r3, #1
	add	r3, fp, #8
	ldm	r3, {r2, r3}
	ldr	r0, [fp, #-40]
	bl	is_location_exist
	mov	r3, r0
	cmp	r3, #0
	beq	.L72
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	ip, [r3, #32]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	lr, [r3, #20]
	ldr	r3, [fp, #-36]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	add	r4, r3, #32
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r2, r1, r3
	ldr	r3, [fp, #-36]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r1, [fp, #-56]
	add	r3, r1, r3
	ldr	r0, [r3]
	ldr	r1, [fp, #-40]
	mov	r3, r1
	lsl	r3, r3, #3
	add	r3, r3, r1
	lsl	r3, r3, #2
	add	r3, r0, r3
	add	r3, r3, #8
	str	r3, [sp, #4]
	ldr	r3, [r2, #4]
	str	r3, [sp]
	ldr	r3, [r2]
	mov	r2, r4
	mov	r1, lr
	mov	r0, ip
	bl	update_location_info
	str	r0, [fp, #-16]
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-32]
.L72:
	ldr	r3, [fp, #-40]
	sub	r0, r3, #1
	add	r3, fp, #8
	ldm	r3, {r2, r3}
	ldr	r1, [fp, #-36]
	bl	is_location_exist
	mov	r3, r0
	cmp	r3, #0
	beq	.L73
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	ip, [r3, #32]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	lr, [r3, #24]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	sub	r3, r3, #36
	add	r3, r1, r3
	add	r4, r3, #32
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r2, r1, r3
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-56]
	add	r3, r1, r3
	ldr	r0, [r3]
	ldr	r1, [fp, #-40]
	mov	r3, r1
	lsl	r3, r3, #3
	add	r3, r3, r1
	lsl	r3, r3, #2
	sub	r3, r3, #36
	add	r3, r0, r3
	add	r3, r3, #8
	str	r3, [sp, #4]
	ldr	r3, [r2, #4]
	str	r3, [sp]
	ldr	r3, [r2]
	mov	r2, r4
	mov	r1, lr
	mov	r0, ip
	bl	update_location_info
	str	r0, [fp, #-16]
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-32]
.L73:
	ldr	r3, [fp, #-36]
	add	r1, r3, #1
	add	r3, fp, #8
	ldm	r3, {r2, r3}
	ldr	r0, [fp, #-40]
	bl	is_location_exist
	mov	r3, r0
	cmp	r3, #0
	beq	.L74
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	ip, [r3, #32]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	lr, [r3, #28]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	add	r4, r3, #32
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-40]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r2, r1, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r1, [fp, #-56]
	add	r3, r1, r3
	ldr	r0, [r3]
	ldr	r1, [fp, #-40]
	mov	r3, r1
	lsl	r3, r3, #3
	add	r3, r3, r1
	lsl	r3, r3, #2
	add	r3, r0, r3
	add	r3, r3, #8
	str	r3, [sp, #4]
	ldr	r3, [r2, #4]
	str	r3, [sp]
	ldr	r3, [r2]
	mov	r2, r4
	mov	r1, lr
	mov	r0, ip
	bl	update_location_info
	str	r0, [fp, #-16]
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-32]
.L74:
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L70:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L75
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L69:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	blt	.L76
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-28]
.L68:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L77
	ldr	r3, [fp, #-56]
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, lr}
	add	sp, sp, #8
	bx	lr
	.size	best_cost, .-best_cost
	.align	2
	.global	recursive_add
	.syntax unified
	.arm
	.fpu softvfp
	.type	recursive_add, %function
recursive_add:
	@ args = 16, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	sub	r1, fp, #36
	stm	r1, {r2, r3}
	ldr	r3, [fp, #4]
	str	r3, [fp, #-12]
	ldrb	r3, [fp, #8]	@ zero_extendqisi2
	sub	r3, r3, #97
	str	r3, [fp, #-8]
	ldrb	r3, [fp, #8]
	strb	r3, [fp, #-13]
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bne	.L80
	ldrb	r3, [fp, #-32]	@ zero_extendqisi2
	ldrb	r2, [fp, #-13]	@ zero_extendqisi2
	cmp	r2, r3
	beq	.L81
.L80:
	ldr	r3, [fp, #16]
	ldr	r2, [r3]
	ldr	r3, [fp, #12]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L82
	ldr	r3, [fp, #12]
	ldr	r3, [r3]
	lsl	r2, r3, #1
	ldr	r3, [fp, #12]
	str	r2, [r3]
	ldr	r3, [fp, #12]
	ldr	r3, [r3]
	lsl	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	realloc
	str	r0, [fp, #-24]
.L82:
	ldr	r3, [fp, #16]
	ldr	r3, [r3]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	str	r2, [r3]
	ldr	r3, [fp, #16]
	ldr	r3, [r3]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldrb	r2, [fp, #-13]
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r2, r1, r3
	ldr	r3, [fp, #16]
	ldr	r3, [r3]
	lsl	r3, r3, #4
	ldr	r1, [fp, #-24]
	add	r3, r1, r3
	ldr	r2, [r2, #32]
	str	r2, [r3, #8]
	ldr	r3, [fp, #16]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #16]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r2, [fp, #16]
	str	r2, [sp, #12]
	ldr	r2, [fp, #12]
	str	r2, [sp, #8]
	mov	r2, sp
	add	r3, r3, #8
	ldm	r3, {r0, r1}
	stm	r2, {r0, r1}
	sub	r3, fp, #36
	ldm	r3, {r2, r3}
	ldr	r1, [fp, #-28]
	ldr	r0, [fp, #-24]
	bl	recursive_add
	mov	r3, r0
	b	.L83
.L81:
	ldr	r3, [fp, #16]
	ldr	r3, [r3]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	str	r2, [r3]
	ldr	r3, [fp, #16]
	ldr	r3, [r3]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldrb	r2, [fp, #-13]
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r2, r1, r3
	ldr	r3, [fp, #16]
	ldr	r3, [r3]
	lsl	r3, r3, #4
	ldr	r1, [fp, #-24]
	add	r3, r1, r3
	ldr	r2, [r2, #32]
	str	r2, [r3, #8]
	ldr	r3, [fp, #16]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-24]
	str	r2, [r3, #12]
	ldr	r3, [fp, #-24]
.L83:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	recursive_add, .-recursive_add
	.section	.rodata
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	navigator_one_route
	.syntax unified
	.arm
	.fpu softvfp
	.type	navigator_one_route, %function
navigator_one_route:
	@ args = 12, pretend = 8, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #8
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-24]
	sub	r0, fp, #32
	stm	r0, {r1, r2}
	str	r3, [fp, #8]
	ldr	r3, .L87
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #1
	str	r3, [fp, #-16]
	mov	r0, #16
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	sub	r3, fp, #20
	str	r3, [sp, #12]
	sub	r3, fp, #16
	str	r3, [sp, #8]
	mov	r2, sp
	add	r3, fp, #8
	ldm	r3, {r0, r1}
	stm	r2, {r0, r1}
	sub	r3, fp, #32
	ldm	r3, {r2, r3}
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-12]
	bl	recursive_add
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldr	r2, .L87
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L86
	bl	__stack_chk_fail
.L86:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, lr}
	add	sp, sp, #8
	bx	lr
.L88:
	.align	2
.L87:
	.word	.LC12
	.size	navigator_one_route, .-navigator_one_route
	.section	.rodata
	.align	2
.LC13:
	.ascii	"S2: start at grid %d%c, cost of %d\012\000"
	.align	2
.LC14:
	.ascii	"S2:       then to %d%c, cost of %d\012\000"
	.text
	.align	2
	.global	print_one_route
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_one_route, %function
print_one_route:
	@ 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]
	ldr	r3, [r3, #12]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	sub	r3, r3, #-268435455
	lsl	r3, r3, #4
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-8]
	sub	r3, r3, #-268435455
	lsl	r3, r3, #4
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3, #4]	@ zero_extendqisi2
	mov	r0, r3
	ldr	r3, [fp, #-8]
	sub	r3, r3, #-268435455
	lsl	r3, r3, #4
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	mov	r2, r0
	ldr	r0, .L92
	bl	printf
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #12]
	sub	r3, r3, #2
	str	r3, [fp, #-12]
	b	.L90
.L91:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3, #4]	@ zero_extendqisi2
	mov	r0, r3
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	mov	r2, r0
	ldr	r0, .L92+4
	bl	printf
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
.L90:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L91
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L93:
	.align	2
.L92:
	.word	.LC13
	.word	.LC14
	.size	print_one_route, .-print_one_route
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
