	.file	"extr_nouveau_ttm.c_nouveau_ttm_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"error initialising bo driver, %d\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"VRAM mm init failed, %d\n"
.LC2:
	.string	"GART mm init failed, %d\n"
.LC3:
	.string	"VRAM: %d MiB\n"
.LC4:
	.string	"GART: %d MiB\n"
	.text
	.p2align 4
	.globl	nouveau_ttm_init
	.type	nouveau_ttm_init, @function
nouveau_ttm_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	add	rdi, 56
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	nvxx_device@PLT
	xor	esi, esi
	mov	rdi, rbp
	mov	rbx, QWORD PTR 96[rbp]
	mov	r13, QWORD PTR 8[rax]
	mov	r14, rax
	call	nouveau_ttm_init_host@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	rax, QWORD PTR NV_DEVICE_INFO_V0_TESLA[rip]
	cmp	QWORD PTR 56[rbp], rax
	jge	.L23
.L3:
	mov	DWORD PTR 8[rbp], -1
.L7:
	test	r13, r13
	je	.L8
	mov	rax, QWORD PTR 16[r13]
	test	rax, rax
	jne	.L24
.L8:
	mov	rax, QWORD PTR [rbx]
	xor	ecx, ecx
	lea	r13, 12[rbp]
	cmp	DWORD PTR 88[rbp], 32
	setle	cl
	lea	rsi, nouveau_bo_driver[rip]
	mov	rdi, r13
	mov	edx, DWORD PTR [rax]
	call	ttm_bo_device_init@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L25
	mov	eax, DWORD PTR 80[rbp]
	mov	esi, 1
	mov	rdi, r14
	mov	DWORD PTR 0[rbp], eax
	mov	rax, QWORD PTR [r14]
	call	[QWORD PTR [rax]]
	mov	esi, 1
	mov	rdi, r14
	mov	r12d, eax
	mov	rax, QWORD PTR [r14]
	call	[QWORD PTR 8[rax]]
	mov	esi, r12d
	mov	edi, eax
	call	arch_io_reserve_memtype_wc@PLT
	mov	ecx, DWORD PTR PAGE_SHIFT[rip]
	mov	edx, DWORD PTR 0[rbp]
	mov	rdi, r13
	mov	esi, DWORD PTR TTM_PL_VRAM[rip]
	sar	edx, cl
	call	ttm_bo_init_mm@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L26
	mov	rax, QWORD PTR [r14]
	mov	esi, 1
	mov	rdi, r14
	call	[QWORD PTR [rax]]
	mov	esi, 1
	mov	rdi, r14
	mov	r12d, eax
	mov	rax, QWORD PTR [r14]
	call	[QWORD PTR 8[rax]]
	mov	esi, r12d
	mov	edi, eax
	call	arch_phys_wc_add@PLT
	cmp	QWORD PTR 32[rbp], 0
	mov	DWORD PTR 16[rbp], eax
	je	.L27
	mov	edx, DWORD PTR 24[rbp]
