// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/jemalloc/src/ctl.c
// Function: ctl_refresh
static void
ctl_refresh(void)
{
	tsd_t *tsd;
	unsigned i;
	bool refreshed;
	VARIABLE_ARRAY(arena_t *, tarenas, ctl_stats.narenas);

	/*
	 * Clear sum stats, since they will be merged into by
	 * ctl_arena_refresh().
	 */
	ctl_stats.arenas[ctl_stats.narenas].nthreads = 0;
	ctl_arena_clear(&ctl_stats.arenas[ctl_stats.narenas]);

	tsd = tsd_fetch();
	for (i = 0, refreshed = false; i < ctl_stats.narenas; i++) {
		tarenas[i] = arena_get(tsd, i, false, false);
		if (tarenas[i] == NULL && !refreshed) {
			tarenas[i] = arena_get(tsd, i, false, true);
			refreshed = true;
		}
	}

	for (i = 0; i < ctl_stats.narenas; i++) {
		if (tarenas[i] != NULL)
			ctl_stats.arenas[i].nthreads = arena_nbound(i);
		else
			ctl_stats.arenas[i].nthreads = 0;
	}

	for (i = 0; i < ctl_stats.narenas; i++) {
		bool initialized = (tarenas[i] != NULL);

		ctl_stats.arenas[i].initialized = initialized;
		if (initialized)
			ctl_arena_refresh(tarenas[i], i);
	}

	if (config_stats) {
		size_t base_allocated, base_resident, base_mapped;
		base_stats_get(&base_allocated, &base_resident, &base_mapped);
		ctl_stats.allocated =
		    ctl_stats.arenas[ctl_stats.narenas].allocated_small +
		    ctl_stats.arenas[ctl_stats.narenas].astats.allocated_large +
		    ctl_stats.arenas[ctl_stats.narenas].astats.allocated_huge;
		ctl_stats.active =
		    (ctl_stats.arenas[ctl_stats.narenas].pactive << LG_PAGE);
		ctl_stats.metadata = base_allocated +
		    ctl_stats.arenas[ctl_stats.narenas].astats.metadata_mapped +
		    ctl_stats.arenas[ctl_stats.narenas].astats
		    .metadata_allocated;
		ctl_stats.resident = base_resident +
		    ctl_stats.arenas[ctl_stats.narenas].astats.metadata_mapped +
		    ((ctl_stats.arenas[ctl_stats.narenas].pactive +
		    ctl_stats.arenas[ctl_stats.narenas].pdirty) << LG_PAGE);
		ctl_stats.mapped = base_mapped +
		    ctl_stats.arenas[ctl_stats.narenas].astats.mapped;
	}

	ctl_epoch++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl 0x2d2fe(%rip), %eax     # 0x57758
movq %rsp, %r13
leaq 0xf(,%rax,8), %rcx
andq $-0x10, %rcx
subq %rcx, %r13
movq %r13, %rsp
movq 0x2d2ea(%rip), %rcx     # 0x57760
imulq $0xbc8, %rax, %rax      # imm = 0xBC8
leaq (%rcx,%rax), %rdi
andl $0x0, 0x4(%rcx,%rax)
callq 0x2a94a
movq 0x29b5e(%rip), %rax     # 0x53ff0
movq %fs:0x0, %rbx
addq %rax, %rbx
movl %fs:(%rax), %ecx
testl %ecx, %ecx
je 0x2a900
cmpl $0x2, %ecx
je 0x2a909
xorl %r14d, %r14d
pushq $0x1
popq %r15
xorl %r12d, %r12d
movl 0x2d296(%rip), %eax     # 0x57758
cmpq %rax, %r14
jae 0x2a505
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2a9a9
movq %rax, (%r13,%r14,8)
testq %rax, %rax
setne %al
orb %r12b, %al
testb $0x1, %al
jne 0x2a500
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
movl %r15d, %ecx
callq 0x2a9a9
movq %rax, (%r13,%r14,8)
movb $0x1, %r12b
incq %r14
jmp 0x2a4bc
pushq $0x4
popq %r14
xorl %ebx, %ebx
movl %eax, %ecx
cmpq %rcx, %rbx
jae 0x2a54c
cmpq $0x0, (%r13,%rbx,8)
je 0x2a534
movl %ebx, %edi
callq 0x1c6c9
movq 0x2d238(%rip), %rcx     # 0x57760
movl %eax, (%rcx,%r14)
movl 0x2d226(%rip), %eax     # 0x57758
jmp 0x2a540
movq 0x2d225(%rip), %rcx     # 0x57760
andl $0x0, (%rcx,%r14)
incq %rbx
addq $0xbc8, %r14            # imm = 0xBC8
jmp 0x2a50b
movl $0xd8, %r8d
xorl %r9d, %r9d
xorl %edx, %edx
movq %r13, -0x30(%rbp)
movl %eax, %ecx
cmpq %rcx, %rdx
jae 0x2a854
movq (%r13,%rdx,8), %r14
movq 0x2d1ee(%rip), %r15     # 0x57760
imulq $0xbc8, %rdx, %rbx      # imm = 0xBC8
testq %r14, %r14
setne (%r15,%rbx)
je 0x2a841
movq %rdx, -0x38(%rbp)
addq %r15, %rbx
imulq $0xbc8, %rcx, %r12      # imm = 0xBC8
leaq (%r15,%r12), %r13
movq %rbx, %rdi
movq %r8, -0x48(%rbp)
movq %r9, -0x40(%rbp)
callq 0x2a94a
movl 0x4(%rbx), %eax
addl %eax, 0x4(%r15,%r12)
leaq 0x8(%rbx), %rsi
leaq 0x10(%rbx), %rdx
leaq 0x18(%rbx), %rcx
leaq 0x20(%rbx), %r8
leaq 0x28(%rbx), %r9
leaq 0xc0(%rbx), %rax
movups 0xbb8(%rbx), %xmm0
subq $0x20, %rsp
movups %xmm0, 0x8(%rsp)
movq %rax, (%rsp)
movq %r14, %rdi
callq 0x256f8
leaq 0x17d91(%rip), %r10     # 0x42380
movq -0x40(%rbp), %r9
movq -0x48(%rbp), %r8
addq $0x20, %rsp
movq 0xa0(%rbx), %rcx
movdqu 0xa8(%rbx), %xmm0
movq 0xb8(%rbx), %rax
leaq (%r15,%r8), %rdx
xorl %esi, %esi
cmpq $0x27, %rsi
je 0x2a654
movq (%r10,%rsi,8), %rdi
imulq (%rdx), %rdi
addq %rdi, %rcx
movq %rcx, 0xa0(%rbx)
movdqu -0x18(%rdx), %xmm1
paddq %xmm1, %xmm0
movdqu %xmm0, 0xa8(%rbx)
addq -0x8(%rdx), %rax
movq %rax, 0xb8(%rbx)
incq %rsi
addq $0x48, %rdx
jmp 0x2a617
movdqu 0x18(%rbx), %xmm1
movdqu 0x18(%r13), %xmm2
paddq %xmm1, %xmm2
movdqu 0x28(%r13), %xmm1
movdqu 0x38(%r13), %xmm3
movdqu 0x48(%r13), %xmm4
movdqu %xmm2, 0x18(%r13)
movdqu 0x28(%rbx), %xmm2
paddq %xmm1, %xmm2
movdqu %xmm2, 0x28(%r13)
movdqu 0x38(%rbx), %xmm1
paddq %xmm3, %xmm1
movdqu %xmm1, 0x38(%r13)
movdqu 0x48(%rbx), %xmm1
paddq %xmm4, %xmm1
movdqu %xmm1, 0x48(%r13)
addq %rcx, 0xa0(%r13)
movdqu 0xa8(%r13), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0xa8(%r13)
addq %rax, 0xb8(%r13)
movdqu 0x58(%rbx), %xmm0
movdqu 0x58(%r13), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x58(%r13)
movdqu 0x68(%rbx), %xmm0
movdqu 0x68(%r13), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x68(%r13)
movdqu 0x78(%rbx), %xmm0
movdqu 0x78(%r13), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x78(%r13)
movq 0x88(%rbx), %rax
addq %rax, 0x88(%r13)
movl 0x2d039(%rip), %eax     # 0x57758
addq %r9, %r15
movl $0x100, %ecx            # imm = 0x100
cmpq $0xbf8, %rcx            # imm = 0xBF8
je 0x2a7a3
movdqu -0x40(%r15,%rcx), %xmm0
movdqu -0x40(%r13,%rcx), %xmm1
paddq %xmm0, %xmm1
movdqu -0x30(%r13,%rcx), %xmm0
movdqu -0x20(%r13,%rcx), %xmm2
movdqu -0x10(%r13,%rcx), %xmm3
movdqu %xmm1, -0x40(%r13,%rcx)
movdqu -0x30(%r15,%rcx), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, -0x30(%r13,%rcx)
movdqu -0x20(%r15,%rcx), %xmm0
paddq %xmm2, %xmm0
movdqu %xmm0, -0x20(%r13,%rcx)
movdqu -0x10(%r15,%rcx), %xmm0
paddq %xmm3, %xmm0
movdqu %xmm0, -0x10(%r13,%rcx)
movq (%r15,%rcx), %rdx
addq %rdx, (%r13,%rcx)
addq $0x48, %rcx
jmp 0x2a727
leaq 0x2cda6(%rip), %rcx     # 0x57550
movl (%rcx), %ecx
shlq $0x5, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x2a7f4
movq 0xbb8(%rbx), %rsi
movq 0xbb8(%r13), %rdi
movdqu (%rsi,%rdx), %xmm0
movdqu (%rdi,%rdx), %xmm1
paddq %xmm0, %xmm1
movdqu 0x10(%rdi,%rdx), %xmm0
movdqu %xmm1, (%rdi,%rdx)
movdqu 0x10(%rsi,%rdx), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x10(%rdi,%rdx)
addq $0x20, %rdx
jmp 0x2a7b2
leaq 0x2cd59(%rip), %rcx     # 0x57554
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x2a839
movq 0xbc0(%rbx), %rsi
movq 0xbc0(%r13), %rdi
movdqu (%rsi,%rdx), %xmm0
movdqu (%rdi,%rdx), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, (%rdi,%rdx)
movq 0x10(%rsi,%rdx), %rsi
addq %rsi, 0x10(%rdi,%rdx)
addq $0x18, %rdx
jmp 0x2a803
movq -0x30(%rbp), %r13
movq -0x38(%rbp), %rdx
incq %rdx
movl $0xbc8, %ecx            # imm = 0xBC8
addq %rcx, %r8
addq %rcx, %r9
jmp 0x2a55b
leaq -0x60(%rbp), %r15
leaq -0x58(%rbp), %r14
leaq -0x50(%rbp), %rbx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x28a2f
movq 0x2ceeb(%rip), %rax     # 0x57760
movl 0x2cedd(%rip), %ecx     # 0x57758
imulq $0xbc8, %rcx, %rcx      # imm = 0xBC8
movq 0x58(%rax,%rcx), %rdx
addq 0xa0(%rax,%rcx), %rdx
addq 0x78(%rax,%rcx), %rdx
movq %rdx, 0x2ce95(%rip)     # 0x57730
movq 0x18(%rax,%rcx), %rdx
movq %rdx, %rsi
shlq $0xc, %rsi
movq %rsi, 0x2ce8a(%rip)     # 0x57738
movq 0x48(%rax,%rcx), %rsi
movq (%r15), %rdi
addq %rsi, %rdi
addq 0x50(%rax,%rcx), %rdi
movq %rdi, 0x2ce7b(%rip)     # 0x57740
addq (%r14), %rsi
addq 0x20(%rax,%rcx), %rdx
shlq $0xc, %rdx
addq %rsi, %rdx
movq %rdx, 0x2ce6d(%rip)     # 0x57748
movq 0x28(%rax,%rcx), %rax
addq (%rbx), %rax
movq %rax, 0x2ce66(%rip)     # 0x57750
incq 0x2ce77(%rip)           # 0x57768
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %fs:(%rax)
jmp 0x2a910
movl $0x3, %fs:(%rax)
leaq 0x2d4fd(%rip), %rax     # 0x57e14
movl (%rax), %edi
movq %rbx, %rsi
callq 0x106f0
testl %eax, %eax
je 0x2a4b2
leaq 0x18589(%rip), %rdi     # 0x42eb9
callq 0x37d1c
leaq 0x2bce4(%rip), %rax     # 0x56620
cmpb $0x1, (%rax)
jne 0x2a4b2
callq 0x10090