	.file	"145108.c"
	.intel_syntax noprefix
	.text
	.type	TurnRight, @function
TurnRight:
.LFB6:
	.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
	cmp	DWORD PTR -4[rbp], 3
	je	.L2
	cmp	DWORD PTR -4[rbp], 3
	jg	.L3
	cmp	DWORD PTR -4[rbp], 2
	je	.L4
	cmp	DWORD PTR -4[rbp], 2
	jg	.L3
	cmp	DWORD PTR -4[rbp], 0
	je	.L5
	cmp	DWORD PTR -4[rbp], 1
	je	.L6
	jmp	.L3
.L5:
	mov	eax, 1
	jmp	.L7
.L6:
	mov	eax, 3
	jmp	.L7
.L2:
	mov	eax, 2
	jmp	.L7
.L4:
	mov	eax, 0
	jmp	.L7
.L3:
	mov	eax, -1
.L7:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	TurnRight, .-TurnRight
	.type	TurnLeft, @function
TurnLeft:
.LFB7:
	.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
	cmp	DWORD PTR -4[rbp], 3
	je	.L9
	cmp	DWORD PTR -4[rbp], 3
	jg	.L10
	cmp	DWORD PTR -4[rbp], 2
	je	.L11
	cmp	DWORD PTR -4[rbp], 2
	jg	.L10
	cmp	DWORD PTR -4[rbp], 0
	je	.L12
	cmp	DWORD PTR -4[rbp], 1
	je	.L13
	jmp	.L10
.L12:
	mov	eax, 2
	jmp	.L14
.L13:
	mov	eax, 0
	jmp	.L14
.L9:
	mov	eax, 1
	jmp	.L14
.L11:
	mov	eax, 3
	jmp	.L14
.L10:
	mov	eax, -1
.L14:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	TurnLeft, .-TurnLeft
	.local	W
	.comm	W,4,4
	.local	H
	.comm	H,4,4
	.local	SMax
	.comm	SMax,4,4
	.local	CurrPtns
	.comm	CurrPtns,8,8
	.local	PrevPtns
	.comm	PrevPtns,8,8
	.type	GetPtnP, @function
GetPtnP:
.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	DWORD PTR -12[rbp], esi
	mov	DWORD PTR -16[rbp], edx
	mov	DWORD PTR -20[rbp], ecx
	mov	eax, DWORD PTR H[rip]
	imul	eax, DWORD PTR -12[rbp]
	sal	eax, 2
	movsx	rdx, eax
	mov	eax, DWORD PTR -16[rbp]
	sal	eax, 2
	cdqe
	add	rdx, rax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	GetPtnP, .-GetPtnP
	.type	GetPtn, @function
