	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dpaa_fd_release
_dpaa_fd_release:                       ## @dpaa_fd_release
	.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, %rbx
	movq	$0, -48(%rbp)
	movq	%rsi, %rdi
	callq	_qm_fd_addr
	leaq	-48(%rbp), %rdi
	movl	%eax, %esi
	callq	_bm_buffer_set64
	movl	(%rbx), %edi
	callq	_dpaa_bpid2pool
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_qm_fd_get_format
	movq	_qm_fd_sg@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.2:
	movq	%rbx, %rdi
	callq	_qm_fd_addr
	movl	%eax, %edi
	callq	_phys_to_virt
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_qm_fd_get_offset
	movslq	%eax, %r12
	addq	%r15, %r12
	movl	(%r14), %r13d
	movq	%rbx, %rdi
	callq	_qm_fd_addr
	movl	4(%r14), %edx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_dma_unmap_single
	movq	%r12, %rdi
	callq	_dpaa_release_sgt_members
	movl	(%r14), %edi
	movl	4(%r14), %edx
	movl	(%rbx), %ecx
	movq	%r15, %rsi
	callq	_dma_map_single
	movl	%eax, %ebx
	movl	(%r14), %edi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_6
LBB0_4:
	leaq	-48(%rbp), %rdi
	movl	%ebx, %esi
	callq	_bm_buffer_set64
LBB0_5:
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_dpaa_bman_release
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_qm_fd_sg,8,3                   ## @qm_fd_sg
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA mapping failed"

	.no_dead_strip	_dpaa_fd_release
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dpaa_fd_release
_dpaa_fd_release:                       ; @dpaa_fd_release
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	str	xzr, [sp, #8]
	mov	x0, x1
	bl	_qm_fd_addr
	mov	x1, x0
	add	x0, sp, #8
	bl	_bm_buffer_set64
	ldr	w0, [x20]
	bl	_dpaa_bpid2pool
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	mov	x0, x20
	bl	_qm_fd_get_format
Lloh0:
	adrp	x8, _qm_fd_sg@GOTPAGE
Lloh1:
	ldr	x8, [x8, _qm_fd_sg@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x20
	bl	_qm_fd_addr
	bl	_phys_to_virt
	mov	x21, x0
	mov	x0, x20
	bl	_qm_fd_get_offset
	add	x22, x21, w0, sxtw
	ldr	w23, [x19]
	mov	x0, x20
	bl	_qm_fd_addr
	mov	x1, x0
	ldr	w2, [x19, #4]
Lloh3:
	adrp	x20, _DMA_FROM_DEVICE@GOTPAGE
Lloh4:
	ldr	x20, [x20, _DMA_FROM_DEVICE@GOTPAGEOFF]
	ldr	w3, [x20]
	mov	x0, x23
	bl	_dma_unmap_single
	mov	x0, x22
	bl	_dpaa_release_sgt_members
	ldp	w0, w2, [x19]
	ldr	w3, [x20]
	mov	x1, x21
	bl	_dma_map_single
	mov	x20, x0
	ldr	w0, [x19]
	mov	x1, x20
	bl	_dma_mapping_error
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w0, [x19]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_6
LBB0_4:
	add	x0, sp, #8
	mov	x1, x20
	bl	_bm_buffer_set64
LBB0_5:
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1
	bl	_dpaa_bman_release
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_qm_fd_sg,8,3                   ; @qm_fd_sg
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA mapping failed"

	.no_dead_strip	_dpaa_fd_release
.subsections_via_symbols
