	.file	"extr_alloc.c_ocfs2_add_clusters_in_btree.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	ocfs2_add_clusters_in_btree
	.type	ocfs2_add_clusters_in_btree, @function
ocfs2_add_clusters_in_btree:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, r8d
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, ecx
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	edi, DWORD PTR 4[rsi]
	mov	r14d, DWORD PTR RESTART_NONE[rip]
	mov	rax, QWORD PTR 128[rsp]
	mov	QWORD PTR 24[rsp], rdx
	mov	QWORD PTR 16[rsp], r9
	mov	QWORD PTR [rsp], rax
	mov	rax, QWORD PTR 136[rsp]
	mov	QWORD PTR 8[rsp], rax
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	call	ocfs2_metadata_cache_get_super@PLT
	mov	edi, eax
	call	OCFS2_SB@PLT
	xor	edi, edi
	test	ebx, ebx
	sete	dil
	mov	QWORD PTR 32[rsp], rax
	call	BUG_ON@PLT
	mov	rdi, r12
	test	ebp, ebp
	cmovne	ebp, DWORD PTR OCFS2_EXT_UNWRITTEN[rip]
	call	ocfs2_num_free_extents@PLT
	mov	r15d, eax
	test	eax, eax
	js	.L32
	jne	.L5
	cmp	QWORD PTR [rsp], 0
	jne	.L5
	mov	r15d, DWORD PTR EAGAIN[rip]
	mov	r14d, DWORD PTR RESTART_META[rip]
	mov	edx, -1
	neg	r15d
.L4:
	mov	rax, QWORD PTR 8[rsp]
	test	rax, rax
	je	.L12
	mov	DWORD PTR [rax], r14d
.L12:
	mov	esi, r14d
	mov	edi, r15d
	call	trace_ocfs2_add_clusters_in_btree_ret@PLT
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L33
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	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
.L5:
	.cfi_restore_state
	test	r15d, r15d
	je	.L34
