	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv50_fb_vram_init
_nv50_fb_vram_init:                     ## @nv50_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_nv_device
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_nouveau_bios
	movq	%rax, %r14
	movq	%r15, %rdi
	movl	$1049100, %esi                  ## imm = 0x10020C
	callq	_nv_rd32
	movl	$-170, %eax
	addl	(%rbx), %eax
	cmpl	$5, %eax
	ja	LBB0_4
## %bb.1:
	movl	$37, %ecx
	btl	%eax, %ecx
	jae	LBB0_4
## %bb.2:
	leaq	16(%r15), %rdi
	movl	$64, %esi
	movl	$1, %ecx
	callq	_nouveau_mm_init
	testl	%eax, %eax
	jne	LBB0_15
## %bb.3:
	movq	_NV_MEM_TYPE_STOLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	movq	%r15, %rdi
	movl	$1052176, %esi                  ## imm = 0x100E10
	callq	_nv_rd32
	shll	$12, %eax
	movl	%eax, 4(%r15)
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_4:
	movq	%r15, %rdi
	movl	$1050388, %esi                  ## imm = 0x100714
	callq	_nv_rd32
                                        ## kill: def $eax killed $eax def $rax
	andl	$7, %eax
	cmpl	$4, %eax
	ja	LBB0_14
## %bb.5:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_6:
	movq	_NV_MEM_TYPE_DDR1@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_7:
	movq	%r14, %rdi
	callq	_nouveau_fb_bios_memtype
	movq	_NV_MEM_TYPE_DDR3@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_13
## %bb.8:
	movq	_NV_MEM_TYPE_DDR2@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_9:
	movq	_NV_MEM_TYPE_GDDR3@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_10:
	movq	_NV_MEM_TYPE_GDDR4@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movq	_NV_MEM_TYPE_GDDR5@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
LBB0_13:
	movl	%eax, 12(%r15)
LBB0_14:
	leaq	16(%r15), %rbx
	movq	%r15, %rdi
	callq	_nv50_fb_vram_rblock
	sarl	$12, %eax
	movq	%rbx, %rdi
	movl	$64, %esi
	movl	%eax, %ecx
	callq	_nouveau_mm_init
	testl	%eax, %eax
	je	LBB0_16
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	%r15, %rdi
	movl	$1049088, %esi                  ## imm = 0x100200
	callq	_nv_rd32
	andl	$4, %eax
	cmpl	$1, %eax
	movl	$2, %eax
	sbbl	$0, %eax
	movl	%eax, 8(%r15)
	movq	%r15, %rdi
	movl	$1049376, %esi                  ## imm = 0x100320
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nv_rd32                        ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
LJTI0_0:
	.long	L0_0_set_6
	.long	L0_0_set_7
	.long	L0_0_set_9
	.long	L0_0_set_10
	.long	L0_0_set_11
	.end_data_region
                                        ## -- End function
	.comm	_NV_MEM_TYPE_STOLEN,4,2         ## @NV_MEM_TYPE_STOLEN
	.comm	_NV_MEM_TYPE_DDR1,4,2           ## @NV_MEM_TYPE_DDR1
	.comm	_NV_MEM_TYPE_DDR3,4,2           ## @NV_MEM_TYPE_DDR3
	.comm	_NV_MEM_TYPE_DDR2,4,2           ## @NV_MEM_TYPE_DDR2
	.comm	_NV_MEM_TYPE_GDDR3,4,2          ## @NV_MEM_TYPE_GDDR3
	.comm	_NV_MEM_TYPE_GDDR4,4,2          ## @NV_MEM_TYPE_GDDR4
	.comm	_NV_MEM_TYPE_GDDR5,4,2          ## @NV_MEM_TYPE_GDDR5
	.no_dead_strip	_nv50_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 nv50_fb_vram_init
_nv50_fb_vram_init:                     ; @nv50_fb_vram_init
	.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
	mov	x19, x0
	mov	w22, #512
	movk	w22, #16, lsl #16
	bl	_nv_device
	mov	x21, x0
	bl	_nouveau_bios
	mov	x20, x0
	orr	w1, w22, #0xc
	mov	x0, x19
	bl	_nv_rd32
	ldr	w8, [x21]
	sub	w8, w8, #170
	cmp	w8, #5
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #37
	and	w8, w8, w9
	ccmp	w8, #0, #4, ls
	b.eq	LBB0_3
