	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pg_wait
_pg_wait:                               ## @pg_wait
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %ebx
	movl	$0, (%rdi)
	xorl	%r15d, %r15d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	$1, %edi
	callq	_pg_sleep
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	incl	%r15d
	movq	%r13, %rdi
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rdi, %r13
	callq	_status_reg
	movl	%eax, %r12d
	testl	%ebx, %eax
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r12d, %r14d
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	andl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%r14d, %r14d
	jne	LBB0_6
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_5
## %bb.11:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_PG_SPIN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jge	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_PG_SPIN_DEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_udelay
	jmp	LBB0_14
LBB0_5:
	andl	-44(%rbp), %r12d                ## 4-byte Folded Reload
	movl	%r12d, %r14d
LBB0_6:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_time_after_eq
	movl	%eax, %r12d
	movq	_STAT_ERR@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	xorl	%eax, %eax
	orl	%r12d, %r14d
	je	LBB0_10
## %bb.7:
	movq	%r13, %r14
	movq	%r13, %rdi
	movl	$7, %esi
	callq	_read_reg
	movl	%eax, %r13d
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_read_reg
	movl	%eax, %ebx
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_read_reg
	movq	_verbose@GOTPCREL(%rip), %rcx
	cmpl	$2, (%rcx)
	jl	LBB0_9
## %bb.8:
	testl	%r12d, %r12d
	movl	4(%r14), %esi
	leaq	L_.str.1(%rip), %rcx
	leaq	L_.str.2(%rip), %rdx
	cmovneq	%rcx, %rdx
	movq	%rdx, (%rsp)
	leaq	L_.str(%rip), %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%r13d, %ecx
	movl	%ebx, %r8d
	movl	%eax, %r9d
	callq	_printk
LBB0_9:
	shrl	$4, %ebx
	movl	%ebx, %eax
	orl	$16, %eax
	testl	%r12d, %r12d
	cmovel	%ebx, %eax
	movzbl	%al, %eax
	movl	%eax, (%r14)
	movl	$-1, %eax
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_PG_SPIN,4,2                    ## @PG_SPIN
	.comm	_PG_SPIN_DEL,4,2                ## @PG_SPIN_DEL
	.comm	_STAT_ERR,4,2                   ## @STAT_ERR
	.comm	_verbose,4,2                    ## @verbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: %s: stat=0x%x err=0x%x phase=%d%s\n"

L_.str.1:                               ## @.str.1
	.asciz	" timeout"

L_.str.2:                               ## @.str.2
	.space	1

	.no_dead_strip	_pg_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pg_wait
_pg_wait:                               ; @pg_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	x4, [sp, #8]                    ; 8-byte Folded Spill
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	mov	w26, #0
	str	wzr, [x0]
Lloh0:
	adrp	x25, _jiffies@GOTPAGE
Lloh1:
	ldr	x25, [x25, _jiffies@GOTPAGEOFF]
Lloh2:
	adrp	x27, _PG_SPIN@GOTPAGE
Lloh3:
	ldr	x27, [x27, _PG_SPIN@GOTPAGEOFF]
Lloh4:
	adrp	x28, _PG_SPIN_DEL@GOTPAGE
Lloh5:
	ldr	x28, [x28, _PG_SPIN_DEL@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x28]
	bl	_udelay
	add	w26, w26, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_status_reg
	mov	x24, x0
	tst	w0, w23
	b.ne	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	and	w20, w24, w22
	cbz	w22, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	cbnz	w20, LBB0_9
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x25]
	mov	x1, x21
	bl	_time_before
	cbz	x0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x27]
	cmp	w26, w8
	b.lt	LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1
	bl	_pg_sleep
	add	w26, w26, #1
	b	LBB0_2
LBB0_8:
	and	w20, w24, w22
LBB0_9:
	ldr	w0, [x25]
	mov	x1, x21
	bl	_time_after_eq
Lloh6:
	adrp	x8, _STAT_ERR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STAT_ERR@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	and	w8, w20, w8
	orr	w8, w8, w0
	cbz	w8, LBB0_13
; %bb.10:
	mov	x21, x0
	mov	x0, x19
	mov	w1, #7
	bl	_read_reg
	mov	x22, x0
	mov	x0, x19
	mov	w1, #1
	bl	_read_reg
	mov	x23, x0
	mov	x0, x19
	mov	w1, #2
	bl	_read_reg
Lloh9:
	adrp	x8, _verbose@GOTPAGE
Lloh10:
	ldr	x8, [x8, _verbose@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, #2
	b.lt	LBB0_12
; %bb.11:
	mov	x5, x0
	ldr	w1, [x19, #4]
Lloh12:
	adrp	x8, l_.str.2@PAGE
Lloh13:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh14:
	adrp	x9, l_.str.1@PAGE
Lloh15:
	add	x9, x9, l_.str.1@PAGEOFF
	cmp	w21, #0
	csel	x6, x9, x8, ne
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	ldr	x2, [sp, #8]                    ; 8-byte Folded Reload
	mov	x3, x22
	mov	x4, x23
	bl	_printk
LBB0_12:
	lsr	w8, w23, #4
	orr	w9, w8, #0x10
	cmp	w21, #0
	csel	w8, w9, w8, ne
	and	w8, w8, #0xff
	str	w8, [x19]
	mov	w0, #-1
	b	LBB0_14
LBB0_13:
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_PG_SPIN,4,2                    ; @PG_SPIN
	.comm	_PG_SPIN_DEL,4,2                ; @PG_SPIN_DEL
	.comm	_STAT_ERR,4,2                   ; @STAT_ERR
	.comm	_verbose,4,2                    ; @verbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: %s: stat=0x%x err=0x%x phase=%d%s\n"

l_.str.1:                               ; @.str.1
	.asciz	" timeout"

l_.str.2:                               ; @.str.2
	.space	1

	.no_dead_strip	_pg_wait
.subsections_via_symbols
