#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
unsigned char base64_chars_find(unsigned char);
scalar_t__ is_base64(unsigned char const);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, unsigned int);
size_t strlen(unsigned char const *);
size_t base64_decode(unsigned char const *encoded_string, unsigned char *ret,
                     unsigned int retsize) {
  int in_len, i = 0, j = 0, in_ = 0;
  unsigned char char_array_4[4], char_array_3[3];
  memset(ret, 0, retsize);
  in_len = strlen(encoded_string);
  while (in_len-- && (encoded_string[in_] != '=') &&
         is_base64(encoded_string[in_])) {
    char_array_4[i++] = encoded_string[in_];
    in_++;
    if (i == 4) {
      for (i = 0; i < 4; i++)
        char_array_4[i] = base64_chars_find(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) && strlen(ret) < retsize; i++)
        ret[strlen(ret)] = 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_chars_find(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) && strlen(ret) < retsize; j++) {
      ret[strlen(ret)] = char_array_3[j];
    }
  }
  return strlen(ret);
}


x86 assembly (clang, -O0):
<base64_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2c(%rbp)
je     11d0 <base64_decode+0x90>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movzbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x3d,%ecx
mov    %al,-0x2c(%rbp)
je     11d0 <base64_decode+0x90>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1060 <is_base64@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2c(%rbp)
mov    -0x2c(%rbp),%al
test   $0x1,%al
jne    11e0 <base64_decode+0xa0>
jmp    1306 <base64_decode+0x1c6>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x1c(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
cltq
mov    %cl,-0x28(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jne    1301 <base64_decode+0x1c1>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1246 <base64_decode+0x106>
movslq -0x1c(%rbp),%rax
movzbl -0x28(%rbp,%rax,1),%edi
call   1040 <base64_chars_find@plt>
mov    %al,%cl
movslq -0x1c(%rbp),%rax
mov    %cl,-0x28(%rbp,%rax,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1216 <base64_decode+0xd6>
movzbl -0x28(%rbp),%eax
shl    $0x2,%eax
movzbl -0x27(%rbp),%ecx
and    $0x30,%ecx
sar    $0x4,%ecx
add    %ecx,%eax
mov    %al,-0x2b(%rbp)
movzbl -0x27(%rbp),%eax
and    $0xf,%eax
shl    $0x4,%eax
movzbl -0x26(%rbp),%ecx
and    $0x3c,%ecx
sar    $0x2,%ecx
add    %ecx,%eax
mov    %al,-0x2a(%rbp)
movzbl -0x26(%rbp),%eax
and    $0x3,%eax
shl    $0x6,%eax
movzbl -0x25(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x29(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x3,-0x1c(%rbp)
mov    %al,-0x2d(%rbp)
jge    12b3 <base64_decode+0x173>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x14(%rbp),%ecx
cmp    %rcx,%rax
setb   %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
test   $0x1,%al
jne    12c3 <base64_decode+0x183>
jmp    12fa <base64_decode+0x1ba>
movslq -0x1c(%rbp),%rax
mov    -0x2b(%rbp,%rax,1),%al
mov    %al,-0x39(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x39(%rbp),%dl
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    128f <base64_decode+0x14f>
movl   $0x0,-0x1c(%rbp)
jmp    1182 <base64_decode+0x42>
cmpl   $0x0,-0x1c(%rbp)
je     142e <base64_decode+0x2ee>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x4,-0x20(%rbp)
jge    1337 <base64_decode+0x1f7>
movslq -0x20(%rbp),%rax
movb   $0x0,-0x28(%rbp,%rax,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1316 <base64_decode+0x1d6>
movl   $0x0,-0x20(%rbp)
cmpl   $0x4,-0x20(%rbp)
jge    136e <base64_decode+0x22e>
movslq -0x20(%rbp),%rax
movzbl -0x28(%rbp,%rax,1),%edi
call   1040 <base64_chars_find@plt>
mov    %al,%cl
movslq -0x20(%rbp),%rax
mov    %cl,-0x28(%rbp,%rax,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    133e <base64_decode+0x1fe>
movzbl -0x28(%rbp),%eax
shl    $0x2,%eax
movzbl -0x27(%rbp),%ecx
and    $0x30,%ecx
sar    $0x4,%ecx
add    %ecx,%eax
mov    %al,-0x2b(%rbp)
movzbl -0x27(%rbp),%eax
and    $0xf,%eax
shl    $0x4,%eax
movzbl -0x26(%rbp),%ecx
and    $0x3c,%ecx
sar    $0x2,%ecx
add    %ecx,%eax
mov    %al,-0x2a(%rbp)
movzbl -0x26(%rbp),%eax
and    $0x3,%eax
shl    $0x6,%eax
movzbl -0x25(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x29(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x3a(%rbp)
jge    13e2 <base64_decode+0x2a2>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x14(%rbp),%ecx
cmp    %rcx,%rax
setb   %al
mov    %al,-0x3a(%rbp)
mov    -0x3a(%rbp),%al
test   $0x1,%al
jne    13f2 <base64_decode+0x2b2>
jmp    1429 <base64_decode+0x2e9>
movslq -0x20(%rbp),%rax
mov    -0x2b(%rbp,%rax,1),%al
mov    %al,-0x49(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x49(%rbp),%dl
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13b7 <base64_decode+0x277>
jmp    142e <base64_decode+0x2ee>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edx,%r14d
mov    %rsi,%r12
mov    %rdi,%rbp
xor    %r15d,%r15d
mov    %rsi,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %rbp,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
test   %ebx,%ebx
je     136f <base64_decode+0x22f>
mov    %r12,0x20(%rsp)
mov    %r14d,%r14d
xor    %r12d,%r12d
mov    %rbp,0x18(%rsp)
mov    %rbx,0x10(%rsp)
mov    0x20(%rsp),%r13
jmp    11a9 <base64_decode+0x69>
mov    %rbp,%r14
mov    0x18(%rsp),%rbp
mov    0x10(%rsp),%rbx
cmp    %r12d,%ebx
je     12a5 <base64_decode+0x165>
movzbl 0x0(%rbp,%r12,1),%eax
cmp    $0x3d,%al
je     12a5 <base64_decode+0x165>
movzbl %al,%edi
call   1060 <is_base64@plt>
test   %rax,%rax
je     12a5 <base64_decode+0x165>
movzbl 0x0(%rbp,%r12,1),%eax
movslq %r15d,%rcx
add    $0x1,%r15d
mov    %al,0x7(%rsp,%rcx,1)
add    $0x1,%r12
cmp    $0x4,%r15d
jne    11a0 <base64_decode+0x60>
movzbl 0x7(%rsp),%edi
call   1040 <base64_chars_find@plt>
mov    %r14,%rbp
mov    %eax,%r14d
mov    %al,0x7(%rsp)
movzbl 0x8(%rsp),%edi
call   1040 <base64_chars_find@plt>
mov    %eax,%ebx
mov    %al,0x8(%rsp)
movzbl 0x9(%rsp),%edi
call   1040 <base64_chars_find@plt>
mov    %al,0xc(%rsp)
mov    %al,0x9(%rsp)
movzbl 0xa(%rsp),%edi
call   1040 <base64_chars_find@plt>
mov    %al,0xb(%rsp)
mov    %al,0xa(%rsp)
mov    %r13,%rdi
call   1030 <strlen@plt>
xor    %r15d,%r15d
cmp    %rbp,%rax
jae    1193 <base64_decode+0x53>
mov    %ebx,%ecx
shr    $0x4,%cl
and    $0x3,%cl
shl    $0x2,%r14b
or     %cl,%r14b
mov    %r14b,0x0(%r13,%rax,1)
mov    %r13,%rdi
call   1030 <strlen@plt>
cmp    %rbp,%rax
mov    %rbp,%r14
jae    1196 <base64_decode+0x56>
shl    $0x4,%bl
movzbl 0xc(%rsp),%ebp
mov    %ebp,%ecx
shr    $0x2,%cl
and    $0xf,%cl
or     %bl,%cl
mov    %cl,0x0(%r13,%rax,1)
mov    %r13,%rdi
call   1030 <strlen@plt>
cmp    %r14,%rax
jae    1196 <base64_decode+0x56>
shl    $0x6,%bpl
movzbl 0xb(%rsp),%ecx
add    %bpl,%cl
mov    %cl,0x0(%r13,%rax,1)
jmp    1196 <base64_decode+0x56>
test   %r15d,%r15d
mov    0x20(%rsp),%r12
je     136f <base64_decode+0x22f>
mov    %r14,%r13
cmp    $0x3,%r15d
jg     12da <base64_decode+0x19a>
movslq %r15d,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x7,%rdi
mov    $0x3,%edx
sub    %r15d,%edx
add    $0x1,%rdx
xor    %esi,%esi
call   1050 <memset@plt>
movzbl 0x7(%rsp),%edi
call   1040 <base64_chars_find@plt>
mov    %eax,%ebp
mov    %al,0x7(%rsp)
movzbl 0x8(%rsp),%edi
call   1040 <base64_chars_find@plt>
mov    %eax,%r14d
mov    %al,0x8(%rsp)
movzbl 0x9(%rsp),%edi
call   1040 <base64_chars_find@plt>
mov    %eax,%ebx
movzbl 0xa(%rsp),%edi
call   1040 <base64_chars_find@plt>
shl    $0x2,%bpl
mov    %r14d,%ecx
shr    $0x4,%cl
and    $0x3,%cl
or     %bpl,%cl
mov    %cl,0xd(%rsp)
shl    $0x4,%r14b
mov    %ebx,%ecx
shr    $0x2,%cl
and    $0xf,%cl
or     %r14b,%cl
mov    %cl,0xe(%rsp)
shl    $0x6,%bl
add    %al,%bl
mov    %bl,0xf(%rsp)
cmp    $0x2,%r15d
jl     136f <base64_decode+0x22f>
add    $0xffffffff,%r15d
xor    %ebx,%ebx
nopl   (%rax)
mov    %r12,%rdi
call   1030 <strlen@plt>
cmp    %r13,%rax
jae    136f <base64_decode+0x22f>
movzbl 0xd(%rsp,%rbx,1),%ecx
mov    %cl,(%r12,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1350 <base64_decode+0x210>
mov    %r12,%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i64 @base64_decode(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [4 x i8]
%12 = alloca [3 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @memset(i8* %13, i32 0, i32 %14)
%16 = load i8*, i8** %4
%17 = call i64 @strlen(i8* %16)
%18 = trunc i64 %17 to i32
store i32 %18, i32* %7
br label %19
19: ; preds = %132, %3
%20 = load i32, i32* %7
%21 = add nsw i32 %20, -1
store i32 %21, i32* %7
%22 = icmp ne i32 %20, 0
br i1 %22, label %23, label %39
23: ; preds = %19
%24 = load i8*, i8** %4
%25 = load i32, i32* %10
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = icmp ne i32 %29, 61
br i1 %30, label %31, label %39
31: ; preds = %23
%32 = load i8*, i8** %4
%33 = load i32, i32* %10
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = load i8, i8* %35
%37 = call i64 @is_base64(i8 zeroext %36)
%38 = icmp ne i64 %37, 0
br label %39
39: ; preds = %31, %23, %19
%40 = phi i1 [ false, %23 ], [ false, %19 ], [ %38, %31 ]
br i1 %40, label %41, label %133
41: ; preds = %39
%42 = load i8*, i8** %4
%43 = load i32, i32* %10
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %42, i64 %44
%46 = load i8, i8* %45
%47 = load i32, i32* %8
%48 = add nsw i32 %47, 1
store i32 %48, i32* %8
%49 = sext i32 %47 to i64
%50 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 %49
store i8 %46, i8* %50
%51 = load i32, i32* %10
%52 = add nsw i32 %51, 1
store i32 %52, i32* %10
%53 = load i32, i32* %8
%54 = icmp eq i32 %53, 4
br i1 %54, label %55, label %132
55: ; preds = %41
store i32 0, i32* %8
br label %56
56: ; preds = %68, %55
%57 = load i32, i32* %8
%58 = icmp slt i32 %57, 4
br i1 %58, label %59, label %71
59: ; preds = %56
%60 = load i32, i32* %8
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = call zeroext i8 @base64_chars_find(i8 zeroext %63)
%65 = load i32, i32* %8
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 %66
store i8 %64, i8* %67
br label %68
68: ; preds = %59
%69 = load i32, i32* %8
%70 = add nsw i32 %69, 1
store i32 %70, i32* %8
br label %56
71: ; preds = %56
%72 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%73 = load i8, i8* %72
%74 = zext i8 %73 to i32
%75 = shl i32 %74, 2
%76 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 1
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = and i32 %78, 48
%80 = ashr i32 %79, 4
%81 = add nsw i32 %75, %80
%82 = trunc i32 %81 to i8
%83 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
store i8 %82, i8* %83
%84 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 1
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = and i32 %86, 15
%88 = shl i32 %87, 4
%89 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 2
%90 = load i8, i8* %89
%91 = zext i8 %90 to i32
%92 = and i32 %91, 60
%93 = ashr i32 %92, 2
%94 = add nsw i32 %88, %93
%95 = trunc i32 %94 to i8
%96 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 1
store i8 %95, i8* %96
%97 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 2
%98 = load i8, i8* %97
%99 = zext i8 %98 to i32
%100 = and i32 %99, 3
%101 = shl i32 %100, 6
%102 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 3
%103 = load i8, i8* %102
%104 = zext i8 %103 to i32
%105 = add nsw i32 %101, %104
%106 = trunc i32 %105 to i8
%107 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 2
store i8 %106, i8* %107
store i32 0, i32* %8
br label %108
108: ; preds = %128, %71
%109 = load i32, i32* %8
%110 = icmp slt i32 %109, 3
br i1 %110, label %111, label %117
111: ; preds = %108
%112 = load i8*, i8** %5
%113 = call i64 @strlen(i8* %112)
%114 = load i32, i32* %6
%115 = zext i32 %114 to i64
%116 = icmp ult i64 %113, %115
br label %117
117: ; preds = %111, %108
%118 = phi i1 [ false, %108 ], [ %116, %111 ]
br i1 %118, label %119, label %131
119: ; preds = %117
%120 = load i32, i32* %8
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 %121
%123 = load i8, i8* %122
%124 = load i8*, i8** %5
%125 = load i8*, i8** %5
%126 = call i64 @strlen(i8* %125)
%127 = getelementptr inbounds i8, i8* %124, i64 %126
store i8 %123, i8* %127
br label %128
128: ; preds = %119
%129 = load i32, i32* %8
%130 = add nsw i32 %129, 1
store i32 %130, i32* %8
br label %108
131: ; preds = %117
store i32 0, i32* %8
br label %132
132: ; preds = %131, %41
br label %19
133: ; preds = %39
%134 = load i32, i32* %8
%135 = icmp ne i32 %134, 0
br i1 %135, label %136, label %227
136: ; preds = %133
%137 = load i32, i32* %8
store i32 %137, i32* %9
br label %138
138: ; preds = %145, %136
%139 = load i32, i32* %9
%140 = icmp slt i32 %139, 4
br i1 %140, label %141, label %148
141: ; preds = %138
%142 = load i32, i32* %9
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 %143
store i8 0, i8* %144
br label %145
145: ; preds = %141
%146 = load i32, i32* %9
%147 = add nsw i32 %146, 1
store i32 %147, i32* %9
br label %138
148: ; preds = %138
store i32 0, i32* %9
br label %149
149: ; preds = %161, %148
%150 = load i32, i32* %9
%151 = icmp slt i32 %150, 4
br i1 %151, label %152, label %164
152: ; preds = %149
%153 = load i32, i32* %9
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 %154
%156 = load i8, i8* %155
%157 = call zeroext i8 @base64_chars_find(i8 zeroext %156)
%158 = load i32, i32* %9
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 %159
store i8 %157, i8* %160
br label %161
161: ; preds = %152
%162 = load i32, i32* %9
%163 = add nsw i32 %162, 1
store i32 %163, i32* %9
br label %149
164: ; preds = %149
%165 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%166 = load i8, i8* %165
%167 = zext i8 %166 to i32
%168 = shl i32 %167, 2
%169 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 1
%170 = load i8, i8* %169
%171 = zext i8 %170 to i32
%172 = and i32 %171, 48
%173 = ashr i32 %172, 4
%174 = add nsw i32 %168, %173
%175 = trunc i32 %174 to i8
%176 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
store i8 %175, i8* %176
%177 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 1
%178 = load i8, i8* %177
%179 = zext i8 %178 to i32
%180 = and i32 %179, 15
%181 = shl i32 %180, 4
%182 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 2
%183 = load i8, i8* %182
%184 = zext i8 %183 to i32
%185 = and i32 %184, 60
%186 = ashr i32 %185, 2
%187 = add nsw i32 %181, %186
%188 = trunc i32 %187 to i8
%189 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 1
store i8 %188, i8* %189
%190 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 2
%191 = load i8, i8* %190
%192 = zext i8 %191 to i32
%193 = and i32 %192, 3
%194 = shl i32 %193, 6
%195 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 3
%196 = load i8, i8* %195
%197 = zext i8 %196 to i32
%198 = add nsw i32 %194, %197
%199 = trunc i32 %198 to i8
%200 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 2
store i8 %199, i8* %200
store i32 0, i32* %9
br label %201
201: ; preds = %223, %164
%202 = load i32, i32* %9
%203 = load i32, i32* %8
%204 = sub nsw i32 %203, 1
%205 = icmp slt i32 %202, %204
br i1 %205, label %206, label %212
206: ; preds = %201
%207 = load i8*, i8** %5
%208 = call i64 @strlen(i8* %207)
%209 = load i32, i32* %6
%210 = zext i32 %209 to i64
%211 = icmp ult i64 %208, %210
br label %212
212: ; preds = %206, %201
%213 = phi i1 [ false, %201 ], [ %211, %206 ]
br i1 %213, label %214, label %226
214: ; preds = %212
%215 = load i32, i32* %9
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 %216
%218 = load i8, i8* %217
%219 = load i8*, i8** %5
%220 = load i8*, i8** %5
%221 = call i64 @strlen(i8* %220)
%222 = getelementptr inbounds i8, i8* %219, i64 %221
store i8 %218, i8* %222
br label %223
223: ; preds = %214
%224 = load i32, i32* %9
%225 = add nsw i32 %224, 1
store i32 %225, i32* %9
br label %201
226: ; preds = %212
br label %227
227: ; preds = %226, %133
%228 = load i8*, i8** %5
%229 = call i64 @strlen(i8* %228)
ret i64 %229
}

LLVM IR (-O2):
define i64 @base64_decode(i8* nocapture %0, i8* %1, i32 %2) {
%4 = alloca [4 x i8]
%5 = alloca [3 x i8]
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%8 = tail call i32 @memset(i8* %1, i32 0, i32 %2)
%9 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%10 = trunc i64 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %119, label %12
12: ; preds = %3
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
%16 = zext i32 %2 to i64
br label %17
17: ; preds = %12, %66
%18 = phi i64 [ 0, %12 ], [ %33, %66 ]
%19 = phi i32 [ %10, %12 ], [ %21, %66 ]
%20 = phi i32 [ 0, %12 ], [ %67, %66 ]
%21 = add nsw i32 %19, -1
%22 = getelementptr inbounds i8, i8* %0, i64 %18
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 61
br i1 %24, label %69, label %25
25: ; preds = %17
%26 = tail call i64 @is_base64(i8 zeroext %23)
%27 = icmp eq i64 %26, 0
br i1 %27, label %69, label %28
28: ; preds = %25
%29 = load i8, i8* %22
%30 = add nsw i32 %20, 1
%31 = sext i32 %20 to i64
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %31
store i8 %29, i8* %32
%33 = add nuw nsw i64 %18, 1
%34 = icmp eq i32 %30, 4
br i1 %34, label %35, label %66
35: ; preds = %28
%36 = load i8, i8* %6
%37 = tail call zeroext i8 @base64_chars_find(i8 zeroext %36)
store i8 %37, i8* %6
%38 = load i8, i8* %13
%39 = tail call zeroext i8 @base64_chars_find(i8 zeroext %38)
store i8 %39, i8* %13
%40 = load i8, i8* %14
%41 = tail call zeroext i8 @base64_chars_find(i8 zeroext %40)
store i8 %41, i8* %14
%42 = load i8, i8* %15
%43 = tail call zeroext i8 @base64_chars_find(i8 zeroext %42)
store i8 %43, i8* %15
%44 = shl i8 %39, 4
%45 = lshr i8 %41, 2
%46 = and i8 %45, 15
%47 = or i8 %46, %44
%48 = shl i8 %41, 6
%49 = add i8 %43, %48
%50 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%51 = icmp ult i64 %50, %16
br i1 %51, label %52, label %66
52: ; preds = %35
%53 = lshr i8 %39, 4
%54 = and i8 %53, 3
%55 = shl i8 %37, 2
%56 = or i8 %54, %55
%57 = getelementptr inbounds i8, i8* %1, i64 %50
store i8 %56, i8* %57
%58 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%59 = icmp ult i64 %58, %16
br i1 %59, label %60, label %66
60: ; preds = %52
%61 = getelementptr inbounds i8, i8* %1, i64 %58
store i8 %47, i8* %61
%62 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%63 = icmp ult i64 %62, %16
br i1 %63, label %64, label %66
64: ; preds = %60
%65 = getelementptr inbounds i8, i8* %1, i64 %62
store i8 %49, i8* %65
br label %66
66: ; preds = %35, %52, %60, %64, %28
%67 = phi i32 [ %30, %28 ], [ 0, %64 ], [ 0, %60 ], [ 0, %52 ], [ 0, %35 ]
%68 = icmp eq i32 %21, 0
br i1 %68, label %69, label %17
69: ; preds = %25, %17, %66
%70 = phi i32 [ %20, %25 ], [ %20, %17 ], [ %67, %66 ]
%71 = icmp eq i32 %70, 0
br i1 %71, label %119, label %72
72: ; preds = %69
%73 = icmp slt i32 %70, 4
br i1 %73, label %74, label %80
74: ; preds = %72
%75 = sext i32 %70 to i64
%76 = getelementptr [4 x i8], [4 x i8]* %4, i64 0, i64 %75
%77 = sub i32 3, %70
%78 = zext i32 %77 to i64
%79 = add nuw nsw i64 %78, 1
br label %80
80: ; preds = %74, %72
%81 = load i8, i8* %6
%82 = tail call zeroext i8 @base64_chars_find(i8 zeroext %81)
store i8 %82, i8* %6
%83 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
%84 = load i8, i8* %83
%85 = tail call zeroext i8 @base64_chars_find(i8 zeroext %84)
store i8 %85, i8* %83
%86 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
%87 = load i8, i8* %86
%88 = tail call zeroext i8 @base64_chars_find(i8 zeroext %87)
%89 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
%90 = load i8, i8* %89
%91 = tail call zeroext i8 @base64_chars_find(i8 zeroext %90)
%92 = shl i8 %82, 2
%93 = lshr i8 %85, 4
%94 = and i8 %93, 3
%95 = or i8 %94, %92
store i8 %95, i8* %7
%96 = shl i8 %85, 4
%97 = lshr i8 %88, 2
%98 = and i8 %97, 15
%99 = or i8 %98, %96
%100 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 %99, i8* %100
%101 = shl i8 %88, 6
%102 = add i8 %91, %101
%103 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 2
store i8 %102, i8* %103
%104 = icmp sgt i32 %70, 1
br i1 %104, label %105, label %119
105: ; preds = %80
%106 = add nsw i32 %70, -1
%107 = zext i32 %2 to i64
%108 = zext i32 %106 to i64
br label %109
109: ; preds = %105, %113
%110 = phi i64 [ 0, %105 ], [ %117, %113 ]
%111 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%112 = icmp ult i64 %111, %107
br i1 %112, label %113, label %119
113: ; preds = %109
%114 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 %110
%115 = load i8, i8* %114
%116 = getelementptr inbounds i8, i8* %1, i64 %111
store i8 %115, i8* %116
%117 = add nuw nsw i64 %110, 1
%118 = icmp eq i64 %117, %108
br i1 %118, label %119, label %109
119: ; preds = %113, %109, %3, %80, %69
%120 = tail call i64 @strlen(i8* dereferenceable(1) %1)
ret i64 %120
}