// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/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
subq $0x18, %rsp
movl %edx, %ebp
movq %rdi, %r15
cmpq $0x1000, %rsi           # imm = 0x1000
ja 0x3b5d2
decq %rsi
shrq $0x3, %rsi
leaq 0x1e36f(%rip), %rax     # 0x59800
movzbl (%rax,%rsi), %eax
leaq 0x1dbe4(%rip), %rcx     # 0x59080
movq (%rcx,%rax,8), %r14
leaq 0x8(%r15), %r12
movq %r12, %rdi
callq 0x12960
movabsq $0x5851f42d4c957f31, %rax # imm = 0x5851F42D4C957F31
imulq 0xb8(%r15), %rax
movabsq $0x14057b7ef7678151, %rbx # imm = 0x14057B7EF7678151
addq %rax, %rbx
movq %rbx, 0xb8(%r15)
leaq 0x1000(%r14), %rsi
movzbl %bpl, %edx
movq %r15, %rdi
callq 0x3b615
testq %rax, %rax
je 0x3b5b5
movl %ebp, 0xc(%rsp)
shrq $0x34, %rbx
addq $-0x10, %rax
leaq 0x4919f(%rip), %rcx     # 0x846a0
movq (%rcx), %r13
notq %r13
andq %rax, %r13
movq 0x4903f(%rip), %rcx     # 0x84550
addq %r13, %rcx
subq %rcx, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
movq %rdx, %rbp
shrq $0x6, %rbp
addq 0x49016(%rip), %rbp     # 0x84548
andl $-0x40, %ebx
shlq $0xc, %rbp
addq %rbx, %r13
cmpq $0x1000, %r14           # imm = 0x1000
ja 0x3b5ea
leaq -0x1(%r14), %rax
shrq $0x3, %rax
leaq 0x1e2a8(%rip), %rcx     # 0x59800
movzbl (%rcx,%rax), %eax
incq 0x68(%r15)
addl $-0x24, %eax
incq 0x78(%r15)
addq %r14, 0x60(%r15)
movq 0x98(%r15), %rcx
shlq $0x5, %rax
incq (%rcx,%rax)
incq 0x10(%rcx,%rax)
addq %rbp, %r13
incq 0x18(%rcx,%rax)
movq %r12, %rdi
callq 0x125c0
cmpb $0x0, 0xc(%rsp)
jne 0x3b5c0
leaq 0x48194(%rip), %rax     # 0x83731
cmpb $0x1, (%rax)
je 0x3b5f7
leaq 0x4819a(%rip), %rax     # 0x83743
cmpb $0x1, (%rax)
jne 0x3b5c0
movq %r13, %rdi
xorl %esi, %esi
jmp 0x3b5ff
movq %r12, %rdi
callq 0x125c0
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x147ae
movq (%r14), %r14
jmp 0x3b4a0
movq %r14, %rdi
callq 0x3fb29
jmp 0x3b55c
movq %r13, %rdi
movl $0xa5, %esi
movq %r14, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12380