	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function RunEventsPico
_RunEventsPico:                         ## @RunEventsPico
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movl	%esi, %ebx
	callq	_emu_RunEventsPico
	movq	_pico_inp_mode@GOTPCREL(%rip), %r8
	cmpl	$0, (%r8)
	je	LBB0_13
## %bb.1:
	movq	_PicoPad@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	andl	$-16, (%rcx)
	movq	_PBTN_UP@GOTPCREL(%rip), %rcx
	testl	%ebx, (%rcx)
	je	LBB0_3
## %bb.2:
	movq	_pico_pen_y@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	$10, %edx
	movl	$9, %esi
	cmovgel	%edx, %esi
	decl	%esi
	movl	%esi, (%rcx)
LBB0_3:
	movq	_PBTN_DOWN@GOTPCREL(%rip), %rcx
	testl	%ebx, (%rcx)
	je	LBB0_5
## %bb.4:
	movq	_pico_pen_y@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leal	1(%rdx), %esi
	movq	_PICO_PEN_ADJUST_Y@GOTPCREL(%rip), %rdi
	movl	$224, %eax
	subl	(%rdi), %eax
	cmpl	%eax, %edx
	cmovll	%esi, %eax
	movl	%eax, (%rcx)
LBB0_5:
	movq	_PBTN_LEFT@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_7
## %bb.6:
	movq	_pico_pen_x@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	$2, %ecx
	movl	$1, %edx
	cmovgel	%ecx, %edx
	decl	%edx
	movl	%edx, (%rax)
LBB0_7:
	movq	_PBTN_RIGHT@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_8
## %bb.9:
	movq	_Pico@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	48(%rsi), %ecx
	andl	$1, %ecx
	shll	$6, %ecx
	movq	_pico_pen_x@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leal	1(%rdx), %edi
	movq	_PICO_PEN_ADJUST_X@GOTPCREL(%rip), %rbx
	subl	(%rbx), %ecx
	addl	$255, %ecx
	cmpl	%ecx, %edx
	cmovll	%edi, %ecx
	movl	%ecx, (%rax)
	jmp	LBB0_10
LBB0_8:
	movq	_pico_pen_x@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_Pico@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
LBB0_10:
	movq	_PicoPicohw@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	%ecx, (%rdx)
	testb	$1, 48(%rsi)
	jne	LBB0_12
## %bb.11:
	movq	_pico_pen_x@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	3(%rax), %esi
	testl	%eax, %eax
	cmovnsl	%eax, %esi
	sarl	$2, %esi
	addl	%esi, %ecx
	movl	%ecx, (%rdx)
LBB0_12:
	addl	$60, %ecx
	movl	%ecx, (%rdx)
	cmpl	$1, (%r8)
	movl	$760, %eax                      ## imm = 0x2F8
	movl	$508, %ecx                      ## imm = 0x1FC
	cmovel	%eax, %ecx
	movq	_pico_pen_y@GOTPCREL(%rip), %rax
	addl	(%rax), %ecx
	movl	%ecx, 4(%rdx)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pico_inp_mode,4,2              ## @pico_inp_mode
	.comm	_PicoPad,8,3                    ## @PicoPad
	.comm	_PBTN_UP,4,2                    ## @PBTN_UP
	.comm	_pico_pen_y,4,2                 ## @pico_pen_y
	.comm	_PBTN_DOWN,4,2                  ## @PBTN_DOWN
	.comm	_PICO_PEN_ADJUST_Y,4,2          ## @PICO_PEN_ADJUST_Y
	.comm	_PBTN_LEFT,4,2                  ## @PBTN_LEFT
	.comm	_pico_pen_x,4,2                 ## @pico_pen_x
	.comm	_PBTN_RIGHT,4,2                 ## @PBTN_RIGHT
	.comm	_Pico,8,3                       ## @Pico
	.comm	_PICO_PEN_ADJUST_X,4,2          ## @PICO_PEN_ADJUST_X
	.comm	_PicoPicohw,8,3                 ## @PicoPicohw
	.no_dead_strip	_RunEventsPico
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function RunEventsPico
_RunEventsPico:                         ; @RunEventsPico
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	bl	_emu_RunEventsPico
Lloh0:
	adrp	x8, _pico_inp_mode@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pico_inp_mode@GOTPAGEOFF]
	ldr	w9, [x8]
	cbz	w9, LBB0_13
; %bb.1:
Lloh2:
	adrp	x9, _PicoPad@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PicoPad@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	ldr	w10, [x9]
	and	w10, w10, #0xfffffff0
	str	w10, [x9]
Lloh5:
	adrp	x9, _PBTN_UP@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PBTN_UP@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x9]
Lloh8:
	adrp	x9, _pico_pen_y@GOTPAGE
Lloh9:
	ldr	x9, [x9, _pico_pen_y@GOTPAGEOFF]
	tst	w10, w19
	b.eq	LBB0_3
