// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_dump
static bool
prof_dump(bool propagate_err, const char *filename, bool leakcheck)
{
	prof_tdata_t *prof_tdata;
	prof_cnt_t cnt_all;
	size_t tabind;
	union {
		prof_bt_t	*p;
		void		*v;
	} bt;
	union {
		prof_ctx_t	*p;
		void		*v;
	} ctx;
	size_t leak_nctx;

	cassert(config_prof);

	prof_tdata = prof_tdata_get();
	if ((uintptr_t)prof_tdata <= (uintptr_t)PROF_TDATA_STATE_MAX)
		return (true);
	prof_enter(prof_tdata);
	prof_dump_fd = creat(filename, 0644);
	if (prof_dump_fd == -1) {
		if (propagate_err == false) {
			malloc_printf(
			    "<jemalloc>: creat(\"%s\"), 0644) failed\n",
			    filename);
			if (opt_abort)
				abort();
		}
		goto label_error;
	}

	/* Merge per thread profile stats, and sum them in cnt_all. */
	memset(&cnt_all, 0, sizeof(prof_cnt_t));
	leak_nctx = 0;
	for (tabind = 0; ckh_iter(&bt2ctx, &tabind, NULL, &ctx.v) == false;)
		prof_ctx_sum(ctx.p, &cnt_all, &leak_nctx);

	/* Dump profile header. */
	if (opt_lg_prof_sample == 0) {
		if (prof_printf(propagate_err,
		    "heap profile: %"PRId64": %"PRId64
		    " [%"PRIu64": %"PRIu64"] @ heapprofile\n",
		    cnt_all.curobjs, cnt_all.curbytes,
		    cnt_all.accumobjs, cnt_all.accumbytes))
			goto label_error;
	} else {
		if (prof_printf(propagate_err,
		    "heap profile: %"PRId64": %"PRId64
		    " [%"PRIu64": %"PRIu64"] @ heap_v2/%"PRIu64"\n",
		    cnt_all.curobjs, cnt_all.curbytes,
		    cnt_all.accumobjs, cnt_all.accumbytes,
		    ((uint64_t)1U << opt_lg_prof_sample)))
			goto label_error;
	}

	/* Dump  per ctx profile stats. */
	for (tabind = 0; ckh_iter(&bt2ctx, &tabind, &bt.v, &ctx.v)
	    == false;) {
		if (prof_dump_ctx(propagate_err, ctx.p, bt.p))
			goto label_error;
	}

	/* Dump /proc/<pid>/maps if possible. */
	if (prof_dump_maps(propagate_err))
		goto label_error;

	if (prof_flush(propagate_err))
		goto label_error;
	close(prof_dump_fd);
	prof_leave(prof_tdata);

	if (leakcheck && cnt_all.curbytes != 0) {
		malloc_printf("<jemalloc>: Leak summary: %"PRId64" byte%s, %"
		    PRId64" object%s, %zu context%s\n",
		    cnt_all.curbytes, (cnt_all.curbytes != 1) ? "s" : "",
		    cnt_all.curobjs, (cnt_all.curobjs != 1) ? "s" : "",
		    leak_nctx, (leak_nctx != 1) ? "s" : "");
		malloc_printf(
		    "<jemalloc>: Run pprof on \"%s\" for leak detail\n",
		    filename);
	}

	return (false);
label_error:
	prof_leave(prof_tdata);
	return (true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movb %dl, %al
movb %dil, %cl
andb $0x1, %cl
movb %cl, -0x2(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
jmp 0xceb9e
jmp 0xceba0
jmp 0xceba2
callq 0xce560
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x2, %rax
ja 0xcebbe
movb $0x1, -0x1(%rbp)
jmp 0xcee31
movq -0x20(%rbp), %rdi
callq 0xce5a0
movq -0x10(%rbp), %rdi
movl $0x1a4, %esi            # imm = 0x1A4
callq 0x1f460
movl %eax, 0x5b8dd(%rip)     # 0x12a4b8
cmpl $-0x1, 0x5b8d6(%rip)    # 0x12a4b8
jne 0xcec1b
movb -0x2(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xcec16
movq -0x10(%rbp), %rsi
leaq 0x1ef01(%rip), %rdi     # 0xedafd
movb $0x0, %al
callq 0xda3b0
leaq 0x598a0(%rip), %rax     # 0x1284aa
testb $0x1, (%rax)
je 0xcec14
callq 0x1f1b0
jmp 0xcec16
jmp 0xcee24
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x1f110
movq $0x0, -0x60(%rbp)
movq $0x0, -0x48(%rbp)
leaq 0x5a7a6(%rip), %rdi     # 0x1293e8
leaq -0x48(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
leaq -0x58(%rbp), %rcx
callq 0xdb4f0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xcec70
movq -0x58(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0xd0570
jmp 0xcec3b
cmpq $0x0, 0x44c50(%rip)     # 0x1138c8
jne 0xcecad
movb -0x2(%rbp), %al
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x28(%rbp), %r9
leaq 0x1ee90(%rip), %rsi     # 0xedb24
andb $0x1, %al
movzbl %al, %edi
movb $0x0, %al
callq 0xd0730
testb $0x1, %al
jne 0xceca6
jmp 0xcecab
jmp 0xcee24
jmp 0xcecff
movb -0x2(%rbp), %dil
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %r8
movq -0x28(%rbp), %r9
movq 0x44bfc(%rip), %rcx     # 0x1138c8
movl $0x1, %eax
shlq %cl, %rax
movq -0x68(%rbp), %rcx
leaq 0x1ee76(%rip), %rsi     # 0xedb55
andb $0x1, %dil
movzbl %dil, %edi
movq %rax, (%rsp)
movb $0x0, %al
callq 0xd0730
testb $0x1, %al
jne 0xcecf8
jmp 0xcecfd
jmp 0xcee24
jmp 0xcecff
movq $0x0, -0x48(%rbp)
leaq 0x5a6da(%rip), %rdi     # 0x1293e8
leaq -0x48(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x58(%rbp), %rcx
callq 0xdb4f0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xced4b
movb -0x2(%rbp), %al
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
andb $0x1, %al
movzbl %al, %edi
callq 0xd0810
testb $0x1, %al
jne 0xced44
jmp 0xced49
jmp 0xcee24
jmp 0xced07
movb -0x2(%rbp), %al
andb $0x1, %al
movzbl %al, %edi
callq 0xd0940
testb $0x1, %al
jne 0xced5e
jmp 0xced63
jmp 0xcee24
movb -0x2(%rbp), %al
andb $0x1, %al
movzbl %al, %edi
callq 0xd0a80
testb $0x1, %al
jne 0xced76
jmp 0xced7b
jmp 0xcee24
movl 0x5b737(%rip), %edi     # 0x12a4b8
callq 0x1f170
movq -0x20(%rbp), %rdi
callq 0xce600
testb $0x1, -0x11(%rbp)
je 0xcee1e
cmpq $0x0, -0x38(%rbp)
je 0xcee1e
movq -0x38(%rbp), %rsi
movq -0x38(%rbp), %rcx
leaq 0x1264a(%rip), %rdx     # 0xe13f9
leaq 0x1a691(%rip), %rax     # 0xe9447
cmpq $0x1, %rcx
cmovneq %rax, %rdx
movq -0x40(%rbp), %rcx
movq -0x40(%rbp), %rdi
leaq 0x1262c(%rip), %r8      # 0xe13f9
leaq 0x1a673(%rip), %rax     # 0xe9447
cmpq $0x1, %rdi
cmovneq %rax, %r8
movq -0x60(%rbp), %r9
movq -0x60(%rbp), %r10
leaq 0x1260e(%rip), %rax     # 0xe13f9
leaq 0x1a655(%rip), %rdi     # 0xe9447
cmpq $0x1, %r10
cmovneq %rdi, %rax
leaq 0x1ed85(%rip), %rdi     # 0xedb86
movq %rax, (%rsp)
movb $0x0, %al
callq 0xda3b0
movq -0x10(%rbp), %rsi
leaq 0x1edb2(%rip), %rdi     # 0xedbc9
movb $0x0, %al
callq 0xda3b0
movb $0x0, -0x1(%rbp)
jmp 0xcee31
movq -0x20(%rbp), %rdi
callq 0xce600
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)