	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvc0_fb_vram_init
_nvc0_fb_vram_init:                     ## @nvc0_fb_vram_init
	.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
	movq	%rdi, %r12
	callq	_nouveau_bios
	movq	%rax, %rbx
	movq	%r12, %rdi
	movl	$140344, %esi                   ## imm = 0x22438
	callq	_nv_rd32
	movl	%eax, %r13d
	movq	%r12, %rdi
	movl	$140628, %esi                   ## imm = 0x22554
	callq	_nv_rd32
	movl	%eax, %r14d
	movq	%r12, %rdi
	movl	$1110540, %esi                  ## imm = 0x10F20C
	callq	_nv_rd32
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	movl	$1050624, %esi                  ## imm = 0x100800
	callq	_nv_rd32
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_nv_debug
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%r13d, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_nv_debug
	movq	%rbx, %rdi
	callq	_nouveau_fb_bios_memtype
	movl	%eax, 12(%r12)
	movq	%r12, %rdi
	movl	$1110528, %esi                  ## imm = 0x10F200
	callq	_nv_rd32
	andl	$4, %eax
	cmpl	$1, %eax
	movl	$2, %eax
	sbbl	$0, %eax
	movl	%eax, 4(%r12)
	testl	%r13d, %r13d
	jle	LBB0_10
## %bb.1:
	movl	$1, -48(%rbp)                   ## 4-byte Folded Spill
	movl	$1114636, %ebx                  ## imm = 0x11020C
	xorl	%r15d, %r15d
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%r15d
	addl	$4096, %ebx                     ## imm = 0x1000
	cmpl	%r15d, %r13d
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	btl	%r15d, %r14d
	jb	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_nv_rd32
	movl	%r13d, %r14d
	movq	%r12, %r13
	movl	%eax, %r12d
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, %eax
	movl	%ecx, %eax
	cmovll	%r12d, %eax
	cmovnel	%eax, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	$0, %eax
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmovnel	%eax, %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_nv_debug
	shll	$20, %r12d
	addl	%r12d, 8(%r13)
	movq	%r13, %r12
	movl	%r14d, %r13d
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_4
LBB0_5:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_6
LBB0_10:
	movl	8(%r12), %edx
	sarl	$12, %edx
	addl	$-320, %edx                     ## imm = 0xFEC0
	movq	%r12, %rdi
	movl	$64, %esi
	movl	$1, %ecx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nouveau_mm_init                ## TAILCALL
LBB0_6:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	shll	$8, %ebx
	imull	%ebx, %r13d
	movq	%r12, %rdi
	movl	$64, %esi
	movl	%r13d, %edx
	movl	$1, %ecx
	callq	_nouveau_mm_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:
	movl	8(%r12), %edx
	sarl	$12, %edx
	subl	%ebx, %edx
	addl	$2097152, %ebx                  ## imm = 0x200000
	addl	$-256, %edx
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	movl	%ebx, %esi
	xorl	%ecx, %ecx
	callq	_nouveau_mm_init
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_nouveau_mm_fini
	movl	%r15d, %r14d
LBB0_9:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"0x100800: 0x%08x\n"

L_.str.1:                               ## @.str.1
	.asciz	"parts 0x%08x mask 0x%08x\n"

L_.str.2:                               ## @.str.2
	.asciz	"%d: mem_amount 0x%08x\n"

	.no_dead_strip	_nvc0_fb_vram_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvc0_fb_vram_init
_nvc0_fb_vram_init:                     ; @nvc0_fb_vram_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	bl	_nouveau_bios
	mov	x23, x0
	mov	w21, #9272
	movk	w21, #2, lsl #16
	mov	x0, x19
	mov	w1, #9272
	movk	w1, #2, lsl #16
	bl	_nv_rd32
	mov	x20, x0
	add	w1, w21, #284
	mov	x0, x19
	bl	_nv_rd32
	mov	x21, x0
	mov	w8, #61952
	movk	w8, #16, lsl #16
	orr	w1, w8, #0xc
	mov	x0, x19
	bl	_nv_rd32
	mov	x22, x0
	mov	x0, x19
	mov	w1, #2048
	movk	w1, #16, lsl #16
	bl	_nv_rd32
	mov	x2, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_nv_debug
	str	x21, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_nv_debug
	mov	x0, x23
	bl	_nouveau_fb_bios_memtype
	str	w0, [x19, #12]
	mov	x0, x19
	mov	w1, #61952
	movk	w1, #16, lsl #16
	bl	_nv_rd32
	tst	w0, #0x4
	mov	w8, #1
	cinc	w8, w8, ne
	str	w8, [x19, #4]
	cmp	w20, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w23, #0
	mov	w27, #1
	mov	w24, #524
	movk	w24, #17, lsl #16
Lloh4:
	adrp	x25, l_.str.2@PAGE
Lloh5:
	add	x25, x25, l_.str.2@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w23, w23, #1
	add	w24, w24, #1, lsl #12           ; =4096
	cmp	w20, w23
	b.eq	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w8, w21, w23
	tbnz	w8, #0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x24
	bl	_nv_rd32
	mov	x26, x0
	cmp	w0, w22
	csel	w8, w0, w22, lt
	csel	w22, w22, w8, eq
	csel	w27, w27, wzr, eq
	str	x26, [sp]
	mov	x0, x19
	mov	x1, x25
	mov	x2, x23
	bl	_nv_debug
	ldr	w8, [x19, #8]
	add	w8, w8, w26, lsl #20
	str	w8, [x19, #8]
	b	LBB0_2
LBB0_5:
	cbz	w27, LBB0_7
LBB0_6:
	ldr	w8, [x19, #8]
	asr	w8, w8, #12
	sub	w2, w8, #320
	mov	x0, x19
	mov	w1, #64
	mov	w3, #1
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_nouveau_mm_init
LBB0_7:
	lsl	w21, w22, #8
	mul	w2, w21, w20
	mov	x0, x19
	mov	w1, #64
	mov	w3, #1
	bl	_nouveau_mm_init
	mov	x20, x0
	cbnz	w0, LBB0_10
; %bb.8:
	add	w1, w21, #512, lsl #12          ; =2097152
	ldr	w8, [x19, #8]
	asr	w8, w8, #12
	sub	w8, w8, w21
	sub	w2, w8, #256
	mov	x0, x19
	mov	w3, #0
	bl	_nouveau_mm_init
	mov	x20, x0
	cbz	w0, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_nouveau_mm_fini
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"0x100800: 0x%08x\n"

l_.str.1:                               ; @.str.1
	.asciz	"parts 0x%08x mask 0x%08x\n"

l_.str.2:                               ; @.str.2
	.asciz	"%d: mem_amount 0x%08x\n"

	.no_dead_strip	_nvc0_fb_vram_init
.subsections_via_symbols
