	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxc_sdma_handle_channel_normal
_mxc_sdma_handle_channel_normal:        ## @mxc_sdma_handle_channel_normal
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	movq	8(%rdi), %r9
	movq	$0, 8(%r9)
	movl	(%r9), %ecx
	testl	%ecx, %ecx
	jle	LBB0_10
## %bb.1:
	movq	16(%r9), %r8
	movq	_BD_DONE@GOTPCREL(%rip), %rax
	movq	_BD_RROR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r11d
	orl	(%rax), %r11d
	movq	_EIO@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	subl	(%rdx), %ebx
	cmpl	$5, %ecx
	jae	LBB0_3
## %bb.2:
	xorl	%r10d, %r10d
	xorl	%edx, %edx
	jmp	LBB0_6
LBB0_3:
	movl	%ecx, %eax
	andl	$3, %eax
	testq	%rax, %rax
	movl	$4, %edx
	cmovneq	%rax, %rdx
	movq	%rcx, %r10
	subq	%rdx, %r10
	movd	%r11d, %xmm0
	pshufd	$80, %xmm0, %xmm9               ## xmm9 = xmm0[0,0,1,1]
	movd	%ebx, %xmm0
	pshufd	$80, %xmm0, %xmm6               ## xmm6 = xmm0[0,0,1,1]
	leaq	48(%r8), %rax
	pxor	%xmm8, %xmm8
	pxor	%xmm2, %xmm2
	movq	%r10, %rdx
	pxor	%xmm3, %xmm3
	xorps	%xmm7, %xmm7
	xorps	%xmm5, %xmm5
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movaps	%xmm5, %xmm4
	movaps	%xmm7, %xmm5
	movd	-48(%rax), %xmm0                ## xmm0 = mem[0],zero,zero,zero
	pinsrd	$1, -32(%rax), %xmm0
	movd	-16(%rax), %xmm1                ## xmm1 = mem[0],zero,zero,zero
	pinsrd	$1, (%rax), %xmm1
	pand	%xmm9, %xmm0
	pand	%xmm9, %xmm1
	pcmpeqd	%xmm8, %xmm0
	pcmpeqd	%xmm8, %xmm1
	movdqa	%xmm6, %xmm7
	blendvps	%xmm0, %xmm5, %xmm7
	movdqa	%xmm6, %xmm5
	movdqa	%xmm1, %xmm0
	blendvps	%xmm0, %xmm4, %xmm5
	movdqu	-40(%rax), %xmm0
	movdqu	-24(%rax), %xmm1
	punpcklqdq	%xmm1, %xmm0            ## xmm0 = xmm0[0],xmm1[0]
	paddq	%xmm0, %xmm2
	movdqu	-8(%rax), %xmm0
	movdqu	8(%rax), %xmm1
	punpcklqdq	%xmm1, %xmm0            ## xmm0 = xmm0[0],xmm1[0]
	paddq	%xmm0, %xmm3
	addq	$64, %rax
	addq	$-4, %rdx
	jne	LBB0_4
## %bb.5:
	pxor	%xmm0, %xmm0
	pcmpeqd	%xmm7, %xmm0
	blendvps	%xmm0, %xmm5, %xmm7
	movq	%xmm7, %rdx
	xorl	%eax, %eax
	testq	%rdx, %rdx
	cmovnel	%ebx, %eax
	paddq	%xmm2, %xmm3
	pshufd	$238, %xmm3, %xmm0              ## xmm0 = xmm3[2,3,2,3]
	paddq	%xmm3, %xmm0
	movq	%xmm0, %rdx
LBB0_6:
	subq	%r10, %rcx
	shlq	$4, %r10
	leaq	(%r8,%r10), %rsi
	addq	$8, %rsi
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r11d, -8(%rsi)
	cmovnel	%ebx, %eax
	addq	(%rsi), %rdx
	addq	$16, %rsi
	decq	%rcx
	jne	LBB0_7
## %bb.8:
	movq	%rdx, 8(%r9)
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movq	_DMA_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_DMA_COMPLETE@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	movl	%eax, (%rdi)
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BD_DONE,4,2                    ## @BD_DONE
	.comm	_BD_RROR,4,2                    ## @BD_RROR
	.comm	_EIO,4,2                        ## @EIO
	.comm	_DMA_ERROR,4,2                  ## @DMA_ERROR
	.comm	_DMA_COMPLETE,4,2               ## @DMA_COMPLETE
	.no_dead_strip	_mxc_sdma_handle_channel_normal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxc_sdma_handle_channel_normal
_mxc_sdma_handle_channel_normal:        ; @mxc_sdma_handle_channel_normal
	.cfi_startproc
