	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usbhid_open                    ## -- Begin function usbhid_open
	.p2align	4, 0x90
_usbhid_open:                           ## @usbhid_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movq	_hid_open_mut@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movl	(%rbx), %eax
	leal	1(%rax), %ecx
	movl	%ecx, (%rbx)
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	(%r14), %rdi
	callq	_usb_autopm_get_interface
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movq	(%r14), %rax
	movl	$1, (%rax)
	movq	%rbx, %rdi
	callq	_hid_start_in
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_hid_io_error
LBB0_5:
	movq	(%r14), %rdi
	callq	_usb_autopm_put_interface
LBB0_6:
	movq	_hid_open_mut@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_2:
	decl	(%rbx)
	movq	_hid_open_mut@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_hid_open_mut,4,2               ## @hid_open_mut
	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usbhid_open                    ; -- Begin function usbhid_open
	.p2align	2
_usbhid_open:                           ; @usbhid_open
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #8]
Lloh0:
	adrp	x0, _hid_open_mut@GOTPAGE
Lloh1:
	ldr	x0, [x0, _hid_open_mut@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	w8, [x19]
	add	w9, w8, #1
	str	w9, [x19]
	cbnz	w8, LBB0_5
; %bb.1:
	ldr	x0, [x20]
	bl	_usb_autopm_get_interface
	tbnz	w0, #31, LBB0_7
; %bb.2:
	ldr	x8, [x20]
	mov	w9, #1
	str	w9, [x8]
	mov	x0, x19
	bl	_hid_start_in
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_hid_io_error
LBB0_4:
	ldr	x0, [x20]
	bl	_usb_autopm_put_interface
LBB0_5:
Lloh2:
	adrp	x0, _hid_open_mut@GOTPAGE
Lloh3:
	ldr	x0, [x0, _hid_open_mut@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
Lloh4:
	adrp	x0, _hid_open_mut@GOTPAGE
Lloh5:
	ldr	x0, [x0, _hid_open_mut@GOTPAGEOFF]
	bl	_mutex_unlock
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_hid_open_mut,4,2               ; @hid_open_mut
	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
