// File: /workspace/github_c_makefile_star2_O0/rpeepz[P]ft_ssl/srcs/encode/base64.c
// Function: base64_nstr_fd
void			base64_nstr_fd(uint8_t *in, int len, int fd, int *count)
{
	int			i;
	uint8_t		enc[4];

	i = 0;
	while (count ? in[i] : i < len)
	{
		DEBUG ? ft_printf("%02x %02x %02x\n", in[i], in[i + 1], in[i + 2]) : 0;
		ft_bzero(enc, 4);
		enc[0] |= in[i] >> 2;
		enc[1] |= ((in[i] & 0x03) << 4);
		enc[1] |= (in[i + 1] >> 4);
		enc[2] |= ((in[i + 1] & 0x0F) << 2);
		enc[2] |= (in[i + 2] >> 6);
		enc[3] |= (in[i + 2] & 0x3F);
		ft_putchar_fd(g_base64[enc[0]], fd);
		ft_putchar_fd(g_base64[enc[1]], fd);
		ft_putchar_fd((!enc[2] && len - i < 2) ? '=' : g_base64[enc[2]], fd);
		ft_putchar_fd((!enc[3] && len - i < 3) ? '=' : g_base64[enc[3]], fd);
		i += 3;
		count ? (*count) += 4 : 0;
		count && *count % 64 == 0 ? ft_putchar_fd('\n', fd) : 0;
		!count && (i % 48) == 0 ? ft_putchar_fd('\n', fd) : 0;
	}
	!count && (i % 48) ? ft_putchar_fd('\n', fd) : 0;
	count && len < 63 ? ft_putchar_fd('\n', fd) : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1de5
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x24(%rbp)
jmp 0x1df6
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl $0x0, %eax
je 0x1fe1
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
callq 0xa600
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
sarl $0x2, %ecx
movzbl -0x20(%rbp), %eax
orl %ecx, %eax
movb %al, -0x20(%rbp)
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
andl $0x3, %ecx
shll $0x4, %ecx
movzbl -0x1f(%rbp), %eax
orl %ecx, %eax
movb %al, -0x1f(%rbp)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %ecx
sarl $0x4, %ecx
movzbl -0x1f(%rbp), %eax
orl %ecx, %eax
movb %al, -0x1f(%rbp)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %ecx
andl $0xf, %ecx
shll $0x2, %ecx
movzbl -0x1e(%rbp), %eax
orl %ecx, %eax
movb %al, -0x1e(%rbp)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %ecx
sarl $0x6, %ecx
movzbl -0x1e(%rbp), %eax
orl %ecx, %eax
movb %al, -0x1e(%rbp)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %ecx
andl $0x3f, %ecx
movzbl -0x1d(%rbp), %eax
orl %ecx, %eax
movb %al, -0x1d(%rbp)
movzbl -0x20(%rbp), %eax
movl %eax, %ecx
leaq 0x161c9(%rip), %rax     # 0x18090
movb (%rax,%rcx), %al
movl -0x10(%rbp), %esi
movsbl %al, %edi
callq 0xb200
movzbl -0x1f(%rbp), %eax
movl %eax, %ecx
leaq 0x161ae(%rip), %rax     # 0x18090
movb (%rax,%rcx), %al
movl -0x10(%rbp), %esi
movsbl %al, %edi
callq 0xb200
cmpb $0x0, -0x1e(%rbp)
jne 0x1f0b
movl -0xc(%rbp), %eax
subl -0x1c(%rbp), %eax
cmpl $0x2, %eax
jge 0x1f0b
movl $0x3d, %eax
movl %eax, -0x28(%rbp)
jmp 0x1f1f
movzbl -0x1e(%rbp), %eax
movl %eax, %ecx
leaq 0x16178(%rip), %rax     # 0x18090
movzbl (%rax,%rcx), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0x10(%rbp), %esi
movsbl %al, %edi
callq 0xb200
cmpb $0x0, -0x1d(%rbp)
jne 0x1f48
movl -0xc(%rbp), %eax
subl -0x1c(%rbp), %eax
cmpl $0x3, %eax
jge 0x1f48
movl $0x3d, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1f5c
movzbl -0x1d(%rbp), %eax
movl %eax, %ecx
leaq 0x1613b(%rip), %rax     # 0x18090
movzbl (%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl -0x10(%rbp), %esi
movsbl %al, %edi
callq 0xb200
movl -0x1c(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1f87
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x4, %ecx
movl %ecx, (%rax)
jmp 0x1f89
jmp 0x1f89
cmpq $0x0, -0x18(%rbp)
je 0x1fb2
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x1fb2
movl -0x10(%rbp), %esi
movl $0xa, %edi
callq 0xb200
jmp 0x1fb4
jmp 0x1fb4
cmpq $0x0, -0x18(%rbp)
jne 0x1fda
movl -0x1c(%rbp), %eax
movl $0x30, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x1fda
movl -0x10(%rbp), %esi
movl $0xa, %edi
callq 0xb200
jmp 0x1fdc
jmp 0x1fdc
jmp 0x1dcd
cmpq $0x0, -0x18(%rbp)
jne 0x2007
movl -0x1c(%rbp), %eax
movl $0x30, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x2007
movl -0x10(%rbp), %esi
movl $0xa, %edi
callq 0xb200
jmp 0x2009
jmp 0x2009
cmpq $0x0, -0x18(%rbp)
je 0x2025
cmpl $0x3f, -0xc(%rbp)
jge 0x2025
movl -0x10(%rbp), %esi
movl $0xa, %edi
callq 0xb200
jmp 0x2027
jmp 0x2027
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)