// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/stats.c
// Function: stats_print_helper
static void
stats_print_helper(void (*write_cb)(void *, const char *), void *cbopaque,
    bool json, bool merged, bool unmerged, bool bins, bool large, bool huge)
{
	size_t *cactive;
	size_t allocated, active, metadata, resident, mapped, retained;

	CTL_GET("stats.cactive", &cactive, size_t *);
	CTL_GET("stats.allocated", &allocated, size_t);
	CTL_GET("stats.active", &active, size_t);
	CTL_GET("stats.metadata", &metadata, size_t);
	CTL_GET("stats.resident", &resident, size_t);
	CTL_GET("stats.mapped", &mapped, size_t);
	CTL_GET("stats.retained", &retained, size_t);
	if (json) {
		malloc_cprintf(write_cb, cbopaque,
		    "\t\t\"stats\": {\n");

		malloc_cprintf(write_cb, cbopaque,
		    "\t\t\t\"cactive\": %zu,\n", atomic_read_z(cactive));
		malloc_cprintf(write_cb, cbopaque,
		    "\t\t\t\"allocated\": %zu,\n", allocated);
		malloc_cprintf(write_cb, cbopaque,
		    "\t\t\t\"active\": %zu,\n", active);
		malloc_cprintf(write_cb, cbopaque,
		    "\t\t\t\"metadata\": %zu,\n", metadata);
		malloc_cprintf(write_cb, cbopaque,
		    "\t\t\t\"resident\": %zu,\n", resident);
		malloc_cprintf(write_cb, cbopaque,
		    "\t\t\t\"mapped\": %zu,\n", mapped);
		malloc_cprintf(write_cb, cbopaque,
		    "\t\t\t\"retained\": %zu\n", retained);

		malloc_cprintf(write_cb, cbopaque,
		    "\t\t}%s\n", (merged || unmerged) ? "," : "");
	} else {
		malloc_cprintf(write_cb, cbopaque,
		    "Allocated: %zu, active: %zu, metadata: %zu,"
		    " resident: %zu, mapped: %zu, retained: %zu\n",
		    allocated, active, metadata, resident, mapped, retained);
		malloc_cprintf(write_cb, cbopaque,
		    "Current active ceiling: %zu\n",
		    atomic_read_z(cactive));
	}

	if (merged || unmerged) {
		unsigned narenas;

		if (json) {
			malloc_cprintf(write_cb, cbopaque,
			    "\t\t\"stats.arenas\": {\n");
		}

		CTL_GET("arenas.narenas", &narenas, unsigned);
		{
			VARIABLE_ARRAY(bool, initialized, narenas);
			size_t isz;
			unsigned i, j, ninitialized;

			isz = sizeof(bool) * narenas;
			xmallctl("arenas.initialized", (void *)initialized,
			    &isz, NULL, 0);
			for (i = ninitialized = 0; i < narenas; i++) {
				if (initialized[i])
					ninitialized++;
			}

			/* Merged stats. */
			if (merged && (ninitialized > 1 || !unmerged)) {
				/* Print merged arena stats. */
				if (json) {
					malloc_cprintf(write_cb, cbopaque,
					    "\t\t\t\"merged\": {\n");
				} else {
					malloc_cprintf(write_cb, cbopaque,
					    "\nMerged arenas stats:\n");
				}
				stats_arena_print(write_cb, cbopaque, json,
				    narenas, bins, large, huge);
				if (json) {
					malloc_cprintf(write_cb, cbopaque,
					    "\t\t\t}%s\n", (ninitialized > 1) ?
					    "," : "");
				}
			}

			/* Unmerged stats. */
			for (i = j = 0; i < narenas; i++) {
				if (initialized[i]) {
					if (json) {
						j++;
						malloc_cprintf(write_cb,
						    cbopaque,
						    "\t\t\t\"%u\": {\n", i);
					} else {
						malloc_cprintf(write_cb,
						    cbopaque, "\narenas[%u]:\n",
						    i);
					}
					stats_arena_print(write_cb, cbopaque,
					    json, i, bins, large, huge);
					if (json) {
						malloc_cprintf(write_cb,
						    cbopaque,
						    "\t\t\t}%s\n", (j <
						    ninitialized) ? "," : "");
					}
				}
			}
		}

		if (json) {
			malloc_cprintf(write_cb, cbopaque,
			    "\t\t}\n");
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %r9d, %r13d
movl %r8d, %r14d
movl %ecx, %r12d
movl %edx, -0x2c(%rbp)
movq %rsi, %r15
movq %rdi, %rbx
leaq -0x80(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb2bd(%rip), %rdi      # 0x3d999
leaq -0xa0(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1ffb8
testl %eax, %eax
jne 0x32be1
leaq -0x78(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb2a0(%rip), %rdi      # 0x3d9a7
leaq -0x80(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1ffb8
testl %eax, %eax
jne 0x32bf1
leaq -0x70(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb288(%rip), %rdi      # 0x3d9b7
leaq -0x78(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1ffb8
testl %eax, %eax
jne 0x32c01
leaq -0x68(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb26d(%rip), %rdi      # 0x3d9c4
leaq -0x70(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1ffb8
testl %eax, %eax
jne 0x32c11
leaq -0x60(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb254(%rip), %rdi      # 0x3d9d3
leaq -0x68(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1ffb8
testl %eax, %eax
jne 0x32c21
leaq -0x58(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb23b(%rip), %rdi      # 0x3d9e2
leaq -0x60(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1ffb8
testl %eax, %eax
jne 0x32c31
leaq -0x98(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb21d(%rip), %rdi      # 0x3d9ef
leaq -0x58(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1ffb8
testl %eax, %eax
jne 0x32c41
cmpb $0x0, -0x2c(%rbp)
je 0x328dd
leaq 0xb205(%rip), %rdx      # 0x3d9fe
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
movq -0xa0(%rbp), %rax
xorl %ecx, %ecx
lock
xaddq %rcx, (%rax)
leaq 0xb1f1(%rip), %rdx      # 0x3da0c
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
movq -0x80(%rbp), %rcx
leaq 0xb618(%rip), %rdx      # 0x3de4b
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
movq -0x78(%rbp), %rcx
leaq 0xb1d5(%rip), %rdx      # 0x3da20
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
movq -0x70(%rbp), %rcx
leaq 0xb1d0(%rip), %rdx      # 0x3da33
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
movq -0x68(%rbp), %rcx
leaq 0xb1cd(%rip), %rdx      # 0x3da48
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
movq -0x60(%rbp), %rcx
leaq 0xb934(%rip), %rdx      # 0x3e1c7
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
movq -0x58(%rbp), %rcx
leaq 0xb1b2(%rip), %rdx      # 0x3da5d
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
leaq 0x69ac(%rip), %rax      # 0x3926b
leaq 0x6e7f(%rip), %rcx      # 0x39745
testb %r14b, %r14b
cmovneq %rax, %rcx
testb %r12b, %r12b
cmovneq %rax, %rcx
leaq 0xbf80(%rip), %rdx      # 0x3e85b
jmp 0x32923
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %r8
movq -0x70(%rbp), %r9
subq $0x8, %rsp
leaq 0xb17d(%rip), %rdx      # 0x3da71
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
pushq -0x58(%rbp)
pushq -0x60(%rbp)
pushq -0x68(%rbp)
callq 0x36e31
addq $0x20, %rsp
movq -0xa0(%rbp), %rax
xorl %ecx, %ecx
lock
xaddq %rcx, (%rax)
leaq 0xb1a5(%rip), %rdx      # 0x3dac8
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
movl %r12d, %eax
orb %r14b, %al
cmpb $0x1, %al
jne 0x32bd2
cmpb $0x0, -0x2c(%rbp)
je 0x32958
leaq 0xb19a(%rip), %rdx      # 0x3dae5
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
movl %r14d, -0x40(%rbp)
leaq -0x98(%rbp), %rdx
movq $0x4, (%rdx)
leaq 0xac63(%rip), %rdi      # 0x3d5d4
leaq -0x30(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1ffb8
testl %eax, %eax
jne 0x32c51
movq %rsp, -0xa8(%rbp)
movl -0x30(%rbp), %eax
movq %rsp, %rsi
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %rsi
movq %rsi, %rsp
movl -0x30(%rbp), %eax
leaq -0x98(%rbp), %rdx
movq %rax, (%rdx)
leaq 0xb144(%rip), %rdi      # 0x3dafa
xorl %r14d, %r14d
movq %rsi, -0x50(%rbp)
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1ffb8
testl %eax, %eax
jne 0x32c61
movl %r13d, -0x34(%rbp)
movq %rbx, -0x48(%rbp)
movl -0x30(%rbp), %eax
testq %rax, %rax
movq -0x50(%rbp), %r13
je 0x329f9
xorl %ecx, %ecx
xorl %r14d, %r14d
movzbl (%r13,%rcx), %edx
addl %edx, %r14d
incq %rcx
cmpq %rcx, %rax
jne 0x329e8
movb 0x18(%rbp), %bl
movb 0x10(%rbp), %dl
testb %r12b, %r12b
je 0x32aa4
cmpl $0x2, %r14d
setb %al
testb %al, -0x40(%rbp)
jne 0x32aa4
leaq 0xb0ee(%rip), %rax      # 0x3db0d
leaq 0xb0f7(%rip), %rdx      # 0x3db1d
movl -0x2c(%rbp), %r13d
testb %r13b, %r13b
cmovneq %rax, %rdx
movq -0x48(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
movl -0x30(%rbp), %ecx
subq $0x8, %rsp
movzbl %bl, %eax
movzbl %r13b, %edx
movzbl -0x34(%rbp), %r8d
movzbl 0x10(%rbp), %r9d
movq %r12, %rdi
movq %r15, %rsi
pushq %rax
callq 0x32c7b
movb 0x10(%rbp), %dl
addq $0x10, %rsp
testb %r13b, %r13b
movq -0x50(%rbp), %r13
je 0x32aa4
cmpl $0x2, %r14d
leaq 0x6cc4(%rip), %rax      # 0x39745
leaq 0x67e3(%rip), %rcx      # 0x3926b
cmovbq %rax, %rcx
leaq 0xbdc7(%rip), %rdx      # 0x3e85a
movq -0x48(%rbp), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x36e31
movb 0x10(%rbp), %dl
movq %r15, -0x40(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x32baf
leaq 0xb07b(%rip), %rax      # 0x3db34
leaq 0xb080(%rip), %rsi      # 0x3db40
movl -0x2c(%rbp), %ecx
testb %cl, %cl
cmovneq %rax, %rsi
movq %rsi, -0xb8(%rbp)
movzbl %cl, %eax
movl %eax, -0x8c(%rbp)
movzbl %bl, %eax
movq %rax, -0xb0(%rbp)
movzbl -0x34(%rbp), %eax
movl %eax, -0x88(%rbp)
movzbl %dl, %eax
movl %eax, -0x84(%rbp)
xorl %ebx, %ebx
xorl %ecx, %ecx
movq -0x48(%rbp), %r15
cmpb $0x1, (%r13,%rbx)
jne 0x32ba0
movl -0x8c(%rbp), %r12d
addl %r12d, %ecx
movl %ecx, -0x34(%rbp)
movq %r15, %rdi
movq -0x40(%rbp), %r13
movq %r13, %rsi
movq -0xb8(%rbp), %rdx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x36e31
subq $0x8, %rsp
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %ebx, %ecx
movl -0x88(%rbp), %r8d
movl -0x84(%rbp), %r9d
pushq -0xb0(%rbp)
callq 0x32c7b
addq $0x10, %rsp
cmpb $0x0, -0x2c(%rbp)
je 0x32b99
movl -0x34(%rbp), %r12d
cmpl %r14d, %r12d
leaq 0x6bd4(%rip), %rcx      # 0x39745
leaq 0x66f3(%rip), %rax      # 0x3926b
cmovbq %rax, %rcx
movq %r15, %rdi
movq %r13, %rsi
leaq 0xbcd1(%rip), %rdx      # 0x3e85a
xorl %eax, %eax
callq 0x36e31
movq -0x50(%rbp), %r13
movl %r12d, %ecx
jmp 0x32ba0
movq -0x50(%rbp), %r13
movl -0x34(%rbp), %ecx
incq %rbx
movl -0x30(%rbp), %eax
cmpq %rax, %rbx
jb 0x32afe
movq -0xa8(%rbp), %rsp
cmpb $0x0, -0x2c(%rbp)
je 0x32bd2
leaq 0xaf8b(%rip), %rdx      # 0x3db4e
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
xorl %eax, %eax
callq 0x36e31
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa0aa(%rip), %rdi      # 0x3cc92
leaq 0xadaa(%rip), %rsi      # 0x3d999
jmp 0x32c6f
leaq 0xa09a(%rip), %rdi      # 0x3cc92
leaq 0xada8(%rip), %rsi      # 0x3d9a7
jmp 0x32c6f
leaq 0xa08a(%rip), %rdi      # 0x3cc92
leaq 0xada8(%rip), %rsi      # 0x3d9b7
jmp 0x32c6f
leaq 0xa07a(%rip), %rdi      # 0x3cc92
leaq 0xada5(%rip), %rsi      # 0x3d9c4
jmp 0x32c6f
leaq 0xa06a(%rip), %rdi      # 0x3cc92
leaq 0xada4(%rip), %rsi      # 0x3d9d3
jmp 0x32c6f
leaq 0xa05a(%rip), %rdi      # 0x3cc92
leaq 0xada3(%rip), %rsi      # 0x3d9e2
jmp 0x32c6f
leaq 0xa04a(%rip), %rdi      # 0x3cc92
leaq 0xada0(%rip), %rsi      # 0x3d9ef
jmp 0x32c6f
leaq 0xa03a(%rip), %rdi      # 0x3cc92
leaq 0xa975(%rip), %rsi      # 0x3d5d4
jmp 0x32c6f
leaq 0xa02a(%rip), %rdi      # 0x3cc92
leaq 0xae8b(%rip), %rsi      # 0x3dafa
xorl %eax, %eax
callq 0x36ef7
callq 0xb070