// File: /workspace/github_c_makefile_star2_O3/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 $0x58, %rsp
movl 0x2bc61(%rip), %eax     # 0x5b758
movq %rsp, %r12
leaq 0xf(,%rax,8), %rcx
andq $-0x10, %rcx
subq %rcx, %r12
movq %r12, %rsp
movq 0x2bc4d(%rip), %rcx     # 0x5b760
imulq $0xbc8, %rax, %rax      # imm = 0xBC8
leaq (%rcx,%rax), %rbx
addq $0x18, %rbx
movl $0x0, -0x14(%rbx)
leaq 0x2a870(%rip), %rax     # 0x5a3a0
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbx)
movq $-0x1, -0x8(%rbx)
movl $0xba0, %edx            # imm = 0xBA0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10270
movq 0xba0(%rbx), %rdi
leaq 0x2b9f3(%rip), %rax     # 0x5b550
movl (%rax), %edx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x10270
movq 0xba8(%rbx), %rdi
leaq 0x2b9dc(%rip), %rax     # 0x5b554
movl (%rax), %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdx
xorl %esi, %esi
callq 0x10270
movq 0x28460(%rip), %r15     # 0x57ff0
movq %fs:0x0, %rdx
addq %r15, %rdx
movl %fs:(%r15), %eax
testl %eax, %eax
je 0x30133
cmpl $0x2, %eax
je 0x3013d
cmpl $0x0, 0x2bba0(%rip)     # 0x5b758
je 0x30087
xorl %r14d, %r14d
movq %r12, -0x30(%rbp)
xorl %ebx, %ebx
movq %fs:0x30(%r15), %rax
testq %rax, %rax
je 0x2fc3c
movl %fs:0x38(%r15), %ecx
cmpq %rcx, %r14
jae 0x2fc02
movq (%rax,%r14,8), %rax
testq %rax, %rax
je 0x2fc02
movq %rax, (%r12)
movl %ebx, %r13d
incq %r14
movl 0x2bb64(%rip), %eax     # 0x5b758
addq $0x8, %r12
movl %r13d, %ebx
cmpq %rax, %r14
jb 0x2fbc7
jmp 0x2fc7a
movq -0x30(%rbp), %rax
leaq (%rax,%r14,8), %rsi
movq $0x0, (%r12)
movb $0x1, %r13b
testb $0x1, %bl
jne 0x2fbeb
movq %fs:0x30(%r15), %rax
testq %rax, %rax
je 0x2fc5d
movl %fs:0x38(%r15), %ecx
cmpq %rcx, %r14
jae 0x2fc5d
movq (%rax,%r14,8), %rax
testq %rax, %rax
je 0x2fc5d
movq %rax, (%rsi)
jmp 0x2fbeb
movq %rdx, %rdi
movq %rdx, %r13
movl %r14d, %esi
xorl %edx, %edx
callq 0x21fbc
movq %r13, %rdx
movq %rax, (%r12)
movq %r12, %rsi
testq %rax, %rax
jne 0x2fbe8
jmp 0x2fc12
movq %rdx, %rdi
movq %rdx, -0x38(%rbp)
movq %rsi, %rbx
movl %r14d, %esi
xorl %edx, %edx
callq 0x21fbc
movq %rbx, %rsi
movq -0x38(%rbp), %rdx
jmp 0x2fc37
testl %eax, %eax
movq -0x30(%rbp), %r12
je 0x30087
movl $0x4, %r14d
xorl %ebx, %ebx
cmpq $0x0, (%r12,%rbx,8)
je 0x2fcaf
movl %ebx, %edi
callq 0x21f85
movq 0x2babd(%rip), %rcx     # 0x5b760
movl %eax, (%rcx,%r14)
movl 0x2baab(%rip), %eax     # 0x5b758
jmp 0x2fcbe
movq 0x2baaa(%rip), %rcx     # 0x5b760
movl $0x0, (%rcx,%r14)
incq %rbx
movl %eax, %ecx
addq $0xbc8, %r14            # imm = 0xBC8
cmpq %rcx, %rbx
jb 0x2fc8e
testl %eax, %eax
je 0x30087
movl $0xd8, %r9d
movq 0x2ba7c(%rip), %r14     # 0x5b760
xorl %r10d, %r10d
leaq 0x17b52(%rip), %r15     # 0x47840
xorl %edx, %edx
movq (%r12,%rdx,8), %rbx
imulq $0xbc8, %rdx, %r12      # imm = 0xBC8
testq %rbx, %rbx
setne (%r14,%r12)
je 0x30066
movq %rdx, -0x40(%rbp)
movq %r10, -0x68(%rbp)
addq %r14, %r12
movl %eax, %eax
imulq $0xbc8, %rax, %rax      # imm = 0xBC8
movq %rax, -0x48(%rbp)
leaq (%r14,%rax), %r13
leaq 0x2a674(%rip), %rax     # 0x5a3a0
movq 0x18(%rax), %rax
leaq 0x8(%r12), %rcx
movq %rcx, -0x60(%rbp)
movq %rax, 0x8(%r12)
leaq 0x10(%r12), %rax
movq %rax, -0x58(%rbp)
movq $-0x1, 0x10(%r12)
leaq 0x18(%r12), %rdi
movq %rdi, -0x50(%rbp)
movl $0xba0, %edx            # imm = 0xBA0
xorl %esi, %esi
movq %r9, -0x38(%rbp)
callq 0x10270
movq 0xbb8(%r12), %rdi
leaq 0x2b7d8(%rip), %rax     # 0x5b550
movl (%rax), %edx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x10270
movq 0xbc0(%r12), %rdi
leaq 0x2b7c0(%rip), %rax     # 0x5b554
movl (%rax), %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdx
xorl %esi, %esi
callq 0x10270
movl 0x4(%r12), %eax
movq -0x48(%rbp), %rcx
addl %eax, 0x4(%r14,%rcx)
leaq 0x20(%r12), %r8
leaq 0x28(%r12), %r9
leaq 0xc0(%r12), %rax
movups 0xbb8(%r12), %xmm0
subq $0x20, %rsp
movups %xmm0, 0x8(%rsp)
movq %rax, (%rsp)
movq %rbx, %rdi
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rcx
callq 0x2a90a
movq -0x38(%rbp), %r9
addq $0x20, %rsp
movq 0xa0(%r12), %rcx
movdqu 0xa8(%r12), %xmm0
movq 0xb8(%r12), %rax
leaq (%r14,%r9), %rdx
xorl %esi, %esi
movq (%r15,%rsi,8), %rdi
imulq (%rdx), %rdi
addq %rdi, %rcx
movq %rcx, 0xa0(%r12)
movdqu -0x18(%rdx), %xmm1
paddq %xmm1, %xmm0
movdqu %xmm0, 0xa8(%r12)
addq -0x8(%rdx), %rax
movq %rax, 0xb8(%r12)
incq %rsi
addq $0x48, %rdx
cmpq $0x27, %rsi
jne 0x2fe17
movdqu 0x18(%r12), %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(%r12), %xmm2
paddq %xmm1, %xmm2
movdqu %xmm2, 0x28(%r13)
movdqu 0x38(%r12), %xmm1
paddq %xmm3, %xmm1
movdqu %xmm1, 0x38(%r13)
movdqu 0x48(%r12), %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(%r12), %xmm0
movdqu 0x58(%r13), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x58(%r13)
movdqu 0x68(%r12), %xmm0
movdqu 0x68(%r13), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x68(%r13)
movdqu 0x78(%r12), %xmm0
movdqu 0x78(%r13), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x78(%r13)
movq 0x88(%r12), %rax
addq %rax, 0x88(%r13)
movq 0x2b82f(%rip), %rax     # 0x5b760
movq -0x68(%rbp), %r10
addq %r10, %r14
movl $0x100, %ecx            # imm = 0x100
movdqu -0x40(%r14,%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(%r14,%rcx), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, -0x30(%r13,%rcx)
movdqu -0x20(%r14,%rcx), %xmm0
paddq %xmm2, %xmm0
movdqu %xmm0, -0x20(%r13,%rcx)
movdqu -0x10(%r14,%rcx), %xmm0
paddq %xmm3, %xmm0
movdqu %xmm0, -0x10(%r13,%rcx)
movq (%r14,%rcx), %rdx
addq %rdx, (%r13,%rcx)
addq $0x48, %rcx
cmpq $0xbf8, %rcx            # imm = 0xBF8
jne 0x2ff3d
leaq 0x2b592(%rip), %rcx     # 0x5b550
movl (%rcx), %ecx
testq %rcx, %rcx
je 0x3000c
movq 0xbb8(%r12), %rdx
movq 0xbb8(%r13), %rsi
shlq $0x5, %rcx
xorl %edi, %edi
movdqu (%rdx,%rdi), %xmm0
movdqu (%rsi,%rdi), %xmm1
paddq %xmm0, %xmm1
movdqu 0x10(%rsi,%rdi), %xmm0
movdqu %xmm1, (%rsi,%rdi)
movdqu 0x10(%rdx,%rdi), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x10(%rsi,%rdi)
addq $0x20, %rdi
cmpq %rdi, %rcx
jne 0x2ffda
leaq 0x2b541(%rip), %rcx     # 0x5b554
movl (%rcx), %esi
testq %rsi, %rsi
je 0x30059
movq 0xbc0(%r12), %rcx
movq 0xbc0(%r13), %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
movdqu (%rcx,%rdi), %xmm0
movdqu (%rdx,%rdi), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, (%rdx,%rdi)
movq 0x10(%rcx,%rdi), %r8
addq %r8, 0x10(%rdx,%rdi)
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0x30033
movq %rax, %r14
movq -0x30(%rbp), %r12
movq -0x40(%rbp), %rdx
jmp 0x3006a
movq -0x30(%rbp), %r12
incq %rdx
movl 0x2b6e5(%rip), %eax     # 0x5b758
movl $0xbc8, %ecx            # imm = 0xBC8
addq %rcx, %r9
addq %rcx, %r10
cmpq %rax, %rdx
jb 0x2fcf0
leaq -0x80(%rbp), %r15
leaq -0x78(%rbp), %r14
leaq -0x70(%rbp), %rbx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2dfc9
movq 0x2b6b8(%rip), %rax     # 0x5b760
movl 0x2b6aa(%rip), %ecx     # 0x5b758
imulq $0xbc8, %rcx, %rcx      # imm = 0xBC8
movq 0x58(%rax,%rcx), %rdx
addq 0xa0(%rax,%rcx), %rdx
addq 0x78(%rax,%rcx), %rdx
movq %rdx, 0x2b662(%rip)     # 0x5b730
movq 0x18(%rax,%rcx), %rdx
movq %rdx, %rsi
shlq $0xc, %rsi
movq %rsi, 0x2b657(%rip)     # 0x5b738
movq 0x48(%rax,%rcx), %rsi
movq (%r15), %rdi
addq %rsi, %rdi
addq 0x50(%rax,%rcx), %rdi
movq %rdi, 0x2b648(%rip)     # 0x5b740
addq (%r14), %rsi
addq 0x20(%rax,%rcx), %rdx
shlq $0xc, %rdx
addq %rsi, %rdx
movq %rdx, 0x2b63a(%rip)     # 0x5b748
movq 0x28(%rax,%rcx), %rax
addq (%rbx), %rax
movq %rax, 0x2b633(%rip)     # 0x5b750
incq 0x2b644(%rip)           # 0x5b768
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %fs:(%r15)
jmp 0x30145
movl $0x3, %fs:(%r15)
leaq 0x2bcc8(%rip), %rax     # 0x5be14
movl (%rax), %edi
movq %rdx, %rbx
movq %rdx, %rsi
callq 0x106f0
movq %rbx, %rdx
testl %eax, %eax
je 0x2fbb1
leaq 0x1820e(%rip), %rdi     # 0x48379
callq 0x3d37c
movq %rbx, %rdx
leaq 0x2a4a6(%rip), %rax     # 0x5a620
cmpb $0x1, (%rax)
jne 0x2fbb1
callq 0x10090