	.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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_SDL_INIT_JOYSTICK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SDL_InitSubSystem
	xorl	%eax, %eax
	callq	_SDL_NumJoysticks
	movq	_MAX_JOYSTICKS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	cmovll	%eax, %ecx
	testl	%ecx, %ecx
	jle	LBB0_3
## %bb.1:
	movl	%ecx, %r14d
	xorl	%ebx, %ebx
	movq	_Joysticks@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_SDL_JoystickOpen
	movq	(%r15), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_2
LBB0_3:
	movq	_jinited@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movl	$1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDL_INIT_JOYSTICK,4,2          ## @SDL_INIT_JOYSTICK
	.comm	_MAX_JOYSTICKS,4,2              ## @MAX_JOYSTICKS
	.comm	_Joysticks,8,3                  ## @Joysticks
	.comm	_jinited,4,2                    ## @jinited
.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	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
Lloh0:
	adrp	x8, _SDL_INIT_JOYSTICK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SDL_INIT_JOYSTICK@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_SDL_InitSubSystem
	bl	_SDL_NumJoysticks
Lloh3:
	adrp	x8, _MAX_JOYSTICKS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_JOYSTICKS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
	csel	w20, w0, w8, lt
	cmp	w20, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x19, #0
Lloh6:
	adrp	x21, _Joysticks@GOTPAGE
Lloh7:
	ldr	x21, [x21, _Joysticks@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_SDL_JoystickOpen
	ldr	x8, [x21]
	str	w0, [x8, x19, lsl #2]
	add	x19, x19, #1
	cmp	x20, x19
	b.ne	LBB0_2
LBB0_3:
Lloh8:
	adrp	x8, _jinited@GOTPAGE
Lloh9:
	ldr	x8, [x8, _jinited@GOTPAGEOFF]
	mov	w9, #1
Lloh10:
	str	w9, [x8]
	mov	w0, #1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_SDL_INIT_JOYSTICK,4,2          ; @SDL_INIT_JOYSTICK
	.comm	_MAX_JOYSTICKS,4,2              ; @MAX_JOYSTICKS
	.comm	_Joysticks,8,3                  ; @Joysticks
	.comm	_jinited,4,2                    ; @jinited
.subsections_via_symbols
