	.file	"151704726.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Start:"
.LC1:
	.string	"Turn %d:\n"
.LC2:
	.string	" K "
.LC3:
	.string	" . "
	.text
	.globl	output
	.type	output, @function
output:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -28[rbp], rsi
	cmp	DWORD PTR -20[rbp], 0
	jne	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	jmp	.L3
.L2:
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
.L3:
	mov	DWORD PTR -8[rbp], 0
	jmp	.L4
.L9:
	mov	DWORD PTR -4[rbp], 0
	jmp	.L5
.L8:
	mov	eax, DWORD PTR -28[rbp]
	cmp	DWORD PTR -8[rbp], eax
	jne	.L6
	mov	eax, DWORD PTR -24[rbp]
	cmp	DWORD PTR -4[rbp], eax
	jne	.L6
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L7
.L6:
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L7:
	add	DWORD PTR -4[rbp], 1
.L5:
	cmp	DWORD PTR -4[rbp], 7
	jle	.L8
	mov	edi, 10
	call	putchar@PLT
	add	DWORD PTR -8[rbp], 1
.L4:
	cmp	DWORD PTR -8[rbp], 7
	jle	.L9
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	output, .-output
	.globl	move
	.type	move, @function
move:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1431655766
	shr	rdx, 32
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	ecx, edx
	add	ecx, ecx
	add	ecx, edx
	sub	eax, ecx
	mov	edx, eax
	lea	eax, -1[rdx]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	move, .-move
	.globl	escaped
	.type	escaped, @function
escaped:
.LFB8:
	.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	eax, DWORD PTR -8[rbp]
	test	eax, eax
	jns	.L13
	mov	eax, 1
	jmp	.L14
.L13:
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, 7
	jle	.L15
	mov	eax, 1
	jmp	.L14
.L15:
	mov	eax, DWORD PTR -4[rbp]
	test	eax, eax
	jns	.L16
	mov	eax, 1
	jmp	.L14
.L16:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, 7
	jle	.L17
	mov	eax, 1
	jmp	.L14
.L17:
	mov	eax, 0
.L14:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	escaped, .-escaped
	.section	.rodata
	.align 8
.LC4:
	.string	"The king wandered off the grid after %d turns\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 16
	mov	DWORD PTR -12[rbp], 0
	mov	DWORD PTR -8[rbp], 3
	mov	DWORD PTR -4[rbp], 4
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
.L21:
	mov	rdx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	output
	call	move
	mov	edx, DWORD PTR -8[rbp]
	add	eax, edx
	mov	DWORD PTR -8[rbp], eax
	call	move
	mov	edx, DWORD PTR -4[rbp]
	add	eax, edx
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	escaped
	test	eax, eax
	jne	.L24
	add	DWORD PTR -12[rbp], 1
	jmp	.L21
.L24:
	nop
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"151704726.c"
	.text
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Start:\000"
	.align	2
.LC2:
	.ascii	"Turn %d:\012\000"
	.align	2
.LC3:
	.ascii	" K \000"
	.align	2
.LC4:
	.ascii	" . \000"
	.text
	.align	2
	.global	output
	.syntax unified
	.arm
	.fpu softvfp
	.type	output, %function
output:
	@ 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]
	sub	r3, fp, #24
	stm	r3, {r1, r2}
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L10
	bl	puts
	b	.L3
.L2:
	ldr	r1, [fp, #-16]
	ldr	r0, .L10+4
	bl	printf
.L3:
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L4
.L9:
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L5
.L8:
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bne	.L6
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bne	.L6
	ldr	r0, .L10+8
	bl	printf
	b	.L7
.L6:
	ldr	r0, .L10+12
	bl	printf
.L7:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L5:
	ldr	r3, [fp, #-8]
	cmp	r3, #7
	ble	.L8
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L4:
	ldr	r3, [fp, #-12]
	cmp	r3, #7
	ble	.L9
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	output, .-output
	.align	2
	.global	move
	.syntax unified
	.arm
	.fpu softvfp
	.type	move, %function
move:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	bl	rand
	mov	r1, r0
	ldr	r3, .L14
	smull	r0, r2, r3, r1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	sub	r2, r1, r3
	sub	r3, r2, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	1431655766
	.size	move, .-move
	.align	2
	.global	escaped
	.syntax unified
	.arm
	.fpu softvfp
	.type	escaped, %function
escaped:
	@ 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
	sub	r3, fp, #12
	stm	r3, {r0, r1}
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L17
	mov	r3, #1
	b	.L18
.L17:
	ldr	r3, [fp, #-12]
	cmp	r3, #7
	ble	.L19
	mov	r3, #1
	b	.L18
.L19:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L20
	mov	r3, #1
	b	.L18
.L20:
	ldr	r3, [fp, #-8]
	cmp	r3, #7
	ble	.L21
	mov	r3, #1
	b	.L18
.L21:
	mov	r3, #0
.L18:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	escaped, .-escaped
	.section	.rodata
	.align	2
.LC5:
	.ascii	"The king wandered off the grid after %d turns\012\000"
	.align	2
.LC0:
	.word	3
	.word	4
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r2, .L29
	sub	r3, fp, #12
	ldm	r2, {r0, r1}
	stm	r3, {r0, r1}
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
.L25:
	sub	r3, fp, #12
	ldm	r3, {r1, r2}
	ldr	r0, [fp, #-16]
	bl	output
	bl	move
	mov	r2, r0
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
	bl	move
	mov	r2, r0
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	sub	r3, fp, #12
	ldm	r3, {r0, r1}
	bl	escaped
	mov	r3, r0
	cmp	r3, #0
	bne	.L28
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	b	.L25
.L28:
	nop
	ldr	r1, [fp, #-16]
	ldr	r0, .L29+4
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC0
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
