	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xdk_joypad_button
_xdk_joypad_button:                     ## @xdk_joypad_button
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_DEFAULT_MAX_PADS@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpl	%edi, (%rax)
	jbe	LBB0_10
## %bb.1:
	movl	%esi, %r14d
	movq	_g_xinput_states@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%edi, %ecx
	shlq	$4, %rcx
	movl	(%rax,%rcx), %r15d
	movl	%esi, %edi
	callq	_GET_HAT_DIR
                                        ## kill: def $eax killed $eax def $rax
	leal	-140(%rax), %ecx
	cmpl	$3, %ecx
	ja	LBB0_2
## %bb.5:
	movq	_XINPUT_GAMEPAD_DPAD_UP@GOTPCREL(%rip), %rax
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	jmpq	*%rcx
LBB0_8:
	movq	_XINPUT_GAMEPAD_DPAD_RIGHT@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_2:
	testl	%eax, %eax
	jne	LBB0_10
## %bb.3:
	cmpl	$9, %r14d
	jg	LBB0_10
## %bb.4:
	movq	_button_index_to_bitmap_code@GOTPCREL(%rip), %rcx
	movslq	%r14d, %rax
	shlq	$2, %rax
	addq	(%rcx), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_XINPUT_GAMEPAD_DPAD_LEFT@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_6:
	movq	_XINPUT_GAMEPAD_DPAD_DOWN@GOTPCREL(%rip), %rax
LBB0_9:
	andl	(%rax), %r15d
	movl	%r15d, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
LJTI0_0:
	.long	L0_0_set_9
	.long	L0_0_set_8
	.long	L0_0_set_7
	.long	L0_0_set_6
	.end_data_region
                                        ## -- End function
	.comm	_DEFAULT_MAX_PADS,4,2           ## @DEFAULT_MAX_PADS
	.comm	_g_xinput_states,8,3            ## @g_xinput_states
	.comm	_XINPUT_GAMEPAD_DPAD_UP,4,2     ## @XINPUT_GAMEPAD_DPAD_UP
	.comm	_XINPUT_GAMEPAD_DPAD_DOWN,4,2   ## @XINPUT_GAMEPAD_DPAD_DOWN
	.comm	_XINPUT_GAMEPAD_DPAD_LEFT,4,2   ## @XINPUT_GAMEPAD_DPAD_LEFT
	.comm	_XINPUT_GAMEPAD_DPAD_RIGHT,4,2  ## @XINPUT_GAMEPAD_DPAD_RIGHT
	.comm	_button_index_to_bitmap_code,8,3 ## @button_index_to_bitmap_code
	.comm	_XINPUT_GAMEPAD_A,8,3           ## @XINPUT_GAMEPAD_A
	.comm	_XINPUT_GAMEPAD_B,8,3           ## @XINPUT_GAMEPAD_B
	.comm	_XINPUT_GAMEPAD_BACK,4,2        ## @XINPUT_GAMEPAD_BACK
	.comm	_XINPUT_GAMEPAD_BLACK,8,3       ## @XINPUT_GAMEPAD_BLACK
	.comm	_XINPUT_GAMEPAD_LEFT_THUMB,4,2  ## @XINPUT_GAMEPAD_LEFT_THUMB
	.comm	_XINPUT_GAMEPAD_LEFT_TRIGGER,8,3 ## @XINPUT_GAMEPAD_LEFT_TRIGGER
	.comm	_XINPUT_GAMEPAD_MAX_CROSSTALK,4,2 ## @XINPUT_GAMEPAD_MAX_CROSSTALK
	.comm	_XINPUT_GAMEPAD_RIGHT_THUMB,4,2 ## @XINPUT_GAMEPAD_RIGHT_THUMB
	.comm	_XINPUT_GAMEPAD_RIGHT_TRIGGER,8,3 ## @XINPUT_GAMEPAD_RIGHT_TRIGGER
	.comm	_XINPUT_GAMEPAD_START,4,2       ## @XINPUT_GAMEPAD_START
	.comm	_XINPUT_GAMEPAD_WHITE,8,3       ## @XINPUT_GAMEPAD_WHITE
	.comm	_XINPUT_GAMEPAD_X,8,3           ## @XINPUT_GAMEPAD_X
	.comm	_XINPUT_GAMEPAD_Y,8,3           ## @XINPUT_GAMEPAD_Y
	.no_dead_strip	_xdk_joypad_button
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xdk_joypad_button
_xdk_joypad_button:                     ; @xdk_joypad_button
	.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
Lloh0:
	adrp	x8, _DEFAULT_MAX_PADS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEFAULT_MAX_PADS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.ls	LBB0_7
; %bb.1:
	mov	x19, x1
Lloh3:
	adrp	x8, _g_xinput_states@GOTPAGE
