// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: je_arena_stats_merge
void
arena_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
    const char **dss, ssize_t *lg_dirty_mult, ssize_t *decay_time,
    size_t *nactive, size_t *ndirty, arena_stats_t *astats,
    malloc_bin_stats_t *bstats, malloc_large_stats_t *lstats,
    malloc_huge_stats_t *hstats)
{
	unsigned i;

	cassert(config_stats);

	malloc_mutex_lock(tsdn, &arena->lock);
	arena_basic_stats_merge_locked(arena, nthreads, dss, lg_dirty_mult,
	    decay_time, nactive, ndirty);

	astats->mapped += arena->stats.mapped;
	astats->retained += arena->stats.retained;
	astats->npurge += arena->stats.npurge;
	astats->nmadvise += arena->stats.nmadvise;
	astats->purged += arena->stats.purged;
	astats->metadata_mapped += arena->stats.metadata_mapped;
	astats->metadata_allocated += arena_metadata_allocated_get(arena);
	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;
	astats->allocated_huge += arena->stats.allocated_huge;
	astats->nmalloc_huge += arena->stats.nmalloc_huge;
	astats->ndalloc_huge += arena->stats.ndalloc_huge;

	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;
	}

	for (i = 0; i < nhclasses; i++) {
		hstats[i].nmalloc += arena->stats.hstats[i].nmalloc;
		hstats[i].ndalloc += arena->stats.hstats[i].ndalloc;
		hstats[i].curhchunks += arena->stats.hstats[i].curhchunks;
	}
	malloc_mutex_unlock(tsdn, &arena->lock);

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

		malloc_mutex_lock(tsdn, &bin->lock);
		bstats[i].nmalloc += bin->stats.nmalloc;
		bstats[i].ndalloc += bin->stats.ndalloc;
		bstats[i].nrequests += bin->stats.nrequests;
		bstats[i].curregs += bin->stats.curregs;
		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(tsdn, &bin->lock);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %rbx
movq 0x50(%rsp), %r14
leaq 0x10(%rsi), %rdi
movq %rdi, (%rsp)
callq 0xb5a0
xorl %eax, %eax
xorl %ecx, %ecx
lock
xaddl %ecx, 0x4(%rbx)
addl %ecx, (%rbp)
movl 0xf8(%rbx), %ecx
leaq 0x2878b(%rip), %rdx     # 0x4c3e0
movq (%rdx,%rcx,8), %rcx
movq %rcx, (%r13)
movq 0x118(%rbx), %rcx
movq %rcx, (%r12)
movq 0x1b8(%rbx), %rcx
movq %rcx, (%r15)
movq 0x128(%rbx), %rcx
movq 0x40(%rsp), %rdx
addq %rcx, (%rdx)
movq 0x130(%rbx), %rcx
movq 0x48(%rsp), %rdx
addq %rcx, (%rdx)
movq 0x60(%rbx), %rcx
addq %rcx, (%r14)
movq 0x68(%rbx), %rcx
addq %rcx, 0x8(%r14)
movq 0x70(%rbx), %rcx
addq %rcx, 0x10(%r14)
movq 0x78(%rbx), %rcx
addq %rcx, 0x18(%r14)
movq 0x80(%rbx), %rcx
addq %rcx, 0x20(%r14)
movq 0x88(%rbx), %rcx
addq %rcx, 0x28(%r14)
lock
xaddq %rax, 0x90(%rbx)
addq %rax, 0x30(%r14)
movq 0x98(%rbx), %rax
addq %rax, 0x38(%r14)
movq 0xa0(%rbx), %rax
addq %rax, 0x40(%r14)
movq 0xa8(%rbx), %rax
addq %rax, 0x48(%r14)
movq 0xb0(%rbx), %rax
addq %rax, 0x50(%r14)
movq 0xb8(%rbx), %rax
addq %rax, 0x58(%r14)
movq 0xc0(%rbx), %rax
addq %rax, 0x60(%r14)
movq 0xc8(%rbx), %rax
addq %rax, 0x68(%r14)
movl 0x288af(%rip), %eax     # 0x4c5d4
testq %rax, %rax
je 0x23d6b
movq 0x60(%rsp), %rcx
movq 0xd0(%rbx), %rdx
shlq $0x5, %rax
xorl %esi, %esi
movq (%rdx,%rsi), %rdi
addq %rdi, (%rcx,%rsi)
movq 0x8(%rdx,%rsi), %rdi
addq %rdi, 0x8(%rcx,%rsi)
movq 0x10(%rdx,%rsi), %rdi
addq %rdi, 0x10(%rcx,%rsi)
movq 0x18(%rdx,%rsi), %rdi
addq %rdi, 0x18(%rcx,%rsi)
addq $0x20, %rsi
cmpq %rsi, %rax
jne 0x23d3c
movl 0x29247(%rip), %edx     # 0x4cfb8
testq %rdx, %rdx
je 0x23db1
movq 0x68(%rsp), %rax
movq 0xd8(%rbx), %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
movq (%rcx,%rsi), %rdi
addq %rdi, (%rax,%rsi)
movq 0x8(%rcx,%rsi), %rdi
addq %rdi, 0x8(%rax,%rsi)
movq 0x10(%rcx,%rsi), %rdi
addq %rdi, 0x10(%rax,%rsi)
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0x23d8c
movq 0x58(%rsp), %r14
movq (%rsp), %rdi
callq 0xb380
addq $0x980, %rbx            # imm = 0x980
movl $0x40, %r15d
movq %rbx, %rdi
callq 0xb5a0
movq 0x60(%rbx), %rax
addq %rax, -0x40(%r14,%r15)
movq 0x68(%rbx), %rax
addq %rax, -0x38(%r14,%r15)
movq 0x70(%rbx), %rax
addq %rax, -0x30(%r14,%r15)
movq 0x78(%rbx), %rax
addq %rax, -0x28(%r14,%r15)
movq 0x80(%rbx), %rax
addq %rax, -0x20(%r14,%r15)
movq 0x88(%rbx), %rax
addq %rax, -0x18(%r14,%r15)
movq 0x90(%rbx), %rax
addq %rax, -0x10(%r14,%r15)
movq 0x98(%rbx), %rax
addq %rax, -0x8(%r14,%r15)
movq 0xa0(%rbx), %rax
addq %rax, (%r14,%r15)
movq %rbx, %rdi
callq 0xb380
addq $0xa8, %rbx
addq $0x48, %r15
cmpq $0xb38, %r15            # imm = 0xB38
jne 0x23dcc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq