	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cm32181_write_als_it
_cm32181_write_als_it:                  ## @cm32181_write_als_it
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	16(%rdi), %r14
	movq	_als_it_value@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %ecx
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movq	(%r12), %rdx
	cmpl	%ebx, (%rdx)
	jge	LBB0_3
## %bb.4:
	leaq	-1(%rcx), %rdi
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, %rdi
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	1(%rsi), %rax
	cmpl	%ebx, 4(%rdx,%rsi,4)
	movq	%rax, %rsi
	jl	LBB0_6
## %bb.10:
	cmpq	%rcx, %rax
	setb	%dl
	jmp	LBB0_8
LBB0_1:
	decl	%ecx
	jmp	LBB0_9
LBB0_3:
	movb	$1, %dl
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_7:
	incq	%rsi
	cmpq	%rcx, %rsi
	setb	%dl
	movl	%ecx, %eax
LBB0_8:
	decl	%ecx
	testb	%dl, %dl
	cmovnel	%eax, %ecx
LBB0_9:
	movq	_als_it_bits@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %ebx
	movq	_CM32181_CMD_ALS_IT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_CM32181_CMD_ALS_IT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	movq	8(%r15), %rax
	movq	_CM32181_REG_ADDR_CMD@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	andl	(%rax,%rsi,4), %edx
	orl	%ebx, %edx
	movl	%edx, (%rax,%rsi,4)
	movq	%r14, %rdi
	callq	_i2c_smbus_write_word_data
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_als_it_value,8,3               ## @als_it_value
	.comm	_als_it_bits,8,3                ## @als_it_bits
	.comm	_CM32181_CMD_ALS_IT_SHIFT,4,2   ## @CM32181_CMD_ALS_IT_SHIFT
	.comm	_CM32181_CMD_ALS_IT_MASK,4,2    ## @CM32181_CMD_ALS_IT_MASK
	.comm	_CM32181_REG_ADDR_CMD,8,3       ## @CM32181_REG_ADDR_CMD
	.no_dead_strip	_cm32181_write_als_it
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cm32181_write_als_it
_cm32181_write_als_it:                  ; @cm32181_write_als_it
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x1
	mov	x19, x0
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x22, _als_it_value@GOTPAGE
Lloh1:
	ldr	x22, [x22, _als_it_value@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	mov	w8, w0
	cmp	w0, #0
	b.le	LBB0_6
; %bb.1:
	ldr	x9, [x22]
	ldr	w10, [x9]
	cmp	w10, w21
	b.ge	LBB0_7
; %bb.2:
	mov	w10, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x8, x10
	b.eq	LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w11, [x9, x10, lsl #2]
	add	x10, x10, #1
	cmp	w11, w21
	b.lt	LBB0_3
; %bb.5:
	sub	x9, x10, #1
	cmp	x9, x8
	cset	w10, lo
	b	LBB0_9
LBB0_6:
	sub	w8, w8, #1
	b	LBB0_10
LBB0_7:
	mov	w9, #0
	mov	w10, #1
	b	LBB0_9
LBB0_8:
	cmp	x10, x8
	cset	w10, lo
	mov	x9, x8
LBB0_9:
	sub	w8, w8, #1
	cmp	w10, #0
	csel	w8, w9, w8, ne
LBB0_10:
Lloh2:
	adrp	x9, _als_it_bits@GOTPAGE
Lloh3:
	ldr	x9, [x9, _als_it_bits@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	ldr	w8, [x9, w8, sxtw #2]
Lloh5:
	adrp	x9, _CM32181_CMD_ALS_IT_SHIFT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CM32181_CMD_ALS_IT_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	lsl	w21, w8, w9
	mov	x0, x19
	bl	_mutex_lock
Lloh8:
	adrp	x8, _CM32181_CMD_ALS_IT_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CM32181_CMD_ALS_IT_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	x9, [x19, #8]
Lloh11:
	adrp	x10, _CM32181_REG_ADDR_CMD@GOTPAGE
Lloh12:
	ldr	x10, [x10, _CM32181_REG_ADDR_CMD@GOTPAGEOFF]
Lloh13:
	ldr	x1, [x10]
	lsl	x10, x1, #2
	ldr	w11, [x9, x10]
	bic	w8, w11, w8
	orr	w2, w8, w21
	str	w2, [x9, x10]
	mov	x0, x20
	bl	_i2c_smbus_write_word_data
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_als_it_value,8,3               ; @als_it_value
	.comm	_als_it_bits,8,3                ; @als_it_bits
	.comm	_CM32181_CMD_ALS_IT_SHIFT,4,2   ; @CM32181_CMD_ALS_IT_SHIFT
	.comm	_CM32181_CMD_ALS_IT_MASK,4,2    ; @CM32181_CMD_ALS_IT_MASK
	.comm	_CM32181_REG_ADDR_CMD,8,3       ; @CM32181_REG_ADDR_CMD
	.no_dead_strip	_cm32181_write_als_it
.subsections_via_symbols
