	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv50_ram_ctor                  ## -- Begin function nv50_ram_ctor
	.p2align	4, 0x90
_nv50_ram_ctor:                         ## @nv50_ram_ctor
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %r13
	movq	(%r13), %r12
	movq	%r13, %rdi
	movl	$1049100, %esi                  ## imm = 0x10020C
	callq	_nvkm_rd32
	movq	_NVKM_RAM_TYPE_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r13, %rdi
	movl	$1050388, %esi                  ## imm = 0x100714
	callq	_nvkm_rd32
                                        ## kill: def $eax killed $eax def $rax
	andl	$7, %eax
	cmpl	$4, %eax
	ja	LBB0_9
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	movq	_NVKM_RAM_TYPE_DDR1@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_3:
	movq	%r12, %rdi
	callq	_nvkm_fb_bios_memtype
	movq	_NVKM_RAM_TYPE_DDR3@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	cmpl	%ebx, %eax
	je	LBB0_9
## %bb.4:
	movq	_NVKM_RAM_TYPE_DDR2@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_5:
	movq	_NVKM_RAM_TYPE_GDDR3@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_NVKM_RAM_TYPE_GDDR4@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_NVKM_RAM_TYPE_GDDR5@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %ebx
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	%ebx, %edx
	movq	%r14, %r8
	callq	_nvkm_ram_ctor
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r13, %rdi
	movl	$5440, %esi                     ## imm = 0x1540
	callq	_nvkm_rd32
	shrl	$16, %eax
	movzbl	%al, %edi
	movl	%edi, (%r14)
	callq	_hweight8
	movl	%eax, 12(%r14)
	movq	%r13, %rdi
	movl	$1049088, %esi                  ## imm = 0x100200
	callq	_nvkm_rd32
	andl	$4, %eax
	cmpl	$1, %eax
	movl	$2, %eax
	sbbl	$0, %eax
	movl	%eax, 4(%r14)
	leaq	8(%r14), %r12
	movq	%r12, %rdi
	callq	_nvkm_mm_fini
	movq	_NVKM_RAM_MM_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_NVKM_RAM_MM_SHIFT@GOTPCREL(%rip), %r13
	movb	(%r13), %cl
	movl	$262144, %ebx                   ## imm = 0x40000
	shrl	%cl, %ebx
	movq	%r14, %rdi
	callq	_nv50_fb_vram_rblock
	movb	(%r13), %cl
	sarl	%cl, %eax
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movl	%eax, %r8d
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nvkm_mm_init                   ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_3
	.long	L0_0_set_5
	.long	L0_0_set_6
	.long	L0_0_set_7
	.end_data_region
                                        ## -- End function
	.comm	_NVKM_RAM_TYPE_UNKNOWN,4,2      ## @NVKM_RAM_TYPE_UNKNOWN
	.comm	_NVKM_RAM_TYPE_DDR1,4,2         ## @NVKM_RAM_TYPE_DDR1
	.comm	_NVKM_RAM_TYPE_DDR3,4,2         ## @NVKM_RAM_TYPE_DDR3
	.comm	_NVKM_RAM_TYPE_DDR2,4,2         ## @NVKM_RAM_TYPE_DDR2
	.comm	_NVKM_RAM_TYPE_GDDR3,4,2        ## @NVKM_RAM_TYPE_GDDR3
	.comm	_NVKM_RAM_TYPE_GDDR4,4,2        ## @NVKM_RAM_TYPE_GDDR4
	.comm	_NVKM_RAM_TYPE_GDDR5,4,2        ## @NVKM_RAM_TYPE_GDDR5
	.comm	_NVKM_RAM_MM_NORMAL,4,2         ## @NVKM_RAM_MM_NORMAL
	.comm	_NVKM_RAM_MM_SHIFT,4,2          ## @NVKM_RAM_MM_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv50_ram_ctor                  ; -- Begin function nv50_ram_ctor
	.p2align	2
_nv50_ram_ctor:                         ; @nv50_ram_ctor
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x22, x0
	mov	w25, #512
	movk	w25, #16, lsl #16
	ldr	x20, [x1]
	ldr	x24, [x20]
	orr	w1, w25, #0xc
	mov	x0, x20
	bl	_nvkm_rd32
