	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ams_input_store_joystick
_ams_input_store_joystick:              ## @ams_input_store_joystick
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rcx, %rbx
	movq	%rdx, %rdi
	leaq	-24(%rbp), %rdx
	xorl	%esi, %esi
	callq	_kstrtoul
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	cmpq	$2, -24(%rbp)
	jb	LBB0_3
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_3:
	movq	_ams_input_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	-24(%rbp), %rax
	movq	_joystick@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.4:
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	xorl	%eax, %eax
	callq	_ams_input_enable
	movl	%eax, %r14d
	movq	_ams_input_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.8:
	movl	%r14d, %ebx
	jmp	LBB0_9
LBB0_5:
	xorl	%eax, %eax
	callq	_ams_input_disable
LBB0_6:
	movq	_ams_input_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_9:
	movl	%ebx, %eax
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ams_input_mutex,4,2            ## @ams_input_mutex
	.comm	_joystick,8,3                   ## @joystick
	.no_dead_strip	_ams_input_store_joystick
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ams_input_store_joystick
_ams_input_store_joystick:              ; @ams_input_store_joystick
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x3
	mov	x0, x2
	add	x2, sp, #8
	mov	w1, #0
	bl	_kstrtoul
	cbnz	w0, LBB0_10
; %bb.1:
	ldr	x8, [sp, #8]
	cmp	x8, #2
	b.lo	LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_3:
Lloh3:
	adrp	x0, _ams_input_mutex@GOTPAGE
Lloh4:
	ldr	x0, [x0, _ams_input_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	x8, [sp, #8]
Lloh5:
	adrp	x9, _joystick@GOTPAGE
Lloh6:
	ldr	x9, [x9, _joystick@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.4:
	cbz	x8, LBB0_7
; %bb.5:
	bl	_ams_input_enable
	mov	x20, x0
Lloh8:
	adrp	x0, _ams_input_mutex@GOTPAGE
Lloh9:
	ldr	x0, [x0, _ams_input_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	cbz	w20, LBB0_9
; %bb.6:
	mov	w19, w20
	b	LBB0_9
LBB0_7:
	bl	_ams_input_disable
LBB0_8:
Lloh10:
	adrp	x0, _ams_input_mutex@GOTPAGE
Lloh11:
	ldr	x0, [x0, _ams_input_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_9:
	mov	x0, x19
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ams_input_mutex,4,2            ; @ams_input_mutex
	.comm	_joystick,8,3                   ; @joystick
	.no_dead_strip	_ams_input_store_joystick
.subsections_via_symbols
