// File: /workspace/github_c_makefile_star2_O3/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/jemalloc.c
// Function: malloc_init_hard
static bool
malloc_init_hard(void)
{
	tsd_t *tsd;

#if defined(_WIN32) && _WIN32_WINNT < 0x0600
	_init_init_lock();
#endif
	malloc_mutex_lock(TSDN_NULL, &init_lock);
	if (!malloc_init_hard_needed()) {
		malloc_mutex_unlock(TSDN_NULL, &init_lock);
		return (false);
	}

	if (malloc_init_state != malloc_init_a0_initialized &&
	    malloc_init_hard_a0_locked()) {
		malloc_mutex_unlock(TSDN_NULL, &init_lock);
		return (true);
	}

	malloc_mutex_unlock(TSDN_NULL, &init_lock);
	/* Recursive allocation relies on functional tsd. */
	tsd = malloc_tsd_boot0();
	if (tsd == NULL)
		return (true);
	if (malloc_init_hard_recursible())
		return (true);
	malloc_mutex_lock(tsd_tsdn(tsd), &init_lock);

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

	if (malloc_init_hard_finish(tsd_tsdn(tsd))) {
		malloc_mutex_unlock(tsd_tsdn(tsd), &init_lock);
		return (true);
	}

	malloc_mutex_unlock(tsd_tsdn(tsd), &init_lock);
	malloc_tsd_boot1();
	return (false);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x2adc6(%rip), %rdi     # 0x4c360
callq 0xb5a0
movl 0x2adb7(%rip), %ebx     # 0x4c35c
testl %ebx, %ebx
je 0x2165c
movq 0x2b004(%rip), %r14     # 0x4c5b8
callq 0xb460
cmpq %rax, %r14
sete %cl
cmpl $0x1, %ebx
sete %dl
testb %cl, %dl
jne 0x2165c
cmpq %rax, %r14
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
je 0x21603
cmpl $0x2, %ebx
je 0x21675
callq 0x20633
testb %al, %al
je 0x21675
leaq 0x2ad66(%rip), %rdi     # 0x4c360
callq 0xb380
movb $0x1, %bl
jmp 0x2166a
xorl %ebp, %ebp
leaq 0x2ad54(%rip), %rbx     # 0x4c360
movq %rbx, %rdi
callq 0xb380
movq $0x0, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl %ebp, %r14d
movl %ebp, %ecx
shrq %cl, %rax
testq %rax, %rax
jne 0x21640
pause
incq 0x8(%rsp)
movq 0x8(%rsp), %rax
movl %r14d, %ecx
jmp 0x21627
cmpl $0x3f, %r14d
adcl $0x0, %r14d
movq %rbx, %rdi
callq 0xb5a0
cmpl $0x0, 0x2ad05(%rip)     # 0x4c35c
movl %r14d, %ebp
jne 0x2160c
leaq 0x2acfd(%rip), %rdi     # 0x4c360
callq 0xb380
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2ace4(%rip), %rdi     # 0x4c360
callq 0xb380
callq 0x36343
movb $0x1, %bl
testq %rax, %rax
je 0x2166a
movq %rax, %r14
movl $0x1, %ebp
movl %ebp, 0x2acc1(%rip)     # 0x4c35c
movl $0x54, %edi
callq 0xb490
cmpq $-0x1, %rax
cmovel %ebp, %eax
movl %eax, 0x2aef6(%rip)     # 0x4c5a8
leaq -0x159e(%rip), %rdi     # 0x2011b
leaq -0x1421(%rip), %rsi     # 0x2029f
leaq -0x1337(%rip), %rdx     # 0x20390
callq 0x38040
testl %eax, %eax
je 0x216ea
leaq 0x1ab4e(%rip), %rdi     # 0x3c225
callq 0x3645c
cmpb $0x1, 0x2ae3d(%rip)     # 0x4c520
jne 0x2166a
callq 0xb070
leaq 0x2ac6f(%rip), %rdi     # 0x4c360
callq 0xb5a0
callq 0x2e4cc
testb %al, %al
jne 0x2180e
movl 0x2ae2b(%rip), %eax     # 0x4c534
testl %eax, %eax
jne 0x21721
movl 0x2ae95(%rip), %eax     # 0x4c5a8
cmpl $0x2, %eax
jb 0x21753
shll $0x2, %eax
movl %eax, 0x2ae13(%rip)     # 0x4c534
movl %eax, 0x2ae71(%rip)     # 0x4c598
cmpl $0xfff, %eax            # imm = 0xFFF
jb 0x21764
movl $0xffe, 0x2ae60(%rip)   # imm = 0xFFE
leaq 0x1ab0d(%rip), %rdi     # 0x3c24c
movl $0xffe, %esi            # imm = 0xFFE
xorl %eax, %eax
callq 0x374a4
movl 0x2ae47(%rip), %eax     # 0x4c598
jmp 0x21764
movl $0x1, %eax
movl %eax, 0x2add6(%rip)     # 0x4c534
movl %eax, 0x2ae34(%rip)     # 0x4c598
xchgl %eax, 0x2add6(%rip)     # 0x4c540
movl $0x7ff8, %esi           # imm = 0x7FF8
movq %r14, %rdi
callq 0xf880
movq %rax, 0x2ae32(%rip)     # 0x4c5b0
testq %rax, %rax
je 0x2180e
movq 0x2adaa(%rip), %rcx     # 0x4c538
xchgq %rcx, (%rax)
movb 0x2ad8b(%rip), %al      # 0x4c522
addb %al, %al
orb 0x2ad82(%rip), %al      # 0x4c521
movl $0x0, 0x2abb3(%rip)     # 0x4c35c
cmpq $0x0, 0x2ad77(%rip)     # 0x4c528
setne %cl
shlb $0x2, %cl
orb %al, %cl
movb 0x2ad74(%rip), %al      # 0x4c533
shlb $0x3, %al
orb %cl, %al
movb 0x2ad67(%rip), %cl      # 0x4c531
shlb $0x4, %cl
orb %al, %cl
movb 0x2ad5d(%rip), %al      # 0x4c532
shlb $0x6, %al
orb 0x2ade2(%rip), %cl      # 0x4c5c0
orb %al, %cl
movb 0x2adb6(%rip), %al      # 0x4c59c
shlb $0x5, %al
orb %cl, %al
movb %al, 0x2adcf(%rip)      # 0x4c5c0
setne 0x2ab60(%rip)           # 0x4c358
leaq 0x2ab61(%rip), %rdi     # 0x4c360
callq 0xb380
callq 0x363e8
jmp 0x21668
leaq 0x2ab4b(%rip), %rdi     # 0x4c360
callq 0xb380
jmp 0x2166a
nop