	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cm32181_reg_init
_cm32181_reg_init:                      ## @cm32181_reg_init
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	16(%rdi), %r14
	movq	_CM32181_REG_ADDR_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_i2c_smbus_read_word_data
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_9
## %bb.1:
	cmpb	$-127, %bl
	jne	LBB0_2
## %bb.3:
	movq	_CM32181_CMD_ALS_ENABLE@GOTPCREL(%rip), %rax
	movq	_CM32181_CMD_ALS_IT_DEFAULT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_CM32181_CMD_ALS_SM_DEFAULT@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	(%r15), %rax
	movq	_CM32181_REG_ADDR_CMD@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%ecx, (%rax,%rdx,4)
	movq	_CM32181_CALIBSCALE_DEFAULT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%r15)
	movq	_CM32181_CONF_REG_NUM@GOTPCREL(%rip), %r12
	xorl	%ebx, %ebx
	cmpl	$0, (%r12)
	jle	LBB0_9
## %bb.4:
	movq	_cm32181_reg@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx), %esi
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_i2c_smbus_write_word_data
	testl	%eax, %eax
	js	LBB0_8
## %bb.5:
	movl	$1, %r13d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r12), %rax
	cmpq	%rax, %r13
	jge	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r15), %rax
	movq	_cm32181_reg@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%r13,4), %esi
	movl	(%rax,%r13,4), %edx
	movq	%r14, %rdi
	callq	_i2c_smbus_write_word_data
	incq	%r13
	testl	%eax, %eax
	jns	LBB0_6
LBB0_8:
	movl	%eax, %ebx
	jmp	LBB0_9
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CM32181_REG_ADDR_ID,4,2        ## @CM32181_REG_ADDR_ID
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_CM32181_CMD_ALS_ENABLE,4,2     ## @CM32181_CMD_ALS_ENABLE
	.comm	_CM32181_CMD_ALS_IT_DEFAULT,4,2 ## @CM32181_CMD_ALS_IT_DEFAULT
	.comm	_CM32181_CMD_ALS_SM_DEFAULT,4,2 ## @CM32181_CMD_ALS_SM_DEFAULT
	.comm	_CM32181_REG_ADDR_CMD,8,3       ## @CM32181_REG_ADDR_CMD
	.comm	_CM32181_CALIBSCALE_DEFAULT,4,2 ## @CM32181_CALIBSCALE_DEFAULT
	.comm	_CM32181_CONF_REG_NUM,4,2       ## @CM32181_CONF_REG_NUM
	.comm	_cm32181_reg,8,3                ## @cm32181_reg
	.no_dead_strip	_cm32181_reg_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cm32181_reg_init
_cm32181_reg_init:                      ; @cm32181_reg_init
	.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
	mov	x19, x0
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x8, _CM32181_REG_ADDR_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CM32181_REG_ADDR_ID@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_i2c_smbus_read_word_data
	tbnz	w0, #31, LBB0_9
; %bb.1:
	and	w8, w0, #0xff
	cmp	w8, #129
	b.ne	LBB0_7
; %bb.2:
Lloh3:
	adrp	x8, _CM32181_CMD_ALS_ENABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CM32181_CMD_ALS_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _CM32181_CMD_ALS_IT_DEFAULT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CM32181_CMD_ALS_IT_DEFAULT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _CM32181_CMD_ALS_SM_DEFAULT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CM32181_CMD_ALS_SM_DEFAULT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w9, w8, w9
Lloh12:
	adrp	x10, _CM32181_REG_ADDR_CMD@GOTPAGE
Lloh13:
	ldr	x10, [x10, _CM32181_REG_ADDR_CMD@GOTPAGEOFF]
	ldr	x8, [x19]
Lloh14:
	ldr	x10, [x10]
	str	w9, [x8, x10, lsl #2]
Lloh15:
	adrp	x9, _CM32181_CALIBSCALE_DEFAULT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CM32181_CALIBSCALE_DEFAULT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	str	w9, [x19, #8]
Lloh18:
	adrp	x21, _CM32181_CONF_REG_NUM@GOTPAGE
Lloh19:
	ldr	x21, [x21, _CM32181_CONF_REG_NUM@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w9, #1
	b.lt	LBB0_8
; %bb.3:
Lloh20:
	adrp	x22, _cm32181_reg@GOTPAGE
Lloh21:
	ldr	x22, [x22, _cm32181_reg@GOTPAGEOFF]
	ldr	x9, [x22]
	ldr	w1, [x9]
	ldr	w2, [x8]
	mov	x0, x20
	bl	_i2c_smbus_write_word_data
	tbnz	w0, #31, LBB0_9
; %bb.4:
	mov	w23, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x8, [x21]
	cmp	x23, x8
	b.ge	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19]
	ldr	x9, [x22]
	lsl	x10, x23, #2
	ldr	w1, [x9, x10]
	ldr	w2, [x8, x10]
	mov	x0, x20
	bl	_i2c_smbus_write_word_data
	add	x23, x23, #1
	tbz	w0, #31, LBB0_5
	b	LBB0_9
LBB0_7:
Lloh22:
	adrp	x8, _ENODEV@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_CM32181_REG_ADDR_ID,4,2        ; @CM32181_REG_ADDR_ID
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_CM32181_CMD_ALS_ENABLE,4,2     ; @CM32181_CMD_ALS_ENABLE
	.comm	_CM32181_CMD_ALS_IT_DEFAULT,4,2 ; @CM32181_CMD_ALS_IT_DEFAULT
	.comm	_CM32181_CMD_ALS_SM_DEFAULT,4,2 ; @CM32181_CMD_ALS_SM_DEFAULT
	.comm	_CM32181_REG_ADDR_CMD,8,3       ; @CM32181_REG_ADDR_CMD
	.comm	_CM32181_CALIBSCALE_DEFAULT,4,2 ; @CM32181_CALIBSCALE_DEFAULT
	.comm	_CM32181_CONF_REG_NUM,4,2       ; @CM32181_CONF_REG_NUM
	.comm	_cm32181_reg,8,3                ; @cm32181_reg
	.no_dead_strip	_cm32181_reg_init
.subsections_via_symbols
