	.file	"extr_flushthread.c_create_chunk.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"out of memory\n"
.LC1:
	.string	"insert_tree_item failed\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"add_to_bootstrap returned %08x\n"
	.align 8
.LC3:
	.string	"insert_tree_item returned %08x\n"
	.align 8
.LC4:
	.string	"update_dev_item returned %08x\n"
	.text
	.p2align 4
	.type	create_chunk, @function
create_chunk:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rsi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	edx, DWORD PTR ALLOC_TAG[rip]
	mov	esi, DWORD PTR [rsi]
	mov	edi, DWORD PTR PagedPool[rip]
	call	ExAllocatePoolWithTag@PLT
	test	rax, rax
	je	.L25
	mov	rsi, QWORD PTR 32[r15]
	mov	edx, DWORD PTR [r15]
	mov	rdi, rax
	mov	r14, rax
	call	RtlCopyMemory@PLT
	mov	eax, DWORD PTR [r15]
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	mov	rsi, QWORD PTR 16[rbp]
	push	r13
	.cfi_def_cfa_offset 96
	mov	r8d, DWORD PTR 4[r15]
	mov	rdi, rbp
	mov	r9, r14
	push	0
	.cfi_def_cfa_offset 104
	mov	ecx, DWORD PTR TYPE_CHUNK_ITEM[rip]
	mov	edx, 256
	push	rax
	.cfi_def_cfa_offset 112
	call	insert_tree_item@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 80
	mov	edi, eax
	mov	r12d, eax
	call	NT_SUCCESS@PLT
	test	eax, eax
	je	.L26
	mov	rax, QWORD PTR 32[r15]
	mov	eax, DWORD PTR [rax]
	test	DWORD PTR BLOCK_FLAG_SYSTEM[rip], eax
	je	.L5
	mov	ecx, DWORD PTR 4[r15]
	mov	r9d, DWORD PTR [r15]
	mov	rdi, rbp
	mov	r8, r14
	mov	edx, DWORD PTR TYPE_CHUNK_ITEM[rip]
	mov	esi, 256
	call	add_to_bootstrap@PLT
	mov	edi, eax
	mov	r12d, eax
	call	NT_SUCCESS@PLT
	test	eax, eax
	je	.L28
.L5:
	mov	edx, DWORD PTR ALLOC_TAG[rip]
	mov	edi, DWORD PTR PagedPool[rip]
	mov	esi, 40
	call	ExAllocatePoolWithTag@PLT
	mov	r14, rax
	test	rax, rax
	je	.L25
	mov	eax, DWORD PTR 12[r15]
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	mov	rsi, QWORD PTR 24[rbp]
	mov	rdi, rbp
	mov	DWORD PTR [r14], 256
	mov	ecx, DWORD PTR TYPE_BLOCK_GROUP_ITEM[rip]
	mov	r9, r14
	mov	DWORD PTR 32[r14], eax
	mov	rax, QWORD PTR 32[r15]
	mov	edx, DWORD PTR [rax]
	mov	r8d, DWORD PTR 4[rax]
	mov	DWORD PTR 4[r14], edx
	mov	edx, DWORD PTR 4[r15]
	push	r13
	.cfi_def_cfa_offset 96
	push	0
	.cfi_def_cfa_offset 104
	push	40
	.cfi_def_cfa_offset 112
	call	insert_tree_item@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 80
	mov	edi, eax
	mov	r12d, eax
	call	NT_SUCCESS@PLT
	test	eax, eax
	je	.L26
	mov	rbx, QWORD PTR 32[r15]
	mov	rcx, QWORD PTR 8[rbx]
	mov	eax, DWORD PTR [rbx]
	mov	QWORD PTR 8[rsp], rbx
	mov	QWORD PTR [rsp], rcx
	test	DWORD PTR BLOCK_FLAG_RAID0[rip], eax
	je	.L29
