// File: /workspace/github_c_makefile_star2_O2/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
subq $0x28, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, %rbp
movq %rsi, %rbx
movq 0x88(%rsp), %r15
movq 0x80(%rsp), %r12
movq 0x78(%rsp), %r14
movq 0x70(%rsp), %r13
leaq 0x10(%rsi), %rdi
movq %rdi, 0x20(%rsp)
callq 0xb5a0
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %r8
movq 0x60(%rsp), %r9
callq 0x1de65
movdqu 0x60(%rbx), %xmm0
movdqu (%r13), %xmm1
paddq %xmm0, %xmm1
movdqu 0x10(%r13), %xmm0
movdqu 0x20(%r13), %xmm2
movdqu %xmm1, (%r13)
movdqu 0x70(%rbx), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x10(%r13)
movdqu 0x80(%rbx), %xmm0
paddq %xmm2, %xmm0
movdqu %xmm0, 0x20(%r13)
xorl %eax, %eax
lock
xaddq %rax, 0x90(%rbx)
addq %rax, 0x30(%r13)
movdqu 0x98(%rbx), %xmm0
movdqu 0x38(%r13), %xmm1
paddq %xmm0, %xmm1
movdqu 0x48(%r13), %xmm0
movdqu 0x58(%r13), %xmm2
movdqu %xmm1, 0x38(%r13)
movdqu 0xa8(%rbx), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, 0x48(%r13)
movdqu 0xb8(%rbx), %xmm0
paddq %xmm2, %xmm0
movdqu %xmm0, 0x58(%r13)
movq 0xc8(%rbx), %rax
addq %rax, 0x68(%r13)
xorl %eax, %eax
movl 0x2a602(%rip), %ecx     # 0x485d4
pushq $0x10
popq %rdx
cmpq %rcx, %rax
jae 0x1e017
movq 0xd0(%rbx), %rsi
movdqu -0x10(%rsi,%rdx), %xmm0
movdqu -0x10(%r12,%rdx), %xmm1
paddq %xmm0, %xmm1
movdqu (%r12,%rdx), %xmm0
movdqu %xmm1, -0x10(%r12,%rdx)
movdqu (%rsi,%rdx), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, (%r12,%rdx)
incq %rax
addq $0x20, %rdx
jmp 0x1dfd5
movl 0x2af9b(%rip), %eax     # 0x48fb8
imulq $0x18, %rax, %rax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x1e054
movq 0xd8(%rbx), %rdx
movdqu (%rdx,%rcx), %xmm0
movdqu (%r15,%rcx), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, (%r15,%rcx)
movq 0x10(%rdx,%rcx), %rdx
addq %rdx, 0x10(%r15,%rcx)
addq $0x18, %rcx
jmp 0x1e023
movq 0x20(%rsp), %rdi
callq 0xb380
addq $0x980, %rbx            # imm = 0x980
pushq $0x40
popq %r15
cmpq $0xb38, %r15            # imm = 0xB38
je 0x1e103
movq %rbx, %rdi
callq 0xb5a0
movdqu 0x60(%rbx), %xmm0
movdqu -0x40(%r14,%r15), %xmm1
paddq %xmm0, %xmm1
movdqu -0x30(%r14,%r15), %xmm0
movdqu -0x20(%r14,%r15), %xmm2
movdqu -0x10(%r14,%r15), %xmm3
movdqu %xmm1, -0x40(%r14,%r15)
movdqu 0x70(%rbx), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, -0x30(%r14,%r15)
movdqu 0x80(%rbx), %xmm0
paddq %xmm2, %xmm0
movdqu %xmm0, -0x20(%r14,%r15)
movdqu 0x90(%rbx), %xmm0
paddq %xmm3, %xmm0
movdqu %xmm0, -0x10(%r14,%r15)
movq 0xa0(%rbx), %rax
addq %rax, (%r14,%r15)
movq %rbx, %rdi
callq 0xb380
addq $0x48, %r15
addq $0xa8, %rbx
jmp 0x1e069
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq