	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_sff_drain_fifo             ## -- Begin function ata_sff_drain_fifo
	.p2align	4, 0x90
_ata_sff_drain_fifo:                    ## @ata_sff_drain_fifo
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	movq	(%rdi), %rax
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.2:
	movq	8(%rdi), %r14
	movq	8(%r14), %rax
	movq	%r14, %rdi
	callq	*(%rax)
	movq	_ATA_DRQ@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_7
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_ioread16
	leal	1(%rbx), %r12d
	movq	8(%r14), %rax
	movq	%r14, %rdi
	callq	*(%rax)
	testl	%eax, (%r15)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$32767, %ebx                    ## imm = 0x7FFF
	movl	%r12d, %ebx
	jb	LBB0_4
LBB0_6:
	movq	_KERN_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movl	%r12d, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ata_port_printk                ## TAILCALL
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TO_DEVICE,8,3              ## @DMA_TO_DEVICE
	.comm	_ATA_DRQ,4,2                    ## @ATA_DRQ
	.comm	_KERN_DEBUG,4,2                 ## @KERN_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"drained %d bytes to clear DRQ.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_sff_drain_fifo             ; -- Begin function ata_sff_drain_fifo
	.p2align	2
_ata_sff_drain_fifo:                    ; @ata_sff_drain_fifo
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cbz	x0, LBB0_6
; %bb.1:
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_6
; %bb.2:
	ldr	x19, [x0, #8]
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
Lloh3:
	adrp	x21, _ATA_DRQ@GOTPAGE
Lloh4:
	ldr	x21, [x21, _ATA_DRQ@GOTPAGEOFF]
	ldr	w8, [x21]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.3:
	mov	w20, #0
	mov	w22, #32767
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x23, x20
	ldr	w0, [x19]
	bl	_ioread16
	add	w20, w20, #1
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	ldr	w8, [x21]
	and	w8, w8, w0
	cmp	w8, #0
	ccmp	w23, w22, #2, ne
	b.lo	LBB0_4
; %bb.5:
Lloh5:
	adrp	x8, _KERN_DEBUG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _KERN_DEBUG@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ata_port_printk
LBB0_6:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,8,3              ; @DMA_TO_DEVICE
	.comm	_ATA_DRQ,4,2                    ; @ATA_DRQ
	.comm	_KERN_DEBUG,4,2                 ; @KERN_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"drained %d bytes to clear DRQ.\n"

.subsections_via_symbols
