	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mga_dma_dispatch_swap
_mga_dma_dispatch_swap:                 ## @mga_dma_dispatch_swap
	.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	(%rdi), %r12
	movq	24(%r12), %rbx
	movq	16(%rbx), %r15
	movl	(%rbx), %r14d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movl	20(%r12), %eax
	movl	%eax, 8(%rbx)
	movl	16(%r12), %eax
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, 4(%rbx)
	leal	4(%r14), %edi
	callq	_BEGIN_DMA
	movq	_MGA_DMAPAD@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	movq	_MGA_DWGSYNC@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	xorl	%esi, %esi
	movq	%rdi, %rdx
	xorl	%ecx, %ecx
	movl	$28928, %r9d                    ## imm = 0x7100
	pushq	$28672                          ## imm = 0x7000
	pushq	%r8
	callq	_DMA_BLOCK
	addq	$16, %rsp
	movq	_MGA_DSTORG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_MGA_MACCESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	(%r12), %esi
	movl	4(%r12), %ecx
	movq	_MGA_SRCORG@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movl	8(%r12), %r9d
	movq	_MGA_AR5@GOTPCREL(%rip), %rax
	movl	12(%r12), %ebx
	pushq	%rbx
	pushq	(%rax)
	callq	_DMA_BLOCK
	addq	$16, %rsp
	movq	(%r13), %rdi
	movq	_MGA_PLNWT@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	_MGA_DWGCTL@GOTPCREL(%rip), %rbx
	movq	_MGA_DWGCTL_COPY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%esi, %esi
	movq	%rdi, %rdx
	xorl	%ecx, %ecx
	movl	$-1, %r9d
	pushq	%rax
	pushq	(%rbx)
	callq	_DMA_BLOCK
	addq	$16, %rsp
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	testl	%r14d, %r14d
	jle	LBB0_3
