	.file	"extr_ttm_bo.c_ttm_bo_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Out of kernel memory\n"
.LC1:
	.string	"Illegal buffer object size\n"
	.text
	.p2align 4
	.globl	ttm_bo_init
	.type	ttm_bo_init, @function
ttm_bo_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	xor	edx, edx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, r8
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, r9d
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR [rdi]
	mov	r14, QWORD PTR 96[rsp]
	mov	QWORD PTR 8[rsp], rsi
	mov	r13, QWORD PTR 8[rax]
	mov	DWORD PTR 4[rsp], ecx
	xor	ecx, ecx
	mov	rsi, r14
	mov	rdi, r13
	call	ttm_mem_global_alloc@PLT
	test	eax, eax
	jne	.L14
	mov	rax, QWORD PTR PAGE_SIZE[rip]
	mov	rcx, QWORD PTR PAGE_SHIFT[rip]
	lea	r12, -1[r12+rax]
	shr	r12, cl
	test	r12, r12
	je	.L15
	mov	rdi, QWORD PTR 8[rsp]
	mov	rax, QWORD PTR 112[rsp]
	mov	QWORD PTR [rdi], rax
	add	rdi, 176
	call	kref_init@PLT
	mov	rax, QWORD PTR 8[rsp]
	lea	rdi, 172[rax]
	call	kref_init@PLT
	mov	rax, QWORD PTR 8[rsp]
	xor	esi, esi
	lea	rdi, 168[rax]
	call	atomic_set@PLT
	mov	rax, QWORD PTR 8[rsp]
	mov	esi, 1
	lea	rdi, 164[rax]
	call	atomic_set@PLT
	mov	rax, QWORD PTR 8[rsp]
	lea	rdi, 160[rax]
	call	init_waitqueue_head@PLT
	mov	rax, QWORD PTR 8[rsp]
	lea	rdi, 156[rax]
	call	INIT_LIST_HEAD@PLT
	mov	rax, QWORD PTR 8[rsp]
	lea	rdi, 152[rax]
	call	INIT_LIST_HEAD@PLT
	mov	rax, QWORD PTR 8[rsp]
	lea	rdi, 148[rax]
	call	INIT_LIST_HEAD@PLT
	mov	rax, QWORD PTR 8[rsp]
	lea	rdi, 144[rax]
	call	INIT_LIST_HEAD@PLT
	mov	rax, QWORD PTR 8[rsp]
	mov	rdx, r12
	mov	rdi, QWORD PTR [r15]
	mov	rcx, QWORD PTR PAGE_SHIFT[rip]
	mov	esi, DWORD PTR 4[rsp]
	mov	QWORD PTR 40[rax], rdi
	sal	rdx, cl
	mov	DWORD PTR 8[rax], esi
	mov	QWORD PTR 64[rax], rdx
	mov	edx, DWORD PTR TTM_PL_SYSTEM[rip]
	mov	QWORD PTR 16[rax], r12
	mov	DWORD PTR 120[rax], edx
	mov	edx, DWORD PTR TTM_PL_FLAG_SYSTEM[rip]
	or	edx, DWORD PTR TTM_PL_FLAG_CACHED[rip]
	mov	QWORD PTR 72[rax], r12
	mov	DWORD PTR 80[rax], edx
	mov	rdx, QWORD PTR 88[rsp]
	mov	QWORD PTR 136[rax], r15
	mov	QWORD PTR 56[rax], rdx
	mov	rdx, QWORD PTR 104[rsp]
	mov	QWORD PTR 112[rax], 0
	mov	QWORD PTR 48[rax], rdx
	mov	DWORD PTR 104[rax], ebx
	mov	DWORD PTR 88[rax], 0
	mov	QWORD PTR 96[rax], 0
	mov	QWORD PTR 128[rax], 0
	mov	DWORD PTR 24[rax], 0
	mov	QWORD PTR 32[rax], r14
	call	atomic_inc@PLT
	mov	rdi, QWORD PTR 8[rsp]
	mov	rsi, rbp
	call	ttm_bo_check_placement@PLT
	xor	edi, edi
	test	eax, eax
	mov	r12d, eax
	setne	dil
	call	unlikely@PLT
	test	rax, rax
	jne	.L9
	mov	rdi, QWORD PTR 8[rsp]
	movsx	rax, DWORD PTR 8[rdi]
	cmp	rax, QWORD PTR ttm_bo_type_device[rip]
	je	.L10
	cmp	rax, QWORD PTR ttm_bo_type_sg[rip]
	je	.L10
