// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movl 0x678a2(%rip), %eax     # 0x129340
movq %rsp, %rcx
movq %rcx, -0x10(%rbp)
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x28(%rbp)
movq %rcx, %rsp
movq %rax, -0x18(%rbp)
leaq 0x676bf(%rip), %rdi     # 0x129188
callq 0xc19c0
leaq 0x676e3(%rip), %rax     # 0x1291b8
movq 0x10(%rax), %rax
movq %rax, 0x67830(%rip)     # 0x129310
leaq 0x676d1(%rip), %rax     # 0x1291b8
movq (%rax), %rax
movq %rax, 0x67827(%rip)     # 0x129318
leaq 0x676c0(%rip), %rax     # 0x1291b8
movq 0x8(%rax), %rax
movq %rax, 0x6781d(%rip)     # 0x129320
leaq 0x6767e(%rip), %rdi     # 0x129188
callq 0xc1d60
leaq 0x67842(%rip), %rdi     # 0x129358
callq 0xc19c0
leaq 0x678ae(%rip), %rax     # 0x1293d0
movq (%rax), %rax
movq %rax, 0x677fc(%rip)     # 0x129328
leaq 0x67895(%rip), %rax     # 0x1293c8
movq (%rax), %rax
movq %rax, 0x677f3(%rip)     # 0x129330
leaq 0x67894(%rip), %rax     # 0x1293d8
movq (%rax), %rax
movq %rax, 0x677ea(%rip)     # 0x129338
leaq 0x67803(%rip), %rdi     # 0x129358
callq 0xc1d60
movq 0x677e7(%rip), %rax     # 0x129348
movl 0x677d9(%rip), %ecx     # 0x129340
imulq $0x870, %rcx, %rcx      # imm = 0x870
addq %rcx, %rax
movl $0x0, 0x4(%rax)
movq 0x677c9(%rip), %rdi     # 0x129348
movl 0x677bb(%rip), %eax     # 0x129340
imulq $0x870, %rax, %rax      # imm = 0x870
addq %rax, %rdi
callq 0xc1d80
leaq 0x6693d(%rip), %rdi     # 0x1284d8
callq 0xc19c0
movq -0x28(%rbp), %rdi
leaq 0x6691d(%rip), %rax     # 0x1284c8
movq (%rax), %rsi
movl 0x6778c(%rip), %eax     # 0x129340
movl %eax, %edx
shlq $0x3, %rdx
callq 0x1fbf0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x67771(%rip), %eax     # 0x129340
jae 0xc1c3a
leaq 0x668f0(%rip), %rax     # 0x1284c8
movq (%rax), %rax
movl -0x4(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xc1c12
leaq 0x668dc(%rip), %rax     # 0x1284c8
movq (%rax), %rax
movl -0x4(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %ecx
movq 0x67748(%rip), %rax     # 0x129348
movl -0x4(%rbp), %edx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rax
movl %ecx, 0x4(%rax)
jmp 0xc1c2d
movq 0x6772f(%rip), %rax     # 0x129348
movl -0x4(%rbp), %ecx
imulq $0x870, %rcx, %rcx      # imm = 0x870
addq %rcx, %rax
movl $0x0, 0x4(%rax)
jmp 0xc1c2f
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc1bc6
leaq 0x66897(%rip), %rdi     # 0x1284d8
callq 0xc1d60
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x676ea(%rip), %eax     # 0x129340
jae 0xc1cae
movq -0x28(%rbp), %rax
movl -0x4(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
setne %al
andb $0x1, %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %cl
movq 0x676d2(%rip), %rax     # 0x129348
movl -0x4(%rbp), %edx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rax
andb $0x1, %cl
movb %cl, (%rax)
testb $0x1, -0x19(%rbp)
je 0xc1ca1
movq -0x28(%rbp), %rax
movl -0x4(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
movl -0x4(%rbp), %esi
callq 0xc1e50
jmp 0xc1ca3
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc1c4d
movq 0x67693(%rip), %rax     # 0x129348
movl 0x67685(%rip), %ecx     # 0x129340
imulq $0x870, %rcx, %rcx      # imm = 0x870
addq %rcx, %rax
movq 0x68(%rax), %rax
movq 0x67678(%rip), %rcx     # 0x129348
movl 0x6766a(%rip), %edx     # 0x129340
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
addq 0x40(%rcx), %rax
addq 0x6763d(%rip), %rax     # 0x129328
movq %rax, 0x67606(%rip)     # 0x1292f8
movq 0x6764f(%rip), %rax     # 0x129348
movl 0x67641(%rip), %ecx     # 0x129340
imulq $0x870, %rcx, %rcx      # imm = 0x870
addq %rcx, %rax
movq 0x10(%rax), %rax
shlq $0xc, %rax
addq 0x67610(%rip), %rax     # 0x129328
movq %rax, 0x675e1(%rip)     # 0x129300
movq 0x675ea(%rip), %rax     # 0x129310
leaq 0x51b6b(%rip), %rcx     # 0x113898
movq (%rcx), %rcx
shlq %cl, %rax
movq %rax, 0x675ce(%rip)     # 0x129308
movq 0x6760f(%rip), %rax     # 0x129350
addq $0x1, %rax
movq %rax, 0x67604(%rip)     # 0x129350
movq -0x10(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax,%rax)