	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv1a_ram_new                   ## -- Begin function nv1a_ram_new
	.p2align	4, 0x90
_nv1a_ram_new:                          ## @nv1a_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movl	4(%rax), %edi
	callq	_dev_is_pci
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	(%r15), %rax
	movl	4(%rax), %edi
	callq	_to_pci_dev
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	(%rax), %edi
	callq	_pci_domain_nr
	movl	%eax, %r12d
LBB0_3:
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	movl	$1, %esi
	callq	_PCI_DEVFN
	movl	%r12d, %edi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_pci_get_domain_bus_and_slot
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	(%r15), %rcx
	cmpl	$26, (%rcx)
	jne	LBB0_7
## %bb.6:
	leaq	-36(%rbp), %rdx
	movq	%rax, %rdi
	movl	$124, %esi
	callq	_pci_read_config_dword
	movl	-36(%rbp), %ecx
	shrl	$6, %ecx
	andl	$31, %ecx
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_nvkm_error
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_7:
	leaq	-36(%rbp), %rdx
	movq	%rax, %rdi
	movl	$132, %esi
	callq	_pci_read_config_dword
	movl	-36(%rbp), %ecx
	shrl	$4, %ecx
	andl	$127, %ecx
LBB0_8:
	movq	_NVKM_RAM_TYPE_STOLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	shll	$20, %ecx
	addl	$1048576, %ecx                  ## imm = 0x100000
	movq	_nv04_ram_func@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	movq	%r14, %r8
	callq	_nvkm_ram_new_
	movl	%eax, %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no bridge device\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_nv04_ram_func,4,2              ## @nv04_ram_func
	.comm	_NVKM_RAM_TYPE_STOLEN,4,2       ## @NVKM_RAM_TYPE_STOLEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv1a_ram_new                   ; -- Begin function nv1a_ram_new
	.p2align	2
_nv1a_ram_new:                          ; @nv1a_ram_new
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x1
	mov	x20, x0
	ldr	x8, [x0]
	ldr	w0, [x8, #4]
	bl	_dev_is_pci
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x20]
	ldr	w0, [x8, #4]
	bl	_to_pci_dev
	cbz	x0, LBB0_3
; %bb.2:
	ldr	w0, [x0]
	bl	_pci_domain_nr
	mov	x21, x0
	b	LBB0_4
LBB0_3:
	mov	w21, #0
LBB0_4:
	mov	w0, #0
	mov	w1, #1
	bl	_PCI_DEVFN
	mov	x2, x0
	mov	x0, x21
	mov	w1, #0
	bl	_pci_get_domain_bus_and_slot
	cbz	x0, LBB0_7
; %bb.5:
	ldr	x8, [x20]
	ldr	w8, [x8]
	add	x2, sp, #12
	cmp	w8, #26
	b.ne	LBB0_8
; %bb.6:
	mov	w1, #124
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	ubfx	w8, w8, #6, #5
	b	LBB0_9
LBB0_7:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_nvkm_error
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_8:
	mov	w1, #132
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	ubfx	w8, w8, #4, #7
LBB0_9:
Lloh5:
	adrp	x9, _NVKM_RAM_TYPE_STOLEN@GOTPAGE
Lloh6:
	ldr	x9, [x9, _NVKM_RAM_TYPE_STOLEN@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x9]
	lsl	w8, w8, #20
	add	w3, w8, #256, lsl #12           ; =1048576
Lloh8:
	adrp	x0, _nv04_ram_func@GOTPAGE
Lloh9:
	ldr	x0, [x0, _nv04_ram_func@GOTPAGEOFF]
	mov	x1, x20
	mov	x4, x19
	bl	_nvkm_ram_new_
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no bridge device\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_nv04_ram_func,4,2              ; @nv04_ram_func
	.comm	_NVKM_RAM_TYPE_STOLEN,4,2       ; @NVKM_RAM_TYPE_STOLEN
.subsections_via_symbols
