// File: /workspace/github_c_makefile_star2_O1/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 0x2ac68(%rip), %rdi     # 0x4c360
callq 0xb5a0
movl 0x2ac59(%rip), %ebp     # 0x4c35c
testl %ebp, %ebp
je 0x217be
movq 0x2aea6(%rip), %rbx     # 0x4c5b8
callq 0xb460
cmpq %rax, %rbx
sete %cl
cmpl $0x1, %ebp
sete %dl
testb %cl, %dl
jne 0x217be
cmpq %rax, %rbx
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
je 0x21765
cmpl $0x2, 0x2ac1a(%rip)     # 0x4c35c
je 0x217d7
callq 0x20914
testb %al, %al
je 0x217d7
leaq 0x2ac04(%rip), %rdi     # 0x4c360
callq 0xb380
movb $0x1, %bl
jmp 0x217cc
xorl %ebp, %ebp
leaq 0x2abf2(%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 0x217a2
pause
incq 0x8(%rsp)
movq 0x8(%rsp), %rax
movl %r14d, %ecx
jmp 0x21789
cmpl $0x3f, %r14d
adcl $0x0, %r14d
movq %rbx, %rdi
callq 0xb5a0
cmpl $0x0, 0x2aba3(%rip)     # 0x4c35c
movl %r14d, %ebp
jne 0x2176e
leaq 0x2ab9b(%rip), %rdi     # 0x4c360
callq 0xb380
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2ab82(%rip), %rdi     # 0x4c360
callq 0xb380
callq 0x35de3
movb $0x1, %bl
testq %rax, %rax
je 0x217cc
movq %rax, %r14
movl $0x1, %ebp
movl %ebp, 0x2ab5f(%rip)     # 0x4c35c
movl $0x54, %edi
callq 0xb490
cmpq $-0x1, %rax
cmovel %ebp, %eax
movl %eax, 0x2ad94(%rip)     # 0x4c5a8
leaq -0x140a(%rip), %rdi     # 0x20411
leaq -0x12a2(%rip), %rsi     # 0x20580
leaq -0x11b8(%rip), %rdx     # 0x20671
callq 0x38040
testl %eax, %eax
je 0x21855
movl %eax, %ebp
leaq 0x1a96a(%rip), %rdi     # 0x3c1a5
callq 0x35efc
cmpb $0x1, 0x2acd9(%rip)     # 0x4c520
je 0x21986
testl %ebp, %ebp
jne 0x217cc
leaq 0x2ab04(%rip), %rdi     # 0x4c360
callq 0xb5a0
callq 0x2e66c
testb %al, %al
jne 0x21975
cmpl $0x0, 0x2acbf(%rip)     # 0x4c534
jne 0x21895
movl 0x2ad2b(%rip), %eax     # 0x4c5a8
leal (,%rax,4), %ecx
cmpl $0x2, %eax
movl $0x1, %eax
cmovael %ecx, %eax
movl %eax, 0x2ac9f(%rip)     # 0x4c534
movl 0x2ac99(%rip), %eax     # 0x4c534
movl %eax, 0x2acf7(%rip)     # 0x4c598
cmpl $0xfff, %eax            # imm = 0xFFF
jb 0x218c5
movl $0xffe, 0x2ace6(%rip)   # imm = 0xFFE
leaq 0x1a913(%rip), %rdi     # 0x3c1cc
movl $0xffe, %esi            # imm = 0xFFE
xorl %eax, %eax
callq 0x36ef7
movl 0x2accd(%rip), %eax     # 0x4c598
xchgl %eax, 0x2ac6f(%rip)     # 0x4c540
movl $0x7ff8, %esi           # imm = 0x7FF8
movq %r14, %rdi
callq 0xff71
movq %rax, 0x2accb(%rip)     # 0x4c5b0
testq %rax, %rax
je 0x21975
movq 0x2ac43(%rip), %rcx     # 0x4c538
xchgq %rcx, (%rax)
movb 0x2ac24(%rip), %al      # 0x4c522
addb %al, %al
orb 0x2ac1b(%rip), %al      # 0x4c521
movl $0x0, 0x2aa4c(%rip)     # 0x4c35c
cmpq $0x0, 0x2ac10(%rip)     # 0x4c528
setne %cl
shlb $0x2, %cl
orb %al, %cl
movb 0x2ac0d(%rip), %al      # 0x4c533
shlb $0x3, %al
orb %cl, %al
movb 0x2ac00(%rip), %cl      # 0x4c531
shlb $0x4, %cl
orb %al, %cl
movb 0x2abf6(%rip), %al      # 0x4c532
shlb $0x6, %al
orb 0x2ac7b(%rip), %cl      # 0x4c5c0
orb %al, %cl
movb 0x2ac4f(%rip), %al      # 0x4c59c
shlb $0x5, %al
orb %cl, %al
movb %al, 0x2ac68(%rip)      # 0x4c5c0
setne 0x2a9f9(%rip)           # 0x4c358
leaq 0x2a9fa(%rip), %rdi     # 0x4c360
callq 0xb380
callq 0x35e88
jmp 0x217ca
leaq 0x2a9e4(%rip), %rdi     # 0x4c360
callq 0xb380
jmp 0x217cc
callq 0xb070
nop