.L8:
	xor	ebx, ebx
	test	rcx, rcx
	jne	.L11
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rcx, QWORD PTR 16[rbp]
	xor	edx, edx
	mov	rsi, QWORD PTR 8[rbp]
	mov	rdi, rbp
	mov	r9, r14
	mov	eax, DWORD PTR 8[rcx]
	mov	DWORD PTR 8[r14], 256
	mov	DWORD PTR 28[r14], eax
	mov	eax, DWORD PTR 4[r15]
	mov	DWORD PTR 12[r14], eax
	mov	rax, QWORD PTR 32[r15]
	movsx	rax, DWORD PTR 4[rax]
	div	QWORD PTR [rsp]
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	mov	QWORD PTR 16[r14], rax
	mov	rax, QWORD PTR [rcx]
	mov	ecx, DWORD PTR TYPE_DEV_EXTENT[rip]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR 24[r14], eax
	mov	rax, QWORD PTR 16[rsp]
	mov	r8d, DWORD PTR 24[rax+rbx*4]
	mov	rax, QWORD PTR 24[r15]
	mov	rax, QWORD PTR [rax+rbx*8]
	push	r13
	.cfi_def_cfa_offset 96
	push	0
	.cfi_def_cfa_offset 104
	push	40
	.cfi_def_cfa_offset 112
	mov	edx, DWORD PTR [rax]
	call	insert_tree_item@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 80
	mov	edi, eax
	mov	r12d, eax
	call	NT_SUCCESS@PLT
	test	eax, eax
	je	.L30
	mov	rax, QWORD PTR 24[r15]
	mov	rdi, rbp
	mov	edx, r13d
	mov	rsi, QWORD PTR [rax+rbx*8]
	call	update_dev_item@PLT
	mov	edi, eax
	mov	r12d, eax
	call	NT_SUCCESS@PLT
	test	eax, eax
	je	.L31
	mov	rax, QWORD PTR 32[r15]
	add	rbx, 1
	cmp	QWORD PTR 8[rax], rbx
	jbe	.L15
.L11:
	mov	edx, DWORD PTR ALLOC_TAG[rip]
	mov	edi, DWORD PTR PagedPool[rip]
	mov	esi, 40
	call	ExAllocatePoolWithTag@PLT
	mov	r14, rax
	test	rax, rax
	jne	.L12
.L25:
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	ERR@PLT
	mov	r12d, DWORD PTR STATUS_INSUFFICIENT_RESOURCES[rip]
.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
.L26:
	.cfi_restore_state
	lea	rdi, .LC1[rip]
	call	ERR@PLT
	mov	rdi, r14
	call	ExFreePool@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L29:
	test	DWORD PTR BLOCK_FLAG_RAID10[rip], eax
	je	.L9
	mov	rax, rcx
	xor	edx, edx
	div	QWORD PTR 16[rbx]
	mov	QWORD PTR [rsp], rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L28:
	mov	esi, r12d
	lea	rdi, .LC2[rip]
	call	ERR@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	mov	edx, DWORD PTR 12[r15]
	mov	DWORD PTR 8[r15], 0
	mov	rsi, r15
	mov	rdi, rbp
	mov	DWORD PTR 16[r15], edx
	call	chunk_estimate_phys_size@PLT
	mov	r12d, DWORD PTR STATUS_SUCCESS[rip]
	add	DWORD PTR 0[rbp], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	test	DWORD PTR BLOCK_FLAG_RAID5[rip], eax
	je	.L10
	lea	rax, -1[rcx]
	mov	QWORD PTR [rsp], rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L30:
	mov	esi, r12d
	lea	rdi, .LC3[rip]
	call	ERR@PLT
	mov	rdi, r14
	call	ExFreePool@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	mov	esi, r12d
	lea	rdi, .LC4[rip]
	call	ERR@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	test	DWORD PTR BLOCK_FLAG_RAID6[rip], eax
	lea	r14, -2[rcx]
	mov	eax, 1
	cmovne	rax, r14
	mov	QWORD PTR [rsp], rax
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	create_chunk, .-create_chunk
	.comm	TYPE_DEV_EXTENT,4,4
	.comm	TYPE_CHUNK_ITEM,4,4
	.comm	TYPE_BLOCK_GROUP_ITEM,4,4
	.comm	STATUS_SUCCESS,4,4
	.comm	STATUS_INSUFFICIENT_RESOURCES,4,4
	.comm	PagedPool,4,4
	.comm	BLOCK_FLAG_SYSTEM,4,4
	.comm	BLOCK_FLAG_RAID6,4,4
	.comm	BLOCK_FLAG_RAID5,4,4
	.comm	BLOCK_FLAG_RAID10,4,4
	.comm	BLOCK_FLAG_RAID0,4,4
	.comm	ALLOC_TAG,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_flushthread.c_create_chunk.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"out of memory\012\000"
	.align	2