Lloh0:
	adrp	x8, _NVKM_RAM_TYPE_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NVKM_RAM_TYPE_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	mov	w8, #1300
	orr	w1, w25, w8
	mov	x0, x20
	bl	_nvkm_rd32
	and	w8, w0, #0x7
	cmp	w8, #4
	b.hi	LBB0_8
; %bb.1:
Lloh3:
	adrp	x9, lJTI0_0@PAGE
Lloh4:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
Lloh5:
	adrp	x8, _NVKM_RAM_TYPE_DDR1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NVKM_RAM_TYPE_DDR1@GOTPAGEOFF]
	b	LBB0_7
LBB0_3:
	mov	x0, x24
	bl	_nvkm_fb_bios_memtype
Lloh7:
	adrp	x8, _NVKM_RAM_TYPE_DDR3@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NVKM_RAM_TYPE_DDR3@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _NVKM_RAM_TYPE_DDR2@GOTPAGE
Lloh11:
	ldr	x9, [x9, _NVKM_RAM_TYPE_DDR2@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	w0, w8
	csel	w23, w8, w9, eq
	b	LBB0_8
LBB0_4:
Lloh13:
	adrp	x8, _NVKM_RAM_TYPE_GDDR3@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NVKM_RAM_TYPE_GDDR3@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
Lloh15:
	adrp	x8, _NVKM_RAM_TYPE_GDDR4@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NVKM_RAM_TYPE_GDDR4@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh17:
	adrp	x8, _NVKM_RAM_TYPE_GDDR5@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NVKM_RAM_TYPE_GDDR5@GOTPAGEOFF]
LBB0_7:
	ldr	w23, [x8]
LBB0_8:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x23
	mov	x4, x19
	bl	_nvkm_ram_ctor
	cbz	w0, LBB0_10
; %bb.9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x20
	mov	w1, #5440
	bl	_nvkm_rd32
	ubfx	w0, w0, #16, #8
	str	w0, [x19]
	bl	_hweight8
	str	w0, [x19, #12]
	mov	x0, x20
	mov	w1, #512
	movk	w1, #16, lsl #16
	bl	_nvkm_rd32
	tst	w0, #0x4
	mov	w8, #1
	cinc	w8, w8, ne
	str	w8, [x19, #4]
	add	x20, x19, #8
	mov	x0, x20
	bl	_nvkm_mm_fini
Lloh19:
	adrp	x8, _NVKM_RAM_MM_NORMAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _NVKM_RAM_MM_NORMAL@GOTPAGEOFF]
Lloh21:
	ldr	w21, [x8]
Lloh22:
	adrp	x23, _NVKM_RAM_MM_SHIFT@GOTPAGE
Lloh23:
	ldr	x23, [x23, _NVKM_RAM_MM_SHIFT@GOTPAGEOFF]
	ldr	w8, [x23]
	mov	w9, #262144
	lsr	w22, w9, w8
	mov	x0, x19
	bl	_nv50_fb_vram_rblock
	ldr	w8, [x23]
	asr	w4, w0, w8
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_nvkm_mm_init
	.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
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
                                        ; -- End function
	.comm	_NVKM_RAM_TYPE_UNKNOWN,4,2      ; @NVKM_RAM_TYPE_UNKNOWN
	.comm	_NVKM_RAM_TYPE_DDR1,4,2         ; @NVKM_RAM_TYPE_DDR1
	.comm	_NVKM_RAM_TYPE_DDR3,4,2         ; @NVKM_RAM_TYPE_DDR3
	.comm	_NVKM_RAM_TYPE_DDR2,4,2         ; @NVKM_RAM_TYPE_DDR2
	.comm	_NVKM_RAM_TYPE_GDDR3,4,2        ; @NVKM_RAM_TYPE_GDDR3
	.comm	_NVKM_RAM_TYPE_GDDR4,4,2        ; @NVKM_RAM_TYPE_GDDR4
	.comm	_NVKM_RAM_TYPE_GDDR5,4,2        ; @NVKM_RAM_TYPE_GDDR5
	.comm	_NVKM_RAM_MM_NORMAL,4,2         ; @NVKM_RAM_MM_NORMAL
	.comm	_NVKM_RAM_MM_SHIFT,4,2          ; @NVKM_RAM_MM_SHIFT
.subsections_via_symbols