Lloh4:
	ldr	x8, [x8, _g_xinput_states@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	mov	w9, w0
	lsl	x9, x9, #4
	ldr	w20, [x8, x9]
	mov	x0, x1
	bl	_GET_HAT_DIR
	sub	w9, w0, #140
	cmp	w9, #3
	b.hi	LBB0_4
; %bb.2:
Lloh6:
	adrp	x8, _XINPUT_GAMEPAD_DPAD_UP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _XINPUT_GAMEPAD_DPAD_UP@GOTPAGEOFF]
Lloh8:
	adrp	x10, lJTI0_0@PAGE
Lloh9:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_3
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_3:
Lloh10:
	adrp	x8, _XINPUT_GAMEPAD_DPAD_RIGHT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _XINPUT_GAMEPAD_DPAD_RIGHT@GOTPAGEOFF]
	b	LBB0_10
LBB0_4:
	cbnz	w0, LBB0_7
; %bb.5:
	cmp	w19, #9
	b.gt	LBB0_7
; %bb.6:
Lloh12:
	adrp	x8, _button_index_to_bitmap_code@GOTPAGE
Lloh13:
	ldr	x8, [x8, _button_index_to_bitmap_code@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	add	x8, x8, w19, sxtw #2
	b	LBB0_10
LBB0_7:
	mov	w0, #0
	b	LBB0_11
LBB0_8:
Lloh15:
	adrp	x8, _XINPUT_GAMEPAD_DPAD_LEFT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _XINPUT_GAMEPAD_DPAD_LEFT@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh17:
	adrp	x8, _XINPUT_GAMEPAD_DPAD_DOWN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _XINPUT_GAMEPAD_DPAD_DOWN@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	and	w0, w8, w20
LBB0_11:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_10-LBB0_3)>>2
	.byte	(LBB0_3-LBB0_3)>>2
	.byte	(LBB0_8-LBB0_3)>>2
	.byte	(LBB0_9-LBB0_3)>>2
                                        ; -- End function
	.comm	_DEFAULT_MAX_PADS,4,2           ; @DEFAULT_MAX_PADS
	.comm	_g_xinput_states,8,3            ; @g_xinput_states
	.comm	_XINPUT_GAMEPAD_DPAD_UP,4,2     ; @XINPUT_GAMEPAD_DPAD_UP
	.comm	_XINPUT_GAMEPAD_DPAD_DOWN,4,2   ; @XINPUT_GAMEPAD_DPAD_DOWN
	.comm	_XINPUT_GAMEPAD_DPAD_LEFT,4,2   ; @XINPUT_GAMEPAD_DPAD_LEFT
	.comm	_XINPUT_GAMEPAD_DPAD_RIGHT,4,2  ; @XINPUT_GAMEPAD_DPAD_RIGHT
	.comm	_button_index_to_bitmap_code,8,3 ; @button_index_to_bitmap_code
	.comm	_XINPUT_GAMEPAD_A,8,3           ; @XINPUT_GAMEPAD_A
	.comm	_XINPUT_GAMEPAD_B,8,3           ; @XINPUT_GAMEPAD_B
	.comm	_XINPUT_GAMEPAD_BACK,4,2        ; @XINPUT_GAMEPAD_BACK
	.comm	_XINPUT_GAMEPAD_BLACK,8,3       ; @XINPUT_GAMEPAD_BLACK
	.comm	_XINPUT_GAMEPAD_LEFT_THUMB,4,2  ; @XINPUT_GAMEPAD_LEFT_THUMB
	.comm	_XINPUT_GAMEPAD_LEFT_TRIGGER,8,3 ; @XINPUT_GAMEPAD_LEFT_TRIGGER
	.comm	_XINPUT_GAMEPAD_MAX_CROSSTALK,4,2 ; @XINPUT_GAMEPAD_MAX_CROSSTALK
	.comm	_XINPUT_GAMEPAD_RIGHT_THUMB,4,2 ; @XINPUT_GAMEPAD_RIGHT_THUMB
	.comm	_XINPUT_GAMEPAD_RIGHT_TRIGGER,8,3 ; @XINPUT_GAMEPAD_RIGHT_TRIGGER
	.comm	_XINPUT_GAMEPAD_START,4,2       ; @XINPUT_GAMEPAD_START
	.comm	_XINPUT_GAMEPAD_WHITE,8,3       ; @XINPUT_GAMEPAD_WHITE
	.comm	_XINPUT_GAMEPAD_X,8,3           ; @XINPUT_GAMEPAD_X
	.comm	_XINPUT_GAMEPAD_Y,8,3           ; @XINPUT_GAMEPAD_Y
	.no_dead_strip	_xdk_joypad_button
.subsections_via_symbols
