	.file	"extr_Scene_b.c_SceneHandleInput.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	SceneHandleInput, @function
SceneHandleInput:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	QWORD PTR scene_loaded[rip], 0
	je	.L29
	mov	eax, DWORD PTR scene_input_ready[rip]
	test	eax, eax
	jne	.L4
	xor	eax, eax
	test	BYTE PTR joy[rip], -16
	sete	al
	mov	DWORD PTR scene_input_ready[rip], eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xor	eax, eax
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	UIOnInteract@PLT
	xor	edi, edi
	call	ACTOR_ON_TILE@PLT
	test	eax, eax
	je	.L1
	mov	rax, QWORD PTR script_ptr[rip]
	or	rax, QWORD PTR emote_timer[rip]
	or	rax, QWORD PTR fade_running[rip]
	jne	.L17
	mov	ecx, DWORD PTR joy[rip]
	test	ecx, ecx
	je	.L7
	cmp	ecx, DWORD PTR last_joy[rip]
	je	.L7
	mov	rdi, QWORD PTR input_script_ptrs[rip]
	mov	eax, ecx
	lea	rdx, 64[rdi]
	.p2align 4,,10
	.p2align 3
.L9:
	test	al, 1
	je	.L8
	cmp	QWORD PTR [rdi], 0
	jne	.L32
.L8:
	add	rdi, 8
	sar	eax
	cmp	rdi, rdx
	jne	.L9
.L7:
	mov	edi, DWORD PTR J_A[rip]
	call	JOY_PRESSED@PLT
	test	rax, rax
	mov	eax, DWORD PTR joy[rip]
	jne	.L33
	mov	rdx, QWORD PTR actors[rip]
	cmp	QWORD PTR 8[rdx], 0
	je	.L34
.L12:
	mov	edi, DWORD PTR J_LEFT[rip]
	mov	DWORD PTR last_joy[rip], eax
	call	JOY@PLT
	test	rax, rax
	je	.L13
	lea	rax, dir_left[rip]
	mov	QWORD PTR update_dir[rip], rax
.L14:
	add	rsp, 8
	.cfi_def_cfa_offset 24
	xor	edi, edi
	pop	rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	SceneUpdateActorMovement_b@PLT
	.p2align 4,,10
	.p2align 3
.L29:
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -24
	.cfi_offset 6, -16
	mov	rax, QWORD PTR actors[rip]
	mov	rdx, QWORD PTR FALSE[rip]
	mov	QWORD PTR 8[rax], rdx
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	mov	rdx, QWORD PTR FALSE[rip]
	mov	DWORD PTR last_joy[rip], eax
	mov	rax, QWORD PTR actors[rip]
	mov	QWORD PTR 8[rax], rdx
	mov	edi, DWORD PTR 36[rax]
	call	DIV_8@PLT
	mov	rdx, QWORD PTR actors[rip]
	mov	edi, DWORD PTR 32[rdx]
	add	eax, DWORD PTR 28[rdx]
	mov	ebp, eax
	call	DIV_8@PLT
	mov	rdx, QWORD PTR actors[rip]
	mov	esi, ebp
	xor	edi, edi
	add	eax, DWORD PTR 24[rdx]
	mov	edx, eax
	call	SceneNpcAt_b@PLT
	cmp	DWORD PTR scene_num_actors[rip], eax
	mov	ebp, eax
	je	.L1
	cdqe
	mov	rdx, QWORD PTR actors[rip]
	mov	rcx, QWORD PTR FALSE[rip]
	lea	rbx, [rax+rax*4]
	sal	rbx, 3
	mov	QWORD PTR 8[rdx], rcx
	lea	rax, [rdx+rbx]
	mov	rsi, QWORD PTR [rax]
	cmp	rsi, QWORD PTR NONE[rip]
	je	.L11
	cmp	rsi, QWORD PTR AI_ROTATE_TRB[rip]
	je	.L11
	mov	esi, DWORD PTR 28[rdx]
	mov	edx, DWORD PTR 24[rdx]
	neg	esi
	neg	edx
	mov	DWORD PTR 28[rax], esi
	mov	DWORD PTR 24[rax], edx
.L11:
	mov	QWORD PTR 8[rax], rcx
	mov	edi, ebp
	call	SceneRenderActor_b@PLT
	add	rbx, QWORD PTR actors[rip]
	mov	DWORD PTR script_actor[rip], ebp
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbx
	pop	rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	add	rdi, 16
	jmp	ScriptStart@PLT
	.p2align 4,,10
	.p2align 3
.L34:
	.cfi_restore_state
	cmp	DWORD PTR last_joy[rip], eax
	jne	.L12
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edi, DWORD PTR J_RIGHT[rip]
	call	JOY@PLT
	test	rax, rax
	je	.L15
	lea	rax, dir_right[rip]
	mov	QWORD PTR update_dir[rip], rax
	jmp	.L14
