	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _hid_sensor_power_state
__hid_sensor_power_state:               ## @_hid_sensor_power_state
	.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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	testl	%esi, %esi
	je	LBB0_4
## %bb.1:
	movl	16(%rbx), %edi
	callq	_sensor_hub_device_open
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_4:
	leaq	48(%rbx), %rdi
	callq	_atomic_dec_if_positive
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	16(%rbx), %edi
	callq	_sensor_hub_device_close
	movl	16(%rbx), %edi
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	movq	_HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_hid_sensor_get_usage_index
	movl	%eax, %r13d
	movl	%eax, -44(%rbp)
	movl	36(%rbx), %esi
	movl	16(%rbx), %edi
	movl	32(%rbx), %edx
	movq	_HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_hid_sensor_get_usage_index
	movl	%eax, %r12d
	movl	%eax, -48(%rbp)
	xorl	%r15d, %r15d
	testl	%r13d, %r13d
	jns	LBB0_8
	jmp	LBB0_9
LBB0_3:
	leaq	48(%rbx), %rdi
	callq	_atomic_inc
	movl	16(%rbx), %edi
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	movq	_HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_hid_sensor_get_usage_index
	movl	%eax, %r13d
	movl	%eax, -44(%rbp)
	movl	36(%rbx), %esi
	movl	16(%rbx), %edi
	movl	32(%rbx), %edx
	movq	_HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_hid_sensor_get_usage_index
	movl	%eax, %r12d
	movl	%eax, -48(%rbp)
	movq	%rbx, %rdi
	callq	_hid_sensor_read_poll_value
	movl	%eax, %r15d
	testl	%r13d, %r13d
	js	LBB0_9
LBB0_8:
	addl	8(%rbx), %r13d
	movl	%r13d, -44(%rbp)
	movl	16(%rbx), %edi
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	leaq	-44(%rbp), %r8
	movl	$4, %ecx
	callq	_sensor_hub_set_feature
LBB0_9:
	testl	%r12d, %r12d
	js	LBB0_11
## %bb.10:
	addl	40(%rbx), %r12d
	movl	%r12d, -48(%rbp)
	movl	36(%rbx), %esi
	movl	16(%rbx), %edi
	movl	32(%rbx), %edx
	leaq	-48(%rbp), %r8
	movl	$4, %ecx
	callq	_sensor_hub_set_feature
	movl	-48(%rbp), %r12d
LBB0_11:
	movq	24(%rbx), %rax
	movl	(%rax), %esi
	movl	-44(%rbp), %edx
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %ecx
	callq	_pr_debug
	movl	16(%rbx), %edi
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	leaq	-44(%rbp), %r8
	movl	$4, %ecx
	callq	_sensor_hub_get_feature
	xorl	%ebx, %ebx
	testl	%r14d, %r14d
	je	LBB0_14
## %bb.12:
	testl	%r15d, %r15d
	je	LBB0_14
## %bb.13:
	addl	%r15d, %r15d
	movl	%r15d, %edi
	callq	_msleep_interruptible
	jmp	LBB0_14
LBB0_5:
	xorl	%ebx, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM,4,2 ## @HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM
	.comm	_HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM,4,2 ## @HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM
	.comm	_HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM,4,2 ## @HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM
	.comm	_HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM,4,2 ## @HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HID_SENSOR %s set power_state %d report_state %d\n"

	.no_dead_strip	__hid_sensor_power_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _hid_sensor_power_state
__hid_sensor_power_state:               ; @_hid_sensor_power_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
	cbz	w1, LBB0_3
; %bb.1:
	ldr	w0, [x20, #16]
	bl	_sensor_hub_device_open
	cbz	x0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_3:
	add	x0, x20, #48
	bl	_atomic_dec_if_positive
	tbnz	w0, #31, LBB0_12
; %bb.4:
	ldr	w0, [x20, #16]
	bl	_sensor_hub_device_close
	ldr	w0, [x20, #16]
	ldp	w2, w1, [x20]
Lloh3:
	adrp	x8, _HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	bl	_hid_sensor_get_usage_index
	mov	x23, x0
	str	w0, [sp, #12]
	ldr	w0, [x20, #16]
	ldp	w2, w1, [x20, #32]
Lloh6:
	adrp	x8, _HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	bl	_hid_sensor_get_usage_index
	mov	x22, x0
	mov	w21, #0
	str	w0, [sp, #8]
	tbz	w23, #31, LBB0_6
	b	LBB0_7
LBB0_5:
	add	x0, x20, #48
	bl	_atomic_inc
	ldr	w0, [x20, #16]
	ldp	w2, w1, [x20]
Lloh9:
	adrp	x8, _HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	bl	_hid_sensor_get_usage_index
	mov	x23, x0
	str	w0, [sp, #12]
	ldr	w0, [x20, #16]
	ldp	w2, w1, [x20, #32]
Lloh12:
	adrp	x8, _HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	bl	_hid_sensor_get_usage_index
	mov	x22, x0
	str	w0, [sp, #8]
	mov	x0, x20
	bl	_hid_sensor_read_poll_value
	mov	x21, x0
	tbnz	w23, #31, LBB0_7
LBB0_6:
	ldp	w1, w8, [x20, #4]
	add	w8, w23, w8
	str	w8, [sp, #12]
	ldr	w0, [x20, #16]
	ldr	w2, [x20]
	add	x4, sp, #12
	mov	w3, #4
	bl	_sensor_hub_set_feature
LBB0_7:
	tbnz	w22, #31, LBB0_9
; %bb.8:
	ldp	w1, w8, [x20, #36]
	add	w8, w22, w8
	str	w8, [sp, #8]
	ldr	w0, [x20, #16]
	ldr	w2, [x20, #32]
	add	x4, sp, #8
	mov	w3, #4
	bl	_sensor_hub_set_feature
	ldr	w22, [sp, #8]
LBB0_9:
	ldr	x8, [x20, #24]
	ldr	w1, [x8]
	ldr	w2, [sp, #12]
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x22
	bl	_pr_debug
	ldr	w0, [x20, #16]
	ldp	w2, w1, [x20]
	add	x4, sp, #12
	mov	w3, #4
	bl	_sensor_hub_get_feature
	mov	w0, #0
	cbz	w19, LBB0_13
; %bb.10:
	cbz	w21, LBB0_13
; %bb.11:
	lsl	w0, w21, #1
	bl	_msleep_interruptible
LBB0_12:
	mov	w0, #0
LBB0_13:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM,4,2 ; @HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM
	.comm	_HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM,4,2 ; @HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM
	.comm	_HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM,4,2 ; @HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM
	.comm	_HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM,4,2 ; @HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HID_SENSOR %s set power_state %d report_state %d\n"

	.no_dead_strip	__hid_sensor_power_state
.subsections_via_symbols
