// File: /workspace/github_c_makefile_star2_O2/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 0x2e87e(%rip), %rdi     # 0x48360
callq 0xb5a0
movl 0x2e86f(%rip), %ebx     # 0x4835c
testl %ebx, %ebx
je 0x19b8a
movq 0x2eabc(%rip), %r14     # 0x485b8
callq 0xb460
cmpq %rax, %r14
sete %cl
cmpl $0x1, %ebx
sete %dl
testb %cl, %dl
jne 0x19b8a
cmpq %rax, %r14
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
je 0x19b3f
cmpl $0x2, %ebx
je 0x19ba3
callq 0x18d93
testb %al, %al
je 0x19ba3
leaq 0x2e82a(%rip), %rdi     # 0x48360
callq 0xb380
movb $0x1, %bl
jmp 0x19b98
xorl %ebx, %ebx
leaq 0x2e818(%rip), %r14     # 0x48360
movq %r14, %rdi
callq 0xb380
movq $0x0, 0x8(%rsp)
movl %ebx, %ebx
movq 0x8(%rsp), %rax
movl %ebx, %ecx
shrq %cl, %rax
testq %rax, %rax
jne 0x19b73
pause
incq 0x8(%rsp)
jmp 0x19b5b
cmpl $0x3f, %ebx
adcl $0x0, %ebx
movq %r14, %rdi
callq 0xb5a0
cmpl $0x0, 0x2e7d4(%rip)     # 0x4835c
jne 0x19b48
leaq 0x2e7cf(%rip), %rdi     # 0x48360
callq 0xb380
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2e7b6(%rip), %rdi     # 0x48360
callq 0xb380
callq 0x31155
movb $0x1, %bl
testq %rax, %rax
je 0x19b98
movq %rax, %r14
pushq $0x1
popq %rbp
movl %ebp, 0x2e795(%rip)     # 0x4835c
pushq $0x54
popq %rdi
callq 0xb490
cmpq $-0x1, %rax
cmovel %ebp, %eax
movl %eax, 0x2e9cc(%rip)     # 0x485a8
leaq -0x1311(%rip), %rdi     # 0x188d2
leaq -0x11af(%rip), %rsi     # 0x18a3b
leaq -0x10c9(%rip), %rdx     # 0x18b28
callq 0x33b50
testl %eax, %eax
je 0x19c14
leaq 0x1d1a4(%rip), %rdi     # 0x36da5
callq 0x3126c
cmpb $0x1, 0x2e913(%rip)     # 0x48520
jne 0x19b98
callq 0xb070
leaq 0x2e745(%rip), %rdi     # 0x48360
callq 0xb5a0
callq 0x294aa
testb %al, %al
jne 0x19d32
movl 0x2e901(%rip), %eax     # 0x48534
testl %eax, %eax
jne 0x19c4b
movl 0x2e96b(%rip), %eax     # 0x485a8
cmpl $0x2, %eax
jb 0x19c7f
shll $0x2, %eax
movl %eax, 0x2e8e9(%rip)     # 0x48534
movl %eax, 0x2e947(%rip)     # 0x48598
movl %eax, %ebp
cmpl $0xfff, %eax            # imm = 0xFFF
jb 0x19c8b
movl $0xffe, 0x2e934(%rip)   # imm = 0xFFE
leaq 0x1d161(%rip), %rdi     # 0x36dcc
movl $0xffe, %esi            # imm = 0xFFE
xorl %eax, %eax
callq 0x322ac
movl 0x2e91b(%rip), %ebp     # 0x48598
jmp 0x19c8b
movl %ebp, 0x2e8af(%rip)     # 0x48534
movl %ebp, 0x2e90d(%rip)     # 0x48598
xchgl %ebp, 0x2e8af(%rip)     # 0x48540
movl $0x7ff8, %esi           # imm = 0x7FF8
movq %r14, %rdi
callq 0x20d5c
movq %rax, 0x2e90b(%rip)     # 0x485b0
testq %rax, %rax
je 0x19d32
movq 0x2e883(%rip), %rcx     # 0x48538
xchgq %rcx, (%rax)
andl $0x0, 0x2e69d(%rip)     # 0x4835c
movb 0x2e85d(%rip), %al      # 0x48522
addb %al, %al
orb 0x2e854(%rip), %al      # 0x48521
cmpq $0x0, 0x2e853(%rip)     # 0x48528
setne %cl
shlb $0x2, %cl
orb %al, %cl
movb 0x2e850(%rip), %al      # 0x48533
shlb $0x3, %al
orb %cl, %al
movb 0x2e843(%rip), %cl      # 0x48531
shlb $0x4, %cl
orb %al, %cl
movb 0x2e839(%rip), %al      # 0x48532
shlb $0x6, %al
orb 0x2e8be(%rip), %cl      # 0x485c0
orb %al, %cl
movb 0x2e892(%rip), %al      # 0x4859c
shlb $0x5, %al
orb %cl, %al
movb %al, 0x2e8ab(%rip)      # 0x485c0
setne 0x2e63c(%rip)           # 0x48358
leaq 0x2e63d(%rip), %rdi     # 0x48360
callq 0xb380
callq 0x311f7
jmp 0x19b96
leaq 0x2e627(%rip), %rdi     # 0x48360
callq 0xb380
jmp 0x19b98
nop