	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv_load_state_vga
_nv_load_state_vga:                     ## @nv_load_state_vga
	.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
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	(%rdx), %rcx
	movslq	%esi, %rsi
	movq	_NV_PRMVIO_MISC__WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	shlq	$5, %r13
	movq	%rcx, %rax
	leaq	(%rcx,%r13), %r15
	movl	24(%rcx,%r13), %ecx
	movq	%rax, %rbx
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_NVWritePRMVIO
	movq	16(%rbx,%r13), %rax
	movl	(%rax), %ecx
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%edx, %edx
	callq	_NVWriteVgaSeq
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax,%r13), %rax
	movl	4(%rax), %ecx
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$1, %edx
	callq	_NVWriteVgaSeq
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax,%r13), %rax
	movl	8(%rax), %ecx
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$2, %edx
	callq	_NVWriteVgaSeq
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax,%r13), %rax
	movl	12(%rax), %ecx
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$3, %edx
	callq	_NVWriteVgaSeq
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax,%r13), %rax
	movl	16(%rax), %ecx
	movq	%r12, %rdi
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	%r13d, %esi
	movl	$4, %edx
	callq	_NVWriteVgaSeq
	movq	%r12, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	callq	_nv_lock_vga_crtc_base
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r14d, %esi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	callq	_wr_cio_state
	incl	%ebx
	cmpl	$25, %ebx
	jne	LBB0_1
## %bb.2:
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	callq	_nv_lock_vga_crtc_base
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%r13,%rax), %rax
	movl	(%rax), %ecx
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	callq	_NVWriteVgaGr
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%r13,%rax), %rax
	movl	4(%rax), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	callq	_NVWriteVgaGr
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%r13,%rax), %rax
	movl	8(%rax), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	$2, %edx
	callq	_NVWriteVgaGr
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax,%r13), %rax
	movl	12(%rax), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	$3, %edx
	callq	_NVWriteVgaGr
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax,%r13), %rax
	movl	16(%rax), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	$4, %edx
	callq	_NVWriteVgaGr
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax,%r13), %rax
	movl	20(%rax), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	$5, %edx
	callq	_NVWriteVgaGr
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax,%r13), %rax
	movl	24(%rax), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	$6, %edx
	callq	_NVWriteVgaGr
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax,%r13), %rax
	movl	28(%rax), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	$7, %edx
	callq	_NVWriteVgaGr
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax,%r13), %rax
	movl	32(%rax), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	$8, %edx
	callq	_NVWriteVgaGr
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	callq	_NVSetEnablePalette
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movl	(%rax,%rbx,4), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_NVWriteVgaAttr
	incq	%rbx
	cmpq	$21, %rbx
	jne	LBB0_3
## %bb.4:
	movq	%r12, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NVSetEnablePalette             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_PRMVIO_MISC__WRITE,4,2      ## @NV_PRMVIO_MISC__WRITE
	.no_dead_strip	_nv_load_state_vga
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv_load_state_vga
_nv_load_state_vga:                     ; @nv_load_state_vga
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x20, x0
	ldr	x23, [x2]
	sxtw	x24, w19
Lloh0:
	adrp	x8, _NV_PRMVIO_MISC__WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NV_PRMVIO_MISC__WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x21, x23, x24, lsl #5
	ldr	w3, [x21, #24]
	bl	_NVWritePRMVIO
	ldr	x8, [x21, #16]
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_NVWriteVgaSeq
	ldr	x8, [x21, #16]
	ldr	w3, [x8, #4]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #1
	bl	_NVWriteVgaSeq
	ldr	x8, [x21, #16]
	ldr	w3, [x8, #8]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #2
	bl	_NVWriteVgaSeq
	ldr	x8, [x21, #16]
	ldr	w3, [x8, #12]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #3
	bl	_NVWriteVgaSeq
	ldr	x8, [x21, #16]
	ldr	w3, [x8, #16]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #4
	bl	_NVWriteVgaSeq
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_nv_lock_vga_crtc_base
	mov	w22, #0
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	mov	x3, x22
	bl	_wr_cio_state
	add	w22, w22, #1
	cmp	w22, #25
	b.ne	LBB0_1
; %bb.2:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #1
	bl	_nv_lock_vga_crtc_base
	add	x22, x23, x24, lsl #5
	ldr	x8, [x22, #8]
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_NVWriteVgaGr
	ldr	x8, [x22, #8]
	ldr	w3, [x8, #4]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #1
	bl	_NVWriteVgaGr
	ldr	x8, [x22, #8]
	ldr	w3, [x8, #8]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #2
	bl	_NVWriteVgaGr
	ldr	x8, [x22, #8]
	ldr	w3, [x8, #12]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #3
	bl	_NVWriteVgaGr
	ldr	x8, [x22, #8]
	ldr	w3, [x8, #16]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #4
	bl	_NVWriteVgaGr
	ldr	x8, [x22, #8]
	ldr	w3, [x8, #20]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #5
	bl	_NVWriteVgaGr
	ldr	x8, [x22, #8]
	ldr	w3, [x8, #24]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #6
	bl	_NVWriteVgaGr
	ldr	x8, [x22, #8]
	ldr	w3, [x8, #28]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #7
	bl	_NVWriteVgaGr
	ldr	x8, [x22, #8]
	ldr	w3, [x8, #32]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #8
	bl	_NVWriteVgaGr
	mov	x0, x20
	mov	x1, x19
	mov	w2, #1
	bl	_NVSetEnablePalette
	mov	x22, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	w3, [x8, x22, lsl #2]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	bl	_NVWriteVgaAttr
	add	x22, x22, #1
	cmp	x22, #21
	b.ne	LBB0_3
; %bb.4:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_NVSetEnablePalette
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_PRMVIO_MISC__WRITE,4,2      ; @NV_PRMVIO_MISC__WRITE
	.no_dead_strip	_nv_load_state_vga
.subsections_via_symbols
