	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lv0104cs_get_lux
_lv0104cs_get_lux:                      ## @lv0104cs_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_LV0104CS_REGVAL_MEASURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_lv0104cs_scales@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rdi), %rcx
	movq	8(%rdi), %rdx
	orl	(%rax,%rcx,4), %esi
	movq	_lv0104cs_int_times@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	orl	(%rax,%rdx,4), %esi
	movl	16(%rdi), %edi
	callq	_lv0104cs_write_reg
	testl	%eax, %eax
	jne	LBB0_13
## %bb.1:
	movq	8(%rbx), %rax
	leaq	-132(%rax), %rcx
	cmpq	$3, %rcx
	jae	LBB0_12
## %bb.2:
	leaq	l_switch.table.lv0104cs_get_lux(%rip), %rcx
	movl	-528(%rcx,%rax,4), %edi
	callq	_msleep
	movl	16(%rbx), %edi
	leaq	-28(%rbp), %rsi
	callq	_lv0104cs_read_adc
	testl	%eax, %eax
	jne	LBB0_13
## %bb.3:
	movl	16(%rbx), %edi
	movq	_LV0104CS_REGVAL_SLEEP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_lv0104cs_write_reg
	testl	%eax, %eax
	jne	LBB0_13
## %bb.4:
	movq	(%rbx), %rax
	addq	$-128, %rax
	cmpq	$3, %rax
	ja	LBB0_12
## %bb.5:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_11:
	movl	-28(%rbp), %eax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	movl	%ecx, %edx
	sarl	$3, %edx
	movl	%edx, (%r15)
	andl	$-8, %ecx
	subl	%ecx, %eax
	imull	$125000, %eax, %eax             ## imm = 0x1E848
	jmp	LBB0_10
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	-28(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	movl	%ecx, %edx
	sarl	%edx
	movl	%edx, (%r15)
	andl	$-2, %ecx
	subl	%ecx, %eax
	imull	$500000, %eax, %eax             ## imm = 0x7A120
LBB0_10:
	movl	%eax, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_7:
	movl	-28(%rbp), %eax
	jmp	LBB0_8
LBB0_6:
	movl	-28(%rbp), %eax
	shll	$2, %eax
LBB0_8:
	movl	%eax, (%r15)
	movl	$0, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_13
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
LJTI0_0:
	.long	L0_0_set_11
	.long	L0_0_set_9
	.long	L0_0_set_7
	.long	L0_0_set_6
	.end_data_region
                                        ## -- End function
	.comm	_LV0104CS_REGVAL_MEASURE,4,2    ## @LV0104CS_REGVAL_MEASURE
	.comm	_lv0104cs_scales,8,3            ## @lv0104cs_scales
	.comm	_lv0104cs_int_times,8,3         ## @lv0104cs_int_times
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LV0104CS_REGVAL_SLEEP,4,2      ## @LV0104CS_REGVAL_SLEEP
	.no_dead_strip	_lv0104cs_get_lux
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.lv0104cs_get_lux
l_switch.table.lv0104cs_get_lux:
	.long	250                             ## 0xfa
	.long	50                              ## 0x32
	.long	150                             ## 0x96

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lv0104cs_get_lux
_lv0104cs_get_lux:                      ; @lv0104cs_get_lux
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _LV0104CS_REGVAL_MEASURE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LV0104CS_REGVAL_MEASURE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _lv0104cs_scales@GOTPAGE
Lloh4:
	ldr	x9, [x9, _lv0104cs_scales@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldp	x10, x11, [x0]
	ldr	w9, [x9, x10, lsl #2]
Lloh6:
	adrp	x10, _lv0104cs_int_times@GOTPAGE
Lloh7:
	ldr	x10, [x10, _lv0104cs_int_times@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh8:
	ldr	x9, [x10]
	ldr	w9, [x9, x11, lsl #2]
	orr	w1, w8, w9
	ldr	w0, [x0, #16]
	bl	_lv0104cs_write_reg
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	x8, [x21, #8]
	sub	x8, x8, #132
	cmp	x8, #3
	b.hs	LBB0_7
; %bb.2:
Lloh9:
	adrp	x9, l_switch.table.lv0104cs_get_lux@PAGE
Lloh10:
	add	x9, x9, l_switch.table.lv0104cs_get_lux@PAGEOFF
	ldr	w0, [x9, x8, lsl #2]
	bl	_msleep
	ldr	w0, [x21, #16]
	add	x1, sp, #12
	bl	_lv0104cs_read_adc
	cbnz	w0, LBB0_8
; %bb.3:
	ldr	w0, [x21, #16]
Lloh11:
	adrp	x8, _LV0104CS_REGVAL_SLEEP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LV0104CS_REGVAL_SLEEP@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_lv0104cs_write_reg
	cbnz	w0, LBB0_8
; %bb.4:
	ldr	x8, [x21]
	sub	x8, x8, #128
	cmp	x8, #3
	b.hi	LBB0_7
; %bb.5:
Lloh14:
	adrp	x9, lJTI0_0@PAGE
Lloh15:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_6
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_6:
	mov	w0, #0
	ldr	w8, [sp, #12]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w10, w9, #3
	str	w10, [x20]
	and	w9, w9, #0xfffffff8
	sub	w8, w8, w9
	mov	w9, #59464
	movk	w9, #1, lsl #16
	b	LBB0_10
LBB0_7:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	add	sp, sp, #64
	ret
LBB0_9:
	mov	w0, #0
	ldr	w8, [sp, #12]
	cmp	w8, #0
	cinc	w9, w8, lt
	asr	w10, w9, #1
	str	w10, [x20]
	and	w9, w9, #0xfffffffe
	sub	w8, w8, w9
	mov	w9, #41248
	movk	w9, #7, lsl #16
LBB0_10:
	mul	w8, w8, w9
	str	w8, [x19]
	b	LBB0_8
LBB0_11:
	mov	w0, #0
	ldr	w8, [sp, #12]
	b	LBB0_13
LBB0_12:
	mov	w0, #0
	ldr	w8, [sp, #12]
	lsl	w8, w8, #2
LBB0_13:
	str	w8, [x20]
	str	wzr, [x19]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_6-LBB0_6)>>2
	.byte	(LBB0_9-LBB0_6)>>2
	.byte	(LBB0_11-LBB0_6)>>2
	.byte	(LBB0_12-LBB0_6)>>2
                                        ; -- End function
	.comm	_LV0104CS_REGVAL_MEASURE,4,2    ; @LV0104CS_REGVAL_MEASURE
	.comm	_lv0104cs_scales,8,3            ; @lv0104cs_scales
	.comm	_lv0104cs_int_times,8,3         ; @lv0104cs_int_times
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LV0104CS_REGVAL_SLEEP,4,2      ; @LV0104CS_REGVAL_SLEEP
	.no_dead_strip	_lv0104cs_get_lux
	.p2align	2                               ; @switch.table.lv0104cs_get_lux
l_switch.table.lv0104cs_get_lux:
	.long	250                             ; 0xfa
	.long	50                              ; 0x32
	.long	150                             ; 0x96

.subsections_via_symbols
