	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lm3530_als_configure
_lm3530_als_configure:                  ## @lm3530_als_configure
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	8(%rdi), %r14d
	movq	_LM3530_ALS_WINDOW_mV@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	jmp	LBB0_3
LBB0_2:
	movl	$0, 8(%rdi)
	movq	_LM3530_ALS_WINDOW_mV@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movslq	%edx, %rax
	movq	%rax, (%rdi)
	xorl	%r14d, %r14d
LBB0_3:
	subl	%r14d, %eax
	cmpl	%edx, %eax
	jle	LBB0_5
## %bb.4:
	leal	(%rdx,%r14), %eax
	cltq
	movq	%rax, (%rdi)
	movl	%edx, %eax
LBB0_5:
	movq	_LM3530_ALS_ZB_MAX@GOTPCREL(%rip), %r8
	movl	(%r8), %r9d
	leal	1(%r9), %r10d
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%r10d
	testl	%r9d, %r9d
	jle	LBB0_8
## %bb.6:
	movq	(%rsi), %r9
	addl	%eax, %r14d
	xorl	%edx, %edx
	movq	_LM3530_ALS_OFFSET_mV@GOTPCREL(%rip), %r10
	movq	_LED_FULL@GOTPCREL(%rip), %r11
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r10), %ebx
	addl	%r14d, %ebx
	imull	(%r11), %ebx
	movslq	%ebx, %rbx
	imulq	$274877907, %rbx, %rbx          ## imm = 0x10624DD3
	movq	%rbx, %rcx
	shrq	$63, %rcx
	sarq	$38, %rbx
	addl	%ecx, %ebx
	movl	%ebx, (%r9,%rdx,4)
	incq	%rdx
	movslq	(%r8), %rcx
	addl	%eax, %r14d
	cmpq	%rcx, %rdx
	jl	LBB0_7
LBB0_8:
	movq	_LM3530_ALS_AVG_TIME_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	12(%rdi), %eax
	shll	%cl, %eax
	movl	16(%rdi), %edx
	movq	_LM3530_ALS_SEL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	_LM3530_ENABLE_ALS@GOTPCREL(%rip), %rbx
	shll	%cl, %edx
	orl	(%rbx), %eax
	orl	%eax, %edx
	movl	%edx, 8(%rsi)
	movq	_LM3530_ALS1_IMP_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	20(%rdi), %eax
	movl	24(%rdi), %edx
	shll	%cl, %eax
	movq	_LM3530_ALS2_IMP_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, 12(%rsi)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LM3530_ALS_WINDOW_mV,4,2       ## @LM3530_ALS_WINDOW_mV
	.comm	_LM3530_ALS_ZB_MAX,4,2          ## @LM3530_ALS_ZB_MAX
	.comm	_LM3530_ALS_OFFSET_mV,4,2       ## @LM3530_ALS_OFFSET_mV
	.comm	_LED_FULL,4,2                   ## @LED_FULL
	.comm	_LM3530_ALS_AVG_TIME_SHIFT,4,2  ## @LM3530_ALS_AVG_TIME_SHIFT
	.comm	_LM3530_ENABLE_ALS,4,2          ## @LM3530_ENABLE_ALS
	.comm	_LM3530_ALS_SEL_SHIFT,4,2       ## @LM3530_ALS_SEL_SHIFT
	.comm	_LM3530_ALS1_IMP_SHIFT,4,2      ## @LM3530_ALS1_IMP_SHIFT
	.comm	_LM3530_ALS2_IMP_SHIFT,4,2      ## @LM3530_ALS2_IMP_SHIFT
	.no_dead_strip	_lm3530_als_configure
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lm3530_als_configure
_lm3530_als_configure:                  ; @lm3530_als_configure
	.cfi_startproc
; %bb.0:
	ldr	x10, [x0]
	cbz	x10, LBB0_2
