	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ide_dma_prepare                ## -- Begin function ide_dma_prepare
	.p2align	4, 0x90
_ide_dma_prepare:                       ## @ide_dma_prepare
	.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
	movq	_IDE_DFLAG_USING_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$1, %r14d
	testl	%eax, (%rdi)
	je	LBB0_8
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %r12
	movq	8(%r12), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	*%rax
	testq	%rax, %rax
	jne	LBB0_8
LBB0_3:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_ide_map_sg
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_ide_dma_map_sg
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	*(%r12)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_ide_dma_unmap_sg
LBB0_7:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_ide_map_sg
	jmp	LBB0_8
LBB0_5:
	movl	$1, 4(%rbx)
	xorl	%r14d, %r14d
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IDE_DFLAG_USING_DMA,4,2        ## @IDE_DFLAG_USING_DMA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ide_dma_prepare                ; -- Begin function ide_dma_prepare
	.p2align	2
_ide_dma_prepare:                       ; @ide_dma_prepare
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _IDE_DFLAG_USING_DMA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IDE_DFLAG_USING_DMA@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	blr	x8
	cbnz	x0, LBB0_7
LBB0_3:
	mov	x0, x19
	mov	x1, x20
	bl	_ide_map_sg
	mov	x0, x19
	mov	x1, x20
	bl	_ide_dma_map_sg
	cbz	x0, LBB0_6
; %bb.4:
	ldr	x8, [x21]
	mov	x0, x19
	mov	x1, x20
	blr	x8
	cbz	x0, LBB0_9
; %bb.5:
	mov	x0, x19
	mov	x1, x20
	bl	_ide_dma_unmap_sg
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_ide_map_sg
LBB0_7:
	mov	w0, #1
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	w8, #1
	str	w8, [x19, #4]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_IDE_DFLAG_USING_DMA,4,2        ; @IDE_DFLAG_USING_DMA
.subsections_via_symbols