## %bb.1:
	shlq	$4, -48(%rbp)                   ## 8-byte Folded Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%r14), %r8d
	movl	4(%r15,%r14), %edx
	movq	%r15, %rbx
	movl	%r8d, %r15d
	subl	%edx, %r15d
	movq	%r12, %r13
	movl	12(%r12), %r12d
	imull	%edx, %r12d
	movl	8(%rbx,%r14), %esi
	movl	12(%rbx,%r14), %ecx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	_MGA_AR0@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	12(%rbx,%r14), %r9d
	leal	(%r12,%r9), %esi
	decl	%esi
	movq	_MGA_AR3@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	4(%rbx,%r14), %eax
	movl	8(%rbx,%r14), %ecx
	addl	%ecx, %r12d
	shll	$16, %r9d
	addl	$-65536, %r9d                   ## imm = 0xFFFF0000
	orl	%ecx, %r9d
	movq	_MGA_FXBNDRY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r8
	shll	$16, %eax
	orl	%r15d, %eax
	movq	%rbx, %r15
	movq	_MGA_EXEC@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	movq	_MGA_YDSTLEN@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rbx
	movl	%r12d, %ecx
	movq	%r13, %r12
                                        ## kill: def $r9d killed $r9d killed $r9
	pushq	%rax
	pushq	%rbx
	callq	_DMA_BLOCK
	addq	$16, %rsp
	addq	$16, %r14
	cmpq	%r14, -48(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_2
LBB0_3:
	movq	_MGA_DMAPAD@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_MGA_PLNWT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_MGA_SRCORG@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movl	(%r12), %r9d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	24(%rax), %ecx
	movl	28(%rax), %eax
	xorl	%esi, %esi
	pushq	%rax
	movq	_MGA_DWGCTL@GOTPCREL(%rip), %rax
	pushq	(%rax)
	callq	_DMA_BLOCK
	addq	$16, %rsp
	xorl	%eax, %eax
	callq	_ADVANCE_DMA
	xorl	%eax, %eax
	callq	_FLUSH_DMA
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_DEBUG                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_LOCALS,4,2                 ## @DMA_LOCALS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_MGA_DMAPAD,8,3                 ## @MGA_DMAPAD
	.comm	_MGA_DWGSYNC,8,3                ## @MGA_DWGSYNC
	.comm	_MGA_DSTORG,8,3                 ## @MGA_DSTORG
	.comm	_MGA_MACCESS,8,3                ## @MGA_MACCESS
	.comm	_MGA_SRCORG,8,3                 ## @MGA_SRCORG
	.comm	_MGA_AR5,8,3                    ## @MGA_AR5
	.comm	_MGA_PLNWT,8,3                  ## @MGA_PLNWT
	.comm	_MGA_DWGCTL,8,3                 ## @MGA_DWGCTL
	.comm	_MGA_DWGCTL_COPY,4,2            ## @MGA_DWGCTL_COPY
L_.str.1:                               ## @.str.1
	.asciz	"   from=%d,%d to=%d,%d\n"

	.comm	_MGA_AR0,8,3                    ## @MGA_AR0
	.comm	_MGA_AR3,8,3                    ## @MGA_AR3
	.comm	_MGA_FXBNDRY,8,3                ## @MGA_FXBNDRY
	.comm	_MGA_YDSTLEN,8,3                ## @MGA_YDSTLEN
	.comm	_MGA_EXEC,8,3                   ## @MGA_EXEC
L_.str.2:                               ## @.str.2
	.asciz	"... done.\n"

	.no_dead_strip	_mga_dma_dispatch_swap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mga_dma_dispatch_swap
_mga_dma_dispatch_swap:                 ; @mga_dma_dispatch_swap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	ldr	x20, [x0]
	ldr	x21, [x20, #24]
	ldr	x19, [x21, #16]
	ldr	w22, [x21]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	ldr	d0, [x20, #16]
	str	x21, [sp, #40]                  ; 8-byte Folded Spill
	stur	d0, [x21, #4]
	add	w0, w22, #4
	bl	_BEGIN_DMA
Lloh2:
	adrp	x21, _MGA_DMAPAD@GOTPAGE
Lloh3:
	ldr	x21, [x21, _MGA_DMAPAD@GOTPAGEOFF]
	ldr	x0, [x21]
Lloh4:
	adrp	x8, _MGA_DWGSYNC@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MGA_DWGSYNC@GOTPAGEOFF]
Lloh6:
	ldr	x4, [x8]
	mov	w1, #0
	mov	x2, x0
	mov	w3, #0
	mov	w5, #28928
	mov	x6, x4
	mov	w7, #28672
	bl	_DMA_BLOCK
Lloh7:
	adrp	x8, _MGA_DSTORG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MGA_DSTORG@GOTPAGEOFF]
Lloh9:
	adrp	x9, _MGA_MACCESS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MGA_MACCESS@GOTPAGEOFF]
Lloh11:
	ldr	x0, [x8]
Lloh12:
	ldr	x2, [x9]
	ldp	w1, w3, [x20]
Lloh13:
	adrp	x8, _MGA_SRCORG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MGA_SRCORG@GOTPAGEOFF]
Lloh15:
	ldr	x4, [x8]
Lloh16:
	adrp	x8, _MGA_AR5@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MGA_AR5@GOTPAGEOFF]
Lloh18:
	ldr	x6, [x8]
	ldp	w5, w7, [x20, #8]
	bl	_DMA_BLOCK
	ldr	x0, [x21]
Lloh19:
	adrp	x8, _MGA_PLNWT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MGA_PLNWT@GOTPAGEOFF]
Lloh21:
	ldr	x4, [x8]
Lloh22:
	adrp	x8, _MGA_DWGCTL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MGA_DWGCTL@GOTPAGEOFF]
Lloh24:
	ldr	x6, [x8]
Lloh25:
	adrp	x8, _MGA_DWGCTL_COPY@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MGA_DWGCTL_COPY@GOTPAGEOFF]
Lloh27:
	ldr	w7, [x8]
	mov	w1, #0
	mov	x2, x0
	mov	w3, #0
	mov	w5, #-1
	bl	_DMA_BLOCK
	cmp	w22, #1
	b.lt	LBB0_3
; %bb.1:
	add	x27, x19, #8
Lloh28:
	adrp	x24, _MGA_AR3@GOTPAGE
Lloh29:
	ldr	x24, [x24, _MGA_AR3@GOTPAGEOFF]
Lloh30:
	adrp	x19, l_.str.1@PAGE
Lloh31:
	add	x19, x19, l_.str.1@PAGEOFF
Lloh32:
	adrp	x25, _MGA_FXBNDRY@GOTPAGE
Lloh33:
	ldr	x25, [x25, _MGA_FXBNDRY@GOTPAGEOFF]
Lloh34:
	adrp	x23, _MGA_YDSTLEN@GOTPAGE
