	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_ttm_init               ## -- Begin function nouveau_ttm_init
	.p2align	4, 0x90
_nouveau_ttm_init:                      ## @nouveau_ttm_init
	.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	%rdi, %r12
	leaq	56(%rdi), %r15
	movq	%r15, %rdi
	callq	_nvxx_device
	movq	%rax, %r14
	movq	8(%rax), %r13
	movq	96(%r12), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_nouveau_ttm_init_host
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.1:
	movq	(%r15), %rax
	movq	_NV_DEVICE_INFO_V0_TESLA@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rax
	jl	LBB0_4
## %bb.2:
	cmpl	$80, 64(%r12)
	je	LBB0_4
## %bb.3:
	movq	_NVIF_MEM_KIND@GOTPCREL(%rip), %rax
	movq	%rsi, %rbx
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_nouveau_ttm_init_host
	movq	%rbx, %rsi
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
LBB0_4:
	movq	72(%r12), %rcx
	movq	_NV_DEVICE_INFO_V0_SOC@GOTPCREL(%rip), %rdx
	movl	$-1, %eax
	cmpq	(%rdx), %rcx
	je	LBB0_8
## %bb.5:
	movq	(%r15), %rcx
	cmpq	(%rsi), %rcx
	jl	LBB0_8
## %bb.6:
	movq	_NVIF_MEM_VRAM@GOTPCREL(%rip), %rax
	movq	_NVIF_MEM_MAPPABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_NVIF_MEM_KIND@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_NVIF_MEM_COMP@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	leaq	88(%r12), %rdi
	movq	_NVIF_MEM_DISP@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	callq	_nvif_mmu_type
	testl	%eax, %eax
	js	LBB0_7
LBB0_8:
	movl	%eax, 8(%r12)
	testq	%r13, %r13
	je	LBB0_11
## %bb.9:
	movq	16(%r13), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%rax, 32(%r12)
	movl	8(%r13), %eax
	movl	%eax, 44(%r12)
	movl	(%r13), %eax
	movl	%eax, 24(%r12)
	movl	4(%r13), %eax
	movl	%eax, 40(%r12)
LBB0_11:
	leaq	12(%r12), %r15
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	cmpl	$33, 88(%r12)
	setl	%cl
	movq	_nouveau_bo_driver@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_ttm_bo_device_init
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_13
LBB0_14:
	movl	80(%r12), %eax
	movl	%eax, (%r12)
	movq	(%r14), %rax
	movq	%r14, %rdi
	movl	$1, %esi
	callq	*8(%rax)
	movl	%eax, %ebx
	movq	(%r14), %rax
	movq	%r14, %rdi
	movl	$1, %esi
	callq	*(%rax)
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_arch_io_reserve_memtype_wc
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %r13
	movb	(%r13), %cl
	sarl	%cl, %edx
	movq	%r15, %rdi
	callq	_ttm_bo_init_mm
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_13
LBB0_16:
	movq	(%r14), %rax
	movq	%r14, %rdi
	movl	$1, %esi
	callq	*8(%rax)
	movl	%eax, %ebx
	movq	(%r14), %rax
	movq	%r14, %rdi
	movl	$1, %esi
	callq	*(%rax)
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_arch_phys_wc_add
	movl	%eax, 16(%r12)
	leaq	24(%r12), %rax
	leaq	48(%r12), %rcx
	cmpq	$0, 32(%r12)
	cmoveq	%rcx, %rax
	movl	(%rax), %edx
	movl	%edx, 4(%r12)
	movq	_TTM_PL_TT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movb	(%r13), %cl
	sarl	%cl, %edx
	movq	%r15, %rdi
	callq	_ttm_bo_init_mm
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
LBB0_13:
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_NV_ERROR
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_ENOSYS@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_18:
	movl	(%r12), %edx
	sarl	$20, %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	callq	_NV_INFO
	movl	4(%r12), %edx
	sarl	$20, %edx
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	callq	_NV_INFO
	xorl	%ebx, %ebx
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_DEVICE_INFO_V0_TESLA,8,3    ## @NV_DEVICE_INFO_V0_TESLA
	.comm	_NVIF_MEM_KIND,4,2              ## @NVIF_MEM_KIND
	.comm	_NV_DEVICE_INFO_V0_SOC,8,3      ## @NV_DEVICE_INFO_V0_SOC
	.comm	_NVIF_MEM_VRAM,4,2              ## @NVIF_MEM_VRAM
	.comm	_NVIF_MEM_MAPPABLE,4,2          ## @NVIF_MEM_MAPPABLE
	.comm	_NVIF_MEM_COMP,4,2              ## @NVIF_MEM_COMP
	.comm	_NVIF_MEM_DISP,4,2              ## @NVIF_MEM_DISP
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.comm	_nouveau_bo_driver,4,2          ## @nouveau_bo_driver
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error initialising bo driver, %d\n"

	.comm	_TTM_PL_VRAM,4,2                ## @TTM_PL_VRAM
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
L_.str.1:                               ## @.str.1
	.asciz	"VRAM mm init failed, %d\n"

	.comm	_TTM_PL_TT,4,2                  ## @TTM_PL_TT
