// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/jemalloc/src/arena.c
// Function: je_arena_malloc_large
void *
arena_malloc_large(arena_t *arena, size_t size, bool zero)
{
	void *ret;
	size_t usize;
	uintptr_t random_offset;
	arena_run_t *run;
	arena_chunk_map_misc_t *miscelm;
	UNUSED bool idump;

	/* Large allocation. */
	usize = s2u(size);
	malloc_mutex_lock(&arena->lock);
	if (config_cache_oblivious) {
		uint64_t r;

		/*
		 * Compute a uniformly distributed offset within the first page
		 * that is a multiple of the cacheline size, e.g. [0 .. 63) * 64
		 * for 4 KiB pages and 64-byte cachelines.
		 */
		prng64(r, LG_PAGE - LG_CACHELINE, arena->offset_state,
		    UINT64_C(6364136223846793009),
		    UINT64_C(1442695040888963409));
		random_offset = ((uintptr_t)r) << LG_CACHELINE;
	} else
		random_offset = 0;
	run = arena_run_alloc_large(arena, usize + large_pad, zero);
	if (run == NULL) {
		malloc_mutex_unlock(&arena->lock);
		return (NULL);
	}
	miscelm = arena_run_to_miscelm(run);
	ret = (void *)((uintptr_t)arena_miscelm_to_rpages(miscelm) +
	    random_offset);
	if (config_stats) {
		szind_t index = size2index(usize) - NBINS;

		arena->stats.nmalloc_large++;
		arena->stats.nrequests_large++;
		arena->stats.allocated_large += usize;
		arena->stats.lstats[index].nmalloc++;
		arena->stats.lstats[index].nrequests++;
		arena->stats.lstats[index].curruns++;
	}
	if (config_prof)
		idump = arena_prof_accum_locked(arena, usize);
	malloc_mutex_unlock(&arena->lock);
	if (config_prof && idump)
		prof_idump();

	if (!zero) {
		if (config_fill) {
			if (unlikely(opt_junk_alloc))
				memset(ret, 0xa5, usize);
			else if (unlikely(opt_zero))
				memset(ret, 0, usize);
		}
	}

	return (ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %r14
cmpq $0x1000, %rsi           # imm = 0x1000
ja 0x23867
decq %rsi
shrq $0x3, %rsi
leaq 0x1f3f1(%rip), %rax     # 0x42b00
movzbl (%rax,%rsi), %eax
leaq 0x1ec66(%rip), %rcx     # 0x42380
movq (%rcx,%rax,8), %r15
leaq 0x8(%r14), %r12
movq %r12, %rdi
callq 0x106d0
movabsq $0x5851f42d4c957f31, %rax # imm = 0x5851F42D4C957F31
imulq 0xb8(%r14), %rax
movabsq $0x14057b7ef7678151, %rbx # imm = 0x14057B7EF7678151
addq %rax, %rbx
movq %rbx, 0xb8(%r14)
leaq 0x1000(%r15), %rsi
movzbl %bpl, %edx
movq %r14, %rdi
callq 0x238de
testq %rax, %rax
je 0x2384a
movl %ebp, 0x4(%rsp)
shrq $0x34, %rbx
addq $-0x10, %rax
leaq 0x33f31(%rip), %rcx     # 0x576b0
movq (%rcx), %r13
notq %r13
andq %rax, %r13
movq 0x33dd1(%rip), %rcx     # 0x57560
addq %r13, %rcx
subq %rcx, %rax
pushq $0x60
popq %rcx
xorl %edx, %edx
divq %rcx
movq %rax, %rbp
addq 0x33db1(%rip), %rbp     # 0x57558
andl $-0x40, %ebx
shlq $0xc, %rbp
addq %rbx, %r13
cmpq $0x1000, %r15           # imm = 0x1000
ja 0x2389e
leaq -0x1(%r15), %rax
shrq $0x3, %rax
leaq 0x1f333(%rip), %rcx     # 0x42b00
movzbl (%rcx,%rax), %eax
addq %rbp, %r13
incq 0x78(%r14)
addl $-0x27, %eax
movq %r15, %xmm0
shufpd $0x2, 0x1f6f7(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
movdqu 0x60(%r14), %xmm1
paddq %xmm1, %xmm0
movdqu %xmm0, 0x60(%r14)
movq 0x98(%r14), %rcx
shlq $0x5, %rax
incq (%rcx,%rax)
movdqu 0x10(%rcx,%rax), %xmm0
pcmpeqd %xmm1, %xmm1
psubq %xmm1, %xmm0
movdqu %xmm0, 0x10(%rcx,%rax)
movq %r12, %rdi
callq 0x10440
cmpb $0x0, 0x4(%rsp)
jne 0x23855
leaq 0x32def(%rip), %rax     # 0x56621
cmpb $0x1, (%rax)
je 0x238ab
leaq 0x32df5(%rip), %rax     # 0x56633
cmpb $0x1, (%rax)
jne 0x23855
movq %r13, %rdi
xorl %esi, %esi
jmp 0x238b3
movq %r12, %rdi
callq 0x10440
xorl %r13d, %r13d
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %rsi, %rsi
js 0x238c9
leaq -0x1(,%rsi,2), %rax
bsrq %rax, %rax
leal -0x3(%rax), %ecx
pushq $-0x1
popq %rdx
shlq %cl, %rdx
cmpq $0x6, %rax
notq %rdx
pushq $0x7
popq %r15
cmovaeq %rdx, %r15
addq %r15, %rsi
notq %r15
andq %rsi, %r15
jmp 0x2371e
movq %r15, %rdi
callq 0x284a4
jmp 0x237d1
movq %r13, %rdi
movl $0xa5, %esi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10270
movq %rsi, %rax
btrq $0x3f, %rax
cmpq $0x1, %rax
pushq $0x40
popq %rax
sbbq $0x0, %rax
jmp 0x23878