	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vl53l0x_read_proximity
_vl53l0x_read_proximity:                ## @vl53l0x_read_proximity
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r12
	movq	_VL_REG_SYSRANGE_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_12
## %bb.1:
	movl	$-20, %ebx
	movq	_VL_REG_RESULT_RANGE_STATUS@GOTPCREL(%rip), %r15
	movq	_VL_REG_RESULT_RANGE_STATUS_COMPLETE@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_i2c_smbus_read_byte_data
	testl	%eax, %eax
	js	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%eax, (%r13)
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$5000, %esi                     ## imm = 0x1388
	callq	_usleep_range
	incl	%ebx
	jne	LBB0_2
	jmp	LBB0_6
LBB0_5:
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.8:
	movl	(%r15), %esi
	leaq	-96(%rbp), %rcx
	movq	%r12, %rdi
	movl	$12, %edx
	callq	_i2c_smbus_read_i2c_block_data
	testl	%eax, %eax
	js	LBB0_12
## %bb.9:
	cmpl	$12, %eax
	jne	LBB0_10
## %bb.11:
	movl	-56(%rbp), %eax
	shll	$8, %eax
	addl	-52(%rbp), %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_6:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_14
## %bb.13:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_EREMOTEIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_VL_REG_SYSRANGE_START,4,2      ## @VL_REG_SYSRANGE_START
	.comm	_VL_REG_RESULT_RANGE_STATUS,4,2 ## @VL_REG_RESULT_RANGE_STATUS
	.comm	_VL_REG_RESULT_RANGE_STATUS_COMPLETE,4,2 ## @VL_REG_RESULT_RANGE_STATUS_COMPLETE
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.no_dead_strip	_vl53l0x_read_proximity
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vl53l0x_read_proximity
_vl53l0x_read_proximity:                ; @vl53l0x_read_proximity
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x2
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	ldr	x20, [x0]
Lloh3:
	adrp	x8, _VL_REG_SYSRANGE_START@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VL_REG_SYSRANGE_START@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_11
; %bb.1:
	mov	w22, #-20
Lloh6:
	adrp	x21, _VL_REG_RESULT_RANGE_STATUS@GOTPAGE
Lloh7:
	ldr	x21, [x21, _VL_REG_RESULT_RANGE_STATUS@GOTPAGEOFF]
Lloh8:
	adrp	x23, _VL_REG_RESULT_RANGE_STATUS_COMPLETE@GOTPAGE
Lloh9:
	ldr	x23, [x23, _VL_REG_RESULT_RANGE_STATUS_COMPLETE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x20
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_11
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x23]
	tst	w8, w0
	b.ne	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1000
	mov	w1, #5000
	bl	_usleep_range
	adds	w22, w22, #1
	b.lo	LBB0_2
	b	LBB0_9
LBB0_5:
	cbz	w22, LBB0_9
; %bb.6:
	ldr	w1, [x21]
	add	x3, sp, #8
	mov	x0, x20
	mov	w2, #12
	bl	_i2c_smbus_read_i2c_block_data
	tbnz	w0, #31, LBB0_11
; %bb.7:
	cmp	w0, #12
	b.ne	LBB0_13
; %bb.8:
	mov	w0, #0
	ldp	w8, w9, [sp, #48]
	add	w8, w9, w8, lsl #8
	str	w8, [x19]
	b	LBB0_11
LBB0_9:
Lloh10:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldr	x8, [sp, #56]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.12:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_13:
Lloh15:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
	b	LBB0_10
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_VL_REG_SYSRANGE_START,4,2      ; @VL_REG_SYSRANGE_START
	.comm	_VL_REG_RESULT_RANGE_STATUS,4,2 ; @VL_REG_RESULT_RANGE_STATUS
	.comm	_VL_REG_RESULT_RANGE_STATUS_COMPLETE,4,2 ; @VL_REG_RESULT_RANGE_STATUS_COMPLETE
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.no_dead_strip	_vl53l0x_read_proximity
.subsections_via_symbols
