	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv40_instmem_ctor
_nv40_instmem_ctor:                     ## @nv40_instmem_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r13
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_nv_device
	movq	%rax, %r12
	movq	8(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	-48(%rbp), %rcx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_nouveau_instmem_create
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi
	callq	_nv_object
	movq	%rax, (%r13)
	testl	%ebx, %ebx
	je	LBB0_1
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	$2, %esi
	callq	_pci_resource_len
	xorl	%ebx, %ebx
	testq	%rax, %rax
	sete	%bl
	orl	$2, %ebx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_pci_resource_start
	movl	%eax, %r14d
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_pci_resource_len
	movl	%r14d, %edi
	movq	%rax, %rsi
	callq	_ioremap
	movq	-48(%rbp), %rdi
	movl	%eax, 32(%rdi)
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movl	$5440, %esi                     ## imm = 0x1540
	callq	_nv_rd32
	movzbl	%ah, %edi
	callq	_hweight8
	movl	%eax, %ebx
	movl	(%r12), %ecx
	movl	$27296, %eax                    ## imm = 0x6AA0
	cmpl	$64, %ecx
	je	LBB0_6
## %bb.4:
	movl	$20224, %eax                    ## imm = 0x4F00
	cmpl	$67, %ecx
	jl	LBB0_6
## %bb.5:
	movq	-48(%rbp), %rdi
	callq	_nv44_graph_class
	testq	%rax, %rax
	movl	$19008, %ecx                    ## imm = 0x4A40
	movl	$18816, %eax                    ## imm = 0x4980
	cmovel	%ecx, %eax
LBB0_6:
	imull	%eax, %ebx
	movq	-48(%rbp), %rax
	shll	$5, %ebx
	addl	$1572864, %ebx                  ## imm = 0x180000
	movl	%ebx, 20(%rax)
	movl	%ebx, %edi
	movl	$4096, %esi                     ## imm = 0x1000
	callq	_round_up
	movq	-48(%rbp), %rdi
	movl	%eax, 20(%rdi)
	movq	_nv04_instmem_alloc@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 24(%rdi)
	addq	$28, %rdi
	xorl	%esi, %esi
	movl	%eax, %edx
	movl	$1, %ecx
	callq	_nouveau_mm_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.7:
	movq	-48(%rbp), %r9
	addq	$16, %r9
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$65536, %edx                    ## imm = 0x10000
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nouveau_gpuobj_new
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:
	movq	-48(%rbp), %r8
	addq	$12, %r8
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$32768, %edx                    ## imm = 0x8000
	xorl	%ecx, %ecx
	callq	_nouveau_ramht_new
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.9:
	movq	-48(%rbp), %r9
	addq	$8, %r9
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$32768, %edx                    ## imm = 0x8000
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nouveau_gpuobj_new
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.10:
	movq	_NVOBJ_FLAG_ZERO_ALLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-48(%rbp), %r9
	addq	$4, %r9
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$131072, %edx                   ## imm = 0x20000
	xorl	%ecx, %ecx
	callq	_nouveau_gpuobj_new
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movq	-48(%rbp), %rax
	movl	$1, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_2:
	leaq	L_.str(%rip), %rsi
	callq	_nv_error
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to map PRAMIN BAR\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_nv04_instmem_alloc,4,2         ## @nv04_instmem_alloc
	.comm	_NVOBJ_FLAG_ZERO_ALLOC,4,2      ## @NVOBJ_FLAG_ZERO_ALLOC
	.no_dead_strip	_nv40_instmem_ctor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv40_instmem_ctor
_nv40_instmem_ctor:                     ; @nv40_instmem_ctor
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x23, x5
	mov	x21, x2
	mov	x24, x1
	mov	x19, x0
	bl	_nv_device
	mov	x20, x0
	ldr	x22, [x0, #8]
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x24
	mov	x2, x21
	bl	_nouveau_instmem_create
	mov	x21, x0
	ldr	x0, [sp, #8]
	bl	_nv_object
	str	x0, [x23]
	cbz	w21, LBB0_2
LBB0_1:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
LBB0_2:
	mov	w21, #2
	mov	x0, x22
	mov	w1, #2
	bl	_pci_resource_len
	cmp	x0, #0
	cinc	w21, w21, eq
	mov	x0, x22
	mov	x1, x21
	bl	_pci_resource_start
	mov	x23, x0
	mov	x0, x22
	mov	x1, x21
	bl	_pci_resource_len
	mov	x1, x0
	mov	x0, x23
	bl	_ioremap
	mov	x8, x0
	ldr	x0, [sp, #8]
	str	w8, [x0, #32]
	cbz	w8, LBB0_5
; %bb.3:
	mov	w1, #5440
	bl	_nv_rd32
	ubfx	w0, w0, #8, #8
	bl	_hweight8
	mov	x21, x0
	ldr	w8, [x20]
	cmp	w8, #64
	b.ne	LBB0_6
; %bb.4:
	mov	w8, #27296
	b	LBB0_9
LBB0_5:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_nv_error
Lloh2:
	adrp	x8, _EFAULT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_1
LBB0_6:
	cmp	w8, #67
	b.ge	LBB0_8
; %bb.7:
	mov	w8, #20224
	b	LBB0_9
LBB0_8:
	ldr	x0, [sp, #8]
	bl	_nv44_graph_class
	cmp	x0, #0
	mov	w8, #18816
	mov	w9, #19008
	csel	w8, w9, w8, eq
LBB0_9:
	mul	w8, w21, w8
	ldr	x9, [sp, #8]
	lsl	w8, w8, #5
	add	w0, w8, #384, lsl #12           ; =1572864
	str	w0, [x9, #20]
	mov	w1, #4096
	bl	_round_up
	mov	x2, x0
	ldr	x8, [sp, #8]
Lloh5:
	adrp	x9, _nv04_instmem_alloc@GOTPAGE
Lloh6:
	ldr	x9, [x9, _nv04_instmem_alloc@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	stp	w0, w9, [x8, #20]
	add	x0, x8, #28
	mov	w1, #0
	mov	w3, #1
	bl	_nouveau_mm_init
	mov	x21, x0
	cbnz	w0, LBB0_1
; %bb.10:
	ldr	x8, [sp, #8]
	add	x5, x8, #16
	mov	x0, x19
	mov	x1, #0
	mov	w2, #65536
	mov	w3, #0
	mov	w4, #0
	bl	_nouveau_gpuobj_new
	mov	x21, x0
	cbnz	w0, LBB0_1
; %bb.11:
	ldr	x8, [sp, #8]
	add	x4, x8, #12
	mov	x0, x19
	mov	x1, #0
	mov	w2, #32768
	mov	w3, #0
	bl	_nouveau_ramht_new
	mov	x21, x0
	cbnz	w0, LBB0_1
; %bb.12:
	ldr	x8, [sp, #8]
	add	x5, x8, #8
	mov	x0, x19
	mov	x1, #0
	mov	w2, #32768
	mov	w3, #0
	mov	w4, #0
	bl	_nouveau_gpuobj_new
	mov	x21, x0
	cbnz	w0, LBB0_1
; %bb.13:
Lloh8:
	adrp	x8, _NVOBJ_FLAG_ZERO_ALLOC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NVOBJ_FLAG_ZERO_ALLOC@GOTPAGEOFF]
Lloh10:
	ldr	w4, [x8]
	ldr	x8, [sp, #8]
	add	x5, x8, #4
	mov	x0, x19
	mov	x1, #0
	mov	w2, #131072
	mov	w3, #0
	bl	_nouveau_gpuobj_new
	mov	x21, x0
	cbnz	w0, LBB0_1
; %bb.14:
	ldr	x8, [sp, #8]
	mov	w9, #1
	str	w9, [x8]
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to map PRAMIN BAR\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_nv04_instmem_alloc,4,2         ; @nv04_instmem_alloc
	.comm	_NVOBJ_FLAG_ZERO_ALLOC,4,2      ; @NVOBJ_FLAG_ZERO_ALLOC
	.no_dead_strip	_nv40_instmem_ctor
.subsections_via_symbols
