	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function PcVideoSetMode
_PcVideoSetMode:                        ## @PcVideoSetMode
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_CurrentMemoryBank@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_BiosVideoMode@GOTPCREL(%rip), %rdx
	movl	%edi, (%rdx)
	movq	_ScreenWidth@GOTPCREL(%rip), %r15
	movl	$80, (%r15)
	movq	_ScreenHeight@GOTPCREL(%rip), %rdi
	movl	$25, (%rdi)
	movq	_BytesPerScanLine@GOTPCREL(%rip), %rsi
	movl	$160, (%rsi)
	movq	_VideoTextMode@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	movq	_DisplayMode@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_FALSE@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movq	_VesaVideoMode@GOTPCREL(%rip), %r12
	movl	%eax, (%r12)
	cmpl	$127, %ebx
	jle	LBB0_4
## %bb.1:
	leal	-128(%rbx), %eax
	cmpl	$6, %eax
	ja	LBB0_17
## %bb.2:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_3:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PcVideoSetMode80x50_80x43      ## TAILCALL
LBB0_4:
	cmpl	$3, %ebx
	je	LBB0_8
## %bb.5:
	cmpl	$18, %ebx
	je	LBB0_14
## %bb.6:
	cmpl	$19, %ebx
	jne	LBB0_17
## %bb.7:
	movq	%rdi, %r13
	movl	$19, %edi
	movq	%rcx, %r14
	movq	%rdx, %r12
	movq	%rsi, %rbx
	callq	_PcVideoSetBiosMode
	movl	$320, (%r15)                    ## imm = 0x140
	movl	$200, (%r13)
	movl	$320, (%rbx)                    ## imm = 0x140
	movl	$19, (%r12)
	jmp	LBB0_15
LBB0_8:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PcVideoSetMode80x25            ## TAILCALL
LBB0_9:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PcVideoSetMode80x60            ## TAILCALL
LBB0_10:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PcVideoSetMode80x43            ## TAILCALL
LBB0_11:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PcVideoSetMode80x34            ## TAILCALL
LBB0_12:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PcVideoSetMode80x30            ## TAILCALL
LBB0_13:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PcVideoSetMode80x28            ## TAILCALL
LBB0_14:
	movq	%rdi, %r13
	movl	$18, %edi
	movq	%rcx, %r14
	movq	%rdx, %r12
	movq	%rsi, %rbx
	callq	_PcVideoSetBiosMode
	movl	$974, %edi                      ## imm = 0x3CE
	movl	$3841, %esi                     ## imm = 0xF01
	callq	_WRITE_PORT_USHORT
	movl	$640, (%r15)                    ## imm = 0x280
	movl	$480, (%r13)                    ## imm = 0x1E0
	movl	$80, (%rbx)
	movl	$18, (%r12)
LBB0_15:
	movq	_VideoGraphicsMode@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_16
