	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_map_blit_for_device
_via_map_blit_for_device:               ## @via_map_blit_for_device
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, -144(%rbp)                ## 8-byte Spill
	movq	(%rsi), %rbx
	movq	%rbx, %rdi
	callq	_VIA_PGDN
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	movq	_VIA_DMA_DPR_EC@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	cmpl	$1, %r14d
	jne	LBB0_1
## %bb.2:
	movq	16(%r15), %rcx
	movq	(%rcx), %rcx
	jmp	LBB0_3
LBB0_1:
	xorl	%ecx, %ecx
LBB0_3:
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	12(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_16
## %bb.4:
	movl	8(%r12), %esi
	xorl	%edi, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r15, -104(%rbp)                ## 8-byte Spill
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movq	%r12, -120(%rbp)                ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-120(%rbp), %r12                ## 8-byte Reload
	movl	12(%r12), %eax
	movq	-104(%rbp), %r15                ## 8-byte Reload
	movq	-128(%rbp), %rbx                ## 8-byte Reload
	movl	-88(%rbp), %esi                 ## 4-byte Reload
	movl	-84(%rbp), %edi                 ## 4-byte Reload
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movslq	32(%r12), %rcx
	addq	%rcx, %rbx
	addl	24(%r12), %esi
	incl	%edi
	cmpl	%eax, %edi
	jge	LBB0_16
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	16(%r12), %r13
	testq	%r13, %r13
	je	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%edi, -84(%rbp)                 ## 4-byte Spill
	movl	%esi, -88(%rbp)                 ## 4-byte Spill
	movl	%esi, %r15d
	movq	%rbx, -128(%rbp)                ## 8-byte Spill
	movq	%rbx, %r12
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=2
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=2
	incl	%edx
	addq	%rax, %r12
	addl	%r13d, %r15d
	movq	-152(%rbp), %r13                ## 8-byte Reload
	testq	%r13, %r13
	je	LBB0_14
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r12, %rdi
	callq	_VIA_PGOFF
	subq	%rax, %rbx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_min
	movq	%r13, %rcx
	movl	%eax, %r13d
	movl	%eax, %eax
	subq	%rax, %rcx
	movq	%rcx, -152(%rbp)                ## 8-byte Spill
	cmpl	$1, %r14d
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	-104(%rbp), %r14                ## 8-byte Reload
	movq	32(%r14), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_VIA_PFN
	movq	%rax, %rbx
	movq	-136(%rbp), %rdi                ## 8-byte Reload
	callq	_VIA_PFN
	subq	%rax, %rbx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%rbx,4), %eax
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	callq	_VIA_PGOFF
	movl	24(%r14), %r8d
	movq	-144(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	movl	-72(%rbp), %esi                 ## 4-byte Reload
	movq	%rax, %rdx
	movl	%r13d, %ecx
	callq	_dma_map_page
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, 12(%rdx)
	movl	%r15d, (%rdx)
	movl	%r13d, 4(%rdx)
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%rdx)
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%rdx, %rbx
	movq	%rdx, %rsi
	movl	$16, %edx
	callq	_dma_map_single
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	cmpl	(%r14), %eax
	jae	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=2
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	addq	$16, %rbx
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=2
	movq	16(%r14), %rax
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	incl	%ecx
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movq	(%rax,%rcx,8), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=2
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	-112(%rbp), %rax                ## 8-byte Reload
	jmp	LBB0_13
LBB0_16:
	cmpl	$1, %r14d
	jne	LBB0_18
## %bb.17:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%r15)
	movq	_dr_via_device_mapped@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
LBB0_18:
	movl	%edx, 8(%r15)
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIA_DMA_DPR_EC,4,2             ## @VIA_DMA_DPR_EC
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_dr_via_device_mapped,4,2       ## @dr_via_device_mapped
	.no_dead_strip	_via_map_blit_for_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_map_blit_for_device
