	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_pio_sector
_ata_pio_sector:                        ## @ata_pio_sector
	.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	%rdi, %r13
	movq	_ATA_TFLAG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	andl	44(%rdi), %r14d
	movq	48(%rdi), %rcx
	movq	8(%rdi), %rax
	subq	16(%rdi), %rax
	cmpq	%rax, (%rdi)
	jne	LBB0_2
## %bb.1:
	movq	_HSM_ST_LAST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rcx)
LBB0_2:
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	32(%r13), %rdi
	callq	_sg_page
	movq	32(%r13), %rcx
	movl	24(%r13), %ebx
	addl	(%rcx), %ebx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%ebx, %esi
	shrl	%cl, %esi
	movq	%rax, %rdi
	callq	_nth_page
	movq	%rax, %r15
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	(%rcx)
	movl	%edx, %r12d
	movq	_ATA_TFLAG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	44(%r13), %eax
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
	callq	_DPRINTK
	movq	%r15, %rdi
	callq	_PageHighMem
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	callq	_local_irq_save
	movq	_KM_IRQ0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_kmap_atomic
	movq	%rax, %rbx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	40(%r13), %edi
	movl	%r12d, %esi
	addq	%rbx, %rsi
	movq	16(%r13), %rdx
	movl	%r14d, %ecx
	callq	*(%rax)
	movq	_KM_IRQ0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_kunmap_atomic
	callq	_local_irq_restore
	testl	%r14d, %r14d
	jne	LBB0_8
	jmp	LBB0_6
LBB0_4:
	movq	%r15, %rdi
	callq	_page_address
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rbx
	movl	40(%r13), %edi
	movl	%r12d, %esi
	addq	%rax, %rsi
	movq	16(%r13), %rdx
	movl	%r14d, %ecx
	callq	*(%rbx)
	testl	%r14d, %r14d
	jne	LBB0_8
LBB0_6:
	movq	%r15, %rdi
	callq	_PageSlab
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movq	%r15, %rdi
	callq	_flush_dcache_page
LBB0_8:
	movq	16(%r13), %rax
	movq	32(%r13), %rdi
	addq	%rax, (%r13)
	addl	24(%r13), %eax
	movl	%eax, 24(%r13)
	cmpl	4(%rdi), %eax
	jne	LBB0_10
## %bb.9:
	callq	_sg_next
	movq	%rax, 32(%r13)
	movl	$0, 24(%r13)
LBB0_10:
	addq	$8, %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	_HSM_ST_LAST,4,2                ## @HSM_ST_LAST
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"data %s\n"

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

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

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ata_pio_sector
_ata_pio_sector:                        ; @ata_pio_sector
	.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	x19, x0
	ldr	w8, [x0, #44]
Lloh0:
	adrp	x22, _ATA_TFLAG_WRITE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ATA_TFLAG_WRITE@GOTPAGEOFF]
	ldr	w9, [x22]
	ldr	x23, [x0, #48]
	ldp	x10, x11, [x0]
	ldr	x12, [x0, #16]
	sub	x11, x11, x12
	cmp	x10, x11
	b.ne	LBB0_2
; %bb.1:
Lloh2:
	adrp	x10, _HSM_ST_LAST@GOTPAGE
Lloh3:
	ldr	x10, [x10, _HSM_ST_LAST@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	str	w10, [x23, #8]
LBB0_2:
	and	w20, w9, w8
	ldr	x0, [x19, #32]
	bl	_sg_page
	ldr	x8, [x19, #32]
	ldr	w8, [x8]
	ldr	w9, [x19, #24]
	add	w24, w9, w8
Lloh5:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	lsr	w1, w24, w8
	bl	_nth_page
	mov	x21, x0
Lloh8:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	udiv	w9, w24, w8
	msub	w24, w9, w8, w24
	ldr	w8, [x19, #44]
	ldr	w9, [x22]
Lloh11:
	adrp	x10, l_.str.1@PAGE
Lloh12:
	add	x10, x10, l_.str.1@PAGEOFF
Lloh13:
	adrp	x11, l_.str.2@PAGE
Lloh14:
	add	x11, x11, l_.str.2@PAGEOFF
	tst	w9, w8
	csel	x1, x11, x10, eq
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINTK
	mov	x0, x21
	bl	_PageHighMem
	cbz	x0, LBB0_4
; %bb.3:
	bl	_local_irq_save
Lloh17:
	adrp	x25, _KM_IRQ0@GOTPAGE
Lloh18:
	ldr	x25, [x25, _KM_IRQ0@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x21
	bl	_kmap_atomic
	mov	x22, x0
	ldr	x8, [x23]
	ldr	x8, [x8]
	ldr	w0, [x19, #40]
	add	x1, x22, w24, uxtw
	ldr	x2, [x19, #16]
	mov	x3, x20
	blr	x8
	ldr	w1, [x25]
	mov	x0, x22
	bl	_kunmap_atomic
	bl	_local_irq_restore
	cbnz	w20, LBB0_7
	b	LBB0_5
LBB0_4:
	mov	x0, x21
	bl	_page_address
	ldr	x8, [x23]
	ldr	x9, [x8]
	ldr	w8, [x19, #40]
	add	x1, x0, w24, uxtw
	ldr	x2, [x19, #16]
	mov	x0, x8
	mov	x3, x20
	blr	x9
	cbnz	w20, LBB0_7
LBB0_5:
	mov	x0, x21
	bl	_PageSlab
	cbnz	w0, LBB0_7
; %bb.6:
	mov	x0, x21
	bl	_flush_dcache_page
LBB0_7:
	ldr	x8, [x19, #16]
	ldr	x9, [x19]
	add	x9, x9, x8
	str	x9, [x19]
	ldr	w9, [x19, #24]
	ldr	x0, [x19, #32]
	ldr	w10, [x0, #4]
	add	w8, w9, w8
	cmp	w8, w10
	str	w8, [x19, #24]
	b.ne	LBB0_9
; %bb.8:
	bl	_sg_next
	str	x0, [x19, #32]
	str	wzr, [x19, #24]
LBB0_9:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_TFLAG_WRITE,4,2            ; @ATA_TFLAG_WRITE
	.comm	_HSM_ST_LAST,4,2                ; @HSM_ST_LAST
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"data %s\n"

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

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

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