	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flexrm_spu_dma_map
_flexrm_spu_dma_map:                    ## @flexrm_spu_dma_map
	.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	%rsi, %r12
	movq	%rdi, %r14
	movl	(%rsi), %ebx
	movl	%ebx, %edi
	callq	_sg_nents
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_dma_map_sg
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	movl	4(%r12), %ebx
	movl	%ebx, %edi
	callq	_sg_nents
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_dma_map_sg
	movl	%eax, %r15d
	xorl	%eax, %eax
	testl	%r15d, %r15d
	jns	LBB0_3
## %bb.2:
	movl	(%r12), %ebx
	movl	%ebx, %edi
	callq	_sg_nents
	movl	(%r13), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_dma_unmap_sg
	movl	%r15d, %eax
LBB0_3:
	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
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.no_dead_strip	_flexrm_spu_dma_map
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flexrm_spu_dma_map
_flexrm_spu_dma_map:                    ; @flexrm_spu_dma_map
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	w21, [x1]
	mov	x0, x21
	bl	_sg_nents
	mov	x2, x0
Lloh0:
	adrp	x22, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DMA_TO_DEVICE@GOTPAGEOFF]
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x21
	bl	_dma_map_sg
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	w21, [x20, #4]
	mov	x0, x21
	bl	_sg_nents
	mov	x2, x0
Lloh2:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_dma_map_sg
	tbnz	w0, #31, LBB0_4
; %bb.2:
	mov	w21, #0
	b	LBB0_5
LBB0_3:
	mov	x21, x0
	b	LBB0_5
LBB0_4:
	mov	x21, x0
	ldr	w20, [x20]
	mov	x0, x20
	bl	_sg_nents
	mov	x2, x0
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	bl	_dma_unmap_sg
LBB0_5:
	mov	x0, x21
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.no_dead_strip	_flexrm_spu_dma_map
.subsections_via_symbols
