// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/jemalloc/src/ctl.c
// Function: ctl_init
static bool
ctl_init(void)
{
	bool ret;

	malloc_mutex_lock(&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();
		ctl_initialized = true;
	}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x4fda9(%rip), %rdi     # 0xa2788
callq 0x53170
testb $0x1, 0x4fd95(%rip)     # 0xa2780
jne 0x52b3a
callq 0x25f90
movl %eax, 0x4fddc(%rip)     # 0xa27d8
movl 0x4fdd6(%rip), %eax     # 0xa27d8
addl $0x1, %eax
movl %eax, %eax
imulq $0xbc8, %rax, %rdi      # imm = 0xBC8
callq 0x246c0
movq %rax, 0x4fdc6(%rip)     # 0xa27e0
cmpq $0x0, 0x4fdbe(%rip)     # 0xa27e0
jne 0x52a2d
movb $0x1, -0x1(%rbp)
jmp 0x52b3e
movq 0x4fdac(%rip), %rdi     # 0xa27e0
movl 0x4fd9e(%rip), %eax     # 0xa27d8
addl $0x1, %eax
movl %eax, %eax
imulq $0xbc8, %rax, %rdx      # imm = 0xBC8
xorl %esi, %esi
callq 0x10250
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x4fd7b(%rip), %eax     # 0xa27d8
ja 0x52b09
movq 0x4fd76(%rip), %rdi     # 0xa27e0
movl -0x8(%rbp), %eax
imulq $0xbc8, %rax, %rax      # imm = 0xBC8
addq %rax, %rdi
callq 0x53190
testb $0x1, %al
jne 0x52a82
jmp 0x52af9
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x8(%rbp), %eax
jae 0x52adc
movq 0x4fd48(%rip), %rax     # 0xa27e0
movl -0xc(%rbp), %ecx
imulq $0xbc8, %rcx, %rcx      # imm = 0xBC8
addq %rcx, %rax
movq 0xbb8(%rax), %rdi
callq 0x25330
movq 0x4fd28(%rip), %rax     # 0xa27e0
movl -0xc(%rbp), %ecx
imulq $0xbc8, %rcx, %rcx      # imm = 0xBC8
addq %rcx, %rax
movq 0xbc0(%rax), %rdi
callq 0x25330
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x52a89
movq 0x4fcfd(%rip), %rdi     # 0xa27e0
callq 0x25330
movq $0x0, 0x4fced(%rip) # 0xa27e0
movb $0x1, -0x1(%rbp)
jmp 0x52b3e
jmp 0x52afb
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x52a54
movq 0x4fcd0(%rip), %rax     # 0xa27e0
movl 0x4fcc2(%rip), %ecx     # 0xa27d8
imulq $0xbc8, %rcx, %rcx      # imm = 0xBC8
addq %rcx, %rax
movb $0x1, (%rax)
movq $0x0, 0x4fcba(%rip) # 0xa27e8
callq 0x53240
movb $0x1, 0x4fc46(%rip)     # 0xa2780
movb $0x0, -0x1(%rbp)
leaq 0x4fc43(%rip), %rdi     # 0xa2788
callq 0x536b0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)