	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mdc_tx_status
_mdc_tx_status:                         ## @mdc_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r13
	movq	%rdi, %rbx
	callq	_to_mdc_chan
	movq	%rax, %r12
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	callq	_dma_cookie_status
	movl	%eax, %r15d
	testq	%r14, %r14
	je	LBB0_5
## %bb.1:
	movq	_DMA_COMPLETE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	je	LBB0_5
## %bb.2:
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_vchan_find_desc
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rax, %rdi
	callq	_to_mdc_desc
	movq	(%rax), %rbx
	jmp	LBB0_4
LBB0_6:
	movq	8(%r12), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.7:
	cmpq	%r13, 32(%rax)
	jne	LBB0_13
## %bb.8:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_MDC_CMDS_PROCESSED@GOTPCREL(%rip), %r14
	movq	_MDC_CMDS_PROCESSED_INT_ACTIVE@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_mdc_chan_readl
	movl	(%r15), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	_MDC_ACTIVE_TRANSFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_mdc_chan_readl
	movl	%eax, %r13d
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_mdc_chan_readl
	movl	(%r15), %ecx
	notl	%ecx
	andl	%eax, %ecx
	cmpl	%ecx, %ebx
	jne	LBB0_9
## %bb.10:
	movq	_MDC_CMDS_PROCESSED_CMDS_DONE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%ebx, %eax
	sarl	%cl, %eax
	movq	_MDC_CMDS_PROCESSED_CMDS_DONE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	%esi, %eax
	movq	_MDC_CMDS_PROCESSED_CMDS_PROCESSED_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %ebx
	movq	_MDC_CMDS_PROCESSED_CMDS_PROCESSED_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	subl	%ebx, %eax
	incl	%esi
	cltd
	idivl	%esi
                                        ## kill: def $edx killed $edx def $rdx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, 24(%rax)
	je	LBB0_14
## %bb.11:
	movl	16(%rax), %ecx
	jmp	LBB0_15
LBB0_13:
	xorl	%ebx, %ebx
LBB0_4:
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_dma_set_residue
LBB0_5:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	$-1, %ecx
LBB0_15:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	leal	(%rcx,%rdx), %esi
	movq	(%rax), %rbx
	movq	8(%rax), %rax
	testl	%esi, %esi
	jle	LBB0_21
## %bb.16:
	addl	%ecx, %edx
	decl	%edx
	movl	%esi, %ecx
	andl	$3, %ecx
	cmpl	$3, %edx
	jb	LBB0_19
## %bb.17:
	andl	$-4, %esi
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movslq	(%rax), %rdx
	movq	8(%rax), %rax
	movslq	(%rax), %rdi
	addq	%rdx, %rdi
	movq	8(%rax), %rax
	movslq	(%rax), %rdx
	addq	%rdi, %rdx
	movq	8(%rax), %rax
	movslq	(%rax), %rdi
	addq	%rdi, %rdx
	addq	$3, %rdx
	notq	%rdx
	addq	%rdx, %rbx
	movq	8(%rax), %rax
	addl	$-4, %esi
	jne	LBB0_18
LBB0_19:
	testl	%ecx, %ecx
	je	LBB0_21
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movslq	(%rax), %rdx
	notq	%rdx
	addq	%rdx, %rbx
	movq	8(%rax), %rax
	decl	%ecx
	jne	LBB0_20
LBB0_21:
	testq	%rax, %rax
	je	LBB0_4
## %bb.22:
	movq	_MDC_TRANSFER_SIZE_MASK@GOTPCREL(%rip), %rcx
	movslq	(%rax), %rax
	cmpl	(%rcx), %r13d
	jne	LBB0_24
## %bb.23:
	notq	%rax
	addq	%rax, %rbx
	jmp	LBB0_4
LBB0_24:
	subl	%r13d, %eax
	cltq
	subq	%rax, %rbx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_COMPLETE,4,2               ## @DMA_COMPLETE
	.comm	_MDC_CMDS_PROCESSED,4,2         ## @MDC_CMDS_PROCESSED
	.comm	_MDC_CMDS_PROCESSED_INT_ACTIVE,4,2 ## @MDC_CMDS_PROCESSED_INT_ACTIVE
	.comm	_MDC_ACTIVE_TRANSFER_SIZE,4,2   ## @MDC_ACTIVE_TRANSFER_SIZE
	.comm	_MDC_CMDS_PROCESSED_CMDS_DONE_SHIFT,4,2 ## @MDC_CMDS_PROCESSED_CMDS_DONE_SHIFT
	.comm	_MDC_CMDS_PROCESSED_CMDS_DONE_MASK,4,2 ## @MDC_CMDS_PROCESSED_CMDS_DONE_MASK
	.comm	_MDC_CMDS_PROCESSED_CMDS_PROCESSED_SHIFT,4,2 ## @MDC_CMDS_PROCESSED_CMDS_PROCESSED_SHIFT
	.comm	_MDC_CMDS_PROCESSED_CMDS_PROCESSED_MASK,4,2 ## @MDC_CMDS_PROCESSED_CMDS_PROCESSED_MASK
	.comm	_MDC_TRANSFER_SIZE_MASK,4,2     ## @MDC_TRANSFER_SIZE_MASK
	.no_dead_strip	_mdc_tx_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mdc_tx_status
_mdc_tx_status:                         ; @mdc_tx_status
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x2
	mov	x22, x1
	mov	x20, x0
	bl	_to_mdc_chan
	mov	x21, x0
	mov	x0, x20
	mov	x1, x22
	mov	x2, x19
	bl	_dma_cookie_status
	mov	x20, x0
	cbz	x19, LBB0_17
