// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/arena.c
// Function: arena_stats_merge
void
arena_stats_merge(arena_t *arena, const char **dss, size_t *nactive,
    size_t *ndirty, arena_stats_t *astats, malloc_bin_stats_t *bstats,
    malloc_large_stats_t *lstats)
{
	unsigned i;

	malloc_mutex_lock(&arena->lock);
	*dss = dss_prec_names[arena->dss_prec];
	*nactive += arena->nactive;
	*ndirty += arena->ndirty;

	astats->mapped += arena->stats.mapped;
	astats->npurge += arena->stats.npurge;
	astats->nmadvise += arena->stats.nmadvise;
	astats->purged += arena->stats.purged;
	astats->allocated_large += arena->stats.allocated_large;
	astats->nmalloc_large += arena->stats.nmalloc_large;
	astats->ndalloc_large += arena->stats.ndalloc_large;
	astats->nrequests_large += arena->stats.nrequests_large;

	for (i = 0; i < nlclasses; i++) {
		lstats[i].nmalloc += arena->stats.lstats[i].nmalloc;
		lstats[i].ndalloc += arena->stats.lstats[i].ndalloc;
		lstats[i].nrequests += arena->stats.lstats[i].nrequests;
		lstats[i].curruns += arena->stats.lstats[i].curruns;
	}
	malloc_mutex_unlock(&arena->lock);

	for (i = 0; i < NBINS; i++) {
		arena_bin_t *bin = &arena->bins[i];

		malloc_mutex_lock(&bin->lock);
		bstats[i].allocated += bin->stats.allocated;
		bstats[i].nmalloc += bin->stats.nmalloc;
		bstats[i].ndalloc += bin->stats.ndalloc;
		bstats[i].nrequests += bin->stats.nrequests;
		if (config_tcache) {
			bstats[i].nfills += bin->stats.nfills;
			bstats[i].nflushes += bin->stats.nflushes;
		}
		bstats[i].nruns += bin->stats.nruns;
		bstats[i].reruns += bin->stats.reruns;
		bstats[i].curruns += bin->stats.curruns;
		malloc_mutex_unlock(&bin->lock);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movq %r8, %r12
movq %rcx, 0x8(%rsp)
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %r14
movq 0x50(%rsp), %r13
addq $0x8, %rdi
movq %rdi, 0x10(%rsp)
callq 0x1faa0
movl 0x88(%r14), %eax
leaq 0x4d043(%rip), %rcx     # 0xc6f50
movq (%rcx,%rax,8), %rax
movq %rax, (%r15)
movq 0xe8(%r14), %rax
addq %rax, (%rbp)
movq 0xf0(%r14), %rax
movq 0x8(%rsp), %rcx
addq %rax, (%rcx)
movdqu 0x30(%r14), %xmm0
movdqu (%r12), %xmm1
paddq %xmm0, %xmm1
movdqu 0x10(%r12), %xmm0
movdqu 0x20(%r12), %xmm2
movdqu 0x30(%r12), %xmm3
movdqu %xmm1, (%r12)
movdqu 0x40(%r14), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x10(%r12)
movdqu 0x50(%r14), %xmm0
paddq %xmm2, %xmm0
movdqu %xmm0, 0x20(%r12)
movdqu 0x60(%r14), %xmm0
paddq %xmm3, %xmm0
movdqu %xmm0, 0x30(%r12)
xorl %edx, %edx
leaq 0x628f3(%rip), %rax     # 0xdc888
leaq 0x6298c(%rip), %rcx     # 0xdc928
movl %edx, %edx
movq (%rax), %rsi
subq (%rcx), %rsi
cmpq %rdx, %rsi
jbe 0x79fe7
movq 0x70(%r14), %rsi
movq %rdx, %rdi
shlq $0x5, %rdi
movdqu (%rsi,%rdi), %xmm0
movdqu (%r13,%rdi), %xmm1
paddq %xmm0, %xmm1
movdqu 0x10(%r13,%rdi), %xmm0
movdqu %xmm1, (%r13,%rdi)
movdqu 0x10(%rsi,%rdi), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x10(%r13,%rdi)
incl %edx
jmp 0x79f9c
movq 0x10(%rsp), %rdi
callq 0x1fbb0
addq $0x120, %r14            # imm = 0x120
xorl %r15d, %r15d
cmpq $0x7e0, %r15            # imm = 0x7E0
je 0x7a095
movq %r14, %rdi
callq 0x1faa0
movdqu 0x50(%r14), %xmm0
movdqu (%rbx,%r15), %xmm1
paddq %xmm0, %xmm1
movdqu 0x10(%rbx,%r15), %xmm0
movdqu 0x20(%rbx,%r15), %xmm2
movdqu 0x30(%rbx,%r15), %xmm3
movdqu %xmm1, (%rbx,%r15)
movdqu 0x60(%r14), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x10(%rbx,%r15)
movdqu 0x70(%r14), %xmm0
paddq %xmm2, %xmm0
movdqu %xmm0, 0x20(%rbx,%r15)
movdqu 0x80(%r14), %xmm0
paddq %xmm3, %xmm0
movdqu %xmm0, 0x30(%rbx,%r15)
movq 0x90(%r14), %rax
addq %rax, 0x40(%rbx,%r15)
movq %r14, %rdi
callq 0x1fbb0
addq $0x48, %r15
addq $0x98, %r14
jmp 0x79ffb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq