// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/base64.c
// Function: base64_decode
void base64_decode(const char *encoded_string,int strlength,char *out) {
  static const char base64_chars2[256]={
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    62,
    0,0,0,
    63,52,53,54,55,56,57,58,59,60,61,
    0,0,0,0,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,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

  int in_len = strlength;
  int i = 0;
  int j = 0;
  int in_ = 0;
  unsigned char char_array_4[4],char_array_3[3];
  int outInd=0;

  while(in_len-- && (encoded_string[in_] != '=') ) {
    char_array_4[i++] = encoded_string[in_++];

    if(i ==4) {
      for(i = 0; i <4; i++) {
        char_array_4[i] = base64_chars2[char_array_4[i]];
      }

      char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
      char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
      char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];

      for(i = 0; (i < 3); i++) {
        out[outInd++]=char_array_3[i];
      }

      i = 0;
    }
  }

  if(i) {
    for(j = i; j <4; j++) {
      char_array_4[j] = 0;
    }

    for(j = 0; j <4; j++) {
      char_array_4[j] = base64_chars2[char_array_4[j]];
    }

    char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
    char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
    char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];

    for(j = 0; (j < i - 1); j++) {
      out[outInd++]=char_array_3[j];
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x1c(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x35(%rbp)
je 0x40838b
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3d, %eax
setne %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0x408397
jmp 0x40847f
movq -0x8(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x28(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movl -0x20(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
cltq
movb %cl, -0x2c(%rbp,%rax)
cmpl $0x4, -0x20(%rbp)
jne 0x40847a
movl $0x0, -0x20(%rbp)
cmpl $0x4, -0x20(%rbp)
jge 0x4083fc
movslq -0x20(%rbp), %rax
movzbl -0x2c(%rbp,%rax), %eax
movl %eax, %ecx
leaq 0xdaf7a(%rip), %rax     # 0x4e3360
movb (%rax,%rcx), %cl
movslq -0x20(%rbp), %rax
movb %cl, -0x2c(%rbp,%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4083ce
movzbl -0x2c(%rbp), %eax
shll $0x2, %eax
movzbl -0x2b(%rbp), %ecx
andl $0x30, %ecx
sarl $0x4, %ecx
addl %ecx, %eax
movb %al, -0x2f(%rbp)
movzbl -0x2b(%rbp), %eax
andl $0xf, %eax
shll $0x4, %eax
movzbl -0x2a(%rbp), %ecx
andl $0x3c, %ecx
sarl $0x2, %ecx
addl %ecx, %eax
movb %al, -0x2e(%rbp)
movzbl -0x2a(%rbp), %eax
andl $0x3, %eax
shll $0x6, %eax
movzbl -0x29(%rbp), %ecx
addl %ecx, %eax
movb %al, -0x2d(%rbp)
movl $0x0, -0x20(%rbp)
cmpl $0x3, -0x20(%rbp)
jge 0x408473
movslq -0x20(%rbp), %rax
movb -0x2f(%rbp,%rax), %dl
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x34(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x408445
movl $0x0, -0x20(%rbp)
jmp 0x408361
cmpl $0x0, -0x20(%rbp)
je 0x40855e
movl -0x20(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0x4084a9
movslq -0x24(%rbp), %rax
movb $0x0, -0x2c(%rbp,%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x40848f
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0x4084de
movslq -0x24(%rbp), %rax
movzbl -0x2c(%rbp,%rax), %eax
movl %eax, %ecx
leaq 0xdae98(%rip), %rax     # 0x4e3360
movb (%rax,%rcx), %cl
movslq -0x24(%rbp), %rax
movb %cl, -0x2c(%rbp,%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4084b0
movzbl -0x2c(%rbp), %eax
shll $0x2, %eax
movzbl -0x2b(%rbp), %ecx
andl $0x30, %ecx
sarl $0x4, %ecx
addl %ecx, %eax
movb %al, -0x2f(%rbp)
movzbl -0x2b(%rbp), %eax
andl $0xf, %eax
shll $0x4, %eax
movzbl -0x2a(%rbp), %ecx
andl $0x3c, %ecx
sarl $0x2, %ecx
addl %ecx, %eax
movb %al, -0x2e(%rbp)
movzbl -0x2a(%rbp), %eax
andl $0x3, %eax
shll $0x6, %eax
movzbl -0x29(%rbp), %ecx
addl %ecx, %eax
movb %al, -0x2d(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x40855c
movslq -0x24(%rbp), %rax
movb -0x2f(%rbp,%rax), %dl
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x34(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x408527
jmp 0x40855e
popq %rbp
retq