// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movzbl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
subl $0x20, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x60, %eax
jb 0x1ecad
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ee7d
movl -0x3c(%rbp), %eax
movl %eax, %ecx
leaq 0x12ac7(%rip), %rax     # 0x31780
movzbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3f, -0x3c(%rbp)
jbe 0x1ecd2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ee7d
movl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movzbl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
subl $0x20, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x60, %eax
jb 0x1ed07
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ee7d
movl -0x3c(%rbp), %eax
movl %eax, %ecx
leaq 0x12a6d(%rip), %rax     # 0x31780
movzbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3f, -0x3c(%rbp)
jbe 0x1ed2c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ee7d
movl -0x3c(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x40(%rbp), %eax
shll $0x2, %eax
movl -0x44(%rbp), %ecx
andl $0x30, %ecx
shrl $0x4, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x1ed65
jmp 0x1ee76
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movzbl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
subl $0x20, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x60, %eax
jb 0x1ed94
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ee7d
movl -0x3c(%rbp), %eax
movl %eax, %ecx
leaq 0x129e0(%rip), %rax     # 0x31780
movzbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3f, -0x3c(%rbp)
jbe 0x1edb9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ee7d
movl -0x3c(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x44(%rbp), %eax
andl $0xf, %eax
shll $0x4, %eax
movl -0x48(%rbp), %ecx
andl $0x3c, %ecx
shrl $0x2, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x1edf5
jmp 0x1ee76
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movzbl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
subl $0x20, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x60, %eax
jb 0x1ee21
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ee7d
movl -0x3c(%rbp), %eax
movl %eax, %ecx
leaq 0x12953(%rip), %rax     # 0x31780
movzbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3f, -0x3c(%rbp)
jbe 0x1ee43
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ee7d
movl -0x3c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %eax
andl $0x3, %eax
shll $0x6, %eax
orl -0x4c(%rbp), %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x1ec7e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)