L_.str.2:                               ## @.str.2
	.asciz	"GART mm init failed, %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"VRAM: %d MiB\n"

L_.str.4:                               ## @.str.4
	.asciz	"GART: %d MiB\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_ttm_init               ; -- Begin function nouveau_ttm_init
	.p2align	2
_nouveau_ttm_init:                      ; @nouveau_ttm_init
	.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, x0
	add	x21, x0, #56
	mov	x0, x21
	bl	_nvxx_device
	mov	x20, x0
	ldr	x24, [x0, #8]
	ldr	x23, [x19, #96]
	mov	x0, x19
	mov	w1, #0
	bl	_nouveau_ttm_init_host
	mov	x22, x0
	cbnz	w0, LBB0_19
; %bb.1:
	ldr	x8, [x21]
Lloh0:
	adrp	x25, _NV_DEVICE_INFO_V0_TESLA@GOTPAGE
Lloh1:
	ldr	x25, [x25, _NV_DEVICE_INFO_V0_TESLA@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x8, x9
	b.lt	LBB0_4
; %bb.2:
	ldr	w8, [x19, #64]
	cmp	w8, #80
	b.eq	LBB0_4
; %bb.3:
Lloh2:
	adrp	x8, _NVIF_MEM_KIND@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NVIF_MEM_KIND@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_nouveau_ttm_init_host
	mov	x22, x0
	cbnz	w0, LBB0_19
LBB0_4:
	ldr	x8, [x19, #72]
Lloh5:
	adrp	x9, _NV_DEVICE_INFO_V0_SOC@GOTPAGE
Lloh6:
	ldr	x9, [x9, _NV_DEVICE_INFO_V0_SOC@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_6
; %bb.5:
	ldr	x8, [x21]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ge	LBB0_14
LBB0_6:
	mov	w0, #-1
LBB0_7:
	str	w0, [x19, #8]
	cbz	x24, LBB0_10
; %bb.8:
	ldr	x8, [x24, #16]
	cbz	x8, LBB0_10
; %bb.9:
	str	x8, [x19, #32]
	ldr	w8, [x24]
	str	w8, [x19, #24]
	ldur	d0, [x24, #4]
	str	d0, [x19, #40]
LBB0_10:
	add	x21, x19, #12
	ldr	x8, [x23]
	ldr	w2, [x8]
	ldr	w8, [x19, #88]
	cmp	w8, #33
	cset	w3, lt
Lloh8:
	adrp	x1, _nouveau_bo_driver@GOTPAGE
Lloh9:
	ldr	x1, [x1, _nouveau_bo_driver@GOTPAGEOFF]
	mov	x0, x21
	bl	_ttm_bo_device_init
	cbz	w0, LBB0_12
; %bb.11:
	mov	x22, x0
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_18
LBB0_12:
	ldr	w8, [x19, #80]
	str	w8, [x19]
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	mov	x0, x20
	mov	w1, #1
	blr	x8
	mov	x22, x0
	ldr	x8, [x20]
	ldr	x8, [x8]
	mov	x0, x20
	mov	w1, #1
	blr	x8
	mov	x1, x0
	mov	x0, x22
	bl	_arch_io_reserve_memtype_wc
Lloh12:
	adrp	x8, _TTM_PL_VRAM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	w8, [x19]
Lloh15:
	adrp	x23, _PAGE_SHIFT@GOTPAGE
Lloh16:
	ldr	x23, [x23, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	w9, [x23]
	asr	w2, w8, w9
	mov	x0, x21
	bl	_ttm_bo_init_mm
	cbz	w0, LBB0_16
; %bb.13:
	mov	x22, x0
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_18
LBB0_14:
Lloh19:
	adrp	x8, _NVIF_MEM_VRAM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _NVIF_MEM_VRAM@GOTPAGEOFF]
	add	x0, x19, #88
Lloh21:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _NVIF_MEM_MAPPABLE@GOTPAGE
Lloh23:
	ldr	x9, [x9, _NVIF_MEM_MAPPABLE@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh25:
	adrp	x9, _NVIF_MEM_KIND@GOTPAGE
Lloh26:
	ldr	x9, [x9, _NVIF_MEM_KIND@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh28:
	adrp	x9, _NVIF_MEM_COMP@GOTPAGE
Lloh29:
	ldr	x9, [x9, _NVIF_MEM_COMP@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh31:
	adrp	x9, _NVIF_MEM_DISP@GOTPAGE
Lloh32:
	ldr	x9, [x9, _NVIF_MEM_DISP@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	orr	w1, w8, w9
	bl	_nvif_mmu_type
	tbz	w0, #31, LBB0_7
; %bb.15:
Lloh34:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_19
LBB0_16:
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	mov	x0, x20
	mov	w1, #1
	blr	x8
	mov	x22, x0
	ldr	x8, [x20]
	ldr	x8, [x8]
	mov	x0, x20
	mov	w1, #1
	blr	x8
	mov	x1, x0
	mov	x0, x22
	bl	_arch_phys_wc_add
	str	w0, [x19, #16]
	ldr	x8, [x19, #32]
	mov	w9, #24
	mov	w10, #48
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	w8, [x19, x8]
	str	w8, [x19, #4]
Lloh37:
	adrp	x9, _TTM_PL_TT@GOTPAGE
Lloh38:
	ldr	x9, [x9, _TTM_PL_TT@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x9]
	ldr	w9, [x23]
	asr	w2, w8, w9
	mov	x0, x21
	bl	_ttm_bo_init_mm
	mov	x22, x0
	cbz	w0, LBB0_20
; %bb.17:
Lloh40:
	adrp	x1, l_.str.2@PAGE
Lloh41:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_18:
	mov	x0, x19
	mov	x2, x22
	bl	_NV_ERROR
LBB0_19:
	mov	x0, 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
	ret
LBB0_20:
	ldr	w8, [x19]
	asr	w2, w8, #20
Lloh42:
	adrp	x1, l_.str.3@PAGE
Lloh43:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_NV_INFO
	ldr	w8, [x19, #4]
	asr	w2, w8, #20
Lloh44:
	adrp	x1, l_.str.4@PAGE
Lloh45:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_NV_INFO
	b	LBB0_19
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_DEVICE_INFO_V0_TESLA,8,3    ; @NV_DEVICE_INFO_V0_TESLA
	.comm	_NVIF_MEM_KIND,4,2              ; @NVIF_MEM_KIND
	.comm	_NV_DEVICE_INFO_V0_SOC,8,3      ; @NV_DEVICE_INFO_V0_SOC
	.comm	_NVIF_MEM_VRAM,4,2              ; @NVIF_MEM_VRAM
	.comm	_NVIF_MEM_MAPPABLE,4,2          ; @NVIF_MEM_MAPPABLE
	.comm	_NVIF_MEM_COMP,4,2              ; @NVIF_MEM_COMP
	.comm	_NVIF_MEM_DISP,4,2              ; @NVIF_MEM_DISP
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.comm	_nouveau_bo_driver,4,2          ; @nouveau_bo_driver
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error initialising bo driver, %d\n"

	.comm	_TTM_PL_VRAM,4,2                ; @TTM_PL_VRAM
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
l_.str.1:                               ; @.str.1
	.asciz	"VRAM mm init failed, %d\n"

	.comm	_TTM_PL_TT,4,2                  ; @TTM_PL_TT
l_.str.2:                               ; @.str.2
	.asciz	"GART mm init failed, %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"VRAM: %d MiB\n"

l_.str.4:                               ; @.str.4
	.asciz	"GART: %d MiB\n"

.subsections_via_symbols
