// File: /workspace/github_c_makefile_star2_O3/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:
testl %esi, %esi
je 0x404ace
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
xorl %eax, %eax
leaq 0xd19e3(%rip), %r15     # 0x4d6360
xorl %r12d, %r12d
xorl %r14d, %r14d
movb (%rdi,%rax), %cl
cmpb $0x3d, %cl
je 0x404a20
movslq %r14d, %rdx
incl %r14d
movb %cl, 0x1(%rsp,%rdx)
cmpl $0x4, %r14d
jne 0x404a13
xorl %ecx, %ecx
movzbl 0x1(%rsp,%rcx), %edx
movb (%rdx,%r15), %dl
movb %dl, 0x1(%rsp,%rcx)
incq %rcx
cmpq $0x4, %rcx
jne 0x4049a1
movb 0x1(%rsp), %cl
movb 0x2(%rsp), %dl
shlb $0x2, %cl
movl %edx, %r8d
shrb $0x4, %r8b
andb $0x3, %r8b
orb %cl, %r8b
movb %r8b, 0x5(%rsp)
shlb $0x4, %dl
movb 0x3(%rsp), %cl
movl %ecx, %r8d
shrb $0x2, %r8b
andb $0xf, %r8b
orb %dl, %r8b
shlb $0x6, %cl
addb 0x4(%rsp), %cl
movb %r8b, 0x6(%rsp)
movb %cl, 0x7(%rsp)
movslq %r12d, %r12
movb %cl, 0x2(%rbx,%r12)
movzwl 0x5(%rsp), %ecx
movw %cx, (%rbx,%r12)
addl $0x3, %r12d
xorl %r14d, %r14d
decl %esi
incq %rax
testl %esi, %esi
jne 0x404983
testl %r14d, %r14d
je 0x404ac3
cmpl $0x3, %r14d
jg 0x404a4b
movslq %r14d, %rax
leaq (%rsp,%rax), %rdi
incq %rdi
movl $0x3, %edx
subl %r14d, %edx
incq %rdx
xorl %esi, %esi
callq 0x4010e0
movslq %r12d, %rax
xorl %ecx, %ecx
movzbl 0x1(%rsp,%rcx), %edx
movb (%rdx,%r15), %dl
movb %dl, 0x1(%rsp,%rcx)
incq %rcx
cmpq $0x4, %rcx
jne 0x404a50
movb 0x1(%rsp), %cl
movb 0x2(%rsp), %dl
shlb $0x2, %cl
movl %edx, %esi
shrb $0x4, %sil
andb $0x3, %sil
orb %cl, %sil
movb %sil, 0x5(%rsp)
shlb $0x4, %dl
movb 0x3(%rsp), %cl
movl %ecx, %esi
shrb $0x2, %sil
andb $0xf, %sil
orb %dl, %sil
movb %sil, 0x6(%rsp)
shlb $0x6, %cl
addb 0x4(%rsp), %cl
movb %cl, 0x7(%rsp)
cmpl $0x2, %r14d
jl 0x404ac3
decl %r14d
addq %rax, %rbx
leaq 0x5(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x401058
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq