	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function DmaFill
_DmaFill:                               ## @DmaFill
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r12d
	movq	_Pico@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rcx), %rax
	movq	32(%rcx), %r13
	movzbl	15(%rax), %r14d
	xorl	%eax, %eax
	callq	_GetDmaLength
	movl	%eax, %r15d
	movq	_EL_VDPDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_SekCyclesDone
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	movl	%eax, %r8d
	callq	_elprintf
	movq	_Pico@GOTPCREL(%rip), %r9
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addl	%r15d, 24(%r9)
	orb	$2, 16(%r9)
	testw	%r14w, %r14w
	movb	%r12b, (%r13,%rdi)
	movl	$1, %eax
	cmovnel	%r15d, %eax
	movl	%r14d, %edx
	addl	%edi, %edx
	testl	%eax, %eax
	je	LBB0_25
## %bb.1:
	shrl	$8, %r12d
	cmpl	$32, %eax
	jb	LBB0_17
## %bb.3:
	cmpb	$1, %r14b
	jne	LBB0_17
## %bb.4:
	leal	-1(%rax), %ecx
	movl	$-2, %esi
	subl	%edi, %esi
	cmpw	%cx, %si
	jb	LBB0_17
## %bb.5:
	cmpl	$65535, %ecx                    ## imm = 0xFFFF
	ja	LBB0_17
## %bb.6:
	movl	%eax, %edi
	andl	$-32, %edi
	movl	%r14d, -60(%rbp)                ## 4-byte Spill
	movzwl	%r14w, %esi
	movl	%edi, %ecx
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	imull	%esi, %ecx
	movzbl	%r12b, %esi
	movd	%esi, %xmm0
	pxor	%xmm1, %xmm1
	pshufb	%xmm1, %xmm0
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	leal	-32(%rdi), %esi
	movl	%esi, %r11d
	shrl	$5, %r11d
	incl	%r11d
	movl	%r11d, %r10d
	andl	$3, %r10d
	xorl	%r15d, %r15d
	cmpl	$96, %esi
	jb	LBB0_9
## %bb.7:
	andl	$-4, %r11d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, %r8d
	shll	$6, %r8d
	addl	%edi, %r8d
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	addl	%esi, %r8d
	movl	%edi, %r9d
	shll	$7, %r9d
	movl	%edi, %ebx
	shll	$5, %ebx
	addl	%edi, %ebx
	addl	%esi, %ebx
	imull	$97, %edi, %edi
	addl	%esi, %edi
	xorl	%r15d, %r15d
	movzwl	%r9w, %esi
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movl	%edx, %r9d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movzwl	%r9w, %r14d
	movdqu	%xmm0, (%r13,%r14)
	movdqu	%xmm0, 16(%r13,%r14)
	movzwl	%bx, %esi
	movdqu	%xmm0, (%r13,%rsi)
	movdqu	%xmm0, 16(%r13,%rsi)
	movzwl	%r8w, %esi
	movdqu	%xmm0, (%r13,%rsi)
	movdqu	%xmm0, 16(%r13,%rsi)
	movzwl	%di, %esi
	movdqu	%xmm0, (%r13,%rsi)
	movdqu	%xmm0, 16(%r13,%rsi)
	subl	$-128, %r15d
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	addl	%esi, %r8d
	addl	%esi, %ebx
	addl	%esi, %edi
	addl	%esi, %r9d
	addl	$-4, %r11d
	jne	LBB0_8
LBB0_9:
	addl	%edx, %ecx
	testl	%r10d, %r10d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_12
## %bb.10:
	incl	%r15d
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	imull	%edx, %r15d
	addl	%r15d, %edi
	shll	$5, %edx
	movzwl	%dx, %edx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movzwl	%di, %esi
	addl	%edx, %edi
	movdqu	%xmm0, (%r13,%rsi)
	movdqu	%xmm0, 16(%r13,%rsi)
                                        ## kill: def $di killed $di killed $edi def $rdi
	decl	%r10d
	jne	LBB0_11
LBB0_12:
	cmpl	-72(%rbp), %eax                 ## 4-byte Folded Reload
	movq	_Pico@GOTPCREL(%rip), %r9
	jne	LBB0_15
## %bb.13:
	movl	%ecx, %edx
	jmp	LBB0_25
LBB0_17:
	movl	%edx, %ecx
LBB0_18:
	leal	-1(%rax), %r8d
	movl	%eax, %edx
	andl	$3, %edx
	je	LBB0_22
## %bb.19:
	xorl	%edi, %edi
	movzwl	%r14w, %ebx
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movzwl	%cx, %esi
	addl	%ebx, %ecx
	movb	%r12b, (%r13,%rsi)
                                        ## kill: def $cx killed $cx killed $ecx def $rcx
	incl	%edi
	cmpl	%edi, %edx
	jne	LBB0_20
## %bb.21:
	subl	%edi, %eax
