	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __atapi_pio_bytes
___atapi_pio_bytes:                     ## @__atapi_pio_bytes
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_ATA_TFLAG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%rdi)
	jne	LBB0_1
## %bb.2:
	movq	_READ@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_WRITE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	24(%r15), %rax
	movq	32(%r15), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	testl	%r14d, %r14d
	je	LBB0_12
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rbx
	xorl	%edi, %edi
	testq	%rbx, %rbx
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_sg_page
	movl	4(%r15), %r12d
	addl	(%rbx), %r12d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	movl	%r12d, %esi
	shrl	%cl, %esi
	movq	%rax, %rdi
	callq	_nth_page
	movq	%rax, %r13
	movl	%r12d, %eax
	xorl	%edx, %edx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	divl	(%r12)
	movl	%r14d, %esi
	movl	%edx, %r14d
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movl	4(%rbx), %edi
	subl	4(%r15), %edi
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	callq	_min
	movl	(%r12), %esi
	subl	%r14d, %esi
	movl	%eax, %edi
	callq	_min
	movl	%eax, %r12d
	movq	_ATA_TFLAG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	16(%r15), %eax
	leaq	L_.str.2(%rip), %rsi
	leaq	L_.str.3(%rip), %rax
	cmoveq	%rax, %rsi
	leaq	L_.str.1(%rip), %rdi
	callq	_DPRINTK
	movq	%r13, %r15
	movq	%r13, %rdi
	callq	_PageHighMem
	movl	%r14d, %ebx
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	callq	_local_irq_save
	movq	_KM_IRQ0@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_kmap_atomic
	movq	%rax, %r14
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	addq	%r14, %rbx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%r12d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	*(%rax)
	movl	%eax, %ebx
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_kunmap_atomic
	callq	_local_irq_restore
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	callq	_page_address
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %r8
	addq	%rax, %rbx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%r12d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	*(%r8)
	movl	%eax, %ebx
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_min
	addl	%r12d, (%r15)
	addl	4(%r15), %r12d
	subl	%eax, %r14d
	movl	%r12d, 4(%r15)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	cmpl	4(%rax), %r12d
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r15), %rdi
	callq	_sg_next
	movq	%rax, 8(%r15)
	movl	$0, 4(%r15)
	jmp	LBB0_11
LBB0_12:
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_5:
	movl	(%r15), %ecx
	movl	20(%r15), %edx
	leaq	L_.str(%rip), %rsi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %r8d
	callq	_ata_ehi_push_desc
	movl	$-1, %eax
LBB0_13:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_TFLAG_WRITE,4,2            ## @ATA_TFLAG_WRITE
	.comm	_WRITE,4,2                      ## @WRITE
	.comm	_READ,4,2                       ## @READ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unexpected or too much trailing data buf=%u cur=%u bytes=%u"

	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"data %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"write"

L_.str.3:                               ## @.str.3
	.asciz	"read"

	.comm	_KM_IRQ0,4,2                    ## @KM_IRQ0
	.no_dead_strip	___atapi_pio_bytes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __atapi_pio_bytes
___atapi_pio_bytes:                     ; @__atapi_pio_bytes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x9, _ATA_TFLAG_WRITE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATA_TFLAG_WRITE@GOTPAGEOFF]
	ldr	w8, [x0, #16]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _WRITE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _WRITE@GOTPAGEOFF]
Lloh5:
	adrp	x11, _READ@GOTPAGE
Lloh6:
	ldr	x11, [x11, _READ@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w8, [x8]
	str	w8, [sp, #28]                   ; 4-byte Folded Spill
	ldp	x23, x9, [x0, #24]
	ldr	x8, [x23]
	stp	x8, x9, [sp, #8]                ; 16-byte Folded Spill
Lloh7:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh8:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
Lloh9:
	adrp	x22, _KM_IRQ0@GOTPAGE
Lloh10:
	ldr	x22, [x22, _KM_IRQ0@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	cbz	w19, LBB0_8
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x25, [x20, #8]
	cmp	x25, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x25
	bl	_sg_page
	ldr	w8, [x25]
	ldr	w9, [x20, #4]
	add	w21, w9, w8
Lloh11:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	lsr	w1, w21, w8
	bl	_nth_page
	mov	x27, x0
	ldr	w8, [x24]
	udiv	w9, w21, w8
	msub	w21, w9, w8, w21
	ldr	w8, [x25, #4]
	ldr	w9, [x20, #4]
	sub	w0, w8, w9
	mov	x1, x19
	bl	_min
	ldr	w8, [x24]
	sub	w1, w8, w21
	bl	_min
	mov	x26, x0
	ldr	w8, [x20, #16]
Lloh14:
	adrp	x9, _ATA_TFLAG_WRITE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ATA_TFLAG_WRITE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
Lloh17:
	adrp	x8, l_.str.2@PAGE
Lloh18:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh19:
	adrp	x9, l_.str.3@PAGE
Lloh20:
	add	x9, x9, l_.str.3@PAGEOFF
	csel	x1, x9, x8, eq
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPRINTK
	mov	x0, x27
	bl	_PageHighMem
	cbz	x0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_local_irq_save
	ldr	w1, [x22]
	mov	x0, x27
	bl	_kmap_atomic
	mov	x28, x0
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	ldr	x8, [x8]
	add	x1, x0, w21, uxtw
	mov	x0, x23
	mov	x2, x26
	ldr	w3, [sp, #28]                   ; 4-byte Folded Reload
	blr	x8
	mov	x27, x0
	ldr	w1, [x22]
	mov	x0, x28
	bl	_kunmap_atomic
	bl	_local_irq_restore
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x27
	bl	_page_address
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	ldr	x8, [x8]
	add	x1, x0, w21, uxtw
	mov	x0, x23
	mov	x2, x26
	ldr	w3, [sp, #28]                   ; 4-byte Folded Reload
	blr	x8
	mov	x27, x0
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x19
	mov	x1, x27
	bl	_min
	sub	w19, w19, w0
	ldp	w8, w9, [x20]
	add	w8, w8, w26
	ldr	w10, [x25, #4]
	add	w9, w9, w26
	cmp	w9, w10
	stp	w8, w9, [x20]
	b.ne	LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x0, [x20, #8]
	bl	_sg_next
	str	x0, [x20, #8]
	str	wzr, [x20, #4]
	b	LBB0_1
LBB0_8:
	mov	w0, #0
	b	LBB0_10
LBB0_9:
	ldr	w2, [x20, #20]
	ldr	w3, [x20]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x4, x19
	bl	_ata_ehi_push_desc
	mov	w0, #-1
LBB0_10:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_TFLAG_WRITE,4,2            ; @ATA_TFLAG_WRITE
	.comm	_WRITE,4,2                      ; @WRITE
	.comm	_READ,4,2                       ; @READ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unexpected or too much trailing data buf=%u cur=%u bytes=%u"

	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"data %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"write"

l_.str.3:                               ; @.str.3
	.asciz	"read"

	.comm	_KM_IRQ0,4,2                    ; @KM_IRQ0
	.no_dead_strip	___atapi_pio_bytes
.subsections_via_symbols