GetPtn:
.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, 24
	mov	QWORD PTR -8[rbp], rdi
	mov	DWORD PTR -12[rbp], esi
	mov	DWORD PTR -16[rbp], edx
	mov	DWORD PTR -20[rbp], ecx
	mov	ecx, DWORD PTR -20[rbp]
	mov	edx, DWORD PTR -16[rbp]
	mov	esi, DWORD PTR -12[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	GetPtnP
	mov	eax, DWORD PTR [rax]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	GetPtn, .-GetPtn
	.type	SetPtn, @function
SetPtn:
.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, 24
	mov	QWORD PTR -8[rbp], rdi
	mov	DWORD PTR -12[rbp], esi
	mov	DWORD PTR -16[rbp], edx
	mov	DWORD PTR -20[rbp], ecx
	mov	DWORD PTR -24[rbp], r8d
	mov	ecx, DWORD PTR -20[rbp]
	mov	edx, DWORD PTR -16[rbp]
	mov	esi, DWORD PTR -12[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	GetPtnP
	mov	edx, DWORD PTR -24[rbp]
	mov	DWORD PTR [rax], edx
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	SetPtn, .-SetPtn
	.type	ClearPtns, @function
ClearPtns:
.LFB11:
	.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	DWORD PTR -4[rbp], 0
	jmp	.L21
.L22:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	DWORD PTR [rax], 0
	add	DWORD PTR -4[rbp], 1
.L21:
	mov	edx, DWORD PTR W[rip]
	mov	eax, DWORD PTR H[rip]
	imul	eax, edx
	sal	eax, 2
	cmp	DWORD PTR -4[rbp], eax
	jl	.L22
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	ClearPtns, .-ClearPtns
	.type	MakePrevPtns, @function
MakePrevPtns:
.LFB12:
	.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 -24[rbp], 0
	jmp	.L24
.L35:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L25
.L34:
	mov	DWORD PTR -16[rbp], 0
	jmp	.L26
.L33:
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	TurnRight
	mov	ecx, eax
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	edx, DWORD PTR -20[rbp]
	mov	esi, DWORD PTR -24[rbp]
	mov	rdi, rax
	call	GetPtn
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	TurnLeft
	mov	ecx, eax
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	edx, DWORD PTR -20[rbp]
	mov	esi, DWORD PTR -24[rbp]
	mov	rdi, rax
	call	GetPtn
	add	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -16[rbp], 3
	je	.L27
	cmp	DWORD PTR -16[rbp], 3
	jg	.L28
	cmp	DWORD PTR -16[rbp], 2
	je	.L29
	cmp	DWORD PTR -16[rbp], 2
	jg	.L28
	cmp	DWORD PTR -16[rbp], 0
	je	.L30
	cmp	DWORD PTR -16[rbp], 1
	je	.L31
	jmp	.L28
.L30:
	sub	DWORD PTR -4[rbp], 1
	jmp	.L28
.L31:
	add	DWORD PTR -8[rbp], 1
	jmp	.L28
.L29:
	sub	DWORD PTR -8[rbp], 1
	jmp	.L28
.L27:
	add	DWORD PTR -4[rbp], 1
	nop
.L28:
	cmp	DWORD PTR -8[rbp], 0
	js	.L32
	mov	eax, DWORD PTR W[rip]
	cmp	DWORD PTR -8[rbp], eax
	jge	.L32
	cmp	DWORD PTR -4[rbp], 0
	js	.L32
	mov	eax, DWORD PTR H[rip]
	cmp	DWORD PTR -4[rbp], eax
	jge	.L32
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	ecx, DWORD PTR -16[rbp]
	mov	edx, DWORD PTR -4[rbp]
	mov	esi, DWORD PTR -8[rbp]
	mov	rdi, rax
	call	GetPtn
	add	DWORD PTR -12[rbp], eax
.L32:
	mov	rax, QWORD PTR PrevPtns[rip]
	mov	edi, DWORD PTR -12[rbp]
	mov	ecx, DWORD PTR -16[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	esi, DWORD PTR -24[rbp]
	mov	r8d, edi
	mov	rdi, rax
	call	SetPtn
	add	DWORD PTR -16[rbp], 1
.L26:
	cmp	DWORD PTR -16[rbp], 3
	jle	.L33
	add	DWORD PTR -20[rbp], 1
.L25:
	mov	eax, DWORD PTR H[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L34
	add	DWORD PTR -24[rbp], 1
.L24:
	mov	eax, DWORD PTR W[rip]
	cmp	DWORD PTR -24[rbp], eax
	jl	.L35
	mov	eax, DWORD PTR H[rip]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR W[rip]
	lea	esi, -1[rax]
	mov	rax, QWORD PTR PrevPtns[rip]
	mov	r8d, 0
	mov	ecx, 0
	mov	rdi, rax
	call	SetPtn
	mov	eax, DWORD PTR H[rip]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR W[rip]
	lea	esi, -1[rax]
	mov	rax, QWORD PTR PrevPtns[rip]
	mov	r8d, 0
	mov	ecx, 1
	mov	rdi, rax
	call	SetPtn
	mov	eax, DWORD PTR H[rip]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR W[rip]
	lea	esi, -1[rax]
	mov	rax, QWORD PTR PrevPtns[rip]
	mov	r8d, 0
	mov	ecx, 2
	mov	rdi, rax
	call	SetPtn
	mov	eax, DWORD PTR H[rip]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR W[rip]
	lea	esi, -1[rax]
	mov	rax, QWORD PTR PrevPtns[rip]
	mov	r8d, 0
	mov	ecx, 3
	mov	rdi, rax
	call	SetPtn
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	MakePrevPtns, .-MakePrevPtns
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.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, 24
	.cfi_offset 3, -24
	lea	rcx, SMax[rip]
	lea	rdx, H[rip]
	lea	rsi, W[rip]
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	edx, DWORD PTR W[rip]
	mov	eax, DWORD PTR H[rip]
	imul	eax, edx
	sal	eax, 2
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR CurrPtns[rip], rax
	mov	edx, DWORD PTR W[rip]
	mov	eax, DWORD PTR H[rip]
	imul	eax, edx
	sal	eax, 2
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR PrevPtns[rip], rax
	mov	rax, QWORD PTR CurrPtns[rip]
	test	rax, rax
	je	.L37
	mov	rax, QWORD PTR PrevPtns[rip]
	test	rax, rax
	jne	.L38
.L37:
	mov	edi, 1
	call	exit@PLT
.L38:
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	rdi, rax
	call	ClearPtns
	mov	eax, DWORD PTR H[rip]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR W[rip]
	lea	esi, -1[rax]
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	r8d, 1
	mov	ecx, 0
	mov	rdi, rax
	call	SetPtn
	mov	eax, DWORD PTR H[rip]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR W[rip]
	lea	esi, -1[rax]
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	r8d, 1
	mov	ecx, 1
	mov	rdi, rax
	call	SetPtn
	mov	eax, DWORD PTR H[rip]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR W[rip]
	lea	esi, -1[rax]
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	r8d, 1
	mov	ecx, 2
	mov	rdi, rax
	call	SetPtn
	mov	eax, DWORD PTR H[rip]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR W[rip]
	lea	esi, -1[rax]
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	r8d, 1
	mov	ecx, 3
	mov	rdi, rax
	call	SetPtn
	mov	DWORD PTR -32[rbp], 0
	jmp	.L39
.L40:
	call	MakePrevPtns
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR PrevPtns[rip]
	mov	QWORD PTR CurrPtns[rip], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR PrevPtns[rip], rax
	add	DWORD PTR -32[rbp], 1
.L39:
	mov	eax, DWORD PTR SMax[rip]
	cmp	DWORD PTR -32[rbp], eax
	jl	.L40
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	ecx, 0
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	GetPtn
	mov	ebx, eax
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	ecx, 1
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	GetPtn
	add	ebx, eax
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	ecx, 2
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	GetPtn
	add	ebx, eax
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	ecx, 3
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	GetPtn
	add	eax, ebx
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR CurrPtns[rip]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR PrevPtns[rip]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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	"145108.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	TurnRight, %function
TurnRight:
	@ 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]
	ldr	r3, [fp, #-8]
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L2
.L4:
	.word	.L7
	.word	.L6
	.word	.L5
	.word	.L3
.L7:
	mov	r3, #1
	b	.L8
.L6:
	mov	r3, #3
	b	.L8
.L3:
	mov	r3, #2
	b	.L8
.L5:
	mov	r3, #0
	b	.L8
.L2:
	mvn	r3, #0
.L8:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	TurnRight, .-TurnRight
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	TurnLeft, %function
TurnLeft:
	@ 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]
	ldr	r3, [fp, #-8]
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L10
.L12:
	.word	.L15
	.word	.L14
	.word	.L13
	.word	.L11
.L15:
	mov	r3, #2
	b	.L16
.L14:
	mov	r3, #0
	b	.L16
.L11:
	mov	r3, #1
	b	.L16
.L13:
	mov	r3, #3
	b	.L16
.L10:
	mvn	r3, #0
.L16:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	TurnLeft, .-TurnLeft
	.local	W
	.comm	W,4,4
	.local	H
	.comm	H,4,4
	.local	SMax
	.comm	SMax,4,4
	.local	CurrPtns
	.comm	CurrPtns,4,4
	.local	PrevPtns
	.comm	PrevPtns,4,4
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	GetPtnP, %function
GetPtnP:
	@ 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]
	str	r3, [fp, #-20]
	ldr	r3, .L19
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r2, r2, r3
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L20:
	.align	2
.L19:
	.word	H
	.size	GetPtnP, .-GetPtnP
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	GetPtn, %function
GetPtn:
	@ 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, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	GetPtnP
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	GetPtn, .-GetPtn
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	SetPtn, %function
SetPtn:
	@ args = 4, 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, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	GetPtnP
	mov	r2, r0
	ldr	r3, [fp, #4]
	str	r3, [r2]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	SetPtn, .-SetPtn
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ClearPtns, %function
ClearPtns:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L25
.L26:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L25:
	ldr	r3, .L27
	ldr	r3, [r3]
	ldr	r2, .L27+4
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L26
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L28:
	.align	2
.L27:
	.word	W
	.word	H
	.size	ClearPtns, .-ClearPtns
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	MakePrevPtns, %function
MakePrevPtns:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #36
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L30
.L42:
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L31
.L41:
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L32
.L40:
	ldr	r3, .L43
	ldr	r4, [r3]
	ldr	r0, [fp, #-28]
	bl	TurnRight
	mov	r3, r0
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-36]
	mov	r0, r4
	bl	GetPtn
	str	r0, [fp, #-24]
	ldr	r3, .L43
	ldr	r4, [r3]
	ldr	r0, [fp, #-28]
	bl	TurnLeft
	mov	r3, r0
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-36]
	mov	r0, r4
	bl	GetPtn
	mov	r2, r0
	ldr	r3, [fp, #-24]
	add	r3, r3, r2
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-36]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-28]
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L33
.L35:
	.word	.L38
	.word	.L37
	.word	.L36
	.word	.L34
.L38:
	ldr	r3, [fp, #-16]
	sub	r3, r3, #1
	str	r3, [fp, #-16]
	b	.L33
.L37:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	b	.L33
.L36:
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	str	r3, [fp, #-20]
	b	.L33
.L34:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	nop
.L33:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	blt	.L39
	ldr	r3, .L43+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bge	.L39
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	blt	.L39
	ldr	r3, .L43+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bge	.L39
	ldr	r3, .L43
	ldr	r0, [r3]
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-16]
	ldr	r1, [fp, #-20]
	bl	GetPtn
	mov	r2, r0
	ldr	r3, [fp, #-24]
	add	r3, r3, r2
	str	r3, [fp, #-24]
.L39:
	ldr	r3, .L43+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	str	r3, [sp]
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-36]
	bl	SetPtn
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L32:
	ldr	r3, [fp, #-28]
	cmp	r3, #3
	ble	.L40
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L31:
	ldr	r3, .L43+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L41
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L30:
	ldr	r3, .L43+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	blt	.L42
	ldr	r3, .L43+12
	ldr	r0, [r3]
	ldr	r3, .L43+4
	ldr	r3, [r3]
	sub	r1, r3, #1
	ldr	r3, .L43+8
	ldr	r3, [r3]
	sub	r2, r3, #1
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	bl	SetPtn
	ldr	r3, .L43+12
	ldr	r0, [r3]
	ldr	r3, .L43+4
	ldr	r3, [r3]
	sub	r1, r3, #1
	ldr	r3, .L43+8
	ldr	r3, [r3]
	sub	r2, r3, #1
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #1
	bl	SetPtn
	ldr	r3, .L43+12
	ldr	r0, [r3]
	ldr	r3, .L43+4
	ldr	r3, [r3]
	sub	r1, r3, #1
	ldr	r3, .L43+8
	ldr	r3, [r3]
	sub	r2, r3, #1
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #2
	bl	SetPtn
	ldr	r3, .L43+12
	ldr	r0, [r3]
	ldr	r3, .L43+4
	ldr	r3, [r3]
	sub	r1, r3, #1
	ldr	r3, .L43+8
	ldr	r3, [r3]
	sub	r2, r3, #1
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #3
	bl	SetPtn
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L44:
	.align	2
.L43:
	.word	CurrPtns
	.word	W
	.word	H
	.word	PrevPtns
	.size	MakePrevPtns, .-MakePrevPtns
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d %d %d\000"
	.align	2
.LC1:
	.ascii	"%d\012\000"
	.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	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	ldr	r3, .L51
	ldr	r2, .L51+4
	ldr	r1, .L51+8
	ldr	r0, .L51+12
	bl	__isoc99_scanf
	ldr	r3, .L51+8
	ldr	r3, [r3]
	ldr	r2, .L51+4
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #4
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L51+16
	str	r2, [r3]
	ldr	r3, .L51+8
	ldr	r3, [r3]
	ldr	r2, .L51+4
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #4
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L51+20
	str	r2, [r3]
	ldr	r3, .L51+16
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L46
	ldr	r3, .L51+20
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L47
.L46:
	mov	r0, #1
	bl	exit
.L47:
	ldr	r3, .L51+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	ClearPtns
	ldr	r3, .L51+16
	ldr	r0, [r3]
	ldr	r3, .L51+8
	ldr	r3, [r3]
	sub	r1, r3, #1
	ldr	r3, .L51+4
	ldr	r3, [r3]
	sub	r2, r3, #1
	mov	r3, #1
	str	r3, [sp]
	mov	r3, #0
	bl	SetPtn
	ldr	r3, .L51+16
	ldr	r0, [r3]
	ldr	r3, .L51+8
	ldr	r3, [r3]
	sub	r1, r3, #1
	ldr	r3, .L51+4
	ldr	r3, [r3]
	sub	r2, r3, #1
	mov	r3, #1
	str	r3, [sp]
	mov	r3, #1
	bl	SetPtn
	ldr	r3, .L51+16
	ldr	r0, [r3]
	ldr	r3, .L51+8
	ldr	r3, [r3]
	sub	r1, r3, #1
	ldr	r3, .L51+4
	ldr	r3, [r3]
	sub	r2, r3, #1
	mov	r3, #1
	str	r3, [sp]
	mov	r3, #2
	bl	SetPtn
	ldr	r3, .L51+16
	ldr	r0, [r3]
	ldr	r3, .L51+8
	ldr	r3, [r3]
	sub	r1, r3, #1
	ldr	r3, .L51+4
	ldr	r3, [r3]
	sub	r2, r3, #1
	mov	r3, #1
	str	r3, [sp]
	mov	r3, #3
	bl	SetPtn
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L48
.L49:
	bl	MakePrevPtns
	ldr	r3, .L51+16
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	ldr	r3, .L51+20
	ldr	r3, [r3]
	ldr	r2, .L51+16
	str	r3, [r2]
	ldr	r2, .L51+20
	ldr	r3, [fp, #-16]
	str	r3, [r2]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L48:
	ldr	r3, .L51
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L49
	ldr	r3, .L51+16
	ldr	r0, [r3]
	mov	r3, #0
	mov	r2, #0
	mov	r1, #0
	bl	GetPtn
	mov	r4, r0
	ldr	r3, .L51+16
	ldr	r0, [r3]
	mov	r3, #1
	mov	r2, #0
	mov	r1, #0
	bl	GetPtn
	mov	r3, r0
	add	r4, r4, r3
	ldr	r3, .L51+16
	ldr	r0, [r3]
	mov	r3, #2
	mov	r2, #0
	mov	r1, #0
	bl	GetPtn
	mov	r3, r0
	add	r4, r4, r3
	ldr	r3, .L51+16
	ldr	r0, [r3]
	mov	r3, #3
	mov	r2, #0
	mov	r1, #0
	bl	GetPtn
	mov	r3, r0
	add	r3, r4, r3
	str	r3, [fp, #-20]
	ldr	r1, [fp, #-20]
	ldr	r0, .L51+24
	bl	printf
	ldr	r3, .L51+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L51+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L52:
	.align	2
.L51:
	.word	SMax
	.word	H
	.word	W
	.word	.LC0
	.word	CurrPtns
	.word	PrevPtns
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
