	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bh1770_power_state_store
_bh1770_power_state_store:              ## @bh1770_power_state_store
	.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	%rcx, %r14
	movq	%rdx, %rbx
	movq	%rdi, %r13
	callq	_dev_get_drvdata
	movq	%rax, %r12
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_kstrtoul
	testq	%rax, %rax
	jne	LBB0_6
## %bb.1:
	leaq	4(%r12), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	cmpq	$0, -48(%rbp)
	je	LBB0_3
## %bb.2:
	movq	%r13, %rdi
	callq	_pm_runtime_get_sync
	movl	8(%r12), %esi
	movq	%r12, %rdi
	callq	_bh1770_lux_rate
	movq	_BH1770_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_bh1770_lux_interrupt_control
	movq	_BH1770_LUX_DEF_THRES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	%edx, %esi
	callq	_bh1770_lux_update_thresholds
	movl	$1, (%r12)
	movq	%r12, %rdi
	callq	_bh1770_prox_mode_control
	jmp	LBB0_5
LBB0_3:
	movq	%r13, %rdi
	callq	_pm_runtime_suspended
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	%r13, %rdi
	callq	_pm_runtime_put
LBB0_5:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%r14, %rax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BH1770_ENABLE,4,2              ## @BH1770_ENABLE
	.comm	_BH1770_LUX_DEF_THRES,4,2       ## @BH1770_LUX_DEF_THRES
	.no_dead_strip	_bh1770_power_state_store
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bh1770_power_state_store
_bh1770_power_state_store:              ; @bh1770_power_state_store
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x3
	mov	x20, x2
	mov	x22, x0
	bl	_dev_get_drvdata
	mov	x21, x0
	add	x2, sp, #8
	mov	x0, x20
	mov	w1, #0
	bl	_kstrtoul
	cbnz	x0, LBB0_6
; %bb.1:
	add	x20, x21, #4
	mov	x0, x20
	bl	_mutex_lock
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x22
	bl	_pm_runtime_get_sync
	ldr	w1, [x21, #8]
	mov	x0, x21
	bl	_bh1770_lux_rate
Lloh0:
	adrp	x8, _BH1770_ENABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BH1770_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_bh1770_lux_interrupt_control
Lloh3:
	adrp	x8, _BH1770_LUX_DEF_THRES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BH1770_LUX_DEF_THRES@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x1
	bl	_bh1770_lux_update_thresholds
	mov	w8, #1
	str	w8, [x21]
	mov	x0, x21
	bl	_bh1770_prox_mode_control
	b	LBB0_5
LBB0_3:
	mov	x0, x22
	bl	_pm_runtime_suspended
	cbnz	w0, LBB0_5
; %bb.4:
	mov	x0, x22
	bl	_pm_runtime_put
LBB0_5:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BH1770_ENABLE,4,2              ; @BH1770_ENABLE
	.comm	_BH1770_LUX_DEF_THRES,4,2       ; @BH1770_LUX_DEF_THRES
	.no_dead_strip	_bh1770_power_state_store
.subsections_via_symbols
