	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PcVideoSetDisplayMode          ## -- Begin function PcVideoSetDisplayMode
	.p2align	4, 0x90
_PcVideoSetDisplayMode:                 ## @PcVideoSetDisplayMode
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.1:
	movq	%rdi, %rbx
	cmpb	$0, (%rdi)
	je	LBB0_11
## %bb.2:
	movq	_VIDEOCARD_CGA_OR_OTHER@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	xorl	%eax, %eax
	callq	_PcVideoDetectVideoCard
	cmpq	%rax, %r15
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	leaq	L_str.12(%rip), %rdi
	jmp	LBB0_6
LBB0_4:
	movq	_VIDEOCARD_EGA@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	xorl	%eax, %eax
	callq	_PcVideoDetectVideoCard
	cmpq	%rax, %r15
	jne	LBB0_12
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	callq	_TRACE
	leaq	L_str.10(%rip), %rdi
LBB0_6:
	callq	_puts
	leaq	L_str.13(%rip), %rdi
	callq	_puts
LBB0_7:
	movq	_VIDEOMODE_NORMAL_TEXT@GOTPCREL(%rip), %rax
LBB0_8:
	movq	(%rax), %rbx
LBB0_9:
	movq	%rbx, %rdi
	callq	_PcVideoSetMode
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	leaq	L_.str.6(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_printf
	leaq	L_str(%rip), %rdi
	callq	_puts
	leaq	L_str.9(%rip), %rdi
	callq	_puts
	xorl	%eax, %eax
	callq	_PcConsGetCh
	movq	_VIDEOMODE_NORMAL_TEXT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_PcVideoSetMode
LBB0_11:
	xorl	%edi, %edi
	testl	%r14d, %r14d
	sete	%dil
	callq	_PcVideoSetBlinkBit
	movq	_DisplayMode@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	L_.str.3(%rip), %rdi
	callq	_TRACE
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	callq	__stricmp
	testq	%rax, %rax
	je	LBB0_7
## %bb.13:
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	callq	__stricmp
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_strtoul
	movq	%rax, %rbx
	jmp	LBB0_9
LBB0_15:
	movq	_VIDEOMODE_EXTENDED_TEXT@GOTPCREL(%rip), %rax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_VIDEOMODE_NORMAL_TEXT,8,3      ## @VIDEOMODE_NORMAL_TEXT
	.comm	_DisplayMode,4,2                ## @DisplayMode
	.comm	_VIDEOCARD_CGA_OR_OTHER,8,3     ## @VIDEOCARD_CGA_OR_OTHER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CGA or other display adapter detected.\n"

	.comm	_VIDEOCARD_EGA,8,3              ## @VIDEOCARD_EGA
L_.str.2:                               ## @.str.2
	.asciz	"EGA display adapter detected.\n"

L_.str.3:                               ## @.str.3
	.asciz	"VGA display adapter detected.\n"

L_.str.4:                               ## @.str.4
	.asciz	"NORMAL_VGA"

L_.str.5:                               ## @.str.5
	.asciz	"EXTENDED_VGA"

	.comm	_VIDEOMODE_EXTENDED_TEXT,8,3    ## @VIDEOMODE_EXTENDED_TEXT
L_.str.6:                               ## @.str.6
	.asciz	"Error: unable to set video display mode 0x%x\n"

L_str:                                  ## @str
	.asciz	"Defaulting to 80x25 text mode."

L_str.9:                                ## @str.9
	.asciz	"Press any key to continue."

L_str.10:                               ## @str.10
	.asciz	"EGA display adapter detected."

L_str.12:                               ## @str.12
	.asciz	"CGA or other display adapter detected."

L_str.13:                               ## @str.13
	.asciz	"Using 80x25 text mode."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PcVideoSetDisplayMode          ; -- Begin function PcVideoSetDisplayMode
	.p2align	2
_PcVideoSetDisplayMode:                 ; @PcVideoSetDisplayMode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	cbz	x0, LBB0_11
; %bb.1:
	mov	x20, x0
	ldrb	w8, [x0]
	cbz	w8, LBB0_11
; %bb.2:
Lloh0:
	adrp	x8, _VIDEOCARD_CGA_OR_OTHER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIDEOCARD_CGA_OR_OTHER@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
	bl	_PcVideoDetectVideoCard
	cmp	x21, x0
	b.ne	LBB0_4
; %bb.3:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
Lloh5:
	adrp	x0, l_str.12@PAGE
Lloh6:
	add	x0, x0, l_str.12@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh7:
	adrp	x8, _VIDEOCARD_EGA@GOTPAGE
Lloh8:
	ldr	x8, [x8, _VIDEOCARD_EGA@GOTPAGEOFF]
Lloh9:
	ldr	x21, [x8]
	bl	_PcVideoDetectVideoCard
	cmp	x21, x0
	b.ne	LBB0_12
; %bb.5:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
Lloh12:
	adrp	x0, l_str.10@PAGE
Lloh13:
	add	x0, x0, l_str.10@PAGEOFF
LBB0_6:
	bl	_puts
Lloh14:
	adrp	x0, l_str.13@PAGE
Lloh15:
	add	x0, x0, l_str.13@PAGEOFF
	bl	_puts
LBB0_7:
Lloh16:
	adrp	x8, _VIDEOMODE_NORMAL_TEXT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _VIDEOMODE_NORMAL_TEXT@GOTPAGEOFF]