LBB0_17:
	leal	-264(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_VesaVideoModeInformation@GOTPCREL(%rip), %rsi
	movl	%ebx, %edi
	callq	_PcVideoVesaGetSVGAModeInformation
	cmpl	$4, -44(%rbp)                   ## 4-byte Folded Reload
	ja	LBB0_21
## %bb.18:
	testl	%eax, %eax
	je	LBB0_25
## %bb.19:
	movl	%ebx, %edi
	callq	_PcVideoSetBiosVesaMode
	testl	%eax, %eax
	je	LBB0_25
## %bb.20:
	movq	_VesaVideoModeInformation@GOTPCREL(%rip), %rdx
	movl	(%rdx), %eax
	movl	4(%rdx), %ecx
	movl	%eax, (%r15)
	movq	_ScreenHeight@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	movl	8(%rdx), %eax
	movq	_BytesPerScanLine@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_BiosVideoMode@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movl	(%r14), %eax
	jmp	LBB0_24
LBB0_21:
	testl	%eax, %eax
	je	LBB0_25
## %bb.22:
	movl	%ebx, %edi
	callq	_PcVideoSetBiosVesaMode
	testl	%eax, %eax
	je	LBB0_25
## %bb.23:
	movq	_VesaVideoModeInformation@GOTPCREL(%rip), %rdx
	movl	(%rdx), %eax
	movl	4(%rdx), %ecx
	movl	%eax, (%r15)
	movq	_ScreenHeight@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	movl	8(%rdx), %eax
	movq	_BytesPerScanLine@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_BiosVideoMode@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movq	_VideoGraphicsMode@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_24:
	movq	_DisplayMode@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	jmp	LBB0_16
LBB0_25:
	movl	(%r13), %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
LJTI0_0:
	.long	L0_0_set_8
	.long	L0_0_set_3
	.long	L0_0_set_9
	.long	L0_0_set_10
	.long	L0_0_set_11
	.long	L0_0_set_12
	.long	L0_0_set_13
	.end_data_region
                                        ## -- End function
	.comm	_CurrentMemoryBank,8,3          ## @CurrentMemoryBank
	.comm	_BiosVideoMode,4,2              ## @BiosVideoMode
	.comm	_ScreenWidth,4,2                ## @ScreenWidth
	.comm	_ScreenHeight,4,2               ## @ScreenHeight
	.comm	_BytesPerScanLine,4,2           ## @BytesPerScanLine
	.comm	_VideoTextMode,4,2              ## @VideoTextMode
	.comm	_DisplayMode,4,2                ## @DisplayMode
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_VesaVideoMode,4,2              ## @VesaVideoMode
	.comm	_VideoGraphicsMode,4,2          ## @VideoGraphicsMode
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_VesaVideoModeInformation,12,2  ## @VesaVideoModeInformation
	.no_dead_strip	_PcVideoSetMode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function PcVideoSetMode
_PcVideoSetMode:                        ; @PcVideoSetMode
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
Lloh0:
	adrp	x8, _CurrentMemoryBank@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CurrentMemoryBank@GOTPAGEOFF]
Lloh2:
	str	xzr, [x8]
Lloh3:
	adrp	x21, _BiosVideoMode@GOTPAGE
Lloh4:
	ldr	x21, [x21, _BiosVideoMode@GOTPAGEOFF]
Lloh5:
	adrp	x25, _ScreenWidth@GOTPAGE
Lloh6:
	ldr	x25, [x25, _ScreenWidth@GOTPAGEOFF]
	str	w0, [x21]
	mov	w8, #80
	str	w8, [x25]
Lloh7:
	adrp	x24, _ScreenHeight@GOTPAGE
Lloh8:
	ldr	x24, [x24, _ScreenHeight@GOTPAGEOFF]
	mov	w8, #25
	str	w8, [x24]
Lloh9:
	adrp	x23, _BytesPerScanLine@GOTPAGE
Lloh10:
	ldr	x23, [x23, _BytesPerScanLine@GOTPAGEOFF]
	mov	w8, #160
Lloh11:
	adrp	x28, _VideoTextMode@GOTPAGE
Lloh12:
	ldr	x28, [x28, _VideoTextMode@GOTPAGEOFF]
	str	w8, [x23]
	ldr	w8, [x28]
Lloh13:
	adrp	x22, _DisplayMode@GOTPAGE
Lloh14:
	ldr	x22, [x22, _DisplayMode@GOTPAGEOFF]
Lloh15:
	adrp	x27, _FALSE@GOTPAGE
Lloh16:
	ldr	x27, [x27, _FALSE@GOTPAGEOFF]
	str	w8, [x22]
	ldr	w8, [x27]
Lloh17:
	adrp	x26, _VesaVideoMode@GOTPAGE
Lloh18:
	ldr	x26, [x26, _VesaVideoMode@GOTPAGEOFF]
	str	w8, [x26]
	cmp	w0, #127
	b.le	LBB0_4
; %bb.1:
	sub	w8, w19, #128
	cmp	w8, #6
	b.hi	LBB0_16
; %bb.2:
Lloh19:
	adrp	x9, lJTI0_0@PAGE
Lloh20:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_3
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_3:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_PcVideoSetMode80x50_80x43
LBB0_4:
	cmp	w19, #3
	b.eq	LBB0_8
; %bb.5:
	cmp	w19, #18
	b.eq	LBB0_14
; %bb.6:
	cmp	w19, #19
	b.ne	LBB0_16
; %bb.7:
	mov	w0, #19
	bl	_PcVideoSetBiosMode
	mov	w8, #320
	str	w8, [x25]
	mov	w9, #200
	str	w9, [x24]
	b	LBB0_15
