	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sensor_hub_device_open         ## -- Begin function sensor_hub_device_open
	.p2align	4, 0x90
_sensor_hub_device_open:                ## @sensor_hub_device_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_hid_get_drvdata
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_mutex_lock
	movl	4(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_1
LBB0_3:
	incl	%eax
	movl	%eax, 4(%rbx)
	xorl	%r15d, %r15d
	jmp	LBB0_4
LBB0_1:
	movl	(%r14), %edi
	callq	_hid_hw_open
	testl	%eax, %eax
	je	LBB0_2
## %bb.5:
	movl	%eax, %r15d
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_hid_err
LBB0_4:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	4(%rbx), %eax
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to open hid device\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sensor_hub_device_open         ; -- Begin function sensor_hub_device_open
	.p2align	2
_sensor_hub_device_open:                ; @sensor_hub_device_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	x20, x0
	ldr	w0, [x0]
	bl	_hid_get_drvdata
	mov	x19, x0
	bl	_mutex_lock
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_2
LBB0_1:
	mov	w21, #0
	add	w8, w8, #1
	str	w8, [x19, #4]
	b	LBB0_4
LBB0_2:
	ldr	w0, [x20]
	bl	_hid_hw_open
	cbz	w0, LBB0_5
; %bb.3:
	mov	x21, x0
	ldr	w0, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_hid_err
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
	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_5:
	ldr	w8, [x19, #4]
	b	LBB0_1
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to open hid device\n"

.subsections_via_symbols
