	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function owl_prep_dma_cyclic
_owl_prep_dma_cyclic:                   ## @owl_prep_dma_cyclic
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -120(%rbp)                 ## 8-byte Spill
	movl	%r8d, -68(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r12
	movl	(%rdi), %edi
	callq	_to_owl_dma
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_to_owl_vchan
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rax
	orq	%r13, %rax
	shrq	$32, %rax
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%r13
	movq	%rax, %r14
	jmp	LBB0_3
LBB0_1:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%r13d
	movl	%eax, %r14d
LBB0_3:
	movq	_GFP_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$12, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.4:
	movq	%rax, %rbx
	leaq	8(%rax), %rdi
	callq	_INIT_LIST_HEAD
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	$1, (%rbx)
	testl	%r14d, %r14d
	je	LBB0_5
## %bb.6:
	movq	%r13, -136(%rbp)                ## 8-byte Spill
	movq	%r12, -112(%rbp)                ## 8-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	$8, %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	%r14d, %eax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_owl_dma_alloc_lli
	testq	%rax, %rax
	je	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %r13
	movl	-68(%rbp), %r9d                 ## 4-byte Reload
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rax
	cmpl	%r9d, (%rax)
	movq	%rbx, -152(%rbp)                ## 8-byte Spill
	movq	%r12, -144(%rbp)                ## 8-byte Spill
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rax
	movq	%r15, %rbx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	cmpl	%r9d, (%rax)
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	-104(%rbp), %rax                ## 8-byte Reload
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rbx
	movq	%r15, %rax
LBB0_15:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %r14
	movl	(%r12), %r10d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%rbx, %rdx
	movq	%rax, %rcx
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	-136(%rbp), %r15                ## 8-byte Reload
	movq	%r15, %r8
	pushq	%r10
	pushq	-88(%rbp)                       ## 8-byte Folded Reload
	callq	_owl_dma_cfg_lli
	addq	$16, %rsp
	testl	%eax, %eax
	jne	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	cmoveq	%r13, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movq	-144(%rbp), %rsi                ## 8-byte Reload
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	callq	_owl_dma_add_lli
	movq	%rax, %r12
	movq	-152(%rbp), %rbx                ## 8-byte Reload
	incq	%rbx
	addq	%r15, %r14
	movq	%r14, %r15
	cmpq	-128(%rbp), %rbx                ## 8-byte Folded Reload
	jne	LBB0_7
	jmp	LBB0_18
LBB0_5:
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
LBB0_18:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	$1, %ecx
	callq	_owl_dma_add_lli
	addq	$4, %rbx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	-120(%rbp), %rdx                ## 8-byte Reload
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vchan_tx_prep                  ## TAILCALL
LBB0_8:
	leaq	L_.str(%rip), %rbx
	jmp	LBB0_9
LBB0_16:
	leaq	L_.str.1(%rip), %rbx
LBB0_9:
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	callq	_chan2dev
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_dev_warn
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_owl_dma_free_txd
LBB0_10:
	xorl	%eax, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_NOWAIT,4,2                 ## @GFP_NOWAIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate lli"

	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
L_.str.1:                               ## @.str.1
	.asciz	"failed to config lli"

	.no_dead_strip	_owl_prep_dma_cyclic
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function owl_prep_dma_cyclic
_owl_prep_dma_cyclic:                   ; @owl_prep_dma_cyclic
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x21, x5
	mov	x24, x4
	mov	x25, x3
	mov	x19, x2
	mov	x26, x1
	mov	x22, x0
	ldr	w0, [x0]
	bl	_to_owl_dma
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	mov	x0, x22
	bl	_to_owl_vchan
	str	x0, [sp, #40]                   ; 8-byte Folded Spill
Lloh0:
	adrp	x8, _GFP_NOWAIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_NOWAIT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #12
	bl	_kzalloc
	cbz	x0, LBB0_15
; %bb.1:
	mov	x20, x0
	str	x21, [sp, #8]                   ; 8-byte Folded Spill
	add	x0, x0, #8
	udiv	x19, x19, x25
	bl	_INIT_LIST_HEAD
	mov	w8, #1
	str	w8, [x20]
	cbz	w19, LBB0_10
; %bb.2:
	str	x22, [sp]                       ; 8-byte Folded Spill
	mov	x23, #0
	mov	x27, #0
	mov	x21, #0
	mov	x22, #0
	mov	x28, #0
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	add	x8, x8, #8
	str	x8, [sp, #32]                   ; 8-byte Folded Spill
	and	x8, x19, #0xffffffff
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	bl	_owl_dma_alloc_lli
	cbz	x0, LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x19, x0
Lloh3:
	adrp	x8, _DMA_MEM_TO_DEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w24
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x21, [x8, #16]
	mov	x22, x26
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh6:
	adrp	x8, _DMA_DEV_TO_MEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w24
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	ldr	x22, [x8]
	mov	x21, x26
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w7, [x20]
	ldp	x6, x0, [sp, #32]               ; 16-byte Folded Reload
	mov	x1, x19
	mov	x2, x22
	mov	x3, x21
	mov	x4, x25
	mov	x5, x24
	bl	_owl_dma_cfg_lli
	cbnz	w0, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	x28, #0
	csel	x28, x19, x28, eq
	mov	x0, x20
	mov	x1, x27
	mov	x2, x19
	mov	w3, #0
	bl	_owl_dma_add_lli
	mov	x27, x0
	add	x23, x23, #1
	add	x26, x26, x25
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	cmp	x23, x8
	b.ne	LBB0_3
	b	LBB0_11
LBB0_10:
	mov	x28, #0
	mov	x27, #0
LBB0_11:
	mov	x0, x20
	mov	x1, x27
	mov	x2, x28
	mov	w3, #1
	bl	_owl_dma_add_lli
	add	x1, x20, #4
	ldr	x0, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x2, [sp, #8]                    ; 8-byte Folded Reload
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_vchan_tx_prep
LBB0_12:
Lloh9:
	adrp	x19, l_.str@PAGE
Lloh10:
	add	x19, x19, l_.str@PAGEOFF
	b	LBB0_14
LBB0_13:
Lloh11:
	adrp	x19, l_.str.1@PAGE
Lloh12:
	add	x19, x19, l_.str.1@PAGEOFF
LBB0_14:
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_chan2dev
	mov	x1, x19
	bl	_dev_warn
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x20
	bl	_owl_dma_free_txd
LBB0_15:
	mov	x0, #0
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_NOWAIT,4,2                 ; @GFP_NOWAIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate lli"

	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
l_.str.1:                               ; @.str.1
	.asciz	"failed to config lli"

	.no_dead_strip	_owl_prep_dma_cyclic
.subsections_via_symbols