.L11:
	mov	edx, DWORD PTR 80[rsp]
	xor	ecx, ecx
	mov	rsi, rbp
	call	ttm_bo_validate@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L16
.L9:
	mov	rdi, QWORD PTR 8[rsp]
	call	ttm_bo_unreserve@PLT
	lea	rdi, 8[rsp]
	call	ttm_bo_unref@PLT
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	lea	rdi, .LC1[rip]
	call	pr_err@PLT
	cmp	QWORD PTR 112[rsp], 0
	mov	rdi, QWORD PTR 8[rsp]
	je	.L7
	call	[QWORD PTR 112[rsp]]
.L8:
	mov	rsi, r14
	mov	rdi, r13
	call	ttm_mem_global_free@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	lea	rdi, .LC0[rip]
	call	pr_err@PLT
	cmp	QWORD PTR 112[rsp], 0
	mov	rdi, QWORD PTR 8[rsp]
	je	.L3
	call	[QWORD PTR 112[rsp]]
.L4:
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rdi, QWORD PTR 8[rsp]
	call	ttm_bo_unreserve@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	call	ttm_bo_setup_vm@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L9
	mov	rdi, QWORD PTR 8[rsp]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	call	kfree@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	call	kfree@PLT
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	ttm_bo_init, .-ttm_bo_init
	.comm	ttm_bo_type_sg,8,8
	.comm	ttm_bo_type_device,8,8
	.comm	TTM_PL_SYSTEM,4,4
	.comm	TTM_PL_FLAG_SYSTEM,4,4
	.comm	TTM_PL_FLAG_CACHED,4,4
	.comm	PAGE_SIZE,8,8
	.comm	PAGE_SHIFT,8,8
	.comm	ENOMEM,4,4
	.comm	EINVAL,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_ttm_bo.c_ttm_bo_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Out of kernel memory\012\000"
	.align	2
.LC1:
	.ascii	"Illegal buffer object size\012\000"
	.text
	.align	2
	.global	ttm_bo_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	ttm_bo_init, %function
