	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function edma_completion_handler
_edma_completion_handler:               ## @edma_completion_handler
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	callq	_spin_lock
	movq	24(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.1:
	cmpq	$0, 56(%rbx)
	je	LBB0_3
## %bb.2:
	addq	$48, %rbx
	movq	%rbx, %rdi
	callq	_vchan_cyclic_callback
	jmp	LBB0_7
LBB0_3:
	movq	(%rbx), %rax
	cmpq	8(%rbx), %rax
	jne	LBB0_5
## %bb.4:
	movq	$0, 24(%rbx)
	movq	%r14, %rdi
	callq	_edma_stop
	addq	$48, %rbx
	movq	%rbx, %rdi
	callq	_vchan_cookie_complete
	movq	$0, 24(%r14)
	movl	16(%r14), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	jmp	LBB0_6
LBB0_5:
	movl	16(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	movq	%r14, %rdi
	callq	_edma_pause
	movq	24(%rbx), %rax
	subq	40(%rbx), %rax
	movq	(%rbx), %rcx
	movq	%rax, 24(%rbx)
	movq	%rax, 32(%rbx)
	movq	%rcx, 16(%rbx)
LBB0_6:
	movq	%r14, %rdi
	callq	_edma_execute
LBB0_7:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Transfer completed on channel %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Sub transfer completed on channel %d\n"

	.no_dead_strip	_edma_completion_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function edma_completion_handler
_edma_completion_handler:               ; @edma_completion_handler
	.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	x19, x0
	ldr	x8, [x0, #8]
	ldr	x20, [x8]
	bl	_spin_lock
	ldr	x21, [x19, #24]
	cbz	x21, LBB0_7
; %bb.1:
	ldr	x8, [x21, #56]
	cbz	x8, LBB0_3
; %bb.2:
	add	x0, x21, #48
	bl	_vchan_cyclic_callback
	b	LBB0_7
LBB0_3:
	ldp	x8, x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	str	xzr, [x21, #24]
	mov	x0, x19
	bl	_edma_stop
	add	x0, x21, #48
	bl	_vchan_cookie_complete
	str	xzr, [x19, #24]
	ldr	w2, [x19, #16]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	b	LBB0_6
LBB0_5:
	ldr	w2, [x19, #16]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	mov	x0, x19
	bl	_edma_pause
	ldr	x8, [x21, #40]
	ldr	x9, [x21, #24]
	sub	x8, x9, x8
	stp	x8, x8, [x21, #24]
	ldr	x9, [x21]
	str	x9, [x21, #16]
LBB0_6:
	mov	x0, x19
	bl	_edma_execute
LBB0_7:
	mov	x0, x19
	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
	b	_spin_unlock
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Transfer completed on channel %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Sub transfer completed on channel %d\n"

	.no_dead_strip	_edma_completion_handler
.subsections_via_symbols