LBB0_8:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_PcVideoSetMode80x25
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_PcVideoSetMode80x60
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_PcVideoSetMode80x43
LBB0_11:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_PcVideoSetMode80x34
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_PcVideoSetMode80x30
LBB0_13:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_PcVideoSetMode80x28
LBB0_14:
	mov	w0, #18
	bl	_PcVideoSetBiosMode
	mov	w0, #974
	mov	w1, #3841
	bl	_WRITE_PORT_USHORT
	mov	w8, #640
	str	w8, [x25]
	mov	w8, #480
	str	w8, [x24]
	mov	w8, #80
LBB0_15:
	str	w8, [x23]
Lloh21:
	adrp	x8, _VideoGraphicsMode@GOTPAGE
Lloh22:
	ldr	x8, [x8, _VideoGraphicsMode@GOTPAGEOFF]
	str	w19, [x21]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x22]
Lloh24:
	adrp	x8, _TRUE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	b	LBB0_25
LBB0_16:
	sub	w20, w19, #264
Lloh27:
	adrp	x1, _VesaVideoModeInformation@GOTPAGE
Lloh28:
	ldr	x1, [x1, _VesaVideoModeInformation@GOTPAGEOFF]
	mov	x0, x19
	bl	_PcVideoVesaGetSVGAModeInformation
	cmp	w20, #4
	b.hi	LBB0_20
; %bb.17:
	cbz	w0, LBB0_24
; %bb.18:
	mov	x0, x19
	bl	_PcVideoSetBiosVesaMode
	cbz	w0, LBB0_24
; %bb.19:
Lloh29:
	adrp	x10, _VesaVideoModeInformation@GOTPAGE
Lloh30:
	ldr	x10, [x10, _VesaVideoModeInformation@GOTPAGEOFF]
	ldp	w8, w9, [x10]
	str	w8, [x25]
	str	w9, [x24]
	ldr	w8, [x10, #8]
	str	w8, [x23]
	str	w19, [x21]
	ldr	w8, [x28]
	b	LBB0_23
LBB0_20:
	cbz	w0, LBB0_24
; %bb.21:
	mov	x0, x19
	bl	_PcVideoSetBiosVesaMode
	cbz	w0, LBB0_24
; %bb.22:
Lloh31:
	adrp	x10, _VesaVideoModeInformation@GOTPAGE
Lloh32:
	ldr	x10, [x10, _VesaVideoModeInformation@GOTPAGEOFF]
	ldp	w8, w9, [x10]
	str	w8, [x25]
	str	w9, [x24]
	ldr	w8, [x10, #8]
	str	w8, [x23]
	str	w19, [x21]
Lloh33:
	adrp	x8, _VideoGraphicsMode@GOTPAGE
Lloh34:
	ldr	x8, [x8, _VideoGraphicsMode@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
LBB0_23:
	str	w8, [x22]
Lloh36:
	adrp	x8, _TRUE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
	str	w0, [x26]
	b	LBB0_25
LBB0_24:
	ldr	w0, [x27]
LBB0_25:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_8-LBB0_3)>>2
	.byte	(LBB0_3-LBB0_3)>>2
	.byte	(LBB0_9-LBB0_3)>>2
	.byte	(LBB0_10-LBB0_3)>>2
	.byte	(LBB0_11-LBB0_3)>>2
	.byte	(LBB0_12-LBB0_3)>>2
	.byte	(LBB0_13-LBB0_3)>>2
                                        ; -- End function
	.comm	_CurrentMemoryBank,8,3          ; @CurrentMemoryBank
	.comm	_BiosVideoMode,4,2              ; @BiosVideoMode
	.comm	_ScreenWidth,4,2                ; @ScreenWidth
	.comm	_ScreenHeight,4,2               ; @ScreenHeight
	.comm	_BytesPerScanLine,4,2           ; @BytesPerScanLine
	.comm	_VideoTextMode,4,2              ; @VideoTextMode
	.comm	_DisplayMode,4,2                ; @DisplayMode
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_VesaVideoMode,4,2              ; @VesaVideoMode
	.comm	_VideoGraphicsMode,4,2          ; @VideoGraphicsMode
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_VesaVideoModeInformation,12,2  ; @VesaVideoModeInformation
	.no_dead_strip	_PcVideoSetMode
.subsections_via_symbols
