// File: /workspace/github_c_makefile_star2_O3/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 $0x88, %rsp
movl %r9d, %r13d
movl %r8d, %ebx
movl %ecx, %r12d
movl %edx, -0x34(%rbp)
movq %rsi, %r15
movq %rdi, %r14
leaq -0x80(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb09f(%rip), %rdi      # 0x3da85
leaq -0x98(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1fcb0
testl %eax, %eax
jne 0x32f41
leaq -0x78(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb082(%rip), %rdi      # 0x3da93
leaq -0x80(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1fcb0
testl %eax, %eax
jne 0x32f51
leaq -0x70(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb06a(%rip), %rdi      # 0x3daa3
leaq -0x78(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1fcb0
testl %eax, %eax
jne 0x32f61
leaq -0x68(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb04f(%rip), %rdi      # 0x3dab0
leaq -0x70(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1fcb0
testl %eax, %eax
jne 0x32f71
leaq -0x60(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb036(%rip), %rdi      # 0x3dabf
leaq -0x68(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1fcb0
testl %eax, %eax
jne 0x32f81
leaq -0x58(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xb01d(%rip), %rdi      # 0x3dace
leaq -0x60(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1fcb0
testl %eax, %eax
jne 0x32f91
leaq -0x90(%rbp), %rdx
movq $0x8, (%rdx)
leaq 0xafff(%rip), %rdi      # 0x3dadb
leaq -0x58(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1fcb0
testl %eax, %eax
jne 0x32fa1
cmpb $0x0, -0x34(%rbp)
movl %r13d, -0x30(%rbp)
je 0x32c16
leaq 0xafe3(%rip), %rdx      # 0x3daea
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x373de
movq -0x98(%rbp), %rax
xorl %ecx, %ecx
lock
xaddq %rcx, (%rax)
leaq 0xafcf(%rip), %rdx      # 0x3daf8
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x373de
movq -0x80(%rbp), %rcx
leaq 0xb3f6(%rip), %rdx      # 0x3df37
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x373de
movq -0x78(%rbp), %rcx
leaq 0xafb3(%rip), %rdx      # 0x3db0c
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x373de
movq -0x70(%rbp), %rcx
leaq 0xafae(%rip), %rdx      # 0x3db1f
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x373de
movq -0x68(%rbp), %rcx
leaq 0xafab(%rip), %rdx      # 0x3db34
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x373de
movq -0x60(%rbp), %rcx
leaq 0xb712(%rip), %rdx      # 0x3e2b3
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x373de
movq -0x58(%rbp), %rcx
leaq 0xaf90(%rip), %rdx      # 0x3db49
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x373de
movl %ebx, %r13d
movl %r12d, %ebx
orb %r13b, %bl
leaq 0x66c8(%rip), %rax      # 0x3929e
leaq 0x6b9b(%rip), %rcx      # 0x39778
cmovneq %rax, %rcx
leaq 0xbd5f(%rip), %rdx      # 0x3e947
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x373de
testb %bl, %bl
je 0x32f32
movl %r13d, %ebx
leaq 0xafca(%rip), %rdx      # 0x3dbd1
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x373de
jmp 0x32c76
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %r8
movq -0x70(%rbp), %r9
subq $0x8, %rsp
leaq 0xaf30(%rip), %rdx      # 0x3db5d
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
pushq -0x58(%rbp)
pushq -0x60(%rbp)
pushq -0x68(%rbp)
callq 0x373de
addq $0x20, %rsp
movq -0x98(%rbp), %rax
xorl %ecx, %ecx
lock
xaddq %rcx, (%rax)
leaq 0xaf58(%rip), %rdx      # 0x3dbb4
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x373de
movl %r12d, %eax
orb %bl, %al
cmpb $0x1, %al
jne 0x32f32
movq %r14, -0x48(%rbp)
leaq -0x90(%rbp), %rdx
movq $0x4, (%rdx)
leaq 0xaa31(%rip), %rdi      # 0x3d6c0
leaq -0x2c(%rbp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1fcb0
testl %eax, %eax
jne 0x32fb1
movq %rsp, -0xa0(%rbp)
movl -0x2c(%rbp), %eax
movq %rsp, %r13
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
movl -0x2c(%rbp), %eax
leaq -0x90(%rbp), %rdx
movq %rax, (%rdx)
leaq 0xaf12(%rip), %rdi      # 0x3dbe6
xorl %r14d, %r14d
movq %r13, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1fcb0
testl %eax, %eax
jne 0x32fc1
movq %r15, -0x40(%rbp)
movl -0x2c(%rbp), %eax
testq %rax, %rax
je 0x32d0e
xorl %ecx, %ecx
xorl %r14d, %r14d
movzbl (%r13,%rcx), %edx
addl %edx, %r14d
incq %rcx
cmpq %rcx, %rax
jne 0x32cfd
movb 0x18(%rbp), %r15b
movb 0x10(%rbp), %cl
testb %r12b, %r12b
je 0x32df2
cmpl $0x2, %r14d
setb %al
testb %bl, %al
jne 0x32df2
cmpb $0x0, -0x34(%rbp)
je 0x32daa
leaq 0xaebf(%rip), %rdx      # 0x3dbf9
movq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq -0x40(%rbp), %r12
movq %r12, %rsi
xorl %eax, %eax
callq 0x373de
movl -0x2c(%rbp), %ecx
subq $0x8, %rsp
movzbl %r15b, %eax
movzbl -0x30(%rbp), %r8d
movb 0x10(%rbp), %dl
movzbl %dl, %r9d
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
pushq %rax
callq 0x32fdb
addq $0x10, %rsp
cmpl $0x2, %r14d
leaq 0x69f2(%rip), %rax      # 0x39778
leaq 0x6511(%rip), %rcx      # 0x3929e
cmovbq %rax, %rcx
leaq 0xbbae(%rip), %rdx      # 0x3e946
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x373de
movb 0x10(%rbp), %cl
jmp 0x32df2
leaq 0xae58(%rip), %rdx      # 0x3dc09
movq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq -0x40(%rbp), %r12
movq %r12, %rsi
xorl %eax, %eax
callq 0x373de
movl -0x2c(%rbp), %ecx
subq $0x8, %rsp
movzbl %r15b, %eax
movzbl -0x30(%rbp), %r8d
movb 0x10(%rbp), %dl
movzbl %dl, %r9d
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
pushq %rax
callq 0x32fdb
movb 0x10(%rbp), %cl
addq $0x10, %rsp
cmpl $0x0, -0x2c(%rbp)
je 0x32f0f
movzbl %r15b, %eax
movq %rax, -0x88(%rbp)
movzbl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movzbl %cl, %eax
movl %eax, -0x50(%rbp)
xorl %ebx, %ebx
movl $0x0, -0x4c(%rbp)
movq %r13, -0xa8(%rbp)
cmpb $0x1, (%r13,%rbx)
jne 0x32f00
cmpb $0x0, -0x34(%rbp)
je 0x32ebd
movl -0x4c(%rbp), %r13d
incl %r13d
movq -0x48(%rbp), %r12
movq %r12, %rdi
movq -0x40(%rbp), %r15
movq %r15, %rsi
leaq 0xadca(%rip), %rdx      # 0x3dc20
movl %ebx, %ecx
xorl %eax, %eax
callq 0x373de
subq $0x8, %rsp
movq %r12, %rdi
movq %r15, %rsi
movl $0x1, %edx
movl %ebx, %ecx
movl -0x30(%rbp), %r8d
movl -0x50(%rbp), %r9d
pushq -0x88(%rbp)
callq 0x32fdb
addq $0x10, %rsp
movl %r13d, -0x4c(%rbp)
cmpl %r14d, %r13d
movq -0xa8(%rbp), %r13
leaq 0x68dc(%rip), %rcx      # 0x39778
leaq 0x63fb(%rip), %rax      # 0x3929e
cmovbq %rax, %rcx
movq %r12, %rdi
movq %r15, %rsi
leaq 0xba92(%rip), %rdx      # 0x3e946
xorl %eax, %eax
callq 0x373de
jmp 0x32f00
movq -0x48(%rbp), %r12
movq %r12, %rdi
movq -0x40(%rbp), %r15
movq %r15, %rsi
leaq 0xad5a(%rip), %rdx      # 0x3dc2c
movl %ebx, %ecx
xorl %eax, %eax
callq 0x373de
subq $0x8, %rsp
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movl %ebx, %ecx
movl -0x30(%rbp), %r8d
movl -0x50(%rbp), %r9d
pushq -0x88(%rbp)
callq 0x32fdb
addq $0x10, %rsp
incq %rbx
movl -0x2c(%rbp), %eax
cmpq %rax, %rbx
jb 0x32e24
movq -0xa0(%rbp), %rsp
cmpb $0x0, -0x34(%rbp)
je 0x32f32
leaq 0xad17(%rip), %rdx      # 0x3dc3a
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
xorl %eax, %eax
callq 0x373de
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9e36(%rip), %rdi      # 0x3cd7e
leaq 0xab36(%rip), %rsi      # 0x3da85
jmp 0x32fcf
leaq 0x9e26(%rip), %rdi      # 0x3cd7e
leaq 0xab34(%rip), %rsi      # 0x3da93
jmp 0x32fcf
leaq 0x9e16(%rip), %rdi      # 0x3cd7e
leaq 0xab34(%rip), %rsi      # 0x3daa3
jmp 0x32fcf
leaq 0x9e06(%rip), %rdi      # 0x3cd7e
leaq 0xab31(%rip), %rsi      # 0x3dab0
jmp 0x32fcf
leaq 0x9df6(%rip), %rdi      # 0x3cd7e
leaq 0xab30(%rip), %rsi      # 0x3dabf
jmp 0x32fcf
leaq 0x9de6(%rip), %rdi      # 0x3cd7e
leaq 0xab2f(%rip), %rsi      # 0x3dace
jmp 0x32fcf
leaq 0x9dd6(%rip), %rdi      # 0x3cd7e
leaq 0xab2c(%rip), %rsi      # 0x3dadb
jmp 0x32fcf
leaq 0x9dc6(%rip), %rdi      # 0x3cd7e
leaq 0xa701(%rip), %rsi      # 0x3d6c0
jmp 0x32fcf
leaq 0x9db6(%rip), %rdi      # 0x3cd7e
leaq 0xac17(%rip), %rsi      # 0x3dbe6
xorl %eax, %eax
callq 0x374a4
callq 0xb070