	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcd_command
_pcd_command:                           ## @pcd_command
	.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	%rcx, %r14
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movl	4(%rdi), %edi
	callq	_pi_connect
	movl	(%r13), %edx
	shll	$4, %edx
	addl	$160, %edx
	movq	%r13, %rdi
	movl	$6, %esi
	callq	_write_reg
	movq	_IDE_BUSY@GOTPCREL(%rip), %r15
	movq	_IDE_DRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r15), %esi
	leaq	L_.str(%rip), %r8
	movq	%r13, %rdi
	xorl	%edx, %edx
	movq	%r14, %rcx
	callq	_pcd_wait
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leal	255(%r12), %ebx
	testl	%r12d, %r12d
	cmovnsl	%r12d, %ebx
	movl	%ebx, %eax
	andl	$-256, %eax
	subl	%eax, %r12d
	movq	%r13, %rdi
	movl	$4, %esi
	movl	%r12d, %edx
	callq	_write_reg
	sarl	$8, %ebx
	movq	%r13, %rdi
	movl	$5, %esi
	movl	%ebx, %edx
	callq	_write_reg
	movq	%r13, %rdi
	movl	$7, %esi
	movl	$160, %edx
	callq	_write_reg
	movl	(%r15), %esi
	movq	_IDE_DRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %r8
	movq	%r13, %rdi
	movq	%r14, %rcx
	callq	_pcd_wait
	testq	%rax, %rax
	jne	LBB0_1
## %bb.3:
	movq	%r13, %rdi
	movl	$2, %esi
	callq	_read_reg
	cmpl	$1, %eax
	jne	LBB0_4
## %bb.5:
	movl	4(%r13), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	$12, %edx
	callq	_pi_write_block
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_4:
	movl	8(%r13), %esi
	leaq	L_.str.2(%rip), %rdi
	movq	%r14, %rdx
	callq	_printk
LBB0_1:
	movl	4(%r13), %edi
	callq	_pi_disconnect
	movl	$-1, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IDE_BUSY,4,2                   ## @IDE_BUSY
	.comm	_IDE_DRQ,4,2                    ## @IDE_DRQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"before command"

L_.str.1:                               ## @.str.1
	.asciz	"command DRQ"

L_.str.2:                               ## @.str.2
	.asciz	"%s: %s: command phase error\n"

	.no_dead_strip	_pcd_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcd_command
_pcd_command:                           ; @pcd_command
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #4]
	bl	_pi_connect
	ldr	w8, [x19]
	lsl	w8, w8, #4
	add	w2, w8, #160
	mov	x0, x19
	mov	w1, #6
	bl	_write_reg
Lloh0:
	adrp	x24, _IDE_BUSY@GOTPAGE
Lloh1:
	ldr	x24, [x24, _IDE_BUSY@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh2:
	adrp	x25, _IDE_DRQ@GOTPAGE
Lloh3:
	ldr	x25, [x25, _IDE_DRQ@GOTPAGEOFF]
	ldr	w9, [x25]
	orr	w1, w9, w8
Lloh4:
	adrp	x4, l_.str@PAGE
Lloh5:
	add	x4, x4, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #0
	mov	x3, x20
	bl	_pcd_wait
	cbnz	x0, LBB0_5
; %bb.1:
	add	w8, w22, #255
	cmp	w22, #0
	csel	w8, w8, w22, lt
	asr	w23, w8, #8
	and	w8, w8, #0xffffff00
	sub	w2, w22, w8
	mov	x0, x19
	mov	w1, #4
	bl	_write_reg
	mov	x0, x19
	mov	w1, #5
	mov	x2, x23
	bl	_write_reg
	mov	x0, x19
	mov	w1, #7
	mov	w2, #160
	bl	_write_reg
	ldr	w1, [x24]
	ldr	w2, [x25]
Lloh6:
	adrp	x4, l_.str.1@PAGE
Lloh7:
	add	x4, x4, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	bl	_pcd_wait
	cbnz	x0, LBB0_5
; %bb.2:
	mov	x0, x19
	mov	w1, #2
	bl	_read_reg
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.3:
	ldr	w0, [x19, #4]
	mov	x1, x21
	mov	w2, #12
	bl	_pi_write_block
	mov	w0, #0
	b	LBB0_6
LBB0_4:
	ldr	w1, [x19, #8]
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_printk
LBB0_5:
	ldr	w0, [x19, #4]
	bl	_pi_disconnect
	mov	w0, #-1
LBB0_6:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_IDE_BUSY,4,2                   ; @IDE_BUSY
	.comm	_IDE_DRQ,4,2                    ; @IDE_DRQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"before command"

l_.str.1:                               ; @.str.1
	.asciz	"command DRQ"

l_.str.2:                               ; @.str.2
	.asciz	"%s: %s: command phase error\n"

	.no_dead_strip	_pcd_command
.subsections_via_symbols
