// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/jemalloc/src/jemalloc.c
// Function: je_arena_get_hard
arena_t *
arena_get_hard(tsd_t *tsd, unsigned ind, bool init_if_missing)
{
	arena_t *arena;
	arena_t **arenas_cache = tsd_arenas_cache_get(tsd);
	unsigned narenas_cache = tsd_narenas_cache_get(tsd);
	unsigned narenas_actual = narenas_total_get();

	/* Deallocate old cache if it's too small. */
	if (arenas_cache != NULL && narenas_cache < narenas_actual) {
		a0dalloc(arenas_cache);
		arenas_cache = NULL;
		narenas_cache = 0;
		tsd_arenas_cache_set(tsd, arenas_cache);
		tsd_narenas_cache_set(tsd, narenas_cache);
	}

	/* Allocate cache if it's missing. */
	if (arenas_cache == NULL) {
		bool *arenas_cache_bypassp = tsd_arenas_cache_bypassp_get(tsd);
		assert(ind < narenas_actual || !init_if_missing);
		narenas_cache = (ind < narenas_actual) ? narenas_actual : ind+1;

		if (tsd_nominal(tsd) && !*arenas_cache_bypassp) {
			*arenas_cache_bypassp = true;
			arenas_cache = (arena_t **)a0malloc(sizeof(arena_t *) *
			    narenas_cache);
			*arenas_cache_bypassp = false;
		}
		if (arenas_cache == NULL) {
			/*
			 * This function must always tell the truth, even if
			 * it's slow, so don't let OOM, thread cleanup (note
			 * tsd_nominal check), nor recursive allocation
			 * avoidance (note arenas_cache_bypass check) get in the
			 * way.
			 */
			if (ind >= narenas_actual)
				return (NULL);
			malloc_mutex_lock(&arenas_lock);
			arena = arenas[ind];
			malloc_mutex_unlock(&arenas_lock);
			return (arena);
		}
		assert(tsd_nominal(tsd) && !*arenas_cache_bypassp);
		tsd_arenas_cache_set(tsd, arenas_cache);
		tsd_narenas_cache_set(tsd, narenas_cache);
	}

	/*
	 * Copy to cache.  It's possible that the actual number of arenas has
	 * increased since narenas_total_get() was called above, but that causes
	 * no correctness issues unless two threads concurrently execute the
	 * arenas.extend mallctl, which we trust mallctl synchronization to
	 * prevent.
	 */
	malloc_mutex_lock(&arenas_lock);
	memcpy(arenas_cache, arenas, sizeof(arena_t *) * narenas_actual);
	malloc_mutex_unlock(&arenas_lock);
	if (narenas_cache > narenas_actual) {
		memset(&arenas_cache[narenas_actual], 0, sizeof(arena_t *) *
		    (narenas_cache - narenas_actual));
	}

	/* Read the refreshed cache, and init the arena if necessary. */
	arena = arenas_cache[ind];
	if (init_if_missing && arena == NULL)
		arena = arenas_cache[ind] = arena_init(ind);
	return (arena);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movb %dl, %al
movq %rdi, -0x78(%rbp)
movl %esi, -0x7c(%rbp)
andb $0x1, %al
movb %al, -0x7d(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x94(%rbp)
callq 0x25f90
movl %eax, -0x98(%rbp)
cmpq $0x0, -0x90(%rbp)
je 0x26173
movl -0x94(%rbp), %eax
cmpl -0x98(%rbp), %eax
jae 0x26173
movq -0x90(%rbp), %rdi
callq 0x25330
movq $0x0, -0x90(%rbp)
movl $0x0, -0x94(%rbp)
movq -0x78(%rbp), %rcx
movq -0x90(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x78(%rbp), %rcx
movl -0x94(%rbp), %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x38(%rax)
cmpq $0x0, -0x90(%rbp)
jne 0x262af
movq -0x78(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x3c, %rax
movq %rax, -0xa0(%rbp)
jmp 0x2619a
movl -0x7c(%rbp), %eax
cmpl -0x98(%rbp), %eax
jae 0x261b3
movl -0x98(%rbp), %eax
movl %eax, -0xa4(%rbp)
jmp 0x261bf
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x94(%rbp)
movq -0x78(%rbp), %rdi
callq 0x26380
testb $0x1, %al
jne 0x261da
jmp 0x26212
movq -0xa0(%rbp), %rax
testb $0x1, (%rax)
jne 0x26212
movq -0xa0(%rbp), %rax
movb $0x1, (%rax)
movl -0x94(%rbp), %eax
movl %eax, %edi
shlq $0x3, %rdi
callq 0x246c0
movq %rax, -0x90(%rbp)
movq -0xa0(%rbp), %rax
movb $0x0, (%rax)
cmpq $0x0, -0x90(%rbp)
jne 0x26271
movl -0x7c(%rbp), %eax
cmpl -0x98(%rbp), %eax
jb 0x26234
movq $0x0, -0x70(%rbp)
jmp 0x26370
leaq 0x7b48d(%rip), %rdi     # 0xa16c8
callq 0x25e30
movq 0x7b4b1(%rip), %rax     # 0xa16f8
movl -0x7c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x88(%rbp)
leaq 0x7b46c(%rip), %rdi     # 0xa16c8
callq 0x25f70
movq -0x88(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0x26370
jmp 0x26273
jmp 0x26275
movq -0x78(%rbp), %rcx
movq -0x90(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x78(%rbp), %rcx
movl -0x94(%rbp), %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x38(%rax)
leaq 0x7b412(%rip), %rdi     # 0xa16c8
callq 0x25e30
movq -0x90(%rbp), %rdi
movq 0x7b42f(%rip), %rsi     # 0xa16f8
movl -0x98(%rbp), %eax
movl %eax, %edx
shlq $0x3, %rdx
callq 0x103b0
leaq 0x7b3e7(%rip), %rdi     # 0xa16c8
callq 0x25f70
movl -0x94(%rbp), %eax
cmpl -0x98(%rbp), %eax
jbe 0x26323
movq -0x90(%rbp), %rdi
movl -0x98(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rdi
movl -0x94(%rbp), %eax
subl -0x98(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x10250
movq -0x90(%rbp), %rax
movl -0x7c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x88(%rbp)
testb $0x1, -0x7d(%rbp)
je 0x26365
cmpq $0x0, -0x88(%rbp)
jne 0x26365
movl -0x7c(%rbp), %edi
callq 0x25df0
movq -0x90(%rbp), %rcx
movl -0x7c(%rbp), %edx
movq %rax, (%rcx,%rdx,8)
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)