	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lm3532_get_als_imp_index
_lm3532_get_als_imp_index:              ## @lm3532_get_als_imp_index
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_als_imp_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movl	4(%rcx), %edx
	xorl	%eax, %eax
	cmpl	%edi, %edx
	jl	LBB0_1
## %bb.2:
	movq	_LM3532_NUM_IMP_VALS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpl	%edi, -4(%rcx,%rax,4)
	jle	LBB0_4
## %bb.3:
	decq	%rax
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
LBB0_4:
	movl	%eax, %r8d
	cmpl	$2, %r8d
	jl	LBB0_12
## %bb.5:
	movl	$1, %eax
	cmpl	%edi, %edx
	je	LBB0_1
## %bb.6:
	movl	$-1, %esi
	movl	$2, %eax
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	-8(%rcx,%rax,4), %r9d
	cmpl	%edi, %r9d
	jle	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	subl	%edi, %edx
	jl	LBB0_13
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	cmpq	%rax, %r8
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%rcx,%rax,4), %edx
	decl	%esi
	incq	%rax
	cmpl	%edi, %edx
	jne	LBB0_7
## %bb.11:
	negl	%esi
	movl	%esi, %eax
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
LBB0_13:
	subl	%r9d, %edi
	xorl	%eax, %eax
	cmpl	%edx, %edi
	setl	%al
	subl	%esi, %eax
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_als_imp_table,8,3              ## @als_imp_table
	.comm	_LM3532_NUM_IMP_VALS,4,2        ## @LM3532_NUM_IMP_VALS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_lm3532_get_als_imp_index
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lm3532_get_als_imp_index
_lm3532_get_als_imp_index:              ; @lm3532_get_als_imp_index
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _als_imp_table@GOTPAGE
Lloh1:
	ldr	x8, [x8, _als_imp_table@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x8]
	ldr	w10, [x9, #4]
	cmp	w10, w0
	b.ge	LBB0_2
; %bb.1:
	mov	w0, #0
	ret
LBB0_2:
Lloh3:
	adrp	x8, _LM3532_NUM_IMP_VALS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LM3532_NUM_IMP_VALS@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x8]
	sub	w8, w11, #1
	ldr	w12, [x9, w8, sxtw #2]
	cmp	w12, w0
	b.le	LBB0_4
; %bb.3:
	mov	x0, x8
	ret
LBB0_4:
	cmp	w11, #2
	b.lt	LBB0_12
; %bb.5:
	cmp	w10, w0
	b.ne	LBB0_7
; %bb.6:
	mov	w0, #1
	ret
LBB0_7:
	mov	x8, #0
	sub	x11, x11, #2
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x9, x8, lsl #2]
	cmp	w12, w0
	ccmp	w10, w0, #0, gt
	b.lt	LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	cmp	x11, x8
	b.eq	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	add	x10, x9, x8, lsl #2
	ldr	w10, [x10, #8]
	add	x8, x8, #1
	cmp	w10, w0
	b.ne	LBB0_8
; %bb.11:
	add	w8, w8, #1
	mov	x0, x8
	ret
LBB0_12:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	ret
LBB0_13:
	sub	w9, w0, w12
	sub	w10, w10, w0
	cmp	w9, w10
	cinc	w8, w8, lt
	add	w0, w8, #1
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_als_imp_table,8,3              ; @als_imp_table
	.comm	_LM3532_NUM_IMP_VALS,4,2        ; @LM3532_NUM_IMP_VALS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_lm3532_get_als_imp_index
.subsections_via_symbols