.L6:
	mov	rsi, QWORD PTR 16[rsp]
	lea	r9, 52[rsp]
	mov	ecx, ebx
	mov	rdi, r13
	lea	r8, 48[rsp]
	mov	edx, 1
	call	__ocfs2_claim_clusters@PLT
	mov	r15d, eax
	test	eax, eax
	js	.L35
	xor	edi, edi
	cmp	DWORD PTR 52[rsp], ebx
	setg	dil
	call	BUG_ON@PLT
	mov	edx, DWORD PTR OCFS2_JOURNAL_ACCESS_WRITE[rip]
	mov	rsi, r12
	mov	rdi, r13
	call	ocfs2_et_root_journal_access@PLT
	mov	r15d, eax
	test	eax, eax
	js	.L30
	mov	rax, QWORD PTR 32[rsp]
	mov	esi, DWORD PTR 48[rsp]
	mov	edi, DWORD PTR [rax]
	call	ocfs2_clusters_to_blocks@PLT
	mov	edx, DWORD PTR 52[rsp]
	mov	esi, DWORD PTR 48[rsp]
	mov	edi, DWORD PTR 4[r12]
	mov	r15d, eax
	mov	DWORD PTR 44[rsp], edx
	mov	DWORD PTR 40[rsp], esi
	call	ocfs2_metadata_cache_owner@PLT
	mov	edx, DWORD PTR 44[rsp]
	mov	esi, DWORD PTR 40[rsp]
	mov	rdi, rax
	call	trace_ocfs2_add_clusters_in_btree@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 136
	mov	ecx, r15d
	mov	r9d, ebp
	push	QWORD PTR 8[rsp]
	.cfi_def_cfa_offset 144
	mov	rax, QWORD PTR 40[rsp]
	mov	rsi, r12
	mov	rdi, r13
	mov	r8d, DWORD PTR 68[rsp]
	mov	edx, DWORD PTR [rax]
	call	ocfs2_insert_extent@PLT
	mov	r15d, eax
	pop	rax
	.cfi_def_cfa_offset 136
	pop	rdx
	.cfi_def_cfa_offset 128
	test	r15d, r15d
	js	.L30
	mov	esi, DWORD PTR [r12]
	mov	rdi, r13
	call	ocfs2_journal_dirty@PLT
	mov	eax, DWORD PTR 52[rsp]
	mov	rcx, QWORD PTR 24[rsp]
	add	DWORD PTR [rcx], eax
	sub	ebx, eax
	mov	edx, ebx
	je	.L4
	mov	r15d, DWORD PTR EAGAIN[rip]
	mov	r14d, DWORD PTR RESTART_TRANS[rip]
	neg	r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L34:
	mov	rdi, QWORD PTR [rsp]
	call	ocfs2_alloc_context_bits_left@PLT
	mov	edi, DWORD PTR 8[r12]
	mov	r15, rax
	call	ocfs2_extend_meta_needed@PLT
	cmp	r15, rax
	jge	.L6
	mov	r15d, DWORD PTR EAGAIN[rip]
	mov	r14d, DWORD PTR RESTART_META[rip]
	mov	edx, -2
	neg	r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L30:
	mov	edi, r15d
	call	mlog_errno@PLT
	mov	rax, QWORD PTR 16[rsp]
	mov	ebx, DWORD PTR 52[rsp]
	mov	esi, DWORD PTR 48[rsp]
	mov	rcx, QWORD PTR OCFS2_AC_USE_LOCAL[rip]
	cmp	QWORD PTR [rax], rcx
	je	.L36
	mov	rax, QWORD PTR 32[rsp]
	mov	edi, DWORD PTR [rax]
	call	ocfs2_clusters_to_blocks@PLT
	mov	r8d, ebx
	mov	rdi, r13
	mov	ecx, eax
	mov	rax, QWORD PTR 16[rsp]
	mov	edx, DWORD PTR 8[rax]
	mov	esi, DWORD PTR 12[rax]
	call	ocfs2_free_clusters@PLT
	xor	edx, edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L35:
	xor	edx, edx
	add	eax, DWORD PTR ENOSPC[rip]
	je	.L4
	mov	edi, r15d
	mov	DWORD PTR [rsp], edx
	call	mlog_errno@PLT
	mov	edx, DWORD PTR [rsp]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L32:
	mov	edi, eax
	call	mlog_errno@PLT
	xor	edx, edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L36:
	mov	rdi, QWORD PTR 32[rsp]
	mov	ecx, esi
	mov	rdx, rax
	mov	r8d, ebx
	mov	rsi, r13
	call	ocfs2_free_local_alloc_bits@PLT
	xor	edx, edx
	jmp	.L4
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ocfs2_add_clusters_in_btree, .-ocfs2_add_clusters_in_btree
	.comm	RESTART_TRANS,4,4
	.comm	RESTART_NONE,4,4
	.comm	RESTART_META,4,4
	.comm	OCFS2_JOURNAL_ACCESS_WRITE,4,4
	.comm	OCFS2_EXT_UNWRITTEN,4,4
	.comm	OCFS2_AC_USE_LOCAL,8,8
	.comm	ENOSPC,4,4
	.comm	EAGAIN,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_alloc.c_ocfs2_add_clusters_in_btree.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	ocfs2_add_clusters_in_btree
	.syntax unified
	.arm
	.fpu softvfp
	.type	ocfs2_add_clusters_in_btree, %function