ttm_bo_init:
	@ args = 28, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r7, r3
	mov	r3, #0
	mov	fp, r2
	ldr	r2, [r0]
	sub	sp, sp, #12
	ldr	r10, [r2, #4]
	ldr	r8, [sp, #64]
	str	r1, [sp, #4]
	mov	r6, r0
	mov	r2, r3
	mov	r0, r10
	mov	r1, r8
	bl	ttm_mem_global_alloc
	subs	r5, r0, #0
	bne	.L14
	ldr	r2, .L17
	ldr	r9, .L17+4
	ldr	r2, [r2]
	ldr	r4, [r9]
	sub	r2, r2, #1
	add	r2, r2, fp
	lsrs	r4, r2, r4
	beq	.L15
	ldr	r3, [sp, #72]
	ldr	r0, [sp, #4]
	str	r3, [r0], #104
	bl	kref_init
	ldr	r0, [sp, #4]
	add	r0, r0, #100
	bl	kref_init
	ldr	r0, [sp, #4]
	mov	r1, r5
	add	r0, r0, #96
	bl	atomic_set
	ldr	r0, [sp, #4]
	mov	r1, #1
	add	r0, r0, #92
	bl	atomic_set
	ldr	r0, [sp, #4]
	add	r0, r0, #88
	bl	init_waitqueue_head
	ldr	r0, [sp, #4]
	add	r0, r0, #84
	bl	INIT_LIST_HEAD
	ldr	r0, [sp, #4]
	add	r0, r0, #80
	bl	INIT_LIST_HEAD
	ldr	r0, [sp, #4]
	add	r0, r0, #76
	bl	INIT_LIST_HEAD
	ldr	r0, [sp, #4]
	add	r0, r0, #72
	bl	INIT_LIST_HEAD
	ldr	r0, .L17+8
	ldr	r1, .L17+12
	ldr	r2, [r9]
	ldr	r3, [r0]
	ldr	r0, [r1]
	ldr	r1, [sp, #4]
	lsl	r2, r4, r2
	orr	r3, r3, r0
	ldr	r0, [r6]
	str	r2, [r1, #32]
	ldr	r2, [sp, #52]
	ldr	ip, .L17+16
	str	r2, [r1, #52]
	ldr	r2, [sp, #60]
	ldr	ip, [ip]
	str	r2, [r1, #28]
	ldr	r2, [sp, #68]
	str	ip, [r1, #60]
	str	r2, [r1, #24]
	str	r3, [r1, #40]
	str	r4, [r1, #8]
	str	r4, [r1, #36]
	str	r6, [r1, #68]
	str	r0, [r1, #20]
	str	r7, [r1, #4]
	str	r5, [r1, #56]
	str	r5, [r1, #44]
	str	r5, [r1, #48]
	str	r5, [r1, #64]
	str	r5, [r1, #12]
	str	r8, [r1, #16]
	bl	atomic_inc
	ldr	r1, [sp, #48]
	ldr	r0, [sp, #4]
	bl	ttm_bo_check_placement
	mov	r4, r0
	subs	r0, r0, #0
	movne	r0, #1
	bl	unlikely
	cmp	r0, #0
	bne	.L9
	ldr	r0, [sp, #4]
	ldr	r2, .L17+20
	ldr	r3, [r0, #4]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L10
	ldr	r2, .L17+24
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L10
.L11:
	mov	r3, #0
	ldr	r2, [sp, #56]
	ldr	r1, [sp, #48]
	bl	ttm_bo_validate
	subs	r4, r0, #0
	beq	.L16
.L9:
	ldr	r0, [sp, #4]
	bl	ttm_bo_unreserve
	add	r0, sp, #4
	bl	ttm_bo_unref
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	ldr	r0, .L17+28
	bl	pr_err
	ldr	r3, [sp, #72]
	ldr	r0, [sp, #4]
	cmp	r3, #0
	beq	.L7
	blx	r3
.L8:
	mov	r1, r8
	mov	r0, r10
	bl	ttm_mem_global_free
	ldr	r3, .L17+32
	ldr	r4, [r3]
	rsb	r4, r4, #0
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	ldr	r0, .L17+36
	bl	pr_err
	ldr	r3, [sp, #72]
	ldr	r0, [sp, #4]
	cmp	r3, #0
	beq	.L3
	blx	r3
.L4:
	ldr	r3, .L17+40
	ldr	r4, [r3]
	rsb	r4, r4, #0
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	ldr	r0, [sp, #4]
	bl	ttm_bo_unreserve
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L10:
	bl	ttm_bo_setup_vm
	subs	r4, r0, #0
	bne	.L9
	ldr	r0, [sp, #4]
	b	.L11
.L3:
	bl	kfree
	b	.L4
.L7:
	bl	kfree
	b	.L8
.L18:
	.align	2
.L17:
	.word	PAGE_SIZE
	.word	PAGE_SHIFT
	.word	TTM_PL_FLAG_SYSTEM
	.word	TTM_PL_FLAG_CACHED
	.word	TTM_PL_SYSTEM
	.word	ttm_bo_type_device
	.word	ttm_bo_type_sg
	.word	.LC1
	.word	EINVAL
	.word	.LC0
	.word	ENOMEM
	.size	ttm_bo_init, .-ttm_bo_init
	.comm	ttm_bo_type_sg,4,4
	.comm	ttm_bo_type_device,4,4
	.comm	TTM_PL_SYSTEM,4,4
	.comm	TTM_PL_FLAG_SYSTEM,4,4
	.comm	TTM_PL_FLAG_CACHED,4,4
	.comm	PAGE_SIZE,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
