	.file	"extr_extent-tree.c_btrfs_remove_block_group.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	btrfs_remove_block_group
	.type	btrfs_remove_block_group, @function
btrfs_remove_block_group:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r8, rsi
	mov	esi, edx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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, 72
	.cfi_def_cfa_offset 128
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR [r8]
	lea	r15, 32[rsp]
	mov	r13, QWORD PTR 16[rax]
	mov	rbx, QWORD PTR 24[rax]
	mov	rdi, QWORD PTR 0[r13]
	call	btrfs_lookup_block_group@PLT
	xor	edi, edi
	test	rax, rax
	mov	rbp, rax
	sete	dil
	call	BUG_ON@PLT
	mov	eax, DWORD PTR 64[rbp]
	xor	edi, edi
	test	eax, eax
	sete	dil
	call	BUG_ON@PLT
	mov	rsi, rbp
	mov	rdi, r13
	call	free_excluded_extents@PLT
	lea	rax, 16[rbp]
	mov	edx, 16
	mov	rdi, r15
	mov	rsi, rax
	mov	QWORD PTR [rsp], rax
	call	memcpy@PLT
	mov	rdi, rbp
	call	get_block_group_index@PLT
	mov	DWORD PTR 12[rsp], eax
	mov	eax, DWORD PTR BTRFS_BLOCK_GROUP_DUP[rip]
	or	eax, DWORD PTR BTRFS_BLOCK_GROUP_RAID1[rip]
	or	eax, DWORD PTR BTRFS_BLOCK_GROUP_RAID10[rip]
	test	DWORD PTR 0[rbp], eax
	setne	al
	movzx	eax, al
	add	eax, 1
	mov	DWORD PTR 8[rsp], eax
	mov	rax, QWORD PTR 0[r13]
	lea	r12, 12[rax]
	mov	rdi, r12
	call	spin_lock@PLT
	mov	rsi, r12
	mov	rdi, rbp
	call	btrfs_return_cluster_to_free_space@PLT
	mov	rdi, r12
	call	spin_unlock@PLT
	mov	rax, QWORD PTR 0[r13]
	lea	r12, 8[rax]
	mov	rdi, r12
	call	spin_lock@PLT
	mov	rsi, r12
	mov	rdi, rbp
	call	btrfs_return_cluster_to_free_space@PLT
	mov	rdi, r12
	call	spin_unlock@PLT
	xor	eax, eax
	call	btrfs_alloc_path@PLT
	mov	r8d, DWORD PTR ENOMEM[rip]
	mov	r12, rax
	neg	r8d
	test	rax, rax
	je	.L4
	mov	rdi, rbx
	mov	rdx, rax
	mov	rsi, rbp
	call	lookup_free_space_inode@PLT
	mov	rdi, rax
	mov	QWORD PTR 16[rsp], rax
	call	IS_ERR@PLT
	test	eax, eax
	jne	.L5
	mov	r9, QWORD PTR 16[rsp]
	mov	rdi, r14
	mov	rsi, r9
	call	btrfs_orphan_add@PLT
	mov	r9, QWORD PTR 16[rsp]
	test	eax, eax
	jne	.L24
	mov	rdi, r9
	mov	QWORD PTR 24[rsp], r9
	call	clear_nlink@PLT
	lea	rdi, 40[rbp]
	mov	QWORD PTR 16[rsp], rdi
	call	spin_lock@PLT
	mov	r9, QWORD PTR 24[rsp]
	cmp	QWORD PTR 56[rbp], 0
	mov	rdi, QWORD PTR 16[rsp]
	mov	QWORD PTR 16[rsp], r9
	jne	.L25
	call	spin_unlock@PLT
	mov	r9, QWORD PTR 16[rsp]
.L8:
	mov	rdi, r9
	call	btrfs_add_delayed_iput@PLT