ocfs2_add_clusters_in_btree:
	@ args = 16, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #44
	str	r2, [sp, #16]
	mov	r5, r3
	ldr	r2, .L33
	ldr	r3, .L33+4
	mov	r7, r0
	ldr	r0, [r1, #4]
	mov	r6, r1
	ldr	r2, [r2]
	str	r2, [sp, #36]
	mov	r2,#0
	ldr	r8, [r3]
	ldr	fp, [sp, #84]
	ldr	r10, [sp, #88]
	ldr	r9, [sp, #92]
	bl	ocfs2_metadata_cache_get_super
	bl	OCFS2_SB
	mov	r3, r0
	clz	r0, r5
	lsr	r0, r0, #5
	str	r3, [sp, #20]
	bl	BUG_ON
	ldr	r3, [sp, #80]
	mov	r0, r6
	cmp	r3, #0
	ldrne	r3, .L33+8
	ldrne	r3, [r3]
	strne	r3, [sp, #80]
	bl	ocfs2_num_free_extents
	subs	r4, r0, #0
	blt	.L26
	orrs	r3, r10, r4
	beq	.L28
	cmp	r4, #0
	beq	.L29
.L6:
	add	r2, sp, #32
	add	r3, sp, #28
	str	r2, [sp, #4]
	str	r3, [sp]
	mov	r2, #1
	mov	r3, r5
	mov	r1, fp
	mov	r0, r7
	bl	__ocfs2_claim_clusters
	subs	r4, r0, #0
	blt	.L30
	ldr	r0, [sp, #32]
	cmp	r0, r5
	movle	r0, #0
	movgt	r0, #1
	bl	BUG_ON
	ldr	r3, .L33+12
	mov	r1, r6
	mov	r0, r7
	ldr	r2, [r3]
	bl	ocfs2_et_root_journal_access
	subs	r4, r0, #0
	blt	.L25
	ldr	r3, [sp, #20]
	ldr	r1, [sp, #28]
	ldr	r0, [r3]
	bl	ocfs2_clusters_to_blocks
	mov	r4, r0
	ldr	r0, [r6, #4]
	bl	ocfs2_metadata_cache_owner
	ldr	r3, [sp, #32]
	ldr	r2, [sp, #28]
	asr	r1, r0, #31
	bl	trace_ocfs2_add_clusters_in_btree
	ldr	r2, [sp, #32]
	ldr	r1, [sp, #80]
	str	r2, [sp]
	ldr	r2, [sp, #16]
	str	r1, [sp, #4]
	str	r10, [sp, #8]
	mov	r3, r4
	mov	r1, r6
	mov	r0, r7
	ldr	r2, [r2]
	bl	ocfs2_insert_extent
	subs	r4, r0, #0
	blt	.L25
	ldr	r1, [r6]
	mov	r0, r7
	bl	ocfs2_journal_dirty
	ldr	r0, [sp, #16]
	ldr	r1, [sp, #32]
	ldr	r3, [r0]
	subs	r2, r5, r1
	add	r3, r3, r1
	str	r3, [r0]
	beq	.L4
	ldr	r1, .L33+16
	ldr	r3, .L33+20
	ldr	r0, [r1]
	ldr	r8, [r3]
	rsb	r4, r0, #0
	b	.L4
.L29:
	mov	r0, r10
	bl	ocfs2_alloc_context_bits_left
	mov	r4, r0
	ldr	r0, [r6, #8]
	bl	ocfs2_extend_meta_needed
	cmp	r4, r0
	bge	.L6
	ldr	r2, .L33+16
	ldr	r3, .L33+24
	ldr	r0, [r2]
	ldr	r8, [r3]
	mvn	r2, #1
	rsb	r4, r0, #0
	b	.L4
.L28:
	ldr	r2, .L33+16
	ldr	r3, .L33+24
	ldr	r0, [r2]
	mvn	r2, #0
	ldr	r8, [r3]
	rsb	r4, r0, #0
.L4:
	cmp	r9, #0
	strne	r8, [r9]
	mov	r1, r8
	mov	r0, r4
	bl	trace_ocfs2_add_clusters_in_btree_ret
	ldr	r3, .L33
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L31
	mov	r0, r4
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L30:
	ldr	r3, .L33+28
	ldr	r3, [r3]
	cmn	r4, r3
	moveq	r2, #0
	beq	.L4
.L26:
	bl	mlog_errno
	mov	r2, #0
	b	.L4
.L25:
	bl	mlog_errno
	ldr	r3, .L33+32
	ldr	r2, [fp]
	ldr	r3, [r3]
	ldr	r1, [sp, #28]
	cmp	r2, r3
	beq	.L32
	ldr	r3, [sp, #20]
	ldr	r5, [fp, #8]
	ldr	r0, [r3]
	ldr	r6, [fp, #4]
	bl	ocfs2_clusters_to_blocks
	ldr	ip, [sp, #32]
	mov	r3, r0
	mov	r2, r6
	mov	r1, r5
	mov	r0, r7
	str	ip, [sp]
	bl	ocfs2_free_clusters
	mov	r2, #0
	b	.L4
.L32:
	ldr	ip, [sp, #32]
	mov	r3, r1
	mov	r2, fp
	mov	r1, r7
	ldr	r0, [sp, #20]
	str	ip, [sp]
	bl	ocfs2_free_local_alloc_bits
	mov	r2, #0
	b	.L4
.L31:
	bl	__stack_chk_fail
.L34:
	.align	2
.L33:
	.word	.LC0
	.word	RESTART_NONE
	.word	OCFS2_EXT_UNWRITTEN
	.word	OCFS2_JOURNAL_ACCESS_WRITE
	.word	EAGAIN
	.word	RESTART_TRANS
	.word	RESTART_META
	.word	ENOSPC
	.word	OCFS2_AC_USE_LOCAL
	.size	ocfs2_add_clusters_in_btree, .-ocfs2_add_clusters_in_btree
	.comm	RESTART_TRANS,4,4
	.comm	RESTART_NONE,4,4
	.comm	RESTART_META,4,4
	.comm	OCFS2_JOURNAL_ACCESS_WRITE,4,4
	.comm	OCFS2_EXT_UNWRITTEN,4,4
	.comm	OCFS2_AC_USE_LOCAL,4,4
	.comm	ENOSPC,4,4
	.comm	EAGAIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
