	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function finish_dma_sg
_finish_dma_sg:                         ## @finish_dma_sg
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	callq	_MIO_EMM_DMA_FIFO_CFG
	addq	%rax, %rbx
	movq	%rbx, %rdi
	callq	_readq
	movq	_MIO_EMM_DMA_FIFO_CFG_COUNT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%eax, %esi
	callq	_FIELD_GET
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
LBB0_2:
	movl	8(%r15), %eax
	imull	4(%r15), %eax
	movl	%eax, (%r15)
	movq	$0, 24(%r15)
	movl	$16, %edi
	callq	_BIT_ULL
	movl	%eax, %r12d
	movq	8(%r14), %rbx
	movq	%r14, %rdi
	callq	_MIO_EMM_DMA_FIFO_CFG
	addq	%rax, %rbx
	movl	%r12d, %edi
	movq	%rbx, %rsi
	callq	_writeq
	movl	(%r14), %r12d
	movl	12(%r15), %r14d
	movl	16(%r15), %ebx
	movq	%r15, %rdi
	callq	_get_dma_dir
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_dma_unmap_sg
	movl	$1, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MIO_EMM_DMA_FIFO_CFG_COUNT,4,2 ## @MIO_EMM_DMA_FIFO_CFG_COUNT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%u requests still pending\n"

	.no_dead_strip	_finish_dma_sg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function finish_dma_sg
_finish_dma_sg:                         ; @finish_dma_sg
	.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, x1
	mov	x20, x0
	ldr	x21, [x0, #8]
	bl	_MIO_EMM_DMA_FIFO_CFG
	add	x0, x0, x21
	bl	_readq
	mov	x1, x0
Lloh0:
	adrp	x8, _MIO_EMM_DMA_FIFO_CFG_COUNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MIO_EMM_DMA_FIFO_CFG_COUNT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_FIELD_GET
	cbz	w0, LBB0_2
; %bb.1:
	mov	x2, x0
	ldr	w0, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_2:
	ldp	w8, w9, [x19, #4]
	mul	w8, w9, w8
	str	w8, [x19]
	str	xzr, [x19, #24]
	mov	w0, #16
	bl	_BIT_ULL
	mov	x21, x0
	ldr	x22, [x20, #8]
	mov	x0, x20
	bl	_MIO_EMM_DMA_FIFO_CFG
	add	x1, x0, x22
	mov	x0, x21
	bl	_writeq
	ldr	w20, [x20]
	ldp	w22, w21, [x19, #12]
	mov	x0, x19
	bl	_get_dma_dir
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_dma_unmap_sg
	mov	w0, #1
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MIO_EMM_DMA_FIFO_CFG_COUNT,4,2 ; @MIO_EMM_DMA_FIFO_CFG_COUNT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%u requests still pending\n"

	.no_dead_strip	_finish_dma_sg
.subsections_via_symbols