; %bb.1:
	add	x0, x19, #16
	mov	w1, #64
	mov	w3, #1
	bl	_nouveau_mm_init
	cbnz	w0, LBB0_13
; %bb.2:
Lloh0:
	adrp	x8, _NV_MEM_TYPE_STOLEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NV_MEM_TYPE_STOLEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #12]
	add	w1, w22, #3088
	mov	x0, x19
	bl	_nv_rd32
	mov	x8, x0
	mov	w0, #0
	lsl	w8, w8, #12
	str	w8, [x19, #4]
	b	LBB0_13
LBB0_3:
	add	w1, w22, #1300
	mov	x0, x19
	bl	_nv_rd32
	and	w8, w0, #0x7
	cmp	w8, #4
	b.hi	LBB0_12
; %bb.4:
Lloh3:
	adrp	x9, lJTI0_0@PAGE
Lloh4:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_5
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_5:
Lloh5:
	adrp	x8, _NV_MEM_TYPE_DDR1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NV_MEM_TYPE_DDR1@GOTPAGEOFF]
	b	LBB0_10
LBB0_6:
	mov	x0, x20
	bl	_nouveau_fb_bios_memtype
Lloh7:
	adrp	x8, _NV_MEM_TYPE_DDR3@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NV_MEM_TYPE_DDR3@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _NV_MEM_TYPE_DDR2@GOTPAGE
Lloh11:
	ldr	x9, [x9, _NV_MEM_TYPE_DDR2@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	w0, w8
	csel	w8, w0, w9, eq
	b	LBB0_11
LBB0_7:
Lloh13:
	adrp	x8, _NV_MEM_TYPE_GDDR3@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NV_MEM_TYPE_GDDR3@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
Lloh15:
	adrp	x8, _NV_MEM_TYPE_GDDR4@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NV_MEM_TYPE_GDDR4@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh17:
	adrp	x8, _NV_MEM_TYPE_GDDR5@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NV_MEM_TYPE_GDDR5@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
LBB0_11:
	str	w8, [x19, #12]
LBB0_12:
	add	x20, x19, #16
	mov	x0, x19
	bl	_nv50_fb_vram_rblock
	asr	w3, w0, #12
	mov	x0, x20
	mov	w1, #64
	bl	_nouveau_mm_init
	cbz	w0, LBB0_14
LBB0_13:
	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_14:
	mov	x0, x19
	mov	w1, #512
	movk	w1, #16, lsl #16
	bl	_nv_rd32
	tst	w0, #0x4
	mov	w8, #1
	cinc	w8, w8, ne
	str	w8, [x19, #8]
	add	w1, w22, #288
	mov	x0, x19
	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	_nv_rd32
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_5-LBB0_5)>>2
	.byte	(LBB0_6-LBB0_5)>>2
	.byte	(LBB0_7-LBB0_5)>>2
	.byte	(LBB0_8-LBB0_5)>>2
	.byte	(LBB0_9-LBB0_5)>>2
                                        ; -- End function
	.comm	_NV_MEM_TYPE_STOLEN,4,2         ; @NV_MEM_TYPE_STOLEN
	.comm	_NV_MEM_TYPE_DDR1,4,2           ; @NV_MEM_TYPE_DDR1
	.comm	_NV_MEM_TYPE_DDR3,4,2           ; @NV_MEM_TYPE_DDR3
	.comm	_NV_MEM_TYPE_DDR2,4,2           ; @NV_MEM_TYPE_DDR2
	.comm	_NV_MEM_TYPE_GDDR3,4,2          ; @NV_MEM_TYPE_GDDR3
	.comm	_NV_MEM_TYPE_GDDR4,4,2          ; @NV_MEM_TYPE_GDDR4
	.comm	_NV_MEM_TYPE_GDDR5,4,2          ; @NV_MEM_TYPE_GDDR5
	.no_dead_strip	_nv50_fb_vram_init
.subsections_via_symbols
