	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hiddev_open
_hiddev_open:                           ## @hiddev_open
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_iminor
	movq	_HIDDEV_MINOR_BASE@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movq	_HIDDEV_MINORS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_3
## %bb.1:
	testl	%eax, %eax
	js	LBB0_3
## %bb.2:
	movq	_hiddev_table@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movl	%eax, %r13d
	cmpq	$0, (%rcx,%r13,8)
	je	LBB0_3
## %bb.5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r15
	leaq	12(%rax), %rdi
	callq	_mutex_init
	movq	(%r12), %rax
	movq	(%rax,%r13,8), %rdi
	movq	%rdi, (%r15)
	movq	%r15, (%r14)
	cmpq	$0, 8(%rdi)
	je	LBB0_8
## %bb.9:
	movl	16(%rdi), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 16(%rdi)
	testl	%eax, %eax
	jne	LBB0_12
## %bb.10:
	movq	(%r12), %rax
	movq	(%rax,%r13,8), %rax
	movq	(%rax), %rdi
	callq	_usbhid_open
	testl	%eax, %eax
	js	LBB0_15
## %bb.11:
	movq	(%r15), %rdi
LBB0_12:
	addq	$20, %rdi
	callq	_spin_lock_irq
	movq	%r15, %rdi
	addq	$8, %rdi
	movq	(%r12), %rax
	movq	(%rax,%r13,8), %rsi
	addq	$24, %rsi
	callq	_list_add_tail
	movq	(%r15), %rdi
	addq	$20, %rdi
	callq	_spin_unlock_irq
	movq	(%r15), %rax
	movl	16(%rax), %ecx
	leal	1(%rcx), %edx
	movl	%edx, 16(%rax)
	xorl	%ebx, %ebx
	testl	%ecx, %ecx
	jne	LBB0_17
## %bb.13:
	cmpq	$0, 8(%rax)
	je	LBB0_17
## %bb.14:
	movq	(%r12), %rax
	movq	(%rax,%r13,8), %rax
	movq	(%rax), %r12
	movq	%r12, %rdi
	callq	_usbhid_get_power
	testl	%eax, %eax
	js	LBB0_15
## %bb.18:
	movq	%r12, %rdi
	callq	_usbhid_open
	jmp	LBB0_17
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_8:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_15:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_16:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	$0, (%r14)
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_HIDDEV_MINOR_BASE,4,2          ## @HIDDEV_MINOR_BASE
	.comm	_HIDDEV_MINORS,4,2              ## @HIDDEV_MINORS
	.comm	_hiddev_table,8,3               ## @hiddev_table
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_hiddev_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hiddev_open
_hiddev_open:                           ; @hiddev_open
	.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
	mov	x19, x1
	bl	_iminor
Lloh0:
	adrp	x8, _HIDDEV_MINOR_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HIDDEV_MINOR_BASE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _HIDDEV_MINORS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _HIDDEV_MINORS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	sub	w21, w0, w8
	cmp	w21, w9
	b.ge	LBB0_10
; %bb.1:
	tbnz	w21, #31, LBB0_10
; %bb.2:
Lloh6:
	adrp	x22, _hiddev_table@GOTPAGE
Lloh7:
	ldr	x22, [x22, _hiddev_table@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x8, [x8, w21, uxtw #3]
	cbz	x8, LBB0_10
; %bb.3:
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_13
; %bb.4:
	mov	x20, x0
	add	x0, x0, #12
	bl	_mutex_init
	ldr	x8, [x22]
	ldr	x8, [x8, x21, lsl #3]
	str	x8, [x20]
	str	x20, [x19]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_14
; %bb.5:
	ldr	w9, [x8, #16]
	add	w10, w9, #1
	str	w10, [x8, #16]
	cbnz	w9, LBB0_8
; %bb.6:
	ldr	x8, [x22]
	ldr	x8, [x8, x21, lsl #3]
	ldr	x0, [x8]
	bl	_usbhid_open
	tbnz	w0, #31, LBB0_18
; %bb.7:
	ldr	x8, [x20]
LBB0_8:
	add	x0, x8, #20
	bl	_spin_lock_irq
	add	x0, x20, #8
	ldr	x8, [x22]
	ldr	x8, [x8, x21, lsl #3]
	add	x1, x8, #24
	bl	_list_add_tail
	ldr	x8, [x20]
	add	x0, x8, #20
	bl	_spin_unlock_irq
	ldr	x8, [x20]
	ldr	w9, [x8, #16]
	add	w10, w9, #1
	str	w10, [x8, #16]
	cbz	w9, LBB0_15
LBB0_9:
	mov	w21, #0
	b	LBB0_12
LBB0_10:
Lloh11:
	adrp	x8, _ENODEV@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, x21
	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
LBB0_13:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
LBB0_14:
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_19
LBB0_15:
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_9
; %bb.16:
	ldr	x8, [x22]
	ldr	x8, [x8, x21, lsl #3]
	ldr	x21, [x8]
	mov	x0, x21
	bl	_usbhid_get_power
	tbnz	w0, #31, LBB0_18
; %bb.17:
	mov	x0, x21
	bl	_usbhid_open
	mov	w21, #0
	b	LBB0_12
LBB0_18:
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_19:
	ldr	w8, [x8]
	neg	w21, w8
	str	xzr, [x19]
	mov	x0, x20
	bl	_kfree
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_HIDDEV_MINOR_BASE,4,2          ; @HIDDEV_MINOR_BASE
	.comm	_HIDDEV_MINORS,4,2              ; @HIDDEV_MINORS
	.comm	_hiddev_table,8,3               ; @hiddev_table
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_hiddev_open
.subsections_via_symbols
