	.file	"extr_paint.c_run.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xor	eax, eax
	xor	r13d, r13d
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, 10
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	set_cursor@PLT
	xor	eax, eax
	call	move_cursor@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	xor	eax, eax
	call	wait_vbl_done@PLT
	xor	eax, eax
	call	joypad@PLT
	mov	edi, DWORD PTR J_UP[rip]
	mov	esi, DWORD PTR J_DOWN[rip]
	mov	ecx, DWORD PTR J_LEFT[rip]
	mov	ebx, eax
	mov	edx, DWORD PTR J_RIGHT[rip]
	mov	eax, edi
	or	eax, esi
	or	eax, ecx
	or	eax, edx
	test	eax, ebx
	jne	.L35
	mov	ebp, 10
.L3:
	test	DWORD PTR J_SELECT[rip], ebx
	jne	.L36
.L11:
	mov	ecx, DWORD PTR J_A[rip]
	mov	edx, DWORD PTR J_B[rip]
	mov	eax, ecx
	or	eax, edx
	and	eax, ebx
	cmp	ecx, eax
	je	.L37
	xor	r12d, r12d
.L12:
	cmp	edx, eax
	je	.L38
.L16:
	xor	r13d, r13d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L37:
	test	r12d, r12d
	jne	.L12
	mov	rdx, QWORD PTR current_mode[rip]
	mov	rax, QWORD PTR modes[rip]
	mov	r12d, 1
	mov	esi, DWORD PTR cursor_y[rip]
	mov	edi, DWORD PTR cursor_x[rip]
	mov	ecx, DWORD PTR [rax+rdx*4]
	mov	rdx, QWORD PTR current_color[rip]
	mov	rax, QWORD PTR colors[rip]
	mov	edx, DWORD PTR [rax+rdx*4]
	call	plot@PLT
	mov	edx, DWORD PTR J_B[rip]
	mov	eax, DWORD PTR J_A[rip]
	or	eax, edx
	and	eax, ebx
	cmp	edx, eax
	jne	.L16
	.p2align 4,,10
	.p2align 3
.L38:
	test	r13d, r13d
	jne	.L2
	mov	ecx, DWORD PTR SOLID[rip]
	mov	edx, DWORD PTR WHITE[rip]
	mov	r13d, 1
	mov	esi, DWORD PTR cursor_y[rip]
	mov	edi, DWORD PTR cursor_x[rip]
	call	plot@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L36:
	xor	eax, eax
	call	menu@PLT
	xor	eax, eax
	call	set_cursor@PLT
	xor	eax, eax
	call	move_cursor@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L35:
	test	edi, ebx
	je	.L4
	mov	eax, DWORD PTR cursor_y[rip]
	test	eax, eax
	jle	.L4
	sub	eax, 1
	mov	DWORD PTR cursor_y[rip], eax
.L4:
	test	esi, ebx
	je	.L5
	mov	eax, DWORD PTR cursor_y[rip]
	cmp	eax, 142
	jg	.L5
	add	eax, 1
	mov	DWORD PTR cursor_y[rip], eax
.L5:
	test	ecx, ebx
	je	.L6
	mov	eax, DWORD PTR cursor_x[rip]
	test	eax, eax
	jle	.L6
	sub	eax, 1
	mov	DWORD PTR cursor_x[rip], eax
.L6:
	test	edx, ebx
	je	.L7
	mov	eax, DWORD PTR cursor_x[rip]
	cmp	eax, 158
	jg	.L7
	add	eax, 1
	mov	DWORD PTR cursor_x[rip], eax
.L7:
	xor	eax, eax
	call	move_cursor@PLT
	.p2align 4,,10
	.p2align 3
.L8:
	xor	eax, eax
	call	joypad@PLT
	cmp	eax, ebx
	jne	.L10
	xor	eax, eax
	call	wait_vbl_done@PLT
	sub	ebp, 1
	jne	.L8
.L10:
	xor	r13d, r13d
	xor	r12d, r12d
	mov	ebp, 1
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	run, .-run
	.comm	modes,8,8
	.comm	cursor_y,4,4
	.comm	cursor_x,4,4
	.comm	current_mode,8,8
	.comm	current_color,8,8
	.comm	colors,8,8
	.comm	WHITE,4,4
	.comm	SOLID,4,4
	.comm	SHOW_SPRITES,4,4
	.comm	J_UP,4,4
	.comm	J_SELECT,4,4
	.comm	J_RIGHT,4,4
	.comm	J_LEFT,4,4
	.comm	J_DOWN,4,4
	.comm	J_B,4,4
	.comm	J_A,4,4
	.comm	HIDE_SPRITES,4,4
	.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_paint.c_run.c"
	.text
	.align	2
	.global	run
	.syntax unified
	.arm
	.fpu softvfp
	.type	run, %function
run:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, #0
	bl	set_cursor
	mov	r7, r6
	bl	move_cursor
	mov	r5, #10
	ldr	fp, .L38
	ldr	r10, .L38+4
	ldr	r9, .L38+8
	ldr	r8, .L38+12
.L2:
	bl	wait_vbl_done
	bl	joypad
	mov	r4, r0
	ldr	r3, .L38+16
	ldr	ip, [fp]
	ldr	r0, [r3]
	ldr	r3, .L38+20
	ldr	r2, .L38+24
	ldr	r1, [r3]
	ldr	r2, [r2]
	orr	r3, ip, r0
	orr	r3, r3, r1
	orr	r3, r3, r2
	tst	r3, r4
	moveq	r5, #10
	bne	.L35
.L3:
	ldr	r3, [r10]
	tst	r4, r3
	bne	.L36
.L11:
	ldr	r1, [r9]
	ldr	r2, [r8]
	orr	r3, r1, r2
	and	r3, r3, r4
	cmp	r1, r3
	movne	r7, #0
	beq	.L37
.L12:
	cmp	r2, r3
	movne	r6, #0
	bne	.L2
	cmp	r6, #0
	bne	.L2
	ldr	r3, .L38+28
	ldr	r2, .L38+32
	ldr	r1, .L38+36
	ldr	r0, .L38+40
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r0, [r0]
	bl	plot
	mov	r6, #1
	b	.L2
.L37:
	cmp	r7, #0
	bne	.L12
	ldr	r3, .L38+44
	ldr	r2, .L38+48
	ldr	r0, [r3]
	ldr	r1, [r2]
	ldr	r3, .L38+52
	ldr	r2, .L38+56
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r3, [r3, r0, lsl #2]
	ldr	r2, [r2, r1, lsl #2]
	ldr	r0, .L38+40
	ldr	r1, .L38+36
	ldr	r0, [r0]
	ldr	r1, [r1]
	bl	plot
	ldr	r2, [r8]
	ldr	r3, [r9]
	mov	r7, #1
	orr	r3, r2, r3
	and	r3, r3, r4
	b	.L12
.L36:
	bl	menu
	bl	set_cursor
	bl	move_cursor
	b	.L11
.L35:
	tst	ip, r4
	beq	.L4
	ldr	ip, .L38+36
	ldr	r3, [ip]
	cmp	r3, #0
	subgt	r3, r3, #1
	strgt	r3, [ip]
.L4:
	tst	r0, r4
	beq	.L5
	ldr	r0, .L38+36
	ldr	r3, [r0]
	cmp	r3, #142
	addle	r3, r3, #1
	strle	r3, [r0]
.L5:
	tst	r1, r4
	beq	.L6
	ldr	r1, .L38+40
	ldr	r3, [r1]
	cmp	r3, #0
	subgt	r3, r3, #1
	strgt	r3, [r1]
.L6:
	tst	r2, r4
	beq	.L7
	ldr	r2, .L38+40
	ldr	r3, [r2]
	cmp	r3, #158
	addle	r3, r3, #1
	strle	r3, [r2]
.L7:
	bl	move_cursor
.L8:
	bl	joypad
	cmp	r0, r4
	bne	.L10
	bl	wait_vbl_done
	subs	r5, r5, #1
	bne	.L8
.L10:
	mov	r6, #0
	mov	r5, #1
	mov	r7, r6
	b	.L3
.L39:
	.align	2
.L38:
	.word	J_UP
	.word	J_SELECT
	.word	J_A
	.word	J_B
	.word	J_DOWN
	.word	J_LEFT
	.word	J_RIGHT
	.word	SOLID
	.word	WHITE
	.word	cursor_y
	.word	cursor_x
	.word	current_mode
	.word	current_color
	.word	modes
	.word	colors
	.size	run, .-run
	.comm	modes,4,4
	.comm	cursor_y,4,4
	.comm	cursor_x,4,4
	.comm	current_mode,4,4
	.comm	current_color,4,4
	.comm	colors,4,4
	.comm	WHITE,4,4
	.comm	SOLID,4,4
	.comm	SHOW_SPRITES,4,4
	.comm	J_UP,4,4
	.comm	J_SELECT,4,4
	.comm	J_RIGHT,4,4
	.comm	J_LEFT,4,4
	.comm	J_DOWN,4,4
	.comm	J_B,4,4
	.comm	J_A,4,4
	.comm	HIDE_SPRITES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
