	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apds990x_lux_to_threshold
_apds990x_lux_to_threshold:             ## @apds990x_lux_to_threshold
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movl	%esi, %eax
	movq	_APDS_RANGE@GOTPCREL(%rip), %rcx
	cmpl	%esi, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	_APDS_CALIB_SCALER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leal	3(%rdx), %ecx
	testl	%edx, %edx
	cmovnsl	%edx, %ecx
	sarl	$2, %ecx
	imull	%eax, %ecx
	movl	(%rdi), %eax
	leal	3(%rax), %esi
	testl	%eax, %eax
	cmovnsl	%eax, %esi
	sarl	$2, %esi
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movl	%eax, %r8d
	movq	_again@GOTPCREL(%rip), %rax
	movq	(%rax), %r10
	movq	8(%rdi), %rax
	movl	(%r10,%rax,8), %r11d
	movq	_APDS_PARAM_SCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	72(%rdi), %eax
	imull	%r11d, %eax
	imull	%r9d, %eax
	shll	$6, %eax
	movl	64(%rdi), %ecx
	imull	60(%rdi), %ecx
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	imull	%r8d, %ecx
	leal	63(%rcx), %eax
	testl	%ecx, %ecx
	cmovsl	%eax, %ecx
	movl	16(%rdi), %ebx
	imull	%ebx, %r11d
	movq	24(%rdi), %r8
	movl	%r11d, %eax
	cltd
	idivl	(%r10,%r8,8)
	sarl	$6, %ecx
	movl	32(%rdi), %edx
	imull	40(%rdi), %ebx
	imull	%r9d, %edx
	xorl	%esi, %esi
	cmpl	%ebx, %edx
	setl	%sil
	imull	44(%rdi,%rsi,8), %ecx
	imull	48(%rdi,%rsi,8), %eax
	addl	%ecx, %eax
	cltd
	idivl	%r9d
	movl	%eax, %ecx
	movl	36(%rdi), %edx
	leal	-1(%rdx), %eax
	cmpl	%edx, %ecx
	cmovll	%ecx, %eax
	jmp	LBB0_4
LBB0_1:
	xorl	%eax, %eax
LBB0_4:
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_APDS_RANGE,4,2                 ## @APDS_RANGE
	.comm	_APDS_CALIB_SCALER,4,2          ## @APDS_CALIB_SCALER
	.comm	_again,8,3                      ## @again
	.comm	_APDS_PARAM_SCALE,4,2           ## @APDS_PARAM_SCALE
	.no_dead_strip	_apds990x_lux_to_threshold
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apds990x_lux_to_threshold
_apds990x_lux_to_threshold:             ; @apds990x_lux_to_threshold
	.cfi_startproc
; %bb.0:
	cbz	w1, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _APDS_RANGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _APDS_RANGE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.eq	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _APDS_CALIB_SCALER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _APDS_CALIB_SCALER@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #2
	mul	w8, w8, w1
	ldr	w9, [x0]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #2
	sdiv	w8, w8, w9
Lloh6:
	adrp	x9, _again@GOTPAGE
Lloh7:
	ldr	x9, [x9, _again@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	x10, [x0, #8]
	ldr	x10, [x9, x10, lsl #3]
Lloh9:
	adrp	x11, _APDS_PARAM_SCALE@GOTPAGE
Lloh10:
	ldr	x11, [x11, _APDS_PARAM_SCALE@GOTPAGEOFF]
	ldr	w12, [x0, #72]
Lloh11:
	ldr	w11, [x11]
	mul	w12, w12, w10
	mul	w12, w12, w11
	lsl	w12, w12, #6
	ldp	w13, w14, [x0, #60]
	mul	w13, w14, w13
	sdiv	w12, w12, w13
	mul	w8, w12, w8
	add	w12, w8, #63
	cmp	w8, #0
	csel	w8, w12, w8, lt
	asr	w8, w8, #6
	ldr	w12, [x0, #16]
	ldr	x13, [x0, #24]
	ldr	x9, [x9, x13, lsl #3]
	mul	w10, w12, w10
	sdiv	w9, w10, w9
	ldp	w10, w13, [x0, #32]
	mul	w10, w10, w11
	ldr	w14, [x0, #40]
	mul	w12, w14, w12
	cmp	w10, w12
	mov	w10, #48
	mov	w12, #56
	csel	x10, x12, x10, lt
	mov	w12, #44
	mov	w14, #52
	csel	x12, x14, x12, lt
	ldr	w12, [x0, x12]
	ldr	w10, [x0, x10]
	mul	w8, w12, w8
	madd	w8, w10, w9, w8
	sdiv	w8, w8, w11
	sub	w9, w13, #1
	cmp	w8, w13
	csel	w1, w8, w9, lt
LBB0_3:
	mov	x0, x1
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_APDS_RANGE,4,2                 ; @APDS_RANGE
	.comm	_APDS_CALIB_SCALER,4,2          ; @APDS_CALIB_SCALER
	.comm	_again,8,3                      ; @again
	.comm	_APDS_PARAM_SCALE,4,2           ; @APDS_PARAM_SCALE
	.no_dead_strip	_apds990x_lux_to_threshold
.subsections_via_symbols
