// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/arena.c
// Function: arena_new
bool
arena_new(arena_t *arena, unsigned ind)
{
	unsigned i;
	arena_bin_t *bin;

	arena->ind = ind;
	arena->nthreads = 0;

	if (malloc_mutex_init(&arena->lock))
		return (true);

	if (config_stats) {
		memset(&arena->stats, 0, sizeof(arena_stats_t));
		arena->stats.lstats =
		    (malloc_large_stats_t *)base_alloc(nlclasses *
		    sizeof(malloc_large_stats_t));
		if (arena->stats.lstats == NULL)
			return (true);
		memset(arena->stats.lstats, 0, nlclasses *
		    sizeof(malloc_large_stats_t));
		if (config_tcache)
			ql_new(&arena->tcache_ql);
	}

	if (config_prof)
		arena->prof_accumbytes = 0;

	arena->dss_prec = chunk_dss_prec_get();

	/* Initialize chunks. */
	arena_chunk_dirty_new(&arena->chunks_dirty);
	arena->spare = NULL;

	arena->nactive = 0;
	arena->ndirty = 0;
	arena->npurgatory = 0;

	arena_avail_tree_new(&arena->runs_avail);

	/* Initialize bins. */
	for (i = 0; i < NBINS; i++) {
		bin = &arena->bins[i];
		if (malloc_mutex_init(&bin->lock))
			return (true);
		bin->runcur = NULL;
		arena_run_tree_new(&bin->runs);
		if (config_stats)
			memset(&bin->stats, 0, sizeof(malloc_bin_stats_t));
	}

	return (false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0xcde60
testb $0x1, %al
jne 0xb8736
jmp 0xb873f
movb $0x1, -0x1(%rbp)
jmp 0xb88a8
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x1f110
leaq 0x70a7e(%rip), %rax     # 0x1291d8
movq (%rax), %rdi
leaq 0x70b14(%rip), %rax     # 0x129278
subq (%rax), %rdi
shlq $0x5, %rdi
callq 0xbfc90
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x70(%rax)
jne 0xb878f
movb $0x1, -0x1(%rbp)
jmp 0xb88a8
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
leaq 0x70a3a(%rip), %rax     # 0x1291d8
movq (%rax), %rdx
leaq 0x70ad0(%rip), %rax     # 0x129278
subq (%rax), %rdx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x1f110
movq -0x10(%rbp), %rax
movq $0x0, 0x78(%rax)
callq 0xc0ae0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x88(%rax)
movq -0x10(%rbp), %rdi
addq $0x90, %rdi
callq 0xb88c0
movq -0x10(%rbp), %rax
movq $0x0, 0xe0(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0xe8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0xf0(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0xf8(%rax)
movq -0x10(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0xb8940
movl $0x0, -0x18(%rbp)
cmpl $0x1c, -0x18(%rbp)
jae 0xb88a4
movq -0x10(%rbp), %rax
addq $0x120, %rax            # imm = 0x120
movl -0x18(%rbp), %ecx
imulq $0x98, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xcde60
testb $0x1, %al
jne 0xb8866
jmp 0xb886c
movb $0x1, -0x1(%rbp)
jmp 0xb88a8
movq -0x20(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x20(%rbp), %rdi
addq $0x30, %rdi
callq 0xb89c0
movq -0x20(%rbp), %rdi
addq $0x50, %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x1f110
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xb8836
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)