	.file	"552699.c"
	.intel_syntax noprefix
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB6:
	.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	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, DWORD PTR -4[rbp]
	mov	DWORD PTR [rax], edx
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	swap, .-swap
	.globl	first_permutation
	.type	first_permutation, @function
first_permutation:
.LFB7:
	.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 -8[rbp], rdi
	mov	DWORD PTR -12[rbp], esi
	cmp	QWORD PTR -8[rbp], 0
	jne	.L5
	mov	eax, 0
	jmp	.L4
.L6:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR [rdx], eax
.L5:
	mov	eax, DWORD PTR -12[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -12[rbp], edx
	test	eax, eax
	jne	.L6
	mov	eax, 1
.L4:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	first_permutation, .-first_permutation
	.globl	next_permutation
	.type	next_permutation, @function
next_permutation:
.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 -28[rbp], esi
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, 1
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR -8[rbp], eax
	jmp	.L8
.L10:
	sub	DWORD PTR -8[rbp], 1
.L8:
	cmp	DWORD PTR -8[rbp], 0
	jle	.L9
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jge	.L10
.L9:
	cmp	DWORD PTR -8[rbp], 0
	jg	.L13
	mov	eax, 0
	jmp	.L12
.L14:
	sub	DWORD PTR -4[rbp], 1
.L13:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 2
	lea	rcx, -4[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jle	.L14
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 2
	lea	rcx, -4[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rcx
	mov	rsi, rdx
	mov	rdi, rax
	call	swap
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, 1
	mov	DWORD PTR -4[rbp], eax
	jmp	.L15
.L16:
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -4[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -8[rbp]
	lea	ecx, 1[rax]
	mov	DWORD PTR -8[rbp], ecx
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rcx
	mov	rsi, rdx
	mov	rdi, rax
	call	swap
.L15:
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jl	.L16
	mov	eax, 1
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	next_permutation, .-next_permutation
	.globl	journey_distance
	.type	journey_distance, @function
journey_distance:
.LFB9:
	.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	DWORD PTR -36[rbp], edx
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -4[rbp], 0
	jmp	.L18
.L19:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	imul	eax, DWORD PTR -36[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	add	rax, 1
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	add	eax, edx
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	add	DWORD PTR -8[rbp], eax
	add	DWORD PTR -4[rbp], 1
.L18:
	mov	eax, DWORD PTR -36[rbp]
	sub	eax, 1
	cmp	DWORD PTR -4[rbp], eax
	jl	.L19
	mov	eax, DWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	journey_distance, .-journey_distance
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"bad number: %s\n"
.LC2:
	.string	"usage: %s [NUMBER]\n"
	.align 8
.LC3:
	.string	"number must be positive, got %d\n"
.LC4:
	.string	"couldn't allocate\n"
.LC5:
	.string	"%*[^=]= %d"
.LC6:
	.string	"bad input\n"
.LC7:
	.string	"Day 9, part 1: %d\n"
.LC8:
	.string	"Day 9, part 2: %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -48[rbp], 8
	cmp	DWORD PTR -52[rbp], 1
	jle	.L22
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rdx, -48[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	cmp	eax, 1
	je	.L23
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L35
.L23:
	mov	eax, DWORD PTR -48[rbp]
	test	eax, eax
	jns	.L22
	mov	edx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L35
.L22:
	mov	edx, DWORD PTR -48[rbp]
	mov	eax, DWORD PTR -48[rbp]
	imul	eax, edx
	cdqe
	mov	esi, 4
	mov	rdi, rax
	call	calloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	je	.L25
	cmp	QWORD PTR -16[rbp], 0
	jne	.L26
.L25:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 18
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L35
.L26:
	mov	DWORD PTR -44[rbp], 0
	jmp	.L27
.L31:
	mov	eax, DWORD PTR -44[rbp]
	add	eax, 1
	mov	DWORD PTR -40[rbp], eax
	jmp	.L28
.L30:
	mov	eax, DWORD PTR -48[rbp]
	imul	eax, DWORD PTR -44[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -40[rbp]
	add	eax, edx
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	cmp	eax, 1
	je	.L29
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 10
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L35
.L29:
	mov	eax, DWORD PTR -48[rbp]
	imul	eax, DWORD PTR -44[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -40[rbp]
	add	eax, edx
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -48[rbp]
	imul	eax, DWORD PTR -40[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -44[rbp]
	add	eax, edx
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR [rcx]
	mov	DWORD PTR [rdx], eax
	add	DWORD PTR -40[rbp], 1
.L28:
	mov	eax, DWORD PTR -48[rbp]
	cmp	DWORD PTR -40[rbp], eax
	jl	.L30
	add	DWORD PTR -44[rbp], 1
.L27:
	mov	eax, DWORD PTR -48[rbp]
	cmp	DWORD PTR -44[rbp], eax
	jl	.L31
	mov	edx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	first_permutation
	mov	edx, DWORD PTR -48[rbp]
	mov	rcx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	journey_distance
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	mov	DWORD PTR -32[rbp], eax
	jmp	.L32
.L34:
	mov	edx, DWORD PTR -48[rbp]
	mov	rcx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	journey_distance
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jge	.L33
	mov	eax, DWORD PTR -28[rbp]
	mov	DWORD PTR -36[rbp], eax
.L33:
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -32[rbp]
	jle	.L32
	mov	eax, DWORD PTR -28[rbp]
	mov	DWORD PTR -32[rbp], eax
.L32:
	mov	edx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	next_permutation
	test	eax, eax
	jne	.L34
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
.L35:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	"552699.c"
	.text
	.align	2
	.global	swap
	.syntax unified
	.arm
	.fpu softvfp
	.type	swap, %function
swap:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-20]
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	swap, .-swap
	.align	2
	.global	first_permutation
	.syntax unified
	.arm
	.fpu softvfp
	.type	first_permutation, %function
first_permutation:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L5
	mov	r3, #0
	b	.L4
.L6:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	str	r2, [r3]
.L5:
	ldr	r3, [fp, #-12]
	sub	r2, r3, #1
	str	r2, [fp, #-12]
	cmp	r3, #0
	bne	.L6
	mov	r3, #1
.L4:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	first_permutation, .-first_permutation
	.align	2
	.global	next_permutation
	.syntax unified
	.arm
	.fpu softvfp
	.type	next_permutation, %function
next_permutation:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-12]
	b	.L8
.L10:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
.L8:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	ble	.L9
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-16]
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	bge	.L10
.L9:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bgt	.L13
	mov	r3, #0
	b	.L12
.L14:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
.L13:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r1, [fp, #-16]
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L14
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r0, r2, r3
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r1, r3
	bl	swap
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
	b	.L15
.L16:
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	str	r2, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r0, r2, r3
	ldr	r3, [fp, #-8]
	sub	r2, r3, #1
	str	r2, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r1, r3
	bl	swap
.L15:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	blt	.L16
	mov	r3, #1
.L12:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	next_permutation, .-next_permutation
	.align	2
	.global	journey_distance
	.syntax unified
	.arm
	.fpu softvfp
	.type	journey_distance, %function
journey_distance:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L18
.L19:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	mul	r2, r3, r2
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r1, [fp, #-20]
	add	r3, r1, r3
	ldr	r3, [r3]
	add	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L18:
	ldr	r3, [fp, #-24]
	sub	r3, r3, #1
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L19
	ldr	r3, [fp, #-12]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	journey_distance, .-journey_distance
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d\000"
	.align	2
.LC1:
	.ascii	"bad number: %s\012\000"
	.align	2
.LC2:
	.ascii	"usage: %s [NUMBER]\012\000"
	.align	2
.LC3:
	.ascii	"number must be positive, got %d\012\000"
	.align	2
.LC4:
	.ascii	"couldn't allocate\012\000"
	.align	2
.LC5:
	.ascii	"%*[^=]= %d\000"
	.align	2
.LC6:
	.ascii	"bad input\012\000"
	.align	2
.LC7:
	.ascii	"Day 9, part 1: %d\012\000"
	.align	2
.LC8:
	.ascii	"Day 9, part 2: %d\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L37
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #8
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-48]
	cmp	r3, #1
	ble	.L22
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r2, fp, #40
	ldr	r1, .L37+4
	mov	r0, r3
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #1
	beq	.L23
	ldr	r3, .L37+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+12
	bl	fprintf
	ldr	r3, .L37+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+16
	bl	fprintf
	mov	r3, #1
	b	.L35
.L23:
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bge	.L22
	ldr	r3, .L37+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	ldr	r1, .L37+20
	mov	r0, r3
	bl	fprintf
	mov	r3, #1
	b	.L35
.L22:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-40]
	mul	r3, r2, r3
	mov	r1, #4
	mov	r0, r3
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L25
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L26
.L25:
	ldr	r3, .L37+8
	ldr	r3, [r3]
	mov	r2, #18
	mov	r1, #1
	ldr	r0, .L37+24
	bl	fwrite
	mov	r3, #1
	b	.L35
.L26:
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L27
.L31:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-32]
	b	.L28
.L30:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-36]
	mul	r2, r3, r2
	ldr	r3, [fp, #-32]
	add	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L37+28
	bl	__isoc99_scanf
	mov	r3, r0
	cmp	r3, #1
	beq	.L29
	ldr	r3, .L37+8
	ldr	r3, [r3]
	mov	r2, #10
	mov	r1, #1
	ldr	r0, .L37+32
	bl	fwrite
	mov	r3, #1
	b	.L35
.L29:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-36]
	mul	r2, r3, r2
	ldr	r3, [fp, #-32]
	add	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r2, r2, r3
	ldr	r3, [fp, #-40]
	ldr	r1, [fp, #-32]
	mul	r1, r3, r1
	ldr	r3, [fp, #-36]
	add	r3, r1, r3
	lsl	r3, r3, #2
	ldr	r1, [fp, #-20]
	add	r3, r1, r3
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L28:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L30
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L27:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	blt	.L31
	ldr	r3, [fp, #-40]
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	first_permutation
	ldr	r3, [fp, #-40]
	mov	r2, r3
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-20]
	bl	journey_distance
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	str	r3, [fp, #-24]
	b	.L32
.L34:
	ldr	r3, [fp, #-40]
	mov	r2, r3
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-20]
	bl	journey_distance
	str	r0, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	bge	.L33
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-28]
.L33:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	ble	.L32
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-24]
.L32:
	ldr	r3, [fp, #-40]
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	next_permutation
	mov	r3, r0
	cmp	r3, #0
	bne	.L34
	ldr	r1, [fp, #-28]
	ldr	r0, .L37+36
	bl	printf
	ldr	r1, [fp, #-24]
	ldr	r0, .L37+40
	bl	printf
	ldr	r0, [fp, #-20]
	bl	free
	ldr	r0, [fp, #-16]
	bl	free
	mov	r3, #0
.L35:
	ldr	r2, .L37
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L36
	bl	__stack_chk_fail
.L36:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L38:
	.align	2
.L37:
	.word	.LC9
	.word	.LC0
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
