	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_set_mode                       ## -- Begin function set_mode
	.p2align	4, 0x90
_set_mode:                              ## @set_mode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_VIDEO_CURRENT_MODE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	%edi, (%rcx)
	je	LBB0_10
## %bb.1:
	movl	%edi, %ebx
	movq	_NORMAL_VGA@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jne	LBB0_3
## %bb.2:
	movq	_VIDEO_80x25@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_EXTENDED_VGA@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_6
## %bb.4:
	movq	_VIDEO_8POINT@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %ebx
LBB0_6:
	leaq	-12(%rbp), %rsi
	movl	%ebx, %edi
	callq	_raw_set_mode
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:
	movq	_VIDEO_RECALC@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	callq	_vga_recalc_vertical
LBB0_9:
	movl	-12(%rbp), %eax
	movq	_boot_params@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIDEO_CURRENT_MODE,4,2         ## @VIDEO_CURRENT_MODE
	.comm	_NORMAL_VGA,4,2                 ## @NORMAL_VGA
	.comm	_VIDEO_80x25,4,2                ## @VIDEO_80x25
	.comm	_EXTENDED_VGA,4,2               ## @EXTENDED_VGA
	.comm	_VIDEO_8POINT,4,2               ## @VIDEO_8POINT
	.comm	_VIDEO_RECALC,4,2               ## @VIDEO_RECALC
	.comm	_boot_params,4,2                ## @boot_params
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_set_mode                       ; -- Begin function set_mode
	.p2align	2
_set_mode:                              ; @set_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _VIDEO_CURRENT_MODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIDEO_CURRENT_MODE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_9
LBB0_2:
Lloh3:
	adrp	x8, _NORMAL_VGA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NORMAL_VGA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w0
	b.ne	LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _VIDEO_80x25@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VIDEO_80x25@GOTPAGEOFF]
Lloh8:
	ldr	w19, [x8]
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x8, _EXTENDED_VGA@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EXTENDED_VGA@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _VIDEO_8POINT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _VIDEO_8POINT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w0
	csel	w19, w9, w0, eq
LBB0_5:
	add	x1, sp, #12
	mov	x0, x19
	bl	_raw_set_mode
	cbnz	w0, LBB0_9
; %bb.6:
Lloh15:
	adrp	x8, _VIDEO_RECALC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VIDEO_RECALC@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_8
; %bb.7:
	bl	_vga_recalc_vertical
LBB0_8:
	mov	w0, #0
	ldr	w8, [sp, #12]
Lloh18:
	adrp	x9, _boot_params@GOTPAGE
Lloh19:
	ldr	x9, [x9, _boot_params@GOTPAGEOFF]
Lloh20:
	str	w8, [x9]
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_VIDEO_CURRENT_MODE,4,2         ; @VIDEO_CURRENT_MODE
	.comm	_NORMAL_VGA,4,2                 ; @NORMAL_VGA
	.comm	_VIDEO_80x25,4,2                ; @VIDEO_80x25
	.comm	_EXTENDED_VGA,4,2               ; @EXTENDED_VGA
	.comm	_VIDEO_8POINT,4,2               ; @VIDEO_8POINT
	.comm	_VIDEO_RECALC,4,2               ; @VIDEO_RECALC
	.comm	_boot_params,4,2                ; @boot_params
.subsections_via_symbols
