	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	callq	_iminor
	movl	%eax, %edi
	callq	_usbhid_find_interface
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rdi
	callq	_usb_get_intfdata
	movq	%rax, %r12
	movq	(%rax), %r14
	movl	$16, %edi
	callq	_vzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r13
	movq	%rax, %r15
	leaq	12(%rax), %rdi
	callq	_mutex_init
	movq	%r14, (%r13)
	movq	%r13, (%rbx)
	cmpq	$0, 16(%r14)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_9
## %bb.6:
	movl	24(%r14), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 24(%r14)
	movq	%r14, %rdi
	testl	%eax, %eax
	jne	LBB0_11
## %bb.7:
	movq	8(%r14), %rdi
	callq	_hid_hw_open
	testl	%eax, %eax
	js	LBB0_8
## %bb.10:
	movq	(%r15), %rdi
LBB0_11:
	callq	_spin_lock_irq
	addq	$8, %r13
	leaq	28(%r14), %rsi
	movq	%r13, %rdi
	callq	_list_add_tail
	movq	(%r15), %rdi
	callq	_spin_unlock_irq
	leaq	4(%r14), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	(%r15), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_12
## %bb.13:
	movl	24(%rax), %ecx
	leal	1(%rcx), %edx
	movl	%edx, 24(%rax)
	testl	%ecx, %ecx
	je	LBB0_14
LBB0_17:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_9:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_20
LBB0_12:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	(%r15), %rdi
	callq	_spin_lock_irq
	movq	%r13, %rdi
	callq	_list_del
	movq	(%r15), %rdi
	callq	_spin_unlock_irq
	jmp	LBB0_20
LBB0_14:
	movq	8(%r14), %r14
	movq	_PM_HINT_FULLON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_hid_hw_power
	testl	%eax, %eax
	js	LBB0_15
## %bb.16:
	movq	%r14, %rdi
	callq	_hid_hw_open
	testl	%eax, %eax
	jns	LBB0_17
## %bb.18:
	movl	%eax, %ebx
	movq	_PM_HINT_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_hid_hw_power
	jmp	LBB0_19
LBB0_8:
	movl	%eax, %ebx
LBB0_20:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	movq	%r15, %rdi
	callq	_vfree
LBB0_21:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	%eax, %ebx
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PM_HINT_FULLON,4,2             ## @PM_HINT_FULLON
	.comm	_PM_HINT_NORMAL,4,2             ## @PM_HINT_NORMAL
	.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	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	bl	_iminor
	bl	_usbhid_find_interface
	cbz	x0, LBB0_9
; %bb.1:
	bl	_usb_get_intfdata
	mov	x21, x0
	ldr	x25, [x0]
	mov	w0, #16
	bl	_vzalloc
	cbz	x0, LBB0_10
; %bb.2:
	mov	x20, x0
	add	x0, x0, #12
	bl	_mutex_init
	str	x25, [x20]
	str	x20, [x19]
	ldr	x8, [x25, #16]
	cbz	x8, LBB0_12
; %bb.3:
	ldr	w8, [x25, #24]
	add	w9, w8, #1
	str	w9, [x25, #24]
	mov	x0, x25
	cbnz	w8, LBB0_6
; %bb.4:
	ldr	x0, [x25, #8]
	bl	_hid_hw_open
	tbnz	w0, #31, LBB0_18
; %bb.5:
	ldr	x0, [x20]
LBB0_6:
	bl	_spin_lock_irq
	add	x22, x20, #8
	add	x1, x25, #28
	mov	x0, x22
	bl	_list_add_tail
	ldr	x0, [x20]
	bl	_spin_unlock_irq
	add	x24, x25, #4
	mov	x0, x24
	bl	_mutex_lock
	ldr	x8, [x20]
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_13
; %bb.7:
	ldr	w9, [x8, #24]
	add	w10, w9, #1
	str	w10, [x8, #24]
	cbz	w9, LBB0_15
LBB0_8:
	mov	x0, x24
	bl	_mutex_unlock
	mov	w23, #0
	b	LBB0_20
LBB0_9:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_20
LBB0_12:
Lloh4:
	adrp	x8, _ENODEV@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_19
LBB0_13:
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_14:
	mov	x0, x24
	bl	_mutex_unlock
	ldr	x0, [x20]
	bl	_spin_lock_irq
	mov	x0, x22
	bl	_list_del
	ldr	x0, [x20]
	bl	_spin_unlock_irq
	b	LBB0_19
LBB0_15:
	ldr	x25, [x25, #8]
Lloh10:
	adrp	x8, _PM_HINT_FULLON@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PM_HINT_FULLON@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x25
	bl	_hid_hw_power
	tbnz	w0, #31, LBB0_21
; %bb.16:
	mov	x0, x25
	bl	_hid_hw_open
	tbz	w0, #31, LBB0_8
; %bb.17:
	mov	x23, x0
Lloh13:
	adrp	x8, _PM_HINT_NORMAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PM_HINT_NORMAL@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_hid_hw_power
	b	LBB0_14
LBB0_18:
	mov	x23, x0
LBB0_19:
	str	xzr, [x19]
	mov	x0, x20
	bl	_vfree
LBB0_20:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_21:
	mov	x23, x0
	b	LBB0_14
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PM_HINT_FULLON,4,2             ; @PM_HINT_FULLON
	.comm	_PM_HINT_NORMAL,4,2             ; @PM_HINT_NORMAL
	.no_dead_strip	_hiddev_open
.subsections_via_symbols
