	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amijoy_close
_amijoy_close:                          ## @amijoy_close
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_amijoy_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_amijoy_used@GOTPCREL(%rip), %rax
	decl	(%rax)
	jne	LBB0_2
## %bb.1:
	movq	_IRQ_AMIGA_VERTB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_amijoy_interrupt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_free_irq
LBB0_2:
	movq	_amijoy_mutex@GOTPCREL(%rip), %rdi
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_amijoy_mutex,4,2               ## @amijoy_mutex
	.comm	_amijoy_used,4,2                ## @amijoy_used
	.comm	_IRQ_AMIGA_VERTB,4,2            ## @IRQ_AMIGA_VERTB
	.comm	_amijoy_interrupt,4,2           ## @amijoy_interrupt
	.no_dead_strip	_amijoy_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amijoy_close
_amijoy_close:                          ; @amijoy_close
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x0, _amijoy_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _amijoy_mutex@GOTPAGEOFF]
	bl	_mutex_lock
Lloh2:
	adrp	x8, _amijoy_used@GOTPAGE
Lloh3:
	ldr	x8, [x8, _amijoy_used@GOTPAGEOFF]
	ldr	w9, [x8]
	subs	w9, w9, #1
	str	w9, [x8]
	b.ne	LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, _IRQ_AMIGA_VERTB@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IRQ_AMIGA_VERTB@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x8, _amijoy_interrupt@GOTPAGE
Lloh8:
	ldr	x8, [x8, _amijoy_interrupt@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_free_irq
LBB0_2:
Lloh10:
	adrp	x0, _amijoy_mutex@GOTPAGE
Lloh11:
	ldr	x0, [x0, _amijoy_mutex@GOTPAGEOFF]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_amijoy_mutex,4,2               ; @amijoy_mutex
	.comm	_amijoy_used,4,2                ; @amijoy_used
	.comm	_IRQ_AMIGA_VERTB,4,2            ; @IRQ_AMIGA_VERTB
	.comm	_amijoy_interrupt,4,2           ; @amijoy_interrupt
	.no_dead_strip	_amijoy_close
.subsections_via_symbols