; %bb.2:
	ldr	w10, [x9]
	mov	w11, #9
	cmp	w10, #9
	csel	w10, w10, w11, gt
	sub	w10, w10, #1
	str	w10, [x9]
LBB0_3:
Lloh10:
	adrp	x10, _PBTN_DOWN@GOTPAGE
Lloh11:
	ldr	x10, [x10, _PBTN_DOWN@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	tst	w10, w19
	b.eq	LBB0_5
; %bb.4:
	ldr	w10, [x9]
Lloh13:
	adrp	x11, _PICO_PEN_ADJUST_Y@GOTPAGE
Lloh14:
	ldr	x11, [x11, _PICO_PEN_ADJUST_Y@GOTPAGEOFF]
Lloh15:
	ldr	w11, [x11]
	mov	w12, #224
	sub	w11, w12, w11
	cmp	w10, w11
	csinc	w10, w11, w10, ge
	str	w10, [x9]
LBB0_5:
Lloh16:
	adrp	x10, _PBTN_LEFT@GOTPAGE
Lloh17:
	ldr	x10, [x10, _PBTN_LEFT@GOTPAGEOFF]
Lloh18:
	ldr	w11, [x10]
Lloh19:
	adrp	x10, _pico_pen_x@GOTPAGE
Lloh20:
	ldr	x10, [x10, _pico_pen_x@GOTPAGEOFF]
	tst	w11, w19
	b.eq	LBB0_7
; %bb.6:
	ldr	w11, [x10]
	cmp	w11, #1
	csinc	w11, w11, wzr, gt
	sub	w11, w11, #1
	str	w11, [x10]
LBB0_7:
Lloh21:
	adrp	x11, _PBTN_RIGHT@GOTPAGE
Lloh22:
	ldr	x11, [x11, _PBTN_RIGHT@GOTPAGEOFF]
Lloh23:
	ldr	w11, [x11]
	tst	w11, w19
	b.eq	LBB0_9
; %bb.8:
Lloh24:
	adrp	x11, _Pico@GOTPAGE
Lloh25:
	ldr	x11, [x11, _Pico@GOTPAGEOFF]
Lloh26:
	ldr	x12, [x11]
	ldr	w11, [x12, #48]
	tst	w11, #0x1
	mov	w11, #319
	mov	w13, #255
	csel	w11, w13, w11, eq
Lloh27:
	adrp	x13, _PICO_PEN_ADJUST_X@GOTPAGE
Lloh28:
	ldr	x13, [x13, _PICO_PEN_ADJUST_X@GOTPAGEOFF]
	ldr	w14, [x10]
Lloh29:
	ldr	w13, [x13]
	sub	w11, w11, w13
	cmp	w14, w11
	csinc	w11, w11, w14, ge
	str	w11, [x10]
	b	LBB0_10
LBB0_9:
	ldr	w11, [x10]
Lloh30:
	adrp	x12, _Pico@GOTPAGE
Lloh31:
	ldr	x12, [x12, _Pico@GOTPAGEOFF]
Lloh32:
	ldr	x12, [x12]
LBB0_10:
Lloh33:
	adrp	x13, _PicoPicohw@GOTPAGE
Lloh34:
	ldr	x13, [x13, _PicoPicohw@GOTPAGEOFF]
Lloh35:
	ldr	x13, [x13]
	str	w11, [x13]
	ldrb	w12, [x12, #48]
	tbnz	w12, #0, LBB0_12
; %bb.11:
	ldr	w10, [x10]
	add	w12, w10, #3
	cmp	w10, #0
	csel	w10, w12, w10, lt
	add	w11, w11, w10, asr #2
	str	w11, [x13]
LBB0_12:
	add	w10, w11, #60
	str	w10, [x13]
	ldr	w8, [x8]
	ldr	w9, [x9]
	mov	w10, #508
	mov	w11, #760
	cmp	w8, #1
	csel	w8, w11, w10, eq
	add	w8, w8, w9
	str	w8, [x13, #4]
LBB0_13:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_pico_inp_mode,4,2              ; @pico_inp_mode
	.comm	_PicoPad,8,3                    ; @PicoPad
	.comm	_PBTN_UP,4,2                    ; @PBTN_UP
	.comm	_pico_pen_y,4,2                 ; @pico_pen_y
	.comm	_PBTN_DOWN,4,2                  ; @PBTN_DOWN
	.comm	_PICO_PEN_ADJUST_Y,4,2          ; @PICO_PEN_ADJUST_Y
	.comm	_PBTN_LEFT,4,2                  ; @PBTN_LEFT
	.comm	_pico_pen_x,4,2                 ; @pico_pen_x
	.comm	_PBTN_RIGHT,4,2                 ; @PBTN_RIGHT
	.comm	_Pico,8,3                       ; @Pico
	.comm	_PICO_PEN_ADJUST_X,4,2          ; @PICO_PEN_ADJUST_X
	.comm	_PicoPicohw,8,3                 ; @PicoPicohw
	.no_dead_strip	_RunEventsPico
.subsections_via_symbols
