	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_flush_descq
_sdma_flush_descq:                      ## @sdma_flush_descq
	.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, %r15
	callq	_get_txhead
	movq	%rax, %r12
	movl	(%r15), %ebx
	movl	4(%r15), %eax
	movl	%eax, %ecx
	andl	%ebx, %ecx
	movl	8(%r15), %r14d
	andl	%eax, %r14d
	cmpl	%r14d, %ecx
	jne	LBB0_1
## %bb.9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_SDMA_TXREQ_S_ABORTED@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	movl	%ebx, (%r15)
	andl	%eax, %ebx
	testq	%r12, %r12
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%ebx, (%r12)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r15), %rcx
	movl	12(%r15), %edx
	leal	1(%rdx), %esi
	movl	%esi, 12(%r15)
	andl	%edx, %eax
	cltq
	movq	$0, (%rcx,%rax,8)
	movl	(%r13), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_complete_tx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	movq	%r12, %rcx
	callq	_trace_hfi1_sdma_progress
	movq	%r15, %rdi
	callq	_get_txhead
	movq	%rax, %r12
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r12d, %r12d
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%r14d, %ebx
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %ebx
	movl	4(%r15), %eax
	jmp	LBB0_2
LBB0_8:
	movq	%r15, %rdi
	callq	_sdma_descq_freecnt
	movq	%r15, %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sdma_desc_avail                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SDMA_TXREQ_S_ABORTED,4,2       ## @SDMA_TXREQ_S_ABORTED
	.no_dead_strip	_sdma_flush_descq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdma_flush_descq
_sdma_flush_descq:                      ; @sdma_flush_descq
	.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
	mov	x19, x0
	bl	_get_txhead
	ldp	w9, w8, [x19]
	and	w10, w8, w9
	ldr	w11, [x19, #8]
	and	w20, w11, w8
	cmp	w10, w20
	b.ne	LBB0_2
; %bb.1:
	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
LBB0_2:
	mov	x21, x0
Lloh0:
	adrp	x23, _SDMA_TXREQ_S_ABORTED@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SDMA_TXREQ_S_ABORTED@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	w9, w9, #1
	str	w9, [x19]
	and	w22, w8, w9
	cbz	x21, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x21]
	cmp	w9, w22
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x19, #16]
	ldr	w10, [x19, #12]
	add	w11, w10, #1
	str	w11, [x19, #12]
	and	w8, w10, w8
	str	xzr, [x9, w8, sxtw #3]
	ldr	w2, [x23]
	mov	x0, x19
	mov	x1, x21
	bl	_complete_tx
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	mov	x3, x21
	bl	_trace_hfi1_sdma_progress
	mov	x0, x19
	bl	_get_txhead
	mov	x21, x0
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w22, w20
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldp	w9, w8, [x19]
	b	LBB0_3
LBB0_8:
	mov	x0, x19
	bl	_sdma_descq_freecnt
	mov	x1, x0
	mov	x0, x19
	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
	b	_sdma_desc_avail
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SDMA_TXREQ_S_ABORTED,4,2       ; @SDMA_TXREQ_S_ABORTED
	.no_dead_strip	_sdma_flush_descq
.subsections_via_symbols
