	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_do_rw_taskfile                 ## -- Begin function do_rw_taskfile
	.p2align	4, 0x90
_do_rw_taskfile:                        ## @do_rw_taskfile
	.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	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %rbx
	movq	8(%rbx), %rcx
	movq	16(%rbx), %r13
	cmpq	$128, (%rsi)
	jne	LBB0_4
## %bb.1:
	movq	_IDE_TFLAG_MULTI_PIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rsi)
	je	LBB0_4
## %bb.2:
	cmpq	$0, (%r15)
	je	LBB0_3
LBB0_4:
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	leaq	24(%rbx), %r14
	movl	12(%rsi), %eax
	movq	_IDE_FTFLAG_FLAGGED@GOTPCREL(%rip), %r12
	testl	%eax, (%r12)
	je	LBB0_6
## %bb.5:
	movq	_IDE_FTFLAG_SET_IN_FLAGS@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 12(%rsi)
LBB0_6:
	movq	%r14, %rdi
	movl	$48, %edx
	callq	_memcpy
	movq	_IDE_TFLAG_DMA_PIO_FALLBACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 32(%rbx)
	jne	LBB0_15
## %bb.7:
	movl	12(%r15), %edi
	movq	%r14, %rsi
	callq	_ide_tf_dump
	movq	_ATA_DEVCTL_OBS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	*24(%r13)
	movq	_IDE_FTFLAG_OUT_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 36(%rbx)
	je	LBB0_9
## %bb.8:
	movl	48(%rbx), %eax
	movl	%eax, -56(%rbp)
	movl	60(%rbx), %eax
	movl	%eax, -52(%rbp)
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$2, %ecx
	callq	*16(%r13)