; %bb.1:
	ldr	w8, [x0, #8]
Lloh0:
	adrp	x9, _LM3530_ALS_WINDOW_mV@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LM3530_ALS_WINDOW_mV@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	b	LBB0_3
LBB0_2:
	mov	w8, #0
	str	wzr, [x0, #8]
Lloh3:
	adrp	x9, _LM3530_ALS_WINDOW_mV@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LM3530_ALS_WINDOW_mV@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	sxtw	x10, w9
	str	x10, [x0]
LBB0_3:
	sub	w11, w10, w8
	cmp	w11, w9
	b.le	LBB0_5
; %bb.4:
	add	w10, w9, w8
	sxtw	x10, w10
	str	x10, [x0]
	mov	x11, x9
LBB0_5:
Lloh6:
	adrp	x9, _LM3530_ALS_ZB_MAX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _LM3530_ALS_ZB_MAX@GOTPAGEOFF]
	ldr	w12, [x9]
	cmp	w12, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x10, #0
	add	w12, w12, #1
	sdiv	w11, w11, w12
	ldr	x12, [x1]
	add	w8, w8, w11
Lloh8:
	adrp	x13, _LM3530_ALS_OFFSET_mV@GOTPAGE
Lloh9:
	ldr	x13, [x13, _LM3530_ALS_OFFSET_mV@GOTPAGEOFF]
Lloh10:
	adrp	x14, _LED_FULL@GOTPAGE
Lloh11:
	ldr	x14, [x14, _LED_FULL@GOTPAGEOFF]
	mov	w15, #19923
	movk	w15, #4194, lsl #16
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w16, [x13]
	add	w16, w8, w16
	ldr	w17, [x14]
	mul	w16, w16, w17
	smull	x16, w16, w15
	lsr	x17, x16, #63
	asr	x16, x16, #38
	add	w16, w16, w17
	str	w16, [x12, x10, lsl #2]
	add	x10, x10, #1
	ldrsw	x16, [x9]
	add	w8, w8, w11
	cmp	x10, x16
	b.lt	LBB0_7
LBB0_8:
Lloh12:
	adrp	x8, _LM3530_ALS_AVG_TIME_SHIFT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LM3530_ALS_AVG_TIME_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldp	w9, w10, [x0, #12]
	lsl	w8, w9, w8
Lloh15:
	adrp	x9, _LM3530_ENABLE_ALS@GOTPAGE
Lloh16:
	ldr	x9, [x9, _LM3530_ENABLE_ALS@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh18:
	adrp	x9, _LM3530_ALS_SEL_SHIFT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _LM3530_ALS_SEL_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	lsl	w9, w10, w9
Lloh21:
	adrp	x10, _LM3530_ALS1_IMP_SHIFT@GOTPAGE
Lloh22:
	ldr	x10, [x10, _LM3530_ALS1_IMP_SHIFT@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh23:
	ldr	w9, [x10]
	ldp	w10, w11, [x0, #20]
Lloh24:
	adrp	x12, _LM3530_ALS2_IMP_SHIFT@GOTPAGE
Lloh25:
	ldr	x12, [x12, _LM3530_ALS2_IMP_SHIFT@GOTPAGEOFF]
	lsl	w9, w10, w9
Lloh26:
	ldr	w10, [x12]
	lsl	w10, w11, w10
	orr	w9, w10, w9
	stp	w8, w9, [x1, #8]
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_LM3530_ALS_WINDOW_mV,4,2       ; @LM3530_ALS_WINDOW_mV
	.comm	_LM3530_ALS_ZB_MAX,4,2          ; @LM3530_ALS_ZB_MAX
	.comm	_LM3530_ALS_OFFSET_mV,4,2       ; @LM3530_ALS_OFFSET_mV
	.comm	_LED_FULL,4,2                   ; @LED_FULL
	.comm	_LM3530_ALS_AVG_TIME_SHIFT,4,2  ; @LM3530_ALS_AVG_TIME_SHIFT
	.comm	_LM3530_ENABLE_ALS,4,2          ; @LM3530_ENABLE_ALS
	.comm	_LM3530_ALS_SEL_SHIFT,4,2       ; @LM3530_ALS_SEL_SHIFT
	.comm	_LM3530_ALS1_IMP_SHIFT,4,2      ; @LM3530_ALS1_IMP_SHIFT
	.comm	_LM3530_ALS2_IMP_SHIFT,4,2      ; @LM3530_ALS2_IMP_SHIFT
	.no_dead_strip	_lm3530_als_configure
.subsections_via_symbols
