	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cm3232_reg_init
_cm3232_reg_init:                       ## @cm3232_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	movq	_cm3232_als_info_default@GOTPCREL(%rip), %rax
	movq	%rax, 16(%rdi)
	movq	_CM3232_REG_ADDR_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_word_data
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movzbl	%bl, %eax
	movq	16(%r14), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_3
## %bb.4:
	movq	_CM3232_CMD_ALS_DISABLE@GOTPCREL(%rip), %rax
	movq	_CM3232_CMD_ALS_RESET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	%edx, (%r14)
	movq	_CM3232_REG_ADDR_CMD@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	16(%r14), %rax
	movl	4(%rax), %edx
	movl	%edx, (%r14)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_9
	jmp	LBB0_7
LBB0_1:
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_8
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_5:
	movl	%eax, %ebx
LBB0_7:
	movq	8(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
LBB0_8:
	callq	_dev_err
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cm3232_als_info_default,8,2    ## @cm3232_als_info_default
	.comm	_CM3232_REG_ADDR_ID,4,2         ## @CM3232_REG_ADDR_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading addr_id\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_CM3232_CMD_ALS_DISABLE,4,2     ## @CM3232_CMD_ALS_DISABLE
	.comm	_CM3232_CMD_ALS_RESET,4,2       ## @CM3232_CMD_ALS_RESET
	.comm	_CM3232_REG_ADDR_CMD,4,2        ## @CM3232_REG_ADDR_CMD
L_.str.1:                               ## @.str.1
	.asciz	"Error writing reg_cmd\n"

	.no_dead_strip	_cm3232_reg_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cm3232_reg_init
_cm3232_reg_init:                       ; @cm3232_reg_init
	.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	x19, x0
	ldr	x21, [x0, #8]
Lloh0:
	adrp	x8, _cm3232_als_info_default@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cm3232_als_info_default@GOTPAGEOFF]
	str	x8, [x0, #16]
Lloh2:
	adrp	x8, _CM3232_REG_ADDR_ID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CM3232_REG_ADDR_ID@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_i2c_smbus_read_word_data
	mov	x20, x0
	tbnz	w0, #31, LBB0_4
; %bb.1:
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
	cmp	w8, w20, uxtb
	b.ne	LBB0_5
; %bb.2:
Lloh5:
	adrp	x8, _CM3232_CMD_ALS_DISABLE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CM3232_CMD_ALS_DISABLE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _CM3232_CMD_ALS_RESET@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CM3232_CMD_ALS_RESET@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w2, w9, w8
	str	w2, [x19]
Lloh11:
	adrp	x22, _CM3232_REG_ADDR_CMD@GOTPAGE
Lloh12:
	ldr	x22, [x22, _CM3232_REG_ADDR_CMD@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_6
; %bb.3:
	ldr	x8, [x19, #16]
	ldr	w2, [x8, #4]
	str	w2, [x19]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_i2c_smbus_write_byte_data
	mov	x20, x0
	tbz	w0, #31, LBB0_9
	b	LBB0_7
LBB0_4:
	ldr	x0, [x19, #8]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_8
LBB0_5:
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_9
LBB0_6:
	mov	x20, x0
LBB0_7:
	ldr	x0, [x19, #8]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_8:
	bl	_dev_err
LBB0_9:
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_cm3232_als_info_default,8,2    ; @cm3232_als_info_default
	.comm	_CM3232_REG_ADDR_ID,4,2         ; @CM3232_REG_ADDR_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading addr_id\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_CM3232_CMD_ALS_DISABLE,4,2     ; @CM3232_CMD_ALS_DISABLE
	.comm	_CM3232_CMD_ALS_RESET,4,2       ; @CM3232_CMD_ALS_RESET
	.comm	_CM3232_REG_ADDR_CMD,4,2        ; @CM3232_REG_ADDR_CMD
l_.str.1:                               ; @.str.1
	.asciz	"Error writing reg_cmd\n"

	.no_dead_strip	_cm3232_reg_init
.subsections_via_symbols