.L5:
	mov	eax, DWORD PTR BTRFS_FREE_SPACE_OBJECTID[rip]
	mov	rcx, r12
	mov	rdx, r15
	mov	rsi, rbx
	mov	r8d, -1
	mov	r9d, 1
	mov	rdi, r14
	mov	QWORD PTR 32[rsp], 0
	mov	DWORD PTR 44[rsp], eax
	mov	eax, DWORD PTR 20[rbp]
	mov	DWORD PTR 40[rsp], eax
	call	btrfs_search_slot@PLT
	mov	r8d, eax
	test	eax, eax
	js	.L4
	jne	.L21
	mov	rdx, r12
	mov	rsi, rbx
	mov	rdi, r14
	call	btrfs_del_item@PLT
	mov	r8d, eax
	test	eax, eax
	je	.L21
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rdi, r12
	mov	DWORD PTR [rsp], r8d
	call	btrfs_free_path@PLT
	mov	r8d, DWORD PTR [rsp]
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L26
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r8d
	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
.L21:
	.cfi_restore_state
	mov	rdi, r12
	call	btrfs_release_path@PLT
	mov	rdi, QWORD PTR 0[r13]
	call	spin_lock@PLT
	mov	rax, QWORD PTR 0[r13]
	lea	rdi, 36[rbp]
	lea	rsi, 4[rax]
	call	rb_erase@PLT
	mov	rdi, QWORD PTR 0[r13]
	call	spin_unlock@PLT
	mov	rax, QWORD PTR 24[rbp]
	lea	rdi, 16[rax]
	call	down_write@PLT
	lea	rdi, 32[rbp]
	call	list_del_init@PLT
	mov	rdx, QWORD PTR 24[rbp]
	movsx	rax, DWORD PTR 12[rsp]
	mov	rdx, QWORD PTR 24[rdx]
	lea	rdi, [rdx+rax*4]
	call	list_empty@PLT
	test	rax, rax
	jne	.L27
.L11:
	mov	rax, QWORD PTR 24[rbp]
	lea	rdi, 16[rax]
	call	up_write@PLT
	mov	rax, QWORD PTR BTRFS_CACHE_STARTED[rip]
	cmp	QWORD PTR 8[rbp], rax
	je	.L28
.L12:
	mov	rdi, rbp
	call	btrfs_remove_free_space_cache@PLT
	mov	rax, QWORD PTR 24[rbp]
	lea	rdi, 12[rax]
	call	spin_lock@PLT
	mov	rdi, QWORD PTR 24[rbp]
	mov	eax, DWORD PTR 16[rbp]
	sub	DWORD PTR [rdi], eax
	sub	DWORD PTR 4[rdi], eax
	imul	eax, DWORD PTR 8[rsp]
	sub	DWORD PTR 8[rdi], eax
	add	rdi, 12
	call	spin_unlock@PLT
	mov	rsi, QWORD PTR [rsp]
	mov	edx, 16
	mov	rdi, r15
	call	memcpy@PLT
	mov	rdi, QWORD PTR 0[r13]
	call	btrfs_clear_space_info_full@PLT
	mov	rdi, rbp
	call	btrfs_put_block_group@PLT
	mov	rdi, rbp
	call	btrfs_put_block_group@PLT
	mov	rcx, r12
	mov	rdx, r15
	mov	rsi, r13
	mov	r8d, -1
	mov	r9d, 1
	mov	rdi, r14
	call	btrfs_search_slot@PLT
	mov	r8d, eax
	test	eax, eax
	jle	.L13
	mov	r8d, DWORD PTR EIO[rip]
	neg	r8d
.L13:
	test	r8d, r8d
	js	.L4
	mov	rdx, r12
	mov	rsi, r13
	mov	rdi, r14
	call	btrfs_del_item@PLT
	mov	r8d, eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L25:
	mov	QWORD PTR 56[rbp], 0
	mov	QWORD PTR 48[rbp], 0
	call	spin_unlock@PLT
	mov	r9, QWORD PTR 16[rsp]
	mov	rdi, r9
	call	iput@PLT
	mov	r9, QWORD PTR 16[rsp]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L27:
	mov	esi, DWORD PTR 0[rbp]
	mov	rdi, QWORD PTR 0[r13]
	call	clear_avail_alloc_bits@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L24:
	mov	rdi, r9
	mov	DWORD PTR [rsp], eax
	call	btrfs_add_delayed_iput@PLT
	mov	r8d, DWORD PTR [rsp]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rdi, rbp
	call	wait_block_group_cache_done@PLT
	jmp	.L12
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	btrfs_remove_block_group, .-btrfs_remove_block_group
	.comm	ENOMEM,4,4
	.comm	EIO,4,4
	.comm	BTRFS_FREE_SPACE_OBJECTID,4,4
	.comm	BTRFS_CACHE_STARTED,8,8
	.comm	BTRFS_BLOCK_GROUP_RAID10,4,4
	.comm	BTRFS_BLOCK_GROUP_RAID1,4,4
	.comm	BTRFS_BLOCK_GROUP_DUP,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_extent-tree.c_btrfs_remove_block_group.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	btrfs_remove_block_group
	.syntax unified
	.arm
	.fpu softvfp
	.type	btrfs_remove_block_group, %function
