	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bh1770_lux_update_thresholds
_bh1770_lux_update_thresholds:          ## @bh1770_lux_update_thresholds
	.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
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %rdi
	callq	_pm_runtime_suspended
	xorl	%r12d, %r12d
	testq	%rax, %rax
	jne	LBB0_10
## %bb.1:
	movq	_BH1770_LUX_RANGE@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.2:
	cmpl	%ebx, %eax
	je	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_bh1770_lux_adjusted_to_raw
	movl	%eax, %ebx
	movl	(%r13), %eax
LBB0_4:
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.5:
	cmpl	%r14d, %eax
	je	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_bh1770_lux_adjusted_to_raw
	movl	%eax, %r14d
LBB0_7:
	cmpl	%ebx, (%r15)
	jne	LBB0_9
## %bb.8:
	cmpl	%r14d, 4(%r15)
	je	LBB0_10
LBB0_9:
	movl	%ebx, (%r15)
	movl	%r14d, 4(%r15)
	movl	%ebx, -64(%rbp)
	sarl	$8, %ebx
	movl	%ebx, -60(%rbp)
	movl	%r14d, -56(%rbp)
	sarl	$8, %r14d
	movl	%r14d, -52(%rbp)
	movq	8(%r15), %r14
	movq	_BH1770_ALS_TH_UP_0@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	-64(%rbp), %r15
	movq	%r15, %rdi
	callq	_ARRAY_SIZE
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	movq	%r15, %rcx
	callq	_i2c_smbus_write_i2c_block_data
	movl	%eax, %r12d
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BH1770_LUX_RANGE,4,2           ## @BH1770_LUX_RANGE
	.comm	_BH1770_ALS_TH_UP_0,4,2         ## @BH1770_ALS_TH_UP_0
	.no_dead_strip	_bh1770_lux_update_thresholds
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bh1770_lux_update_thresholds
_bh1770_lux_update_thresholds:          ; @bh1770_lux_update_thresholds
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x0, [x0, #8]
	bl	_pm_runtime_suspended
	cbz	x0, LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_11
LBB0_2:
Lloh3:
	adrp	x22, _BH1770_LUX_RANGE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _BH1770_LUX_RANGE@GOTPAGEOFF]
	ldr	w8, [x22]
	cbz	w21, LBB0_5
; %bb.3:
	cmp	w8, w21
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x19
	mov	x1, x21
	bl	_bh1770_lux_adjusted_to_raw
	mov	x21, x0
	ldr	w8, [x22]
LBB0_5:
	cbz	w20, LBB0_8
; %bb.6:
	cmp	w8, w20
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x19
	mov	x1, x20
	bl	_bh1770_lux_adjusted_to_raw
	mov	x20, x0
LBB0_8:
	ldr	w8, [x19]
	cmp	w8, w21
	b.ne	LBB0_10
; %bb.9:
	ldr	w8, [x19, #4]
	cmp	w8, w20
	b.eq	LBB0_1
LBB0_10:
	stp	w21, w20, [x19]
	asr	w8, w21, #8
	stp	w21, w8, [sp, #8]
	asr	w8, w20, #8
	stp	w20, w8, [sp, #16]
	ldr	x19, [x19, #8]
Lloh5:
	adrp	x8, _BH1770_ALS_TH_UP_0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BH1770_ALS_TH_UP_0@GOTPAGEOFF]
Lloh7:
	ldr	w20, [x8]
	add	x0, sp, #8
	bl	_ARRAY_SIZE
	mov	x2, x0
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x20
	bl	_i2c_smbus_write_i2c_block_data
LBB0_11:
	ldr	x8, [sp, #24]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	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
	add	sp, sp, #80
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_BH1770_LUX_RANGE,4,2           ; @BH1770_LUX_RANGE
	.comm	_BH1770_ALS_TH_UP_0,4,2         ; @BH1770_ALS_TH_UP_0
	.no_dead_strip	_bh1770_lux_update_thresholds
.subsections_via_symbols
