	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vcnl4035_init
_vcnl4035_init:                         ## @vcnl4035_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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	24(%rdi), %edi
	movq	_VCNL4035_DEV_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	-36(%rbp), %edx
	movq	_VCNL4035_DEV_ID_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jne	LBB0_3
## %bb.4:
	movq	_VCNL4035_MODE_ALS_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_vcnl4035_set_als_power_state
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	24(%r14), %edi
	movq	_VCNL4035_ALS_CONF@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_VCNL4035_MODE_ALS_WHITE_CHAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_8
LBB0_1:
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_18
LBB0_3:
	movq	16(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_5:
	movl	%eax, %ebx
	jmp	LBB0_18
LBB0_9:
	movl	24(%r14), %edi
	movl	(%r15), %esi
	movq	_VCNL4035_ALS_IT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_VCNL4035_ALS_IT_DEFAULT@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_8
LBB0_11:
	movl	(%r12), %eax
	movl	%eax, (%r14)
	movl	24(%r14), %edi
	movl	(%r15), %esi
	movq	_VCNL4035_ALS_PERS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_VCNL4035_ALS_PERS_DEFAULT@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_8
LBB0_13:
	movl	(%r15), %eax
	movl	%eax, 4(%r14)
	movl	24(%r14), %edi
	movq	_VCNL4035_ALS_THDH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VCNL4035_ALS_THDH_DEFAULT@GOTPCREL(%rip), %r15
	movq	(%r15), %rdx
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_8
LBB0_15:
	movq	(%r15), %rax
	movq	%rax, 32(%r14)
	movl	24(%r14), %edi
	movq	_VCNL4035_ALS_THDL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VCNL4035_ALS_THDL_DEFAULT@GOTPCREL(%rip), %r15
	movq	(%r15), %rdx
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	leaq	L_.str.6(%rip), %rsi
LBB0_8:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_18:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	(%r15), %rax
	movq	%rax, 8(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_VCNL4035_DEV_ID,4,2            ## @VCNL4035_DEV_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read DEV_ID register\n"

	.comm	_VCNL4035_DEV_ID_VAL,4,2        ## @VCNL4035_DEV_ID_VAL
L_.str.1:                               ## @.str.1
	.asciz	"Wrong id, got %x, expected %x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_VCNL4035_MODE_ALS_ENABLE,4,2   ## @VCNL4035_MODE_ALS_ENABLE
	.comm	_VCNL4035_ALS_CONF,4,2          ## @VCNL4035_ALS_CONF
	.comm	_VCNL4035_MODE_ALS_WHITE_CHAN,4,2 ## @VCNL4035_MODE_ALS_WHITE_CHAN
L_.str.2:                               ## @.str.2
	.asciz	"set white channel enable %d\n"

	.comm	_VCNL4035_ALS_IT_MASK,4,2       ## @VCNL4035_ALS_IT_MASK
	.comm	_VCNL4035_ALS_IT_DEFAULT,4,2    ## @VCNL4035_ALS_IT_DEFAULT
L_.str.3:                               ## @.str.3
	.asciz	"set default ALS IT returned %d\n"

	.comm	_VCNL4035_ALS_PERS_MASK,4,2     ## @VCNL4035_ALS_PERS_MASK
	.comm	_VCNL4035_ALS_PERS_DEFAULT,4,2  ## @VCNL4035_ALS_PERS_DEFAULT
L_.str.4:                               ## @.str.4
	.asciz	"set default PERS returned %d\n"

	.comm	_VCNL4035_ALS_THDH,4,2          ## @VCNL4035_ALS_THDH
	.comm	_VCNL4035_ALS_THDH_DEFAULT,8,3  ## @VCNL4035_ALS_THDH_DEFAULT
L_.str.5:                               ## @.str.5
	.asciz	"set default THDH returned %d\n"

	.comm	_VCNL4035_ALS_THDL,4,2          ## @VCNL4035_ALS_THDL
	.comm	_VCNL4035_ALS_THDL_DEFAULT,8,3  ## @VCNL4035_ALS_THDL_DEFAULT
L_.str.6:                               ## @.str.6
	.asciz	"set default THDL returned %d\n"

	.no_dead_strip	_vcnl4035_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vcnl4035_init
_vcnl4035_init:                         ; @vcnl4035_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	w0, [x0, #24]
Lloh0:
	adrp	x8, _VCNL4035_DEV_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VCNL4035_DEV_ID@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #28
	bl	_regmap_read
	tbnz	w0, #31, LBB0_5
; %bb.1:
	ldr	w8, [sp, #28]
Lloh3:
	adrp	x9, _VCNL4035_DEV_ID_VAL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VCNL4035_DEV_ID_VAL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.2:
Lloh6:
	adrp	x8, _VCNL4035_MODE_ALS_ENABLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VCNL4035_MODE_ALS_ENABLE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_vcnl4035_set_als_power_state
	tbnz	w0, #31, LBB0_7
; %bb.3:
	ldr	w0, [x19, #24]
Lloh9:
	adrp	x21, _VCNL4035_ALS_CONF@GOTPAGE
Lloh10:
	ldr	x21, [x21, _VCNL4035_ALS_CONF@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh11:
	adrp	x8, _VCNL4035_MODE_ALS_WHITE_CHAN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VCNL4035_MODE_ALS_WHITE_CHAN@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	w3, #1
	bl	_regmap_update_bits
	cbz	w0, LBB0_8
; %bb.4:
	mov	x20, x0
	ldr	x0, [x19, #16]
	str	x20, [sp]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_17
LBB0_5:
	mov	x20, x0
	ldr	x0, [x19, #16]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_17
LBB0_6:
	ldr	x0, [x19, #16]
	stp	x8, x9, [sp]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh20:
	adrp	x8, _ENODEV@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_17
LBB0_7:
	mov	x20, x0
	b	LBB0_17
LBB0_8:
	ldr	w0, [x19, #24]
	ldr	w1, [x21]
Lloh23:
	adrp	x8, _VCNL4035_ALS_IT_MASK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _VCNL4035_ALS_IT_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
Lloh26:
	adrp	x22, _VCNL4035_ALS_IT_DEFAULT@GOTPAGE
Lloh27:
	ldr	x22, [x22, _VCNL4035_ALS_IT_DEFAULT@GOTPAGEOFF]
	ldr	w3, [x22]
	bl	_regmap_update_bits
	cbz	w0, LBB0_10
; %bb.9:
	mov	x20, x0
	ldr	x0, [x19, #16]
	str	x20, [sp]
Lloh28:
	adrp	x1, l_.str.3@PAGE
Lloh29:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_16
LBB0_10:
	ldr	w8, [x22]
	str	w8, [x19]
	ldr	w0, [x19, #24]
	ldr	w1, [x21]
Lloh30:
	adrp	x8, _VCNL4035_ALS_PERS_MASK@GOTPAGE
Lloh31:
	ldr	x8, [x8, _VCNL4035_ALS_PERS_MASK@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
Lloh33:
	adrp	x21, _VCNL4035_ALS_PERS_DEFAULT@GOTPAGE
Lloh34:
	ldr	x21, [x21, _VCNL4035_ALS_PERS_DEFAULT@GOTPAGEOFF]
	ldr	w3, [x21]
	bl	_regmap_update_bits
	cbz	w0, LBB0_12
; %bb.11:
	mov	x20, x0
	ldr	x0, [x19, #16]
	str	x20, [sp]
Lloh35:
	adrp	x1, l_.str.4@PAGE
Lloh36:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_16
LBB0_12:
	ldr	w8, [x21]
	str	w8, [x19, #4]
	ldr	w0, [x19, #24]
Lloh37:
	adrp	x8, _VCNL4035_ALS_THDH@GOTPAGE
Lloh38:
	ldr	x8, [x8, _VCNL4035_ALS_THDH@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
Lloh40:
	adrp	x21, _VCNL4035_ALS_THDH_DEFAULT@GOTPAGE
Lloh41:
	ldr	x21, [x21, _VCNL4035_ALS_THDH_DEFAULT@GOTPAGEOFF]
	ldr	x2, [x21]
	bl	_regmap_write
	cbz	w0, LBB0_14
; %bb.13:
	mov	x20, x0
	ldr	x0, [x19, #16]
	str	x20, [sp]
Lloh42:
	adrp	x1, l_.str.5@PAGE
Lloh43:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_16
LBB0_14:
	ldr	x8, [x21]
	str	x8, [x19, #32]
	ldr	w0, [x19, #24]
Lloh44:
	adrp	x8, _VCNL4035_ALS_THDL@GOTPAGE
Lloh45:
	ldr	x8, [x8, _VCNL4035_ALS_THDL@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
Lloh47:
	adrp	x21, _VCNL4035_ALS_THDL_DEFAULT@GOTPAGE
Lloh48:
	ldr	x21, [x21, _VCNL4035_ALS_THDL_DEFAULT@GOTPAGEOFF]
	ldr	x2, [x21]
	bl	_regmap_write
	mov	x20, x0
	cbz	w0, LBB0_18
; %bb.15:
	ldr	x0, [x19, #16]
	str	x20, [sp]
Lloh49:
	adrp	x1, l_.str.6@PAGE
Lloh50:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_16:
	bl	_dev_err
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
LBB0_17:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_18:
	ldr	x8, [x21]
	str	x8, [x19, #8]
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_VCNL4035_DEV_ID,4,2            ; @VCNL4035_DEV_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read DEV_ID register\n"

	.comm	_VCNL4035_DEV_ID_VAL,4,2        ; @VCNL4035_DEV_ID_VAL
l_.str.1:                               ; @.str.1
	.asciz	"Wrong id, got %x, expected %x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_VCNL4035_MODE_ALS_ENABLE,4,2   ; @VCNL4035_MODE_ALS_ENABLE
	.comm	_VCNL4035_ALS_CONF,4,2          ; @VCNL4035_ALS_CONF
	.comm	_VCNL4035_MODE_ALS_WHITE_CHAN,4,2 ; @VCNL4035_MODE_ALS_WHITE_CHAN
l_.str.2:                               ; @.str.2
	.asciz	"set white channel enable %d\n"

	.comm	_VCNL4035_ALS_IT_MASK,4,2       ; @VCNL4035_ALS_IT_MASK
	.comm	_VCNL4035_ALS_IT_DEFAULT,4,2    ; @VCNL4035_ALS_IT_DEFAULT
l_.str.3:                               ; @.str.3
	.asciz	"set default ALS IT returned %d\n"

	.comm	_VCNL4035_ALS_PERS_MASK,4,2     ; @VCNL4035_ALS_PERS_MASK
	.comm	_VCNL4035_ALS_PERS_DEFAULT,4,2  ; @VCNL4035_ALS_PERS_DEFAULT
l_.str.4:                               ; @.str.4
	.asciz	"set default PERS returned %d\n"

	.comm	_VCNL4035_ALS_THDH,4,2          ; @VCNL4035_ALS_THDH
	.comm	_VCNL4035_ALS_THDH_DEFAULT,8,3  ; @VCNL4035_ALS_THDH_DEFAULT
l_.str.5:                               ; @.str.5
	.asciz	"set default THDH returned %d\n"

	.comm	_VCNL4035_ALS_THDL,4,2          ; @VCNL4035_ALS_THDL
	.comm	_VCNL4035_ALS_THDL_DEFAULT,8,3  ; @VCNL4035_ALS_THDL_DEFAULT
l_.str.6:                               ; @.str.6
	.asciz	"set default THDL returned %d\n"

	.no_dead_strip	_vcnl4035_init
.subsections_via_symbols
