LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/chunk.c
// Function: chunk_dealloc
void
chunk_dealloc(void *chunk, size_t size, bool unmap)
{

	assert(chunk != NULL);
	assert(CHUNK_ADDR2BASE(chunk) == chunk);
	assert(size != 0);
	assert((size & chunksize_mask) == 0);

	if (config_ivsalloc)
		rtree_set(chunks_rtree, (uintptr_t)chunk, NULL);
	if (config_stats || config_prof) {
		malloc_mutex_lock(&chunks_mtx);
		assert(stats_chunks.curchunks >= (size / chunksize));
		stats_chunks.curchunks -= (size / chunksize);
		malloc_mutex_unlock(&chunks_mtx);
	}

	if (unmap)
		chunk_unmap(chunk, size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x5fa95(%rip), %r15     # 0xdc838
movq %r15, %rdi
callq 0x1faa0
movq %rbx, %rax
xorl %edx, %edx
divq 0x5faa9(%rip)           # 0xdc860
subq %rax, 0x5faba(%rip)     # 0xdc878
movq %r15, %rdi
callq 0x1fbb0
testl %ebp, %ebp
je 0x7cddf
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7cc04
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/chunk.c
// Function: chunk_boot
bool
chunk_boot(void)
{

	/* Set variables according to the value of opt_lg_chunk. */
	chunksize = (ZU(1) << opt_lg_chunk);
	assert(chunksize >= PAGE);
	chunksize_mask = chunksize - 1;
	chunk_npages = (chunksize >> LG_PAGE);

	if (config_stats || config_prof) {
		if (malloc_mutex_init(&chunks_mtx))
			return (true);
		memset(&stats_chunks, 0, sizeof(chunk_stats_t));
	}
	if (config_dss && chunk_dss_boot())
		return (true);
	extent_tree_szad_new(&chunks_szad_mmap);
	extent_tree_ad_new(&chunks_ad_mmap);
	extent_tree_szad_new(&chunks_szad_dss);
	extent_tree_ad_new(&chunks_ad_dss);
	if (config_ivsalloc) {
		chunks_rtree = rtree_new((ZU(1) << (LG_SIZEOF_PTR+3)) -
		    opt_lg_chunk);
		if (chunks_rtree == NULL)
			return (true);
	}

	return (false);
}

// Assembly:
pushq %rbx
movb 0x4a157(%rip), %cl      # 0xc6f48
pushq $0x1
popq %rax
shlq %cl, %rax
movq %rax, 0x5fa62(%rip)     # 0xdc860
leaq -0x1(%rax), %rcx
movq %rcx, 0x5fa77(%rip)     # 0xdc880
shrq $0xc, %rax
movq %rax, 0x5fa74(%rip)     # 0xdc888
leaq 0x5fa1d(%rip), %rdi     # 0xdc838
callq 0x82b74
movl %eax, %ebx
testb %al, %al
jne 0x7ce68
xorps %xmm0, %xmm0
movups %xmm0, 0x5fa38(%rip)    # 0xdc868
andq $0x0, 0x5fa40(%rip)     # 0xdc878
leaq 0x5f969(%rip), %rdi     # 0xdc7a8
callq 0x810e4
leaq 0x5f9a5(%rip), %rdi     # 0xdc7f0
callq 0x81b4a
leaq 0x5fa39(%rip), %rdi     # 0xdc890
callq 0x810e4
leaq 0x5fa75(%rip), %rdi     # 0xdc8d8
callq 0x81b4a
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/chunk_dss.c
// Function: chunk_in_dss
bool
chunk_in_dss(void *chunk)
{
	bool ret;

	cassert(config_dss);

	malloc_mutex_lock(&dss_mtx);
	if ((uintptr_t)chunk >= (uintptr_t)dss_base
	    && (uintptr_t)chunk < (uintptr_t)dss_max)
		ret = true;
	else
		ret = false;
	malloc_mutex_unlock(&dss_mtx);

	return (ret);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5f91d(%rip), %r14     # 0xdc938
movq %r14, %rdi
callq 0x1faa0
cmpq %rbx, 0x5f946(%rip)     # 0xdc970
setbe %al
cmpq %rbx, 0x5f934(%rip)     # 0xdc968
seta %bl
andb %al, %bl
movq %r14, %rdi
callq 0x1fbb0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/chunk_dss.c
// Function: chunk_dss_boot
bool
chunk_dss_boot(void)
{

	cassert(config_dss);

	if (malloc_mutex_init(&dss_mtx))
		return (true);
	dss_base = sbrk(0);
	dss_prev = dss_base;
	dss_max = dss_base;

	return (false);
}

// Assembly:
pushq %rbx
leaq 0x5f8e5(%rip), %rdi     # 0xdc938
callq 0x82b74
movl %eax, %ebx
testb %al, %al
jne 0x7d07a
xorl %edi, %edi
callq 0x1f3e0
movq %rax, 0x5f904(%rip)     # 0xdc970
movq %rax, 0x5f8ed(%rip)     # 0xdc960
movq %rax, 0x5f8ee(%rip)     # 0xdc968
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/chunk_mmap.c
// Function: chunk_alloc_mmap
void *
chunk_alloc_mmap(size_t size, size_t alignment, bool *zero)
{
	void *ret;
	size_t offset;

	/*
	 * Ideally, there would be a way to specify alignment to mmap() (like
	 * NetBSD has), but in the absence of such a feature, we have to work
	 * hard to efficiently create aligned mappings.  The reliable, but
	 * slow method is to create a mapping that is over-sized, then trim the
	 * excess.  However, that always results in one or two calls to
	 * pages_unmap().
	 *
	 * Optimistically try mapping precisely the right amount before falling
	 * back to the slow method, with the expectation that the optimistic
	 * approach works most of the time.
	 */

	assert(alignment != 0);
	assert((alignment & chunksize_mask) == 0);

	ret = pages_map(NULL, size);
	if (ret == NULL)
		return (NULL);
	offset = ALIGNMENT_ADDR2OFFSET(ret, alignment);
	if (offset != 0) {
		pages_unmap(ret, size);
		return (chunk_alloc_mmap_slow(size, alignment, zero));
	}

	assert(ret != NULL);
	*zero = true;
	return (ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
callq 0x7d141
testq %rax, %rax
je 0x7d0d6
leaq -0x1(%r15), %rbp
testq %rax, %rbp
je 0x7d12f
movq %rax, %rdi
movq %r12, %rsi
callq 0x7d165
leaq (%r12,%r15), %r13
addq $-0x1000, %r13          # imm = 0xF000
cmpq %r12, %r13
jae 0x7d0da
xorl %eax, %eax
jmp 0x7d132
movq %rbx, (%rsp)
negq %r15
movq %r13, %rdi
callq 0x7d141
testq %rax, %rax
je 0x7d0d6
leaq (%rax,%rbp), %r14
andq %r15, %r14
movq %r14, %rbx
subq %rax, %rbx
movq %r14, %rsi
subq %rax, %rsi
je 0x7d10b
movq %rax, %rdi
callq 0x7d165
leaq (%rbx,%r12), %rax
cmpq %rax, %r13
je 0x7d123
movq %r13, %rsi
subq %rax, %rsi
leaq (%r14,%r12), %rdi
callq 0x7d165
testq %r14, %r14
je 0x7d0e1
movq %r14, %rax
movq (%rsp), %rbx
movb $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/ctl.c
// Function: ctl_byname
int
ctl_byname(const char *name, void *oldp, size_t *oldlenp, void *newp,
    size_t newlen)
{
	int ret;
	size_t depth;
	ctl_node_t const *nodes[CTL_MAX_DEPTH];
	size_t mib[CTL_MAX_DEPTH];
	const ctl_named_node_t *node;

	if (ctl_initialized == false && ctl_init()) {
		ret = EAGAIN;
		goto label_return;
	}

	depth = CTL_MAX_DEPTH;
	ret = ctl_lookup(name, nodes, mib, &depth);
	if (ret != 0)
		goto label_return;

	node = ctl_named_node(nodes[depth-1]);
	if (node != NULL && node->ctl)
		ret = node->ctl(mib, depth, oldp, oldlenp, newp, newlen);
	else {
		/* The name refers to a partial path through the ctl tree. */
		ret = ENOENT;
	}

label_return:
	return(ret);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
cmpb $0x0, 0x5f7a5(%rip)     # 0xdc978
jne 0x7d1e3
callq 0x7d242
testb %al, %al
je 0x7d1e3
pushq $0xb
popq %rax
jmp 0x7d234
leaq 0x8(%rsp), %rcx
movq $0x6, (%rcx)
leaq 0x40(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r13, %rdi
callq 0x7d304
testl %eax, %eax
jne 0x7d234
movq 0x8(%rsp), %rsi
movq 0x38(%rsp,%rsi,8), %rcx
pushq $0x2
popq %rax
cmpb $0x1, (%rcx)
jne 0x7d234
movq 0x20(%rcx), %r10
testq %r10, %r10
je 0x7d234
leaq 0x10(%rsp), %rdi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
callq *%r10
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/ctl.c
// Function: ctl_init
static bool
ctl_init(void)
{
	bool ret;

	malloc_mutex_lock(&ctl_mtx);
	if (ctl_initialized == false) {
		/*
		 * Allocate space for one extra arena stats element, which
		 * contains summed stats across all arenas.
		 */
		assert(narenas_auto == narenas_total_get());
		ctl_stats.narenas = narenas_auto;
		ctl_stats.arenas = (ctl_arena_stats_t *)base_alloc(
		    (ctl_stats.narenas + 1) * sizeof(ctl_arena_stats_t));
		if (ctl_stats.arenas == NULL) {
			ret = true;
			goto label_return;
		}
		memset(ctl_stats.arenas, 0, (ctl_stats.narenas + 1) *
		    sizeof(ctl_arena_stats_t));

		/*
		 * Initialize all stats structures, regardless of whether they
		 * ever get used.  Lazy initialization would allow errors to
		 * cause inconsistent state to be viewable by the application.
		 */
		if (config_stats) {
			unsigned i;
			for (i = 0; i <= ctl_stats.narenas; i++) {
				if (ctl_arena_init(&ctl_stats.arenas[i])) {
					ret = true;
					goto label_return;
				}
			}
		}
		ctl_stats.arenas[ctl_stats.narenas].initialized = true;

		ctl_epoch = 0;
		ctl_refresh();
		ctl_initialized = true;
	}

	ret = false;
label_return:
	malloc_mutex_unlock(&ctl_mtx);
	return (ret);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
leaq 0x5f734(%rip), %rdi     # 0xdc980
callq 0x1faa0
cmpb $0x0, 0x5f720(%rip)     # 0xdc978
jne 0x7d2ed
leaq 0x5e91b(%rip), %rax     # 0xdbb80
movl (%rax), %eax
movl %eax, 0x5f783(%rip)     # 0xdc9f0
incl %eax
imulq $0x870, %rax, %rdi      # imm = 0x870
callq 0x7c708
movq %rax, 0x5f776(%rip)     # 0xdc9f8
movb $0x1, %bl
testq %rax, %rax
je 0x7d2ef
movl 0x5f761(%rip), %ecx     # 0xdc9f0
incl %ecx
imulq $0x870, %rcx, %rdx      # imm = 0x870
xorl %ebp, %ebp
movq %rax, %rdi
xorl %esi, %esi
callq 0x1f110
movl 0x5f746(%rip), %eax     # 0xdc9f0
movq 0x5f747(%rip), %rdi     # 0xdc9f8
cmpl %eax, %ebp
ja 0x7d2ce
movl %ebp, %eax
imulq $0x870, %rax, %rax      # imm = 0x870
addq %rax, %rdi
callq 0x7d663
incl %ebp
testb %al, %al
je 0x7d2a4
jmp 0x7d2ef
imulq $0x870, %rax, %rax      # imm = 0x870
movb $0x1, %bl
movb %bl, (%rdi,%rax)
andq $0x0, 0x5f71e(%rip)     # 0xdca00
callq 0x7d6a1
movb %bl, 0x5f68b(%rip)      # 0xdc978
xorl %ebx, %ebx
leaq 0x5f68a(%rip), %rdi     # 0xdc980
callq 0x1fbb0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/ctl.c
// Function: thread_arena_ctl
static int
thread_arena_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp,
    void *newp, size_t newlen)
{
	int ret;
	unsigned newind, oldind;

	malloc_mutex_lock(&ctl_mtx);
	newind = oldind = choose_arena(NULL)->ind;
	WRITE(newind, unsigned);
	READ(oldind, unsigned);
	if (newind != oldind) {
		arena_t *arena;

		if (newind >= ctl_stats.narenas) {
			/* New arena index is out of range. */
			ret = EFAULT;
			goto label_return;
		}

		/* Initialize arena if necessary. */
		malloc_mutex_lock(&arenas_lock);
		if ((arena = arenas[newind]) == NULL && (arena =
		    arenas_extend(newind)) == NULL) {
			malloc_mutex_unlock(&arenas_lock);
			ret = EAGAIN;
			goto label_return;
		}
		assert(arena == arenas[newind]);
		arenas[oldind]->nthreads--;
		arenas[newind]->nthreads++;
		malloc_mutex_unlock(&arenas_lock);

		/* Set new arena association. */
		if (config_tcache) {
			tcache_t *tcache;
			if ((uintptr_t)(tcache = *tcache_tsd_get()) >
			    (uintptr_t)TCACHE_STATE_MAX) {
				tcache_arena_dissociate(tcache);
				tcache_arena_associate(tcache, arena);
			}
		}
		arenas_tsd_set(&arena);
	}

	ret = 0;
label_return:
	malloc_mutex_unlock(&ctl_mtx);
	return (ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r13
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r14
leaq 0x5ed70(%rip), %rdi     # 0xdc980
callq 0x1faa0
callq 0x7deeb
movl (%rax), %ebx
movl %ebx, 0x4(%rsp)
movl %ebx, %ebp
testq %r12, %r12
je 0x7dc35
cmpq $0x4, %r13
jne 0x7dd3f
movl (%r12), %ebp
testq %r14, %r14
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x7dc55
movq (%r15), %rax
cmpq $0x4, %rax
jne 0x7dd2b
movl %ebx, (%r14)
xorl %r13d, %r13d
cmpl %ebx, %ebp
je 0x7dd47
cmpl 0x5ed8a(%rip), %ebp     # 0xdc9f0
jae 0x7dd43
leaq 0x5df15(%rip), %rdi     # 0xdbb88
callq 0x1faa0
leaq 0x5def9(%rip), %r15     # 0xdbb78
movq (%r15), %rax
movl %ebp, %r12d
movq (%rax,%r12,8), %rcx
movq %rcx, %r14
testq %rcx, %rcx
jne 0x7dcab
movl %ebp, %edi
callq 0x7520c
testq %rax, %rax
je 0x7dd65
movq %rax, %r14
movq (%r15), %rax
movq (%rax,%r12,8), %rcx
movq (%rax,%rbx,8), %rax
decl 0x4(%rax)
incl 0x4(%rcx)
leaq 0x5decc(%rip), %rdi     # 0xdbb88
callq 0x1fbb0
movq 0x45290(%rip), %rax     # 0xc2f58
movq %fs:(%rax), %r15
cmpq $0x4, %r15
jb 0x7dce5
movq %r15, %rdi
callq 0x874ae
movq %r15, %rdi
movq %r14, %rsi
callq 0x87459
movq 0x4524c(%rip), %rax     # 0xc2f38
movq %fs:0x0, %rsi
addq %rax, %rsi
movq %r14, %fs:(%rax)
leaq 0x5deb1(%rip), %rax     # 0xdbbb4
movl (%rax), %edi
callq 0x1f1c0
testl %eax, %eax
je 0x7dd47
leaq 0x1b24d(%rip), %rdi     # 0x98f62
callq 0x879d0
leaq 0x5de39(%rip), %rax     # 0xdbb5a
cmpb $0x1, (%rax)
jne 0x7dd47
callq 0x1f1b0
pushq $0x4
popq %rdx
cmovbq %rax, %rdx
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x1fbd0
pushq $0x16
jmp 0x7dd45
pushq $0xe
popq %r13
leaq 0x5ec32(%rip), %rdi     # 0xdc980
callq 0x1fbb0
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5de1c(%rip), %rdi     # 0xdbb88
callq 0x1fbb0
pushq $0xb
jmp 0x7dd45
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/ctl.c
// Function: thread_tcache_flush_ctl
static int
thread_tcache_flush_ctl(const size_t *mib, size_t miblen, void *oldp,
    size_t *oldlenp, void *newp, size_t newlen)
{
	int ret;

	if (config_tcache == false)
		return (ENOENT);

	READONLY();
	WRITEONLY();

	tcache_flush();

	ret = 0;
label_return:
	return (ret);
}

// Assembly:
pushq $0x1
popq %rax
orq %r9, %r8
jne 0x7dfc7
orq %rcx, %rdx
jne 0x7dfc7
movq 0x44fb3(%rip), %rax     # 0xc2f58
movq %fs:(%rax), %rdi
cmpq $0x4, %rdi
jb 0x7dfc5
pushq %rax
callq 0x876ee
movq %rsp, %rdi
andq $0x0, (%rdi)
callq 0x7e010
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/ctl.c
// Function: arena_i_dss_ctl
static int
arena_i_dss_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp,
    void *newp, size_t newlen)
{
	int ret, i;
	bool match, err;
	const char *dss;
	unsigned arena_ind = mib[1];
	dss_prec_t dss_prec_old = dss_prec_limit;
	dss_prec_t dss_prec = dss_prec_limit;

	malloc_mutex_lock(&ctl_mtx);
	WRITE(dss, const char *);
	match = false;
	for (i = 0; i < dss_prec_limit; i++) {
		if (strcmp(dss_prec_names[i], dss) == 0) {
			dss_prec = i;
			match = true;
			break;
		}
	}
	if (match == false) {
		ret = EINVAL;
		goto label_return;
	}

	if (arena_ind < ctl_stats.narenas) {
		arena_t *arena = arenas[arena_ind];
		if (arena != NULL) {
			dss_prec_old = arena_dss_prec_get(arena);
			arena_dss_prec_set(arena, dss_prec);
			err = false;
		} else
			err = true;
	} else {
		dss_prec_old = chunk_dss_prec_get();
		err = chunk_dss_prec_set(dss_prec);
	}
	dss = dss_prec_names[dss_prec_old];
	READ(dss, const char *);
	if (err) {
		ret = EFAULT;
		goto label_return;
	}

	ret = 0;
label_return:
	malloc_mutex_unlock(&ctl_mtx);
	return (ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r13
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r14
movq 0x8(%rdi), %rbp
leaq 0x5de9d(%rip), %rdi     # 0xdc980
callq 0x1faa0
pushq $0x16
popq %rbx
testq %r12, %r12
je 0x7eb09
cmpq $0x8, %r13
jne 0x7ebda
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq (%r12), %r13
jmp 0x7eb12
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movl %ebp, %r15d
xorl %r12d, %r12d
leaq 0x48431(%rip), %r14     # 0xc6f50
cmpq $0x3, %r12
je 0x7ebda
movq (%r14,%r12,8), %rdi
movq %r13, %rsi
callq 0x1f880
testl %eax, %eax
je 0x7eb3e
incq %r12
jmp 0x7eb1f
cmpl %ebp, 0x5deac(%rip)     # 0xdc9f0
jbe 0x7eb72
leaq 0x5d02b(%rip), %rax     # 0xdbb78
movq (%rax), %rax
movq (%rax,%r15,8), %r13
testq %r13, %r13
je 0x7eb8d
movq %r13, %rdi
callq 0x79e75
movl %eax, %ebp
movq %r13, %rdi
movl %r12d, %esi
callq 0x79ea0
xorl %eax, %eax
jmp 0x7eb93
callq 0x7cea8
movl %eax, %ebp
movl %r12d, %edi
callq 0x7ceab
xorl %ecx, %ecx
testb %al, %al
pushq $0xe
popq %rax
cmovel %ecx, %eax
jmp 0x7eb93
pushq $0x3
popq %rbp
pushq $0xe
popq %rax
movq (%rsp), %r8
movl %ebp, %ecx
movq (%r14,%rcx,8), %rcx
movq %rcx, 0x10(%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
sete %dl
testq %r8, %r8
sete %sil
orb %dl, %sil
jne 0x7ebc5
movq (%r8), %rsi
cmpq $0x8, %rsi
jne 0x7ebc9
movq %rcx, (%rdi)
movl %eax, %ebx
jmp 0x7ebda
pushq $0x8
popq %rdx
cmovbq %rsi, %rdx
leaq 0x10(%rsp), %rsi
callq 0x1fbd0
leaq 0x5dd9f(%rip), %rdi     # 0xdc980
callq 0x1fbb0
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/ctl.c
// Function: arenas_purge_ctl
static int
arenas_purge_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp,
    void *newp, size_t newlen)
{
	int ret;
	unsigned arena_ind;

	malloc_mutex_lock(&ctl_mtx);
	WRITEONLY();
	arena_ind = UINT_MAX;
	WRITE(arena_ind, unsigned);
	if (newp != NULL && arena_ind >= ctl_stats.narenas)
		ret = EFAULT;
	else {
		if (arena_ind == UINT_MAX)
			arena_ind = ctl_stats.narenas;
		arena_purge(arena_ind);
		ret = 0;
	}

label_return:
	malloc_mutex_unlock(&ctl_mtx);
	return (ret);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
leaq 0x5d9cd(%rip), %rdi     # 0xdc980
callq 0x1faa0
orq %r15, %r12
je 0x7efc1
pushq $0x1
jmp 0x7efeb
testq %rbx, %rbx
je 0x7efda
cmpq $0x4, %r14
jne 0x7efe9
movl (%rbx), %edi
cmpl 0x5da1c(%rip), %edi     # 0xdc9f0
jb 0x7efe0
pushq $0xe
jmp 0x7efeb
movl 0x5da10(%rip), %edi     # 0xdc9f0
callq 0x7ebf7
xorl %ebx, %ebx
jmp 0x7efec
pushq $0x16
popq %rbx
leaq 0x5d98d(%rip), %rdi     # 0xdc980
callq 0x1fbb0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/huge.c
// Function: huge_palloc
void *
huge_palloc(size_t size, size_t alignment, bool zero)
{
	void *ret;
	size_t csize;
	extent_node_t *node;
	bool is_zeroed;

	/* Allocate one or more contiguous chunks for this request. */

	csize = CHUNK_CEILING(size);
	if (csize == 0) {
		/* size is large enough to cause size_t wrap-around. */
		return (NULL);
	}

	/* Allocate an extent node with which to track the chunk. */
	node = base_node_alloc();
	if (node == NULL)
		return (NULL);

	/*
	 * Copy zero into is_zeroed and pass the copy to chunk_alloc(), so that
	 * it is possible to make correct junk/zero fill decisions below.
	 */
	is_zeroed = zero;
	ret = chunk_alloc(csize, alignment, false, &is_zeroed,
	    chunk_dss_prec_get());
	if (ret == NULL) {
		base_node_dealloc(node);
		return (NULL);
	}

	/* Insert node into huge. */
	node->addr = ret;
	node->size = csize;

	malloc_mutex_lock(&huge_mtx);
	extent_tree_ad_insert(&huge, node);
	if (config_stats) {
		stats_cactive_add(csize);
		huge_nmalloc++;
		huge_allocated += csize;
	}
	malloc_mutex_unlock(&huge_mtx);

	if (config_fill && zero == false) {
		if (opt_junk)
			memset(ret, 0xa5, csize);
		else if (opt_zero && is_zeroed == false)
			memset(ret, 0, csize);
	}

	return (ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x5a33c(%rip), %rax     # 0xdc880
movq (%rax), %rbx
addq %rbx, %rdi
notq %rbx
andq %rdi, %rbx
je 0x825ff
movl %edx, %ebp
movq %rsi, %r14
callq 0x7c7e6
testq %rax, %rax
je 0x825ff
movq %rax, %r15
leaq 0xf(%rsp), %r12
movb %bpl, (%r12)
callq 0x7cea8
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %r12, %rcx
movl %eax, %r8d
callq 0x7c988
testq %rax, %rax
je 0x825f7
movq %rax, %r14
movq %rax, 0x28(%r15)
movq %rbx, 0x30(%r15)
leaq 0x5a464(%rip), %r12     # 0xdca08
movq %r12, %rdi
callq 0x1faa0
leaq 0x5a47d(%rip), %rdi     # 0xdca30
movq %r15, %rsi
callq 0x81d1f
leaq 0x6b5be(%rip), %rax     # 0xedb80
lock
addq %rbx, (%rax)
incq 0x5a4ab(%rip)           # 0xdca78
addq %rbx, 0x5a4ac(%rip)     # 0xdca80
movq %r12, %rdi
callq 0x1fbb0
testb %bpl, %bpl
jne 0x82602
leaq 0x59573(%rip), %rax     # 0xdbb5b
cmpb $0x1, (%rax)
jne 0x82612
movq %r14, %rdi
movl $0xa5, %esi
jmp 0x8262a
movq %r15, %rdi
callq 0x7c82f
xorl %r14d, %r14d
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x59553(%rip), %rax     # 0xdbb6c
cmpb $0x1, (%rax)
jne 0x82602
cmpb $0x0, 0xf(%rsp)
jne 0x82602
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1f110
jmp 0x82602
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/huge.c
// Function: huge_ralloc_no_move
void *
huge_ralloc_no_move(void *ptr, size_t oldsize, size_t size, size_t extra)
{

	/*
	 * Avoid moving the allocation if the size class can be left the same.
	 */
	if (oldsize > arena_maxclass
	    && CHUNK_CEILING(oldsize) >= CHUNK_CEILING(size)
	    && CHUNK_CEILING(oldsize) <= CHUNK_CEILING(size+extra)) {
		assert(CHUNK_CEILING(oldsize) == oldsize);
		if (config_fill && opt_junk && size < oldsize) {
			memset((void *)((uintptr_t)ptr + size), 0x5a,
			    oldsize - size);
		}
		return (ptr);
	}

	/* Reallocation would require a move. */
	return (NULL);
}

// Assembly:
pushq %rbx
movq %rsi, %rax
leaq 0x5a2f1(%rip), %rsi     # 0xdc930
cmpq %rax, (%rsi)
jae 0x82678
movq %rdi, %rbx
leaq 0x5a232(%rip), %rsi     # 0xdc880
movq (%rsi), %rdi
leaq (%rdi,%rax), %rsi
movq %rdi, %r8
notq %r8
andq %r8, %rsi
leaq (%rdi,%rdx), %r9
andq %r8, %r9
cmpq %r9, %rsi
jb 0x82678
addq %rdx, %rcx
addq %rdi, %rcx
andq %r8, %rcx
cmpq %rcx, %rsi
jbe 0x8267f
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
subq %rdx, %rax
jbe 0x8267a
leaq 0x594d0(%rip), %rcx     # 0xdbb5b
cmpb $0x0, (%rcx)
je 0x8267a
addq %rbx, %rdx
pushq $0x5a
popq %rsi
movq %rdx, %rdi
movq %rax, %rdx
callq 0x1f110
jmp 0x8267a
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/huge.c
// Function: huge_dalloc
void
huge_dalloc(void *ptr, bool unmap)
{
	extent_node_t *node, key;

	malloc_mutex_lock(&huge_mtx);

	/* Extract from tree of huge allocations. */
	key.addr = ptr;
	node = extent_tree_ad_search(&huge, &key);
	assert(node != NULL);
	assert(node->addr == ptr);
	extent_tree_ad_remove(&huge, node);

	if (config_stats) {
		stats_cactive_sub(node->size);
		huge_ndalloc++;
		huge_allocated -= node->size;
	}

	malloc_mutex_unlock(&huge_mtx);

	if (unmap && config_fill && config_dss && opt_junk)
		memset(node->addr, 0x5a, node->size);

	chunk_dealloc(node->addr, node->size, unmap);

	base_node_dealloc(node);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x5a0bb(%rip), %r15     # 0xdca08
movq %r15, %rdi
callq 0x1faa0
leaq 0x8(%rsp), %rsi
movq %r14, 0x28(%rsi)
leaq 0x5a0cb(%rip), %r14     # 0xdca30
movq %r14, %rdi
callq 0x81c5d
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
callq 0x81e79
xorl %eax, %eax
subq 0x30(%r12), %rax
leaq 0x6b1f7(%rip), %rcx     # 0xedb80
lock
addq %rax, (%rcx)
incq 0x5a0f4(%rip)           # 0xdca88
movq 0x30(%r12), %rax
subq %rax, 0x5a0e0(%rip)     # 0xdca80
movq %r15, %rdi
callq 0x1fbb0
movq 0x28(%r12), %rdi
movq 0x30(%r12), %rsi
movl %ebx, %edx
callq 0x7cd8d
movq %r12, %rdi
callq 0x7c82f
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/huge.c
// Function: huge_salloc
size_t
huge_salloc(const void *ptr)
{
	size_t ret;
	extent_node_t *node, key;

	malloc_mutex_lock(&huge_mtx);

	/* Extract from tree of huge allocations. */
	key.addr = __DECONST(void *, ptr);
	node = extent_tree_ad_search(&huge, &key);
	assert(node != NULL);

	ret = node->size;

	malloc_mutex_unlock(&huge_mtx);

	return (ret);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x5a02a(%rip), %r14     # 0xdca08
movq %r14, %rdi
callq 0x1faa0
leaq 0x8(%rsp), %rsi
movq %rbx, 0x28(%rsi)
leaq 0x5a03a(%rip), %rdi     # 0xdca30
callq 0x81c5d
movq 0x30(%rax), %rbx
movq %r14, %rdi
callq 0x1fbb0
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/huge.c
// Function: huge_prof_ctx_get
prof_ctx_t *
huge_prof_ctx_get(const void *ptr)
{
	prof_ctx_t *ret;
	extent_node_t *node, key;

	malloc_mutex_lock(&huge_mtx);

	/* Extract from tree of huge allocations. */
	key.addr = __DECONST(void *, ptr);
	node = extent_tree_ad_search(&huge, &key);
	assert(node != NULL);

	ret = node->prof_ctx;

	malloc_mutex_unlock(&huge_mtx);

	return (ret);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x59fe5(%rip), %r14     # 0xdca08
movq %r14, %rdi
callq 0x1faa0
leaq 0x8(%rsp), %rsi
movq %rbx, 0x28(%rsi)
leaq 0x59ff5(%rip), %rdi     # 0xdca30
callq 0x81c5d
movq 0x20(%rax), %rbx
movq %r14, %rdi
callq 0x1fbb0
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/huge.c
// Function: huge_prof_ctx_set
void
huge_prof_ctx_set(const void *ptr, prof_ctx_t *ctx)
{
	extent_node_t *node, key;

	malloc_mutex_lock(&huge_mtx);

	/* Extract from tree of huge allocations. */
	key.addr = __DECONST(void *, ptr);
	node = extent_tree_ad_search(&huge, &key);
	assert(node != NULL);

	node->prof_ctx = ctx;

	malloc_mutex_unlock(&huge_mtx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x59f9b(%rip), %r15     # 0xdca08
movq %r15, %rdi
callq 0x1faa0
movq %rsp, %rsi
movq %r14, 0x28(%rsi)
leaq 0x59fad(%rip), %rdi     # 0xdca30
callq 0x81c5d
movq %rbx, 0x20(%rax)
movq %r15, %rdi
callq 0x1fbb0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_leave
static inline void
prof_leave(prof_tdata_t *prof_tdata)
{
	bool idump, gdump;

	cassert(config_prof);

	malloc_mutex_unlock(&bt2ctx_mtx);

	assert(prof_tdata->enq);
	prof_tdata->enq = false;
	idump = prof_tdata->enq_idump;
	prof_tdata->enq_idump = false;
	gdump = prof_tdata->enq_gdump;
	prof_tdata->enq_gdump = false;

	if (idump)
		prof_idump();
	if (gdump)
		prof_gdump();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5a9d6(%rip), %rdi     # 0xddb28
callq 0x1fbb0
movb $0x0, 0x58(%rbx)
movb 0x59(%rbx), %al
movb 0x5a(%rbx), %bpl
andw $0x0, 0x59(%rbx)
cmpb $0x1, %al
jne 0x83170
callq 0x834af
addq $0x8, %rsp
testb %bpl, %bpl
je 0x83180
popq %rbx
popq %rbp
jmp 0x839f6
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_ctx_merge
static void
prof_ctx_merge(prof_ctx_t *ctx, prof_thr_cnt_t *cnt)
{
	bool destroy;

	cassert(config_prof);

	/* Merge cnt stats and detach from ctx. */
	malloc_mutex_lock(ctx->lock);
	ctx->cnt_merged.curobjs += cnt->cnts.curobjs;
	ctx->cnt_merged.curbytes += cnt->cnts.curbytes;
	ctx->cnt_merged.accumobjs += cnt->cnts.accumobjs;
	ctx->cnt_merged.accumbytes += cnt->cnts.accumbytes;
	ql_remove(&ctx->cnts_ql, cnt, cnts_link);
	if (opt_prof_accum == false && ql_first(&ctx->cnts_ql) == NULL &&
	    ctx->cnt_merged.curobjs == 0 && ctx->nlimbo == 0) {
		/*
		 * Increment ctx->nlimbo in order to keep another thread from
		 * winning the race to destroy ctx while this one has ctx->lock
		 * dropped.  Without this, it would be possible for another
		 * thread to:
		 *
		 * 1) Sample an allocation associated with ctx.
		 * 2) Deallocate the sampled object.
		 * 3) Successfully prof_ctx_destroy(ctx).
		 *
		 * The result would be that ctx no longer exists by the time
		 * this thread accesses it in prof_ctx_destroy().
		 */
		ctx->nlimbo++;
		destroy = true;
	} else
		destroy = false;
	malloc_mutex_unlock(ctx->lock);
	if (destroy)
		prof_ctx_destroy(ctx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x1faa0
movdqu 0x30(%r14), %xmm1
movdqu 0x38(%rbx), %xmm0
paddq %xmm1, %xmm0
movdqu 0x48(%rbx), %xmm1
movdqu %xmm0, 0x38(%rbx)
movdqu 0x40(%r14), %xmm2
paddq %xmm1, %xmm2
movdqu %xmm2, 0x48(%rbx)
movq 0x58(%rbx), %rax
cmpq %r14, %rax
jne 0x833ab
movq (%rax), %rax
movq %rax, 0x58(%rbx)
cmpq %r14, %rax
je 0x833cd
movq (%r14), %rcx
movq 0x8(%r14), %rdx
movq %rcx, (%rdx)
movq %rdx, 0x8(%rcx)
movq %r14, (%r14)
movq %r14, 0x8(%r14)
testq %rax, %rax
sete %al
jmp 0x833d4
andq $0x0, 0x58(%rbx)
movb $0x1, %al
cmpb $0x0, 0x596b9(%rip)     # 0xdca94
sete %cl
movq %xmm0, %rdx
testq %rdx, %rdx
sete %dl
andb %al, %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x833f8
cmpl $0x0, 0x10(%rbx)
je 0x83408
movq 0x8(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1fbb0
movl $0x1, 0x10(%rbx)
movq 0x8(%rbx), %rdi
callq 0x1fbb0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x83424
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_idump
void
prof_idump(void)
{
	prof_tdata_t *prof_tdata;
	char filename[PATH_MAX + 1];

	cassert(config_prof);

	if (prof_booted == false)
		return;
	/*
	 * Don't call prof_tdata_get() here, because it could cause recursive
	 * allocation.
	 */
	prof_tdata = *prof_tdata_tsd_get();
	if ((uintptr_t)prof_tdata <= (uintptr_t)PROF_TDATA_STATE_MAX)
		return;
	if (prof_tdata->enq) {
		prof_tdata->enq_idump = true;
		return;
	}

	if (opt_prof_prefix[0] != '\0') {
		malloc_mutex_lock(&prof_dump_seq_mtx);
		prof_dump_filename(filename, 'i', prof_dump_iseq);
		prof_dump_iseq++;
		malloc_mutex_unlock(&prof_dump_seq_mtx);
		prof_dump(false, filename, false);
	}
}

// Assembly:
cmpb $0x1, 0x59612(%rip)     # 0xdcac8
jne 0x8352e
movq %fs:-0x18, %rax
cmpq $0x3, %rax
jb 0x8352e
cmpb $0x1, 0x58(%rax)
jne 0x834d2
movb $0x1, 0x59(%rax)
retq
cmpb $0x0, 0x595f7(%rip)     # 0xdcad0
je 0x8352e
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
leaq 0x5a5ec(%rip), %rbx     # 0xddad8
movq %rbx, %rdi
callq 0x1faa0
movq 0x5a605(%rip), %rdx     # 0xddb00
movq %rsp, %r14
pushq $0x69
popq %rsi
movq %r14, %rdi
callq 0x8352f
incq 0x5a5f0(%rip)           # 0xddb00
movq %rbx, %rdi
callq 0x1fbb0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x835a1
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_dump_filename
static void
prof_dump_filename(char *filename, char v, int64_t vseq)
{

	cassert(config_prof);

	if (vseq != UINT64_C(0xffffffffffffffff)) {
	        /* "<prefix>.<pid>.<seq>.v<vseq>.heap" */
		malloc_snprintf(filename, DUMP_FILENAME_BUFSIZE,
		    "%s.%d.%"PRIu64".%c%"PRId64".heap",
		    opt_prof_prefix, (int)getpid(), prof_dump_seq, v, vseq);
	} else {
	        /* "<prefix>.<pid>.<seq>.<v>.heap" */
		malloc_snprintf(filename, DUMP_FILENAME_BUFSIZE,
		    "%s.%d.%"PRIu64".%c.heap",
		    opt_prof_prefix, (int)getpid(), prof_dump_seq, v);
	}
	prof_dump_seq++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
callq 0x1f410
movq 0x5a618(%rip), %r9      # 0xddb60
cmpq $-0x1, %r15
je 0x8356d
leaq 0x16021(%rip), %rdx     # 0x99576
leaq 0x59574(%rip), %rcx     # 0xdcad0
movl $0x1001, %esi           # imm = 0x1001
movq %r14, %rdi
movl %eax, %r8d
xorl %eax, %eax
pushq %r15
jmp 0x8358c
subq $0x8, %rsp
leaq 0x16013(%rip), %rdx     # 0x9958b
leaq 0x59551(%rip), %rcx     # 0xdcad0
movl $0x1001, %esi           # imm = 0x1001
movq %r14, %rdi
movl %eax, %r8d
xorl %eax, %eax
pushq %rbx
callq 0x8872c
popq %rcx
popq %rdx
incq 0x5a5c5(%rip)           # 0xddb60
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_mdump
bool
prof_mdump(const char *filename)
{
	char filename_buf[DUMP_FILENAME_BUFSIZE];

	cassert(config_prof);

	if (opt_prof == false || prof_booted == false)
		return (true);

	if (filename == NULL) {
		/* No filename specified, so automatically generate one. */
		if (opt_prof_prefix[0] == '\0')
			return (true);
		malloc_mutex_lock(&prof_dump_seq_mtx);
		prof_dump_filename(filename_buf, 'm', prof_dump_mseq);
		prof_dump_mseq++;
		malloc_mutex_unlock(&prof_dump_seq_mtx);
		filename = filename_buf;
	}
	return (prof_dump(true, filename, false));
}

// Assembly:
movb $0x1, %al
cmpb $0x0, 0x5910c(%rip)     # 0xdca91
je 0x839f5
cmpb $0x1, 0x5913a(%rip)     # 0xdcac8
jne 0x839f5
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x839de
cmpb $0x0, 0x59127(%rip)     # 0xdcad0
je 0x839eb
leaq 0x5a126(%rip), %r14     # 0xddad8
movq %r14, %rdi
callq 0x1faa0
movq 0x5a147(%rip), %rdx     # 0xddb08
movq %rsp, %rbx
pushq $0x6d
popq %rsi
movq %rbx, %rdi
callq 0x8352f
incq 0x5a132(%rip)           # 0xddb08
movq %r14, %rdi
callq 0x1fbb0
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x835a1
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_gdump
void
prof_gdump(void)
{
	prof_tdata_t *prof_tdata;
	char filename[DUMP_FILENAME_BUFSIZE];

	cassert(config_prof);

	if (prof_booted == false)
		return;
	/*
	 * Don't call prof_tdata_get() here, because it could cause recursive
	 * allocation.
	 */
	prof_tdata = *prof_tdata_tsd_get();
	if ((uintptr_t)prof_tdata <= (uintptr_t)PROF_TDATA_STATE_MAX)
		return;
	if (prof_tdata->enq) {
		prof_tdata->enq_gdump = true;
		return;
	}

	if (opt_prof_prefix[0] != '\0') {
		malloc_mutex_lock(&prof_dump_seq_mtx);
		prof_dump_filename(filename, 'u', prof_dump_useq);
		prof_dump_useq++;
		malloc_mutex_unlock(&prof_dump_seq_mtx);
		prof_dump(false, filename, false);
	}
}

// Assembly:
cmpb $0x1, 0x590cb(%rip)     # 0xdcac8
jne 0x83a75
movq %fs:-0x18, %rax
cmpq $0x3, %rax
jb 0x83a75
cmpb $0x1, 0x58(%rax)
jne 0x83a19
movb $0x1, 0x5a(%rax)
retq
cmpb $0x0, 0x590b0(%rip)     # 0xdcad0
je 0x83a75
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
leaq 0x5a0a5(%rip), %rbx     # 0xddad8
movq %rbx, %rdi
callq 0x1faa0
movq 0x5a0ce(%rip), %rdx     # 0xddb10
movq %rsp, %r14
pushq $0x75
popq %rsi
movq %r14, %rdi
callq 0x8352f
incq 0x5a0b9(%rip)           # 0xddb10
movq %rbx, %rdi
callq 0x1fbb0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x835a1
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_tdata_init
prof_tdata_t *
prof_tdata_init(void)
{
	prof_tdata_t *prof_tdata;

	cassert(config_prof);

	/* Initialize an empty cache for this thread. */
	prof_tdata = (prof_tdata_t *)imalloc(sizeof(prof_tdata_t));
	if (prof_tdata == NULL)
		return (NULL);

	if (ckh_new(&prof_tdata->bt2cnt, PROF_CKH_MINITEMS,
	    prof_bt_hash, prof_bt_keycomp)) {
		idalloc(prof_tdata);
		return (NULL);
	}
	ql_new(&prof_tdata->lru_ql);

	prof_tdata->vec = imalloc(sizeof(void *) * PROF_BT_MAX);
	if (prof_tdata->vec == NULL) {
		ckh_delete(&prof_tdata->bt2cnt);
		idalloc(prof_tdata);
		return (NULL);
	}

	prof_tdata->prng_state = 0;
	prof_tdata->threshold = 0;
	prof_tdata->accum = 0;

	prof_tdata->enq = false;
	prof_tdata->enq_idump = false;
	prof_tdata->enq_gdump = false;

	prof_tdata_tsd_set(&prof_tdata);

	return (prof_tdata);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
pushq $0x60
popq %rdi
callq 0x82f7d
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x83aec
movq %rax, %rbx
leaq 0x60(%rip), %rdx        # 0x83af7
leaq 0xcd(%rip), %rcx        # 0x83b6b
pushq $0x40
popq %rsi
movq %rax, %rdi
callq 0x88bd0
testb %al, %al
jne 0x83ae4
andq $0x0, 0x30(%rbx)
movl $0x400, %edi            # imm = 0x400
callq 0x82f7d
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x83adc
xorps %xmm0, %xmm0
movups %xmm0, 0x4b(%rbx)
movups %xmm0, 0x40(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x83b90
jmp 0x83aee
movq %rbx, %rdi
callq 0x88f48
movq %rbx, %rdi
callq 0x83183
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_bt_hash
static void
prof_bt_hash(const void *key, unsigned minbits, size_t *hash1, size_t *hash2)
{
	size_t ret1, ret2;
	uint64_t h;
	prof_bt_t *bt = (prof_bt_t *)key;

	cassert(config_prof);
	assert(minbits <= 32 || (SIZEOF_PTR == 8 && minbits <= 64));
	assert(hash1 != NULL);
	assert(hash2 != NULL);

	h = hash(bt->vec, bt->len * sizeof(void *),
	    UINT64_C(0x94122f335b332aea));
	if (minbits <= 32) {
		/*
		 * Avoid doing multiple hashes, since a single hash provides
		 * enough bits.
		 */
		ret1 = h & ZU(0xffffffffU);
		ret2 = h >> 32;
	} else {
		ret1 = h;
		ret2 = hash(bt->vec, bt->len * sizeof(void *),
		    UINT64_C(0x8432a476666bbc13));
	}

	*hash1 = ret1;
	*hash2 = ret2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq (%rdi), %r12
movl 0x8(%rdi), %r13d
shlq $0x3, %r13
movabsq $-0x6bedd0cca4ccd516, %rdx # imm = 0x94122F335B332AEA
movq %r12, %rdi
movq %r13, %rsi
callq 0x84209
movq %rax, %r15
cmpl $0x20, %ebp
ja 0x83b41
movl %r15d, %ecx
shrq $0x20, %r15
movq %r15, %rax
movq %rcx, %r15
jmp 0x83b56
movabsq $-0x7bcd5b89999443ed, %rdx # imm = 0x8432A476666BBC13
movq %r12, %rdi
movq %r13, %rsi
callq 0x84209
movq %r15, (%r14)
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_tdata_cleanup
void
prof_tdata_cleanup(void *arg)
{
	prof_thr_cnt_t *cnt;
	prof_tdata_t *prof_tdata = *(prof_tdata_t **)arg;

	cassert(config_prof);

	if (prof_tdata == PROF_TDATA_STATE_REINCARNATED) {
		/*
		 * Another destructor deallocated memory after this destructor
		 * was called.  Reset prof_tdata to PROF_TDATA_STATE_PURGATORY
		 * in order to receive another callback.
		 */
		prof_tdata = PROF_TDATA_STATE_PURGATORY;
		prof_tdata_tsd_set(&prof_tdata);
	} else if (prof_tdata == PROF_TDATA_STATE_PURGATORY) {
		/*
		 * The previous time this destructor was called, we set the key
		 * to PROF_TDATA_STATE_PURGATORY so that other destructors
		 * wouldn't cause re-creation of the prof_tdata.  This time, do
		 * nothing, so that the destructor will not be called again.
		 */
	} else if (prof_tdata != NULL) {
		/*
		 * Delete the hash table.  All of its contents can still be
		 * iterated over via the LRU.
		 */
		ckh_delete(&prof_tdata->bt2cnt);
		/*
		 * Iteratively merge cnt's into the global stats and delete
		 * them.
		 */
		while ((cnt = ql_last(&prof_tdata->lru_ql, lru_link)) != NULL) {
			ql_remove(&prof_tdata->lru_ql, cnt, lru_link);
			prof_ctx_merge(cnt->ctx, cnt);
			idalloc(cnt);
		}
		idalloc(prof_tdata->vec);
		idalloc(prof_tdata);
		prof_tdata = PROF_TDATA_STATE_PURGATORY;
		prof_tdata_tsd_set(&prof_tdata);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rbx
cmpq $0x1, %rbx
je 0x83c67
testq $-0x3, %rbx
je 0x83c76
movq %rbx, %rdi
callq 0x88f48
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x83c56
movq 0x18(%rax), %r14
testq %r14, %r14
je 0x83c56
cmpq %r14, %rax
jne 0x83c1c
movq 0x10(%rax), %rax
movq %rax, 0x30(%rbx)
cmpq %r14, %rax
je 0x83c3b
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
movq %rax, 0x10(%rcx)
movq %rcx, 0x18(%rax)
movq %r14, 0x10(%r14)
movq %r14, 0x18(%r14)
jmp 0x83c40
andq $0x0, 0x30(%rbx)
movq 0x20(%r14), %rdi
movq %r14, %rsi
callq 0x83360
movq %r14, %rdi
callq 0x83183
jmp 0x83bfd
movq 0x38(%rbx), %rdi
callq 0x83183
movq %rbx, %rdi
callq 0x83183
movq %rsp, %rdi
movq $0x2, (%rdi)
callq 0x83b90
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_boot2
bool
prof_boot2(void)
{

	cassert(config_prof);

	if (opt_prof) {
		unsigned i;

		if (ckh_new(&bt2ctx, PROF_CKH_MINITEMS, prof_bt_hash,
		    prof_bt_keycomp))
			return (true);
		if (malloc_mutex_init(&bt2ctx_mtx))
			return (true);
		if (prof_tdata_tsd_boot()) {
			malloc_write(
			    "<jemalloc>: Error in pthread_key_create()\n");
			abort();
		}

		if (malloc_mutex_init(&prof_dump_seq_mtx))
			return (true);

		if (atexit(prof_fdump) != 0) {
			malloc_write("<jemalloc>: Error in atexit()\n");
			if (opt_abort)
				abort();
		}

		ctx_locks = (malloc_mutex_t *)base_alloc(PROF_NCTX_LOCKS *
		    sizeof(malloc_mutex_t));
		if (ctx_locks == NULL)
			return (true);
		for (i = 0; i < PROF_NCTX_LOCKS; i++) {
			if (malloc_mutex_init(&ctx_locks[i]))
				return (true);
		}
	}

#ifdef JEMALLOC_PROF_LIBGCC
	/*
	 * Cause the backtracing machinery to allocate its internal state
	 * before enabling profiling.
	 */
	_Unwind_Backtrace(prof_unwind_init_callback, NULL);
#endif

	prof_booted = true;

	return (false);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x1, 0x58d94(%rip)     # 0xdca91
jne 0x83dd2
leaq 0x58d8e(%rip), %rdi     # 0xdca98
leaq -0x21a(%rip), %rdx      # 0x83af7
leaq -0x1ad(%rip), %rcx      # 0x83b6b
pushq $0x40
popq %rsi
callq 0x88bd0
movb $0x1, %bl
testb %al, %al
jne 0x83ddb
leaq 0x59df7(%rip), %rdi     # 0xddb28
callq 0x82b74
testb %al, %al
jne 0x83ddb
leaq 0x59e13(%rip), %rdi     # 0xddb58
leaq -0x171(%rip), %rsi      # 0x83bdb
callq 0x1f5a0
testl %eax, %eax
jne 0x83de5
movb $0x1, 0x58d30(%rip)     # 0xdca90
leaq 0x59d71(%rip), %rdi     # 0xddad8
callq 0x82b74
testb %al, %al
jne 0x83ddb
leaq 0x7f(%rip), %rdi        # 0x83df6
callq 0x89990
testl %eax, %eax
je 0x83d98
leaq 0x1522c(%rip), %rdi     # 0x98fb3
callq 0x879d0
leaq 0x57dc7(%rip), %rax     # 0xdbb5a
cmpb $0x1, (%rax)
je 0x83df1
movl $0xa000, %edi           # imm = 0xA000
callq 0x7c708
movq %rax, 0x59da7(%rip)     # 0xddb50
testq %rax, %rax
je 0x83ddb
xorl %edi, %edi
leaq 0x28(%rdi), %r14
cmpq $0xa028, %r14           # imm = 0xA028
je 0x83dd2
addq 0x59d8c(%rip), %rdi     # 0xddb50
callq 0x82b74
movq %r14, %rdi
testb %al, %al
je 0x83db0
jmp 0x83ddb
movb $0x1, 0x58cef(%rip)     # 0xdcac8
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1575f(%rip), %rdi     # 0x9954b
callq 0x879d0
callq 0x1f1b0
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_fdump
static void
prof_fdump(void)
{
	char filename[DUMP_FILENAME_BUFSIZE];

	cassert(config_prof);

	if (prof_booted == false)
		return;

	if (opt_prof_final && opt_prof_prefix[0] != '\0') {
		malloc_mutex_lock(&prof_dump_seq_mtx);
		prof_dump_filename(filename, 'f', UINT64_C(0xffffffffffffffff));
		malloc_mutex_unlock(&prof_dump_seq_mtx);
		prof_dump(false, filename, opt_prof_leak);
	}
}

// Assembly:
cmpb $0x1, 0x58ccb(%rip)     # 0xdcac8
jne 0x83e5e
cmpb $0x1, 0x43182(%rip)     # 0xc6f88
jne 0x83e5e
cmpb $0x0, 0x58cc1(%rip)     # 0xdcad0
je 0x83e5e
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
leaq 0x59cb6(%rip), %rbx     # 0xddad8
movq %rbx, %rdi
callq 0x1faa0
movq %rsp, %r14
pushq $0x66
popq %rsi
pushq $-0x1
popq %rdx
movq %r14, %rdi
callq 0x8352f
movq %rbx, %rdi
callq 0x1fbb0
movzbl 0x58c49(%rip), %edx     # 0xdca93
xorl %edi, %edi
movq %r14, %rsi
callq 0x835a1
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_prefork
void
prof_prefork(void)
{

	if (opt_prof) {
		unsigned i;

		malloc_mutex_lock(&bt2ctx_mtx);
		malloc_mutex_lock(&prof_dump_seq_mtx);
		for (i = 0; i < PROF_NCTX_LOCKS; i++)
			malloc_mutex_lock(&ctx_locks[i]);
	}
}

// Assembly:
cmpb $0x1, 0x58c2b(%rip)     # 0xdca91
jne 0x83ea2
pushq %rbx
leaq 0x59cb8(%rip), %rdi     # 0xddb28
callq 0x1faa0
leaq 0x59c5c(%rip), %rdi     # 0xddad8
callq 0x1faa0
xorl %ebx, %ebx
cmpq $0xa000, %rbx           # imm = 0xA000
je 0x83ea1
movq 0x59cbd(%rip), %rdi     # 0xddb50
addq %rbx, %rdi
callq 0x1faa0
addq $0x28, %rbx
jmp 0x83e83
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_postfork_parent
void
prof_postfork_parent(void)
{

	if (opt_prof) {
		unsigned i;

		for (i = 0; i < PROF_NCTX_LOCKS; i++)
			malloc_mutex_postfork_parent(&ctx_locks[i]);
		malloc_mutex_postfork_parent(&prof_dump_seq_mtx);
		malloc_mutex_postfork_parent(&bt2ctx_mtx);
	}
}

// Assembly:
cmpb $0x1, 0x58be7(%rip)     # 0xdca91
jne 0x83ecd
pushq %rbx
xorl %ebx, %ebx
cmpq $0xa000, %rbx           # imm = 0xA000
je 0x83ece
movq 0x59c91(%rip), %rdi     # 0xddb50
addq %rbx, %rdi
callq 0x82bc8
addq $0x28, %rbx
jmp 0x83eaf
retq
leaq 0x59c03(%rip), %rdi     # 0xddad8
callq 0x82bc8
leaq 0x59c47(%rip), %rdi     # 0xddb28
popq %rbx
jmp 0x82bc8
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_postfork_child
void
prof_postfork_child(void)
{

	if (opt_prof) {
		unsigned i;

		for (i = 0; i < PROF_NCTX_LOCKS; i++)
			malloc_mutex_postfork_child(&ctx_locks[i]);
		malloc_mutex_postfork_child(&prof_dump_seq_mtx);
		malloc_mutex_postfork_child(&bt2ctx_mtx);
	}
}

// Assembly:
cmpb $0x1, 0x58ba3(%rip)     # 0xdca91
jne 0x83f11
pushq %rbx
xorl %ebx, %ebx
cmpq $0xa000, %rbx           # imm = 0xA000
je 0x83f12
movq 0x59c4d(%rip), %rdi     # 0xddb50
addq %rbx, %rdi
callq 0x82bcd
addq $0x28, %rbx
jmp 0x83ef3
retq
leaq 0x59bbf(%rip), %rdi     # 0xddad8
callq 0x82bcd
leaq 0x59c03(%rip), %rdi     # 0xddb28
popq %rbx
jmp 0x82bcd
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_flush
static bool
prof_flush(bool propagate_err)
{
	bool ret = false;
	ssize_t err;

	cassert(config_prof);

	err = write(prof_dump_fd, prof_dump_buf, prof_dump_buf_end);
	if (err == -1) {
		if (propagate_err == false) {
			malloc_write("<jemalloc>: write() failed during heap "
			    "profile flush\n");
			if (opt_abort)
				abort();
		}
		ret = true;
	}
	prof_dump_buf_end = 0;

	return (ret);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
movl 0x59a59(%rip), %edi     # 0xddb68
movl 0x59a57(%rip), %edx     # 0xddb6c
leaq 0x59a54(%rip), %rsi     # 0xddb70
callq 0x1fb30
movq %rax, %rbx
cmpq $-0x1, %rax
setne %al
orb %bpl, %al
jne 0x84148
leaq 0x1559f(%rip), %rdi     # 0x996d6
callq 0x879d0
leaq 0x57a17(%rip), %rax     # 0xdbb5a
cmpb $0x1, (%rax)
je 0x8415d
cmpq $-0x1, %rbx
sete %al
andl $0x0, 0x59a16(%rip)     # 0xddb6c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x1f1b0
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/prof.c
// Function: prof_write
static bool
prof_write(bool propagate_err, const char *s)
{
	unsigned i, slen, n;

	cassert(config_prof);

	i = 0;
	slen = strlen(s);
	while (i < slen) {
		/* Flush the buffer if it is full. */
		if (prof_dump_buf_end == PROF_DUMP_BUFSIZE)
			if (prof_flush(propagate_err) && propagate_err)
				return (true);

		if (prof_dump_buf_end + slen <= PROF_DUMP_BUFSIZE) {
			/* Finish writing. */
			n = slen - i;
		} else {
			/* Write as much of s as will fit. */
			n = PROF_DUMP_BUFSIZE - prof_dump_buf_end;
		}
		memcpy(&prof_dump_buf[prof_dump_buf_end], &s[i], n);
		prof_dump_buf_end += n;
		i += n;
	}

	return (false);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebp
movq %rsi, (%rsp)
movq %rsi, %rdi
callq 0x1f4f0
movq %rax, %r14
xorl %r12d, %r12d
movzbl %bpl, %ebp
movl %r14d, %ebx
subl %r12d, %ebx
jbe 0x841f4
movl 0x599d8(%rip), %r13d    # 0xddb6c
cmpl $0x10000, %r13d         # imm = 0x10000
jne 0x841b0
movl %ebp, %edi
callq 0x84104
testb %bpl, %al
jne 0x841f4
movl 0x599bc(%rip), %r13d    # 0xddb6c
leal (%r14,%r13), %eax
movl $0x10000, %r15d         # imm = 0x10000
subl %r13d, %r15d
cmpl $0x10001, %eax          # imm = 0x10001
cmovbl %ebx, %r15d
movl %r13d, %edi
leaq 0x599a0(%rip), %rax     # 0xddb70
addq %rax, %rdi
movl %r12d, %esi
addq (%rsp), %rsi
movq %r15, %rdx
callq 0x1fbd0
addl %r15d, %r13d
movl %r13d, 0x59980(%rip)    # 0xddb6c
addl %r12d, %r15d
movl %r15d, %r12d
jmp 0x84185
cmpl %r12d, %r14d
seta %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq