	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rm3100_wait_measurement
_rm3100_wait_measurement:               ## @rm3100_wait_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	cmpq	$0, 8(%rdi)
	je	LBB0_2
## %bb.1:
	leaq	4(%rbx), %rdi
	callq	_reinit_completion
LBB0_2:
	movq	_RM3100_REG_STATUS@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	movl	-44(%rbp), %eax
	movq	_RM3100_STATUS_DRDY@GOTPCREL(%rip), %r13
	notl	%eax
	xorl	%r15d, %r15d
	testl	%eax, (%r13)
	je	LBB0_14
## %bb.4:
	cmpq	$0, 8(%rbx)
	je	LBB0_7
## %bb.5:
	movl	(%rbx), %edi
	addq	$4, %rbx
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	jne	LBB0_14
	jmp	LBB0_13
LBB0_7:
	movl	$-20, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$5000, %esi                     ## imm = 0x1388
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r14, %rdi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	(%r13), %eax
	testl	%eax, -44(%rbp)
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	incl	%ebx
	jne	LBB0_8
	jmp	LBB0_13
LBB0_6:
	movl	%eax, %r15d
	jmp	LBB0_14
LBB0_12:
	testl	%ebx, %ebx
	jne	LBB0_14
LBB0_13:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_14:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RM3100_REG_STATUS,4,2          ## @RM3100_REG_STATUS
	.comm	_RM3100_STATUS_DRDY,4,2         ## @RM3100_STATUS_DRDY
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_rm3100_wait_measurement
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rm3100_wait_measurement
_rm3100_wait_measurement:               ; @rm3100_wait_measurement
	.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
	ldp	x8, x19, [x0, #8]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, x20, #4
	bl	_reinit_completion
LBB0_2:
Lloh0:
	adrp	x21, _RM3100_REG_STATUS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _RM3100_REG_STATUS@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_regmap_read
	tbnz	w0, #31, LBB0_13
; %bb.3:
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x22, _RM3100_STATUS_DRDY@GOTPAGE
Lloh3:
	ldr	x22, [x22, _RM3100_STATUS_DRDY@GOTPAGEOFF]
	ldr	w9, [x22]
	bics	wzr, w9, w8
	b.eq	LBB0_6
; %bb.4:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_7
; %bb.5:
	ldr	w0, [x20], #4
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x20
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_12
LBB0_6:
	mov	w0, #0
	b	LBB0_13
LBB0_7:
	mov	w20, #-20
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1000
	mov	w1, #5000
	bl	_usleep_range
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_regmap_read
	tbnz	w0, #31, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	adds	w20, w20, #1
	b.lo	LBB0_8
	b	LBB0_12
LBB0_11:
	cbnz	w20, LBB0_6
LBB0_12:
Lloh4:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_RM3100_REG_STATUS,4,2          ; @RM3100_REG_STATUS
	.comm	_RM3100_STATUS_DRDY,4,2         ; @RM3100_STATUS_DRDY
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_rm3100_wait_measurement
.subsections_via_symbols
