	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_joy_scan_joysticks             ## -- Begin function joy_scan_joysticks
	.p2align	4, 0x90
_joy_scan_joysticks:                    ## @joy_scan_joysticks
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	$0, -16(%rbp)
	movq	_joys@GOTPCREL(%rip), %rcx
	movl	$-1, %eax
	cmpq	$0, (%rcx)
	jne	LBB0_7
## %bb.1:
	movq	_kIOMasterPortDefault@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-16(%rbp), %rsi
	callq	_joy_get_iterator
	movq	-16(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.2:
	callq	_IOIteratorNext
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%rax, %rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_joy_read_device
	movq	%rbx, %rdi
	callq	_IOObjectRelease
	movq	-16(%rbp), %rdi
	callq	_IOIteratorNext
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_4
LBB0_5:
	movq	-16(%rbp), %rdi
	callq	_IOObjectRelease
LBB0_6:
	movq	_joy_count@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_joys,8,3                       ## @joys
	.comm	_kIOMasterPortDefault,4,2       ## @kIOMasterPortDefault
	.comm	_joy_count,4,2                  ## @joy_count
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_joy_scan_joysticks             ; -- Begin function joy_scan_joysticks
	.p2align	2
_joy_scan_joysticks:                    ; @joy_scan_joysticks
	.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
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _joys@GOTPAGE
Lloh1:
	ldr	x8, [x8, _joys@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w0, #-1
	b	LBB0_8
LBB0_2:
Lloh3:
	adrp	x8, _kIOMasterPortDefault@GOTPAGE
Lloh4:
	ldr	x8, [x8, _kIOMasterPortDefault@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x1, sp, #8
	bl	_joy_get_iterator
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_7
; %bb.3:
	bl	_IOIteratorNext
	cbz	x0, LBB0_6
; %bb.4:
	mov	x19, x0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_joy_read_device
	mov	x0, x19
	bl	_IOObjectRelease
	ldr	x0, [sp, #8]
	bl	_IOIteratorNext
	mov	x19, x0
	cbnz	x0, LBB0_5
LBB0_6:
	ldr	x0, [sp, #8]
	bl	_IOObjectRelease
LBB0_7:
Lloh6:
	adrp	x8, _joy_count@GOTPAGE
Lloh7:
	ldr	x8, [x8, _joy_count@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
LBB0_8:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_joys,8,3                       ; @joys
	.comm	_kIOMasterPortDefault,4,2       ; @kIOMasterPortDefault
	.comm	_joy_count,4,2                  ; @joy_count
.subsections_via_symbols
