// File: /workspace/github_c_makefile_star2_O0/orestesleal[P]base64/base64.c
// Function: b64_enc
void b64_enc(unsigned const char *s, char b[], unsigned int len)
{
	register unsigned int x,i,w;
	unsigned char rm,z;

	w = 0;
	for (i = 0; i < len; i++) {
		for (x = 0, z = 0; z < 3 && i < len; z++, i++) {
			x |= s[i];	
			(z < 2 && i+1 < len) ? x <<= 8 : 0;
		}
		for (;z < 4; z++, x <<= 8);
		b[w++] = b64_alp[x >> 26];
		b[w++] = b64_alp[(x << 6) >> 26];
		b[w++] = b64_alp[(x << 12) >> 26];
		b[w++] = b64_alp[(x << 18) >> 26];
		--i;
	}
	b[w] = '\0';
	rm = len % 3; 
	if (rm) { /* padding */ 
		for (x = rm == 1 ? 2 : 1; x; --x) {
			b[--w] = PAD;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x1e9c
movl $0x0, -0x18(%rbp)
movb $0x0, -0x22(%rbp)
movzbl -0x22(%rbp), %ecx
xorl %eax, %eax
cmpl $0x3, %ecx
movb %al, -0x23(%rbp)
jge 0x1d6e
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
setb %al
movb %al, -0x23(%rbp)
movb -0x23(%rbp), %al
testb $0x1, %al
jne 0x1d77
jmp 0x1dbc
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
orl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movzbl -0x22(%rbp), %eax
cmpl $0x2, %eax
jge 0x1da7
movl -0x1c(%rbp), %eax
addl $0x1, %eax
cmpl -0x14(%rbp), %eax
jae 0x1da7
movl -0x18(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x18(%rbp)
jmp 0x1da9
jmp 0x1da9
movb -0x22(%rbp), %al
addb $0x1, %al
movb %al, -0x22(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1d54
jmp 0x1dbe
movzbl -0x22(%rbp), %eax
cmpl $0x4, %eax
jge 0x1ddc
jmp 0x1dc9
movb -0x22(%rbp), %al
addb $0x1, %al
movb %al, -0x22(%rbp)
movl -0x18(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x18(%rbp)
jmp 0x1dbe
movl -0x18(%rbp), %eax
shrl $0x1a, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3293(%rip), %rax      # 0x5080
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x18(%rbp), %eax
shll $0x6, %eax
shrl $0x1a, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3268(%rip), %rax      # 0x5080
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x18(%rbp), %eax
shll $0xc, %eax
shrl $0x1a, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x323d(%rip), %rax      # 0x5080
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x18(%rbp), %eax
shll $0x12, %eax
shrl $0x1a, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3212(%rip), %rax      # 0x5080
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1d3d
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movl -0x14(%rbp), %eax
movl $0x3, %ecx
xorl %edx, %edx
divl %ecx
movb %dl, %al
movb %al, -0x21(%rbp)
cmpb $0x0, -0x21(%rbp)
je 0x1efb
movzbl -0x21(%rbp), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x1ef9
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x20(%rbp)
movl %ecx, %ecx
movb $0x3d, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1ed5
jmp 0x1efb
popq %rbp
retq
nopl (%rax)