	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_user_sdma_send_frag
_qib_user_sdma_send_frag:               ## @qib_user_sdma_send_frag
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	(%rsi), %rax
	movslq	%edx, %r13
	leaq	(,%r13,8), %rdx
	leaq	(%rdx,%rdx,4), %r14
	movl	16(%rax,%r14), %esi
	movl	24(%rax,%r14), %r15d
	addl	32(%rax,%r14), %r15d
	leal	3(%rsi), %edx
	testl	%esi, %esi
	cmovnsl	%esi, %edx
	sarl	$2, %edx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	(%rax,%r8,8), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%r9d, %edi
	movl	%r15d, %esi
	callq	_qib_sdma_make_desc0
	movl	%eax, %ebx
	movq	(%r12), %rax
	cmpq	$0, 8(%rax,%r14)
	je	LBB0_2
## %bb.1:
	movl	%ebx, %edi
	callq	_qib_sdma_make_first_desc0
	movl	%eax, %ebx
	movq	(%r12), %rax
LBB0_2:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	leaq	(,%r13,4), %rcx
	addq	%r13, %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_5
## %bb.3:
	movl	%ebx, %edi
	callq	_qib_sdma_make_last_desc0
	movl	%eax, %ebx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	cmpq	$0, (%r12)
	je	LBB0_5
## %bb.4:
	movl	$32768, %edi                    ## imm = 0x8000
	callq	_cpu_to_le64
	orl	%eax, %ebx
	movq	$0, (%r12)
LBB0_5:
	movl	%ebx, (%r14)
	movl	%r15d, %edi
	callq	_qib_sdma_make_desc1
	movl	%eax, 4(%r14)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_qib_user_sdma_send_frag
.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_send_frag
_qib_user_sdma_send_frag:               ; @qib_user_sdma_send_frag
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
                                        ; kill: def $w2 killed $w2 def $x2
	mov	x22, x1
	mov	x20, x0
	ldr	x8, [x1]
	sxtw	x24, w2
	add	x9, x24, w2, sxtw #2
	lsl	x25, x9, #3
	add	x8, x8, x25
	ldr	w9, [x8, #32]
	ldr	w10, [x8, #24]
	add	w19, w10, w9
	ldr	w8, [x8, #16]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w2, w8, #2
	ldr	x8, [x0, #8]
	ldr	x23, [x8, x4, lsl #3]
	mov	x0, x5
	mov	x1, x19
	bl	_qib_sdma_make_desc0
	mov	x21, x0
	ldr	x8, [x22]
	add	x9, x8, x25
	ldr	x9, [x9, #8]
	cbz	x9, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_qib_sdma_make_first_desc0
	mov	x21, x0
	ldr	x8, [x22]
LBB0_2:
	mov	w9, #40
	mul	x9, x24, x9
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_5
; %bb.3:
	mov	x0, x21
	bl	_qib_sdma_make_last_desc0
	mov	x21, x0
	ldr	x8, [x20]
	cbz	x8, LBB0_5
; %bb.4:
	mov	w0, #32768
	bl	_cpu_to_le64
	orr	w21, w0, w21
	str	xzr, [x20]
LBB0_5:
	str	w21, [x23]
	mov	x0, x19
	bl	_qib_sdma_make_desc1
	str	w0, [x23, #4]
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_qib_user_sdma_send_frag
.subsections_via_symbols