LBB0_9:
	leaq	48(%rbx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_IDE_VALID_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 40(%rbx)
	je	LBB0_14
## %bb.10:
	movl	(%r12), %eax
	testl	%eax, 36(%rbx)
	je	LBB0_12
## %bb.11:
	movl	52(%rbx), %eax
	jmp	LBB0_13
LBB0_3:
	movl	12(%r15), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_ide_stopped@GOTPCREL(%rip), %rax
	jmp	LBB0_29
LBB0_12:
	movq	_IDE_TFLAG_LBA48@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 32(%rbx)
	movl	$239, %ecx
	movl	$224, %eax
	cmovel	%ecx, %eax
	andl	52(%rbx), %eax
LBB0_13:
	orl	8(%r15), %eax
	movl	%eax, 52(%rbx)
LBB0_14:
	leaq	60(%rbx), %rsi
	movl	44(%rbx), %edx
	movq	%r15, %rdi
	callq	*8(%r13)
	movl	40(%rbx), %edx
	movq	%r15, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	*8(%r13)
LBB0_15:
	movq	(%r14), %rax
	cmpq	$130, %rax
	je	LBB0_25
## %bb.16:
	cmpq	$129, %rax
	je	LBB0_17
## %bb.18:
	cmpq	$128, %rax
	jne	LBB0_28
## %bb.19:
	movq	_IDE_TFLAG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 32(%rbx)
	je	LBB0_21
## %bb.20:
	movl	56(%rbx), %esi
	movq	%rbx, %rdi
	callq	*(%r13)
	movl	$400, %edi                      ## imm = 0x190
	callq	_ndelay
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_pre_task_out_intr
	jmp	LBB0_30
LBB0_25:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ide_dma_prepare
	testl	%eax, %eax
	je	LBB0_27
## %bb.26:
	movq	_ide_stopped@GOTPCREL(%rip), %rax
	jmp	LBB0_29
LBB0_17:
	xorl	%edx, %edx
	testq	%rdx, %rdx
	jne	LBB0_24
LBB0_23:
	movq	_task_no_data_intr@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
LBB0_24:
	movq	_WAIT_WORSTCASE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ide_execute_command
	jmp	LBB0_28
LBB0_27:
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movl	8(%r12), %eax
	movl	%eax, (%rbx)
	movq	_ide_dma_intr@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_WAIT_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	%ecx, %ecx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ide_execute_command
	movq	%r15, %rdi
	callq	*(%r12)
LBB0_28:
	movq	_ide_started@GOTPCREL(%rip), %rax
LBB0_29:
	movl	(%rax), %eax
LBB0_30:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_32
## %bb.31:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	_task_pio_intr@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	testq	%rdx, %rdx
	je	LBB0_23
	jmp	LBB0_24
LBB0_32:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_IDE_TFLAG_MULTI_PIO,4,2        ## @IDE_TFLAG_MULTI_PIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: multimode not set!\n"

	.comm	_ide_stopped,4,2                ## @ide_stopped
	.comm	_IDE_FTFLAG_FLAGGED,4,2         ## @IDE_FTFLAG_FLAGGED
	.comm	_IDE_FTFLAG_SET_IN_FLAGS,4,2    ## @IDE_FTFLAG_SET_IN_FLAGS
	.comm	_IDE_TFLAG_DMA_PIO_FALLBACK,4,2 ## @IDE_TFLAG_DMA_PIO_FALLBACK
	.comm	_ATA_DEVCTL_OBS,4,2             ## @ATA_DEVCTL_OBS
	.comm	_IDE_FTFLAG_OUT_DATA,4,2        ## @IDE_FTFLAG_OUT_DATA
	.comm	_IDE_VALID_DEVICE,4,2           ## @IDE_VALID_DEVICE
	.comm	_IDE_TFLAG_LBA48,4,2            ## @IDE_TFLAG_LBA48
	.comm	_IDE_TFLAG_WRITE,4,2            ## @IDE_TFLAG_WRITE
	.comm	_task_pio_intr,8,3              ## @task_pio_intr
	.comm	_task_no_data_intr,8,3          ## @task_no_data_intr
	.comm	_WAIT_WORSTCASE,4,2             ## @WAIT_WORSTCASE
	.comm	_ide_started,4,2                ## @ide_started
	.comm	_ide_dma_intr,8,3               ## @ide_dma_intr
	.comm	_WAIT_CMD,4,2                   ## @WAIT_CMD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_do_rw_taskfile                 ; -- Begin function do_rw_taskfile
	.p2align	2
_do_rw_taskfile:                        ; @do_rw_taskfile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	ldr	x21, [x0, #16]
	ldp	x23, x24, [x21, #8]
	ldr	x8, [x1]
	cmp	x8, #128
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x1, #8]
Lloh3:
	adrp	x9, _IDE_TFLAG_MULTI_PIO@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IDE_TFLAG_MULTI_PIO@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	ldr	x8, [x19]
	cbz	x8, LBB0_11
LBB0_3:
	add	x20, x21, #24
	ldr	w8, [x1, #12]
Lloh6:
	adrp	x25, _IDE_FTFLAG_FLAGGED@GOTPAGE
Lloh7:
	ldr	x25, [x25, _IDE_FTFLAG_FLAGGED@GOTPAGEOFF]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh8:
	adrp	x9, _IDE_FTFLAG_SET_IN_FLAGS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IDE_FTFLAG_SET_IN_FLAGS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x1, #12]
LBB0_5:
	mov	x0, x20
	mov	w2, #48
	bl	_memcpy
	ldr	w8, [x21, #32]
Lloh11:
	adrp	x9, _IDE_TFLAG_DMA_PIO_FALLBACK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _IDE_TFLAG_DMA_PIO_FALLBACK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_15
; %bb.6:
	add	x22, x21, #48
	ldr	w0, [x19, #12]
	mov	x1, x20
	bl	_ide_tf_dump
	ldr	x8, [x24, #24]
Lloh14:
	adrp	x9, _ATA_DEVCTL_OBS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ATA_DEVCTL_OBS@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x9]
	mov	x0, x21
	blr	x8
	ldr	w8, [x21, #36]
Lloh17:
	adrp	x9, _IDE_FTFLAG_OUT_DATA@GOTPAGE
Lloh18:
	ldr	x9, [x9, _IDE_FTFLAG_OUT_DATA@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
	ldr	w8, [x21, #48]
	ldr	w9, [x21, #60]
	stp	w8, w9, [sp]
	ldr	x8, [x24, #16]
	mov	x2, sp
	mov	x0, x19
	mov	x1, x20
	mov	w3, #2
	blr	x8
LBB0_8:
	ldr	w8, [x21, #40]
Lloh20:
	adrp	x9, _IDE_VALID_DEVICE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _IDE_VALID_DEVICE@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.9:
	ldr	w8, [x21, #36]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.10:
	ldr	w8, [x21, #52]
	b	LBB0_13
LBB0_11:
	ldr	w1, [x19, #12]
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_21
LBB0_12:
	ldr	w8, [x21, #32]
Lloh25:
	adrp	x9, _IDE_TFLAG_LBA48@GOTPAGE
Lloh26:
	ldr	x9, [x9, _IDE_TFLAG_LBA48@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w8, #224
	mov	w9, #239
	csel	w8, w9, w8, eq
	ldr	w9, [x21, #52]
	and	w8, w8, w9
LBB0_13:
	ldr	w9, [x19, #8]
	orr	w8, w8, w9
	str	w8, [x21, #52]
LBB0_14:
	ldr	x8, [x24, #8]
	add	x1, x21, #60
	ldr	w2, [x21, #44]
	mov	x0, x19
	blr	x8
	ldr	x8, [x24, #8]
	ldr	w2, [x21, #40]
	mov	x0, x19
	mov	x1, x22
	blr	x8
LBB0_15:
	ldr	x8, [x20]
	cmp	x8, #130
	b.eq	LBB0_20
; %bb.16:
	cmp	x8, #129
	b.eq	LBB0_22
; %bb.17:
	cmp	x8, #128
	b.ne	LBB0_26
; %bb.18:
	ldr	w8, [x21, #32]
Lloh28:
	adrp	x9, _IDE_TFLAG_WRITE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _IDE_TFLAG_WRITE@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_24
; %bb.19:
	ldr	x8, [x24]
	ldr	w1, [x21, #56]
	mov	x0, x21
	blr	x8
	mov	w0, #400
	bl	_ndelay
	mov	x0, x19
	mov	x1, x20
	bl	_pre_task_out_intr
	b	LBB0_28
LBB0_20:
	mov	x0, x19
	mov	x1, x20
	bl	_ide_dma_prepare
	cbz	w0, LBB0_23
LBB0_21:
Lloh31:
	adrp	x8, _ide_stopped@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ide_stopped@GOTPAGEOFF]
	b	LBB0_27
LBB0_22:
	mov	x8, #0
	b	LBB0_25
LBB0_23:
	ldr	w8, [x23, #8]
Lloh33:
	adrp	x9, _ide_dma_intr@GOTPAGE
Lloh34:
	ldr	x9, [x9, _ide_dma_intr@GOTPAGEOFF]
	str	w8, [x21]
Lloh35:
	ldr	x2, [x9]
Lloh36:
	adrp	x8, _WAIT_CMD@GOTPAGE
Lloh37:
	ldr	x8, [x8, _WAIT_CMD@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	lsl	w3, w8, #1
	mov	x0, x19
	mov	x1, x20
	bl	_ide_execute_command
	ldr	x8, [x23]
	mov	x0, x19
	blr	x8
	b	LBB0_26
LBB0_24:
Lloh39:
	adrp	x8, _task_pio_intr@GOTPAGE
Lloh40:
	ldr	x8, [x8, _task_pio_intr@GOTPAGEOFF]
Lloh41:
	ldr	x8, [x8]
LBB0_25:
Lloh42:
	adrp	x9, _task_no_data_intr@GOTPAGE
Lloh43:
	ldr	x9, [x9, _task_no_data_intr@GOTPAGEOFF]
Lloh44:
	ldr	x9, [x9]
	cmp	x8, #0
	csel	x2, x9, x8, eq
Lloh45:
	adrp	x8, _WAIT_WORSTCASE@GOTPAGE
Lloh46:
	ldr	x8, [x8, _WAIT_WORSTCASE@GOTPAGEOFF]
Lloh47:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_ide_execute_command
LBB0_26:
Lloh48:
	adrp	x8, _ide_started@GOTPAGE
Lloh49:
	ldr	x8, [x8, _ide_started@GOTPAGEOFF]
LBB0_27:
	ldr	w0, [x8]
LBB0_28:
	ldr	x8, [sp, #8]
Lloh50:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh51:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh52:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_30
; %bb.29:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_30:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_IDE_TFLAG_MULTI_PIO,4,2        ; @IDE_TFLAG_MULTI_PIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: multimode not set!\n"

	.comm	_ide_stopped,4,2                ; @ide_stopped
	.comm	_IDE_FTFLAG_FLAGGED,4,2         ; @IDE_FTFLAG_FLAGGED
	.comm	_IDE_FTFLAG_SET_IN_FLAGS,4,2    ; @IDE_FTFLAG_SET_IN_FLAGS
	.comm	_IDE_TFLAG_DMA_PIO_FALLBACK,4,2 ; @IDE_TFLAG_DMA_PIO_FALLBACK
	.comm	_ATA_DEVCTL_OBS,4,2             ; @ATA_DEVCTL_OBS
	.comm	_IDE_FTFLAG_OUT_DATA,4,2        ; @IDE_FTFLAG_OUT_DATA
	.comm	_IDE_VALID_DEVICE,4,2           ; @IDE_VALID_DEVICE
	.comm	_IDE_TFLAG_LBA48,4,2            ; @IDE_TFLAG_LBA48
	.comm	_IDE_TFLAG_WRITE,4,2            ; @IDE_TFLAG_WRITE
	.comm	_task_pio_intr,8,3              ; @task_pio_intr
	.comm	_task_no_data_intr,8,3          ; @task_no_data_intr
	.comm	_WAIT_WORSTCASE,4,2             ; @WAIT_WORSTCASE
	.comm	_ide_started,4,2                ; @ide_started
	.comm	_ide_dma_intr,8,3               ; @ide_dma_intr
	.comm	_WAIT_CMD,4,2                   ; @WAIT_CMD
.subsections_via_symbols
