	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_user_sdma_writev           ## -- Begin function qib_user_sdma_writev
	.p2align	4, 0x90
_qib_user_sdma_writev:                  ## @qib_user_sdma_writev
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	(%rdi), %r15
	movq	8(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	-48(%rbp), %rdi
	callq	_INIT_LIST_HEAD
	leaq	12(%rbx), %rdi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_qib_sdma_running
	xorl	%r12d, %r12d
	testl	%eax, %eax
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movq	(%rbx), %rax
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	cmpq	(%r15), %rax
	jle	LBB0_4
## %bb.3:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_qib_user_sdma_hwqueue_clean
LBB0_4:
	cmpq	$0, 16(%rbx)
	je	LBB0_6
## %bb.5:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_qib_user_sdma_queue_clean
LBB0_6:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	testq	%r14, %r14
	je	LBB0_18
## %bb.7:
	movq	%r13, %rcx
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	leaq	-48(%rbp), %r13
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%r15d, %r12d
LBB0_17:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%r15d, %eax
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rcx
	subq	%rax, %r14
	leaq	-48(%rbp), %r13
	je	LBB0_18
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, -56(%rbp)
	movl	$0, -60(%rbp)
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdx
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	movq	%r14, %r8
	movq	%r13, %r9
	leaq	-60(%rbp), %rax
	pushq	%rax
	leaq	-56(%rbp), %rax
	pushq	%rax
	callq	_qib_user_sdma_queue_pkts
	addq	$16, %rsp
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r13, %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rbx, %rdi
	callq	_qib_sdma_descq_freecnt
	cmpl	-60(%rbp), %eax
	jge	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rbx, %rdi
	callq	_qib_user_sdma_hwqueue_clean
	cmpq	$0, 16(%r12)
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_qib_user_sdma_queue_clean
LBB0_15:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	-56(%rbp), %ecx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	leaq	-48(%rbp), %rdx
	callq	_qib_user_sdma_push_pkts
	movq	%r12, %rbx
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	-56(%rbp), %eax
	addl	%eax, -52(%rbp)                 ## 4-byte Folded Spill
	addl	%eax, 8(%rbx)
	jmp	LBB0_17
LBB0_1:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_18
LBB0_9:
	movl	%r15d, %r12d
LBB0_18:
	leaq	-48(%rbp), %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_20
## %bb.19:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	leaq	-48(%rbp), %rdx
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	_qib_user_sdma_free_pkt_list
LBB0_20:
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	testl	%r12d, %r12d
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmovsl	%r12d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_user_sdma_writev           ; -- Begin function qib_user_sdma_writev
	.p2align	2
_qib_user_sdma_writev:                  ; @qib_user_sdma_writev
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x3
	mov	x23, x2
	mov	x19, x1
	ldp	x24, x21, [x0]
	add	x0, sp, #8
	bl	_INIT_LIST_HEAD
	add	x20, x19, #12
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x24
	bl	_qib_sdma_running
	cbz	w0, LBB0_16
; %bb.1:
	ldr	x8, [x19]
	ldr	x9, [x24]
	cmp	x8, x9
	b.le	LBB0_3
; %bb.2:
	mov	x0, x24
	bl	_qib_user_sdma_hwqueue_clean
LBB0_3:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x24
	mov	x1, x19
	bl	_qib_user_sdma_queue_clean
LBB0_5:
	cbz	x22, LBB0_16
; %bb.6:
	mov	w27, #0
	mov	w28, #1
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x25, x26
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	sub	x22, x22, w26, uxtw
	add	x23, x23, w26, uxtw #2
	cbz	x22, LBB0_18
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	stp	wzr, w28, [sp]
	add	x5, sp, #8
	add	x6, sp, #4
	mov	x7, sp
	mov	x0, x21
	mov	x1, x24
	mov	x2, x19
	mov	x3, x23
	mov	x4, x22
	bl	_qib_user_sdma_queue_pkts
	mov	x26, x0
	tbnz	w0, #31, LBB0_17
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x0, sp, #8
	bl	_list_empty
	cbnz	w0, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x24
	bl	_qib_sdma_descq_freecnt
	ldr	w8, [sp]
	cmp	w0, w8
	b.ge	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x24
	bl	_qib_user_sdma_hwqueue_clean
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x24
	mov	x1, x19
	bl	_qib_user_sdma_queue_clean
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w3, [sp, #4]
	add	x2, sp, #8
	mov	x0, x24
	mov	x1, x19
	bl	_qib_user_sdma_push_pkts
	mov	x25, x0
	tbnz	w0, #31, LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [sp, #4]
	add	w27, w8, w27
	ldr	w9, [x19, #8]
	add	w8, w9, w8
	str	w8, [x19, #8]
	b	LBB0_8
LBB0_16:
	mov	w25, #0
	mov	w27, #0
	b	LBB0_18
LBB0_17:
	mov	x25, x26
LBB0_18:
	add	x0, sp, #8
	bl	_list_empty
	cbnz	w0, LBB0_20
; %bb.19:
	ldr	x0, [x21]
	add	x2, sp, #8
	mov	x1, x19
	bl	_qib_user_sdma_free_pkt_list
LBB0_20:
	mov	x0, x20
	bl	_mutex_unlock
	cmp	w25, #0
	csel	w0, w25, w27, lt
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
