	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipath_user_sdma_writev         ## -- Begin function ipath_user_sdma_writev
	.p2align	4, 0x90
_ipath_user_sdma_writev:                ## @ipath_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, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	leaq	-48(%rbp), %rdi
	callq	_INIT_LIST_HEAD
	leaq	4(%r15), %rdi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	(%r12), %rax
	cmpq	8(%r12), %rax
	je	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	callq	_ipath_user_sdma_hwqueue_clean
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_ipath_user_sdma_queue_clean
LBB0_2:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.4:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	%r12d, %r15d
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%r12d, %eax
	leaq	(%r14,%rax,4), %r14
	subq	%rax, %rbx
	je	LBB0_14
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rdi
	callq	_down_write
	movq	%r13, %rdi
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	movq	%r14, %rcx
	leaq	-48(%rbp), %r14
	movq	%r14, %rdx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r8
	movl	$8, %r9d
	callq	_ipath_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_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdi
	callq	_ipath_sdma_descq_freecnt
	leal	(,%r12,4), %ecx
	cmpl	%ecx, %eax
	jge	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdi
	callq	_ipath_user_sdma_hwqueue_clean
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_ipath_user_sdma_queue_clean
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdi
	movq	%r15, %rsi
	leaq	-48(%rbp), %r14
	movq	%r14, %rdx
	callq	_ipath_user_sdma_push_pkts
	movq	%r15, %rbx
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	addl	%r15d, -52(%rbp)                ## 4-byte Folded Spill
	addl	%r15d, (%rbx)
	movq	%r14, %rdi
	callq	_list_empty
	testl	%eax, %eax
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_13
	jmp	LBB0_14
LBB0_3:
	xorl	%r15d, %r15d
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_14
LBB0_6:
	movl	%r12d, %r15d
LBB0_14:
	leaq	-48(%rbp), %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_16
## %bb.15:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rdi
	leaq	-48(%rbp), %rdx
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_ipath_user_sdma_free_pkt_list
LBB0_16:
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	testl	%r15d, %r15d
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmovsl	%r15d, %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	_ipath_user_sdma_writev         ; -- Begin function ipath_user_sdma_writev
	.p2align	2
_ipath_user_sdma_writev:                ; @ipath_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
	mov	x21, x0
	add	x0, sp, #8
	bl	_INIT_LIST_HEAD
	add	x20, x19, #4
	mov	x0, x20
	bl	_mutex_lock
	ldp	x8, x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_ipath_user_sdma_hwqueue_clean
	mov	x0, x21
	mov	x1, x19
	bl	_ipath_user_sdma_queue_clean
LBB0_2:
	cbz	x22, LBB0_12
; %bb.3:
	mov	w26, #0
Lloh0:
	adrp	x27, _current@GOTPAGE
Lloh1:
	ldr	x27, [x27, _current@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x24, x25
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	sub	x22, x22, w25, uxtw
	add	x23, x23, w25, uxtw #2
	cbz	x22, LBB0_14
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27]
	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	_ipath_user_sdma_queue_pkts
	mov	x25, x0
	ldr	x8, [x27]
	ldr	x0, [x8]
	bl	_up_write
	cmp	w25, #1
	b.lt	LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x0, sp, #8
	bl	_list_empty
	cbnz	w0, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x21
	bl	_ipath_sdma_descq_freecnt
	cmp	w0, w25, lsl #2
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x21
	bl	_ipath_user_sdma_hwqueue_clean
	mov	x0, x21
	mov	x1, x19
	bl	_ipath_user_sdma_queue_clean
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x19
	bl	_ipath_user_sdma_push_pkts
	mov	x24, x0
	tbnz	w0, #31, LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	add	w26, w24, w26
	ldr	w8, [x19]
	add	w8, w8, w24
	str	w8, [x19]
	add	x0, sp, #8
	bl	_list_empty
	cbnz	w0, LBB0_5
	b	LBB0_14
LBB0_12:
	mov	w24, #0
	mov	w26, #0
	b	LBB0_14
LBB0_13:
	mov	x24, x25
LBB0_14:
	add	x0, sp, #8
	bl	_list_empty
	cbnz	w0, LBB0_16
; %bb.15:
	ldr	x0, [x21, #16]
	add	x2, sp, #8
	mov	x1, x19
	bl	_ipath_user_sdma_free_pkt_list
LBB0_16:
	mov	x0, x20
	bl	_mutex_unlock
	cmp	w24, #0
	csel	w0, w24, w26, 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
