// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/ctl.c
// Function: ctl_init
static bool
ctl_init(tsdn_t *tsdn)
{
	bool ret;

	malloc_mutex_lock(tsdn, &ctl_mtx);
	if (!ctl_initialized) {
		/*
		 * Allocate space for one extra arena stats element, which
		 * contains summed stats across all arenas.
		 */
		ctl_stats.narenas = narenas_total_get();
		ctl_stats.arenas = (ctl_arena_stats_t *)a0malloc(
		    (ctl_stats.narenas + 1) * sizeof(ctl_arena_stats_t));
		if (ctl_stats.arenas == NULL) {
			ret = true;
			goto label_return;
		}
		memset(ctl_stats.arenas, 0, (ctl_stats.narenas + 1) *
		    sizeof(ctl_arena_stats_t));

		/*
		 * Initialize all stats structures, regardless of whether they
		 * ever get used.  Lazy initialization would allow errors to
		 * cause inconsistent state to be viewable by the application.
		 */
		if (config_stats) {
			unsigned i;
			for (i = 0; i <= ctl_stats.narenas; i++) {
				if (ctl_arena_init(&ctl_stats.arenas[i])) {
					unsigned j;
					for (j = 0; j < i; j++) {
						a0dalloc(
						    ctl_stats.arenas[j].lstats);
						a0dalloc(
						    ctl_stats.arenas[j].hstats);
					}
					a0dalloc(ctl_stats.arenas);
					ctl_stats.arenas = NULL;
					ret = true;
					goto label_return;
				}
			}
		}
		ctl_stats.arenas[ctl_stats.narenas].initialized = true;

		ctl_epoch = 0;
		ctl_refresh(tsdn);
		ctl_initialized = true;
	}

	ret = false;
label_return:
	malloc_mutex_unlock(tsdn, &ctl_mtx);
	return (ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x256cd(%rip), %rdi     # 0x4d100
callq 0xb5a0
cmpb $0x0, 0x256b9(%rip)     # 0x4d0f8
jne 0x27b67
callq 0x1ae79
movl %eax, 0x25730(%rip)     # 0x4d180
incl %eax
imulq $0xbd8, %rax, %rdi      # imm = 0xBD8
callq 0x1ad50
movq %rax, 0x25723(%rip)     # 0x4d188
movb $0x1, %bpl
testq %rax, %rax
je 0x27b69
movl 0x25709(%rip), %ecx     # 0x4d180
incl %ecx
imulq $0xbd8, %rcx, %rdx      # imm = 0xBD8
xorl %r14d, %r14d
movq %rax, %rdi
xorl %esi, %esi
callq 0xb230
movq 0x256f4(%rip), %rdi     # 0x4d188
callq 0x27f0c
movl $0x0, %r15d
testb %al, %al
jne 0x27ad0
xorl %r15d, %r15d
incl %r15d
cmpl 0x256d0(%rip), %r15d    # 0x4d180
seta %r14b
ja 0x27b32
movl %r15d, %eax
imulq $0xbd8, %rax, %rdi      # imm = 0xBD8
addq 0x256c1(%rip), %rdi     # 0x4d188
callq 0x27f0c
testb %al, %al
je 0x27aa6
testl %r15d, %r15d
je 0x27b16
movl %r15d, %eax
imulq $0xbd8, %rax, %r15      # imm = 0xBD8
xorl %r12d, %r12d
movq 0x2569f(%rip), %rax     # 0x4d188
movq 0xbc8(%rax,%r12), %rdi
callq 0x1ad5c
movq 0x2568b(%rip), %rax     # 0x4d188
movq 0xbd0(%rax,%r12), %rdi
callq 0x1ad5c
addq $0xbd8, %r12            # imm = 0xBD8
cmpq %r12, %r15
jne 0x27ae2
movq 0x2566b(%rip), %rdi     # 0x4d188
callq 0x1ad5c
movq $0x0, 0x2565b(%rip) # 0x4d188
testb %r14b, %r14b
je 0x27b69
movq 0x2564f(%rip), %rax     # 0x4d188
movl 0x25641(%rip), %ecx     # 0x4d180
imulq $0xbd8, %rcx, %rcx      # imm = 0xBD8
movb $0x1, %bpl
movb %bpl, (%rax,%rcx)
movq $0x0, 0x25638(%rip) # 0x4d190
movq %rbx, %rdi
callq 0x27f6c
movb %bpl, 0x25591(%rip)     # 0x4d0f8
xorl %ebp, %ebp
leaq 0x25590(%rip), %rdi     # 0x4d100
callq 0xb380
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq