	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv04_ram_new                   ## -- Begin function nv04_ram_new
	.p2align	4, 0x90
_nv04_ram_new:                          ## @nv04_ram_new
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	movq	_NV04_PFB_BOOT_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_nvkm_rd32
	testl	$256, %eax                      ## imm = 0x100
	jne	LBB0_1
## %bb.2:
	movq	_NV04_PFB_BOOT_0_RAM_AMOUNT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%eax, %edx
	addl	$-128, %edx
	movl	$33554432, %ecx                 ## imm = 0x2000000
	cmpl	$3, %edx
	ja	LBB0_4
## %bb.3:
	movslq	%edx, %rcx
	leaq	L_switch.table.nv04_ram_new(%rip), %rdx
	movl	(%rdx,%rcx,4), %ecx
	jmp	LBB0_4
LBB0_1:
	movl	%eax, %ecx
	shll	$9, %ecx
	andl	$31457280, %ecx                 ## imm = 0x1E00000
	addl	$2097152, %ecx                  ## imm = 0x200000
LBB0_4:
	andl	$56, %eax
	cmpl	$17, %eax
	jae	LBB0_5
## %bb.6:
	movq	_NVKM_RAM_TYPE_SGRAM@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_NVKM_RAM_TYPE_SDRAM@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edx
	movq	_nv04_ram_func@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	movq	%r14, %r8
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_nvkm_ram_new_                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NV04_PFB_BOOT_0,4,2            ## @NV04_PFB_BOOT_0
	.comm	_NV04_PFB_BOOT_0_RAM_AMOUNT,4,2 ## @NV04_PFB_BOOT_0_RAM_AMOUNT
	.comm	_NVKM_RAM_TYPE_SGRAM,4,2        ## @NVKM_RAM_TYPE_SGRAM
	.comm	_NVKM_RAM_TYPE_SDRAM,4,2        ## @NVKM_RAM_TYPE_SDRAM
	.comm	_nv04_ram_func,4,2              ## @nv04_ram_func
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ## @switch.table.nv04_ram_new
L_switch.table.nv04_ram_new:
	.long	8388608                         ## 0x800000
	.long	4194304                         ## 0x400000
	.long	33554432                        ## 0x2000000
	.long	16777216                        ## 0x1000000

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv04_ram_new                   ; -- Begin function nv04_ram_new
	.p2align	2
_nv04_ram_new:                          ; @nv04_ram_new
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	ldr	x0, [x0]
Lloh0:
	adrp	x8, _NV04_PFB_BOOT_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NV04_PFB_BOOT_0@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_nvkm_rd32
	tbnz	w0, #8, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _NV04_PFB_BOOT_0_RAM_AMOUNT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NV04_PFB_BOOT_0_RAM_AMOUNT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_4
; %bb.2:
Lloh6:
	adrp	x9, l_switch.table.nv04_ram_new@PAGE
Lloh7:
	add	x9, x9, l_switch.table.nv04_ram_new@PAGEOFF
	ldr	w3, [x9, w8, sxtw #2]
	b	LBB0_5
LBB0_3:
	lsl	w8, w0, #9
	and	w8, w8, #0x1e00000
	add	w3, w8, #512, lsl #12           ; =2097152
	b	LBB0_5
LBB0_4:
	mov	w3, #33554432
LBB0_5:
	and	w8, w0, #0x38
Lloh8:
	adrp	x9, _NVKM_RAM_TYPE_SGRAM@GOTPAGE
Lloh9:
	ldr	x9, [x9, _NVKM_RAM_TYPE_SGRAM@GOTPAGEOFF]
Lloh10:
	adrp	x10, _NVKM_RAM_TYPE_SDRAM@GOTPAGE
Lloh11:
	ldr	x10, [x10, _NVKM_RAM_TYPE_SDRAM@GOTPAGEOFF]
	cmp	w8, #17
	csel	x8, x9, x10, lo
Lloh12:
	adrp	x0, _nv04_ram_func@GOTPAGE
Lloh13:
	ldr	x0, [x0, _nv04_ram_func@GOTPAGEOFF]
	ldr	w2, [x8]
	mov	x1, x20
	mov	x4, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_nvkm_ram_new_
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_NV04_PFB_BOOT_0,4,2            ; @NV04_PFB_BOOT_0
	.comm	_NV04_PFB_BOOT_0_RAM_AMOUNT,4,2 ; @NV04_PFB_BOOT_0_RAM_AMOUNT
	.comm	_NVKM_RAM_TYPE_SGRAM,4,2        ; @NVKM_RAM_TYPE_SGRAM
	.comm	_NVKM_RAM_TYPE_SDRAM,4,2        ; @NVKM_RAM_TYPE_SDRAM
	.comm	_nv04_ram_func,4,2              ; @nv04_ram_func
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ; @switch.table.nv04_ram_new
l_switch.table.nv04_ram_new:
	.long	8388608                         ; 0x800000
	.long	4194304                         ; 0x400000
	.long	33554432                        ; 0x2000000
	.long	16777216                        ; 0x1000000

.subsections_via_symbols
