	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VGLRestorePalette              ## -- Begin function VGLRestorePalette
	.p2align	4, 0x90
_VGLRestorePalette:                     ## @VGLRestorePalette
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_VGLModeInfo@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_V_INFO_MM_DIRECT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	$966, %edi                      ## imm = 0x3C6
	movl	$255, %esi
	callq	_outb
	movl	$986, %edi                      ## imm = 0x3DA
	callq	_inb
	xorl	%ebx, %ebx
	movl	$968, %edi                      ## imm = 0x3C8
	xorl	%esi, %esi
	callq	_outb
	movq	_VGLSavePaletteRed@GOTPCREL(%rip), %r14
	movq	_VGLSavePaletteGreen@GOTPCREL(%rip), %r15
	movq	_VGLSavePaletteBlue@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movl	(%rax,%rbx,4), %esi
	movl	$969, %edi                      ## imm = 0x3C9
	callq	_outb
	movl	$132, %edi
	callq	_inb
	movq	(%r15), %rax
	movl	(%rax,%rbx,4), %esi
	movl	$969, %edi                      ## imm = 0x3C9
	callq	_outb
	movl	$132, %edi
	callq	_inb
	movq	(%r12), %rax
	movl	(%rax,%rbx,4), %esi
	movl	$969, %edi                      ## imm = 0x3C9
	callq	_outb
	movl	$132, %edi
	callq	_inb
	incq	%rbx
	cmpq	$256, %rbx                      ## imm = 0x100
	jne	LBB0_2
## %bb.3:
	movl	$986, %edi                      ## imm = 0x3DA
	callq	_inb
	movl	$960, %edi                      ## imm = 0x3C0
	movl	$32, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_outb                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VGLModeInfo,8,3                ## @VGLModeInfo
	.comm	_V_INFO_MM_DIRECT,8,3           ## @V_INFO_MM_DIRECT
	.comm	_VGLSavePaletteRed,8,3          ## @VGLSavePaletteRed
	.comm	_VGLSavePaletteGreen,8,3        ## @VGLSavePaletteGreen
	.comm	_VGLSavePaletteBlue,8,3         ## @VGLSavePaletteBlue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VGLRestorePalette              ; -- Begin function VGLRestorePalette
	.p2align	2
_VGLRestorePalette:                     ; @VGLRestorePalette
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
Lloh0:
	adrp	x8, _VGLModeInfo@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VGLModeInfo@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _V_INFO_MM_DIRECT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V_INFO_MM_DIRECT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	w0, #966
	mov	w1, #255
	bl	_outb
	mov	w0, #986
	bl	_inb
	mov	w0, #968
	mov	w1, #0
	bl	_outb
	mov	x19, #0
Lloh6:
	adrp	x20, _VGLSavePaletteRed@GOTPAGE
Lloh7:
	ldr	x20, [x20, _VGLSavePaletteRed@GOTPAGEOFF]
Lloh8:
	adrp	x21, _VGLSavePaletteGreen@GOTPAGE
Lloh9:
	ldr	x21, [x21, _VGLSavePaletteGreen@GOTPAGEOFF]
Lloh10:
	adrp	x22, _VGLSavePaletteBlue@GOTPAGE
Lloh11:
	ldr	x22, [x22, _VGLSavePaletteBlue@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	w1, [x8, x19]
	mov	w0, #969
	bl	_outb
	mov	w0, #132
	bl	_inb
	ldr	x8, [x21]
	ldr	w1, [x8, x19]
	mov	w0, #969
	bl	_outb
	mov	w0, #132
	bl	_inb
	ldr	x8, [x22]
	ldr	w1, [x8, x19]
	mov	w0, #969
	bl	_outb
	mov	w0, #132
	bl	_inb
	add	x19, x19, #4
	cmp	x19, #1024
	b.ne	LBB0_3
; %bb.4:
	mov	w0, #986
	bl	_inb
	mov	w0, #960
	mov	w1, #32
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_outb
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_VGLModeInfo,8,3                ; @VGLModeInfo
	.comm	_V_INFO_MM_DIRECT,8,3           ; @V_INFO_MM_DIRECT
	.comm	_VGLSavePaletteRed,8,3          ; @VGLSavePaletteRed
	.comm	_VGLSavePaletteGreen,8,3        ; @VGLSavePaletteGreen
	.comm	_VGLSavePaletteBlue,8,3         ; @VGLSavePaletteBlue
.subsections_via_symbols
