	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flexrm_spu_write_descs
_flexrm_spu_write_descs:                ## @flexrm_spu_write_descs
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -88(%rbp)                  ## 8-byte Spill
	movq	%rcx, %rbx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rcx, -56(%rbp)
	movq	%r8, -64(%rbp)
	movq	(%rdi), %r14
	movq	8(%rdi), %rcx
	testq	%rcx, %rcx
	setne	%al
	movq	%rcx, %rdx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	orq	%r14, %rcx
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	je	LBB0_19
## %bb.1:
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	setne	%al
	orq	%r14, %rcx
	je	LBB0_18
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	testb	$1, %al
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_sg_dma_len
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_sg_dma_address
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_sg_dma_len
	testb	$15, %r12b
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_flexrm_src_desc
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_UINT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	shrl	$4, %eax
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_flexrm_msrc_desc
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %ecx
	movq	%r13, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	leaq	-56(%rbp), %r8
	leaq	-64(%rbp), %r9
	pushq	16(%rbp)
	pushq	-88(%rbp)                       ## 8-byte Folded Reload
	callq	_flexrm_enqueue_desc
	addq	$16, %rsp
	incq	%r13
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_sg_dma_len
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_sg_next
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testl	%r15d, %r15d
	je	LBB0_2
	.p2align	4, 0x90
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	testq	%r14, %r14
	je	LBB0_2
LBB0_11:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rbx
	movq	%r14, %rdi
	callq	_sg_dma_len
	movl	%eax, %r13d
	movq	%r14, %rdi
	callq	_sg_dma_address
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_sg_dma_len
	testb	$15, %r13b
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_flexrm_dst_desc
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=2
	shrl	$4, %eax
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_flexrm_mdst_desc
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=2
	movq	%rbx, %r13
	movq	%rbx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, %ecx
	leaq	-56(%rbp), %r8
	leaq	-64(%rbp), %r9
	pushq	16(%rbp)
	pushq	-88(%rbp)                       ## 8-byte Folded Reload
	callq	_flexrm_enqueue_desc
	addq	$16, %rsp
	movq	%r14, %rdi
	callq	_sg_dma_len
	xorl	%ebx, %ebx
	cmpl	%r15d, %eax
	jae	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	%r14, %rdi
	callq	_sg_dma_len
	subl	%eax, %r15d
	movl	%r15d, %ebx
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=2
	movq	%r14, %rdi
	callq	_sg_next
	movq	%rax, %r14
	incq	%r13
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.17:                              ##   in Loop: Header=BB0_11 Depth=2
	movl	%ebx, %r15d
	testq	%r14, %r14
	jne	LBB0_11
	jmp	LBB0_2
LBB0_18:
	movq	-56(%rbp), %rbx
	movq	-64(%rbp), %r8
LBB0_19:
	xorl	%edi, %edi
	testq	%r8, %r8
	sete	%dil
	callq	_flexrm_null_desc
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_flexrm_write_desc
	xorl	%eax, %eax
	callq	_wmb
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_flexrm_flip_header_toggle
	movq	-56(%rbp), %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UINT_MAX,4,2                   ## @UINT_MAX
	.no_dead_strip	_flexrm_spu_write_descs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flexrm_spu_write_descs
_flexrm_spu_write_descs:                ; @flexrm_spu_write_descs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x26, x3
	stp	x4, x3, [sp, #16]
	ldp	x25, x24, [x0]
	cmp	x24, #0
	cset	w8, ne
	str	x3, [sp, #8]                    ; 8-byte Folded Spill
	orr	x9, x24, x25
	cbz	x9, LBB0_19
; %bb.1:
	mov	x20, x6
	mov	x21, x5
	mov	x22, x2
	mov	x23, x1
	mov	x26, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	x24, #0
	cset	w8, ne
	orr	x9, x24, x25
	cbz	x9, LBB0_18
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	tbz	w8, #0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x24
	bl	_sg_dma_len
	and	w28, w0, #0xf
	mov	x0, x24
	bl	_sg_dma_address
	mov	x27, x0
	mov	x0, x24
	bl	_sg_dma_len
	mov	x1, x0
	cbz	w28, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x27
	bl	_flexrm_src_desc
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x24, #0
Lloh0:
	adrp	x8, _UINT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UINT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w27, [x8]
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	lsr	w1, w1, #4
	mov	x0, x27
	bl	_flexrm_msrc_desc
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x3, x0
	add	x4, sp, #24
	add	x5, sp, #16
	mov	x0, x26
	mov	x1, x23
	mov	x2, x22
	mov	x6, x21
	mov	x7, x20
	bl	_flexrm_enqueue_desc
	add	x26, x26, #1
	mov	x0, x24
	bl	_sg_dma_len
	mov	x27, x0
	mov	x0, x24
	bl	_sg_next
	mov	x24, x0
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w27, #0
	ccmp	x25, #0, #4, ne
	b.eq	LBB0_2
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x25
	bl	_sg_dma_len
	and	w19, w0, #0xf
	mov	x0, x25
	bl	_sg_dma_address
	mov	x28, x0
	mov	x0, x25
	bl	_sg_dma_len
	mov	x1, x0
	cbz	w19, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	x0, x28
	bl	_flexrm_dst_desc
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_10 Depth=2
	lsr	w1, w1, #4
	mov	x0, x28
	bl	_flexrm_mdst_desc
LBB0_13:                                ;   in Loop: Header=BB0_10 Depth=2
	mov	x3, x0
	add	x4, sp, #24
	add	x5, sp, #16
	mov	x0, x26
	mov	x1, x23
	mov	x2, x22
	mov	x6, x21
	mov	x7, x20
	bl	_flexrm_enqueue_desc
	mov	x0, x25
	bl	_sg_dma_len
	cmp	w0, w27
	b.hs	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	x0, x25
	bl	_sg_dma_len
	sub	w27, w27, w0
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_10 Depth=2
	mov	w27, #0
LBB0_16:                                ;   in Loop: Header=BB0_10 Depth=2
	mov	x0, x25
	bl	_sg_next
	mov	x25, x0
	add	x26, x26, #1
	cbz	w27, LBB0_2
; %bb.17:                               ;   in Loop: Header=BB0_10 Depth=2
	cbnz	x25, LBB0_10
	b	LBB0_2
LBB0_18:
	ldp	x4, x26, [sp, #16]
LBB0_19:
	cmp	x4, #0
	cset	w0, eq
	bl	_flexrm_null_desc
	mov	x1, x0
	mov	x0, x26
	bl	_flexrm_write_desc
	bl	_wmb
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_flexrm_flip_header_toggle
	ldr	x0, [sp, #24]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_UINT_MAX,4,2                   ; @UINT_MAX
	.no_dead_strip	_flexrm_spu_write_descs
.subsections_via_symbols
