// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/arena.c
// Function: arena_bin_nonfull_run_get
static arena_run_t *
arena_bin_nonfull_run_get(arena_t *arena, arena_bin_t *bin)
{
	arena_run_t *run;
	size_t binind;
	arena_bin_info_t *bin_info;

	/* Look for a usable run. */
	run = arena_bin_nonfull_run_tryget(bin);
	if (run != NULL)
		return (run);
	/* No existing runs have any space available. */

	binind = arena_bin_index(arena, bin);
	bin_info = &arena_bin_info[binind];

	/* Allocate a new run. */
	malloc_mutex_unlock(&bin->lock);
	/******************************/
	malloc_mutex_lock(&arena->lock);
	run = arena_run_alloc(arena, bin_info->run_size, false, binind, false);
	if (run != NULL) {
		bitmap_t *bitmap = (bitmap_t *)((uintptr_t)run +
		    (uintptr_t)bin_info->bitmap_offset);

		/* Initialize run internals. */
		VALGRIND_MAKE_MEM_UNDEFINED(run, bin_info->reg0_offset -
		    bin_info->redzone_size);
		run->bin = bin;
		run->nextind = 0;
		run->nfree = bin_info->nregs;
		bitmap_init(bitmap, &bin_info->bitmap_info);
	}
	malloc_mutex_unlock(&arena->lock);
	/********************************/
	malloc_mutex_lock(&bin->lock);
	if (run != NULL) {
		if (config_stats) {
			bin->stats.nruns++;
			bin->stats.curruns++;
		}
		return (run);
	}

	/*
	 * arena_run_alloc() failed, but another thread may have made
	 * sufficient memory available while this one dropped bin->lock above,
	 * so search one more time.
	 */
	run = arena_bin_nonfull_run_tryget(bin);
	if (run != NULL)
		return (run);

	return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xbd060
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xbcec4
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xbd04a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xba070
movq %rax, -0x28(%rbp)
leaq 0x6b674(%rip), %rax     # 0x128550
imulq $0x68, -0x28(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0xb5ee0
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0xb5d20
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x28(%rbp), %rcx
xorl %r8d, %r8d
movl %r8d, %edx
callq 0xb6800
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xbcfd1
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x24(%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq $0x4d430001, -0x70(%rbp) # imm = 0x4D430001
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movl 0x64(%rax), %eax
movq -0x30(%rbp), %rcx
subq 0x8(%rcx), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
leaq -0x70(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
rolq $0x3, %rdi
rolq $0xd, %rdi
rolq $0x3d, %rdi
rolq $0x33, %rdi
xchgq %rbx, %rbx
movq %rdx, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x30(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x28, %rsi
callq 0xc0130
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0xb5ee0
movq -0x18(%rbp), %rdi
callq 0xb5d20
cmpq $0x0, -0x20(%rbp)
je 0xbd024
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x80(%rax)
movq -0x18(%rbp), %rax
movq 0x90(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x90(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xbd04a
movq -0x18(%rbp), %rdi
callq 0xbd060
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xbd042
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xbd04a
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)