	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	(%rdi), %r12
	movq	8(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	-48(%rbp), %rdi
	callq	_INIT_LIST_HEAD
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	callq	_qib_sdma_running
	xorl	%r14d, %r14d
	testl	%eax, %eax
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movq	(%r12), %rax
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	cmpq	8(%r12), %rax
	je	LBB0_4
## %bb.3:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_qib_user_sdma_hwqueue_clean
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_qib_user_sdma_queue_clean
LBB0_4:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	testq	%r15, %r15
	je	LBB0_15
## %bb.5:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	%r12d, %r14d
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	%r12d, %eax
	leaq	(%r13,%rax,4), %r13
	subq	%rax, %r15
	je	LBB0_15
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rdi
	callq	_down_write
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	leaq	-48(%rbp), %r14
	movq	%r14, %rdx
	movq	%r13, %rcx
	movq	%r15, %r8
	movl	$8, %r9d
	callq	_qib_user_sdma_queue_pkts
	movl	%eax, %r12d
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rdi
	callq	_up_write
	testl	%r12d, %r12d
	jle	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_qib_sdma_descq_freecnt
	leal	(,%r12,4), %ecx
	cmpl	%ecx, %eax
	jge	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	callq	_qib_user_sdma_hwqueue_clean
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_qib_user_sdma_queue_clean
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	leaq	-48(%rbp), %rdx
	callq	_qib_user_sdma_push_pkts
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=1
	addl	%r14d, -52(%rbp)                ## 4-byte Folded Spill
	addl	%r14d, (%rbx)
	leaq	-48(%rbp), %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_14
	jmp	LBB0_15
LBB0_1:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_15
LBB0_7:
	movl	%r12d, %r14d
LBB0_15:
	leaq	-48(%rbp), %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_17
## %bb.16:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	leaq	-48(%rbp), %rdx
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_qib_user_sdma_free_pkt_list
LBB0_17:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	testl	%r14d, %r14d
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmovsl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_current,8,3                    ## @current
.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, #4
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x24
	bl	_qib_sdma_running
	cbz	w0, LBB0_13
; %bb.1:
	ldp	x8, x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x24
	bl	_qib_user_sdma_hwqueue_clean
	mov	x0, x24
	mov	x1, x19
	bl	_qib_user_sdma_queue_clean
LBB0_3:
	cbz	x22, LBB0_13
; %bb.4:
	mov	w27, #0
Lloh0:
	adrp	x28, _current@GOTPAGE
Lloh1:
	ldr	x28, [x28, _current@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x25, x26
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	sub	x22, x22, w26, uxtw
	add	x23, x23, w26, uxtw #2
	cbz	x22, LBB0_15
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x28]
	ldr	x0, [x8]
	bl	_down_write
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x19
	mov	x3, x23
	mov	x4, x22
	mov	w5, #8
	bl	_qib_user_sdma_queue_pkts
	mov	x26, x0
	ldr	x8, [x28]
	ldr	x0, [x8]
	bl	_up_write
	cmp	w26, #1
	b.lt	LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x0, sp, #8
	bl	_list_empty
	cbnz	w0, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x24
	bl	_qib_sdma_descq_freecnt
	cmp	w0, w26, lsl #2
	b.ge	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x24
	bl	_qib_user_sdma_hwqueue_clean
	mov	x0, x24
	mov	x1, x19
	bl	_qib_user_sdma_queue_clean
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x2, sp, #8
	mov	x0, x24
	mov	x1, x19
	bl	_qib_user_sdma_push_pkts
	mov	x25, x0
	tbnz	w0, #31, LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	add	w27, w25, w27
	ldr	w8, [x19]
	add	w8, w8, w25
	str	w8, [x19]
	add	x0, sp, #8
	bl	_list_empty
	cbnz	w0, LBB0_6
	b	LBB0_15
LBB0_13:
	mov	w25, #0
	mov	w27, #0
	b	LBB0_15
LBB0_14:
	mov	x25, x26
LBB0_15:
	add	x0, sp, #8
	bl	_list_empty
	cbnz	w0, LBB0_17
; %bb.16:
	ldr	x0, [x21]
	add	x2, sp, #8
	mov	x1, x19
	bl	_qib_user_sdma_free_pkt_list
LBB0_17:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_current,8,3                    ; @current
.subsections_via_symbols
