// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/ctl.c
// Function: ctl_grow
static bool
ctl_grow(void)
{
	size_t astats_size;
	ctl_arena_stats_t *astats;
	arena_t **tarenas;

	/* Extend arena stats and arenas arrays. */
	astats_size = (ctl_stats.narenas + 2) * sizeof(ctl_arena_stats_t);
	if (ctl_stats.narenas == narenas_auto) {
		/* ctl_stats.arenas and arenas came from base_alloc(). */
		astats = (ctl_arena_stats_t *)imalloc(astats_size);
		if (astats == NULL)
			return (true);
		memcpy(astats, ctl_stats.arenas, (ctl_stats.narenas + 1) *
		    sizeof(ctl_arena_stats_t));

		tarenas = (arena_t **)imalloc((ctl_stats.narenas + 1) *
		    sizeof(arena_t *));
		if (tarenas == NULL) {
			idalloc(astats);
			return (true);
		}
		memcpy(tarenas, arenas, ctl_stats.narenas * sizeof(arena_t *));
	} else {
		astats = (ctl_arena_stats_t *)iralloc(ctl_stats.arenas,
		    astats_size, 0, 0, false, false);
		if (astats == NULL)
			return (true);

		tarenas = (arena_t **)iralloc(arenas, (ctl_stats.narenas + 1) *
		    sizeof(arena_t *), 0, 0, false, false);
		if (tarenas == NULL)
			return (true);
	}
	/* Initialize the new astats and arenas elements. */
	memset(&astats[ctl_stats.narenas + 1], 0, sizeof(ctl_arena_stats_t));
	if (ctl_arena_init(&astats[ctl_stats.narenas + 1]))
		return (true);
	tarenas[ctl_stats.narenas] = NULL;
	/* Swap merged stats to their new location. */
	{
		ctl_arena_stats_t tstats;
		memcpy(&tstats, &astats[ctl_stats.narenas],
		    sizeof(ctl_arena_stats_t));
		memcpy(&astats[ctl_stats.narenas],
		    &astats[ctl_stats.narenas + 1], sizeof(ctl_arena_stats_t));
		memcpy(&astats[ctl_stats.narenas + 1], &tstats,
		    sizeof(ctl_arena_stats_t));
	}
	ctl_stats.arenas = astats;
	ctl_stats.narenas++;
	malloc_mutex_lock(&arenas_lock);
	arenas = tarenas;
	narenas_total++;
	arenas_extend(narenas_total - 1);
	malloc_mutex_unlock(&arenas_lock);

	return (false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x890, %rsp            # imm = 0x890
movl 0x63baf(%rip), %eax     # 0x129340
addl $0x2, %eax
movl %eax, %eax
imulq $0x870, %rax, %rax      # imm = 0x870
movq %rax, -0x10(%rbp)
movl 0x63b99(%rip), %eax     # 0x129340
leaq 0x62d22(%rip), %rcx     # 0x1284d0
cmpl (%rcx), %eax
jne 0xc5849
movq -0x10(%rbp), %rdi
callq 0xc5a20
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xc57d3
movb $0x1, -0x1(%rbp)
jmp 0xc5a11
movq -0x18(%rbp), %rdi
movq 0x63b6a(%rip), %rsi     # 0x129348
movl 0x63b5c(%rip), %eax     # 0x129340
addl $0x1, %eax
movl %eax, %eax
imulq $0x870, %rax, %rdx      # imm = 0x870
callq 0x1fbf0
movl 0x63b45(%rip), %eax     # 0x129340
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
shlq $0x3, %rdi
callq 0xc5a20
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xc5828
movq -0x18(%rbp), %rdi
callq 0xc5a50
movb $0x1, -0x1(%rbp)
jmp 0xc5a11
movq -0x20(%rbp), %rdi
leaq 0x62c95(%rip), %rax     # 0x1284c8
movq (%rax), %rsi
movl 0x63b04(%rip), %eax     # 0x129340
movl %eax, %edx
shlq $0x3, %rdx
callq 0x1fbf0
jmp 0xc58bd
movq 0x63af8(%rip), %rdi     # 0x129348
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
xorl %r9d, %r9d
movq %rcx, %rdx
movl %r9d, %r8d
callq 0xc5a70
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xc587a
movb $0x1, -0x1(%rbp)
jmp 0xc5a11
leaq 0x62c47(%rip), %rax     # 0x1284c8
movq (%rax), %rdi
movl 0x63ab6(%rip), %eax     # 0x129340
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
shlq $0x3, %rsi
xorl %eax, %eax
movl %eax, %ecx
xorl %r9d, %r9d
movq %rcx, %rdx
movl %r9d, %r8d
callq 0xc5a70
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xc58bb
movb $0x1, -0x1(%rbp)
jmp 0xc5a11
jmp 0xc58bd
movq -0x18(%rbp), %rdi
movl 0x63a79(%rip), %eax     # 0x129340
addl $0x1, %eax
movl %eax, %eax
imulq $0x870, %rax, %rax      # imm = 0x870
addq %rax, %rdi
xorl %esi, %esi
movl $0x870, %edx            # imm = 0x870
callq 0x1f110
movq -0x18(%rbp), %rdi
movl 0x63a54(%rip), %eax     # 0x129340
addl $0x1, %eax
movl %eax, %eax
imulq $0x870, %rax, %rax      # imm = 0x870
addq %rax, %rdi
callq 0xc1a20
testb $0x1, %al
jne 0xc5906
jmp 0xc590f
movb $0x1, -0x1(%rbp)
jmp 0xc5a11
movq -0x20(%rbp), %rax
movl 0x63a27(%rip), %ecx     # 0x129340
movq $0x0, (%rax,%rcx,8)
movq -0x18(%rbp), %rsi
movl 0x63a15(%rip), %eax     # 0x129340
imulq $0x870, %rax, %rax      # imm = 0x870
addq %rax, %rsi
leaq -0x890(%rbp), %rdi
movl $0x870, %edx            # imm = 0x870
callq 0x1fbf0
movq -0x18(%rbp), %rdi
movl 0x639f0(%rip), %eax     # 0x129340
imulq $0x870, %rax, %rax      # imm = 0x870
addq %rax, %rdi
movq -0x18(%rbp), %rsi
movl 0x639dc(%rip), %eax     # 0x129340
addl $0x1, %eax
movl %eax, %eax
imulq $0x870, %rax, %rax      # imm = 0x870
addq %rax, %rsi
movl $0x870, %edx            # imm = 0x870
callq 0x1fbf0
movq -0x18(%rbp), %rdi
movl 0x639b9(%rip), %eax     # 0x129340
addl $0x1, %eax
movl %eax, %eax
imulq $0x870, %rax, %rax      # imm = 0x870
addq %rax, %rdi
leaq -0x890(%rbp), %rsi
movl $0x870, %edx            # imm = 0x870
callq 0x1fbf0
movq -0x18(%rbp), %rax
movq %rax, 0x63996(%rip)     # 0x129348
movl 0x63988(%rip), %eax     # 0x129340
addl $0x1, %eax
movl %eax, 0x6397f(%rip)     # 0x129340
leaq 0x62b10(%rip), %rdi     # 0x1284d8
callq 0xc19c0
movq -0x20(%rbp), %rcx
leaq 0x62af0(%rip), %rax     # 0x1284c8
movq %rcx, (%rax)
leaq 0x62b1e(%rip), %rax     # 0x128500
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x62b12(%rip), %rax     # 0x128500
movl %ecx, (%rax)
leaq 0x62b09(%rip), %rax     # 0x128500
movl (%rax), %edi
subl $0x1, %edi
callq 0xb11a0
leaq 0x62ad0(%rip), %rdi     # 0x1284d8
callq 0xc1d60
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x890, %rsp            # imm = 0x890
popq %rbp
retq
nop