LBB0_8:
	ldr	x20, [x8]
LBB0_9:
	mov	x0, x20
	bl	_PcVideoSetMode
	cbnz	w0, LBB0_11
; %bb.10:
	str	x20, [sp]
Lloh18:
	adrp	x0, l_.str.6@PAGE
Lloh19:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_printf
Lloh20:
	adrp	x0, l_str@PAGE
Lloh21:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
Lloh22:
	adrp	x0, l_str.9@PAGE
Lloh23:
	add	x0, x0, l_str.9@PAGEOFF
	bl	_puts
	bl	_PcConsGetCh
Lloh24:
	adrp	x8, _VIDEOMODE_NORMAL_TEXT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VIDEOMODE_NORMAL_TEXT@GOTPAGEOFF]
Lloh26:
	ldr	x0, [x8]
	bl	_PcVideoSetMode
LBB0_11:
	cmp	w19, #0
	cset	w0, eq
	bl	_PcVideoSetBlinkBit
Lloh27:
	adrp	x8, _DisplayMode@GOTPAGE
Lloh28:
	ldr	x8, [x8, _DisplayMode@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_12:
Lloh30:
	adrp	x0, l_.str.3@PAGE
Lloh31:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_TRACE
Lloh32:
	adrp	x1, l_.str.4@PAGE
Lloh33:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	__stricmp
	cbz	x0, LBB0_7
; %bb.13:
Lloh34:
	adrp	x1, l_.str.5@PAGE
Lloh35:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	__stricmp
	cbz	x0, LBB0_15
; %bb.14:
	mov	x0, x20
	mov	x1, #0
	mov	w2, #0
	bl	_strtoul
	mov	x20, x0
	b	LBB0_9
LBB0_15:
Lloh36:
	adrp	x8, _VIDEOMODE_EXTENDED_TEXT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _VIDEOMODE_EXTENDED_TEXT@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_VIDEOMODE_NORMAL_TEXT,8,3      ; @VIDEOMODE_NORMAL_TEXT
	.comm	_DisplayMode,4,2                ; @DisplayMode
	.comm	_VIDEOCARD_CGA_OR_OTHER,8,3     ; @VIDEOCARD_CGA_OR_OTHER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CGA or other display adapter detected.\n"

	.comm	_VIDEOCARD_EGA,8,3              ; @VIDEOCARD_EGA
l_.str.2:                               ; @.str.2
	.asciz	"EGA display adapter detected.\n"

l_.str.3:                               ; @.str.3
	.asciz	"VGA display adapter detected.\n"

l_.str.4:                               ; @.str.4
	.asciz	"NORMAL_VGA"

l_.str.5:                               ; @.str.5
	.asciz	"EXTENDED_VGA"

	.comm	_VIDEOMODE_EXTENDED_TEXT,8,3    ; @VIDEOMODE_EXTENDED_TEXT
l_.str.6:                               ; @.str.6
	.asciz	"Error: unable to set video display mode 0x%x\n"

l_str:                                  ; @str
	.asciz	"Defaulting to 80x25 text mode."

l_str.9:                                ; @str.9
	.asciz	"Press any key to continue."

l_str.10:                               ; @str.10
	.asciz	"EGA display adapter detected."

l_str.12:                               ; @str.12
	.asciz	"CGA or other display adapter detected."

l_str.13:                               ; @str.13
	.asciz	"Using 80x25 text mode."

.subsections_via_symbols
