LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue_mt.c
// Function: as_queue_mt_init
bool
as_queue_mt_init(as_queue_mt* queue, uint32_t item_size, uint32_t capacity)
{
	if (! as_queue_init(&queue->queue, item_size, capacity)) {
		return false;
	}

	if (pthread_mutex_init(&queue->lock, NULL) != 0) {
		as_queue_destroy(&queue->queue);
		return false;
	}

	if (pthread_cond_init(&queue->cond, NULL) != 0) {
		pthread_mutex_destroy(&queue->lock);
		as_queue_destroy(&queue->queue);
		return false;
	}
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x8a30
testb %al, %al
je 0xe3b9
leaq 0x20(%rbx), %r14
xorl %esi, %esi
movq %r14, %rdi
callq 0x8b60
testl %eax, %eax
jne 0xe3b1
leaq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x8660
testl %eax, %eax
je 0xe3c3
movq %r14, %rdi
callq 0x8300
movq %rbx, %rdi
callq 0x81f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movb $0x1, %al
jmp 0xe3bb
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue_mt.c
// Function: as_queue_mt_create
as_queue_mt*
as_queue_mt_create(uint32_t item_size, uint32_t capacity)
{
	as_queue_mt* queue = cf_malloc(sizeof(as_queue_mt));

	if (! queue) {
		return NULL;
	}

	if (! as_queue_mt_init(queue, item_size, capacity)) {
		cf_free(queue);
		return NULL;
	}
	queue->queue.flags = ITEMS_ON_HEAP | ALL_ON_HEAP;
	return queue;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %r14d
pushq $0x78
popq %rdi
callq 0x8080
testq %rax, %rax
je 0xe402
movq %rax, %rdi
movl %r14d, %esi
movl %ebp, %edx
movq %rax, %rbx
callq 0x80c0
testb %al, %al
je 0xe3fa
movl $0x3, 0x1c(%rbx)
jmp 0xe404
movq %rbx, %rdi
callq 0x8a00
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue_mt.c
// Function: as_queue_mt_pop
bool
as_queue_mt_pop(as_queue_mt* queue, void* ptr, int wait_ms)
{
	pthread_mutex_lock(&queue->lock);
	as_queue_mt_wait(queue, wait_ms);
	bool status = as_queue_pop(&queue->queue, ptr);
	pthread_mutex_unlock(&queue->lock);
	return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x20(%rdi), %rbx
movq %rdi, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rbx, %rdi
callq 0x8ba0
movq %r14, %rdi
movl %ebp, %esi
callq 0xe48e
movl 0xc(%r14), %ebp
movl 0x10(%r14), %r12d
cmpl %ebp, %r12d
je 0xe474
movl %ebp, %eax
xorl %edx, %edx
movq %r15, %rdi
divl 0x8(%r14)
movl 0x14(%r14), %eax
imull %eax, %edx
addq (%r14), %rdx
movq %rdx, %rsi
movq %rax, %rdx
callq 0x8630
movl 0xc(%r14), %eax
incl %eax
movl %eax, 0xc(%r14)
cmpl 0x10(%r14), %eax
jne 0xe474
andq $0x0, 0xc(%r14)
cmpl %ebp, %r12d
movq %rbx, %rdi
setne %bpl
callq 0x86b0
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue_mt.c
// Function: as_queue_mt_wait
static void
as_queue_mt_wait(as_queue_mt* queue, int wait_ms)
{
	// as_queue_empty() is checked in as_queue_pop(), so no need
	// to check here on AS_QUEUE_NOWAIT.
	if (wait_ms == AS_QUEUE_NOWAIT || ! as_queue_empty(&queue->queue)) {
		return;
	}

	if (wait_ms == AS_QUEUE_FOREVER) {
		// Note that we have to use a while() loop. The pthread_cond_signal()
		// documentation says that AT LEAST ONE waiting thread will be awakened.
		// If more than one are awakened, the first will get the popped element,
		// others will find the queue empty and go back to waiting.
		do {
			pthread_cond_wait(&queue->cond, &queue->lock);
		} while (as_queue_empty(&queue->queue));

		return;
	}

	struct timespec tp;
	cf_set_wait_timespec(wait_ms, &tp);
	pthread_cond_timedwait(&queue->cond, &queue->lock, &tp);
}

// Assembly:
testl %esi, %esi
je 0xe541
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl 0x10(%rdi), %eax
movq %rdi, %rbx
cmpl 0xc(%rdi), %eax
jne 0xe537
movl %esi, %ebp
cmpl $-0x1, %esi
je 0xe51c
leaq 0x8(%rsp), %r14
xorl %edi, %edi
movq %r14, %rsi
callq 0x81e0
movl %ebp, %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
cltq
imull $0xf4240, %edx, %ecx    # imm = 0xF4240
addq (%r14), %rax
movslq %ecx, %rcx
movq %rax, (%r14)
addq 0x8(%r14), %rcx
cmpq $0x3b9aca01, %rcx       # imm = 0x3B9ACA01
movq %rcx, 0x8(%r14)
jl 0xe505
addq $-0x3b9aca00, %rcx      # imm = 0xC4653600
incq %rax
movq %rcx, 0x10(%rsp)
movq %rax, 0x8(%rsp)
leaq 0x48(%rbx), %rdi
addq $0x20, %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x8970
jmp 0xe537
leaq 0x48(%rbx), %r14
leaq 0x20(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x8210
movl 0x10(%rbx), %eax
cmpl 0xc(%rbx), %eax
je 0xe524
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue_mt.c
// Function: as_queue_mt_pop_tail
bool
as_queue_mt_pop_tail(as_queue_mt* queue, void* ptr, int wait_ms)
{
	pthread_mutex_lock(&queue->lock);
	as_queue_mt_wait(queue, wait_ms);
	bool status = as_queue_pop_tail(&queue->queue, ptr);
	pthread_mutex_unlock(&queue->lock);
	return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x20(%rdi), %rbx
movq %rdi, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rbx, %rdi
callq 0x8ba0
movq %r14, %rdi
movl %ebp, %esi
callq 0xe48e
movl 0xc(%r14), %ebp
movl 0x10(%r14), %r12d
cmpl %ebp, %r12d
je 0xe5ab
leal -0x1(%r12), %eax
xorl %edx, %edx
movq %r15, %rdi
movl %eax, 0x10(%r14)
divl 0x8(%r14)
movl 0x14(%r14), %eax
imull %eax, %edx
addq (%r14), %rdx
movq %rdx, %rsi
movq %rax, %rdx
callq 0x8630
movl 0xc(%r14), %eax
cmpl 0x10(%r14), %eax
jne 0xe5ab
andq $0x0, 0xc(%r14)
cmpl %ebp, %r12d
movq %rbx, %rdi
setne %bpl
callq 0x86b0
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_random.c
// Function: as_random_instance
as_random*
as_random_instance(void)
{
	as_random* random = &as_rand;

	if (!random->initialized) {
		as_random_init(random);
	}
	return random;
}

// Assembly:
pushq %rbx
leaq 0xf97c(%rip), %rdi      # 0x1df68
callq 0x84f0
cmpb $0x0, 0x10(%rax)
movq %rax, %rbx
jne 0xe605
movq %rbx, %rdi
callq 0x8550
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_random.c
// Function: as_random_next_bytes
void
as_random_next_bytes(as_random* random, uint8_t* bytes, uint32_t len)
{
	uint8_t* p = bytes;
	uint8_t* end = bytes + len;
	
	while (p + sizeof(uint64_t) <= end) {
		// Append full 8 bytes
		*(uint64_t*)p = as_random_next_uint64(random);
		p += sizeof(uint64_t);
	}

	if (p < end) {
		// Append partial bytes.
		uint8_t tmp[sizeof(uint64_t)];
		uint8_t* t = tmp;
		*(uint64_t*)t = as_random_next_uint64(random);
		
		while (p < end) {
			*p++ = *t++;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
addq %rsi, %r15
leaq 0x8(%rbx), %r12
cmpq %r15, %r12
ja 0xe637
movq %r14, %rdi
callq 0xe669
movq %rax, (%rbx)
movq %r12, %rbx
jmp 0xe61e
cmpq %r15, %rbx
jae 0xe65d
movq %r14, %rdi
callq 0xe669
movq %rax, (%rsp)
xorl %eax, %eax
leaq (%rbx,%rax), %rcx
cmpq %r15, %rcx
jae 0xe65d
movb (%rsp,%rax), %dl
incq %rax
movb %dl, (%rcx)
jmp 0xe64a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/include/aerospike/as_random.h
// Function: as_random_next_uint64
static inline uint64_t
as_random_next_uint64(as_random* random)
{
	// Use xorshift128+ algorithm.
	uint64_t s1 = random->seed0;
	const uint64_t s0 = random->seed1;
	random->seed0 = s0;
	s1 ^= s1 << 23;
	random->seed1 = (s1 ^ s0 ^ (s1 >> 18) ^ (s0 >> 5));
	return random->seed1 + s0;
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
movq %rcx, %rax
movq %rdx, %rsi
movq %rdx, (%rdi)
shlq $0x17, %rax
shrq $0x5, %rsi
xorq %rcx, %rax
xorq %rdx, %rsi
xorq %rax, %rsi
shrq $0x12, %rax
xorq %rsi, %rax
movq %rax, 0x8(%rdi)
addq %rdx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_random.c
// Function: as_random_next_str
void
as_random_next_str(as_random* random, char* str, uint32_t len)
{
	uint8_t* p = (uint8_t*)str;
	as_random_next_bytes(random, p, len);
	
	for (uint32_t i = 0; i < len; i++) {
		p[i] = alphanum[p[i] % alphanum_len];
	}
	p[len] = 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
callq 0x8570
movl %ebp, %ecx
movb $0x3e, %dl
leaq 0x6cff(%rip), %rsi      # 0x153b0
movq %rbx, %rdi
movq %rcx, %r8
subq $0x1, %r8
jb 0xe6cf
movzbl (%rdi), %eax
divb %dl
movzbl %ah, %eax
movb (%rax,%rsi), %al
movb %al, (%rdi)
incq %rdi
jmp 0xe6b7
movb $0x0, (%rbx,%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_rec.c
// Function: as_rec_cons
as_rec * as_rec_cons(as_rec * rec, bool free, void * data, const as_rec_hooks * hooks)
{
	if ( !rec ) return rec;

	as_val_init((as_val *) rec, AS_REC, free);
	rec->data = data;
	rec->hooks = hooks;
	return rec;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
je 0xe6fa
movb $0x7, 0x4(%rax)
movb %sil, 0x5(%rax)
movl $0x1, (%rax)
movq %rdx, 0x8(%rax)
movq %rcx, 0x10(%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_result_new
as_result * as_result_new(void) {
    as_result * r = (as_result *) cf_malloc(sizeof(as_result));
    if (!r) return r;
    r->is_malloc = true;
    r->count = 1;
    r->is_success = false;
    r->value = NULL;
    return r;
}

// Assembly:
pushq %rax
pushq $0x10
popq %rdi
callq 0x8080
testq %rax, %rax
je 0xe7cb
movw $0x1, 0xc(%rax)
movl $0x1, 0x8(%rax)
andq $0x0, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_result_destroy
void as_result_destroy(as_result *r) {
    // if we reach the last reference, call the destructor, and free
	if (as_aaf_uint32(&r->count, -1) == 0) {
        if (r->value) {
            as_val_destroy(r->value); 
            r->value = NULL;
        }
        if (r->is_malloc) {
            cf_free(r);
        }
    }
    return;
}

// Assembly:
pushq %rbx
lock
decl 0x8(%rdi)
jne 0xe7ff
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xe7f0
callq 0x84e0
andq $0x0, (%rbx)
cmpb $0x1, 0xc(%rbx)
jne 0xe7ff
movq %rbx, %rdi
popq %rbx
jmp 0x8a00
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_success_new
as_result * as_success_new(as_val * v) {
    as_result *r = as_result_new();
    r->is_success = true;
    r->value = v;
    return(r);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x8670
movb $0x1, 0xd(%rax)
movq %rbx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_failure_new
as_result * as_failure_new(as_val * v) {
    as_result *r = as_result_new();
    r->is_success = false;
    r->value = v;
    return(r);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x8670
movb $0x0, 0xd(%rax)
movq %rbx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_failure_init
as_result * as_failure_init(as_result *r, as_val *v) {
    as_result_init(r);
    r->is_success = false;
    r->value = v;
    return(r);
}

// Assembly:
andw $0x0, 0xc(%rdi)
movq %rdi, %rax
movl $0x1, 0x8(%rdi)
movq %rsi, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_result_setsuccess
as_result * as_result_setsuccess(as_result * r, as_val * v) {
    if (r->value) as_val_destroy(r->value);
    r->value = v;
    r->is_success = true;
    return(r);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movq %rsi, %r14
testq %rdi, %rdi
je 0xe867
callq 0x84e0
movq %r14, (%rbx)
movb $0x1, 0xd(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_result_setfailure
as_result * as_result_setfailure(as_result * r, as_val * v) {
    if (r->value) as_val_destroy(r->value);
    r->value = v;
    r->is_success = false;
    return(r);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movq %rsi, %r14
testq %rdi, %rdi
je 0xe890
callq 0x84e0
movq %r14, (%rbx)
movb $0x0, 0xd(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_string.c
// Function: as_string_val_hashcode
uint32_t as_string_val_hashcode(const as_val * v)
{
	as_string * string = as_string_fromval(v);
	if ( string == NULL || string->value == NULL) return 0;
	uint32_t hash = 0;
	int c;
	char * str = string->value;
	while ( (c = *str++) ) {
		hash = c + (hash << 6) + (hash << 16) - hash;
	}
	return hash;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0xeb93
cmpb $0x4, 0x4(%rdi)
jne 0xeb93
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0xeb93
xorl %eax, %eax
movsbl (%rcx), %edx
testl %edx, %edx
je 0xeb93
imull $0x1003f, %eax, %eax    # imm = 0x1003F
incq %rcx
addl %edx, %eax
jmp 0xeb7f
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_string.c
// Function: as_string_val_tostring
char * as_string_val_tostring(const as_val * v)
{
	as_string * s = (as_string *) v;
	if (s->value == NULL) return(NULL);
	size_t sl = as_string_len(s);
	size_t st = 3 + sl;
	char * str = (char *) cf_malloc(sizeof(char) * st);
	if (!str) return str;
	*(str + 0) = '\"';
	strcpy(str + 1, s->value);
	*(str + 1 + sl) = '\"';
	*(str + 1 + sl + 1) = '\0';
	return str;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x0, 0x10(%rdi)
je 0xebd8
movq %rdi, %r14
callq 0x8320
leaq 0x3(%rax), %rdi
movq %rax, %r15
callq 0x8080
testq %rax, %rax
je 0xebd8
movb $0x22, (%rax)
movq %rax, %rdi
movq %rax, %rbx
movq 0x10(%r14), %rsi
incq %rdi
callq 0x8190
movw $0x22, 0x1(%rbx,%r15)
jmp 0xebda
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_string.c
// Function: as_strncpy
bool
as_strncpy(char* trg, const char* src, int size)
{
	if (src) {
		int max = size - 1;
		int i = 0;
		
		while (*src) {
			if (i >= max) {
				*trg = 0;
				return true;
			}
			*trg++ = *src++;
			i++;
		}
	}
	*trg = 0;
	return false;
}

// Assembly:
xorl %eax, %eax
testq %rsi, %rsi
je 0xec12
decl %edx
testl %edx, %edx
cmovgl %edx, %eax
movl %eax, %ecx
movb (%rsi), %dl
addl $-0x1, %ecx
setb %r8b
testb %dl, %dl
setne %al
je 0xec12
testb %r8b, %r8b
je 0xec12
movb %dl, (%rdi)
incq %rsi
incq %rdi
jmp 0xebf3
movb $0x0, (%rdi)
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_string_builder_init
void
as_string_builder_init(as_string_builder* sb, uint32_t capacity, bool resize)
{
	sb->data = (char*)cf_malloc(capacity);
	sb->data[0] = 0;
	sb->capacity = capacity;
	sb->length = 0;
	sb->resize = resize;
	sb->free = true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl %esi, %edi
movl %edx, %ebx
movl %esi, %ebp
callq 0x8080
movq %rax, (%r14)
movb $0x0, (%rax)
movl %ebp, 0x8(%r14)
andl $0x0, 0xc(%r14)
movb %bl, 0x10(%r14)
movb $0x1, 0x11(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_sb_expand
static bool
as_sb_expand(as_string_builder* sb, const char* src)
{
	uint32_t remaining_len = (uint32_t)strlen(src);
	uint32_t min_capacity = sb->length + remaining_len + 1;

	if (! as_sb_increase_capacity(sb, min_capacity)) {
		return false;
	}

	memcpy(&sb->data[sb->length], src, remaining_len);
	sb->length += remaining_len;
	sb->data[sb->length] = 0;
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
movq %rsi, %r15
callq 0x8270
movq %rax, %r14
movl 0xc(%rbx), %eax
movq %rbx, %rdi
leal 0x1(%r14,%rax), %esi
callq 0xee71
movl %eax, %ebp
testb %al, %al
je 0xece8
movl 0xc(%rbx), %edi
movl %r14d, %edx
movq %r15, %rsi
addq (%rbx), %rdi
callq 0x8630
movl 0xc(%rbx), %eax
addl %r14d, %eax
movl %eax, 0xc(%rbx)
movq (%rbx), %rcx
movb $0x0, (%rcx,%rax)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_string_builder_append_char
bool
as_string_builder_append_char(as_string_builder* sb, char value)
{
	if (sb->length + 1 < sb->capacity) {
		sb->data[sb->length++] = value;
		sb->data[sb->length] = 0;
		return true;
	}
	
	if (sb->resize) {
		char buf[] = {value, '\0'};
		return as_sb_expand(sb, buf);
	}
	return false;
}

// Assembly:
movl 0xc(%rdi), %eax
leal 0x1(%rax), %ecx
cmpl 0x8(%rdi), %ecx
jae 0xed17
movq (%rdi), %rdx
movl %ecx, 0xc(%rdi)
movb %sil, (%rdx,%rax)
movq (%rdi), %rax
movl 0xc(%rdi), %ecx
movb $0x0, (%rax,%rcx)
movb $0x1, %al
retq
cmpb $0x1, 0x10(%rdi)
jne 0xed37
pushq %rax
leaq 0x6(%rsp), %rax
movb %sil, (%rax)
movq %rax, %rsi
movb $0x0, 0x1(%rax)
callq 0xec99
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_string_builder_append_bytes
bool
as_string_builder_append_bytes(as_string_builder* sb, uint8_t* src, uint32_t size)
{
	if (sb->resize) {
		// Ensure buffer is large enough to receive bytes.
		// min capacity = old length + 3 chars per byte including separator + 2 bracket chars
		// - 1 extra separator + 1 null byte.
		uint32_t min_capacity = sb->length + (size * 3) + 2;

		if (min_capacity > sb->capacity) {
			if (! as_sb_increase_capacity(sb, min_capacity)) {
				return false;
			}
		}

		char* trg = &sb->data[sb->length];
		*trg++ = '[';

		for (uint32_t i = 0; i < size; i++) {
			uint8_t b = src[i];
			*trg++ = as_hex_chars[(b >> 4) & 0xf];
			*trg++ = as_hex_chars[b & 0xf];
			*trg++ = ' ';
		}
		trg--; // truncate last separator
		*trg++ = ']';
		*trg = 0;
		sb->length = (int)(trg - sb->data);
	}
	else {
		if (! as_sb_append_char(sb, '[')) {
			return false;
		}

		for (uint32_t i = 0; i < size; i++) {
			if (! as_sb_append_byte(sb, src[i])) {
				return false;
			}
		}
		sb->length--; // truncate last separator

		if (! as_sb_append_char(sb, ']')) {
			return false;
		}
	}
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpb $0x1, 0x10(%rdi)
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
jne 0xedc4
movl 0xc(%rbx), %edi
leal (%r15,%r15,2), %eax
leal 0x2(%rdi,%rax), %esi
cmpl 0x8(%rbx), %esi
jbe 0xed71
movq %rbx, %rdi
callq 0xee71
testb %al, %al
je 0xee69
movl 0xc(%rbx), %edi
movq (%rbx), %rax
movq 0xf255(%rip), %rsi      # 0x1dfd0
movl %edi, %ecx
movl %r15d, %edx
leaq 0x3(%rax,%rcx), %rcx
addl %edi, %eax
notl %eax
movb $0x5b, -0x3(%rcx)
subq $0x1, %rdx
jb 0xee44
movzbl (%r14), %edi
incq %r14
addl $-0x3, %eax
movl %edi, %r8d
andl $0xf, %edi
shrl $0x4, %r8d
movb (%rsi,%r8), %r8b
movb %r8b, -0x2(%rcx)
movb (%rsi,%rdi), %dil
movb %dil, -0x1(%rcx)
movb $0x20, (%rcx)
addq $0x3, %rcx
jmp 0xed8d
pushq $0x5b
popq %rsi
movq %rbx, %rdi
callq 0xeed9
testb %al, %al
je 0xee69
movq 0xf1f2(%rip), %rcx      # 0x1dfd0
movl %r15d, %eax
movl 0xc(%rbx), %edx
subq $0x1, %rax
jb 0xee55
leal 0x3(%rdx), %esi
cmpl 0x8(%rbx), %esi
jae 0xee69
movzbl (%r14), %esi
movq (%rbx), %r8
leal 0x1(%rdx), %r9d
incq %r14
movl %esi, %edi
andl $0xf, %esi
shrl $0x4, %edi
movb (%rcx,%rdi), %dil
movl %r9d, 0xc(%rbx)
movb %dil, (%r8,%rdx)
movl 0xc(%rbx), %edi
movb (%rcx,%rsi), %dl
movq (%rbx), %rsi
leal 0x1(%rdi), %r8d
movl %r8d, 0xc(%rbx)
movb %dl, (%rsi,%rdi)
movl 0xc(%rbx), %esi
movq (%rbx), %rdx
leal 0x1(%rsi), %edi
movl %edi, 0xc(%rbx)
movb $0x20, (%rdx,%rsi)
movq (%rbx), %rdx
movl 0xc(%rbx), %esi
movb $0x0, (%rdx,%rsi)
jmp 0xede1
movw $0x5d, -0x3(%rcx)
addl (%rbx), %eax
negl %eax
movl %eax, 0xc(%rbx)
movb $0x1, %al
jmp 0xee6b
decl %edx
movl %edx, 0xc(%rbx)
pushq $0x5d
popq %rsi
movq %rbx, %rdi
callq 0xeed9
testb %al, %al
jne 0xee51
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_sb_increase_capacity
static bool
as_sb_increase_capacity(as_string_builder* sb, uint32_t min_capacity)
{
	uint32_t capacity = sb->capacity * 2;

	if (capacity < min_capacity) {
		capacity = min_capacity;
	}

	if (sb->free) {
		// String already allocated on heap.  Realloc.
		char* data = cf_realloc(sb->data, capacity);
		
		if (data) {
			sb->data = data;
			sb->capacity = capacity;
			return true;
		}
	}
	else {
		// String allocated on stack.  Transfer to heap.
		char* data = cf_malloc(capacity);
		
		if (data) {
			memcpy(data, sb->data, sb->length);
			data[sb->length] = 0;
			sb->data = data;
			sb->capacity = capacity;
			sb->free = true;
			return true;
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x8(%rdi), %ebp
movq %rdi, %rbx
addl %ebp, %ebp
cmpl %esi, %ebp
cmovbel %esi, %ebp
cmpb $0x1, 0x11(%rdi)
jne 0xee9f
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x8540
testq %rax, %rax
je 0xeed2
movq %rax, (%rbx)
movl %ebp, 0x8(%rbx)
jmp 0xeece
movl %ebp, %edi
callq 0x8080
testq %rax, %rax
je 0xeed2
movq (%rbx), %rsi
movl 0xc(%rbx), %edx
movq %rax, %rdi
movq %rax, %r14
callq 0x8630
movl 0xc(%rbx), %eax
movb $0x0, (%r14,%rax)
movq %r14, (%rbx)
movl %ebp, 0x8(%rbx)
movb $0x1, 0x11(%rbx)
movb $0x1, %al
jmp 0xeed4
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_sb_append_char
static inline bool
as_sb_append_char(as_string_builder* sb, char value)
{
	if (sb->length + 1 < sb->capacity) {
		sb->data[sb->length++] = value;
		sb->data[sb->length] = 0;
		return true;
	}
	return false;
}

// Assembly:
movl 0xc(%rdi), %edx
movl 0x8(%rdi), %eax
leal 0x1(%rdx), %ecx
cmpl %eax, %ecx
jae 0xeefa
movq (%rdi), %r8
movl %ecx, 0xc(%rdi)
movb %sil, (%r8,%rdx)
movq (%rdi), %rdx
movl 0xc(%rdi), %esi
movb $0x0, (%rdx,%rsi)
cmpl %eax, %ecx
setb %al
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_thread_pool.c
// Function: as_thread_worker
void*
as_thread_worker(void* data)
{
	as_thread_pool* pool = data;

	as_thread_set_name("tpool");

	// Run variable tasks.
	as_thread_pool_task task;

	// Retrieve tasks from queue and execute.
	while (cf_queue_pop(pool->dispatch_queue, &task, CF_QUEUE_FOREVER) == CF_QUEUE_OK) {
		// A null task indicates thread should be shut down.
		if (! task.task_fn) {
			break;
		}

		// Run task
		task.task_fn(task.task_data);
	}

	// Run the finalization function, if present.
	if (pool->fini_fn) {
		pool->fini_fn();
	}
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x8940
leaq 0x6412(%rip), %rsi      # 0x15405
movq %rax, %rdi
callq 0x82e0
movq %rsp, %r14
pushq $-0x1
popq %rbp
movq 0x8(%rbx), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8860
testl %eax, %eax
jne 0xf025
movq (%rsp), %rax
testq %rax, %rax
je 0xf025
movq 0x8(%rsp), %rdi
callq *%rax
jmp 0xf001
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0xf030
callq *%rax
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_thread_pool.c
// Function: as_thread_pool_init
int
as_thread_pool_init(as_thread_pool* pool, uint32_t thread_size)
{
	if (thread_size != 0) {
		pool->threads = cf_calloc(thread_size, sizeof(pthread_t));
		pool->dispatch_queue = cf_queue_create(sizeof(as_thread_pool_task), true);
	}
	else {
		pool->threads = NULL;
		pool->dispatch_queue = NULL;
	}
	pool->fini_fn = NULL;
	pool->thread_size = 0;

	// Start threads.
	for (uint32_t i = 0; i < thread_size; i++) {
		if (pthread_create(&pool->threads[i], NULL, as_thread_worker, pool) == 0) {
			pool->thread_size++;
		}
	}
	return (pool->thread_size == thread_size)? 0 : -3;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
testl %esi, %esi
je 0xf06b
movl %ebx, %r15d
pushq $0x8
popq %rsi
movq %r15, %rdi
callq 0x8960
movq %rax, (%r14)
pushq $0x10
popq %rdi
pushq $0x1
popq %rsi
callq 0x8810
jmp 0xf074
andq $0x0, (%r14)
xorl %r15d, %r15d
xorl %eax, %eax
movq 0xef5d(%rip), %r12      # 0x1dfd8
movq %rax, 0x8(%r14)
andq $0x0, 0x10(%r14)
andl $0x0, 0x18(%r14)
shlq $0x3, %r15
xorl %r13d, %r13d
cmpq %r13, %r15
je 0xf0b6
movq (%r14), %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r14, %rcx
addq %r13, %rdi
callq 0x88d0
testl %eax, %eax
jne 0xf0b0
incl 0x18(%r14)
addq $0x8, %r13
jmp 0xf090
xorl %eax, %eax
cmpl %ebx, 0x18(%r14)
sete %al
leal -0x3(%rax,%rax,2), %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_thread_pool.c
// Function: as_thread_pool_queue_task
int
as_thread_pool_queue_task(as_thread_pool* pool, as_task_fn task_fn, void* task)
{
	if (pool->thread_size == 0) {
		// No threads are running to process task.
		return -1;
	}

	// Queue variable task.
	as_thread_pool_task vtask;
	vtask.task_fn = task_fn;
	vtask.task_data = task;

	if (cf_queue_push(pool->dispatch_queue, &vtask) != CF_QUEUE_OK) {
		return -2;
	}
	return 0;
}

// Assembly:
cmpl $0x0, 0x18(%rdi)
je 0xf0ff
subq $0x18, %rsp
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movq %rdx, 0x8(%rax)
movq %rax, %rsi
movq 0x8(%rdi), %rdi
callq 0x8280
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leal -0x2(%rcx,%rcx), %eax
addq $0x18, %rsp
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_thread_pool.c
// Function: as_thread_pool_destroy
int
as_thread_pool_destroy(as_thread_pool* pool)
{
	// Prevent double destroy.
	uint32_t thread_size = as_fas_uint32(&pool->thread_size, 0);

	if (thread_size == 0) {
		return 0;
	}

	// Tells worker threads to stop by setting NULL task_fn. We do this to allow the
	// workers to "wait forever" on processing the work dispatch queue, which has
	// minimum impact when the queue is empty. This also means all queued requests
	// get processed before shutting down.
	as_thread_pool_task task;
	task.task_fn = NULL;
	task.task_data = NULL;

	// Send shutdown signal for variable tasks.
	for (uint32_t i = 0; i < thread_size; i++) {
		cf_queue_push(pool->dispatch_queue, &task);
	}

	// Wait till threads finish.
	for (uint32_t i = 0; i < thread_size; i++) {
		pthread_join(pool->threads[i], NULL);
	}

	cf_free(pool->threads);
	cf_queue_destroy(pool->dispatch_queue);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
xorl %ebp, %ebp
xchgl %ebp, 0x18(%rdi)
testl %ebp, %ebp
je 0xf166
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r14
movl %ebp, %r15d
movaps %xmm0, (%r14)
subl $0x1, %r15d
jb 0xf13a
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x8280
jmp 0xf126
movl %ebp, %r14d
xorl %r15d, %r15d
movq (%rbx), %rdi
cmpq %r15, %r14
je 0xf158
movq (%rdi,%r15,8), %rdi
xorl %esi, %esi
callq 0x8b00
incq %r15
jmp 0xf140
callq 0x8a00
movq 0x8(%rbx), %rdi
callq 0x8380
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_timer.c
// Function: as_timer_init
as_timer * as_timer_init(as_timer * timer, void * source, const as_timer_hooks * hooks) {
    if ( timer == NULL ) return timer;
    timer->source = source;
    timer->hooks = hooks;
    return timer;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
je 0xf184
movq %rsi, 0x8(%rax)
movq %rdx, 0x10(%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_timer.c
// Function: as_timer_new
as_timer * as_timer_new(void * source, const as_timer_hooks * hooks) {
    as_timer * timer = (as_timer *) cf_malloc(sizeof(as_timer));
    if (!timer) return timer;
    timer->source = source;
    timer->hooks = hooks;
    return timer;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x8080
testq %rax, %rax
je 0xf1a4
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_timer.c
// Function: as_timer_destroy
int as_timer_destroy(as_timer * timer) {
    int rc = as_util_hook(destroy, 1, timer);
    if ( rc == 0 && timer->is_malloc ) {
        cf_free(timer);
    }
    return rc;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
pushq $0x1
popq %rbx
testq %rdi, %rdi
je 0xf1e7
movq 0x10(%rdi), %rax
movq %rdi, %r14
testq %rax, %rax
je 0xf1e7
movq (%rax), %rax
testq %rax, %rax
je 0xf1e7
movq %r14, %rdi
callq *%rax
movl %eax, %ebx
testl %eax, %eax
jne 0xf1e7
xorl %ebx, %ebx
cmpb $0x1, (%r14)
jne 0xf1e7
movq %r14, %rdi
callq 0x8a00
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_val.c
// Function: as_val_val_destroy
as_val * as_val_val_destroy(as_val * v)
{
	if (v == NULL || !v->count) {
		return v;
	}

	// if we reach the last reference, call the destructor, and free
	if (as_aaf_uint32_rls(&v->count, -1) == 0) {
		// Subsequent destructor may require an 'acquire' barrier.
		as_fence_acq();

		as_val_destroy_callbacks[v->type](v);

		if (v->free) {
			cf_free(v);
		}
		v = NULL;
	}
	return v;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0xf274
cmpl $0x0, (%rdi)
movq %rdi, %rbx
je 0xf276
lock
decl (%rbx)
jne 0xf276
movzbl 0x4(%rbx), %eax
leaq 0xe9c0(%rip), %rcx      # 0x1dc20
movq %rbx, %rdi
callq *(%rcx,%rax,8)
cmpb $0x1, 0x5(%rbx)
jne 0xf274
movq %rbx, %rdi
callq 0x8a00
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_val.c
// Function: as_val_tobool
bool as_val_tobool(const as_val* v)
{
	if (!v) {
		return false;
	}

	if (v->type == AS_BOOLEAN) {
		return ((as_boolean*)v)->value;
	}

	if (v->type == AS_INTEGER) {
		return ((as_integer*)v)->value;
	}
	return false;
}

// Assembly:
testq %rdi, %rdi
je 0xf2be
movzbl 0x4(%rdi), %eax
cmpl $0x3, %eax
je 0xf2c1
cmpl $0x2, %eax
jne 0xf2be
movb 0x8(%rdi), %al
retq
xorl %eax, %eax
retq
cmpq $0x0, 0x8(%rdi)
setne %al
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_init
void
as_vector_init(as_vector* vector, uint32_t item_size, uint32_t capacity)
{
	vector->list = cf_malloc(capacity * item_size);
	vector->capacity = capacity;
	vector->item_size = item_size;
	vector->size = 0;
	vector->flags = 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl %edx, %edi
movl %edx, %ebx
movl %esi, %ebp
imull %esi, %edi
callq 0x8080
movq %rax, (%r14)
movl %ebx, 0x8(%r14)
movl %ebp, 0x10(%r14)
andl $0x0, 0xc(%r14)
movl $0x1, 0x14(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_create
as_vector*
as_vector_create(uint32_t item_size, uint32_t capacity)
{
	as_vector* vector = cf_malloc(sizeof(as_vector));
	as_vector_init(vector, item_size, capacity);
	vector->flags = FLAGS_HEAP | FLAGS_CREATED;
	return vector;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
pushq $0x18
popq %rdi
callq 0x8080
movq %rax, %rdi
movl %ebp, %esi
movl %ebx, %edx
movq %rax, %r14
callq 0x8620
movl $0x3, 0x14(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_destroy
void
as_vector_destroy(as_vector* vector)
{
	if (vector->flags & FLAGS_HEAP) {
		cf_free(vector->list);
		
		if (vector->flags & FLAGS_CREATED) {
			cf_free(vector);
		}
	}
}

// Assembly:
pushq %rbx
testb $0x1, 0x14(%rdi)
je 0xf355
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x8a00
testb $0x2, 0x14(%rbx)
jne 0xf357
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x8a00
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_increase_capacity
void
as_vector_increase_capacity(as_vector* vector)
{
	if (vector->flags & FLAGS_HEAP) {
		vector->capacity *= 2;
		vector->list = cf_realloc(vector->list, vector->capacity * vector->item_size);
	}
	else {
		uint32_t capacity = vector->capacity * 2;
		void* tmp = cf_malloc(capacity * vector->item_size);
		memcpy(tmp, vector->list, vector->capacity * vector->item_size);
		vector->list = tmp;
		vector->capacity = capacity;
		vector->flags |= FLAGS_HEAP;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl 0x8(%rdi), %r14d
movq %rdi, %rbx
addl %r14d, %r14d
testb $0x1, 0x14(%rdi)
jne 0xf3a0
movl 0x10(%rbx), %edi
imull %r14d, %edi
callq 0x8080
movl 0x10(%rbx), %edx
movq (%rbx), %rsi
movq %rax, %rdi
movq %rax, %r15
imull 0x8(%rbx), %edx
callq 0x8630
movl %r14d, 0x8(%rbx)
orb $0x1, 0x14(%rbx)
jmp 0xf3b7
movl %r14d, 0x8(%rbx)
imull 0x10(%rbx), %r14d
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x8540
movq %rax, %r15
movq %r15, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_append_unique
bool
as_vector_append_unique(as_vector* vector, void* value)
{
	char* item = vector->list;
	for (uint32_t i = 0; i < vector->size; i++) {
		if (memcmp(item, value, vector->item_size) == 0) {
			return false;
		}
		item += vector->item_size;
	}
	as_vector_append(vector, value);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r15
movl 0xc(%rdi), %ebp
movq %rsi, %r14
movq %rdi, %rbx
xorl %r13d, %r13d
movq %r15, (%rsp)
cmpl %r13d, %ebp
je 0xf401
movl 0x10(%rbx), %r12d
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x8800
testl %eax, %eax
je 0xf42e
addq %r12, %r15
incl %r13d
jmp 0xf3de
cmpl 0x8(%rbx), %ebp
movq (%rsp), %rax
movl %ebp, %edi
jb 0xf41a
movq %rbx, %rdi
callq 0x8030
movl 0xc(%rbx), %edi
movq (%rbx), %rax
movl 0x10(%rbx), %edx
movq %r14, %rsi
imull %edx, %edi
addq %rax, %rdi
callq 0x8630
incl 0xc(%rbx)
cmpl %ebp, %r13d
setae %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_to_array
void*
as_vector_to_array(as_vector* vector, uint32_t* size)
{
	size_t len = vector->size * vector->item_size;
	void* array = cf_malloc(len);
	memcpy(array, vector->list, len);
	*size = vector->size;
	return array;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x10(%rdi), %r15d
movq %rdi, %r14
movq %rsi, %rbx
imull 0xc(%rdi), %r15d
movq %r15, %rdi
callq 0x8080
movq (%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
movq %rax, %r12
callq 0x8630
movl 0xc(%r14), %eax
movl %eax, (%rbx)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_remove
bool
as_vector_remove(as_vector* vector, uint32_t index)
{
	if (index >= vector->size) {
		return false;
	}

	memmove((uint8_t*)vector->list + (index * vector->item_size),
		    (uint8_t*)vector->list + ((index + 1) * vector->item_size),
		    (vector->size - index - 1) * vector->item_size);

	vector->size--;
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0xc(%rdi), %ebp
movl %esi, %ebx
cmpl %esi, %ebp
jbe 0xf4c1
movl 0x10(%rdi), %ecx
movq (%rdi), %rax
movl %ebx, %edx
leal 0x1(%rbx), %esi
movq %rdi, %r14
notl %edx
addl %ebp, %edx
movl %ecx, %edi
imull %ecx, %esi
imull %ecx, %edx
imull %ebx, %edi
addq %rax, %rsi
addq %rax, %rdi
callq 0x88f0
decl 0xc(%r14)
cmpl %ebx, %ebp
seta %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/crypt_blowfish.c
// Function: crypt_output_magic
int _crypt_output_magic(const char *setting, char *output, int size)
{
	if (size < 3)
		return -1;

	output[0] = '*';
	output[1] = '0';
	output[2] = '\0';

	if (setting[0] == '*' && setting[1] == '0')
		output[1] = '1';

	return 0;
}

// Assembly:
cmpl $0x3, %edx
jge 0xf4d5
pushq $-0x1
popq %rax
retq
movw $0x302a, (%rsi)         # imm = 0x302A
movb $0x0, 0x2(%rsi)
xorl %eax, %eax
cmpb $0x2a, (%rdi)
jne 0xf4ef
cmpb $0x30, 0x1(%rdi)
jne 0xf4ef
movb $0x31, 0x1(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/crypt_blowfish.c
// Function: crypt_gensalt_blowfish_rn
char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count,
	const char *input, int size, char *output, int output_size)
{
	if (size < 16 || output_size < 7 + 22 + 1 ||
	    (count && (count < 4 || count > 31)) ||
	    prefix[0] != '$' || prefix[1] != '2' ||
	    (prefix[2] != 'a' && prefix[2] != 'y')) {
		if (output_size > 0) output[0] = '\0';
		__set_errno((output_size < 7 + 22 + 1) ? ERANGE : EINVAL);
		return NULL;
	}

	if (!count) count = 5;

	output[0] = '$';
	output[1] = '2';
	output[2] = prefix[2];
	output[3] = '$';
	output[4] = '0' + (char)(count / 10);
	output[5] = '0' + (char)(count % 10);
	output[6] = '$';

	BF_encode(&output[7], (const BF_word *)input, 16);
	output[7 + 22] = '\0';

	return output;
}

// Assembly:
pushq %rbx
cmpl $0x10, %ecx
movq %r8, %rbx
setl %al
cmpl $0x1e, %r9d
setl %cl
orb %al, %cl
je 0x117d9
testl %r9d, %r9d
jg 0x11853
jmp 0x11856
testq %rsi, %rsi
leaq -0x20(%rsi), %rcx
setne %al
cmpq $-0x1c, %rcx
setb %cl
testb %cl, %al
jne 0x11853
cmpb $0x24, (%rdi)
jne 0x11853
cmpb $0x32, 0x1(%rdi)
jne 0x11853
movzbl 0x2(%rdi), %eax
cmpl $0x61, %eax
je 0x11807
cmpl $0x79, %eax
jne 0x11853
movw $0x3224, (%rbx)         # imm = 0x3224
movb $0x24, %cl
testq %rsi, %rsi
movb 0x2(%rdi), %al
movb %al, 0x2(%rbx)
movb %cl, 0x3(%rbx)
pushq $0x5
popq %rax
cmovnel %esi, %eax
movb $0xa, %sil
leaq 0x7(%rbx), %rdi
movzbl %al, %eax
divb %sil
movzbl %ah, %esi
orb $0x30, %al
orb $0x30, %sil
movb %al, 0x4(%rbx)
movb %sil, 0x5(%rbx)
movb %cl, 0x6(%rbx)
pushq $0x10
popq %rax
movq %rdx, %rsi
movl %eax, %edx
callq 0x11871
movb $0x0, 0x1d(%rbx)
jmp 0x1186c
movb $0x0, (%rbx)
cmpl $0x1e, %r9d
pushq $0x22
popq %rax
pushq $0x16
popq %rbx
cmovll %eax, %ebx
callq 0x8160
movl %ebx, (%rax)
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/crypt_blowfish.c
// Function: BF_encode
static void BF_encode(char *dst, const BF_word *src, int size)
{
	const unsigned char *sptr = (const unsigned char *)src;
	const unsigned char *end = sptr + size;
	unsigned char *dptr = (unsigned char *)dst;
	unsigned int c1, c2;

	do {
		c1 = *sptr++;
		*dptr++ = BF_itoa64[c1 >> 2];
		c1 = (c1 & 0x03) << 4;
		if (sptr >= end) {
			*dptr++ = BF_itoa64[c1];
			break;
		}

		c2 = *sptr++;
		c1 |= c2 >> 4;
		*dptr++ = BF_itoa64[c1];
		c1 = (c2 & 0x0f) << 2;
		if (sptr >= end) {
			*dptr++ = BF_itoa64[c1];
			break;
		}

		c2 = *sptr++;
		c1 |= c2 >> 6;
		*dptr++ = BF_itoa64[c1];
		*dptr++ = BF_itoa64[c2 & 0x3f];
	} while (sptr < end);
}

// Assembly:
movl %edx, %ecx
incq %rdi
leaq 0x4d03(%rip), %rax      # 0x16580
addq %rsi, %rcx
movzbl (%rsi), %r8d
incq %rsi
movl %r8d, %edx
shll $0x4, %r8d
shrl $0x2, %edx
andl $0x30, %r8d
cmpq %rcx, %rsi
movb (%rdx,%rax), %dl
movb %dl, -0x1(%rdi)
jae 0x118ef
movzbl (%rsi), %edx
incq %rsi
movl %edx, %r9d
shll $0x2, %edx
shrl $0x4, %r9d
andl $0x3c, %edx
orq %r8, %r9
cmpq %rcx, %rsi
movb (%r9,%rax), %r8b
movb %r8b, (%rdi)
jae 0x118f4
movzbl (%rsi), %r8d
incq %rsi
movl %r8d, %r9d
andl $0x3f, %r8d
shrl $0x6, %r9d
orq %rdx, %r9
movb (%r9,%rax), %dl
movb %dl, 0x1(%rdi)
movb (%r8,%rax), %dl
movb %dl, 0x2(%rdi)
addq $0x4, %rdi
cmpq %rcx, %rsi
jb 0x11880
retq
movl %r8d, %edx
jmp 0x118f7
incq %rdi
movl %edx, %ecx
movb (%rcx,%rax), %al
movb %al, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/ssl_util.c
// Function: as_apr_array_push
static void * as_apr_array_push(apr_array_header_t * arr)
{
	// If we don't have enough space double up.
	if (arr->nelts == arr->nalloc) {
		if (arr->nalloc == 0) {
			arr->nalloc = 16;
		} else {
			arr->nalloc *= 2;
		}
		size_t newsz = arr->nalloc * arr->elt_size;
		arr->elts = cf_realloc(arr->elts, newsz);
	}

	// Point to the first unused location.
	void * ptr = arr->elts + (arr->nelts * arr->elt_size);

	// We'll have one more element now.
	++arr->nelts;
	
    return ptr;
}

// Assembly:
pushq %rbx
movl 0xc(%rdi), %edx
movq %rdi, %rbx
cmpl 0x10(%rdi), %edx
jne 0x11d18
leal (%rdx,%rdx), %eax
testl %edx, %edx
pushq $0x10
popq %rcx
cmovnel %eax, %ecx
movl %ecx, 0x10(%rbx)
movslq %ecx, %rsi
movslq 0x8(%rbx), %rax
movq 0x18(%rbx), %rdi
imulq %rax, %rsi
callq 0x8540
movq %rax, 0x18(%rbx)
movl 0xc(%rbx), %edx
jmp 0x11d1c
movq 0x18(%rbx), %rax
movslq 0x8(%rbx), %rcx
movslq %edx, %rdx
imulq %rdx, %rcx
incl %edx
addq %rax, %rcx
movl %edx, 0xc(%rbx)
movq %rcx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/ssl_util.c
// Function: asn1_string_to_utf8
static char *asn1_string_to_utf8(apr_pool_t *p, ASN1_STRING *asn1str)
{
    char *result = NULL;
    BIO *bio;
    int len;

    if ((bio = BIO_new(BIO_s_mem())) == NULL)
        return NULL;

    ASN1_STRING_print_ex(bio, asn1str, ASN1_STRFLGS_ESC_CTRL|
                                       ASN1_STRFLGS_UTF8_CONVERT);
    len = BIO_pending(bio);
    if (len > 0) {
		result = cf_malloc(len+1);
        len = BIO_read(bio, result, len);
        result[len] = NUL;
    }
    BIO_free(bio);
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x8b80
movq %rax, %rdi
callq 0x8760
testq %rax, %rax
je 0x11da5
movq %rax, %rbx
pushq $0x12
popq %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x8360
xorl %r14d, %r14d
pushq $0xa
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x8770
movq %rax, %r15
testl %r15d, %r15d
jle 0x11d9b
movl %r15d, %edi
incl %edi
callq 0x8080
movq %rbx, %rdi
movq %rax, %rsi
movl %r15d, %edx
movq %rax, %r14
callq 0x8250
cltq
movb $0x0, (%r14,%rax)
movq %rbx, %rdi
callq 0x87a0
jmp 0x11da8
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/citrusleaf/cf_alloc.c
// Function: cf_rc_alloc
void*
cf_rc_alloc(size_t sz)
{
	cf_rc_hdr* head = malloc(sizeof(cf_rc_hdr) + sz);

	head->count = 1;
	head->sz = (uint32_t)sz;

	return head + 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rdi
callq 0x8700
movl $0x1, (%rax)
movl %ebx, 0x4(%rax)
addq $0x8, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/citrusleaf/cf_alloc.c
// Function: cf_rc_releaseandfree
uint32_t
cf_rc_releaseandfree(void* addr)
{
	cf_rc_hdr* head = (cf_rc_hdr*)addr - 1;
	uint32_t rc = as_aaf_uint32_rls(&head->count, -1);

	if (rc == 0) {
		free(head);
	}

	return rc;
}

// Assembly:
pushq %rbx
pushq $-0x1
popq %rbx
lock
xaddl %ebx, -0x8(%rdi)
decl %ebx
jne 0x11e2b
addq $-0x8, %rdi
callq 0x80f0
movl %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/citrusleaf/cf_b64.c
// Function: cf_b64_encode
void
cf_b64_encode(const uint8_t* in, uint32_t in_size, char* out)
{
	int i = 0;
	int j = 0;

	while (in_size >= 3) {
		uint8_t i0 = in[i];
		uint8_t i1 = in[i + 1];
		uint8_t i2 = in[i + 2];

		out[j]     = EA[ (i0 & 0xfc) >> 2];
		out[j + 1] = EA[((i0 & 0x03) << 4) + ((i1 & 0xf0) >> 4)];
		out[j + 2] = EA[((i1 & 0x0f) << 2) + ((i2 & 0xc0) >> 6)];
		out[j + 3] = EA[  i2 & 0x3f];

		i += 3;
		j += 4;

		in_size -= 3;
	}

	if (in_size == 1) {
		uint8_t i0 = in[i];

		out[j]     = EA[(i0 & 0xfc) >> 2];
		out[j + 1] = EA[(i0 & 0x03) << 4];
		out[j + 2] = '=';
		out[j + 3] = '=';
	}
	else if (in_size == 2) {
		uint8_t i0 = in[i];
		uint8_t i1 = in[i + 1];

		out[j]     = EA[ (i0 & 0xfc) >> 2];
		out[j + 1] = EA[((i0 & 0x03) << 4) + ((i1 & 0xf0) >> 4)];
		out[j + 2] = EA[ (i1 & 0x0f) << 2];
		out[j + 3] = '=';
	}
}

// Assembly:
xorl %eax, %eax
leaq 0x4827(%rip), %rcx      # 0x16660
cmpl $0x3, %esi
jb 0x11ea8
movzbl (%rdi), %r8d
movzbl 0x1(%rdi), %r9d
movzbl 0x2(%rdi), %r10d
addl $-0x3, %esi
addq $0x3, %rdi
movl %r8d, %r11d
shll $0x4, %r8d
shrl $0x2, %r11d
andl $0x30, %r8d
movb (%r11,%rcx), %r11b
movb %r11b, (%rdx,%rax)
movl %r9d, %r11d
andl $0xf, %r9d
shrl $0x4, %r11d
orl %r8d, %r11d
movb (%r11,%rcx), %r8b
movb %r8b, 0x1(%rdx,%rax)
movl %r10d, %r8d
andl $0x3f, %r10d
shrl $0x6, %r8d
leal (%r8,%r9,4), %r8d
movb (%r8,%rcx), %r8b
movb %r8b, 0x2(%rdx,%rax)
movb (%r10,%rcx), %r8b
movb %r8b, 0x3(%rdx,%rax)
addq $0x4, %rax
jmp 0x11e39
cmpl $0x2, %esi
je 0x11edb
cmpl $0x1, %esi
jne 0x11f23
movzbl (%rdi), %esi
movl %eax, %r8d
andl $-0x4, %r8d
movl %esi, %edi
shll $0x4, %esi
shrl $0x2, %edi
andl $0x30, %esi
movb (%rdi,%rcx), %dil
movb %dil, (%rdx,%r8)
movb (%rsi,%rcx), %cl
movb %cl, 0x1(%rdx,%r8)
movb $0x3d, %cl
jmp 0x11f17
movzbl (%rdi), %esi
movzbl 0x1(%rdi), %edi
movl %eax, %r9d
andl $-0x4, %r9d
movl %esi, %r8d
shll $0x4, %esi
shrl $0x2, %r8d
andl $0x30, %esi
movb (%r8,%rcx), %r8b
movb %r8b, (%rdx,%r9)
movl %edi, %r8d
andl $0xf, %edi
shrl $0x4, %r8d
orl %esi, %r8d
movb (%r8,%rcx), %sil
movb %sil, 0x1(%rdx,%r9)
movb (%rcx,%rdi,4), %cl
andl $-0x4, %eax
movb %cl, 0x2(%rdx,%rax)
movb $0x3d, 0x3(%rdx,%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/citrusleaf/cf_b64.c
// Function: cf_b64_decode
void
cf_b64_decode(const char* in, uint32_t in_len, uint8_t* out, uint32_t* out_size)
{
	uint32_t i = 0;
	uint32_t j = 0;

	while (i < in_len) {
		uint8_t i0 = (uint8_t)in[i];
		uint8_t i1 = (uint8_t)in[i + 1];
		uint8_t i2 = (uint8_t)in[i + 2];
		uint8_t i3 = (uint8_t)in[i + 3];

		out[j]     = (DA[i0] << 2) | (DA[i1] >> 4);
		out[j + 1] = (DA[i1] << 4) | (DA[i2] >> 2);
		out[j + 2] = (DA[i2] << 6) |  DA[i3];

		i += 4;
		j += 3;
	}

	if (out_size) {
		if (i != 0) {
			if (in[i - 1] == '=') {
				j--;
			}

			if (in[i - 2] == '=') {
				j--;
			}
		}

		*out_size = j;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
xorl %eax, %eax
movl $0xfffffffe, %r9d       # imm = 0xFFFFFFFE
leaq 0x4769(%rip), %r8       # 0x166a0
leal 0x2(%r9), %r10d
cmpl %esi, %r10d
jae 0x11faf
movl %r10d, %r10d
movzbl (%rdi,%r10), %r11d
leal 0x3(%r9), %r10d
movzbl (%rdi,%r10), %ebx
leal 0x4(%r9), %r10d
addl $0x5, %r9d
movzbl (%rdi,%r10), %r14d
movzbl (%rdi,%r9), %r9d
movb (%r11,%r8), %r11b
movb (%rbx,%r8), %bl
shlb $0x2, %r11b
movl %ebx, %ebp
shlb $0x4, %bl
shrb $0x4, %bpl
orb %r11b, %bpl
movl %eax, %r11d
movb %bpl, (%rdx,%r11)
movb (%r14,%r8), %r11b
movl %r11d, %ebp
shlb $0x6, %r11b
shrb $0x2, %bpl
orb %bl, %bpl
leal 0x1(%rax), %ebx
movb %bpl, (%rdx,%rbx)
orb (%r9,%r8), %r11b
leal 0x2(%rax), %r9d
addl $0x3, %eax
movb %r11b, (%rdx,%r9)
movl %r10d, %r9d
jmp 0x11f37
testq %rcx, %rcx
je 0x11fdd
cmpl $-0x2, %r9d
je 0x11fdb
leal 0x1(%r9), %edx
xorl %esi, %esi
cmpb $0x3d, (%rdi,%rdx)
movl %r9d, %edx
sete %sil
xorl %r8d, %r8d
cmpb $0x3d, (%rdi,%rdx)
sete %r8b
addl %r8d, %esi
subl %esi, %eax
movl %eax, (%rcx)
popq %rbx
popq %r14
popq %rbp
retq