; %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_17
; %bb.2:
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x21
	mov	x1, x22
	bl	_vchan_find_desc
	cbz	x0, LBB0_4
; %bb.3:
	bl	_to_mdc_desc
	ldr	x23, [x0]
	b	LBB0_16
LBB0_4:
	ldr	x24, [x21, #8]
	cbz	x24, LBB0_10
; %bb.5:
	ldr	x8, [x24, #32]
	cmp	x8, x22
	b.ne	LBB0_10
; %bb.6:
Lloh3:
	adrp	x25, _MDC_CMDS_PROCESSED@GOTPAGE
Lloh4:
	ldr	x25, [x25, _MDC_CMDS_PROCESSED@GOTPAGEOFF]
Lloh5:
	adrp	x26, _MDC_CMDS_PROCESSED_INT_ACTIVE@GOTPAGE
Lloh6:
	ldr	x26, [x26, _MDC_CMDS_PROCESSED_INT_ACTIVE@GOTPAGEOFF]
Lloh7:
	adrp	x27, _MDC_ACTIVE_TRANSFER_SIZE@GOTPAGE
Lloh8:
	ldr	x27, [x27, _MDC_ACTIVE_TRANSFER_SIZE@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	x0, x21
	bl	_mdc_chan_readl
	ldr	w8, [x26]
	bic	w23, w0, w8
	ldr	w1, [x27]
	mov	x0, x21
	bl	_mdc_chan_readl
	mov	x22, x0
	ldr	w1, [x25]
	mov	x0, x21
	bl	_mdc_chan_readl
	ldr	w8, [x26]
	bic	w8, w0, w8
	cmp	w23, w8
	b.ne	LBB0_7
; %bb.8:
Lloh9:
	adrp	x8, _MDC_CMDS_PROCESSED_CMDS_DONE_SHIFT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MDC_CMDS_PROCESSED_CMDS_DONE_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	asr	w8, w23, w8
Lloh12:
	adrp	x9, _MDC_CMDS_PROCESSED_CMDS_DONE_MASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MDC_CMDS_PROCESSED_CMDS_DONE_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _MDC_CMDS_PROCESSED_CMDS_PROCESSED_SHIFT@GOTPAGE
Lloh16:
	ldr	x10, [x10, _MDC_CMDS_PROCESSED_CMDS_PROCESSED_SHIFT@GOTPAGEOFF]
	and	w8, w8, w9
Lloh17:
	ldr	w10, [x10]
	asr	w10, w23, w10
Lloh18:
	adrp	x11, _MDC_CMDS_PROCESSED_CMDS_PROCESSED_MASK@GOTPAGE
Lloh19:
	ldr	x11, [x11, _MDC_CMDS_PROCESSED_CMDS_PROCESSED_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w11, [x11]
	and	w10, w10, w11
	sub	w8, w8, w10
	add	w9, w9, #1
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
	ldr	w9, [x24, #24]
	cbz	w9, LBB0_11
; %bb.9:
	ldr	w9, [x24, #16]
	b	LBB0_12
LBB0_10:
	mov	x23, #0
	b	LBB0_16
LBB0_11:
	mov	w9, #-1
LBB0_12:
	add	w9, w9, w8
	ldp	x23, x8, [x24]
	cmp	w9, #1
	b.lt	LBB0_14
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldrsw	x10, [x8]
	mvn	x10, x10
	add	x23, x10, x23
	ldr	x8, [x8, #8]
	subs	w9, w9, #1
	b.ne	LBB0_13
LBB0_14:
	cbz	x8, LBB0_16
; %bb.15:
Lloh21:
	adrp	x9, _MDC_TRANSFER_SIZE_MASK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _MDC_TRANSFER_SIZE_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	ldrsw	x8, [x8]
	mvn	x10, x8
	add	x10, x10, x23
	sub	w8, w8, w22
	sub	x8, x23, w8, sxtw
	cmp	w22, w9
	csel	x23, x10, x8, eq
LBB0_16:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	mov	x1, x23
	bl	_dma_set_residue
LBB0_17:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_COMPLETE,4,2               ; @DMA_COMPLETE
	.comm	_MDC_CMDS_PROCESSED,4,2         ; @MDC_CMDS_PROCESSED
	.comm	_MDC_CMDS_PROCESSED_INT_ACTIVE,4,2 ; @MDC_CMDS_PROCESSED_INT_ACTIVE
	.comm	_MDC_ACTIVE_TRANSFER_SIZE,4,2   ; @MDC_ACTIVE_TRANSFER_SIZE
	.comm	_MDC_CMDS_PROCESSED_CMDS_DONE_SHIFT,4,2 ; @MDC_CMDS_PROCESSED_CMDS_DONE_SHIFT
	.comm	_MDC_CMDS_PROCESSED_CMDS_DONE_MASK,4,2 ; @MDC_CMDS_PROCESSED_CMDS_DONE_MASK
	.comm	_MDC_CMDS_PROCESSED_CMDS_PROCESSED_SHIFT,4,2 ; @MDC_CMDS_PROCESSED_CMDS_PROCESSED_SHIFT
	.comm	_MDC_CMDS_PROCESSED_CMDS_PROCESSED_MASK,4,2 ; @MDC_CMDS_PROCESSED_CMDS_PROCESSED_MASK
	.comm	_MDC_TRANSFER_SIZE_MASK,4,2     ; @MDC_TRANSFER_SIZE_MASK
	.no_dead_strip	_mdc_tx_status
.subsections_via_symbols
