	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function isl29018_chip_init
_isl29018_chip_init:                    ## @isl29018_chip_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, %r15
	movl	24(%rdi), %edi
	callq	_regmap_get_device
	movq	%rax, %r14
	movq	(%r15), %rax
	movq	_isl29035@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.1:
	movl	24(%r15), %edi
	movq	_ISL29035_REG_DEVICE_ID@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_2
## %bb.4:
	movq	_ISL29035_DEVICE_ID_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-36(%rbp), %eax
	movq	_ISL29035_DEVICE_ID_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrl	%cl, %eax
	movl	%eax, -36(%rbp)
	movq	_ISL29035_DEVICE_ID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.6:
	movl	24(%r15), %edi
	movl	(%r12), %esi
	movq	_ISL29035_BOUT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_7
LBB0_8:
	movl	24(%r15), %edi
	movq	_ISL29018_REG_TEST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movl	24(%r15), %edi
	movq	_ISL29018_REG_ADD_COMMAND1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movl	16(%r15), %edx
	movl	20(%r15), %esi
	movq	%r15, %rdi
	callq	_isl29018_set_scale
	testl	%eax, %eax
	js	LBB0_13
## %bb.14:
	movq	_isl29018_int_utimes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r15), %rcx
	movq	8(%r15), %rdx
	movq	(%rax,%rcx,8), %rax
	movl	(%rax,%rdx,4), %esi
	movq	%r15, %rdi
	callq	_isl29018_set_integration_time
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_16
	jmp	LBB0_15
LBB0_9:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_3
LBB0_2:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_3
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_11:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
LBB0_3:
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_16
LBB0_13:
	movl	%eax, %ebx
LBB0_15:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_16
LBB0_7:
	movl	%eax, %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_isl29035,8,3                   ## @isl29035
	.comm	_ISL29035_REG_DEVICE_ID,4,2     ## @ISL29035_REG_DEVICE_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading ID register with error %d\n"

	.comm	_ISL29035_DEVICE_ID_MASK,4,2    ## @ISL29035_DEVICE_ID_MASK
	.comm	_ISL29035_DEVICE_ID_SHIFT,4,2   ## @ISL29035_DEVICE_ID_SHIFT
	.comm	_ISL29035_DEVICE_ID,4,2         ## @ISL29035_DEVICE_ID
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ISL29035_BOUT_MASK,4,2         ## @ISL29035_BOUT_MASK
	.comm	_ISL29018_REG_TEST,4,2          ## @ISL29018_REG_TEST
L_.str.1:                               ## @.str.1
	.asciz	"Failed to clear isl29018 TEST reg.(%d)\n"

	.comm	_ISL29018_REG_ADD_COMMAND1,4,2  ## @ISL29018_REG_ADD_COMMAND1
L_.str.2:                               ## @.str.2
	.asciz	"Failed to clear isl29018 CMD1 reg.(%d)\n"

L_.str.3:                               ## @.str.3
	.asciz	"Init of isl29018 fails\n"

	.comm	_isl29018_int_utimes,8,3        ## @isl29018_int_utimes
	.no_dead_strip	_isl29018_chip_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function isl29018_chip_init