btrfs_remove_block_group:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, [r1]
	mov	r1, r2
	ldr	r6, [r3, #16]
	ldr	r2, .L30
	sub	sp, sp, #44
	mov	r7, r0
	ldr	r0, [r6]
	ldr	r10, [r3, #20]
	ldr	r2, [r2]
	str	r2, [sp, #36]
	mov	r2,#0
	bl	btrfs_lookup_block_group
	mov	r4, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	BUG_ON
	ldr	r0, [r4, #40]
	add	fp, r4, #8
	clz	r0, r0
	lsr	r0, r0, #5
	bl	BUG_ON
	mov	r1, r4
	mov	r0, r6
	bl	free_excluded_extents
	mov	r1, fp
	mov	r2, #12
	add	r0, sp, #24
	bl	memcpy
	mov	r0, r4
	bl	get_block_group_index
	ldr	r3, .L30+4
	ldr	r2, .L30+8
	ldr	r1, .L30+12
	ldr	r2, [r2]
	ldr	r3, [r3]
	mov	r8, r0
	ldr	r0, [r1]
	orr	r3, r3, r2
	ldr	r2, [r4]
	orr	r3, r3, r0
	tst	r3, r2
	movne	r3, #2
	moveq	r3, #1
	ldr	r5, [r6]
	str	r3, [sp, #12]
	add	r5, r5, #12
	mov	r0, r5
	str	r8, [sp, #16]
	bl	spin_lock
	mov	r1, r5
	mov	r0, r4
	bl	btrfs_return_cluster_to_free_space
	mov	r0, r5
	bl	spin_unlock
	ldr	r5, [r6]
	add	r5, r5, #8
	mov	r0, r5
	bl	spin_lock
	mov	r1, r5
	mov	r0, r4
	bl	btrfs_return_cluster_to_free_space
	mov	r0, r5
	bl	spin_unlock
	bl	btrfs_alloc_path
	subs	r5, r0, #0
	beq	.L24
	mov	r2, r5
	mov	r1, r4
	mov	r0, r10
	bl	lookup_free_space_inode
	mov	r9, r0
	bl	IS_ERR
	cmp	r0, #0
	bne	.L5
	mov	r1, r9
	mov	r0, r7
	bl	btrfs_orphan_add
	subs	r8, r0, #0
	mov	r0, r9
	bne	.L25
	add	r2, r4, #28
	str	r2, [sp, #20]
	bl	clear_nlink
	ldr	r2, [sp, #20]
	mov	r0, r2
	bl	spin_lock
	ldr	r1, [r4, #36]
	ldr	r2, [sp, #20]
	cmp	r1, #0
	bne	.L26
	mov	r0, r2
	bl	spin_unlock
.L8:
	mov	r0, r9
	bl	btrfs_add_delayed_iput
.L5:
	mov	r2, #1
	mvn	r3, #0
	mov	ip, #0
	ldr	r1, .L30+16
	ldr	r0, [r4, #12]
	ldr	r1, [r1]
	str	r0, [sp, #28]
	str	r2, [sp, #4]
	str	r3, [sp]
	str	r1, [sp, #32]
	mov	r3, r5
	mov	r1, r10
	mov	r0, r7
	add	r2, sp, #24
	str	ip, [sp, #24]
	bl	btrfs_search_slot
	subs	r8, r0, #0
	blt	.L4
	bne	.L21
	mov	r1, r10
	mov	r2, r5
	mov	r0, r7
	bl	btrfs_del_item
	subs	r8, r0, #0
	beq	.L21
.L4:
	mov	r0, r5
	bl	btrfs_free_path
	ldr	r3, .L30
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L27
	mov	r0, r8
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L21:
	mov	r0, r5
	bl	btrfs_release_path
	ldr	r0, [r6]
	bl	spin_lock
	ldr	r1, [r6]
	add	r0, r4, #24
	add	r1, r1, #4
	bl	rb_erase
	ldr	r0, [r6]
	bl	spin_unlock
	ldr	r0, [r4, #16]
	add	r0, r0, #16
	bl	down_write
	add	r0, r4, #20
	bl	list_del_init
	ldr	r3, [r4, #16]
	ldr	r0, [r3, #20]
	ldr	r3, [sp, #16]
	add	r0, r0, r3, lsl #2
	bl	list_empty
	cmp	r0, #0
	bne	.L28
.L11:
	ldr	r0, [r4, #16]
	add	r0, r0, #16
	bl	up_write
	ldr	r3, .L30+20
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L29
.L12:
	mov	r0, r4
	bl	btrfs_remove_free_space_cache
	ldr	r0, [r4, #16]
	add	r0, r0, #12
	bl	spin_lock
	ldr	ip, [r4, #8]
	ldr	r3, [sp, #12]
	ldr	r0, [r4, #16]
	mul	r3, ip, r3
	ldr	r1, [r0, #8]
	ldr	r2, [r0]
	sub	r1, r1, r3
	ldr	r3, [r0, #4]
	sub	r2, r2, ip
	sub	r3, r3, ip
	stm	r0, {r2, r3}
	str	r1, [r0, #8]
	add	r0, r0, #12
	bl	spin_unlock
	mov	r1, fp
	mov	r2, #12
	add	r0, sp, #24
	bl	memcpy
	ldr	r0, [r6]
	bl	btrfs_clear_space_info_full
	mov	r0, r4
	bl	btrfs_put_block_group
	mov	r0, r4
	bl	btrfs_put_block_group
	mov	r1, #1
	mvn	r3, #0
	str	r1, [sp, #4]
	str	r3, [sp]
	mov	r1, r6
	mov	r3, r5
	mov	r0, r7
	add	r2, sp, #24
	bl	btrfs_search_slot
	subs	r8, r0, #0
	ldrgt	r3, .L30+24
	ldrgt	r0, [r3]
	rsbgt	r8, r0, #0
	cmp	r8, #0
	blt	.L4
	mov	r1, r6
	mov	r0, r7
	mov	r2, r5
	bl	btrfs_del_item
	mov	r8, r0
	b	.L4
.L24:
	ldr	r3, .L30+28
	ldr	r0, [r3]
	rsb	r8, r0, #0
	b	.L4
.L26:
	mov	r0, r2
	str	r8, [r4, #36]
	str	r8, [r4, #32]
	bl	spin_unlock
	mov	r0, r9
	bl	iput
	b	.L8
.L28:
	ldr	r1, [r4]
	ldr	r0, [r6]
	bl	clear_avail_alloc_bits
	b	.L11
.L25:
	bl	btrfs_add_delayed_iput
	b	.L4
.L29:
	mov	r0, r4
	bl	wait_block_group_cache_done
	b	.L12
.L27:
	bl	__stack_chk_fail
.L31:
	.align	2
.L30:
	.word	.LC0
	.word	BTRFS_BLOCK_GROUP_DUP
	.word	BTRFS_BLOCK_GROUP_RAID1
	.word	BTRFS_BLOCK_GROUP_RAID10
	.word	BTRFS_FREE_SPACE_OBJECTID
	.word	BTRFS_CACHE_STARTED
	.word	EIO
	.word	ENOMEM
	.size	btrfs_remove_block_group, .-btrfs_remove_block_group
	.comm	ENOMEM,4,4
	.comm	EIO,4,4
	.comm	BTRFS_FREE_SPACE_OBJECTID,4,4
	.comm	BTRFS_CACHE_STARTED,4,4
	.comm	BTRFS_BLOCK_GROUP_RAID10,4,4
	.comm	BTRFS_BLOCK_GROUP_RAID1,4,4
	.comm	BTRFS_BLOCK_GROUP_DUP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