_via_map_blit_for_device:               ; @via_map_blit_for_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x20, x3
	mov	x19, x2
	mov	x21, x1
	str	x0, [sp, #48]                   ; 8-byte Folded Spill
	ldr	x28, [x1]
	mov	x0, x28
	bl	_VIA_PGDN
	str	x0, [sp, #40]                   ; 8-byte Folded Spill
Lloh0:
	adrp	x8, _VIA_DMA_DPR_EC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIA_DMA_DPR_EC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w20, #1
	str	w8, [sp, #60]                   ; 4-byte Folded Spill
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x19, #16]
	ldr	x26, [x8]
	b	LBB0_3
LBB0_2:
	mov	x26, #0
LBB0_3:
	ldr	w8, [x21, #12]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.4:
	mov	w10, #0
	mov	w25, #0
	stp	wzr, w20, [sp, #32]             ; 8-byte Folded Spill
	str	wzr, [sp, #56]                  ; 4-byte Folded Spill
	ldr	w22, [x21, #8]
	str	x21, [sp, #8]                   ; 8-byte Folded Spill
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x21, [sp, #8]                   ; 8-byte Folded Reload
	ldr	w8, [x21, #12]
	ldr	x28, [sp, #24]                  ; 8-byte Folded Reload
	ldp	w22, w10, [sp, #16]             ; 8-byte Folded Reload
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldrsw	x9, [x21, #32]
	add	x28, x28, x9
	ldr	w9, [x21, #24]
	add	w22, w22, w9
	add	w10, w10, #1
	cmp	w10, w8
	b.ge	LBB0_16
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	ldr	x27, [x21, #16]
	cbz	x27, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	stp	w22, w10, [sp, #16]             ; 8-byte Folded Spill
	str	x28, [sp, #24]                  ; 8-byte Folded Spill
	b	LBB0_12
LBB0_9:                                 ;   in Loop: Header=BB0_12 Depth=2
	str	wzr, [sp, #56]                  ; 4-byte Folded Spill
	ldr	x8, [x19, #16]
	ldr	w9, [sp, #32]                   ; 4-byte Folded Reload
	add	w9, w9, #1
	str	w9, [sp, #32]                   ; 4-byte Folded Spill
	ldr	x26, [x8, w9, uxtw #3]
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=2
	ldr	w20, [sp, #36]                  ; 4-byte Folded Reload
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=2
	add	w25, w25, #1
	add	x28, x28, x24
	add	w22, w21, w22
	cbz	x27, LBB0_5
LBB0_12:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
Lloh3:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	x21, [x8]
	mov	x0, x28
	bl	_VIA_PGOFF
	sub	x0, x21, x0
	mov	x1, x27
	bl	_min
	mov	x21, x0
	mov	w24, w0
	sub	x27, x27, x24
	cmp	w20, #1
	b.ne	LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	ldr	x20, [x19, #32]
	mov	x0, x28
	bl	_VIA_PFN
	mov	x23, x0
	ldr	x0, [sp, #40]                   ; 8-byte Folded Reload
	bl	_VIA_PFN
	sub	x8, x23, x0
	ldr	w23, [x20, x8, lsl #2]
	mov	x0, x28
	bl	_VIA_PGOFF
	mov	x2, x0
	ldr	w4, [x19, #24]
	ldr	x20, [sp, #48]                  ; 8-byte Folded Reload
	mov	x0, x20
	mov	x1, x23
	mov	x3, x21
	bl	_dma_map_page
	stp	w22, w21, [x26]
	ldr	w8, [sp, #60]                   ; 4-byte Folded Reload
	stp	w8, w0, [x26, #8]
Lloh6:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x26
	mov	w2, #16
	bl	_dma_map_single
	str	w0, [sp, #60]                   ; 4-byte Folded Spill
	ldr	w9, [sp, #56]                   ; 4-byte Folded Reload
	add	w9, w9, #1
	ldr	w8, [x19]
	cmp	w9, w8
	b.hs	LBB0_9
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=2
	str	w9, [sp, #56]                   ; 4-byte Folded Spill
	add	x26, x26, #16
	b	LBB0_10
LBB0_15:
	mov	w25, #0
LBB0_16:
	cmp	w20, #1
	b.ne	LBB0_18
; %bb.17:
	ldr	w8, [sp, #60]                   ; 4-byte Folded Reload
	str	w8, [x19, #4]
Lloh9:
	adrp	x8, _dr_via_device_mapped@GOTPAGE
Lloh10:
	ldr	x8, [x8, _dr_via_device_mapped@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19, #12]
LBB0_18:
	str	w25, [x19, #8]
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_VIA_DMA_DPR_EC,4,2             ; @VIA_DMA_DPR_EC
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_dr_via_device_mapped,4,2       ; @dr_via_device_mapped
	.no_dead_strip	_via_map_blit_for_device
.subsections_via_symbols
