	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv40_instmem_oneinit
_nv40_instmem_oneinit:                  ## @nv40_instmem_oneinit
	.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
	callq	_nv40_instmem
	movq	%rax, %r15
	movq	24(%rax), %r14
	movq	%r14, %rdi
	movl	$5440, %esi                     ## imm = 0x1540
	callq	_nvkm_rd32
	movzbl	%ah, %edi
	callq	_hweight8
	movl	%eax, %ebx
	movl	(%r14), %ecx
	movl	$27296, %eax                    ## imm = 0x6AA0
	cmpl	$64, %ecx
	je	LBB0_3
## %bb.1:
	movl	$20224, %eax                    ## imm = 0x4F00
	cmpl	$67, %ecx
	jl	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_nv44_gr_class
	testq	%rax, %rax
	movl	$19008, %ecx                    ## imm = 0x4A40
	movl	$18816, %eax                    ## imm = 0x4980
	cmovel	%ecx, %eax
LBB0_3:
	imull	%eax, %ebx
	shll	$5, %ebx
	addl	$1572864, %ebx                  ## imm = 0x180000
	movl	%ebx, (%r15)
	movl	%ebx, %edi
	movl	$4096, %esi                     ## imm = 0x1000
	callq	_round_up
	movl	%eax, (%r15)
	leaq	32(%r15), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	%eax, %ecx
	movl	$1, %r8d
	callq	_nvkm_mm_init
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	movq	_NVKM_MEM_TARGET_INST@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	16(%r15), %r9
	movq	%r14, %rdi
	movl	$65536, %edx                    ## imm = 0x10000
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nvkm_memory_new
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	leaq	12(%r15), %r8
	movq	%r14, %rdi
	movl	$32768, %esi                    ## imm = 0x8000
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_nvkm_ramht_new
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movl	(%rbx), %esi
	leaq	8(%r15), %r9
	movq	%r14, %rdi
	movl	$32768, %edx                    ## imm = 0x8000
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nvkm_memory_new
	testl	%eax, %eax
	je	LBB0_8
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	(%rbx), %esi
	addq	$4, %r15
	movq	%r14, %rdi
	movl	$131072, %edx                   ## imm = 0x20000
	xorl	%ecx, %ecx
	movl	$1, %r8d
	movq	%r15, %r9
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nvkm_memory_new                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NVKM_MEM_TARGET_INST,4,2       ## @NVKM_MEM_TARGET_INST
	.no_dead_strip	_nv40_instmem_oneinit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv40_instmem_oneinit
_nv40_instmem_oneinit:                  ; @nv40_instmem_oneinit
	.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
	bl	_nv40_instmem
	mov	x20, x0
	ldr	x19, [x0, #24]
	mov	x0, x19
	mov	w1, #5440
	bl	_nvkm_rd32
	ubfx	w0, w0, #8, #8
	bl	_hweight8
	mov	x21, x0
	ldr	w8, [x19]
	cmp	w8, #64
	b.ne	LBB0_2
; %bb.1:
	mov	w8, #27296
	b	LBB0_5
LBB0_2:
	cmp	w8, #67
	b.ge	LBB0_4
; %bb.3:
	mov	w8, #20224
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_nv44_gr_class
	cmp	x0, #0
	mov	w8, #18816
	mov	w9, #19008
	csel	w8, w9, w8, eq
LBB0_5:
	mul	w8, w21, w8
	lsl	w8, w8, #5
	add	w0, w8, #384, lsl #12           ; =1572864
	str	w0, [x20]
	mov	w1, #4096
	bl	_round_up
	mov	x3, x0
	mov	x0, x20
	str	w3, [x0], #32
	mov	w1, #0
	mov	w2, #0
	mov	w4, #1
	bl	_nvkm_mm_init
	cbnz	w0, LBB0_9
; %bb.6:
Lloh0:
	adrp	x21, _NVKM_MEM_TARGET_INST@GOTPAGE
Lloh1:
	ldr	x21, [x21, _NVKM_MEM_TARGET_INST@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x5, x20, #16
	mov	x0, x19
	mov	w2, #65536
	mov	w3, #0
	mov	w4, #0
	bl	_nvkm_memory_new
	cbnz	w0, LBB0_9
; %bb.7:
	add	x4, x20, #12
	mov	x0, x19
	mov	w1, #32768
	mov	w2, #0
	mov	x3, #0
	bl	_nvkm_ramht_new
	cbnz	w0, LBB0_9
; %bb.8:
	ldr	w1, [x21]
	add	x5, x20, #8
	mov	x0, x19
	mov	w2, #32768
	mov	w3, #0
	mov	w4, #0
	bl	_nvkm_memory_new
	cbz	w0, LBB0_10
LBB0_9:
	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_10:
	ldr	w1, [x21]
	add	x5, x20, #4
	mov	x0, x19
	mov	w2, #131072
	mov	w3, #0
	mov	w4, #1
	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	_nvkm_memory_new
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_NVKM_MEM_TARGET_INST,4,2       ; @NVKM_MEM_TARGET_INST
	.no_dead_strip	_nv40_instmem_oneinit
.subsections_via_symbols
