	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcd_completion
_pcd_completion:                        ## @pcd_completion
	.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	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	_IDE_BUSY@GOTPCREL(%rip), %rax
	movq	_IDE_DRQ@GOTPCREL(%rip), %rbx
	movq	_IDE_READY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rbx), %edx
	movl	(%rax), %esi
	movq	_IDE_ERR@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	leaq	L_.str(%rip), %r8
	movq	%r12, %rcx
	callq	_pcd_wait
	movl	$-1, %r14d
	testq	%rax, %rax
	je	LBB0_1
LBB0_18:
	movl	(%r13), %edi
	callq	_pi_disconnect
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	$7, %esi
	callq	_read_reg
	testl	%eax, (%rbx)
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movl	$4, %esi
	callq	_read_reg
	movq	%r13, %rbx
	movl	%eax, %r12d
	movq	%r13, %rdi
	movl	$5, %esi
	callq	_read_reg
	movl	%eax, %r13d
	shll	$8, %r13d
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_read_reg
	andl	$3, %eax
	cmpl	$2, %eax
	jne	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	(%r12,%r13), %r14d
	addl	$3, %r14d
	andl	$65532, %r14d                   ## imm = 0xFFFC
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	(%r13), %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	%r14d, %edx
	callq	_pi_read_block
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	movq	_verbose@GOTPCREL(%rip), %rax
	cmpl	$2, (%rax)
	jl	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r13), %esi
	leaq	L_.str.1(%rip), %rdi
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_printk
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_verbose@GOTPCREL(%rip), %rcx
	cmpl	$2, (%rcx)
	jl	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	addl	%r12d, %r13d
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	4(%rcx), %esi
	leaq	L_.str.2(%rip), %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, %ecx
	movl	%r13d, %r8d
	movl	%r15d, %r9d
	xorl	%eax, %eax
	callq	_printk
	movq	_verbose@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jg	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %esi
	leaq	L_.str.3(%rip), %rdi
	callq	_printk_once
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %edi
	callq	_mdelay
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %r12                 ## 8-byte Reload
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_IDE_BUSY@GOTPCREL(%rip), %rax
	movq	_IDE_DRQ@GOTPCREL(%rip), %rbx
	movq	_IDE_READY@GOTPCREL(%rip), %rcx
	movq	_IDE_ERR@GOTPCREL(%rip), %rdi
	movq	_PCD_TMO@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %r15d
	jg	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	incl	%r15d
	movl	(%rax), %esi
	movl	(%rcx), %edx
	orl	(%rbx), %edx
	orl	(%rdi), %edx
	movq	%r13, %rdi
	movq	%r12, %rcx
	leaq	L_.str(%rip), %r8
	callq	_pcd_wait
	testq	%rax, %rax
	je	LBB0_2
## %bb.17:
	movl	$-1, %r14d
	jmp	LBB0_18
LBB0_3:
	xorl	%r14d, %r14d
	jmp	LBB0_18
LBB0_15:
	movl	4(%r13), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_printk
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_IDE_BUSY,4,2                   ## @IDE_BUSY
	.comm	_IDE_DRQ,4,2                    ## @IDE_DRQ
	.comm	_IDE_READY,4,2                  ## @IDE_READY
	.comm	_IDE_ERR,4,2                    ## @IDE_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"completion"

	.comm	_verbose,4,2                    ## @verbose
L_.str.1:                               ## @.str.1
	.asciz	"%s: %s: Read %d bytes\n"

L_.str.2:                               ## @.str.2
	.asciz	"%s: %s: Unexpected phase %d, d=%d, k=%d\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s: WARNING: ATAPI phase errors\n"

	.comm	_PCD_TMO,4,2                    ## @PCD_TMO
