// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movzbl (%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
shrl $0x2, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x12c2c(%rip), %rax     # 0x31730
movb (%rax,%rcx), %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
movl -0x34(%rbp), %eax
andl $0x3, %eax
shll $0x4, %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x1eb53
movl -0x34(%rbp), %eax
movl %eax, %ecx
leaq 0x12bf6(%rip), %rax     # 0x31730
movb (%rax,%rcx), %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
jmp 0x1ec40
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movzbl (%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
shrl $0x4, %eax
orl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, %ecx
leaq 0x12bb0(%rip), %rax     # 0x31730
movb (%rax,%rcx), %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
movl -0x38(%rbp), %eax
andl $0xf, %eax
shll $0x2, %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x1ebcc
movl -0x34(%rbp), %eax
movl %eax, %ecx
leaq 0x12b7a(%rip), %rax     # 0x31730
movb (%rax,%rcx), %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
jmp 0x1ec40
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movzbl (%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
shrl $0x6, %eax
orl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, %ecx
leaq 0x12b37(%rip), %rax     # 0x31730
movb (%rax,%rcx), %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
movl -0x38(%rbp), %eax
andl $0x3f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x12b12(%rip), %rax     # 0x31730
movb (%rax,%rcx), %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x1eade
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)