	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function si1133_get_lux
_si1133_get_lux:                        ## @si1133_get_lux
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_SI1133_LUX_BUFFER_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movq	_SI1133_LUX_ADC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_si1133_set_chlist
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	xorl	%edi, %edi
	callq	_SI1133_REG_HOSTOUT
	movl	(%r15), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	movq	%r13, %rcx
	callq	_si1133_bulk_read
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	(%r13), %eax
	movl	4(%r13), %r15d
	shll	$16, %eax
	shll	$8, %r15d
	orl	%eax, %r15d
	orl	8(%r13), %r15d
	movl	24(%r13), %eax
	shll	$16, %eax
	movl	28(%r13), %r12d
	shll	$8, %r12d
	orl	%eax, %r12d
	orl	32(%r13), %r12d
	movq	_SI1133_ADC_THRESHOLD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_lux_coeff@GOTPCREL(%rip), %rax
	leaq	8(%rax), %r14
	movq	_SI1133_INPUT_FRACTION_HIGH@GOTPCREL(%rip), %rcx
	cmpl	%edx, %r15d
	jg	LBB0_5
## %bb.3:
	cmpl	%edx, %r12d
	jg	LBB0_5
## %bb.4:
	movl	12(%r13), %ecx
	movl	16(%r13), %r15d
	shll	$16, %ecx
	shll	$8, %r15d
	orl	%ecx, %r15d
	orl	20(%r13), %r15d
	movq	_SI1133_INPUT_FRACTION_LOW@GOTPCREL(%rip), %rcx
	movq	%rax, %r14
LBB0_5:
	movl	(%rcx), %ebx
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	movq	(%r14), %r8
	movl	%r15d, %edi
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_si1133_calc_polynomial
	movq	_SI1133_LUX_OUTPUT_FRACTION@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%eax, %eax
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_8
## %bb.7:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SI1133_LUX_BUFFER_SIZE,4,2     ## @SI1133_LUX_BUFFER_SIZE
	.comm	_SI1133_LUX_ADC_MASK,4,2        ## @SI1133_LUX_ADC_MASK
	.comm	_SI1133_ADC_THRESHOLD,4,2       ## @SI1133_ADC_THRESHOLD
	.comm	_SI1133_INPUT_FRACTION_HIGH,4,2 ## @SI1133_INPUT_FRACTION_HIGH
	.comm	_lux_coeff,16,3                 ## @lux_coeff
	.comm	_SI1133_INPUT_FRACTION_LOW,4,2  ## @SI1133_INPUT_FRACTION_LOW
	.comm	_SI1133_LUX_OUTPUT_FRACTION,4,2 ## @SI1133_LUX_OUTPUT_FRACTION
	.no_dead_strip	_si1133_get_lux
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function si1133_get_lux
_si1133_get_lux:                        ; @si1133_get_lux
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #16
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x22, _SI1133_LUX_BUFFER_SIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _SI1133_LUX_BUFFER_SIZE@GOTPAGEOFF]
	ldr	w8, [x22]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
Lloh7:
	adrp	x8, _SI1133_LUX_ADC_MASK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SI1133_LUX_ADC_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_si1133_set_chlist
	cbnz	w0, LBB0_6
; %bb.1:
	bl	_SI1133_REG_HOSTOUT
	mov	x1, x0
	ldr	w2, [x22]
	mov	x0, x21
	mov	x3, x20
	bl	_si1133_bulk_read
	cbnz	w0, LBB0_6
; %bb.2:
	ldp	w8, w9, [x20]
	lsl	w9, w9, #8
	orr	w8, w9, w8, lsl #16
	ldr	w9, [x20, #8]
	orr	w22, w8, w9
	ldp	w8, w9, [x20, #24]
	lsl	w9, w9, #8
	orr	w8, w9, w8, lsl #16
	ldr	w9, [x20, #32]
	orr	w21, w8, w9
Lloh10:
	adrp	x8, _SI1133_ADC_THRESHOLD@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SI1133_ADC_THRESHOLD@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w22, w8
	ccmp	w21, w8, #0, le
	b.le	LBB0_4
; %bb.3:
Lloh13:
	adrp	x8, _lux_coeff@GOTPAGE
Lloh14:
	ldr	x8, [x8, _lux_coeff@GOTPAGEOFF]
	add	x23, x8, #8
Lloh15:
	adrp	x8, _SI1133_INPUT_FRACTION_HIGH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SI1133_INPUT_FRACTION_HIGH@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
	ldp	w8, w9, [x20, #12]
	lsl	w9, w9, #8
	orr	w8, w9, w8, lsl #16
	ldr	w9, [x20, #20]
	orr	w22, w8, w9
Lloh17:
	adrp	x23, _lux_coeff@GOTPAGE
Lloh18:
	ldr	x23, [x23, _lux_coeff@GOTPAGEOFF]
Lloh19:
	adrp	x8, _SI1133_INPUT_FRACTION_LOW@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SI1133_INPUT_FRACTION_LOW@GOTPAGEOFF]
LBB0_5:
	ldr	w20, [x8]
	ldr	x0, [x23]
	bl	_ARRAY_SIZE
	mov	x3, x0
	ldr	x4, [x23]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_si1133_calc_polynomial
	mov	x8, x0
	mov	w0, #0
Lloh21:
	adrp	x9, _SI1133_LUX_OUTPUT_FRACTION@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SI1133_LUX_OUTPUT_FRACTION@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	asr	w8, w8, w9
	str	w8, [x19]
LBB0_6:
	ldur	x8, [x29, #-56]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_SI1133_LUX_BUFFER_SIZE,4,2     ; @SI1133_LUX_BUFFER_SIZE
	.comm	_SI1133_LUX_ADC_MASK,4,2        ; @SI1133_LUX_ADC_MASK
	.comm	_SI1133_ADC_THRESHOLD,4,2       ; @SI1133_ADC_THRESHOLD
	.comm	_SI1133_INPUT_FRACTION_HIGH,4,2 ; @SI1133_INPUT_FRACTION_HIGH
	.comm	_lux_coeff,16,3                 ; @lux_coeff
	.comm	_SI1133_INPUT_FRACTION_LOW,4,2  ; @SI1133_INPUT_FRACTION_LOW
	.comm	_SI1133_LUX_OUTPUT_FRACTION,4,2 ; @SI1133_LUX_OUTPUT_FRACTION
	.no_dead_strip	_si1133_get_lux
.subsections_via_symbols
