	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lm3532_als_configure
_lm3532_als_configure:                  ## @lm3532_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	%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
	movq	%rdi, %r12
	movq	8(%rdi), %r14
	movl	(%r14), %ebx
	movl	4(%r14), %eax
	subl	%ebx, %eax
	movq	_LM3532_ALS_ZB_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leal	(%rcx,%rcx), %esi
	addl	$2, %esi
	cltd
	idivl	%esi
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%ecx, %ecx
	jle	LBB0_6
## %bb.1:
	addl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	$1, %r13d
	xorl	%r15d, %r15d
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_LED_FULL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %eax
	imull	%ebx, %eax
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	movq	8(%r14), %rcx
	movl	%eax, (%rcx,%r15,4)
	movq	_LM3532_ALS_OFFSET_mV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	addl	%ebx, %eax
	imull	(%rdx), %eax
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$38, %rax
	addl	%edx, %eax
	movq	16(%r14), %rdx
	movl	%eax, (%rdx,%r15,4)
	movq	_LM3532_REG_ZN_0_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leal	(%rbx,%r13), %esi
	decl	%esi
	movl	(%r12), %edi
	movl	(%rcx,%r15,4), %edx
	callq	_regmap_write
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rax
	addl	%eax, %ebx
	movl	(%r12), %edi
	movq	16(%r14), %rax
	movl	(%rax,%r15,4), %edx
	movl	%ebx, %esi
	callq	_regmap_write
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%r15
	movq	_LM3532_ALS_ZB_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addl	$2, %r13d
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	addl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	cmpq	%rax, %r15
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jl	LBB0_3
LBB0_6:
	movq	_LM3532_ENABLE_ALS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	28(%r14), %eax
	movl	32(%r14), %edx
	movq	_LM3532_ALS_SEL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, 24(%r14)
	movl	(%r12), %edi
	movq	_LM3532_ALS_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_write                   ## TAILCALL
LBB0_5:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LM3532_REG_ZN_0_HI,4,2         ## @LM3532_REG_ZN_0_HI
	.comm	_LM3532_ALS_ZB_MAX,4,2          ## @LM3532_ALS_ZB_MAX
	.comm	_LED_FULL,4,2                   ## @LED_FULL
	.comm	_LM3532_ALS_OFFSET_mV,4,2       ## @LM3532_ALS_OFFSET_mV
	.comm	_LM3532_ENABLE_ALS,4,2          ## @LM3532_ENABLE_ALS
	.comm	_LM3532_ALS_SEL_SHIFT,4,2       ## @LM3532_ALS_SEL_SHIFT
	.comm	_LM3532_ALS_CONFIG,4,2          ## @LM3532_ALS_CONFIG
	.no_dead_strip	_lm3532_als_configure
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lm3532_als_configure
_lm3532_als_configure:                  ; @lm3532_als_configure
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x21, [x0, #8]
Lloh0:
	adrp	x8, _LM3532_ALS_ZB_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LM3532_ALS_ZB_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x23, #0
	ldp	w9, w10, [x21]
	sub	w10, w10, w9
	lsl	w8, w8, #1
	add	w8, w8, #2
	sdiv	w24, w10, w8
	add	w25, w9, w24
Lloh3:
	adrp	x26, _LED_FULL@GOTPAGE
Lloh4:
	ldr	x26, [x26, _LED_FULL@GOTPAGEOFF]
	mov	w27, #1
	mov	w28, #19923
	movk	w28, #4194, lsl #16
Lloh5:
	adrp	x22, _LM3532_REG_ZN_0_HI@GOTPAGE
Lloh6:
	ldr	x22, [x22, _LM3532_REG_ZN_0_HI@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x26]
	mul	w8, w8, w25
	smull	x8, w8, w28
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	lsl	x9, x23, #2
	ldp	x10, x11, [x21, #8]
	str	w8, [x10, x9]
Lloh7:
	adrp	x8, _LM3532_ALS_OFFSET_mV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _LM3532_ALS_OFFSET_mV@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	add	w8, w25, w8
	ldr	w12, [x26]
	mul	w8, w8, w12
	smull	x8, w8, w28
	lsr	x12, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w12
	str	w8, [x11, x9]
	ldr	w8, [x22]
	add	w20, w27, w8
	sub	w1, w20, #1
	ldr	w0, [x19]
	ldr	w2, [x10, x9]
	bl	_regmap_write
	cbnz	w0, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x19]
	ldr	x8, [x21, #16]
	ldr	w2, [x8, x23, lsl #2]
	mov	x1, x20
	bl	_regmap_write
	cbnz	w0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x23, x23, #1
Lloh10:
	adrp	x8, _LM3532_ALS_ZB_MAX@GOTPAGE
Lloh11:
	ldr	x8, [x8, _LM3532_ALS_ZB_MAX@GOTPAGEOFF]
Lloh12:
	ldrsw	x8, [x8]
	add	w27, w27, #2
	add	w25, w25, w24
	cmp	x23, x8
	b.lt	LBB0_2
LBB0_5:
Lloh13:
	adrp	x8, _LM3532_ENABLE_ALS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LM3532_ENABLE_ALS@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldp	w9, w10, [x21, #28]
Lloh16:
	adrp	x11, _LM3532_ALS_SEL_SHIFT@GOTPAGE
Lloh17:
	ldr	x11, [x11, _LM3532_ALS_SEL_SHIFT@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh18:
	ldr	w9, [x11]
	lsl	w9, w10, w9
	orr	w2, w8, w9
	str	w2, [x21, #24]
	ldr	w0, [x19]
Lloh19:
	adrp	x8, _LM3532_ALS_CONFIG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _LM3532_ALS_CONFIG@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_regmap_write
LBB0_6:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_LM3532_REG_ZN_0_HI,4,2         ; @LM3532_REG_ZN_0_HI
	.comm	_LM3532_ALS_ZB_MAX,4,2          ; @LM3532_ALS_ZB_MAX
	.comm	_LED_FULL,4,2                   ; @LED_FULL
	.comm	_LM3532_ALS_OFFSET_mV,4,2       ; @LM3532_ALS_OFFSET_mV
	.comm	_LM3532_ENABLE_ALS,4,2          ; @LM3532_ENABLE_ALS
	.comm	_LM3532_ALS_SEL_SHIFT,4,2       ; @LM3532_ALS_SEL_SHIFT
	.comm	_LM3532_ALS_CONFIG,4,2          ; @LM3532_ALS_CONFIG
	.no_dead_strip	_lm3532_als_configure
.subsections_via_symbols
