	.file	"extr_ttm_memory.c_ttm_mem_global_reserve.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ttm_mem_global_reserve, @function
ttm_mem_global_reserve:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	r15, 4[rdi]
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	mov	rdi, r15
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	eax, DWORD PTR ENOMEM[rip]
	mov	DWORD PTR 8[rsp], ecx
	mov	QWORD PTR [rsp], rdx
	mov	DWORD PTR 12[rsp], eax
	call	spin_lock@PLT
	mov	ecx, DWORD PTR 0[r13]
	test	r14, r14
	setne	bpl
	xor	ebx, ebx
	test	ecx, ecx
	jne	.L5
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	mov	eax, DWORD PTR 0[r13]
	add	ebx, 1
	cmp	eax, ebx
	jbe	.L37
.L5:
	mov	rdx, QWORD PTR 8[r13]
	mov	eax, ebx
	mov	r12, QWORD PTR [rdx+rax*8]
	cmp	r14, r12
	je	.L4
	test	bpl, bpl
	jne	.L9
.L4:
	mov	edi, DWORD PTR CAP_SYS_ADMIN[rip]
	call	capable@PLT
	mov	rdx, QWORD PTR 8[r12]
	test	rax, rax
	mov	rax, rdx
	cmovne	rax, QWORD PTR [r12]
	cmp	QWORD PTR 16[r12], rax
	jle	.L9
	mov	r14d, DWORD PTR 12[rsp]
	neg	r14d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L37:
	mov	edx, DWORD PTR 8[rsp]
	test	edx, edx
	jne	.L38
.L10:
	xor	r14d, r14d
.L3:
	mov	rdi, r15
	call	spin_unlock@PLT
	mov	rdi, r13
	call	ttm_check_swapping@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r14d
	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
.L38:
	.cfi_restore_state
	test	eax, eax
	je	.L10
	mov	rdx, QWORD PTR 8[r13]
	lea	ecx, -1[rax]
	lea	rax, 8[rdx]
	lea	rcx, [rax+rcx*8]
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L39:
	add	rax, 8
.L13:
	mov	rdx, QWORD PTR [rdx]
	cmp	rdx, r14
	je	.L14
	test	bpl, bpl
	jne	.L11
.L14:
	mov	rsi, QWORD PTR [rsp]
	add	QWORD PTR 16[rdx], rsi
.L11:
	mov	rdx, rax
	cmp	rcx, rax
	jne	.L39
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	ttm_mem_global_reserve, .-ttm_mem_global_reserve
	.comm	ENOMEM,4,4
	.comm	CAP_SYS_ADMIN,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_memory.c_ttm_mem_global_reserve.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ttm_mem_global_reserve, %function
ttm_mem_global_reserve:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r0
	ldr	ip, .L24
	sub	sp, sp, #12
	str	r3, [sp]
	add	fp, r0, #4
	ldr	r3, [ip]
	mov	r0, fp
	mov	r9, r1
	mov	r8, r2
	str	r3, [sp, #4]
	bl	spin_lock
	ldr	r0, [r6]
	cmp	r0, #0
	beq	.L10
	subs	r10, r9, #0
	movne	r10, #1
	mov	r4, #0
	ldr	r7, .L24+4
.L5:
	ldr	r3, [r6, #8]
	ldr	r5, [r3, r4, lsl #2]
	cmp	r9, r5
	moveq	r3, #0
	andne	r3, r10, #1
	cmp	r3, #0
	bne	.L9
	ldr	r0, [r7]
	bl	capable
	ldm	r5, {r3, lr}
	cmp	r0, #0
	moveq	r3, lr
	ldr	ip, [r5, #8]
	cmp	ip, r3
	bgt	.L8
	ldr	r0, [r6]
.L9:
	add	r4, r4, #1
	cmp	r0, r4
	bhi	.L5
	ldr	r3, [sp]
	cmp	r3, #0
	beq	.L10
	cmp	r0, #0
	beq	.L10
	ldr	r3, [r6, #8]
	sub	r3, r3, #4
	add	r0, r3, r0, lsl #2
.L12:
	ldr	ip, [r3, #4]!
	cmp	ip, r9
	moveq	lr, #0
	andne	lr, r10, #1
	cmp	lr, #0
	ldreq	lr, [ip, #8]
	addeq	lr, lr, r8
	streq	lr, [ip, #8]
	cmp	r0, r3
	bne	.L12
.L10:
	mov	r10, #0
.L3:
	mov	r0, fp
	bl	spin_unlock
	mov	r0, r6
	bl	ttm_check_swapping
	mov	r0, r10
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L8:
	ldr	r3, [sp, #4]
	rsb	r10, r3, #0
	b	.L3
.L25:
	.align	2
.L24:
	.word	ENOMEM
	.word	CAP_SYS_ADMIN
	.size	ttm_mem_global_reserve, .-ttm_mem_global_reserve
	.comm	ENOMEM,4,4
	.comm	CAP_SYS_ADMIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
