	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PERDCHandleEvents              ## -- Begin function PERDCHandleEvents
	.p2align	4, 0x90
_PERDCHandleEvents:                     ## @PERDCHandleEvents
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_MAPLE_FUNC_CONTROLLER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_maple_enum_type
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %rdi
	callq	_maple_dev_status
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_CONT_DPAD_UP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	(%rax), %esi
	movq	_pad1@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %r8
	movl	(%r8), %edx
	movl	%edx, %edi
	orl	$16, %edi
	andl	$239, %edx
	testl	%esi, %esi
	cmovel	%edi, %edx
	movl	%edx, (%r8)
	movq	_CONT_DPAD_DOWN@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	(%rax), %esi
	movl	%edx, %edi
	andl	$223, %edi
	orl	$32, %edx
	testl	%esi, %esi
	cmovnel	%edi, %edx
	movl	%edx, (%r8)
	movq	_CONT_DPAD_RIGHT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	(%rax), %esi
	movl	%edx, %edi
	andl	$127, %edi
	orl	$128, %edx
	testl	%esi, %esi
	cmovnel	%edi, %edx
	movl	%edx, (%r8)
	movq	_CONT_DPAD_LEFT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	(%rax), %esi
	movl	%edx, %edi
	andl	$191, %edi
	orl	$64, %edx
	testl	%esi, %esi
	cmovnel	%edi, %edx
	movl	%edx, (%r8)
	movq	_CONT_START@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	(%rax), %esi
	movl	%edx, %edi
	andl	$247, %edi
	orl	$8, %edx
	testl	%esi, %esi
	cmovnel	%edi, %edx
	movl	%edx, (%r8)
	movq	_CONT_A@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	(%rax), %esi
	movl	%edx, %edi
	andl	$251, %edi
	orl	$4, %edx
	testl	%esi, %esi
	cmovnel	%edi, %edx
	movl	%edx, (%r8)
	movq	_CONT_B@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	(%rax), %esi
	movl	%edx, %edi
	andl	$254, %edi
	orl	$1, %edx
	testl	%esi, %esi
	cmovnel	%edi, %edx
	movl	%edx, (%r8)
	movq	_CONT_X@GOTPCREL(%rip), %rsi
	movl	(%rsi), %edi
	andl	(%rax), %edi
	movl	4(%r8), %esi
	movl	%esi, %ecx
	orl	$64, %ecx
	andl	$191, %esi
	testl	%edi, %edi
	cmovel	%ecx, %esi
	movl	%esi, 4(%r8)
	movq	_CONT_Y@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	movl	%esi, %edi
	orl	$32, %edi
	andl	$223, %esi
	testl	%ecx, %ecx
	cmovel	%edi, %esi
	movl	%esi, 4(%r8)
	movl	%esi, %ecx
	orl	$128, %ecx
	andl	$127, %esi
	cmpl	$21, 4(%rax)
	cmovll	%ecx, %esi
	movl	%esi, 4(%r8)
	movl	%esi, %ecx
	orl	$8, %ecx
	andl	$247, %esi
	cmpl	$21, 8(%rax)
	cmovll	%ecx, %esi
	movl	%esi, 4(%r8)
	movl	%edx, %ecx
	orl	$2, %ecx
	andl	$253, %edx
	cmpl	$21, 12(%rax)
	cmovll	%ecx, %edx
	movl	%edx, (%r8)
	movl	%esi, %ecx
	orl	$16, %ecx
	andl	$239, %esi
	cmpl	$21, 16(%rax)
	cmovll	%ecx, %esi
	movl	%esi, 4(%r8)
LBB0_3:
	xorl	%eax, %eax
	callq	_YabauseExec
	xorl	%eax, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAPLE_FUNC_CONTROLLER,4,2      ## @MAPLE_FUNC_CONTROLLER
	.comm	_CONT_DPAD_UP,4,2               ## @CONT_DPAD_UP
	.comm	_pad1,8,3                       ## @pad1
	.comm	_CONT_DPAD_DOWN,4,2             ## @CONT_DPAD_DOWN
	.comm	_CONT_DPAD_RIGHT,4,2            ## @CONT_DPAD_RIGHT
	.comm	_CONT_DPAD_LEFT,4,2             ## @CONT_DPAD_LEFT
	.comm	_CONT_START,4,2                 ## @CONT_START
	.comm	_CONT_A,4,2                     ## @CONT_A
	.comm	_CONT_B,4,2                     ## @CONT_B
	.comm	_CONT_X,4,2                     ## @CONT_X
	.comm	_CONT_Y,4,2                     ## @CONT_Y
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PERDCHandleEvents              ; -- Begin function PERDCHandleEvents
	.p2align	2
_PERDCHandleEvents:                     ; @PERDCHandleEvents
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _MAPLE_FUNC_CONTROLLER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAPLE_FUNC_CONTROLLER@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_maple_enum_type
	cbz	x0, LBB0_3
; %bb.1:
	bl	_maple_dev_status
	cbz	x0, LBB0_3
; %bb.2:
	ldr	w9, [x0]
Lloh3:
	adrp	x8, _CONT_DPAD_UP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CONT_DPAD_UP@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x8]
Lloh6:
	adrp	x8, _pad1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _pad1@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldp	w11, w12, [x8]
	orr	w13, w11, #0x10
	mov	w14, #239
	and	w11, w11, w14
	tst	w10, w9
	csel	w9, w13, w11, eq
	str	w9, [x8]
	ldr	w10, [x0]
