// File: /workspace/github_c_makefile_star2_O0/orestesleal[P]base64/base64.c
// Function: base64_enc
void base64_enc(char *s, char b[])
{
	unsigned int x, npad;
	int i;

	npad = 0;
	for (i = 0; *s; i++) {
		x = s[0] == ESC ? s++[1]-'0' : s[0];
		x <<= 8;
		x |= s[1] == ESC ? s++[2]-'0' : s[1];
		x <<= 8;
		x |= s[2] == ESC ? s++[3]-'0' : s[2];
		x <<= 8;
		b[i++] = b64_alp[x >> 26];
		b[i++] = b64_alp[(x << 6) >> 26];

		if (s[1] == '\0') { /* quantum of encoding of 8 bits */
			npad = 2;
			break;
		}
		b[i++] = b64_alp[(x << 12) >> 26];
		
		if (s[2] == '\0') { /* quantum of 16 bits */
			npad = 1;
			break;
		}
		b[i] = b64_alp[(x << 18) >> 26];
		s += 3; /* point to the next 24 bit group */ 
	}
	for (;npad > 0; npad--) { /* add padding if needed */
		b[i++] = PAD;
	}
	b[i] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, (%rax)
je 0x1b6a
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x19de
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movsbl 0x1(%rax), %eax
subl $0x30, %eax
movl %eax, -0x20(%rbp)
jmp 0x19e8
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x5c, %eax
jne 0x1a1f
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movsbl 0x2(%rax), %eax
subl $0x30, %eax
movl %eax, -0x24(%rbp)
jmp 0x1a2a
movq -0x8(%rbp), %rax
movsbl 0x1(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x5c, %eax
jne 0x1a64
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movsbl 0x3(%rax), %eax
subl $0x30, %eax
movl %eax, -0x28(%rbp)
jmp 0x1a6f
movq -0x8(%rbp), %rax
movsbl 0x2(%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
shrl $0x1a, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x35ee(%rip), %rax      # 0x5080
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
shll $0x6, %eax
shrl $0x1a, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x35c2(%rip), %rax      # 0x5080
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x1aec
movl $0x2, -0x18(%rbp)
jmp 0x1b6a
movl -0x14(%rbp), %eax
shll $0xc, %eax
shrl $0x1a, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3580(%rip), %rax      # 0x5080
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x0, %eax
jne 0x1b2e
movl $0x1, -0x18(%rbp)
jmp 0x1b6a
movl -0x14(%rbp), %eax
shll $0x12, %eax
shrl $0x1a, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x353e(%rip), %rax      # 0x5080
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x8(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x19aa
jmp 0x1b6c
cmpl $0x0, -0x18(%rbp)
jbe 0x1b93
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x3d, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1b6c
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
popq %rbp
retq
nopw %cs:(%rax,%rax)