_isl29018_chip_init:                    ; @isl29018_chip_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x0
	ldr	w0, [x0, #24]
	bl	_regmap_get_device
	mov	x19, x0
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _isl29035@GOTPAGE
Lloh1:
	ldr	x9, [x9, _isl29035@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	ldr	w0, [x20, #24]
Lloh3:
	adrp	x22, _ISL29035_REG_DEVICE_ID@GOTPAGE
Lloh4:
	ldr	x22, [x22, _ISL29035_REG_DEVICE_ID@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_9
; %bb.2:
Lloh5:
	adrp	x8, _ISL29035_DEVICE_ID_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ISL29035_DEVICE_ID_MASK@GOTPAGEOFF]
	ldr	w9, [sp, #12]
Lloh7:
	ldr	w8, [x8]
	and	w8, w8, w9
Lloh8:
	adrp	x9, _ISL29035_DEVICE_ID_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ISL29035_DEVICE_ID_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	lsr	w8, w8, w9
	str	w8, [sp, #12]
Lloh11:
	adrp	x9, _ISL29035_DEVICE_ID@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ISL29035_DEVICE_ID@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.3:
	ldr	w0, [x20, #24]
	ldr	w1, [x22]
Lloh14:
	adrp	x8, _ISL29035_BOUT_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ISL29035_BOUT_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_17
LBB0_4:
	ldr	w0, [x20, #24]
Lloh17:
	adrp	x8, _ISL29018_REG_TEST@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ISL29018_REG_TEST@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_regmap_write
	tbnz	w0, #31, LBB0_8
; %bb.5:
	ldr	w0, [x20, #24]
Lloh20:
	adrp	x8, _ISL29018_REG_ADD_COMMAND1@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ISL29018_REG_ADD_COMMAND1@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_regmap_write
	tbnz	w0, #31, LBB0_11
; %bb.6:
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	ldp	w2, w1, [x20, #16]
	mov	x0, x20
	bl	_isl29018_set_scale
	tbnz	w0, #31, LBB0_13
; %bb.7:
Lloh23:
	adrp	x8, _isl29018_int_utimes@GOTPAGE
Lloh24:
	ldr	x8, [x8, _isl29018_int_utimes@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	ldp	x9, x10, [x20]
	ldr	x8, [x8, x9, lsl #3]
	ldr	w1, [x8, x10, lsl #2]
	mov	x0, x20
	bl	_isl29018_set_integration_time
	mov	x21, x0
	tbz	w0, #31, LBB0_16
	b	LBB0_14
LBB0_8:
	mov	x21, x0
	str	x21, [sp]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_9:
	mov	x21, x0
	str	x21, [sp]
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_15
LBB0_10:
Lloh30:
	adrp	x8, _ENODEV@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_16
LBB0_11:
	mov	x21, x0
	str	x21, [sp]
Lloh33:
	adrp	x1, l_.str.2@PAGE
Lloh34:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_12:
	mov	x0, x19
	bl	_dev_err
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	b	LBB0_16
LBB0_13:
	mov	x21, x0
LBB0_14:
Lloh35:
	adrp	x1, l_.str.3@PAGE
Lloh36:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_15:
	mov	x0, x19
	bl	_dev_err
LBB0_16:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_17:
	mov	x21, x0
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_isl29035,8,3                   ; @isl29035
	.comm	_ISL29035_REG_DEVICE_ID,4,2     ; @ISL29035_REG_DEVICE_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading ID register with error %d\n"

	.comm	_ISL29035_DEVICE_ID_MASK,4,2    ; @ISL29035_DEVICE_ID_MASK
	.comm	_ISL29035_DEVICE_ID_SHIFT,4,2   ; @ISL29035_DEVICE_ID_SHIFT
	.comm	_ISL29035_DEVICE_ID,4,2         ; @ISL29035_DEVICE_ID
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ISL29035_BOUT_MASK,4,2         ; @ISL29035_BOUT_MASK
	.comm	_ISL29018_REG_TEST,4,2          ; @ISL29018_REG_TEST
l_.str.1:                               ; @.str.1
	.asciz	"Failed to clear isl29018 TEST reg.(%d)\n"

	.comm	_ISL29018_REG_ADD_COMMAND1,4,2  ; @ISL29018_REG_ADD_COMMAND1
l_.str.2:                               ; @.str.2
	.asciz	"Failed to clear isl29018 CMD1 reg.(%d)\n"

l_.str.3:                               ; @.str.3
	.asciz	"Init of isl29018 fails\n"

	.comm	_isl29018_int_utimes,8,3        ; @isl29018_int_utimes
	.no_dead_strip	_isl29018_chip_init
.subsections_via_symbols
