	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gx_input_FindDevices           ## -- Begin function gx_input_FindDevices
	.p2align	4, 0x90
_gx_input_FindDevices:                  ## @gx_input_FindDevices
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_VIDEO_WaitVSync
	xorl	%eax, %eax
	callq	_PAD_ScanPads
	movq	_MAX_DEVICES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	testl	%r9d, %r9d
	jle	LBB0_7
## %bb.1:
	movq	_input@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_NO_DEVICE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	_config@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r8
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	xorl	%r14d, %r14d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%edi
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	cmpq	%rbx, %r9
	je	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, (%rdx,%rbx,8)
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	%edi, %rcx
	cmpl	$0, (%r8,%rcx,8)
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r8,%rcx,8), %ecx
	btl	%ecx, %eax
	adcl	$0, %r14d
	jmp	LBB0_5
LBB0_7:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_DEVICES,4,2                ## @MAX_DEVICES
	.comm	_input,8,3                      ## @input
	.comm	_NO_DEVICE,8,3                  ## @NO_DEVICE
	.comm	_config,8,3                     ## @config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gx_input_FindDevices           ; -- Begin function gx_input_FindDevices
	.p2align	2
_gx_input_FindDevices:                  ; @gx_input_FindDevices
	.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
	bl	_VIDEO_WaitVSync
	bl	_PAD_ScanPads
Lloh0:
	adrp	x8, _MAX_DEVICES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_DEVICES@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.1:
	mov	w10, #0
	mov	w8, #0
Lloh3:
	adrp	x11, _input@GOTPAGE
Lloh4:
	ldr	x11, [x11, _input@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
Lloh6:
	adrp	x12, _NO_DEVICE@GOTPAGE
Lloh7:
	ldr	x12, [x12, _NO_DEVICE@GOTPAGEOFF]
Lloh8:
	ldr	x12, [x12]
Lloh9:
	adrp	x13, _config@GOTPAGE
Lloh10:
	ldr	x13, [x13, _config@GOTPAGEOFF]
Lloh11:
	ldr	x13, [x13]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w10, w10, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x11, x11, #8
	subs	x9, x9, #1
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x14, [x11]
	cmp	x14, x12
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	sbfiz	x14, x10, #3, #32
	ldr	w14, [x13, x14]
	cbnz	w14, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	sxtw	x14, w10
	add	x14, x13, x14, lsl #3
	ldr	w14, [x14, #4]
	lsr	w14, w0, w14
	and	w14, w14, #0x1
	add	w8, w14, w8
	b	LBB0_2
LBB0_7:
	mov	w8, #0
LBB0_8:
	mov	x0, x8
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_DEVICES,4,2                ; @MAX_DEVICES
	.comm	_input,8,3                      ; @input
	.comm	_NO_DEVICE,8,3                  ; @NO_DEVICE
	.comm	_config,8,3                     ; @config
.subsections_via_symbols