.L32:
	mov	rax, QWORD PTR actors[rip]
	mov	rdx, QWORD PTR FALSE[rip]
	mov	DWORD PTR last_joy[rip], ecx
	mov	QWORD PTR 8[rax], rdx
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	ScriptStart@PLT
.L15:
	.cfi_restore_state
	mov	edi, DWORD PTR J_UP[rip]
	call	JOY@PLT
	test	rax, rax
	je	.L16
	lea	rax, dir_up[rip]
	mov	QWORD PTR update_dir[rip], rax
	jmp	.L14
.L16:
	mov	edi, DWORD PTR J_DOWN[rip]
	call	JOY@PLT
	test	rax, rax
	je	.L17
	lea	rax, dir_down[rip]
	mov	QWORD PTR update_dir[rip], rax
	jmp	.L14
	.cfi_endproc
.LFE0:
	.size	SceneHandleInput, .-SceneHandleInput
	.comm	update_dir,8,8
	.comm	script_ptr,8,8
	.comm	script_actor,4,4
	.comm	scene_num_actors,4,4
	.comm	scene_loaded,8,8
	.comm	scene_input_ready,4,4
	.comm	last_joy,4,4
	.comm	joy,4,4
	.comm	input_script_ptrs,8,8
	.comm	fade_running,8,8
	.comm	emote_timer,8,8
	.comm	dir_up,4,4
	.comm	dir_right,4,4
	.comm	dir_left,4,4
	.comm	dir_down,4,4
	.comm	actors,8,8
	.comm	NONE,8,8
	.comm	J_UP,4,4
	.comm	J_RIGHT,4,4
	.comm	J_LEFT,4,4
	.comm	J_DOWN,4,4
	.comm	J_A,4,4
	.comm	FALSE,8,8
	.comm	AI_ROTATE_TRB,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_Scene_b.c_SceneHandleInput.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	SceneHandleInput, %function
SceneHandleInput:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L39
	ldr	r3, [r3]
	cmp	r3, #0
	bxeq	lr
	ldr	r3, .L39+4
	ldr	r2, [r3]
	cmp	r2, #0
	bne	.L4
	ldr	r2, .L39+8
	ldr	r2, [r2]
	tst	r2, #240
	moveq	r2, #1
	movne	r2, #0
	str	r2, [r3]
	bx	lr
.L4:
	push	{r4, r5, r6, r7, r8, lr}
	bl	UIOnInteract
	mov	r0, #0
	bl	ACTOR_ON_TILE
	cmp	r0, #0
	popeq	{r4, r5, r6, r7, r8, pc}
	ldr	r3, .L39+12
	ldr	r1, .L39+16
	ldr	r2, .L39+20
	ldr	r3, [r3]
	ldr	r1, [r1]
	ldr	r2, [r2]
	orr	r3, r3, r1
	orrs	r3, r3, r2
	bne	.L35
	ldr	r4, .L39+8
	ldr	r5, .L39+24
	ldr	r1, [r4]
	cmp	r1, #0
	beq	.L7
	ldr	r3, [r5]
	cmp	r1, r3
	beq	.L7
	mov	r3, r1
	ldr	r2, .L39+28
	ldr	r0, [r2]
	add	r2, r0, #32
.L9:
	tst	r3, #1
	beq	.L8
	ldr	ip, [r0]
	cmp	ip, #0
	bne	.L36
.L8:
	add	r0, r0, #4
	cmp	r0, r2
	asr	r3, r3, #1
	bne	.L9
.L7:
	ldr	r3, .L39+32
	ldr	r6, .L39+36
	ldr	r0, [r3]
	bl	JOY_PRESSED
	cmp	r0, #0
	bne	.L37
	ldr	r2, [r6]
	ldr	r3, [r4]
	ldr	r2, [r2, #4]
	cmp	r2, #0
	beq	.L38
.L12:
	ldr	r2, .L39+40
	str	r3, [r5]
	ldr	r0, [r2]
	bl	JOY
	cmp	r0, #0
	beq	.L13
	ldr	r3, .L39+44
	ldr	r2, .L39+48
	str	r2, [r3]
.L14:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, lr}
	b	SceneUpdateActorMovement_b