LBB0_22:
	movl	%ecx, %edx
	cmpl	$3, %r8d
	jb	LBB0_25
## %bb.23:
	movzwl	%r14w, %esi
	leal	(%rsi,%rsi,2), %r8d
	leal	(%rsi,%rsi), %edx
	movzwl	%dx, %ebx
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movzwl	%cx, %edx
	movb	%r12b, (%r13,%rdx)
	leal	(%rcx,%rsi), %edx
	movzwl	%dx, %edi
	movb	%r12b, (%r13,%rdi)
	addl	%esi, %edx
	leal	(%rbx,%rcx), %edi
	movzwl	%di, %edi
	movb	%r12b, (%r13,%rdi)
	addl	%esi, %edx
	addl	%r8d, %ecx
	movzwl	%cx, %ecx
	movb	%r12b, (%r13,%rcx)
	addl	%esi, %edx
	movl	%edx, %ecx
	addl	$-4, %eax
	jne	LBB0_24
LBB0_25:
	movw	%dx, (%r9)
	movq	8(%r9), %rax
	movw	$0, 19(%rax)
	movq	_PDRAW_DIRTY_SPRITES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_rendstatus@GOTPCREL(%rip), %rcx
	orl	%eax, (%rcx)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	andl	$31, %eax
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_Pico,40,3                      ## @Pico
	.comm	_EL_VDPDMA,4,2                  ## @EL_VDPDMA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DmaFill len %i inc %i [%i]"

	.comm	_PDRAW_DIRTY_SPRITES,4,2        ## @PDRAW_DIRTY_SPRITES
	.comm	_rendstatus,4,2                 ## @rendstatus
	.no_dead_strip	_DmaFill
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function DmaFill
_DmaFill:                               ; @DmaFill
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
Lloh0:
	adrp	x23, _Pico@GOTPAGE
Lloh1:
	ldr	x23, [x23, _Pico@GOTPAGEOFF]
	ldrh	w25, [x23]
	ldr	x24, [x23, #32]
	ldr	x8, [x23, #8]
	ldrb	w19, [x8, #15]
	bl	_GetDmaLength
	mov	x21, x0
Lloh2:
	adrp	x8, _EL_VDPDMA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EL_VDPDMA@GOTPAGEOFF]
Lloh4:
	ldr	w22, [x8]
	bl	_SekCyclesDone
	mov	x4, x0
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	mov	x3, x19
	bl	_elprintf
	ldr	w8, [x23, #24]
	add	w8, w8, w21
	str	w8, [x23, #24]
	ldr	w8, [x23, #16]
	orr	w8, w8, #0x2
	str	w8, [x23, #16]
	strb	w20, [x24, x25]
	cmp	w19, #0
	csinc	w9, w21, wzr, ne
	add	w11, w25, w19
	mov	x8, x11
	cbz	w9, LBB0_8
; %bb.1:
	lsr	w10, w20, #8
	cmp	w9, #64
	b.lo	LBB0_7
; %bb.2:
	cmp	w19, #1
	b.ne	LBB0_7
; %bb.3:
	sub	w12, w9, #1
	mov	w13, #-2
	sub	w13, w13, w25
	and	w13, w13, #0xffff
	cmp	w13, w12, uxth
	lsr	w12, w12, #16
	ccmp	w12, #0, #0, hs
	b.ne	LBB0_7
; %bb.4:
	mov	w13, #0
	and	w12, w9, #0xffffffc0
	madd	w8, w12, w19, w11
	and	w14, w9, #0x3f
	dup.16b	v0, w10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mul	w15, w13, w19
	add	w15, w11, w15
	add	x15, x24, w15, uxth
	stp	q0, q0, [x15]
	stp	q0, q0, [x15, #32]
	add	w13, w13, #64
	cmp	w12, w13
	b.ne	LBB0_5
; %bb.6:
	cmp	w9, w12
	mov	x9, x14
	b.eq	LBB0_8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	and	x11, x8, #0xffff
	strb	w10, [x24, x11]
	add	w8, w8, w19
	subs	w9, w9, #1
	b.ne	LBB0_7
LBB0_8:
	strh	w8, [x23]
	ldr	x8, [x23, #8]
	sturh	wzr, [x8, #19]
Lloh7:
	adrp	x8, _PDRAW_DIRTY_SPRITES@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PDRAW_DIRTY_SPRITES@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _rendstatus@GOTPAGE
Lloh11:
	ldr	x9, [x9, _rendstatus@GOTPAGEOFF]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_Pico,40,3                      ; @Pico
	.comm	_EL_VDPDMA,4,2                  ; @EL_VDPDMA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DmaFill len %i inc %i [%i]"

	.comm	_PDRAW_DIRTY_SPRITES,4,2        ; @PDRAW_DIRTY_SPRITES
	.comm	_rendstatus,4,2                 ; @rendstatus
	.no_dead_strip	_DmaFill
.subsections_via_symbols
