// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/jemalloc.c
// Function: malloc_init_hard
static bool
malloc_init_hard(void)
{
	arena_t *init_arenas[1];

	malloc_mutex_lock(&init_lock);
	if (malloc_initialized || IS_INITIALIZER) {
		/*
		 * Another thread initialized the allocator before this one
		 * acquired init_lock, or this thread is the initializing
		 * thread, and it is recursively allocating.
		 */
		malloc_mutex_unlock(&init_lock);
		return (false);
	}
#ifdef JEMALLOC_THREADED_INIT
	if (malloc_initializer != NO_INITIALIZER && IS_INITIALIZER == false) {
		/* Busy-wait until the initializing thread completes. */
		do {
			malloc_mutex_unlock(&init_lock);
			CPU_SPINWAIT;
			malloc_mutex_lock(&init_lock);
		} while (malloc_initialized == false);
		malloc_mutex_unlock(&init_lock);
		return (false);
	}
#endif
	malloc_initializer = INITIALIZER;

	malloc_tsd_boot();
	if (config_prof)
		prof_boot0();

	malloc_conf_init();

#if (!defined(JEMALLOC_MUTEX_INIT_CB) && !defined(JEMALLOC_ZONE) \
    && !defined(_WIN32))
	/* Register fork handlers. */
	if (pthread_atfork(jemalloc_prefork, jemalloc_postfork_parent,
	    jemalloc_postfork_child) != 0) {
		malloc_write("<jemalloc>: Error in pthread_atfork()\n");
		if (opt_abort)
			abort();
	}
