	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uniphier_mdmac_tx_status
_uniphier_mdmac_tx_status:              ## @uniphier_mdmac_tx_status
	.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	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_dma_cookie_status
	testq	%r13, %r13
	je	LBB0_11
## %bb.1:
	movq	_DMA_COMPLETE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_11
## %bb.2:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_to_virt_chan
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	callq	_to_uniphier_mdmac_chan
	movq	%rax, %rbx
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	cmpq	%r12, 16(%rax)
	jne	LBB0_5
## %bb.4:
	movq	_UNIPHIER_MDMAC_CH_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movl	%eax, (%r13)
	movq	(%rbx), %r14
	testq	%r14, %r14
	jne	LBB0_7
LBB0_5:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_vchan_find_desc
	testq	%rax, %rax
	je	LBB0_10
## %bb.6:
	movq	%rax, %rdi
	callq	_to_uniphier_mdmac_desc
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_10
LBB0_7:
	movslq	(%r14), %r12
	cmpl	4(%r14), %r12d
	jge	LBB0_10
## %bb.8:
	leaq	(,%r12,4), %rbx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rdi
	addq	%rbx, %rdi
	callq	_sg_dma_len
	addl	%eax, (%r13)
	incq	%r12
	movslq	4(%r14), %rax
	addq	$4, %rbx
	cmpq	%rax, %r12
	jl	LBB0_9
LBB0_10:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	-44(%rbp), %eax                 ## 4-byte Reload
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_COMPLETE,4,2               ## @DMA_COMPLETE
	.comm	_UNIPHIER_MDMAC_CH_SIZE,8,3     ## @UNIPHIER_MDMAC_CH_SIZE
	.no_dead_strip	_uniphier_mdmac_tx_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uniphier_mdmac_tx_status
_uniphier_mdmac_tx_status:              ; @uniphier_mdmac_tx_status
	.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, x2
	mov	x22, x1
	mov	x21, x0
	bl	_dma_cookie_status
	mov	x20, x0
	cbz	x19, LBB0_11
; %bb.1:
Lloh0:
	adrp	x8, _DMA_COMPLETE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_COMPLETE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w20, w8
	b.eq	LBB0_11
; %bb.2:
	mov	x0, x21
	bl	_to_virt_chan
	mov	x21, x0
	bl	_spin_lock_irqsave
	mov	x0, x21
	bl	_to_uniphier_mdmac_chan
	ldr	x8, [x0]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x8, [x8, #16]
	cmp	x8, x22
	b.ne	LBB0_5
; %bb.4:
	mov	x23, x0
	ldr	x8, [x0, #8]
Lloh3:
	adrp	x9, _UNIPHIER_MDMAC_CH_SIZE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _UNIPHIER_MDMAC_CH_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	str	w0, [x19]
	ldr	x23, [x23]
	cbnz	x23, LBB0_7
LBB0_5:
	mov	x0, x21
	mov	x1, x22
	bl	_vchan_find_desc
	cbz	x0, LBB0_10
; %bb.6:
	bl	_to_uniphier_mdmac_desc
	mov	x23, x0
	cbz	x0, LBB0_10
LBB0_7:
	ldp	w22, w8, [x23]
                                        ; kill: def $w22 killed $w22 def $x22
	sxtw	x22, w22
	cmp	w22, w8
	b.ge	LBB0_10
; %bb.8:
	lsl	x24, x22, #2
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #8]
	add	x0, x8, x24
	bl	_sg_dma_len
	ldr	w8, [x19]
	add	w8, w8, w0
	str	w8, [x19]
	add	x22, x22, #1
	ldrsw	x8, [x23, #4]
	add	x24, x24, #4
	cmp	x22, x8
	b.lt	LBB0_9
LBB0_10:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
LBB0_11:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_COMPLETE,4,2               ; @DMA_COMPLETE
	.comm	_UNIPHIER_MDMAC_CH_SIZE,8,3     ; @UNIPHIER_MDMAC_CH_SIZE
	.no_dead_strip	_uniphier_mdmac_tx_status
.subsections_via_symbols
