	.file	"extr_ntb_tool.c_tool_init_mws.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	tool_init_mws, @function
tool_init_mws:
.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
	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	esi, DWORD PTR [rdi]
	test	esi, esi
	jle	.L8
	mov	QWORD PTR 8[rsp], 0
	mov	rdx, QWORD PTR 8[rdi]
	mov	r14, rdi
.L2:
	mov	r12, QWORD PTR 8[rsp]
	mov	edi, DWORD PTR 4[r14]
	mov	r13d, r12d
	sal	r12, 4
	lea	rbx, [rdx+r12]
	call	ntb_mw_count@PLT
	mov	esi, DWORD PTR M_NTB_TOOL[rip]
	mov	edx, DWORD PTR M_WAITOK[rip]
	mov	DWORD PTR [rbx], eax
	mov	rbx, QWORD PTR 8[r14]
	or	edx, DWORD PTR M_ZERO[rip]
	add	rbx, r12
	mov	eax, DWORD PTR [rbx]
	lea	edi, [rax+rax*2]
	sal	edi, 4
	call	malloc@PLT
	mov	rdx, QWORD PTR 8[r14]
	mov	QWORD PTR 8[rbx], rax
	lea	rcx, [rdx+r12]
	mov	rax, QWORD PTR 8[rcx]
	test	rax, rax
	je	.L4
	mov	ecx, DWORD PTR [rcx]
	xor	ebp, ebp
	test	ecx, ecx
	jg	.L5
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdx, QWORD PTR 8[r14]
	add	rbp, 1
	lea	rax, [rdx+r12]
	cmp	DWORD PTR [rax], ebp
	jle	.L6
	mov	rax, QWORD PTR 8[rax]
.L5:
	lea	rbx, 0[rbp+rbp*2]
	mov	edx, 48
	xor	esi, esi
	sal	rbx, 4
	add	rbx, rax
	mov	rdi, rbx
	call	memset@PLT
	mov	eax, DWORD PTR DEFAULT_MW_OFF[rip]
	mov	DWORD PTR [rbx], ebp
	mov	esi, ebp
	mov	QWORD PTR 40[rbx], r14
	mov	edi, DWORD PTR 4[r14]
	lea	rdx, 28[rbx]
	lea	rcx, 24[rbx]
	mov	DWORD PTR 36[rbx], eax
	mov	eax, DWORD PTR DEFAULT_MW_SIZE[rip]
	lea	r9, 16[rbx]
	lea	r8, 20[rbx]
	mov	DWORD PTR 4[rbx], r13d
	mov	DWORD PTR 32[rbx], eax
	lea	rax, 8[rbx]
	push	rax
	.cfi_def_cfa_offset 88
	lea	rax, 12[rbx]
	push	rax
	.cfi_def_cfa_offset 96
	call	ntb_mw_get_range@PLT
	mov	r15d, eax
	pop	rax
	.cfi_def_cfa_offset 88
	pop	rdx
	.cfi_def_cfa_offset 80
	test	r15d, r15d
	je	.L7
	mov	rdi, r14
	call	tool_clear_mws@PLT
.L1:
	add	rsp, 24
	.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
.L6:
	.cfi_restore_state
	add	QWORD PTR 8[rsp], 1
	mov	rax, QWORD PTR 8[rsp]
	cmp	DWORD PTR [r14], eax
	jg	.L2
.L8:
	xor	r15d, r15d
	jmp	.L1
.L4:
	mov	r15d, DWORD PTR ENOMEM[rip]
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	tool_init_mws, .-tool_init_mws
	.comm	M_ZERO,4,4
	.comm	M_WAITOK,4,4
	.comm	M_NTB_TOOL,4,4
	.comm	ENOMEM,4,4
	.comm	DEFAULT_MW_SIZE,4,4
	.comm	DEFAULT_MW_OFF,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_ntb_tool.c_tool_init_mws.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tool_init_mws, %function
tool_init_mws:
	@ 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, [r0]
	sub	sp, sp, #20
	cmp	r3, #0
	ble	.L8
	mov	r7, r0
	mov	r10, #0
	ldr	r8, [r0, #8]
.L2:
	ldr	r0, [r7, #4]
	bl	ntb_mw_count
	ldr	r2, .L15
	ldr	r3, [r7, #8]
	ldr	r1, [r2]
	ldr	r2, .L15+4
	str	r0, [r8, r10, lsl #3]
	ldr	r0, [r3, r10, lsl #3]
	ldr	r2, [r2]
	add	ip, r0, r0, lsl #2
	orr	r2, r1, r2
	ldr	r1, .L15+8
	add	r0, r0, ip, lsl #1
	lsl	r9, r10, #3
	ldr	r1, [r1]
	lsl	r0, r0, #2
	add	r4, r3, r9
	bl	malloc
	ldr	r8, [r7, #8]
	str	r0, [r4, #4]
	add	r3, r8, r9
	ldr	fp, [r3, #4]
	cmp	fp, #0
	beq	.L4
	ldr	r3, [r8, r10, lsl #3]
	cmp	r3, #0
	movgt	r6, #0
	movgt	r5, r6
	bgt	.L5
	b	.L6
.L7:
	ldr	r8, [r7, #8]
	add	r6, r6, #44
	ldr	r3, [r8, r9]
	add	r2, r8, r9
	cmp	r3, r5
	ble	.L6
	ldr	fp, [r2, #4]
.L5:
	add	r4, fp, r6
	add	r8, r4, #8
	mov	r2, #36
	mov	r1, #0
	mov	r0, r8
	bl	memset
	ldr	r3, .L15+12
	add	r0, r4, #12
	ldr	ip, [r3]
	ldr	r3, .L15+16
	add	r1, r4, #16
	ldr	r3, [r3]
	add	r2, r4, #20
	str	r7, [r4, #40]
	str	r5, [fp, r6]
	str	r3, [r4, #32]
	str	r10, [r4, #4]
	str	ip, [r4, #36]
	str	r1, [sp, #4]
	str	r2, [sp]
	str	r8, [sp, #12]
	str	r0, [sp, #8]
	mov	r1, r5
	ldr	r0, [r7, #4]
	add	r3, r4, #24
	add	r2, r4, #28
	bl	ntb_mw_get_range
	cmp	r0, #0
	add	r5, r5, #1
	beq	.L7
	mov	r4, r0
	mov	r0, r7
	bl	tool_clear_mws
.L1:
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L6:
	ldr	r3, [r7]
	add	r10, r10, #1
	cmp	r3, r10
	bgt	.L2
.L8:
	mov	r4, #0
	b	.L1
.L4:
	ldr	r3, .L15+20
	ldr	r4, [r3]
	b	.L1
.L16:
	.align	2
.L15:
	.word	M_WAITOK
	.word	M_ZERO
	.word	M_NTB_TOOL
	.word	DEFAULT_MW_OFF
	.word	DEFAULT_MW_SIZE
	.word	ENOMEM
	.size	tool_init_mws, .-tool_init_mws
	.comm	M_ZERO,4,4
	.comm	M_WAITOK,4,4
	.comm	M_NTB_TOOL,4,4
	.comm	ENOMEM,4,4
	.comm	DEFAULT_MW_SIZE,4,4
	.comm	DEFAULT_MW_OFF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
