	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PERMacJoyDeInit                ## -- Begin function PERMacJoyDeInit
	.p2align	4, 0x90
_PERMacJoyDeInit:                       ## @PERMacJoyDeInit
	.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
	movq	_initted@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_5
## %bb.1:
	movq	_joycount@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_4
## %bb.2:
	xorl	%ebx, %ebx
	movq	_joys@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_joy_close_joystick
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_4:
	movq	_joys@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_free
	movq	$0, (%rbx)
	movl	$0, (%r15)
	movq	$0, (%r14)
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_initted,8,3                    ## @initted
	.comm	_joycount,4,2                   ## @joycount
	.comm	_joys,8,3                       ## @joys
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PERMacJoyDeInit                ; -- Begin function PERMacJoyDeInit
	.p2align	2
_PERMacJoyDeInit:                       ; @PERMacJoyDeInit
	.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	x19, _initted@GOTPAGE
Lloh1:
	ldr	x19, [x19, _initted@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_5
; %bb.1:
Lloh2:
	adrp	x20, _joycount@GOTPAGE
Lloh3:
	ldr	x20, [x20, _joycount@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh4:
	adrp	x21, _joys@GOTPAGE
Lloh5:
	ldr	x21, [x21, _joys@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x22, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	w0, [x8, x22, lsl #2]
	bl	_joy_close_joystick
	add	x22, x22, #1
	ldrsw	x8, [x20]
	cmp	x22, x8
	b.lt	LBB0_3
LBB0_4:
	ldr	x0, [x21]
	bl	_free
	str	xzr, [x21]
	str	wzr, [x20]
	str	xzr, [x19]
LBB0_5:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_initted,8,3                    ; @initted
	.comm	_joycount,4,2                   ; @joycount
	.comm	_joys,8,3                       ; @joys
.subsections_via_symbols