.L12:
	mov	DWORD PTR 4[rbp], edx
	mov	ecx, DWORD PTR PAGE_SHIFT[rip]
	mov	rdi, r13
	mov	esi, DWORD PTR TTM_PL_TT[rip]
	sar	edx, cl
	call	ttm_bo_init_mm@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L28
	mov	edx, DWORD PTR 0[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rbp
	sar	edx, 20
	call	NV_INFO@PLT
	mov	edx, DWORD PTR 4[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rbp
	sar	edx, 20
	call	NV_INFO@PLT
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	cmp	DWORD PTR 64[rbp], 80
	jne	.L29
	mov	rax, QWORD PTR NV_DEVICE_INFO_V0_SOC[rip]
	cmp	QWORD PTR 72[rbp], rax
	je	.L3
.L14:
	mov	esi, DWORD PTR NVIF_MEM_VRAM[rip]
	lea	rdi, 88[rbp]
	or	esi, DWORD PTR NVIF_MEM_MAPPABLE[rip]
	or	esi, DWORD PTR NVIF_MEM_KIND[rip]
	or	esi, DWORD PTR NVIF_MEM_COMP[rip]
	or	esi, DWORD PTR NVIF_MEM_DISP[rip]
	call	nvif_mmu_type@PLT
	mov	r12d, DWORD PTR ENOSYS[rip]
	neg	r12d
	test	eax, eax
	js	.L1
	mov	DWORD PTR 8[rbp], eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L24:
	mov	QWORD PTR 32[rbp], rax
	mov	eax, DWORD PTR 8[r13]
	mov	DWORD PTR 44[rbp], eax
	mov	eax, DWORD PTR 0[r13]
	mov	DWORD PTR 24[rbp], eax
	mov	eax, DWORD PTR 4[r13]
	mov	DWORD PTR 40[rbp], eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L27:
	mov	edx, DWORD PTR 48[rbp]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L29:
	mov	esi, DWORD PTR NVIF_MEM_KIND[rip]
	mov	rdi, rbp
	call	nouveau_ttm_init_host@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	rax, QWORD PTR NV_DEVICE_INFO_V0_SOC[rip]
	cmp	QWORD PTR 72[rbp], rax
	je	.L3
	mov	rax, QWORD PTR NV_DEVICE_INFO_V0_TESLA[rip]
	cmp	QWORD PTR 56[rbp], rax
	jl	.L3
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rdi, rbp
	mov	edx, eax
	lea	rsi, .LC2[rip]
	call	NV_ERROR@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	mov	rdi, rbp
	mov	edx, eax
	lea	rsi, .LC0[rip]
	call	NV_ERROR@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	mov	edx, eax
	lea	rsi, .LC1[rip]
	mov	rdi, rbp
	call	NV_ERROR@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	nouveau_ttm_init, .-nouveau_ttm_init
	.comm	nouveau_bo_driver,4,4
	.comm	TTM_PL_VRAM,4,4
	.comm	TTM_PL_TT,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	NV_DEVICE_INFO_V0_TESLA,8,8
	.comm	NV_DEVICE_INFO_V0_SOC,8,8
	.comm	NVIF_MEM_VRAM,4,4
	.comm	NVIF_MEM_MAPPABLE,4,4
	.comm	NVIF_MEM_KIND,4,4
	.comm	NVIF_MEM_DISP,4,4
	.comm	NVIF_MEM_COMP,4,4
	.comm	ENOSYS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_nouveau_ttm.c_nouveau_ttm_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"error initialising bo driver, %d\012\000"
	.align	2
.LC1:
	.ascii	"VRAM mm init failed, %d\012\000"
	.align	2
.LC2:
	.ascii	"GART mm init failed, %d\012\000"
	.align	2
.LC3:
	.ascii	"VRAM: %d MiB\012\000"
	.align	2
.LC4:
	.ascii	"GART: %d MiB\012\000"
	.text
	.align	2
	.global	nouveau_ttm_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	nouveau_ttm_init, %function
nouveau_ttm_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	add	r0, r0, #40
	bl	nvxx_device
	mov	r6, r0
	mov	r1, #0
	mov	r0, r4
	ldr	r7, [r6, #4]
	ldr	r8, [r4, #60]
	bl	nouveau_ttm_init_host
	subs	r5, r0, #0
	bne	.L1
	ldr	r9, .L30
	ldr	r2, [r4, #40]
	ldr	r3, [r9]
	cmp	r2, r3
	bge	.L24
.L3:
	mvn	r3, #0
	str	r3, [r4, #8]
.L7:
	cmp	r7, #0
	beq	.L8
	ldr	r3, [r7, #12]
	cmp	r3, #0
	bne	.L25
.L8:
	ldr	r3, [r4, #56]
	ldr	r2, [r8]
	cmp	r3, #32
	add	r7, r4, #12
	movgt	r3, #0
	movle	r3, #1
	mov	r0, r7
	ldr	r2, [r2]
	ldr	r1, .L30+4
	bl	ttm_bo_device_init
	subs	r5, r0, #0
	bne	.L26
	ldr	r2, [r4, #52]
	ldr	r3, [r6]
	mov	r1, #1
	str	r2, [r4]
	ldr	r3, [r3, #4]
	mov	r0, r6
	blx	r3
	ldr	r3, [r6]
	mov	r5, r0
	ldr	r3, [r3]
	mov	r1, #1
	mov	r0, r6
	blx	r3
	ldr	r8, .L30+8
	mov	r1, r0
	mov	r0, r5
	bl	arch_io_reserve_memtype_wc
	ldr	r1, [r4]
	ldr	r2, [r8]
	ldr	r3, .L30+12
	asr	r2, r1, r2
	mov	r0, r7
	ldr	r1, [r3]
	bl	ttm_bo_init_mm
	subs	r5, r0, #0
	bne	.L27
	ldr	r3, [r6]
	mov	r1, #1
	ldr	r3, [r3, #4]
	mov	r0, r6
	blx	r3
	ldr	r3, [r6]
	mov	r5, r0
	ldr	r3, [r3]
	mov	r1, #1
	mov	r0, r6
	blx	r3
	mov	r1, r0
	mov	r0, r5
	bl	arch_phys_wc_add
	ldr	r3, [r4, #24]
	ldr	r2, [r8]
	cmp	r3, #0
	ldreq	r3, [r4, #36]
	ldrne	r3, [r4, #20]
	ldr	r1, .L30+16
	str	r0, [r4, #16]
	ldr	r1, [r1]
	mov	r0, r7
	asr	r2, r3, r2
	str	r3, [r4, #4]
	bl	ttm_bo_init_mm
	subs	r5, r0, #0
	bne	.L28
	ldr	r2, [r4]
	ldr	r1, .L30+20
	asr	r2, r2, #20
	mov	r0, r4
	bl	NV_INFO
	ldr	r2, [r4, #4]
	mov	r0, r4
	ldr	r1, .L30+24
	asr	r2, r2, #20
	bl	NV_INFO
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L24:
	ldr	r3, [r4, #44]
	cmp	r3, #80
	bne	.L29
	ldr	r3, .L30+28
	ldr	r2, [r4, #48]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L3
	ldr	r10, .L30+32
.L14:
	ldr	r2, .L30+36
	ldr	r3, .L30+40
	ldr	r0, [r2]
	ldr	r3, [r3]
	ldr	r2, .L30+44
	ldr	r1, [r10]
	orr	r3, r3, r0
	ldr	r0, .L30+48
	ldr	r2, [r2]
	orr	r3, r3, r1
	ldr	r1, [r0]
	orr	r3, r3, r2
	orr	r1, r3, r1
	add	r0, r4, #56
	bl	nvif_mmu_type
	cmp	r0, #0
	strge	r0, [r4, #8]
	bge	.L7
	ldr	r3, .L30+52
	ldr	r0, [r3]
	rsb	r5, r0, #0
	b	.L1
.L25:
	ldr	r1, [r7, #8]
	str	r3, [r4, #24]
	ldm	r7, {r2, r3}
	str	r1, [r4, #32]
	str	r2, [r4, #20]
	str	r3, [r4, #28]
	b	.L8
.L29:
	ldr	r10, .L30+32
	mov	r0, r4
	ldr	r1, [r10]
	bl	nouveau_ttm_init_host
	subs	r5, r0, #0
	bne	.L1
	ldr	r3, .L30+28
	ldr	r2, [r4, #48]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L3
	ldr	r3, [r9]
	ldr	r2, [r4, #40]
	cmp	r2, r3
	blt	.L3
	b	.L14
.L28:
	mov	r0, r4
	mov	r2, r5
	ldr	r1, .L30+56
	bl	NV_ERROR
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L26:
	mov	r0, r4
	mov	r2, r5
	ldr	r1, .L30+60
	bl	NV_ERROR
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L27:
	mov	r0, r4
	mov	r2, r5
	ldr	r1, .L30+64
	bl	NV_ERROR
	b	.L1
.L31:
	.align	2
.L30:
	.word	NV_DEVICE_INFO_V0_TESLA
	.word	nouveau_bo_driver
	.word	PAGE_SHIFT
	.word	TTM_PL_VRAM
	.word	TTM_PL_TT
	.word	.LC3
	.word	.LC4
	.word	NV_DEVICE_INFO_V0_SOC
	.word	NVIF_MEM_KIND
	.word	NVIF_MEM_MAPPABLE
	.word	NVIF_MEM_VRAM
	.word	NVIF_MEM_COMP
	.word	NVIF_MEM_DISP
	.word	ENOSYS
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.size	nouveau_ttm_init, .-nouveau_ttm_init
	.comm	nouveau_bo_driver,4,4
	.comm	TTM_PL_VRAM,4,4
	.comm	TTM_PL_TT,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	NV_DEVICE_INFO_V0_TESLA,4,4
	.comm	NV_DEVICE_INFO_V0_SOC,4,4
	.comm	NVIF_MEM_VRAM,4,4
	.comm	NVIF_MEM_MAPPABLE,4,4
	.comm	NVIF_MEM_KIND,4,4
	.comm	NVIF_MEM_DISP,4,4
	.comm	NVIF_MEM_COMP,4,4
	.comm	ENOSYS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
