LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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
movq %r8, %rbx
cmpl $0x10, %ecx
setl %al
cmpl $0x1e, %r9d
setl %cl
orb %al, %cl
jne 0x1368d
testq %rsi, %rsi
setne %al
leaq -0x20(%rsi), %rcx
cmpq $-0x1c, %rcx
setb %cl
testb %cl, %al
jne 0x1368d
cmpb $0x24, (%rdi)
jne 0x1368d
cmpb $0x32, 0x1(%rdi)
jne 0x1368d
movq %rdx, %r8
movzbl 0x2(%rdi), %eax
cmpl $0x61, %eax
je 0x1362c
cmpl $0x79, %eax
jne 0x1368d
testq %rsi, %rsi
movl $0x5, %ecx
cmovneq %rsi, %rcx
movw $0x3224, (%rbx)         # imm = 0x3224
movb 0x2(%rdi), %al
movb %al, 0x2(%rbx)
movb $0x24, %sil
movb %sil, 0x3(%rbx)
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
movq %rcx, %rax
mulq %rdx
shrq $0x3, %rdx
movl %edx, %eax
orb $0x30, %al
movb %al, 0x4(%rbx)
addl %edx, %edx
leal (%rdx,%rdx,4), %eax
subl %eax, %ecx
orb $0x30, %cl
movb %cl, 0x5(%rbx)
movb %sil, 0x6(%rbx)
leaq 0x7(%rbx), %rdi
movq %r8, %rsi
movl $0x10, %edx
callq 0x136b4
movb $0x0, 0x1d(%rbx)
jmp 0x136af
testl %r9d, %r9d
jle 0x13695
movb $0x0, (%rbx)
cmpl $0x1e, %r9d
movl $0x22, %eax
movl $0x16, %ebx
cmovll %eax, %ebx
callq 0x8150
movl %ebx, (%rax)
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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, %eax
addq %rsi, %rax
addq $0x3, %rdi
leaq 0x5ebc(%rip), %rcx      # 0x19580
movzbl (%rsi), %r8d
movl %r8d, %edx
shrl $0x2, %edx
movb (%rdx,%rcx), %dl
movb %dl, -0x3(%rdi)
shll $0x4, %r8d
andl $0x30, %r8d
incq %rsi
cmpq %rax, %rsi
jae 0x13733
movzbl (%rsi), %edx
movl %edx, %r9d
shrl $0x4, %r9d
orl %r8d, %r9d
movb (%r9,%rcx), %r8b
movb %r8b, -0x2(%rdi)
shll $0x2, %edx
andl $0x3c, %edx
incq %rsi
cmpq %rax, %rsi
jae 0x1373b
movzbl (%rsi), %r8d
movl %r8d, %r9d
shrl $0x6, %r9d
orl %edx, %r9d
movb (%r9,%rcx), %dl
movb %dl, -0x1(%rdi)
andl $0x3f, %r8d
movb (%r8,%rcx), %dl
movb %dl, (%rdi)
addq $0x4, %rdi
incq %rsi
cmpq %rax, %rsi
jb 0x136c4
retq
movb (%r8,%rcx), %al
movb %al, -0x2(%rdi)
retq
movb (%rdx,%rcx), %al
movb %al, -0x1(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/aerospike/crypt_blowfish.c
// Function: BF_decode
static int BF_decode(BF_word *dst, const char *src, int size)
{
	unsigned char *dptr = (unsigned char *)dst;
	unsigned char *end = dptr + size;
	const unsigned char *sptr = (const unsigned char *)src;
	unsigned int tmp, c1, c2, c3, c4;

	do {
		BF_safe_atoi64(c1, *sptr++);
		BF_safe_atoi64(c2, *sptr++);
		*dptr++ = (c1 << 2) | ((c2 & 0x30) >> 4);
		if (dptr >= end) break;

		BF_safe_atoi64(c3, *sptr++);
		*dptr++ = ((c2 & 0x0F) << 4) | ((c3 & 0x3C) >> 2);
		if (dptr >= end) break;

		BF_safe_atoi64(c4, *sptr++);
		*dptr++ = ((c3 & 0x03) << 6) | c4;
	} while (dptr < end);

	return 0;
}

// Assembly:
movzbl (%rsi), %r8d
addl $-0x20, %r8d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x5f, %r8d
jbe 0x13756
retq
addq $0x4, %rsi
xorl %ecx, %ecx
leaq 0x5dbd(%rip), %rdx      # 0x19520
movl %r8d, %r8d
movb (%r8,%rdx), %r9b
cmpb $0x3f, %r9b
ja 0x13755
movzbl -0x3(%rsi), %r8d
addl $-0x20, %r8d
cmpl $0x5f, %r8d
ja 0x13755
movl %r8d, %r8d
movb (%r8,%rdx), %r8b
cmpb $0x3f, %r8b
ja 0x13755
shlb $0x2, %r9b
movl %r8d, %r10d
shrb $0x4, %r10b
orb %r9b, %r10b
movb %r10b, (%rdi,%rcx)
cmpq $0xe, %rcx
ja 0x13822
movzbl -0x2(%rsi), %r9d
addl $-0x20, %r9d
cmpl $0x5f, %r9d
ja 0x13755
movl %r9d, %r9d
movb (%r9,%rdx), %r9b
cmpb $0x3f, %r9b
ja 0x13755
shlb $0x4, %r8b
movl %r9d, %r10d
shrb $0x2, %r10b
orb %r8b, %r10b
movb %r10b, 0x1(%rdi,%rcx)
movzbl -0x1(%rsi), %r8d
addl $-0x20, %r8d
cmpl $0x5f, %r8d
ja 0x13755
movl %r8d, %r8d
movb (%r8,%rdx), %r8b
cmpb $0x3f, %r8b
ja 0x13755
shlb $0x6, %r9b
orb %r9b, %r8b
movb %r8b, 0x2(%rdi,%rcx)
addq $0x3, %rcx
movzbl (%rsi), %r8d
addl $-0x20, %r8d
addq $0x4, %rsi
cmpl $0x60, %r8d
jb 0x13763
jmp 0x13755
xorl %eax, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
movl 0x10(%rdi), %eax
cmpl %eax, 0xc(%rdi)
jne 0x13d0a
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x10, %eax
cmovnel %ecx, %eax
movl %eax, 0x10(%rbx)
movslq 0x8(%rbx), %rcx
movslq %eax, %rsi
imulq %rcx, %rsi
movq 0x18(%rbx), %rdi
callq 0x8510
movq %rax, 0x18(%rbx)
movslq 0xc(%rbx), %rcx
movslq 0x8(%rbx), %rax
imulq %rcx, %rax
addq 0x18(%rbx), %rax
incl %ecx
movl %ecx, 0xc(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8ab0
movq %rax, %rdi
callq 0x86e0
testq %rax, %rax
je 0x13d96
movq %rax, %rbx
movl $0x12, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x8350
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0xa, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x86f0
movq %rax, %r15
testl %r15d, %r15d
jle 0x13d8c
movl %r15d, %edi
incl %edi
callq 0x8080
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl %r15d, %edx
callq 0x8240
cltq
movb $0x0, (%r14,%rax)
movq %rbx, %rdi
callq 0x8720
jmp 0x13d99
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x8680
movl $0x1, (%rax)
movl %ebx, 0x4(%rax)
addq $0x8, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
lock
xaddl %ebx, -0x8(%rdi)
decl %ebx
jne 0x13e21
addq $-0x8, %rdi
callq 0x80f0
movl %ebx, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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:
cmpl $0x3, %esi
jb 0x13eab
pushq %rbx
xorl %eax, %eax
leaq 0x5829(%rip), %r8       # 0x19660
xorl %ecx, %ecx
movzbl (%rdi,%rcx), %r9d
movzbl 0x1(%rdi,%rcx), %r10d
movzbl 0x2(%rdi,%rcx), %r11d
movl %r9d, %ebx
shrl $0x2, %ebx
movb (%rbx,%r8), %bl
movb %bl, (%rdx,%rax)
shll $0x4, %r9d
andl $0x30, %r9d
movl %r10d, %ebx
shrl $0x4, %ebx
orl %r9d, %ebx
movb (%rbx,%r8), %r9b
movb %r9b, 0x1(%rdx,%rax)
andl $0xf, %r10d
movl %r11d, %r9d
shrl $0x6, %r9d
leal (%r9,%r10,4), %r9d
movb (%r9,%r8), %r9b
movb %r9b, 0x2(%rdx,%rax)
andl $0x3f, %r11d
movb (%r11,%r8), %r9b
movb %r9b, 0x3(%rdx,%rax)
addq $0x3, %rcx
addq $0x4, %rax
addl $-0x3, %esi
cmpl $0x2, %esi
ja 0x13e39
movl %ecx, %ecx
popq %rbx
jmp 0x13eaf
xorl %eax, %eax
xorl %ecx, %ecx
cmpl $0x2, %esi
movl %eax, %eax
je 0x13ee4
cmpl $0x1, %esi
jne 0x13f27
movzbl (%rdi,%rcx), %ecx
movl %ecx, %esi
shrl $0x2, %esi
leaq 0x5795(%rip), %rdi      # 0x19660
movb (%rsi,%rdi), %sil
movb %sil, (%rdx,%rax)
shll $0x4, %ecx
andl $0x30, %ecx
movb (%rcx,%rdi), %cl
movb %cl, 0x1(%rdx,%rax)
movb $0x3d, %cl
jmp 0x13f1e
movzbl (%rdi,%rcx), %esi
movzbl 0x1(%rdi,%rcx), %ecx
movl %esi, %edi
shrl $0x2, %edi
leaq 0x5767(%rip), %r8       # 0x19660
movb (%rdi,%r8), %dil
movb %dil, (%rdx,%rax)
shll $0x4, %esi
andl $0x30, %esi
movl %ecx, %edi
shrl $0x4, %edi
orl %esi, %edi
movb (%rdi,%r8), %sil
movb %sil, 0x1(%rdx,%rax)
andl $0xf, %ecx
movb (%r8,%rcx,4), %cl
movb %cl, 0x2(%rdx,%rax)
movb $0x3d, 0x3(%rdx,%rax)
retq
// File: /workspace/github_c_makefile_star2_O1/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
testl %esi, %esi
je 0x13fb6
xorl %r8d, %r8d
leaq 0x5762(%rip), %r9       # 0x196a0
xorl %eax, %eax
movl %r8d, %r10d
movzbl (%rdi,%r10), %r10d
leal 0x1(%r8), %r11d
movzbl (%rdi,%r11), %r11d
leal 0x2(%r8), %ebx
movzbl (%rdi,%rbx), %ebx
leal 0x3(%r8), %r14d
movzbl (%rdi,%r14), %r14d
movb (%r10,%r9), %r10b
shlb $0x2, %r10b
movb (%r11,%r9), %r11b
movl %r11d, %ebp
shrb $0x4, %bpl
orb %r10b, %bpl
movl %eax, %r10d
movb %bpl, (%rdx,%r10)
shlb $0x4, %r11b
movb (%rbx,%r9), %r10b
movl %r10d, %ebx
shrb $0x2, %bl
orb %r11b, %bl
leal 0x1(%rax), %r11d
movb %bl, (%rdx,%r11)
shlb $0x6, %r10b
orb (%r14,%r9), %r10b
leal 0x2(%rax), %r11d
movb %r10b, (%rdx,%r11)
addl $0x4, %r8d
addl $0x3, %eax
cmpl %esi, %r8d
jb 0x13f40
jmp 0x13fbb
xorl %eax, %eax
xorl %r8d, %r8d
testq %rcx, %rcx
je 0x13fe7
testl %r8d, %r8d
je 0x13fe5
leal -0x1(%r8), %edx
xorl %esi, %esi
cmpb $0x3d, (%rdi,%rdx)
sete %sil
subl %esi, %eax
addl $-0x2, %r8d
xorl %edx, %edx
cmpb $0x3d, (%rdi,%r8)
sete %dl
subl %edx, %eax
movl %eax, (%rcx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_b64.c
// Function: cf_b64_decode_in_place
void
cf_b64_decode_in_place(uint8_t* in_out, uint32_t in_len, uint32_t* out_size)
{
	uint32_t i = 0;
	uint32_t j = 0;

	uint32_t d = 0;

	if (out_size && in_len != 0) {
		if (in_out[in_len - 1] == '=') {
			d++;
		}

		if (in_out[in_len - 2] == '=') {
			d++;
		}
	}

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

		uint8_t b0 = (DA[i0] << 2) | (DA[i1] >> 4);
		uint8_t b1 = (DA[i1] << 4) | (DA[i2] >> 2);
		uint8_t b2 = (DA[i2] << 6) |  DA[i3];

		in_out[j]     = b0;
		in_out[j + 1] = b1;
		in_out[j + 2] = b2;

		i += 4;
		j += 3;
	}

	if (out_size) {
		*out_size = j - d;
	}
}

// Assembly:
testq %rdx, %rdx
sete %cl
testl %esi, %esi
sete %r8b
xorl %eax, %eax
orb %cl, %r8b
movl $0x0, %ecx
jne 0x14027
leal -0x1(%rsi), %r8d
xorl %ecx, %ecx
cmpb $0x3d, (%rdi,%r8)
sete %cl
movl %ecx, %r8d
negl %r8d
leal -0x2(%rsi), %r9d
cmpb $0x3d, (%rdi,%r9)
notl %ecx
cmovnel %r8d, %ecx
testl %esi, %esi
je 0x140b7
pushq %rbp
pushq %r14
pushq %rbx
xorl %r8d, %r8d
leaq 0x5663(%rip), %r9       # 0x196a0
xorl %eax, %eax
movl %r8d, %r10d
movzbl (%rdi,%r10), %r10d
leal 0x1(%r8), %r11d
movzbl (%rdi,%r11), %r11d
leal 0x2(%r8), %ebx
movzbl (%rdi,%rbx), %ebx
leal 0x3(%r8), %r14d
movzbl (%rdi,%r14), %r14d
movb (%r10,%r9), %r10b
shlb $0x2, %r10b
movb (%r11,%r9), %r11b
movl %r11d, %ebp
shrb $0x4, %bpl
orb %r10b, %bpl
shlb $0x4, %r11b
movb (%rbx,%r9), %r10b
movl %r10d, %ebx
shrb $0x2, %bl
orb %r11b, %bl
shlb $0x6, %r10b
orb (%r14,%r9), %r10b
movl %eax, %r11d
movb %bpl, (%rdi,%r11)
leal 0x1(%rax), %r11d
movb %bl, (%rdi,%r11)
leal 0x2(%rax), %r11d
movb %r10b, (%rdi,%r11)
addl $0x4, %r8d
addl $0x3, %eax
cmpl %esi, %r8d
jb 0x1403f
popq %rbx
popq %r14
popq %rbp
testq %rdx, %rdx
je 0x140c0
addl %ecx, %eax
movl %eax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_b64.c
// Function: is_valid_encoded
static bool
is_valid_encoded(const char* in, uint32_t in_len)
{
	if (! in || in_len == 0 || (in_len & 3) != 0) {
		return false;
	}

	const uint8_t* end = (const uint8_t*)in + in_len - 2;
	const uint8_t* read = (const uint8_t*)in;

	while (read < end) {
		if (! VA[*read++]) {
			return false;
		}
	}

	if (*read == '=') {
		return *(read + 1) == '=';
	}

	if (! VA[*read++]) {
		return false;
	}

	return *read == '=' || VA[*read];
}

// Assembly:
testq %rdi, %rdi
sete %al
testl %esi, %esi
sete %cl
orb %al, %cl
testb $0x3, %sil
setne %al
orb %cl, %al
jne 0x1415c
movl %esi, %eax
leaq -0x2(%rdi,%rax), %rax
leaq 0x567e(%rip), %rcx      # 0x197a0
cmpq %rax, %rdi
jae 0x14135
movzbl (%rdi), %edx
incq %rdi
cmpb $0x0, (%rdx,%rcx)
jne 0x14122
jmp 0x1415c
movzbl (%rdi), %eax
cmpq $0x3d, %rax
jne 0x14146
cmpb $0x3d, 0x1(%rdi)
sete %al
retq
cmpb $0x1, (%rax,%rcx)
jne 0x1415c
movzbl 0x1(%rdi), %edx
cmpq $0x3d, %rdx
movb $0x1, %al
je 0x14145
movb (%rdx,%rcx), %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_crypto.c
// Function: cf_SHA1
void
cf_SHA1(const uint8_t* d, size_t n, uint8_t* md)
{
	cf_SHA1Context sha;

	cf_SHA1Reset(&sha);
	cf_SHA1Input(&sha, d, (unsigned)n);
	cf_SHA1Result(&sha, md);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl $0x0, 0x18(%rsp)
movw $0x0, 0x1c(%rsp)
movabsq $-0x1032547698badcff, %rax # imm = 0xEFCDAB8967452301
movq %rax, (%rsp)
movabsq $0x1032547698badcfe, %rax # imm = 0x1032547698BADCFE
movq %rax, 0x8(%rsp)
movl $0xc3d2e1f0, %eax       # imm = 0xC3D2E1F0
movq %rax, 0x10(%rsp)
movq $0x0, 0x60(%rsp)
testl %r14d, %r14d
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x1424e
movq %rdi, %r15
movq %rsp, %r12
cmpl $0x0, 0x64(%rsp)
jne 0x1424e
movb (%r15), %al
movswq 0x1c(%rsp), %rcx
leal 0x1(%rcx), %edx
movw %dx, 0x1c(%rsp)
movb %al, 0x1e(%rsp,%rcx)
addl $0x8, 0x14(%rsp)
jne 0x14233
incl 0x18(%rsp)
jne 0x14233
movl $0x1, 0x64(%rsp)
cmpw $0x40, 0x1c(%rsp)
jne 0x14243
movq %r12, %rdi
callq 0x15b7d
decl %r14d
incq %r15
testl %r14d, %r14d
jne 0x14202
testq %rbx, %rbx
je 0x1437a
cmpl $0x0, 0x64(%rsp)
jne 0x1437a
cmpl $0x0, 0x60(%rsp)
jne 0x14355
movswq 0x1c(%rsp), %rcx
leal 0x1(%rcx), %eax
cmpq $0x38, %rcx
movw %ax, 0x1c(%rsp)
jl 0x142dc
movb $-0x80, 0x1e(%rsp,%rcx)
cmpw $0x3f, %ax
jg 0x142a8
leal 0x1(%rax), %ecx
movw %cx, 0x1c(%rsp)
movswq %ax, %rax
movb $0x0, 0x1e(%rsp,%rax)
movzwl 0x1c(%rsp), %eax
cmpw $0x40, %ax
jl 0x1428c
movq %rsp, %r14
movq %r14, %rdi
callq 0x15b7d
movzwl 0x1c(%r14), %eax
cmpw $0x37, %ax
jg 0x14308
leal 0x1(%rax), %ecx
movw %cx, 0x1c(%rsp)
movswq %ax, %rax
movb $0x0, 0x1e(%rsp,%rax)
movzwl 0x1c(%rsp), %eax
cmpw $0x38, %ax
jl 0x142be
jmp 0x14308
movb $-0x80, 0x1e(%rsp,%rcx)
movzwl 0x1c(%rsp), %eax
cmpw $0x37, %ax
jg 0x14308
leal 0x1(%rax), %ecx
movw %cx, 0x1c(%rsp)
movswq %ax, %rax
movb $0x0, 0x1e(%rsp,%rax)
movzwl 0x1c(%rsp), %eax
cmpw $0x38, %ax
jl 0x142ec
movq %rsp, %r14
movl 0x14(%r14), %eax
movl 0x18(%r14), %ecx
bswapl %ecx
movl %ecx, 0x56(%r14)
bswapl %eax
movl %eax, 0x5a(%r14)
movq %r14, %rdi
callq 0x15b7d
xorl %eax, %eax
movq %rax, 0x56(%r14)
movq %rax, 0x4e(%r14)
movq %rax, 0x46(%r14)
movq %rax, 0x3e(%r14)
movq %rax, 0x36(%r14)
movq %rax, 0x2e(%r14)
movq %rax, 0x26(%r14)
movq %rax, 0x1e(%r14)
movq %rax, 0x14(%r14)
movl $0x1, 0x60(%r14)
xorl %eax, %eax
xorl %edx, %edx
movl %edx, %ecx
andl $-0x4, %ecx
movl (%rsp,%rcx), %esi
movl %eax, %ecx
notb %cl
andb $0x18, %cl
shrl %cl, %esi
movb %sil, (%rbx,%rdx)
incq %rdx
addl $0x8, %eax
cmpq $0x14, %rdx
jne 0x14359
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_crypto.c
// Function: cf_RIPEMD160
int
cf_RIPEMD160(const unsigned char* input, size_t ilen, unsigned char* output)
{
	int ret;
	cf_RIPEMD160_CTX ctx;

	if ((ret = cf_RIPEMD160_Init(&ctx)) != 0) {
		return ret;
	}

	if ((ret = cf_RIPEMD160_Update(&ctx, input, ilen)) != 0) {
		return ret;
	}

	if ((ret = cf_RIPEMD160_Final(output, &ctx)) != 0) {
		return ret;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %rsi
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x20(%r14)
movl $0x0, 0x58(%r14)
movq $0x0, 0x50(%r14)
movabsq $-0x1032547698badcff, %rax # imm = 0xEFCDAB8967452301
movq %rax, 0x8(%r14)
movabsq $0x1032547698badcfe, %rax # imm = 0x1032547698BADCFE
movq %rax, 0x10(%r14)
movl $0xc3d2e1f0, 0x18(%r14) # imm = 0xC3D2E1F0
movq %r14, %rdi
callq 0x8440
movq %rbx, %rdi
movq %r14, %rsi
callq 0x85a0
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_crypto.c
// Function: cf_RIPEMD160_Update
int
cf_RIPEMD160_Update(cf_RIPEMD160_CTX* ctx, const void* v_input, size_t ilen)
{
	const unsigned char* input = (const unsigned char*)v_input;

	int ret;

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

	size_t left = ctx->total[0] & 0x3F;
	uint32_t fill = (uint32_t)(64 - left);

	ctx->total[0] += (uint32_t) ilen;
	ctx->total[0] &= 0xFFFFFFFF;

	if (ctx->total[0] < (uint32_t) ilen) {
		ctx->total[1]++;
	}

	if (left && ilen >= fill) {
		memcpy((void*)(ctx->buffer + left), input, fill);

		if ((ret = cf_ripemd160_process(ctx, ctx->buffer)) != 0) {
			return ret;
		}

		input += fill;
		ilen  -= fill;
		left = 0;
	}

	while (ilen >= 64) {
		if ((ret = cf_ripemd160_process(ctx, input)) != 0) {
			return ret;
		}

		input += 64;
		ilen  -= 64;
	}

	if (ilen > 0) {
		memcpy((void*)(ctx->buffer + left), input, ilen);
	}

	return 0;
}

// Assembly:
testq %rdx, %rdx
je 0x144f1
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %eax
movl %eax, %r13d
andl $0x3f, %r13d
movl %r15d, %ecx
addl %eax, %ecx
movl %ecx, (%rdi)
jae 0x1446a
incl 0x4(%r14)
testl %r13d, %r13d
je 0x144ac
movl $0x40, %eax
subl %r13d, %eax
movl %eax, %r12d
movq %r15, %rbp
subq %r12, %rbp
jb 0x144af
leaq 0x1c(%r14), %r15
leaq 0x1c(%r14,%r13), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x85c0
movq %r14, %rdi
movq %r15, %rsi
callq 0x14617
addq %r12, %rbx
xorl %r13d, %r13d
movq %rbp, %r15
jmp 0x144af
xorl %r13d, %r13d
cmpq $0x40, %r15
jb 0x144ce
movq %r14, %rdi
movq %rbx, %rsi
callq 0x14617
addq $0x40, %rbx
addq $-0x40, %r15
cmpq $0x3f, %r15
ja 0x144b5
testq %r15, %r15
je 0x144e3
leaq 0x1c(%r14,%r13), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x85c0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_crypto.c
// Function: cf_RIPEMD160_Final
int
cf_RIPEMD160_Final(unsigned char* output, cf_RIPEMD160_CTX* ctx)
{
	uint32_t high = (ctx->total[0] >> 29) | (ctx->total[1] <<  3);
	uint32_t low  = (ctx->total[0] <<  3);

	unsigned char msglen[8];

	PUT_UINT32_LE(low,  msglen, 0);
	PUT_UINT32_LE(high, msglen, 4);

	uint32_t last = ctx->total[0] & 0x3F;
	uint32_t padn = (last < 56) ? (56 - last) : (120 - last);

	int ret = cf_RIPEMD160_Update(ctx, cf_ripemd160_padding, padn);

	if (ret != 0) {
		return ret;
	}

	ret = cf_RIPEMD160_Update(ctx, msglen, 8);

	if (ret != 0) {
		return ret;
	}

	PUT_UINT32_LE(ctx->state[0], output,  0);
	PUT_UINT32_LE(ctx->state[1], output,  4);
	PUT_UINT32_LE(ctx->state[2], output,  8);
	PUT_UINT32_LE(ctx->state[3], output, 12);
	PUT_UINT32_LE(ctx->state[4], output, 16);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %eax
movl 0x4(%rsi), %ecx
shldl $0x3, %eax, %ecx
leal (,%rax,8), %edx
leaq 0x8(%rsp), %r15
movb %dl, (%r15)
movl %eax, %edx
shrl $0x5, %edx
movb %dl, 0x1(%r15)
movl %eax, %edx
shrl $0xd, %edx
movb %dl, 0x2(%r15)
movl %eax, %edx
shrl $0x15, %edx
movb %dl, 0x3(%r15)
movb %cl, 0x4(%r15)
movb %ch, 0xd(%rsp)
movl %ecx, %edx
shrl $0x10, %edx
movb %dl, 0x6(%r15)
shrl $0x18, %ecx
movb %cl, 0x7(%r15)
andl $0x3f, %eax
xorl %edx, %edx
cmpl $0x38, %eax
setae %dl
shll $0x6, %edx
orl $0x38, %edx
subl %eax, %edx
leaq 0x5338(%rip), %rsi      # 0x198a0
movq %r14, %rdi
callq 0x8440
movl $0x8, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x8440
movb 0x8(%r14), %al
movb %al, (%rbx)
movb 0x9(%r14), %al
movb %al, 0x1(%rbx)
movb 0xa(%r14), %al
movb %al, 0x2(%rbx)
movb 0xb(%r14), %al
movb %al, 0x3(%rbx)
movb 0xc(%r14), %al
movb %al, 0x4(%rbx)
movb 0xd(%r14), %al
movb %al, 0x5(%rbx)
movb 0xe(%r14), %al
movb %al, 0x6(%rbx)
movb 0xf(%r14), %al
movb %al, 0x7(%rbx)
movb 0x10(%r14), %al
movb %al, 0x8(%rbx)
movb 0x11(%r14), %al
movb %al, 0x9(%rbx)
movb 0x12(%r14), %al
movb %al, 0xa(%rbx)
movb 0x13(%r14), %al
movb %al, 0xb(%rbx)
movb 0x14(%r14), %al
movb %al, 0xc(%rbx)
movb 0x15(%r14), %al
movb %al, 0xd(%rbx)
movb 0x16(%r14), %al
movb %al, 0xe(%rbx)
movb 0x17(%r14), %al
movb %al, 0xf(%rbx)
movb 0x18(%r14), %al
movb %al, 0x10(%rbx)
movb 0x19(%r14), %al
movb %al, 0x11(%rbx)
movb 0x1a(%r14), %al
movb %al, 0x12(%rbx)
movb 0x1b(%r14), %al
movb %al, 0x13(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_ll.c
// Function: cf_ll_size
uint32_t cf_ll_size(cf_ll *ll) {
	LL_LOCK(ll);
	uint32_t sz = ll->sz;
	LL_UNLOCK(ll);
	return(sz);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0x1c(%rdi)
jne 0x16289
leaq 0x20(%rbx), %rdi
callq 0x8ad0
movl 0x18(%rbx), %ebp
cmpb $0x1, 0x1c(%rbx)
jne 0x1629e
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x8630
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_ll.c
// Function: cf_ll_search_lockfree
cf_ll_element * cf_ll_search_lockfree(cf_ll *ll, cf_ll_element *e, bool forward, cf_ll_reduce_fn fn) {
	if (ll->head == NULL) {
		return NULL;
	}
	int rv = 0;
	cf_ll_element *cur = forward ? ll->head : ll->tail;
	
	while (cur) {
		rv = (*fn) (cur, (void*)e);

		if (rv == CF_LL_REDUCE_MATCHED) {
			return cur;
		}
		else if (rv == CF_LL_REDUCE_NOT_MATCHED) {
			cur = forward ? cur->next : cur->prev;
			rv = 0;
		}
		else {
			return NULL;
		}
	}
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x162f3
movq %rcx, %r14
movq %rsi, %r15
testb %dl, %dl
jne 0x162c5
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x162f3
xorb $0x1, %dl
movzbl %dl, %r12d
shll $0x3, %r12d
movq %rbx, %rdi
movq %r15, %rsi
callq *%r14
cmpl $0x4, %eax
jne 0x162ee
movq (%rbx,%r12), %rbx
testq %rbx, %rbx
jne 0x162d5
jmp 0x162f3
cmpl $0x3, %eax
je 0x162f5
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_ll.c
// Function: cf_ll_search
cf_ll_element * cf_ll_search(cf_ll *ll, cf_ll_element *e, bool forward, cf_ll_reduce_fn fn) 
{
	LL_LOCK(ll);
	
	cf_ll_element * ele = NULL;
	ele = cf_ll_search_lockfree(ll, e, forward, fn);

	LL_UNLOCK(ll);

	return ele;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %rbx
cmpb $0x1, 0x1c(%rdi)
jne 0x16329
leaq 0x20(%rbx), %rdi
callq 0x8ad0
movq (%rbx), %r14
testq %r14, %r14
je 0x16369
testb %bpl, %bpl
jne 0x1633a
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x16369
xorb $0x1, %bpl
movzbl %bpl, %r13d
shll $0x3, %r13d
movq %r14, %rdi
movq %r12, %rsi
callq *%r15
cmpl $0x4, %eax
jne 0x16364
movq (%r14,%r13), %r14
testq %r14, %r14
jne 0x1634b
jmp 0x16369
cmpl $0x3, %eax
je 0x1636c
xorl %r14d, %r14d
cmpb $0x1, 0x1c(%rbx)
jne 0x1637e
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x8630
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_ll.c
// Function: cf_ll_getIterator
cf_ll_iterator * cf_ll_getIterator(cf_ll * ll, bool forward)
{
	cf_ll_iterator *iter = NULL;
	iter = (cf_ll_iterator *)cf_malloc(sizeof(cf_ll_iterator));
	if (iter == NULL) {
		return NULL;
	}
	iter->forward = forward;
	iter->next = iter->forward ? ll->head : ll->tail;
	return iter;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl $0x10, %edi
callq 0x8080
testq %rax, %rax
je 0x163bc
movb %bpl, 0x8(%rax)
xorb $0x1, %bpl
movzbl %bpl, %ecx
movq (%rbx,%rcx,8), %rcx
movq %rcx, (%rax)
jmp 0x163be
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_ll.c
// Function: cf_ll_getNext
cf_ll_element * cf_ll_getNext(cf_ll_iterator *iter)
{
	if (!iter) return NULL;
	cf_ll_element * ele = iter->next;
	if (ele != NULL) {
		iter->next = iter->forward ? ele->next : ele->prev;
	}
	return ele;
}

// Assembly:
testq %rdi, %rdi
je 0x163eb
movq (%rdi), %rax
testq %rax, %rax
je 0x163ed
movzbl 0x8(%rdi), %ecx
xorl $0x1, %ecx
movq (%rax,%rcx,8), %rcx
movq %rcx, (%rdi)
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_ll.c
// Function: cf_ll_index
cf_ll_element *cf_ll_index(cf_ll *ll, int index)
{
	cf_ll_element *ele = NULL;
	if (index < 0) {
		index = (-index) - 1;
		ele = ll->tail;
		while (index-- && ele) {
			ele = ele->prev;
		}
	}
	else {
		ele = ll->head;
		while (index-- && ele) {
			ele = ele->next;
		}
	}
	return ele;
}

// Assembly:
movq %rdi, %rax
testl %esi, %esi
js 0x16404
movq (%rax), %rax
addl $-0x1, %esi
jae 0x16415
testq %rax, %rax
jne 0x163f5
jmp 0x16415
incl %esi
movq 0x8(%rax), %rax
testl %esi, %esi
je 0x16415
incl %esi
testq %rax, %rax
jne 0x16406
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_ll.c
// Function: cf_ll_init
int  cf_ll_init(cf_ll *ll, cf_ll_destructor destroy_fn, bool uselock) {
	ll->head = 0;
	ll->tail = 0;
	ll->destroy_fn = destroy_fn;
	ll->sz = 0;
	ll->uselock = uselock;
	if (uselock) {
		pthread_mutex_init(&ll->LOCK, 0);
	}
	return(0);	
}

// Assembly:
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movq %rax, (%rdi)
movq %rsi, 0x10(%rdi)
movl $0x0, 0x18(%rdi)
movb %dl, 0x1c(%rdi)
testl %edx, %edx
je 0x16441
pushq %rax
addq $0x20, %rdi
xorl %esi, %esi
callq 0x8a90
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_init
bool
cf_queue_init(cf_queue *q, size_t element_sz, uint32_t capacity,
		bool threadsafe)
{
	q->alloc_sz = capacity;
	q->write_offset = q->read_offset = 0;
	q->n_eles = 0;
	q->element_sz = element_sz;
	q->threadsafe = threadsafe;
	q->free_struct = false;

	q->elements = (uint8_t*)cf_malloc(capacity * element_sz);

	if (! q->elements) {
		return false;
	}

	if (! q->threadsafe) {
		return true;
	}

	if (0 != pthread_mutex_init(&q->LOCK, NULL)) {
		cf_free(q->elements);
		return false;
	}

	if (0 != pthread_cond_init(&q->CV, NULL)) {
		pthread_mutex_destroy(&q->LOCK);
		cf_free(q->elements);
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %edx, 0x4(%rdi)
movq $0x0, 0x8(%rdi)
movl $0x0, 0x10(%rdi)
movq %rsi, 0x18(%rdi)
movb %cl, (%rdi)
movb $0x0, 0x1(%rdi)
movl %edx, %edi
imulq %rsi, %rdi
callq 0x8080
movq %rax, 0x78(%rbx)
testq %rax, %rax
je 0x164b5
movb $0x1, %bpl
cmpb $0x1, (%rbx)
jne 0x164b7
leaq 0x20(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x8a90
testl %eax, %eax
jne 0x164ac
leaq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x85f0
testl %eax, %eax
je 0x164b7
movq %r14, %rdi
callq 0x82f0
movq 0x78(%rbx), %rdi
callq 0x8940
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_create
cf_queue *
cf_queue_create(size_t element_sz, bool threadsafe)
{
	cf_queue *q = (cf_queue*)cf_malloc(sizeof(cf_queue));

	if (! q) {
		return NULL;
	}

	if (! cf_queue_init(q, element_sz, CF_QUEUE_ALLOCSZ, threadsafe)) {
		cf_free(q);
		return NULL;
	}

	q->free_struct = true;

	return q;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x80, %edi
callq 0x8080
testq %rax, %rax
je 0x164ff
movq %rax, %rbx
movzbl %bpl, %ecx
movq %rax, %rdi
movq %r14, %rsi
movl $0x40, %edx
callq 0x8ae0
testb %al, %al
je 0x164f7
movb $0x1, 0x1(%rbx)
jmp 0x16501
movq %rbx, %rdi
callq 0x8940
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_destroy
void
cf_queue_destroy(cf_queue *q)
{
	if (q->threadsafe) {
		pthread_cond_destroy(&q->CV);
		pthread_mutex_destroy(&q->LOCK);
	}

	cf_free(q->elements);

	if (q->free_struct) {
		memset(q, 0, sizeof(cf_queue));
		cf_free(q);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0x16524
leaq 0x48(%rbx), %rdi
callq 0x8900
leaq 0x20(%rbx), %rdi
callq 0x82f0
movq 0x78(%rbx), %rdi
callq 0x8940
cmpb $0x1, 0x1(%rbx)
jne 0x16549
movl $0x10, %ecx
xorl %eax, %eax
movq %rbx, %rdi
rep  stosq %rax, %es:(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x8940
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_push
int
cf_queue_push(cf_queue *q, const void *ptr)
{
	cf_queue_lock(q);

	// Check queue length.
	if (CF_Q_SZ(q) == q->alloc_sz) {
		if (0 != cf_queue_resize(q, q->alloc_sz * 2)) {
			cf_queue_unlock(q);
			return CF_QUEUE_ERR;
		}
	}

	// TODO - if queues are power of 2, this can be a shift.
	memcpy(CF_Q_ELEM_PTR(q, q->write_offset), ptr, q->element_sz);
	q->write_offset++;
	q->n_eles++;
	cf_queue_unwrap(q);

	if (q->threadsafe) {
		pthread_cond_signal(&q->CV);
	}

	cf_queue_unlock(q);
	return CF_QUEUE_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0x16563
leaq 0x20(%rbx), %rdi
callq 0x8ad0
movl 0x4(%rbx), %esi
movl 0xc(%rbx), %eax
subl 0x8(%rbx), %eax
cmpl %esi, %eax
jne 0x1658a
addl %esi, %esi
movq %rbx, %rdi
callq 0x165f5
testl %eax, %eax
je 0x1658a
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x0, (%rbx)
jne 0x165e2
jmp 0x165ee
movl 0xc(%rbx), %eax
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, %edi
movq 0x18(%rbx), %rdx
imulq %rdx, %rdi
addq 0x78(%rbx), %rdi
movq %r14, %rsi
callq 0x85c0
movl 0xc(%rbx), %ecx
incl %ecx
movl %ecx, 0xc(%rbx)
incl 0x10(%rbx)
cmpl $0x40000000, %ecx       # imm = 0x40000000
jb 0x165cd
movl 0x8(%rbx), %eax
subl %eax, %ecx
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, 0x8(%rbx)
addl %edx, %ecx
movl %ecx, 0xc(%rbx)
cmpb $0x1, (%rbx)
jne 0x165db
leaq 0x48(%rbx), %rdi
callq 0x84e0
xorl %ebp, %ebp
cmpb $0x1, (%rbx)
jne 0x165ee
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x8630
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_resize
static int
cf_queue_resize(cf_queue *q, uint32_t new_sz)
{
	// The rare case where the queue is not fragmented, and realloc makes sense
	// and none of the offsets need to move.
	if (0 == q->read_offset % q->alloc_sz) {
		q->elements = (uint8_t*)cf_realloc(q->elements, new_sz * q->element_sz);

		if (! q->elements) {
			return CF_QUEUE_ERR;
		}

		q->read_offset = 0;
		q->write_offset = q->alloc_sz;
	}
	else {
		uint8_t *newq = (uint8_t*)cf_malloc(new_sz * q->element_sz);

		if (! newq) {
			return CF_QUEUE_ERR;
		}

		// end_sz is used bytes in old queue from insert point to end.
		size_t end_sz =
				(q->alloc_sz - (q->read_offset % q->alloc_sz)) * q->element_sz;

		memcpy(&newq[0], CF_Q_ELEM_PTR(q, q->read_offset), end_sz);
		memcpy(&newq[end_sz], &q->elements[0],
				(q->alloc_sz * q->element_sz) - end_sz);

		cf_free(q->elements);
		q->elements = newq;

		q->write_offset = q->alloc_sz;
		q->read_offset = 0;
	}

	q->alloc_sz = new_sz;

	return CF_QUEUE_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl 0x8(%rdi), %eax
xorl %edx, %edx
divl 0x4(%rdi)
testl %edx, %edx
je 0x1668b
movl %ebx, %edi
imulq 0x18(%r14), %rdi
callq 0x8080
testq %rax, %rax
je 0x166bc
movq %rax, %r15
movl 0x4(%r14), %r12d
movl 0x8(%r14), %eax
xorl %edx, %edx
divl %r12d
subl %edx, %r12d
movq 0x18(%r14), %rsi
imulq %rsi, %r12
imulq %rdx, %rsi
addq 0x78(%r14), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x85c0
movq %r15, %rdi
addq %r12, %rdi
movq 0x78(%r14), %rsi
movl 0x4(%r14), %edx
imulq 0x18(%r14), %rdx
subq %r12, %rdx
callq 0x85c0
movq 0x78(%r14), %rdi
callq 0x8940
movq %r15, 0x78(%r14)
movl 0x4(%r14), %eax
movl %eax, 0xc(%r14)
movl $0x0, 0x8(%r14)
jmp 0x166b4
movq 0x78(%r14), %rdi
movl %ebx, %esi
imulq 0x18(%r14), %rsi
callq 0x8510
movq %rax, 0x78(%r14)
testq %rax, %rax
je 0x166bc
movl $0x0, 0x8(%r14)
movl 0x4(%r14), %eax
movl %eax, 0xc(%r14)
movl %ebx, 0x4(%r14)
xorl %eax, %eax
jmp 0x166c1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_push_limit
bool
cf_queue_push_limit(cf_queue *q, const void *ptr, uint32_t limit)
{
	cf_queue_lock(q);

	uint32_t size = CF_Q_SZ(q);

	if (size >= limit) {
		cf_queue_unlock(q);
		return false;
	}

	if (size == q->alloc_sz) {
		if (0 != cf_queue_resize(q, q->alloc_sz * 2)) {
			cf_queue_unlock(q);
			return false;
		}
	}

	// TODO - if queues are power of 2, this can be a shift.
	memcpy(CF_Q_ELEM_PTR(q, q->write_offset), ptr, q->element_sz);
	q->write_offset++;
	q->n_eles++;
	cf_queue_unwrap(q);

	if (q->threadsafe) {
		pthread_cond_signal(&q->CV);
	}

	cf_queue_unlock(q);
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0x166e7
leaq 0x20(%rbx), %rdi
callq 0x8ad0
movl 0xc(%rbx), %eax
subl 0x8(%rbx), %eax
cmpl %ebp, %eax
jae 0x16706
movl 0x4(%rbx), %esi
cmpl %esi, %eax
jne 0x16720
addl %esi, %esi
movq %rbx, %rdi
callq 0x165f5
testl %eax, %eax
je 0x16720
xorl %ebp, %ebp
cmpb $0x0, (%rbx)
je 0x16719
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x8630
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl 0xc(%rbx), %eax
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, %edi
movq 0x18(%rbx), %rdx
imulq %rdx, %rdi
addq 0x78(%rbx), %rdi
movq %r14, %rsi
callq 0x85c0
movl 0xc(%rbx), %ecx
incl %ecx
movl %ecx, 0xc(%rbx)
incl 0x10(%rbx)
cmpl $0x40000000, %ecx       # imm = 0x40000000
jb 0x16763
movl 0x8(%rbx), %eax
subl %eax, %ecx
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, 0x8(%rbx)
addl %edx, %ecx
movl %ecx, 0xc(%rbx)
cmpb $0x1, (%rbx)
jne 0x16771
leaq 0x48(%rbx), %rdi
callq 0x84e0
movb $0x1, %bpl
cmpb $0x1, (%rbx)
je 0x1670d
jmp 0x16719
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_push_unique
int
cf_queue_push_unique(cf_queue *q, const void *ptr)
{
	cf_queue_lock(q);

	// Check if element is already queued.
	if (CF_Q_SZ(q) != 0) {
		for (uint32_t i = q->read_offset; i < q->write_offset; i++) {
			if (0 == memcmp(CF_Q_ELEM_PTR(q, i), ptr, q->element_sz)) {
				// Element is already queued.
				// TODO - return 0 if all callers regard this as normal?
				cf_queue_unlock(q);
				return -2;
			}
		}
	}

	if (CF_Q_SZ(q) == q->alloc_sz) {
		if (0 != cf_queue_resize(q, q->alloc_sz * 2)) {
			cf_queue_unlock(q);
			return CF_QUEUE_ERR;
		}
	}

	// TODO - if queues are power of 2, this can be a shift.
	memcpy(CF_Q_ELEM_PTR(q, q->write_offset), ptr, q->element_sz);
	q->write_offset++;
	q->n_eles++;
	cf_queue_unwrap(q);

	if (q->threadsafe) {
		pthread_cond_signal(&q->CV);
	}

	cf_queue_unlock(q);
	return CF_QUEUE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0x1699b
leaq 0x20(%rbx), %rdi
callq 0x8ad0
movl 0x8(%rbx), %ebp
movl 0xc(%rbx), %eax
movq %rax, 0x10(%rsp)
cmpl %ebp, %eax
je 0x16a38
seta %r14b
jbe 0x16a38
movq 0x78(%rbx), %r13
movl 0x4(%rbx), %r12d
movq 0x18(%rbx), %r15
movl %ebp, %eax
xorl %edx, %edx
divl %r12d
imulq %r15, %rdx
leaq (%rdx,%r13), %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x8770
testl %eax, %eax
je 0x16a1c
movq 0x10(%rsp), %rax
leal -0x1(%rax), %r14d
cmpl %ebp, %r14d
je 0x16a38
incl %ebp
movl %ebp, %eax
xorl %edx, %edx
divl %r12d
imulq %r15, %rdx
leaq (%rdx,%r13), %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x8770
testl %eax, %eax
jne 0x169ed
cmpl 0x10(%rsp), %ebp
setb %r14b
cmpb $0x1, (%rbx)
jne 0x16a2a
leaq 0x20(%rbx), %rdi
callq 0x8630
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
testb %r14b, %r14b
jne 0x16ac5
movl 0x4(%rbx), %esi
movl 0xc(%rbx), %eax
subl 0x8(%rbx), %eax
cmpl %esi, %eax
jne 0x16a5f
addl %esi, %esi
movq %rbx, %rdi
callq 0x165f5
testl %eax, %eax
je 0x16a5f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x0, (%rbx)
jne 0x16ab9
jmp 0x16ac5
movl 0xc(%rbx), %eax
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, %edi
movq 0x18(%rbx), %rdx
imulq %rdx, %rdi
addq 0x78(%rbx), %rdi
movq 0x8(%rsp), %rsi
callq 0x85c0
movl 0xc(%rbx), %ecx
incl %ecx
movl %ecx, 0xc(%rbx)
incl 0x10(%rbx)
cmpl $0x40000000, %ecx       # imm = 0x40000000
jb 0x16aa4
movl 0x8(%rbx), %eax
subl %eax, %ecx
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, 0x8(%rbx)
addl %edx, %ecx
movl %ecx, 0xc(%rbx)
cmpb $0x1, (%rbx)
jne 0x16ab2
leaq 0x48(%rbx), %rdi
callq 0x84e0
xorl %ebp, %ebp
cmpb $0x1, (%rbx)
jne 0x16ac5
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x8630
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_push_head
int
cf_queue_push_head(cf_queue *q, const void *ptr)
{
	cf_queue_lock(q);

	if (CF_Q_SZ(q) == q->alloc_sz) {
		if (0 != cf_queue_resize(q, q->alloc_sz * 2)) {
			cf_queue_unlock(q);
			return CF_QUEUE_ERR;
		}
	}

	if (q->read_offset == 0) {
		q->read_offset += q->alloc_sz;
		q->write_offset += q->alloc_sz;
	}

	q->read_offset--;
	memcpy(CF_Q_ELEM_PTR(q, q->read_offset), ptr, q->element_sz);
	q->n_eles++;
	cf_queue_unwrap(q);

	if (q->threadsafe) {
		pthread_cond_signal(&q->CV);
	}

	cf_queue_unlock(q);
	return CF_QUEUE_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0x16aee
leaq 0x20(%rbx), %rdi
callq 0x8ad0
movl 0x4(%rbx), %esi
movl 0xc(%rbx), %eax
subl 0x8(%rbx), %eax
cmpl %esi, %eax
jne 0x16b15
addl %esi, %esi
movq %rbx, %rdi
callq 0x165f5
testl %eax, %eax
je 0x16b15
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x0, (%rbx)
jne 0x16b7c
jmp 0x16b88
cmpl $0x0, 0x8(%rbx)
jne 0x16b24
movl 0x4(%rbx), %eax
movl %eax, 0x8(%rbx)
addl %eax, 0xc(%rbx)
movl 0x8(%rbx), %eax
decl %eax
movl %eax, 0x8(%rbx)
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, %edi
movq 0x18(%rbx), %rdx
imulq %rdx, %rdi
addq 0x78(%rbx), %rdi
movq %r14, %rsi
callq 0x85c0
incl 0x10(%rbx)
movl 0xc(%rbx), %ecx
cmpl $0x40000000, %ecx       # imm = 0x40000000
jb 0x16b67
movl 0x8(%rbx), %eax
subl %eax, %ecx
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, 0x8(%rbx)
addl %edx, %ecx
movl %ecx, 0xc(%rbx)
cmpb $0x1, (%rbx)
jne 0x16b75
leaq 0x48(%rbx), %rdi
callq 0x84e0
xorl %ebp, %ebp
cmpb $0x1, (%rbx)
jne 0x16b88
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x8630
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_peek
int
cf_queue_peek(cf_queue *q, void *buf)
{
	cf_queue_lock(q);

	if (CF_Q_EMPTY(q)) {
		cf_queue_unlock(q);
		return CF_QUEUE_EMPTY;
	}

	memcpy(buf, CF_Q_ELEM_PTR(q, q->read_offset), q->element_sz);

	cf_queue_unlock(q);
	return CF_QUEUE_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0x16ba7
leaq 0x20(%rbx), %rdi
callq 0x8ad0
movl 0x8(%rbx), %eax
cmpl %eax, 0xc(%rbx)
jne 0x16bbb
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpb $0x0, (%rbx)
jne 0x16be1
jmp 0x16bed
xorl %ebp, %ebp
xorl %edx, %edx
divl 0x4(%rbx)
movq 0x18(%rbx), %rax
imulq %rax, %rdx
addq 0x78(%rbx), %rdx
movq %r14, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x85c0
cmpb $0x1, (%rbx)
jne 0x16bed
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x8630
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_delete_offset
void
cf_queue_delete_offset(cf_queue *q, uint32_t index)
{
	q->n_eles--;

	index %= q->alloc_sz;

	uint32_t r_index = q->read_offset % q->alloc_sz;
	uint32_t w_index = q->write_offset % q->alloc_sz;

	// Assumes index is validated!

	// If we're deleting the one at the head, just increase the read offset.
	if (index == r_index) {
		q->read_offset++;
		return;
	}

	// If we're deleting the tail just decrease the write offset.
	if (w_index && (index == w_index - 1)) {
		q->write_offset--;
		return;
	}

	if (index > r_index) {
		// The memory copy is overlapping, so must use memmove().
		memmove(&q->elements[(r_index + 1) * q->element_sz],
				&q->elements[r_index * q->element_sz],
				(index - r_index) * q->element_sz);
		q->read_offset++;
		return;
	}

	if (index < w_index) {
		// The memory copy is overlapping, so must use memmove().
		memmove(&q->elements[index * q->element_sz],
				&q->elements[(index + 1) * q->element_sz],
				(w_index - index - 1) * q->element_sz);
		q->write_offset--;
	}
}

// Assembly:
pushq %rbx
movl %esi, %eax
movq %rdi, %rbx
decl 0x10(%rdi)
movl 0x4(%rdi), %r9d
movl 0x8(%rdi), %edi
xorl %edx, %edx
divl %r9d
movl %edx, %ecx
movl %edi, %eax
xorl %edx, %edx
divl %r9d
movl %edx, %esi
movl 0xc(%rbx), %r8d
movl %r8d, %eax
xorl %edx, %edx
divl %r9d
cmpl %esi, %ecx
jne 0x16d72
incl %edi
movl %edi, 0x8(%rbx)
jmp 0x16def
movl %edx, %eax
addl $-0x1, %eax
setae %dil
cmpl %eax, %ecx
setne %al
orb %dil, %al
jne 0x16d8e
decl %r8d
movl %r8d, 0xc(%rbx)
jmp 0x16def
movl %ecx, %eax
subl %esi, %eax
jbe 0x16dc0
movq 0x18(%rbx), %rcx
movq 0x78(%rbx), %rdx
leal 0x1(%rsi), %edi
imulq %rcx, %rdi
addq %rdx, %rdi
movl %esi, %esi
imulq %rcx, %rsi
addq %rdx, %rsi
imulq %rcx, %rax
movq %rax, %rdx
callq 0x8850
incl 0x8(%rbx)
jmp 0x16def
cmpl %edx, %ecx
jae 0x16def
movq 0x18(%rbx), %rax
movq 0x78(%rbx), %r8
movl %ecx, %edi
imulq %rax, %rdi
addq %r8, %rdi
leal 0x1(%rcx), %esi
imulq %rax, %rsi
addq %r8, %rsi
notl %ecx
addl %ecx, %edx
imulq %rax, %rdx
callq 0x8850
decl 0xc(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_reduce
int
cf_queue_reduce(cf_queue *q, cf_queue_reduce_fn cb, void *udata)
{
	cf_queue_lock(q);

	if (CF_Q_SZ(q) != 0) {
		for (uint32_t i = q->read_offset; i < q->write_offset; i++) {
			int rv = cb(CF_Q_ELEM_PTR(q, i), udata);

			if (rv == 0) {
				continue;
			}

			if (rv == -1) {
				// Found what it was looking for, stop reducing.
				break;
			}

			if (rv == -2) {
				// Delete, and stop reducing.
				cf_queue_delete_offset(q, i);
				break;
			}
		}
	}

	cf_queue_unlock(q);
	return CF_QUEUE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0x16e0f
leaq 0x20(%rbx), %rdi
callq 0x8ad0
movl 0x8(%rbx), %ebp
cmpl %ebp, 0xc(%rbx)
jne 0x16e35
cmpb $0x1, (%rbx)
jne 0x16e28
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x8630
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl 0xc(%rbx), %ebp
jae 0x16e17
movl %ebp, %eax
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, %edi
imulq 0x18(%rbx), %rdi
addq 0x78(%rbx), %rdi
movq %r14, %rsi
callq *%r15
cmpl $-0x2, %eax
je 0x16e6b
testl %eax, %eax
je 0x16e64
cmpl $-0x1, %eax
je 0x16e75
xorl %eax, %eax
jmp 0x16e7a
movl $0x4, %eax
jmp 0x16e7a
movq %rbx, %rdi
movl %ebp, %esi
callq 0x8320
movl $0x2, %eax
testb $0x3, %al
jne 0x16e17
incl %ebp
jmp 0x16e35
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/citrusleaf/cf_queue.c
// Function: cf_queue_reduce_reverse
int
cf_queue_reduce_reverse(cf_queue *q, cf_queue_reduce_fn cb, void *udata)
{
	cf_queue_lock(q);

	if (CF_Q_SZ(q) != 0) {
		for (int i = (int)q->write_offset - 1; i >= (int)q->read_offset; i--) {
			int rv = cb(CF_Q_ELEM_PTR(q, i), udata);

			if (rv == 0) {
				continue;
			}

			if (rv == -1) {
				// Found what it was looking for, stop reducing.
				break;
			}

			if (rv == -2) {
				// Delete, and stop reducing.
				cf_queue_delete_offset(q, i);
				break;
			}
		}
	}

	cf_queue_unlock(q);
	return CF_QUEUE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0x17053
leaq 0x20(%rbx), %rdi
callq 0x8ad0
movl 0xc(%rbx), %ebp
cmpl 0x8(%rbx), %ebp
jne 0x17079
cmpb $0x1, (%rbx)
jne 0x1706c
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x8630
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl 0x8(%rbx), %ebp
jle 0x1705b
decl %ebp
movl %ebp, %eax
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, %edi
imulq 0x18(%rbx), %rdi
addq 0x78(%rbx), %rdi
movq %r14, %rsi
callq *%r15
cmpl $-0x2, %eax
je 0x170b1
testl %eax, %eax
je 0x170aa
cmpl $-0x1, %eax
je 0x170bb
xorl %eax, %eax
jmp 0x170c0
movl $0x4, %eax
jmp 0x170c0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x8320
movl $0x2, %eax
testb $0x3, %al
je 0x17079
jmp 0x1705b