	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lidar_get_measurement
_lidar_get_measurement:                 ## @lidar_get_measurement
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	(%rdi), %r14
	movq	%r14, %rdi
	callq	_pm_runtime_get_sync
	movq	_LIDAR_REG_CONTROL_ACQUIRE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_lidar_write_control
	testl	%eax, %eax
	js	LBB0_12
## %bb.1:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	$-10, %r13d
	movq	_LIDAR_REG_STATUS@GOTPCREL(%rip), %r14
	movq	_LIDAR_REG_STATUS_INVALID@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_lidar_read_byte
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%ebx, (%r15)
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_LIDAR_REG_STATUS_READY@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%r13d
	jne	LBB0_2
## %bb.8:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_12:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_11
LBB0_4:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_6:
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_lidar_read_measurement
	movl	%eax, %ebx
LBB0_10:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_pm_runtime_mark_last_busy
	movq	%r14, %rdi
	callq	_pm_runtime_put_autosuspend
LBB0_11:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LIDAR_REG_CONTROL_ACQUIRE,4,2  ## @LIDAR_REG_CONTROL_ACQUIRE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot send start measurement command"

	.comm	_LIDAR_REG_STATUS,4,2           ## @LIDAR_REG_STATUS
	.comm	_LIDAR_REG_STATUS_INVALID,4,2   ## @LIDAR_REG_STATUS_INVALID
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LIDAR_REG_STATUS_READY,4,2     ## @LIDAR_REG_STATUS_READY
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_lidar_get_measurement
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lidar_get_measurement
_lidar_get_measurement:                 ; @lidar_get_measurement
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x0]
	mov	x0, x19
	bl	_pm_runtime_get_sync
Lloh0:
	adrp	x8, _LIDAR_REG_CONTROL_ACQUIRE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LIDAR_REG_CONTROL_ACQUIRE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_lidar_write_control
	tbnz	w0, #31, LBB0_7
; %bb.1:
	mov	w23, #-10
Lloh3:
	adrp	x24, _LIDAR_REG_STATUS@GOTPAGE
Lloh4:
	ldr	x24, [x24, _LIDAR_REG_STATUS@GOTPAGEOFF]
Lloh5:
	adrp	x25, _LIDAR_REG_STATUS_INVALID@GOTPAGE
Lloh6:
	ldr	x25, [x25, _LIDAR_REG_STATUS_INVALID@GOTPAGEOFF]
Lloh7:
	adrp	x26, _LIDAR_REG_STATUS_READY@GOTPAGE
Lloh8:
	ldr	x26, [x26, _LIDAR_REG_STATUS_READY@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	ldr	w1, [x24]
	mov	x0, x21
	bl	_lidar_read_byte
	mov	x22, x0
	tbnz	w0, #31, LBB0_11
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x25]
	tst	w8, w22
	b.ne	LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x26]
	tst	w8, w22
	b.eq	LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	adds	w23, w23, #1
	b.lo	LBB0_2
; %bb.6:
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
	mov	x22, x0
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_12
LBB0_8:
	str	xzr, [x20]
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_11
LBB0_10:
	mov	x0, x21
	mov	x1, x20
	bl	_lidar_read_measurement
	mov	x22, x0
LBB0_11:
	mov	x0, x19
	bl	_pm_runtime_mark_last_busy
	mov	x0, x19
	bl	_pm_runtime_put_autosuspend
LBB0_12:
	mov	x0, x22
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_LIDAR_REG_CONTROL_ACQUIRE,4,2  ; @LIDAR_REG_CONTROL_ACQUIRE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot send start measurement command"

	.comm	_LIDAR_REG_STATUS,4,2           ; @LIDAR_REG_STATUS
	.comm	_LIDAR_REG_STATUS_INVALID,4,2   ; @LIDAR_REG_STATUS_INVALID
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LIDAR_REG_STATUS_READY,4,2     ; @LIDAR_REG_STATUS_READY
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_lidar_get_measurement
.subsections_via_symbols
