	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_devices
_open_devices:                          ## @open_devices
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%esi, %r13d
	movq	_g_dev_type_str@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%esi, %ecx
	movq	(%rax,%rcx,8), %r14
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %edi
	callq	_udev_enumerate_new
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rdx
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_udev_enumerate_add_match_property
	movq	%rbx, %rdi
	callq	_udev_enumerate_scan_devices
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_udev_enumerate_get_list_entry
	testq	%rax, %rax
	je	LBB0_11
## %bb.3:
	movq	%rax, %rbx
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_UDEV_INPUT_KEYBOARD@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	leaq	L_.str.4(%rip), %rsi
	leaq	L_.str.3(%rip), %rax
	cmoveq	%rax, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	leal	1(%rdx), %r13d
	leaq	L_.str.2(%rip), %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	movq	%r12, %rcx
	callq	_RARCH_LOG
	movl	%r13d, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %r13d                ## 4-byte Reload
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%r15d, %edi
	callq	_close
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	callq	_udev_device_unref
	movq	%rbx, %rdi
	callq	_udev_list_entry_get_next
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_11
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_udev_list_entry_get_name
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %edi
	movq	%rax, %rsi
	callq	_udev_device_new_from_syspath
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_udev_device_get_devnode
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r12
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%r12, %rdi
	callq	_open
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %r15d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	movq	%r12, %rdx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	callq	_udev_input_add_device
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_RARCH_ERR
	jmp	LBB0_9
LBB0_11:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_udev_enumerate_unref
	movl	$1, %eax
	jmp	LBB0_12
LBB0_1:
	xorl	%eax, %eax
LBB0_12:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_g_dev_type_str,8,3             ## @g_dev_type_str
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"1"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
L_.str.1:                               ## @.str.1
	.asciz	"[udev] Failed to open device: %s (%s).\n"

	.comm	_errno,4,2                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"[udev]: %s #%d (%s).\n"

	.comm	_UDEV_INPUT_KEYBOARD,4,2        ## @UDEV_INPUT_KEYBOARD
L_.str.3:                               ## @.str.3
	.asciz	"Keyboard"

L_.str.4:                               ## @.str.4
	.asciz	"Mouse"

	.no_dead_strip	_open_devices
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_devices
_open_devices:                          ; @open_devices
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	w2, [sp, #12]                   ; 4-byte Folded Spill
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _g_dev_type_str@GOTPAGE
Lloh1:
	ldr	x8, [x8, _g_dev_type_str@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x23, [x8, w1, uxtw #3]
	ldr	w0, [x0]
	bl	_udev_enumerate_new
	cbz	x0, LBB0_11
; %bb.1:
	mov	x22, x0
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x1, x23
	bl	_udev_enumerate_add_match_property
	mov	x0, x22
	bl	_udev_enumerate_scan_devices
	str	x22, [sp]                       ; 8-byte Folded Spill
	mov	x0, x22
	bl	_udev_enumerate_get_list_entry
	cbz	x0, LBB0_10
; %bb.2:
	mov	x23, x0
	mov	w26, #0
Lloh5:
	adrp	x24, _O_RDONLY@GOTPAGE
Lloh6:
	ldr	x24, [x24, _O_RDONLY@GOTPAGEOFF]
Lloh7:
	adrp	x19, _O_NONBLOCK@GOTPAGE
Lloh8:
	ldr	x19, [x19, _O_NONBLOCK@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
Lloh9:
	adrp	x8, _UDEV_INPUT_KEYBOARD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _UDEV_INPUT_KEYBOARD@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, w20
Lloh12:
	adrp	x8, l_.str.4@PAGE
Lloh13:
	add	x8, x8, l_.str.4@PAGEOFF
Lloh14:
	adrp	x9, l_.str.3@PAGE
Lloh15:
	add	x9, x9, l_.str.3@PAGEOFF
	csel	x1, x9, x8, eq
	mov	x22, x24
	add	w24, w26, #1
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x2, x26
	mov	x3, x25
	bl	_RARCH_LOG
	mov	x26, x24
	mov	x24, x22
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x28
	bl	_close
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x27
	bl	_udev_device_unref
	mov	x0, x23
	bl	_udev_list_entry_get_next
	mov	x23, x0
	cbz	x0, LBB0_10
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_udev_list_entry_get_name
	mov	x1, x0
	ldr	w0, [x21]
	bl	_udev_device_new_from_syspath
	mov	x27, x0
	bl	_udev_device_get_devnode
	cbz	x0, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x25, x0
	ldr	w8, [x24]
	ldr	w9, [x19]
	orr	w1, w9, w8
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x28, x0
	mov	x0, x21
	mov	x1, x20
	mov	x2, x25
	ldr	w3, [sp, #12]                   ; 4-byte Folded Reload
	bl	_udev_input_add_device
	cbnz	w0, LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh18:
	adrp	x8, _errno@GOTPAGE
Lloh19:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x25
	bl	_RARCH_ERR
	b	LBB0_4
LBB0_10:
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_udev_enumerate_unref
	mov	w0, #1
LBB0_11:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_g_dev_type_str,8,3             ; @g_dev_type_str
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"1"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
l_.str.1:                               ; @.str.1
	.asciz	"[udev] Failed to open device: %s (%s).\n"

	.comm	_errno,4,2                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"[udev]: %s #%d (%s).\n"

	.comm	_UDEV_INPUT_KEYBOARD,4,2        ; @UDEV_INPUT_KEYBOARD
l_.str.3:                               ; @.str.3
	.asciz	"Keyboard"

l_.str.4:                               ; @.str.4
	.asciz	"Mouse"

	.no_dead_strip	_open_devices
.subsections_via_symbols