L_.str.4:                               ## @.str.4
	.asciz	"%s: Stuck DRQ\n"

	.no_dead_strip	_pcd_completion
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcd_completion
_pcd_completion:                        ; @pcd_completion
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _IDE_BUSY@GOTPAGE
Lloh1:
	ldr	x21, [x21, _IDE_BUSY@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh2:
	adrp	x28, _IDE_DRQ@GOTPAGE
Lloh3:
	ldr	x28, [x28, _IDE_DRQ@GOTPAGEOFF]
	ldr	w8, [x28]
Lloh4:
	adrp	x23, _IDE_READY@GOTPAGE
Lloh5:
	ldr	x23, [x23, _IDE_READY@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w8, w9, w8
Lloh6:
	adrp	x25, _IDE_ERR@GOTPAGE
Lloh7:
	ldr	x25, [x25, _IDE_ERR@GOTPAGEOFF]
	ldr	w9, [x25]
	orr	w2, w8, w9
Lloh8:
	adrp	x4, l_.str@PAGE
Lloh9:
	add	x4, x4, l_.str@PAGEOFF
	mov	x3, x20
	bl	_pcd_wait
	cbz	x0, LBB0_3
LBB0_1:
	mov	w20, #-1
LBB0_2:
	ldr	w0, [x19]
	bl	_pi_disconnect
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_3:
	str	x22, [sp, #40]                  ; 8-byte Folded Spill
	mov	w24, #0
	mov	w27, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #7
	bl	_read_reg
	ldr	w8, [x28]
	tst	w8, w0
	b.eq	LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	w1, #4
	bl	_read_reg
	mov	x26, x0
	mov	x0, x19
	mov	w1, #5
	bl	_read_reg
	add	w22, w26, w0, lsl #8
	mov	x0, x19
	mov	w1, #2
	bl	_read_reg
	and	w8, w0, #0x3
	cmp	w8, #2
	b.ne	LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w9, w22, #3
	and	w26, w9, #0xfffc
	cmp	w26, #0
	ccmp	w27, #0, #0, ne
	b.ne	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19]
	ldr	x1, [sp, #40]                   ; 8-byte Folded Reload
	mov	x2, x26
	bl	_pi_read_block
Lloh10:
	adrp	x8, _verbose@GOTPAGE
Lloh11:
	ldr	x8, [x8, _verbose@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w8, #2
	b.lt	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x19, #4]
	stp	x20, x26, [sp]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printk
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w27, #1
	b	LBB0_14
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh15:
	adrp	x9, _verbose@GOTPAGE
Lloh16:
	ldr	x9, [x9, _verbose@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w9, #2
	b.lt	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x19, #4]
	stp	x22, x24, [sp, #16]
	stp	x20, x8, [sp]
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printk
Lloh20:
	adrp	x8, _verbose@GOTPAGE
Lloh21:
	ldr	x8, [x8, _verbose@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	cmp	w8, #1
	b.gt	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x19, #4]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printk_once
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	bl	_mdelay
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh25:
	adrp	x8, _PCD_TMO@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PCD_TMO@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w24, w8
	b.gt	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	add	w24, w24, #1
	ldr	w1, [x21]
	ldr	w8, [x28]
	ldr	w9, [x23]
	orr	w8, w9, w8
	ldr	w9, [x25]
	orr	w2, w8, w9
	mov	x0, x19
	mov	x3, x20
Lloh28:
	adrp	x4, l_.str@PAGE
Lloh29:
	add	x4, x4, l_.str@PAGEOFF
	bl	_pcd_wait
	cbz	x0, LBB0_4
	b	LBB0_1
LBB0_16:
	mov	w20, #0
	b	LBB0_2
LBB0_17:
	ldr	w1, [x19, #4]
Lloh30:
	adrp	x0, l_.str.4@PAGE
Lloh31:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printk
	mov	w20, #0
	b	LBB0_2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_IDE_BUSY,4,2                   ; @IDE_BUSY
	.comm	_IDE_DRQ,4,2                    ; @IDE_DRQ
	.comm	_IDE_READY,4,2                  ; @IDE_READY
	.comm	_IDE_ERR,4,2                    ; @IDE_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"completion"

	.comm	_verbose,4,2                    ; @verbose
l_.str.1:                               ; @.str.1
	.asciz	"%s: %s: Read %d bytes\n"

l_.str.2:                               ; @.str.2
	.asciz	"%s: %s: Unexpected phase %d, d=%d, k=%d\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s: WARNING: ATAPI phase errors\n"

	.comm	_PCD_TMO,4,2                    ; @PCD_TMO
l_.str.4:                               ; @.str.4
	.asciz	"%s: Stuck DRQ\n"

	.no_dead_strip	_pcd_completion
.subsections_via_symbols
