// File: /workspace/github_c_makefile_star2_O0/odknt[P]st/st.c
// Function: base64dec
char *
base64dec(const char *src)
{
	size_t in_len = strlen(src);
	char *result, *dst;
	static const char base64_digits[256] = {
		[43] = 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
		0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
		13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0,
		0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
		40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
	};

	if (in_len % 4)
		in_len += 4 - (in_len % 4);
	result = dst = xmalloc(in_len / 4 * 3 + 1);
	while (*src) {
		int a = base64_digits[(unsigned char) base64dec_getc(&src)];
		int b = base64_digits[(unsigned char) base64dec_getc(&src)];
		int c = base64_digits[(unsigned char) base64dec_getc(&src)];
		int d = base64_digits[(unsigned char) base64dec_getc(&src)];

		/* invalid input. 'a' can be -1, e.g. if src is "\n" (c-str) */
		if (a == -1 || b == -1)
			break;

		*dst++ = (a << 2) | ((b & 0x30) >> 4);
		if (c == -1)
			break;
		*dst++ = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2);
		if (d == -1)
			break;
		*dst++ = ((c & 0x03) << 6) | d;
	}
	*dst = '\0';
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x6410
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
je 0xc5bf
movq -0x10(%rbp), %rcx
andq $0x3, %rcx
movl $0x4, %eax
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x2, %rax
imulq $0x3, %rax, %rdi
addq $0x1, %rdi
callq 0x6bd0
movq %rax, -0x20(%rbp)
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, (%rax)
je 0xc6e6
leaq -0x8(%rbp), %rdi
callq 0xc9e0
movzbl %al, %eax
movl %eax, %ecx
leaq 0x8152(%rip), %rax      # 0x14750
movsbl (%rax,%rcx), %eax
movl %eax, -0x24(%rbp)
leaq -0x8(%rbp), %rdi
callq 0xc9e0
movzbl %al, %eax
movl %eax, %ecx
leaq 0x8136(%rip), %rax      # 0x14750
movsbl (%rax,%rcx), %eax
movl %eax, -0x28(%rbp)
leaq -0x8(%rbp), %rdi
callq 0xc9e0
movzbl %al, %eax
movl %eax, %ecx
leaq 0x811a(%rip), %rax      # 0x14750
movsbl (%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
leaq -0x8(%rbp), %rdi
callq 0xc9e0
movzbl %al, %eax
movl %eax, %ecx
leaq 0x80fe(%rip), %rax      # 0x14750
movsbl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
cmpl $-0x1, -0x24(%rbp)
je 0xc665
cmpl $-0x1, -0x28(%rbp)
jne 0xc667
jmp 0xc6e6
movl -0x24(%rbp), %eax
shll $0x2, %eax
movl -0x28(%rbp), %ecx
andl $0x30, %ecx
sarl $0x4, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
cmpl $-0x1, -0x2c(%rbp)
jne 0xc693
jmp 0xc6e6
movl -0x28(%rbp), %eax
andl $0xf, %eax
shll $0x4, %eax
movl -0x2c(%rbp), %ecx
andl $0x3c, %ecx
sarl $0x2, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
cmpl $-0x1, -0x30(%rbp)
jne 0xc6c2
jmp 0xc6e6
movl -0x2c(%rbp), %eax
andl $0x3, %eax
shll $0x6, %eax
orl -0x30(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
jmp 0xc5dc
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)