	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function madera_wait_for_boot
_madera_wait_for_boot:                  ## @madera_wait_for_boot
	.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, %r15
	movl	$0, -44(%rbp)
	xorl	%eax, %eax
	callq	_ktime_get
	movq	_MADERA_BOOT_POLL_TIMEOUT_USEC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_ktime_add_us
	movl	%eax, %ebx
	movl	4(%r15), %edi
	movq	_MADERA_IRQ1_RAW_STATUS_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	movl	-44(%rbp), %eax
	movq	_MADERA_BOOT_DONE_STS1@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	testl	%eax, %ecx
	jne	LBB0_5
## %bb.1:
	movq	_MADERA_BOOT_POLL_INTERVAL_USEC@GOTPCREL(%rip), %r13
	leaq	-44(%rbp), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_ktime_after
	testl	%eax, %eax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13), %esi
	movl	%esi, %edi
	shrl	$31, %edi
	addl	%esi, %edi
	sarl	%edi
	callq	_usleep_range
	movl	4(%r15), %edi
	movq	_MADERA_IRQ1_RAW_STATUS_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdx
	callq	_regmap_read
	movl	-44(%rbp), %eax
	movl	(%r14), %ecx
	testl	%eax, %ecx
	je	LBB0_2
	jmp	LBB0_5
LBB0_3:
	movl	-44(%rbp), %eax
	movl	(%r14), %ecx
LBB0_5:
	testl	%eax, %ecx
	movl	$0, %ebx
	jne	LBB0_7
## %bb.6:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	4(%r15), %edi
	movq	_MADERA_IRQ1_STATUS_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MADERA_BOOT_DONE_EINT1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_write
	movl	(%r15), %edi
	callq	_pm_runtime_mark_last_busy
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MADERA_BOOT_POLL_TIMEOUT_USEC,4,2 ## @MADERA_BOOT_POLL_TIMEOUT_USEC
	.comm	_MADERA_IRQ1_RAW_STATUS_1,4,2   ## @MADERA_IRQ1_RAW_STATUS_1
	.comm	_MADERA_BOOT_DONE_STS1,4,2      ## @MADERA_BOOT_DONE_STS1
	.comm	_MADERA_BOOT_POLL_INTERVAL_USEC,4,2 ## @MADERA_BOOT_POLL_INTERVAL_USEC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Polling BOOT_DONE_STS timed out\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_MADERA_IRQ1_STATUS_1,4,2       ## @MADERA_IRQ1_STATUS_1
	.comm	_MADERA_BOOT_DONE_EINT1,4,2     ## @MADERA_BOOT_DONE_EINT1
	.no_dead_strip	_madera_wait_for_boot
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function madera_wait_for_boot
_madera_wait_for_boot:                  ; @madera_wait_for_boot
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	str	wzr, [sp, #12]
	bl	_ktime_get
Lloh0:
	adrp	x8, _MADERA_BOOT_POLL_TIMEOUT_USEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MADERA_BOOT_POLL_TIMEOUT_USEC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_ktime_add_us
	mov	x20, x0
	ldr	w0, [x19, #4]
Lloh3:
	adrp	x21, _MADERA_IRQ1_RAW_STATUS_1@GOTPAGE
Lloh4:
	ldr	x21, [x21, _MADERA_IRQ1_RAW_STATUS_1@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_regmap_read
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x22, _MADERA_BOOT_DONE_STS1@GOTPAGE
Lloh6:
	ldr	x22, [x22, _MADERA_BOOT_DONE_STS1@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_4
; %bb.1:
Lloh7:
	adrp	x23, _MADERA_BOOT_POLL_INTERVAL_USEC@GOTPAGE
Lloh8:
	ldr	x23, [x23, _MADERA_BOOT_POLL_INTERVAL_USEC@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_ktime_get
	mov	x1, x20
	bl	_ktime_after
	cbnz	w0, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x23]
	cmp	w1, #0
	cinc	w8, w1, lt
	asr	w0, w8, #1
	bl	_usleep_range
	ldr	w0, [x19, #4]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_regmap_read
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_2
LBB0_4:
	tst	w9, w8
	b.eq	LBB0_7
LBB0_5:
	mov	w20, #0
	b	LBB0_8
LBB0_6:
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_5
LBB0_7:
	ldr	w0, [x19]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh11:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_8:
	ldr	w0, [x19, #4]
Lloh14:
	adrp	x8, _MADERA_IRQ1_STATUS_1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MADERA_IRQ1_STATUS_1@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _MADERA_BOOT_DONE_EINT1@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MADERA_BOOT_DONE_EINT1@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	bl	_regmap_write
	ldr	w0, [x19]
	bl	_pm_runtime_mark_last_busy
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MADERA_BOOT_POLL_TIMEOUT_USEC,4,2 ; @MADERA_BOOT_POLL_TIMEOUT_USEC
	.comm	_MADERA_IRQ1_RAW_STATUS_1,4,2   ; @MADERA_IRQ1_RAW_STATUS_1
	.comm	_MADERA_BOOT_DONE_STS1,4,2      ; @MADERA_BOOT_DONE_STS1
	.comm	_MADERA_BOOT_POLL_INTERVAL_USEC,4,2 ; @MADERA_BOOT_POLL_INTERVAL_USEC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Polling BOOT_DONE_STS timed out\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_MADERA_IRQ1_STATUS_1,4,2       ; @MADERA_IRQ1_STATUS_1
	.comm	_MADERA_BOOT_DONE_EINT1,4,2     ; @MADERA_BOOT_DONE_EINT1
	.no_dead_strip	_madera_wait_for_boot
.subsections_via_symbols
