	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_user_sdma_pin_pkt
_qib_user_sdma_pin_pkt:                 ## @qib_user_sdma_pin_pkt
	.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	%rdi, -48(%rbp)                 ## 8-byte Spill
	testq	%r8, %r8
	je	LBB0_1
## %bb.2:
	movq	%r8, %rbx
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_qib_user_sdma_num_pages
	movq	8(%r14), %rcx
	movl	(%r14), %r8d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r15, %rdx
	movl	%eax, %r9d
	callq	_qib_user_sdma_pin_pages
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	addq	$16, %r14
	decq	%rbx
	jne	LBB0_4
	jmp	LBB0_10
LBB0_1:
	xorl	%r13d, %r13d
	jmp	LBB0_10
LBB0_5:
	cmpq	$2, (%r15)
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jb	LBB0_8
## %bb.6:
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movq	%rbx, %rcx
	callq	_qib_user_sdma_free_pkt_frag
	incq	%rbx
	cmpq	(%r15), %rbx
	jb	LBB0_7
LBB0_8:
	movq	8(%r15), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.9:
	movq	(%r14), %rdi
	movq	8(%rax), %rsi
	movl	16(%rax), %edx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_unmap_single
	movq	8(%r15), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
LBB0_10:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.no_dead_strip	_qib_user_sdma_pin_pkt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_user_sdma_pin_pkt
_qib_user_sdma_pin_pkt:                 ; @qib_user_sdma_pin_pkt
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	cbz	x4, LBB0_4
; %bb.1:
	mov	x23, x4
	mov	x24, x3
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_qib_user_sdma_num_pages
	mov	x5, x0
	ldr	x3, [x24, #8]
	ldr	w4, [x24]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x19
	bl	_qib_user_sdma_pin_pages
	mov	x21, x0
	tbnz	w0, #31, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x24, x24, #16
	subs	x23, x23, #1
	b.ne	LBB0_2
	b	LBB0_10
LBB0_4:
	mov	w21, #0
	b	LBB0_10
LBB0_5:
	ldr	x8, [x19]
	cmp	x8, #2
	b.lo	LBB0_8
; %bb.6:
	mov	w23, #1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20]
	mov	x1, x22
	mov	x2, x19
	mov	x3, x23
	bl	_qib_user_sdma_free_pkt_frag
	add	x23, x23, #1
	ldr	x8, [x19]
	cmp	x23, x8
	b.lo	LBB0_7
LBB0_8:
	ldr	x8, [x19, #8]
	ldr	x9, [x8]
	cbz	x9, LBB0_10
; %bb.9:
	ldr	x0, [x20]
	ldr	x1, [x8, #8]
	ldr	w2, [x8, #16]
Lloh0:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	bl	_dma_unmap_single
	ldr	x8, [x19, #8]
	stp	xzr, xzr, [x8]
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.no_dead_strip	_qib_user_sdma_pin_pkt
.subsections_via_symbols
