	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ide_dma_map_sg
_ide_dma_map_sg:                        ## @ide_dma_map_sg
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rsi, %rbx
	movq	(%rdi), %rax
	movq	8(%rax), %rsi
	movq	_IDE_TFLAG_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rbx), %ecx
	jne	LBB0_1
## %bb.2:
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_1:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
LBB0_3:
	movl	(%rcx), %ecx
	movl	%ecx, 12(%rbx)
	movl	(%rax), %edi
	movl	4(%rbx), %edx
	callq	_dma_map_sg
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	4(%rbx), %ecx
	movl	%ecx, 8(%rbx)
	movl	%eax, 4(%rbx)
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IDE_TFLAG_WRITE,4,2            ## @IDE_TFLAG_WRITE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.no_dead_strip	_ide_dma_map_sg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ide_dma_map_sg
_ide_dma_map_sg:                        ; @ide_dma_map_sg
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	ldr	x8, [x0]
	ldr	x1, [x8, #8]
Lloh0:
	adrp	x9, _IDE_TFLAG_WRITE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IDE_TFLAG_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _DMA_FROM_DEVICE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _DMA_FROM_DEVICE@GOTPAGEOFF]
	ldp	w11, w2, [x19]
	tst	w9, w11
Lloh5:
	adrp	x9, _DMA_TO_DEVICE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DMA_TO_DEVICE@GOTPAGEOFF]
	csel	x9, x10, x9, eq
	ldr	w3, [x9]
	str	w3, [x19, #12]
	ldr	w0, [x8]
	bl	_dma_map_sg
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w8, [x19, #4]
	stp	w0, w8, [x19, #4]
LBB0_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_IDE_TFLAG_WRITE,4,2            ; @IDE_TFLAG_WRITE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.no_dead_strip	_ide_dma_map_sg
.subsections_via_symbols