.LC1:
	.ascii	"insert_tree_item failed\012\000"
	.align	2
.LC2:
	.ascii	"add_to_bootstrap returned %08x\012\000"
	.global	__aeabi_uidiv
	.align	2
.LC3:
	.ascii	"insert_tree_item returned %08x\012\000"
	.align	2
.LC4:
	.ascii	"update_dev_item returned %08x\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_chunk, %function
create_chunk:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L31
	mov	r9, r2
	ldr	r2, [r3]
	ldr	r3, .L31+4
	mov	r5, r1
	mov	r7, r0
	ldr	r1, [r1]
	ldr	r0, [r3]
	sub	sp, sp, #28
	bl	ExAllocatePoolWithTag
	subs	r4, r0, #0
	beq	.L24
	ldr	r2, [r5]
	ldr	r1, [r5, #24]
	bl	RtlCopyMemory
	ldm	r5, {r1, r2}
	mov	r3, #0
	ldr	r8, .L31+8
	str	r9, [sp, #16]
	str	r4, [sp, #4]
	str	r3, [sp, #12]
	ldr	r3, [r8]
	str	r2, [sp]
	str	r1, [sp, #8]
	mov	r2, #256
	ldr	r1, [r7, #8]
	mov	r0, r7
	bl	insert_tree_item
	mov	r6, r0
	bl	NT_SUCCESS
	cmp	r0, #0
	beq	.L25
	ldr	r2, [r5, #24]
	ldr	r3, .L31+12
	ldr	r2, [r2]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L5
	ldr	r3, [r5]
	str	r4, [sp]
	ldr	r2, [r8]
	str	r3, [sp, #4]
	mov	r1, #256
	ldr	r3, [r5, #4]
	mov	r0, r7
	bl	add_to_bootstrap
	mov	r6, r0
	bl	NT_SUCCESS
	cmp	r0, #0
	beq	.L27
.L5:
	ldr	r3, .L31
	mov	r1, #32
	ldr	r2, [r3]
	ldr	r3, .L31+4
	ldr	r0, [r3]
	bl	ExAllocatePoolWithTag
	subs	r4, r0, #0
	beq	.L24
	mov	r0, #256
	mov	r1, #0
	mov	r2, #32
	ldr	r3, [r5, #24]
	ldr	lr, [r5, #12]
	ldr	ip, [r3]
	str	lr, [r4, #28]
	stm	r4, {r0, ip}
	str	r9, [sp, #16]
	str	r4, [sp, #4]
	str	r1, [sp, #12]
	str	r2, [sp, #8]
	ldr	r2, [r3, #4]
	ldr	r3, .L31+16
	str	r2, [sp]
	ldr	r3, [r3]
	ldr	r2, [r5, #4]
	ldr	r1, [r7, #12]
	mov	r0, r7
	bl	insert_tree_item
	mov	r6, r0
	bl	NT_SUCCESS
	cmp	r0, #0
	beq	.L25
	ldr	r10, [r5, #24]
	ldr	r2, .L31+20
	ldr	r3, [r10]
	ldr	r2, [r2]
	ldr	r4, [r10, #8]
	tst	r3, r2
	movne	fp, r4
	beq	.L28
.L8:
	cmp	r4, #0
	movne	r8, #0
	addne	r10, r10, #12
	bne	.L15
	b	.L16
.L12:
	ldr	r6, [r7, #8]
	ldr	r3, [r5, #24]
	ldr	r1, [r6, #4]
	ldr	r2, [r5, #4]
	str	r1, [r4, #24]
	mov	r1, #256
	ldr	r0, [r3, #4]
	str	r1, [r4, #8]
	str	r2, [r4, #12]
	mov	r1, fp
	bl	__aeabi_uidiv
	ldr	r1, [r6]
	ldr	r2, [r5, #20]
	ldr	r1, [r1]
	ldr	r2, [r2, r8, lsl #2]
	mov	r3, #0
	str	r1, [r4, #20]
	mov	r1, #32
	ldr	r2, [r2]
	str	r0, [r4, #16]
	str	r9, [sp, #16]
	str	r1, [sp, #8]
	str	r4, [sp, #4]
	str	r3, [sp, #12]
	ldr	r3, [r10, #4]!
	mov	r0, r7
	str	r3, [sp]
	ldr	r3, .L31+24
	ldr	r1, [r7, #4]
	ldr	r3, [r3]
	bl	insert_tree_item
	mov	r6, r0
	bl	NT_SUCCESS
	cmp	r0, #0
	beq	.L29
	ldr	r3, [r5, #20]
	mov	r2, r9
	ldr	r1, [r3, r8, lsl #2]
	mov	r0, r7
	bl	update_dev_item
	mov	r6, r0
	bl	NT_SUCCESS
	cmp	r0, #0
	add	r8, r8, #1
	beq	.L30
	ldr	r3, [r5, #24]
	ldr	r3, [r3, #8]
	cmp	r3, r8
	bls	.L16
.L15:
	ldr	r3, .L31
	mov	r1, #32
	ldr	r2, [r3]
	ldr	r3, .L31+4
	ldr	r0, [r3]
	bl	ExAllocatePoolWithTag
	subs	r4, r0, #0
	bne	.L12
.L24:
	ldr	r0, .L31+28
	bl	ERR
	ldr	r3, .L31+32
	ldr	r6, [r3]
.L1:
	mov	r0, r6
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L25:
	ldr	r0, .L31+36
	bl	ERR
	mov	r0, r4
	bl	ExFreePool
	mov	r0, r6
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L28:
	ldr	r2, .L31+40
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L9
	mov	r0, r4
	ldr	r1, [r10, #12]
	bl	__aeabi_uidiv
	mov	fp, r0
	b	.L8
.L27:
	mov	r1, r6
	ldr	r0, .L31+44
	bl	ERR
	b	.L1
.L16:
	mov	r3, #0
	ldr	r2, [r5, #12]
	str	r3, [r5, #8]
	str	r2, [r5, #16]
	mov	r1, r5
	mov	r0, r7
	bl	chunk_estimate_phys_size
	ldr	r3, [r7]
	ldr	r2, .L31+48
	add	r3, r3, r0
	ldr	r6, [r2]
	str	r3, [r7]
	b	.L1
.L9:
	ldr	r2, .L31+52
	ldr	r2, [r2]
	tst	r3, r2
	subne	fp, r4, #1
	bne	.L8
	ldr	r2, .L31+56
	ldr	r2, [r2]
	tst	r3, r2
	moveq	fp, #1
	subne	fp, r4, #2
	b	.L8
.L29:
	mov	r1, r6
	ldr	r0, .L31+60
	bl	ERR
	mov	r0, r4
	bl	ExFreePool
	b	.L1
.L30:
	mov	r1, r6
	ldr	r0, .L31+64
	bl	ERR
	b	.L1
.L32:
	.align	2
.L31:
	.word	ALLOC_TAG
	.word	PagedPool
	.word	TYPE_CHUNK_ITEM
	.word	BLOCK_FLAG_SYSTEM
	.word	TYPE_BLOCK_GROUP_ITEM
	.word	BLOCK_FLAG_RAID0
	.word	TYPE_DEV_EXTENT
	.word	.LC0
	.word	STATUS_INSUFFICIENT_RESOURCES
	.word	.LC1
	.word	BLOCK_FLAG_RAID10
	.word	.LC2
	.word	STATUS_SUCCESS
	.word	BLOCK_FLAG_RAID5
	.word	BLOCK_FLAG_RAID6
	.word	.LC3
	.word	.LC4
	.size	create_chunk, .-create_chunk
	.comm	TYPE_DEV_EXTENT,4,4
	.comm	TYPE_CHUNK_ITEM,4,4
	.comm	TYPE_BLOCK_GROUP_ITEM,4,4
	.comm	STATUS_SUCCESS,4,4
	.comm	STATUS_INSUFFICIENT_RESOURCES,4,4
	.comm	PagedPool,4,4
	.comm	BLOCK_FLAG_SYSTEM,4,4
	.comm	BLOCK_FLAG_RAID6,4,4
	.comm	BLOCK_FLAG_RAID5,4,4
	.comm	BLOCK_FLAG_RAID10,4,4
	.comm	BLOCK_FLAG_RAID0,4,4
	.comm	ALLOC_TAG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
