	.file	"150143880.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Qual a posi\303\247\303\243o do GHOST? (x,y)"
	.align 8
.LC1:
	.string	"Qual a posicao do pacman (x,y) "
.LC2:
	.string	"x: "
.LC3:
	.string	"%d"
.LC4:
	.string	"y: "
	.align 8
.LC5:
	.string	"Qual a dire\303\247\303\243o do ghost ?  = 1-Down , 2-Right, 3-Up, 4-Left = "
	.align 8
.LC6:
	.string	"Qual a dire\303\247\303\243o do pacman? = 1-Down , 2-Right, 3-Up, 4-Left = "
	.text
	.globl	read_player
	.type	read_player, @function
read_player:
.LFB0:
	.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 -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	eax, edx
	mov	BYTE PTR -36[rbp], al
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
.L4:
	cmp	BYTE PTR -36[rbp], 51
	jne	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	jmp	.L3
.L2:
	lea	rdi, .LC1[rip]
	call	puts@PLT
.L3:
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -12[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	edx, DWORD PTR -12[rbp]
	mov	ecx, DWORD PTR -16[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	mov	eax, 0
	call	validate_position@PLT
	test	eax, eax
	je	.L4
	mov	edx, DWORD PTR -16[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 4[rax]
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 8[rax]
	movsx	eax, BYTE PTR -36[rbp]
	mov	DWORD PTR [rdx], eax
	movsx	edx, BYTE PTR -36[rbp]
	mov	rcx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	mov	eax, 0
	call	position@PLT
	mov	eax, 0
	call	clear_screen@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	print_maze@PLT
.L12:
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -16[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR -12[rbp], eax
	cmp	BYTE PTR -36[rbp], 51
	jne	.L5
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L6
.L5:
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
.L6:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	je	.L7
	cmp	eax, 4
	jg	.L8
	cmp	eax, 3
	je	.L9
	cmp	eax, 3
	jg	.L8
	cmp	eax, 1
	je	.L10
	cmp	eax, 2
	je	.L11
	jmp	.L8
.L10:
	mov	eax, DWORD PTR -16[rbp]
	add	eax, 1
	mov	DWORD PTR -16[rbp], eax
	jmp	.L8
.L11:
	mov	eax, DWORD PTR -12[rbp]
	add	eax, 1
	mov	DWORD PTR -12[rbp], eax
	jmp	.L8
.L9:
	mov	eax, DWORD PTR -16[rbp]
	sub	eax, 1
	mov	DWORD PTR -16[rbp], eax
	jmp	.L8
.L7:
	mov	eax, DWORD PTR -12[rbp]
	sub	eax, 1
	mov	DWORD PTR -12[rbp], eax
	nop
.L8:
	mov	edx, DWORD PTR -12[rbp]
	mov	ecx, DWORD PTR -16[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	mov	eax, 0
	call	validate_position@PLT
	test	eax, eax
	je	.L12
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	jg	.L12
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jle	.L12
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	read_player, .-read_player
	.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	"150143880.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Qual a posi\303\247\303\243o do GHOST? (x,y)\000"
	.align	2
.LC1:
	.ascii	"Qual a posicao do pacman (x,y) \000"
	.align	2
.LC2:
	.ascii	"x: \000"
	.align	2
.LC3:
	.ascii	"%d\000"
	.align	2
.LC4:
	.ascii	"y: \000"
	.align	2
.LC5:
	.ascii	"Qual a dire\303\247\303\243o do ghost ?  = 1-Down ,"
	.ascii	" 2-Right, 3-Up, 4-Left = \000"
	.align	2
.LC6:
	.ascii	"Qual a dire\303\247\303\243o do pacman? = 1-Down , "
	.ascii	"2-Right, 3-Up, 4-Left = \000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_player
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_player, %function
read_player:
	@ 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, #-24]
	str	r1, [fp, #-28]
	mov	r3, r2
	strb	r3, [fp, #-29]
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
.L4:
	ldrb	r3, [fp, #-29]	@ zero_extendqisi2
	cmp	r3, #51
	bne	.L2
	ldr	r0, .L15+4
	bl	puts
	b	.L3
.L2:
	ldr	r0, .L15+8
	bl	puts
.L3:
	ldr	r0, .L15+12
	bl	printf
	sub	r3, fp, #12
	mov	r1, r3
	ldr	r0, .L15+16
	bl	__isoc99_scanf
	ldr	r0, .L15+20
	bl	printf
	sub	r3, fp, #16
	mov	r1, r3
	ldr	r0, .L15+16
	bl	__isoc99_scanf
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	validate_position
	mov	r3, r0
	cmp	r3, #0
	beq	.L4
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-28]
	str	r2, [r3]
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r2, [fp, #-12]
	str	r2, [r3]
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	ldrb	r2, [fp, #-29]	@ zero_extendqisi2
	str	r2, [r3]
	ldrb	r3, [fp, #-29]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r1, [fp, #-28]
	ldr	r0, [fp, #-24]
	bl	position
	bl	clear_screen
	ldr	r0, [fp, #-24]
	bl	print_maze
.L13:
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-12]
	ldrb	r3, [fp, #-29]	@ zero_extendqisi2
	cmp	r3, #51
	bne	.L5
	ldr	r0, .L15+24
	bl	printf
	b	.L6
.L5:
	ldr	r0, .L15+28
	bl	printf
.L6:
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	mov	r1, r3
	ldr	r0, .L15+16
	bl	__isoc99_scanf
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	ldr	r3, [r3]
	sub	r3, r3, #1
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L7
.L9:
	.word	.L12
	.word	.L11
	.word	.L10
	.word	.L8
.L12:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	b	.L7
.L11:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L7
.L10:
	ldr	r3, [fp, #-16]
	sub	r3, r3, #1
	str	r3, [fp, #-16]
	b	.L7
.L8:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	nop
.L7:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	validate_position
	mov	r3, r0
	cmp	r3, #0
	beq	.L13
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	ldr	r3, [r3]
	cmp	r3, #4
	bgt	.L13
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L13
	nop
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC7
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	read_player, .-read_player
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
