	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PcVideoCopyOffScreenBufferToVRAM ## -- Begin function PcVideoCopyOffScreenBufferToVRAM
	.p2align	4, 0x90
_PcVideoCopyOffScreenBufferToVRAM:      ## @PcVideoCopyOffScreenBufferToVRAM
	.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, %r14
	movq	_VideoTextMode@GOTPCREL(%rip), %rcx
	movq	_DisplayMode@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, (%rcx)
	jne	LBB0_2
## %bb.1:
	movq	_VIDEOTEXT_MEM_ADDRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	xorl	%eax, %eax
	callq	_PcVideoGetBufferSize
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	jmp	LBB0_10
LBB0_2:
	movq	_VideoGraphicsMode@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	jne	LBB0_11
## %bb.3:
	movq	_VesaVideoMode@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_11
## %bb.4:
	movq	_VesaVideoModeInformation@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	movl	8(%rcx), %eax
	imull	4(%rcx), %eax
	shll	$10, %r13d
	cltd
	idivl	%r13d
	movl	%edx, %r15d
	testl	%eax, %eax
	jle	LBB0_5
## %bb.6:
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movslq	%r13d, %r12
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %r15d
	xorl	%ebx, %ebx
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_PcVideoSetMemoryBank
	movq	_VIDEOVGA_MEM_ADDRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%r14, %rsi
	movl	%r13d, %edx
	callq	_RtlCopyMemory
	incq	%rbx
	addq	%r12, %r14
	cmpq	%rbx, %r15
	jne	LBB0_7
## %bb.8:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_9
LBB0_5:
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, %edi
	callq	_PcVideoSetMemoryBank
	movq	_VIDEOVGA_MEM_ADDRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	imull	%ebx, %r13d
	movslq	%r13d, %rax
	addq	%rax, %r14
	movq	%r14, %rsi
	movl	%r15d, %edx
LBB0_10:
	callq	_RtlCopyMemory
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VideoTextMode,8,3              ## @VideoTextMode
	.comm	_DisplayMode,8,3                ## @DisplayMode
	.comm	_VIDEOTEXT_MEM_ADDRESS,8,3      ## @VIDEOTEXT_MEM_ADDRESS
	.comm	_VideoGraphicsMode,8,3          ## @VideoGraphicsMode
	.comm	_VesaVideoMode,8,3              ## @VesaVideoMode
	.comm	_VesaVideoModeInformation,12,2  ## @VesaVideoModeInformation
	.comm	_VIDEOVGA_MEM_ADDRESS,8,3       ## @VIDEOVGA_MEM_ADDRESS
	.comm	_UNIMPLEMENTED,4,2              ## @UNIMPLEMENTED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PcVideoCopyOffScreenBufferToVRAM ; -- Begin function PcVideoCopyOffScreenBufferToVRAM
	.p2align	2
_PcVideoCopyOffScreenBufferToVRAM:      ; @PcVideoCopyOffScreenBufferToVRAM
	.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	x19, x0
Lloh0:
	adrp	x8, _VideoTextMode@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VideoTextMode@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x8]
Lloh3:
	adrp	x8, _DisplayMode@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DisplayMode@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _VIDEOTEXT_MEM_ADDRESS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VIDEOTEXT_MEM_ADDRESS@GOTPAGEOFF]
Lloh8:
	ldr	x20, [x8]
	bl	_PcVideoGetBufferSize
	mov	x2, x0
	mov	x0, x20
	mov	x1, x19
	b	LBB0_8
LBB0_2:
Lloh9:
	adrp	x9, _VideoGraphicsMode@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VideoGraphicsMode@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
Lloh12:
	adrp	x10, _VesaVideoMode@GOTPAGE
Lloh13:
	ldr	x10, [x10, _VesaVideoMode@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
	cmp	x9, x8
	ccmp	x10, #0, #4, eq
	b.eq	LBB0_9
; %bb.3:
Lloh15:
	adrp	x8, _VesaVideoModeInformation@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VesaVideoModeInformation@GOTPAGEOFF]
	ldp	w9, w10, [x8]
	lsl	w21, w9, #10
	ldr	w8, [x8, #8]
	mul	w8, w8, w10
	sdiv	w22, w8, w21
	msub	w20, w22, w21, w8
Lloh17:
	adrp	x25, _VIDEOVGA_MEM_ADDRESS@GOTPAGE
Lloh18:
	ldr	x25, [x25, _VIDEOVGA_MEM_ADDRESS@GOTPAGEOFF]
	cmp	w22, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x23, #0
	sxtw	x26, w21
	mov	x24, x19
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_PcVideoSetMemoryBank
	ldr	x0, [x25]
	mov	x1, x24
	mov	x2, x21
	bl	_RtlCopyMemory
	add	x23, x23, #1
	add	x24, x24, x26
	cmp	x22, x23
	b.ne	LBB0_5
	b	LBB0_7
LBB0_6:
	mov	w22, #0
LBB0_7:
	mov	x0, x22
	bl	_PcVideoSetMemoryBank
	ldr	x0, [x25]
	smaddl	x1, w22, w21, x19
	mov	x2, x20
LBB0_8:
	bl	_RtlCopyMemory
LBB0_9:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_VideoTextMode,8,3              ; @VideoTextMode
	.comm	_DisplayMode,8,3                ; @DisplayMode
	.comm	_VIDEOTEXT_MEM_ADDRESS,8,3      ; @VIDEOTEXT_MEM_ADDRESS
	.comm	_VideoGraphicsMode,8,3          ; @VideoGraphicsMode
	.comm	_VesaVideoMode,8,3              ; @VesaVideoMode
	.comm	_VesaVideoModeInformation,12,2  ; @VesaVideoModeInformation
	.comm	_VIDEOVGA_MEM_ADDRESS,8,3       ; @VIDEOVGA_MEM_ADDRESS
	.comm	_UNIMPLEMENTED,4,2              ; @UNIMPLEMENTED
.subsections_via_symbols
