	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vl6180_init
_vl6180_init:                           ## @vl6180_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	movq	_VL6180_MODEL_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_vl6180_read_byte
	testl	%eax, %eax
	js	LBB0_11
## %bb.1:
	movq	_VL6180_MODEL_ID_VAL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.3:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_vl6180_hold
	testl	%eax, %eax
	js	LBB0_11
## %bb.4:
	movq	_VL6180_OUT_OF_RESET@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_vl6180_read_byte
	testl	%eax, %eax
	js	LBB0_11
## %bb.5:
	cmpl	$1, %eax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_info
LBB0_7:
	movq	_VL6180_INTR_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VL6180_ALS_READY@GOTPCREL(%rip), %rax
	movq	_VL6180_RANGE_READY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_vl6180_write_byte
	testl	%eax, %eax
	js	LBB0_11
## %bb.8:
	movl	$100, (%r14)
	movq	_VL6180_ALS_IT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VL6180_ALS_IT_100@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_vl6180_write_word
	testl	%eax, %eax
	js	LBB0_11
## %bb.9:
	movl	$1000, 4(%r14)                  ## imm = 0x3E8
	movq	_VL6180_ALS_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VL6180_ALS_GAIN_1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_vl6180_write_byte
	testl	%eax, %eax
	js	LBB0_11
## %bb.10:
	movl	(%r15), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_vl6180_write_byte
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	movq	%r14, %rdi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vl6180_hold                    ## TAILCALL
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VL6180_MODEL_ID,4,2            ## @VL6180_MODEL_ID
	.comm	_VL6180_MODEL_ID_VAL,4,2        ## @VL6180_MODEL_ID_VAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid model ID %02x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_VL6180_OUT_OF_RESET,4,2        ## @VL6180_OUT_OF_RESET
L_.str.1:                               ## @.str.1
	.asciz	"device is not fresh out of reset\n"

	.comm	_VL6180_INTR_CONFIG,4,2         ## @VL6180_INTR_CONFIG
	.comm	_VL6180_ALS_READY,4,2           ## @VL6180_ALS_READY
	.comm	_VL6180_RANGE_READY,4,2         ## @VL6180_RANGE_READY
	.comm	_VL6180_ALS_IT,4,2              ## @VL6180_ALS_IT
	.comm	_VL6180_ALS_IT_100,4,2          ## @VL6180_ALS_IT_100
	.comm	_VL6180_ALS_GAIN,4,2            ## @VL6180_ALS_GAIN
	.comm	_VL6180_ALS_GAIN_1,4,2          ## @VL6180_ALS_GAIN_1
	.no_dead_strip	_vl6180_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vl6180_init
_vl6180_init:                           ; @vl6180_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	x20, [x0, #8]
Lloh0:
	adrp	x8, _VL6180_MODEL_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VL6180_MODEL_ID@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_vl6180_read_byte
	mov	x2, x0
	tbnz	w0, #31, LBB0_13
; %bb.1:
Lloh3:
	adrp	x8, _VL6180_MODEL_ID_VAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VL6180_MODEL_ID_VAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_11
; %bb.2:
	mov	x0, x19
	mov	w1, #1
	bl	_vl6180_hold
	tbnz	w0, #31, LBB0_12
; %bb.3:
Lloh6:
	adrp	x21, _VL6180_OUT_OF_RESET@GOTPAGE
Lloh7:
	ldr	x21, [x21, _VL6180_OUT_OF_RESET@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_vl6180_read_byte
	mov	x2, x0
	tbnz	w0, #31, LBB0_13
; %bb.4:
	cmp	w2, #1
	b.eq	LBB0_6
; %bb.5:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_info
LBB0_6:
Lloh10:
	adrp	x8, _VL6180_INTR_CONFIG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VL6180_INTR_CONFIG@GOTPAGEOFF]
Lloh12:
	adrp	x9, _VL6180_ALS_READY@GOTPAGE
Lloh13:
	ldr	x9, [x9, _VL6180_ALS_READY@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	ldr	w8, [x9]
Lloh16:
	adrp	x9, _VL6180_RANGE_READY@GOTPAGE
Lloh17:
	ldr	x9, [x9, _VL6180_RANGE_READY@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x20
	bl	_vl6180_write_byte
	tbnz	w0, #31, LBB0_12
; %bb.7:
	mov	w8, #100
	str	w8, [x19]
Lloh19:
	adrp	x8, _VL6180_ALS_IT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _VL6180_ALS_IT@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
Lloh22:
	adrp	x8, _VL6180_ALS_IT_100@GOTPAGE
Lloh23:
	ldr	x8, [x8, _VL6180_ALS_IT_100@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_vl6180_write_word
	tbnz	w0, #31, LBB0_12
; %bb.8:
	mov	w8, #1000
	str	w8, [x19, #4]
Lloh25:
	adrp	x8, _VL6180_ALS_GAIN@GOTPAGE
Lloh26:
	ldr	x8, [x8, _VL6180_ALS_GAIN@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x8, _VL6180_ALS_GAIN_1@GOTPAGE
Lloh29:
	ldr	x8, [x8, _VL6180_ALS_GAIN_1@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_vl6180_write_byte
	tbnz	w0, #31, LBB0_12
; %bb.9:
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #0
	bl	_vl6180_write_byte
	tbnz	w0, #31, LBB0_12
; %bb.10:
	mov	x0, x19
	mov	w1, #0
	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
	b	_vl6180_hold
LBB0_11:
Lloh31:
	adrp	x1, l_.str@PAGE
Lloh32:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh33:
	adrp	x8, _ENODEV@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w2, w8
	b	LBB0_13
LBB0_12:
	mov	x2, x0
LBB0_13:
	mov	x0, x2
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh14
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_VL6180_MODEL_ID,4,2            ; @VL6180_MODEL_ID
	.comm	_VL6180_MODEL_ID_VAL,4,2        ; @VL6180_MODEL_ID_VAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid model ID %02x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_VL6180_OUT_OF_RESET,4,2        ; @VL6180_OUT_OF_RESET
l_.str.1:                               ; @.str.1
	.asciz	"device is not fresh out of reset\n"

	.comm	_VL6180_INTR_CONFIG,4,2         ; @VL6180_INTR_CONFIG
	.comm	_VL6180_ALS_READY,4,2           ; @VL6180_ALS_READY
	.comm	_VL6180_RANGE_READY,4,2         ; @VL6180_RANGE_READY
	.comm	_VL6180_ALS_IT,4,2              ; @VL6180_ALS_IT
	.comm	_VL6180_ALS_IT_100,4,2          ; @VL6180_ALS_IT_100
	.comm	_VL6180_ALS_GAIN,4,2            ; @VL6180_ALS_GAIN
	.comm	_VL6180_ALS_GAIN_1,4,2          ; @VL6180_ALS_GAIN_1
	.no_dead_strip	_vl6180_init
.subsections_via_symbols
