	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_sdl_joystick_name
_get_sdl_joystick_name:                 ## @get_sdl_joystick_name
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_SDL_INIT_JOYSTICK@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_SDL_WasInit
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movl	(%r12), %edi
	callq	_SDL_InitSubSystem
	cmpl	$-1, %eax
	je	LBB0_2
LBB0_3:
	movl	%ebx, %edi
	callq	_SDL_JoystickName
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	_get_sdl_joystick_name.JoyName(%rip), %rdi
	movq	%r15, %rsi
	movl	$255, %edx
	callq	_strncpy
	movb	$0, _get_sdl_joystick_name.JoyName+255(%rip)
LBB0_5:
	testl	%r14d, %r14d
	jne	LBB0_7
## %bb.6:
	movl	(%r12), %edi
	callq	_SDL_QuitSubSystem
LBB0_7:
	testq	%r15, %r15
	leaq	_get_sdl_joystick_name.JoyName(%rip), %rbx
	cmoveq	%r15, %rbx
LBB0_8:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_M64MSG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_SDL_GetError
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movl	%eax, %edx
	callq	_DebugMessage
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_get_sdl_joystick_name.JoyName,256,4 ## @get_sdl_joystick_name.JoyName
	.comm	_SDL_INIT_JOYSTICK,4,2          ## @SDL_INIT_JOYSTICK
	.comm	_M64MSG_ERROR,4,2               ## @M64MSG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't init SDL joystick subsystem: %s"

	.no_dead_strip	_get_sdl_joystick_name
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_sdl_joystick_name
_get_sdl_joystick_name:                 ; @get_sdl_joystick_name
	.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
	mov	x20, x0
Lloh0:
	adrp	x22, _SDL_INIT_JOYSTICK@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SDL_INIT_JOYSTICK@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_SDL_WasInit
	mov	x19, x0
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x22]
	bl	_SDL_InitSubSystem
	cmn	w0, #1
	b.eq	LBB0_8
LBB0_2:
	mov	x0, x20
	bl	_SDL_JoystickName
	mov	x21, x0
Lloh2:
	adrp	x20, _get_sdl_joystick_name.JoyName@PAGE
Lloh3:
	add	x20, x20, _get_sdl_joystick_name.JoyName@PAGEOFF
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x20
	mov	x1, x21
	mov	w2, #255
	bl	_strncpy
	strb	wzr, [x20, #255]
LBB0_4:
	cbnz	w19, LBB0_6
; %bb.5:
	ldr	w0, [x22]
	bl	_SDL_QuitSubSystem
LBB0_6:
	cmp	x21, #0
	csel	x0, xzr, x20, eq
LBB0_7:
	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
LBB0_8:
Lloh4:
	adrp	x8, _M64MSG_ERROR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _M64MSG_ERROR@GOTPAGEOFF]
Lloh6:
	ldr	w19, [x8]
	bl	_SDL_GetError
	mov	x2, x0
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_DebugMessage
	mov	x0, #0
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_get_sdl_joystick_name.JoyName,256,0 ; @get_sdl_joystick_name.JoyName
	.comm	_SDL_INIT_JOYSTICK,4,2          ; @SDL_INIT_JOYSTICK
	.comm	_M64MSG_ERROR,4,2               ; @M64MSG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't init SDL joystick subsystem: %s"

	.no_dead_strip	_get_sdl_joystick_name
.subsections_via_symbols
