	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_InitJoysticks                  ## -- Begin function InitJoysticks
	.p2align	4, 0x90
_InitJoysticks:                         ## @InitJoysticks
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_joy@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DetectJoystick
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	_soundo@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	movq	_soundjoyeron@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	jmp	LBB0_7
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_3:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movq	$0, (%r14)
	jmp	LBB0_9
LBB0_6:
	xorl	%eax, %eax
	callq	_UpdateJoyData
LBB0_7:
	movq	_joyx@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_joyxcenter@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_joyy@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_joyycenter@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_joyBMap@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movdqu	(%rax), %xmm0
	movl	$1, %ebx
	ptest	%xmm0, %xmm0
	jne	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	callq	_ConfigJoystick
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_joy,8,3                        ## @joy
	.comm	_soundo,8,3                     ## @soundo
	.comm	_soundjoyeron,4,2               ## @soundjoyeron
	.comm	_soundjoyer,4,2                 ## @soundjoyer
	.comm	_joyx,4,2                       ## @joyx
	.comm	_joyxcenter,4,2                 ## @joyxcenter
	.comm	_joyy,4,2                       ## @joyy
	.comm	_joyycenter,4,2                 ## @joyycenter
	.comm	_joyBMap,8,3                    ## @joyBMap
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"Joystick not detected!"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_InitJoysticks                  ; -- Begin function InitJoysticks
	.p2align	2
_InitJoysticks:                         ; @InitJoysticks
	.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	x19, _joy@GOTPAGE
Lloh1:
	ldr	x19, [x19, _joy@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_4
; %bb.1:
	bl	_DetectJoystick
	cbz	w0, LBB0_5
; %bb.2:
Lloh2:
	adrp	x8, _soundo@GOTPAGE
Lloh3:
	ldr	x8, [x8, _soundo@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.3:
Lloh5:
	adrp	x8, _soundjoyeron@GOTPAGE
Lloh6:
	ldr	x8, [x8, _soundjoyeron@GOTPAGEOFF]
	mov	w9, #1
Lloh7:
	str	w9, [x8]
	b	LBB0_7
LBB0_4:
	mov	w0, #0
	b	LBB0_10
LBB0_5:
Lloh8:
	adrp	x0, l_str@PAGE
Lloh9:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #0
	str	xzr, [x19]
	b	LBB0_10
LBB0_6:
	bl	_UpdateJoyData
LBB0_7:
Lloh10:
	adrp	x8, _joyx@GOTPAGE
Lloh11:
	ldr	x8, [x8, _joyx@GOTPAGEOFF]
Lloh12:
	adrp	x9, _joyxcenter@GOTPAGE
Lloh13:
	ldr	x9, [x9, _joyxcenter@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	str	w8, [x9]
Lloh16:
	adrp	x8, _joyy@GOTPAGE
Lloh17:
	ldr	x8, [x8, _joyy@GOTPAGEOFF]
Lloh18:
	adrp	x9, _joyycenter@GOTPAGE
Lloh19:
	ldr	x9, [x9, _joyycenter@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	str	w8, [x9]
Lloh22:
	adrp	x8, _joyBMap@GOTPAGE
Lloh23:
	ldr	x8, [x8, _joyBMap@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	ldr	q0, [x8]
	ext.16b	v1, v0, v0, #8
	orr.8b	v0, v0, v1
	mov.s	w8, v0[1]
	fmov	w9, s0
	orr	w8, w9, w8
	cbnz	w8, LBB0_9
; %bb.8:
	bl	_ConfigJoystick
LBB0_9:
	mov	w0, #1
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh20
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_joy,8,3                        ; @joy
	.comm	_soundo,8,3                     ; @soundo
	.comm	_soundjoyeron,4,2               ; @soundjoyeron
	.comm	_soundjoyer,4,2                 ; @soundjoyer
	.comm	_joyx,4,2                       ; @joyx
	.comm	_joyxcenter,4,2                 ; @joyxcenter
	.comm	_joyy,4,2                       ; @joyy
	.comm	_joyycenter,4,2                 ; @joyycenter
	.comm	_joyBMap,8,3                    ; @joyBMap
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"Joystick not detected!"

.subsections_via_symbols
