	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ak8974_await_drdy
_ak8974_await_drdy:                     ## @ak8974_await_drdy
	.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, %r14
	cmpq	$0, 16(%rdi)
	je	LBB0_4
## %bb.1:
	leaq	12(%r14), %rbx
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	leaq	1(%rax), %rsi
	movq	%rbx, %rdi
	callq	_wait_for_completion_timeout
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.2:
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
LBB0_3:
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_4:
	movq	_AK8974_MEASTIME@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_msleep
	movl	8(%r14), %edi
	movq	_AK8974_STATUS@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_9
## %bb.5:
	movq	_AK8974_STATUS_DRDY@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	xorl	%ebx, %ebx
	testl	%eax, -44(%rbp)
	jne	LBB0_10
## %bb.6:
	movl	(%r15), %edi
	callq	_msleep
	movl	8(%r14), %edi
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_9
## %bb.7:
	movl	(%r13), %eax
	testl	%eax, -44(%rbp)
	jne	LBB0_10
## %bb.8:
	movq	(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_3
LBB0_9:
	movl	%eax, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout waiting for DRDY IRQ\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_AK8974_MEASTIME,4,2            ## @AK8974_MEASTIME
	.comm	_AK8974_STATUS,4,2              ## @AK8974_STATUS
	.comm	_AK8974_STATUS_DRDY,4,2         ## @AK8974_STATUS_DRDY
L_.str.1:                               ## @.str.1
	.asciz	"timeout waiting for DRDY\n"

	.no_dead_strip	_ak8974_await_drdy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ak8974_await_drdy
_ak8974_await_drdy:                     ; @ak8974_await_drdy
	.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	x19, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_4
; %bb.1:
	add	x20, x19, #12
	mov	w0, #1000
	bl	_msecs_to_jiffies
	add	x1, x0, #1
	mov	x0, x20
	bl	_wait_for_completion_timeout
	cbnz	w0, LBB0_6
; %bb.2:
	ldr	x0, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
LBB0_3:
	bl	_dev_err
Lloh2:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_4:
Lloh5:
	adrp	x20, _AK8974_MEASTIME@GOTPAGE
Lloh6:
	ldr	x20, [x20, _AK8974_MEASTIME@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_msleep
	ldr	w0, [x19, #8]
Lloh7:
	adrp	x21, _AK8974_STATUS@GOTPAGE
Lloh8:
	ldr	x21, [x21, _AK8974_STATUS@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_7
; %bb.5:
	ldr	w8, [sp, #12]
Lloh9:
	adrp	x22, _AK8974_STATUS_DRDY@GOTPAGE
Lloh10:
	ldr	x22, [x22, _AK8974_STATUS_DRDY@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_8
LBB0_6:
	mov	w0, #0
LBB0_7:
	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_8:
	ldr	w0, [x20]
	bl	_msleep
	ldr	w0, [x19, #8]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_7
; %bb.9:
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.10:
	ldr	x0, [x19]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout waiting for DRDY IRQ\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_AK8974_MEASTIME,4,2            ; @AK8974_MEASTIME
	.comm	_AK8974_STATUS,4,2              ; @AK8974_STATUS
	.comm	_AK8974_STATUS_DRDY,4,2         ; @AK8974_STATUS_DRDY
l_.str.1:                               ; @.str.1
	.asciz	"timeout waiting for DRDY\n"

	.no_dead_strip	_ak8974_await_drdy
.subsections_via_symbols