Lloh9:
	adrp	x11, _CONT_DPAD_DOWN@GOTPAGE
Lloh10:
	ldr	x11, [x11, _CONT_DPAD_DOWN@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	mov	w13, #223
	and	w15, w9, w13
	orr	w9, w9, #0x20
	tst	w11, w10
	csel	w9, w9, w15, eq
	str	w9, [x8]
	ldr	w10, [x0]
Lloh12:
	adrp	x11, _CONT_DPAD_RIGHT@GOTPAGE
Lloh13:
	ldr	x11, [x11, _CONT_DPAD_RIGHT@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	and	w15, w9, #0x7f
	orr	w9, w9, #0x80
	tst	w11, w10
	csel	w9, w9, w15, eq
	str	w9, [x8]
	ldr	w10, [x0]
Lloh15:
	adrp	x11, _CONT_DPAD_LEFT@GOTPAGE
Lloh16:
	ldr	x11, [x11, _CONT_DPAD_LEFT@GOTPAGEOFF]
Lloh17:
	ldr	w11, [x11]
	mov	w15, #191
	and	w16, w9, w15
	orr	w9, w9, #0x40
	tst	w11, w10
	csel	w9, w9, w16, eq
	str	w9, [x8]
	ldr	w10, [x0]
Lloh18:
	adrp	x11, _CONT_START@GOTPAGE
Lloh19:
	ldr	x11, [x11, _CONT_START@GOTPAGEOFF]
Lloh20:
	ldr	w11, [x11]
	mov	w16, #247
	and	w17, w9, w16
	orr	w9, w9, #0x8
	tst	w11, w10
	csel	w9, w9, w17, eq
	str	w9, [x8]
Lloh21:
	adrp	x10, _CONT_A@GOTPAGE
Lloh22:
	ldr	x10, [x10, _CONT_A@GOTPAGEOFF]
	ldr	w11, [x0]
Lloh23:
	ldr	w10, [x10]
	mov	w17, #251
	and	w17, w9, w17
	orr	w9, w9, #0x4
	tst	w10, w11
	csel	w9, w9, w17, eq
	str	w9, [x8]
	ldr	w10, [x0]
Lloh24:
	adrp	x11, _CONT_B@GOTPAGE
Lloh25:
	ldr	x11, [x11, _CONT_B@GOTPAGEOFF]
Lloh26:
	ldr	w11, [x11]
	and	w17, w9, #0xfe
	orr	w9, w9, #0x1
	tst	w11, w10
	csel	w9, w9, w17, eq
	str	w9, [x8]
	ldr	w10, [x0]
Lloh27:
	adrp	x11, _CONT_X@GOTPAGE
Lloh28:
	ldr	x11, [x11, _CONT_X@GOTPAGEOFF]
Lloh29:
	ldr	w11, [x11]
	orr	w17, w12, #0x40
	and	w12, w12, w15
	tst	w11, w10
	csel	w10, w17, w12, eq
	str	w10, [x8, #4]
	ldr	w11, [x0]
Lloh30:
	adrp	x12, _CONT_Y@GOTPAGE
Lloh31:
	ldr	x12, [x12, _CONT_Y@GOTPAGEOFF]
Lloh32:
	ldr	w12, [x12]
	orr	w15, w10, #0x20
	and	w10, w10, w13
	tst	w12, w11
	csel	w10, w15, w10, eq
	str	w10, [x8, #4]
	ldr	w11, [x0, #4]
	orr	w12, w10, #0x80
	and	w10, w10, #0x7f
	cmp	w11, #20
	csel	w10, w10, w12, gt
	str	w10, [x8, #4]
	ldr	w11, [x0, #8]
	orr	w12, w10, #0x8
	and	w10, w10, w16
	cmp	w11, #20
	csel	w10, w10, w12, gt
	str	w10, [x8, #4]
	ldr	w11, [x0, #12]
	orr	w12, w9, #0x2
	mov	w13, #253
	and	w9, w9, w13
	cmp	w11, #20
	csel	w9, w9, w12, gt
	str	w9, [x8]
	ldr	w9, [x0, #16]
	orr	w11, w10, #0x10
	and	w10, w10, w14
	cmp	w9, #20
	csel	w9, w10, w11, gt
	str	w9, [x8, #4]
LBB0_3:
	bl	_YabauseExec
	mov	w0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MAPLE_FUNC_CONTROLLER,4,2      ; @MAPLE_FUNC_CONTROLLER
	.comm	_CONT_DPAD_UP,4,2               ; @CONT_DPAD_UP
	.comm	_pad1,8,3                       ; @pad1
	.comm	_CONT_DPAD_DOWN,4,2             ; @CONT_DPAD_DOWN
	.comm	_CONT_DPAD_RIGHT,4,2            ; @CONT_DPAD_RIGHT
	.comm	_CONT_DPAD_LEFT,4,2             ; @CONT_DPAD_LEFT
	.comm	_CONT_START,4,2                 ; @CONT_START
	.comm	_CONT_A,4,2                     ; @CONT_A
	.comm	_CONT_B,4,2                     ; @CONT_B
	.comm	_CONT_X,4,2                     ; @CONT_X
	.comm	_CONT_Y,4,2                     ; @CONT_Y
.subsections_via_symbols