; %bb.0:
	stp	d11, d10, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	.cfi_offset b8, -8
	.cfi_offset b9, -16
	.cfi_offset b10, -24
	.cfi_offset b11, -32
	ldr	x8, [x0, #8]
	str	xzr, [x8, #8]
	ldr	w11, [x8]
	cmp	w11, #1
	b.lt	LBB0_10
; %bb.1:
	ldr	x12, [x8, #16]
Lloh0:
	adrp	x9, _BD_DONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BD_DONE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _BD_RROR@GOTPAGE
Lloh4:
	ldr	x10, [x10, _BD_RROR@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh6:
	adrp	x10, _EIO@GOTPAGE
Lloh7:
	ldr	x10, [x10, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	neg	w10, w10
	cmp	w11, #9
	b.hs	LBB0_3
; %bb.2:
	mov	x13, #0
	mov	x15, #0
	mov	w14, #0
	b	LBB0_6
LBB0_3:
	ands	x13, x11, #0x7
	mov	w14, #8
	dup.2s	v4, w9
	dup.2s	v5, w10
	movi.2d	v0, #0000000000000000
	movi.2d	v1, #0000000000000000
	csel	x13, x14, x13, eq
	sub	x13, x11, x13
	add	x14, x12, #64
	mov	x15, x13
	movi.2d	v3, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v7, #0000000000000000
	movi.2d	v17, #0000000000000000
	movi.2d	v16, #0000000000000000
	movi.2d	v6, #0000000000000000
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	x16, x14, #64
	sub	x17, x14, #32
	ld4.2s	{ v18, v19, v20, v21 }, [x16]
	ld4.2s	{ v22, v23, v24, v25 }, [x17]
	mov	x16, x14
	ld4.2s	{ v26, v27, v28, v29 }, [x16], #32
	ld4.2s	{ v8, v9, v10, v11 }, [x16]
	and.8b	v18, v4, v18
	and.8b	v19, v4, v22
	and.8b	v20, v4, v26
	and.8b	v21, v4, v8
	cmeq.2s	v18, v18, #0
	cmeq.2s	v19, v19, #0
	cmeq.2s	v20, v20, #0
	cmeq.2s	v21, v21, #0
	bif.8b	v7, v5, v18
	sub	x16, x14, #56
	ld2.2d	{ v22, v23 }, [x16]
	bif.8b	v17, v5, v19
	sub	x16, x14, #24
	ld2.2d	{ v18, v19 }, [x16]
	bif.8b	v16, v5, v20
	add	x16, x14, #8
	ld2.2d	{ v24, v25 }, [x16]
	bif.8b	v6, v5, v21
	add	x16, x14, #40
	ld2.2d	{ v20, v21 }, [x16]
	add.2d	v0, v0, v22
	add.2d	v1, v1, v18
	add.2d	v3, v3, v24
	add.2d	v2, v2, v20
	add	x14, x14, #128
	subs	x15, x15, #8
	b.ne	LBB0_4
; %bb.5:
	cmeq.2s	v4, v7, #0
	bsl.8b	v4, v17, v7
	cmeq.2s	v5, v4, #0
	bit.8b	v4, v16, v5
	cmeq.2s	v5, v4, #0
	bit.8b	v4, v6, v5
	fmov	x14, d4
	cmp	x14, #0
	csel	w14, wzr, w10, eq
	add.2d	v0, v1, v0
	add.2d	v0, v3, v0
	add.2d	v0, v2, v0
	addp.2d	d0, v0
	fmov	x15, d0
LBB0_6:
	add	x12, x12, x13, lsl #4
	add	x12, x12, #8
	sub	x11, x11, x13
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w13, [x12, #-8]
	tst	w9, w13
	csel	w14, w14, w10, eq
	ldr	x13, [x12], #16
	add	x15, x15, x13
	subs	x11, x11, #1
	b.ne	LBB0_7
; %bb.8:
	str	x15, [x8, #8]
	cbz	w14, LBB0_10
; %bb.9:
Lloh9:
	adrp	x8, _DMA_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMA_ERROR@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh11:
	adrp	x8, _DMA_COMPLETE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DMA_COMPLETE@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	str	w8, [x0]
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_BD_DONE,4,2                    ; @BD_DONE
	.comm	_BD_RROR,4,2                    ; @BD_RROR
	.comm	_EIO,4,2                        ; @EIO
	.comm	_DMA_ERROR,4,2                  ; @DMA_ERROR
	.comm	_DMA_COMPLETE,4,2               ; @DMA_COMPLETE
	.no_dead_strip	_mxc_sdma_handle_channel_normal
.subsections_via_symbols
