	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function prepare_data_dma
_prepare_data_dma:                      ## @prepare_data_dma
	.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
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r15
	movl	%edx, %esi
	callq	_gpmi_raw_len_to_len
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_virt_addr_valid
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%r12, %rdi
	callq	_object_is_on_stack
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_sg_init_one
	movl	8(%r15), %edi
	movl	$1, %r13d
	movq	%rbx, %rsi
	movl	$1, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_dma_map_sg
	testl	%eax, %eax
	jne	LBB0_7
LBB0_3:
	movq	(%r15), %rsi
	movq	%rbx, %r13
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_sg_init_one
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%ebx, (%rax)
	jne	LBB0_6
## %bb.4:
	movq	(%r15), %rdi
	cmpq	%r12, %rdi
	je	LBB0_6
## %bb.5:
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_memcpy
LBB0_6:
	movl	8(%r15), %edi
	movq	%r13, %rsi
	movl	$1, %edx
	movl	%ebx, %ecx
	callq	_dma_map_sg
	xorl	%r13d, %r13d
LBB0_7:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.no_dead_strip	_prepare_data_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function prepare_data_dma
_prepare_data_dma:                      ; @prepare_data_dma
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x4
	mov	x20, x3
	mov	x22, x1
	mov	x21, x0
	mov	x1, x2
	bl	_gpmi_raw_len_to_len
	mov	x23, x0
	mov	x0, x22
	bl	_virt_addr_valid
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x22
	bl	_object_is_on_stack
	cbnz	w0, LBB0_3
; %bb.2:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	bl	_sg_init_one
	ldr	w0, [x21, #8]
	mov	w24, #1
	mov	x1, x20
	mov	w2, #1
	mov	x3, x19
	bl	_dma_map_sg
	cbnz	w0, LBB0_7
LBB0_3:
	ldr	x1, [x21]
	mov	x0, x20
	mov	x2, x23
	bl	_sg_init_one
Lloh0:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_6
; %bb.4:
	ldr	x0, [x21]
	cmp	x0, x22
	b.eq	LBB0_6
; %bb.5:
	mov	x1, x22
	mov	x2, x23
	bl	_memcpy
LBB0_6:
	ldr	w0, [x21, #8]
	mov	x1, x20
	mov	w2, #1
	mov	x3, x19
	bl	_dma_map_sg
	mov	w24, #0
LBB0_7:
	mov	x0, x24
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.no_dead_strip	_prepare_data_dma
.subsections_via_symbols