#endif

	if (opt_stats_print) {
		/* Print statistics at exit. */
		if (atexit(stats_print_atexit) != 0) {
			malloc_write("<jemalloc>: Error in atexit()\n");
			if (opt_abort)
				abort();
		}
	}

	if (base_boot()) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

	if (chunk_boot()) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

	if (ctl_boot()) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

	if (config_prof)
		prof_boot1();

	arena_boot();

	if (config_tcache && tcache_boot0()) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

	if (huge_boot()) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

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

	/*
	 * Create enough scaffolding to allow recursive allocation in
	 * malloc_ncpus().
	 */
	narenas_total = narenas_auto = 1;
	arenas = init_arenas;
	memset(arenas, 0, sizeof(arena_t *) * narenas_auto);

	/*
	 * Initialize one arena here.  The rest are lazily created in
	 * choose_arena_hard().
	 */
	arenas_extend(0);
	if (arenas[0] == NULL) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

	/* Initialize allocation counters before any allocations can occur. */
	if (config_stats && thread_allocated_tsd_boot()) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

	if (arenas_tsd_boot()) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

	if (config_tcache && tcache_boot1()) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

	if (config_fill && quarantine_boot()) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

	if (config_prof && prof_boot2()) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

	/* Get number of CPUs. */
	malloc_mutex_unlock(&init_lock);
	ncpus = malloc_ncpus();
	malloc_mutex_lock(&init_lock);

	if (mutex_boot()) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}

	if (opt_narenas == 0) {
		/*
		 * For SMP systems, create more than one arena per CPU by
		 * default.
		 */
		if (ncpus > 1)
			opt_narenas = ncpus << 2;
		else
			opt_narenas = 1;
	}
	narenas_auto = opt_narenas;
	/*
	 * Make sure that the arenas array can be allocated.  In practice, this
	 * limit is enough to allow the allocator to function, but the ctl
	 * machinery will fail to allocate memory at far lower limits.
	 */
	if (narenas_auto > chunksize / sizeof(arena_t *)) {
		narenas_auto = chunksize / sizeof(arena_t *);
		malloc_printf("<jemalloc>: Reducing narenas to limit (%d)\n",
		    narenas_auto);
	}
	narenas_total = narenas_auto;

	/* Allocate and initialize arenas. */
	arenas = (arena_t **)base_alloc(sizeof(arena_t *) * narenas_total);
	if (arenas == NULL) {
		malloc_mutex_unlock(&init_lock);
		return (true);
	}
	/*
	 * Zero the array.  In practice, this should always be pre-zeroed,
	 * since it was just mmap()ed, but let's be sure.
	 */
	memset(arenas, 0, sizeof(arena_t *) * narenas_total);
	/* Copy the pointer to the one arena that was already initialized. */
	arenas[0] = init_arenas[0];

	malloc_initialized = true;
	malloc_mutex_unlock(&init_lock);
	return (false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x74d61(%rip), %rdi     # 0x128520
callq 0xb1380
testb $0x1, 0x74d51(%rip)     # 0x12851c
jne 0xb37e9
movq 0x74d74(%rip), %rax     # 0x128548
movq %rax, -0x18(%rbp)
callq 0x1f5f0
movq %rax, %rcx
movq -0x18(%rbp), %rax
cmpq %rcx, %rax
jne 0xb37fe
leaq 0x74d30(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x0, -0x1(%rbp)
jmp 0xb3be2
cmpq $0x0, 0x74d42(%rip)     # 0x128548
je 0xb3870
movq 0x74d39(%rip), %rax     # 0x128548
movq %rax, -0x20(%rbp)
callq 0x1f5f0
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xb3870
jmp 0xb3831
leaq 0x74ce8(%rip), %rdi     # 0x128520
callq 0xb13a0
pause
leaq 0x74cda(%rip), %rdi     # 0x128520
callq 0xb1380
movb 0x74ccb(%rip), %al      # 0x12851c
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xb3831
leaq 0x74cbe(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x0, -0x1(%rbp)
jmp 0xb3be2
callq 0x1f5f0
movq %rax, 0x74ccc(%rip)     # 0x128548
callq 0xda610
callq 0xb3bf0
leaq -0x4cd(%rip), %rdi      # 0xb33c0
leaq -0x454(%rip), %rsi      # 0xb3440
leaq -0x3db(%rip), %rdx      # 0xb34c0
callq 0xdd110
cmpl $0x0, %eax
je 0xb38c1
leaq 0x39c30(%rip), %rdi     # 0xed4dc
callq 0xd7210
testb $0x1, 0x74bf2(%rip)     # 0x1284aa
je 0xb38bf
callq 0x1f1b0
jmp 0xb38c1
leaq 0x86c08(%rip), %rax     # 0x13a4d0
testb $0x1, (%rax)
je 0xb38fc
leaq 0x120c(%rip), %rdi      # 0xb4ae0
callq 0xdd0f0
cmpl $0x0, %eax
je 0xb38fa
leaq 0x39c1e(%rip), %rdi     # 0xed503
callq 0xd7210
testb $0x1, 0x74bb9(%rip)     # 0x1284aa
je 0xb38f8
callq 0x1f1b0
jmp 0xb38fa
jmp 0xb38fc
callq 0xbff40
testb $0x1, %al
jne 0xb3907
jmp 0xb391c
leaq 0x74c12(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
callq 0xc09d0
testb $0x1, %al
jne 0xb3927
jmp 0xb393c
leaq 0x74bf2(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
callq 0xc1960
testb $0x1, %al
jne 0xb3947
jmp 0xb395c
leaq 0x74bd2(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
callq 0xb8a40
callq 0xd64b0
testb $0x1, %al
jne 0xb396c
jmp 0xb3981
leaq 0x74bad(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
callq 0xcd540
testb $0x1, %al
jne 0xb398c
jmp 0xb39a1
leaq 0x74b8d(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
leaq 0x74b30(%rip), %rdi     # 0x1284d8
callq 0xcde60
testb $0x1, %al
jne 0xb39b3
jmp 0xb39bc
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
movl $0x1, 0x74b0a(%rip)     # 0x1284d0
movl $0x1, 0x74b30(%rip)     # 0x128500
leaq -0x10(%rbp), %rax
movq %rax, 0x74aed(%rip)     # 0x1284c8
movq 0x74ae6(%rip), %rdi     # 0x1284c8
movl 0x74ae8(%rip), %eax     # 0x1284d0
movl %eax, %edx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x1f110
xorl %edi, %edi
callq 0xb11a0
movq 0x74ac5(%rip), %rax     # 0x1284c8
cmpq $0x0, (%rax)
jne 0xb3a1e
leaq 0x74b10(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
callq 0xb4bb0
testb $0x1, %al
jne 0xb3a29
jmp 0xb3a3e
leaq 0x74af0(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
callq 0xb4bd0
testb $0x1, %al
jne 0xb3a49
jmp 0xb3a5e
leaq 0x74ad0(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
callq 0xd6660
testb $0x1, %al
jne 0xb3a69
jmp 0xb3a7e
leaq 0x74ab0(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
callq 0xd13d0
testb $0x1, %al
jne 0xb3a89
jmp 0xb3a9e
leaq 0x74a90(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
leaq 0x74a7b(%rip), %rdi     # 0x128520
callq 0xb13a0
callq 0xb4c10
movl %eax, 0x74a63(%rip)     # 0x128518
leaq 0x74a64(%rip), %rdi     # 0x128520
callq 0xb1380
callq 0xcdfa0
testb $0x1, %al
jne 0xb3acc
jmp 0xb3ae1
leaq 0x74a4d(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
cmpq $0x0, 0x749d7(%rip)     # 0x1284c0
jne 0xb3b15
cmpl $0x1, 0x74a26(%rip)     # 0x128518
jbe 0xb3b08
movl 0x74a1e(%rip), %eax     # 0x128518
shll $0x2, %eax
movl %eax, %eax
movq %rax, 0x749ba(%rip)     # 0x1284c0
jmp 0xb3b13
movq $0x1, 0x749ad(%rip) # 0x1284c0
jmp 0xb3b15
movq 0x749a4(%rip), %rax     # 0x1284c0
movl %eax, 0x749ae(%rip)     # 0x1284d0
movl 0x749a8(%rip), %eax     # 0x1284d0
leaq 0x75681(%rip), %rcx     # 0x1291b0
movq (%rcx), %rcx
shrq $0x3, %rcx
cmpq %rcx, %rax
jbe 0xb3b63
leaq 0x7566e(%rip), %rax     # 0x1291b0
movq (%rax), %rax
shrq $0x3, %rax
movl %eax, 0x74981(%rip)     # 0x1284d0
movl 0x7497b(%rip), %esi     # 0x1284d0
leaq 0x399c6(%rip), %rdi     # 0xed522
movb $0x0, %al
callq 0xda3b0
movl 0x74967(%rip), %eax     # 0x1284d0
movl %eax, 0x74991(%rip)     # 0x128500
movl 0x7498b(%rip), %eax     # 0x128500
movl %eax, %edi
shlq $0x3, %rdi
callq 0xbfc90
movq %rax, 0x74941(%rip)     # 0x1284c8
cmpq $0x0, 0x74939(%rip)     # 0x1284c8
jne 0xb3ba3
leaq 0x74988(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x1, -0x1(%rbp)
jmp 0xb3be2
movq 0x7491e(%rip), %rdi     # 0x1284c8
movl 0x74950(%rip), %eax     # 0x128500
movl %eax, %edx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x1f110
movq -0x10(%rbp), %rcx
movq 0x74900(%rip), %rax     # 0x1284c8
movq %rcx, (%rax)
movb $0x1, 0x7494a(%rip)     # 0x12851c
leaq 0x74947(%rip), %rdi     # 0x128520
callq 0xb13a0
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)