.L35:
	ldr	r3, .L39+36
	ldr	r2, .L39+52
	ldr	r3, [r3]
	ldr	r2, [r2]
	str	r2, [r3, #4]
	pop	{r4, r5, r6, r7, r8, pc}
.L37:
	ldr	r7, .L39+52
	ldr	r3, [r6]
	ldr	r1, [r7]
	ldr	r2, [r4]
	str	r1, [r3, #4]
	ldr	r0, [r3, #24]
	str	r2, [r5]
	bl	DIV_8
	mov	r4, r0
	ldr	r3, [r6]
	ldr	r1, [r3, #16]
	ldr	r0, [r3, #20]
	add	r4, r4, r1
	bl	DIV_8
	mov	r2, r0
	ldr	r3, [r6]
	mov	r1, r4
	ldr	r3, [r3, #12]
	mov	r0, #0
	add	r2, r2, r3
	bl	SceneNpcAt_b
	ldr	r3, .L39+56
	mov	r4, r0
	ldr	r3, [r3]
	cmp	r3, r0
	popeq	{r4, r5, r6, r7, r8, pc}
	ldr	r2, [r6]
	rsb	r3, r0, r0, lsl #3
	ldr	r1, .L39+60
	lsl	r5, r3, #2
	ldr	r0, [r2, r5]
	ldr	ip, [r1]
	ldr	r1, [r7]
	cmp	r0, ip
	str	r1, [r2, #4]
	add	r3, r2, r3, lsl #2
	beq	.L11
	ldr	ip, .L39+64
	ldr	ip, [ip]
	cmp	r0, ip
	beq	.L11
	ldr	r0, [r2, #16]
	ldr	r2, [r2, #12]
	rsb	r0, r0, #0
	rsb	r2, r2, #0
	str	r0, [r3, #16]
	str	r2, [r3, #12]
.L11:
	mov	r0, r4
	str	r1, [r3, #4]
	bl	SceneRenderActor_b
	ldr	r0, [r6]
	ldr	r3, .L39+68
	add	r0, r0, r5
	str	r4, [r3]
	add	r0, r0, #8
	pop	{r4, r5, r6, r7, r8, lr}
	b	ScriptStart
.L38:
	ldr	r2, [r5]
	cmp	r2, r3
	bne	.L12
	pop	{r4, r5, r6, r7, r8, pc}
.L13:
	ldr	r3, .L39+72
	ldr	r0, [r3]
	bl	JOY
	cmp	r0, #0
	beq	.L15
	ldr	r3, .L39+44
	ldr	r2, .L39+76
	str	r2, [r3]
	b	.L14
.L36:
	ldr	r3, .L39+36
	ldr	r2, .L39+52
	ldr	r3, [r3]
	ldr	r2, [r2]
	str	r1, [r5]
	str	r2, [r3, #4]
	pop	{r4, r5, r6, r7, r8, lr}
	b	ScriptStart
.L15:
	ldr	r3, .L39+80
	ldr	r0, [r3]
	bl	JOY
	cmp	r0, #0
	ldrne	r3, .L39+44
	ldrne	r2, .L39+84
	strne	r2, [r3]
	bne	.L14
.L16:
	ldr	r3, .L39+88
	ldr	r0, [r3]
	bl	JOY
	cmp	r0, #0
	ldrne	r3, .L39+44
	ldrne	r2, .L39+92
	strne	r2, [r3]
	bne	.L14
.L17:
	ldr	r2, .L39+52
	ldr	r3, [r6]
	ldr	r2, [r2]
	str	r2, [r3, #4]
	pop	{r4, r5, r6, r7, r8, pc}
.L40:
	.align	2
.L39:
	.word	scene_loaded
	.word	scene_input_ready
	.word	joy
	.word	script_ptr
	.word	emote_timer
	.word	fade_running
	.word	last_joy
	.word	input_script_ptrs
	.word	J_A
	.word	actors
	.word	J_LEFT
	.word	update_dir
	.word	dir_left
	.word	FALSE
	.word	scene_num_actors
	.word	NONE
	.word	AI_ROTATE_TRB
	.word	script_actor
	.word	J_RIGHT
	.word	dir_right
	.word	J_UP
	.word	dir_up
	.word	J_DOWN
	.word	dir_down
	.size	SceneHandleInput, .-SceneHandleInput
	.comm	update_dir,4,4
	.comm	script_ptr,4,4
	.comm	script_actor,4,4
	.comm	scene_num_actors,4,4
	.comm	scene_loaded,4,4
	.comm	scene_input_ready,4,4
	.comm	last_joy,4,4
	.comm	joy,4,4
	.comm	input_script_ptrs,4,4
	.comm	fade_running,4,4
	.comm	emote_timer,4,4
	.comm	dir_up,4,4
	.comm	dir_right,4,4
	.comm	dir_left,4,4
	.comm	dir_down,4,4
	.comm	actors,4,4
	.comm	NONE,4,4
	.comm	J_UP,4,4
	.comm	J_RIGHT,4,4
	.comm	J_LEFT,4,4
	.comm	J_DOWN,4,4
	.comm	J_A,4,4
	.comm	FALSE,4,4
	.comm	AI_ROTATE_TRB,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
