// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/ctl.c
// Function: ctl_refresh
static void
ctl_refresh(void)
{
	unsigned i;
	VARIABLE_ARRAY(arena_t *, tarenas, ctl_stats.narenas);

	if (config_stats) {
		malloc_mutex_lock(&chunks_mtx);
		ctl_stats.chunks.current = stats_chunks.curchunks;
		ctl_stats.chunks.total = stats_chunks.nchunks;
		ctl_stats.chunks.high = stats_chunks.highchunks;
		malloc_mutex_unlock(&chunks_mtx);

		malloc_mutex_lock(&huge_mtx);
		ctl_stats.huge.allocated = huge_allocated;
		ctl_stats.huge.nmalloc = huge_nmalloc;
		ctl_stats.huge.ndalloc = huge_ndalloc;
		malloc_mutex_unlock(&huge_mtx);
	}

	/*
	 * 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]);

	malloc_mutex_lock(&arenas_lock);
	memcpy(tarenas, arenas, sizeof(arena_t *) * ctl_stats.narenas);
	for (i = 0; i < ctl_stats.narenas; i++) {
		if (arenas[i] != NULL)
			ctl_stats.arenas[i].nthreads = arenas[i]->nthreads;
		else
			ctl_stats.arenas[i].nthreads = 0;
	}
	malloc_mutex_unlock(&arenas_lock);
	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) {
		ctl_stats.allocated =
		    ctl_stats.arenas[ctl_stats.narenas].allocated_small
		    + ctl_stats.arenas[ctl_stats.narenas].astats.allocated_large
		    + ctl_stats.huge.allocated;
		ctl_stats.active =
		    (ctl_stats.arenas[ctl_stats.narenas].pactive << LG_PAGE)
		    + ctl_stats.huge.allocated;
		ctl_stats.mapped = (ctl_stats.chunks.current << opt_lg_chunk);
	}

	ctl_epoch++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl 0x59535(%rip), %eax     # 0xdf9f0
movq %rsp, %r15
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
leaq 0x59361(%rip), %r14     # 0xdf838
movq %r14, %rdi
callq 0x1faa0
leaq 0x59382(%rip), %rax     # 0xdf868
movq 0x10(%rax), %rcx
movq %rcx, 0x594cf(%rip)     # 0xdf9c0
movdqu (%rax), %xmm0
movdqu %xmm0, 0x594cb(%rip)    # 0xdf9c8
movq %r14, %rdi
callq 0x1fbb0
leaq 0x594fc(%rip), %r14     # 0xdfa08
movq %r14, %rdi
callq 0x1faa0
leaq 0x59565(%rip), %rax     # 0xdfa80
movq (%rax), %rax
movq %rax, 0x594b3(%rip)     # 0xdf9d8
leaq 0x5954c(%rip), %rax     # 0xdfa78
movq (%rax), %rax
movq %rax, 0x594aa(%rip)     # 0xdf9e0
leaq 0x5954b(%rip), %rax     # 0xdfa88
movq (%rax), %rax
movq %rax, 0x594a1(%rip)     # 0xdf9e8
movq %r14, %rdi
callq 0x1fbb0
movq 0x594a2(%rip), %rax     # 0xdf9f8
movl 0x59494(%rip), %ecx     # 0xdf9f0
imulq $0x870, %rcx, %rcx      # imm = 0x870
leaq (%rax,%rcx), %r14
addq $0x10, %r14
movl $0x0, -0xc(%r14)
leaq 0x439d6(%rip), %rax     # 0xc9f50
movq 0x18(%rax), %rax
movq %rax, -0x8(%r14)
movl $0x858, %edx            # imm = 0x858
movq %r14, %rdi
xorl %esi, %esi
callq 0x1f110
movq 0x858(%r14), %rdi
leaq 0x592e9(%rip), %rax     # 0xdf888
movq (%rax), %rdx
leaq 0x5937f(%rip), %rax     # 0xdf928
subq (%rax), %rdx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x1f110
leaq 0x585ca(%rip), %rdi     # 0xdeb88
callq 0x1faa0
leaq 0x585ae(%rip), %rax     # 0xdeb78
movq (%rax), %r14
movl 0x5941d(%rip), %ebx     # 0xdf9f0
leaq (,%rbx,8), %rdx
movq %r15, -0x30(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fbd0
testq %rbx, %rbx
je 0x8661d
movq 0x59402(%rip), %rax     # 0xdf9f8
addq $0x4, %rax
xorl %ecx, %ecx
movq (%r14,%rcx,8), %rsi
movl $0x0, %edx
testq %rsi, %rsi
je 0x8660d
movl 0x4(%rsi), %edx
movl %edx, (%rax)
incq %rcx
addq $0x870, %rax            # imm = 0x870
cmpq %rcx, %rbx
jne 0x865fc
leaq 0x58564(%rip), %rdi     # 0xdeb88
callq 0x1fbb0
movl 0x593c1(%rip), %ecx     # 0xdf9f0
movq 0x593c2(%rip), %r13     # 0xdf9f8
testl %ecx, %ecx
je 0x8690f
movl $0x98, %r11d
movl $0xc8, %edi
xorl %esi, %esi
movq -0x30(%rbp), %rax
movq (%rax,%rsi,8), %r14
imulq $0x870, %rsi, %r15      # imm = 0x870
testq %r14, %r14
setne (%r13,%r15)
je 0x868f4
movq %rsi, -0x48(%rbp)
movq %rdi, -0x58(%rbp)
addq %r13, %r15
movl %ecx, %eax
imulq $0x870, %rax, %rbx      # imm = 0x870
leaq (%rbx,%r13), %r12
leaq 0x438c8(%rip), %rax     # 0xc9f50
movq 0x18(%rax), %rax
leaq 0x8(%r15), %rcx
movq %rcx, -0x40(%rbp)
movq %rax, 0x8(%r15)
leaq 0x10(%r15), %rdi
movq %rdi, -0x38(%rbp)
movl $0x858, %edx            # imm = 0x858
xorl %esi, %esi
movq %r11, -0x60(%rbp)
callq 0x1f110
movq 0x868(%r15), %rdi
leaq 0x591ca(%rip), %rax     # 0xdf888
movq (%rax), %rdx
leaq 0x59260(%rip), %rax     # 0xdf928
subq (%rax), %rdx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x1f110
movl 0x4(%r15), %eax
movq %rbx, -0x50(%rbp)
addl %eax, 0x4(%r13,%rbx)
leaq 0x18(%r15), %rcx
leaq 0x20(%r15), %r8
leaq 0x88(%r15), %r9
subq $0x8, %rsp
movq %r14, %rdi
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
pushq 0x868(%r15)
callq 0x82b1f
movq -0x60(%rbp), %r11
addq $0x10, %rsp
movdqu 0x68(%r15), %xmm1
movdqu 0x78(%r15), %xmm0
movq 0x592d0(%rip), %rax     # 0xdf9f8
leaq (%r11,%r13), %rcx
xorl %edx, %edx
movdqu -0x10(%rcx,%rdx), %xmm2
paddq %xmm2, %xmm1
movdqu (%rcx,%rdx), %xmm2
paddq %xmm2, %xmm0
addq $0x48, %rdx
cmpq $0x7e0, %rdx            # imm = 0x7E0
jne 0x8672e
movdqu %xmm1, 0x68(%r15)
movdqu %xmm0, 0x78(%r15)
movdqu 0x10(%r15), %xmm2
movdqu 0x10(%r12), %xmm3
paddq %xmm2, %xmm3
movdqu 0x20(%r12), %xmm2
movdqu 0x30(%r12), %xmm4
movdqu 0x40(%r12), %xmm5
movdqu %xmm3, 0x10(%r12)
movdqu 0x20(%r15), %xmm3
paddq %xmm2, %xmm3
movdqu %xmm3, 0x20(%r12)
movdqu 0x30(%r15), %xmm2
paddq %xmm4, %xmm2
movdqu %xmm2, 0x30(%r12)
movdqu 0x68(%r12), %xmm2
paddq %xmm1, %xmm2
movdqu %xmm2, 0x68(%r12)
movdqu 0x78(%r12), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x78(%r12)
movdqu 0x40(%r15), %xmm0
paddq %xmm5, %xmm0
movdqu %xmm0, 0x40(%r12)
movdqu 0x50(%r15), %xmm0
movdqu 0x50(%r12), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x50(%r12)
leaq 0x5908b(%rip), %r9      # 0xdf888
movq (%r9), %rcx
leaq 0x59121(%rip), %r10     # 0xdf928
cmpq (%r10), %rcx
je 0x8685e
movq 0x868(%r15), %rcx
movq 0x868(%r12), %rdx
movl $0x1, %esi
xorl %edi, %edi
shlq $0x5, %rdi
movdqu (%rcx,%rdi), %xmm0
movdqu (%rdx,%rdi), %xmm1
paddq %xmm0, %xmm1
movdqu 0x10(%rdx,%rdi), %xmm0
movdqu %xmm1, (%rdx,%rdi)
movdqu 0x10(%rcx,%rdi), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x10(%rdx,%rdi)
movl %esi, %edi
movq (%r9), %r8
subq (%r10), %r8
incl %esi
cmpq %rdi, %r8
ja 0x86822
movq -0x50(%rbp), %rcx
addq %r13, %rcx
addq $0xc8, %rcx
movq -0x58(%rbp), %rdi
addq %rdi, %r13
xorl %edx, %edx
movdqu -0x40(%r13,%rdx), %xmm0
movdqu -0x40(%rcx,%rdx), %xmm1
paddq %xmm0, %xmm1
movdqu -0x30(%rcx,%rdx), %xmm0
movdqu -0x20(%rcx,%rdx), %xmm2
movdqu -0x10(%rcx,%rdx), %xmm3
movdqu %xmm1, -0x40(%rcx,%rdx)
movdqu -0x30(%r13,%rdx), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, -0x30(%rcx,%rdx)
movdqu -0x20(%r13,%rdx), %xmm0
paddq %xmm2, %xmm0
movdqu %xmm0, -0x20(%rcx,%rdx)
movdqu -0x10(%r13,%rdx), %xmm0
paddq %xmm3, %xmm0
movdqu %xmm0, -0x10(%rcx,%rdx)
movq (%r13,%rdx), %rsi
addq %rsi, (%rcx,%rdx)
addq $0x48, %rdx
cmpq $0x7e0, %rdx            # imm = 0x7E0
jne 0x86875
movl 0x59103(%rip), %ecx     # 0xdf9f0
movq %rax, %r13
movq -0x48(%rbp), %rsi
incq %rsi
movl %ecx, %eax
movl $0x870, %edx            # imm = 0x870
addq %rdx, %r11
addq %rdx, %rdi
cmpq %rax, %rsi
jb 0x8664b
jmp 0x86911
xorl %eax, %eax
imulq $0x870, %rax, %rax      # imm = 0x870
movq 0x40(%r13,%rax), %rcx
addq 0x68(%r13,%rax), %rcx
movq 0x590af(%rip), %rdx     # 0xdf9d8
addq %rdx, %rcx
movq %rcx, 0x59075(%rip)     # 0xdf9a8
movq 0x10(%r13,%rax), %rax
shlq $0xc, %rax
addq %rdx, %rax
movq %rax, 0x5906a(%rip)     # 0xdf9b0
movq 0x59073(%rip), %rax     # 0xdf9c0
leaq 0x435f4(%rip), %rcx     # 0xc9f48
movb (%rcx), %cl
shlq %cl, %rax
movq %rax, 0x59058(%rip)     # 0xdf9b8
incq 0x59099(%rip)           # 0xdfa00
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq