// File: /workspace/github_c_makefile_star2_O2/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 %rbx
xorl %r8d, %r8d
leaq 0xcdce4(%rip), %rcx     # 0x4d2360
xorl %r9d, %r9d
leaq (%rdi,%r8), %r11
movl %esi, %esi
xorl %r10d, %r10d
movslq %r9d, %rax
cmpl %r10d, %esi
je 0x404739
movb (%r11,%r10), %bl
cmpb $0x3d, %bl
je 0x404739
movb %bl, -0x7(%rsp,%r10)
incq %r10
cmpl $0x4, %r10d
jne 0x404688
addq %r10, %r8
subq %r10, %rsi
xorl %r10d, %r10d
cmpq $0x4, %r10
je 0x4046d2
movzbl -0x7(%rsp,%r10), %r11d
movb (%r11,%rcx), %r11b
movb %r11b, -0x7(%rsp,%r10)
incq %r10
jmp 0x4046b8
movb -0x7(%rsp), %r10b
movb -0x6(%rsp), %r11b
shlb $0x2, %r10b
movl %r11d, %ebx
shrb $0x4, %bl
andb $0x3, %bl
orb %r10b, %bl
movb %bl, -0x3(%rsp)
shlb $0x4, %r11b
movb -0x5(%rsp), %r10b
movl %r10d, %ebx
shrb $0x2, %bl
andb $0xf, %bl
orb %r11b, %bl
shlb $0x6, %r10b
addb -0x4(%rsp), %r10b
movb %bl, -0x2(%rsp)
movb %r10b, -0x1(%rsp)
addq %rdx, %rax
xorl %r10d, %r10d
cmpq $0x3, %r10
je 0x404731
movb -0x3(%rsp,%r10), %r11b
movb %r11b, (%rax,%r10)
incq %r10
jmp 0x40471d
addl %r10d, %r9d
jmp 0x40467f
testl %r10d, %r10d
je 0x4047da
movq %r10, %rsi
cmpq $0x4, %rsi
jae 0x404755
movb $0x0, -0x7(%rsp,%rsi)
incq %rsi
jmp 0x404745
xorl %esi, %esi
cmpq $0x4, %rsi
je 0x404770
movzbl -0x7(%rsp,%rsi), %edi
movb (%rdi,%rcx), %dil
movb %dil, -0x7(%rsp,%rsi)
incq %rsi
jmp 0x404757
movb -0x7(%rsp), %cl
movb -0x6(%rsp), %sil
shlb $0x2, %cl
movl %esi, %edi
shrb $0x4, %dil
andb $0x3, %dil
orb %cl, %dil
movb %dil, -0x3(%rsp)
shlb $0x4, %sil
movb -0x5(%rsp), %cl
movl %ecx, %edi
shrb $0x2, %dil
andb $0xf, %dil
orb %sil, %dil
movb %dil, -0x2(%rsp)
shlb $0x6, %cl
addb -0x4(%rsp), %cl
movb %cl, -0x1(%rsp)
addq %rax, %rdx
cmpl $0x2, %r10d
movl $0x1, %eax
cmovgel %r10d, %eax
decl %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x4047da
movb -0x3(%rsp,%rcx), %sil
movb %sil, (%rdx,%rcx)
incq %rcx
jmp 0x4047c7
popq %rbx
retq