Lloh35:
	ldr	x23, [x23, _MGA_YDSTLEN@GOTPAGEOFF]
Lloh36:
	adrp	x26, _MGA_EXEC@GOTPAGE
Lloh37:
	ldr	x26, [x26, _MGA_EXEC@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w8, w9, [x27, #-8]
	sub	w21, w8, w9
	ldr	w10, [x20, #12]
	mul	w28, w10, w9
	ldp	w10, w11, [x27]
	stp	x11, x8, [sp, #16]
	stp	x10, x9, [sp]
	mov	x0, x19
	bl	_DRM_DEBUG
Lloh38:
	adrp	x8, _MGA_AR0@GOTPAGE
Lloh39:
	ldr	x8, [x8, _MGA_AR0@GOTPAGEOFF]
Lloh40:
	ldr	x0, [x8]
	ldp	w9, w8, [x27]
	add	w10, w28, w8
	sub	w1, w10, #1
	ldr	x2, [x24]
	add	w3, w9, w28
	ldr	x4, [x25]
	lsl	w8, w8, #16
	sub	w8, w8, #16, lsl #12            ; =65536
	orr	w5, w8, w9
	ldr	x8, [x23]
	ldr	x9, [x26]
	add	x6, x9, x8
	ldur	w8, [x27, #-4]
	orr	w7, w21, w8, lsl #16
	bl	_DMA_BLOCK
	add	x27, x27, #16
	subs	x22, x22, #1
	b.ne	LBB0_2
LBB0_3:
Lloh41:
	adrp	x8, _MGA_DMAPAD@GOTPAGE
Lloh42:
	ldr	x8, [x8, _MGA_DMAPAD@GOTPAGEOFF]
Lloh43:
	ldr	x0, [x8]
Lloh44:
	adrp	x8, _MGA_PLNWT@GOTPAGE
Lloh45:
	ldr	x8, [x8, _MGA_PLNWT@GOTPAGEOFF]
Lloh46:
	ldr	x2, [x8]
Lloh47:
	adrp	x8, _MGA_SRCORG@GOTPAGE
Lloh48:
	ldr	x8, [x8, _MGA_SRCORG@GOTPAGEOFF]
Lloh49:
	ldr	x4, [x8]
	ldr	w5, [x20]
Lloh50:
	adrp	x8, _MGA_DWGCTL@GOTPAGE
Lloh51:
	ldr	x8, [x8, _MGA_DWGCTL@GOTPAGEOFF]
Lloh52:
	ldr	x6, [x8]
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	ldp	w3, w7, [x8, #24]
	mov	w1, #0
	bl	_DMA_BLOCK
	bl	_ADVANCE_DMA
	bl	_FLUSH_DMA
Lloh53:
	adrp	x0, l_.str.2@PAGE
Lloh54:
	add	x0, x0, l_.str.2@PAGEOFF
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_DRM_DEBUG
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_LOCALS,4,2                 ; @DMA_LOCALS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_MGA_DMAPAD,8,3                 ; @MGA_DMAPAD
	.comm	_MGA_DWGSYNC,8,3                ; @MGA_DWGSYNC
	.comm	_MGA_DSTORG,8,3                 ; @MGA_DSTORG
	.comm	_MGA_MACCESS,8,3                ; @MGA_MACCESS
	.comm	_MGA_SRCORG,8,3                 ; @MGA_SRCORG
	.comm	_MGA_AR5,8,3                    ; @MGA_AR5
	.comm	_MGA_PLNWT,8,3                  ; @MGA_PLNWT
	.comm	_MGA_DWGCTL,8,3                 ; @MGA_DWGCTL
	.comm	_MGA_DWGCTL_COPY,4,2            ; @MGA_DWGCTL_COPY
l_.str.1:                               ; @.str.1
	.asciz	"   from=%d,%d to=%d,%d\n"

	.comm	_MGA_AR0,8,3                    ; @MGA_AR0
	.comm	_MGA_AR3,8,3                    ; @MGA_AR3
	.comm	_MGA_FXBNDRY,8,3                ; @MGA_FXBNDRY
	.comm	_MGA_YDSTLEN,8,3                ; @MGA_YDSTLEN
	.comm	_MGA_EXEC,8,3                   ; @MGA_EXEC
l_.str.2:                               ; @.str.2
	.asciz	"... done.\n"

	.no_dead_strip	_mga_dma_dispatch_swap
.subsections_via_symbols
