	.file	"extr_bh1770glc.c_bh1770_lux_update_thresholds.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	bh1770_lux_update_thresholds, @function
bh1770_lux_update_thresholds:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdi
	sub	rsp, 32
	.cfi_def_cfa_offset 64
	mov	rdi, QWORD PTR 8[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	pm_runtime_suspended@PLT
	test	rax, rax
	jne	.L7
	mov	eax, DWORD PTR BH1770_LUX_RANGE[rip]
	cmp	eax, ebp
	je	.L4
	test	ebp, ebp
	jne	.L19
.L4:
	cmp	r12d, eax
	je	.L5
.L22:
	test	r12d, r12d
	jne	.L20
.L5:
	cmp	DWORD PTR [rbx], ebp
	jne	.L6
.L23:
	cmp	DWORD PTR 4[rbx], r12d
	je	.L7
.L6:
	mov	DWORD PTR [rbx], ebp
	mov	DWORD PTR 4[rbx], r12d
	mov	DWORD PTR 8[rsp], r12d
	sar	r12d, 8
	mov	DWORD PTR 12[rsp], r12d
	mov	r12, rsp
	mov	DWORD PTR [rsp], ebp
	mov	rdi, r12
	sar	ebp, 8
	mov	DWORD PTR 4[rsp], ebp
	call	ARRAY_SIZE@PLT
	mov	rdi, QWORD PTR 8[rbx]
	mov	esi, DWORD PTR BH1770_ALS_TH_UP_0[rip]
	mov	rcx, r12
	mov	edx, eax
	call	i2c_smbus_write_i2c_block_data@PLT
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L21
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L19:
	mov	esi, ebp
	mov	rdi, rbx
	call	bh1770_lux_adjusted_to_raw@PLT
	mov	ebp, eax
	mov	eax, DWORD PTR BH1770_LUX_RANGE[rip]
	cmp	r12d, eax
	jne	.L22
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L20:
	mov	esi, r12d
	mov	rdi, rbx
	call	bh1770_lux_adjusted_to_raw@PLT
	mov	r12d, eax
	cmp	DWORD PTR [rbx], ebp
	je	.L23
	jmp	.L6
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	bh1770_lux_update_thresholds, .-bh1770_lux_update_thresholds
	.comm	BH1770_LUX_RANGE,4,4
	.comm	BH1770_ALS_TH_UP_0,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_bh1770glc.c_bh1770_lux_update_thresholds.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bh1770_lux_update_thresholds, %function
bh1770_lux_update_thresholds:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L24
	sub	sp, sp, #28
	mov	r5, r0
	ldr	r0, [r0, #8]
	mov	r4, r1
	mov	r6, r2
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	bl	pm_runtime_suspended
	cmp	r0, #0
	bne	.L7
	ldr	r7, .L24+4
	ldr	r3, [r7]
	cmp	r3, r4
	beq	.L4
	cmp	r4, #0
	bne	.L19
.L4:
	cmp	r6, r3
	beq	.L5
.L22:
	cmp	r6, #0
	bne	.L20
.L5:
	ldr	r3, [r5]
	cmp	r3, r4
	bne	.L6
.L23:
	ldr	r3, [r5, #4]
	cmp	r3, r6
	beq	.L7
.L6:
	ldr	r3, .L24+8
	asr	r2, r4, #8
	ldr	r7, [r3]
	stm	r5, {r4, r6}
	asr	r3, r6, #8
	add	r0, sp, #4
	ldr	r5, [r5, #8]
	str	r2, [sp, #8]
	str	r3, [sp, #16]
	str	r4, [sp, #4]
	str	r6, [sp, #12]
	bl	ARRAY_SIZE
	mov	r1, r7
	mov	r2, r0
	add	r3, sp, #4
	mov	r0, r5
	bl	i2c_smbus_write_i2c_block_data
.L1:
	ldr	r3, .L24
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L7:
	mov	r0, #0
	b	.L1
.L19:
	mov	r1, r4
	mov	r0, r5
	bl	bh1770_lux_adjusted_to_raw
	ldr	r3, [r7]
	mov	r4, r0
	cmp	r6, r3
	bne	.L22
	b	.L5
.L20:
	mov	r1, r6
	mov	r0, r5
	bl	bh1770_lux_adjusted_to_raw
	ldr	r3, [r5]
	mov	r6, r0
	cmp	r3, r4
	beq	.L23
	b	.L6
.L21:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	.LC0
	.word	BH1770_LUX_RANGE
	.word	BH1770_ALS_TH_UP_0
	.size	bh1770_lux_update_thresholds, .-bh1770_lux_update_thresholds
	.comm	BH1770_LUX_RANGE,4,4
	.comm	BH1770_ALS_TH_UP_0,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
