// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
testl %esi, %esi
je 0x404a65
xorl %ecx, %ecx
leaq 0xd09df(%rip), %rdx     # 0x4d5390
xorl %eax, %eax
xorl %r14d, %r14d
movb (%rdi,%rcx), %r8b
cmpb $0x3d, %r8b
je 0x404a60
movslq %r14d, %r9
incl %r14d
movb %r8b, 0x9(%rsp,%r9)
cmpl $0x4, %r14d
jne 0x404a53
xorl %r8d, %r8d
movzbl 0x9(%rsp,%r8), %r9d
movb (%r9,%rdx), %r9b
movb %r9b, 0x9(%rsp,%r8)
incq %r8
cmpq $0x4, %r8
jne 0x4049d8
movb 0x9(%rsp), %r8b
movb 0xa(%rsp), %r9b
shlb $0x2, %r8b
movl %r9d, %r10d
shrb $0x4, %r10b
andb $0x3, %r10b
orb %r8b, %r10b
movb %r10b, 0xd(%rsp)
shlb $0x4, %r9b
movb 0xb(%rsp), %r8b
movl %r8d, %r10d
shrb $0x2, %r10b
andb $0xf, %r10b
orb %r9b, %r10b
shlb $0x6, %r8b
addb 0xc(%rsp), %r8b
movb %r10b, 0xe(%rsp)
movb %r8b, 0xf(%rsp)
cltq
movb %r8b, 0x2(%rbx,%rax)
movzwl 0xd(%rsp), %r8d
movw %r8w, (%rbx,%rax)
addl $0x3, %eax
xorl %r14d, %r14d
decl %esi
incq %rcx
testl %esi, %esi
jne 0x4049b6
movslq %eax, %r15
jmp 0x404a6b
xorl %r14d, %r14d
xorl %r15d, %r15d
testl %r14d, %r14d
je 0x404b0a
cmpl $0x3, %r14d
jg 0x404a97
movslq %r14d, %rax
leaq (%rsp,%rax), %rdi
addq $0x9, %rdi
movl $0x3, %edx
subl %r14d, %edx
incq %rdx
xorl %esi, %esi
callq 0x4010e0
xorl %eax, %eax
leaq 0xd08f0(%rip), %rcx     # 0x4d5390
movzbl 0x9(%rsp,%rax), %edx
movb (%rdx,%rcx), %dl
movb %dl, 0x9(%rsp,%rax)
incq %rax
cmpq $0x4, %rax
jne 0x404aa0
movb 0x9(%rsp), %al
movb 0xa(%rsp), %cl
shlb $0x2, %al
movl %ecx, %edx
shrb $0x4, %dl
andb $0x3, %dl
orb %al, %dl
movb %dl, 0xd(%rsp)
shlb $0x4, %cl
movb 0xb(%rsp), %al
movl %eax, %edx
shrb $0x2, %dl
andb $0xf, %dl
orb %cl, %dl
movb %dl, 0xe(%rsp)
shlb $0x6, %al
addb 0xc(%rsp), %al
movb %al, 0xf(%rsp)
cmpl $0x2, %r14d
jl 0x404b0a
decl %r14d
addq %r15, %rbx
leaq 0xd(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x401058
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq