#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 */
int /*<<< orphan*/ _base64_test_vector(char const *, int /*<<< orphan*/,
                                       char const *);
int /*<<< orphan*/ strlen(char const *);
void test_base64(void) {
  const char **plainp, **base64p;
  static const char *base64_vector[] = {
      "",
      "",
      "f",
      "Zg==",
      "fo",
      "Zm8=",
      "foo",
      "Zm9v",
      "foob",
      "Zm9vYg==",
      "fooba",
      "Zm9vYmE=",
      "foobar",
      "Zm9vYmFy",
      "The quick brown fox jumped over the lazy dogs.",
      "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2dzLg==",
      "It was the best of times, it was the worst of times.",
      "SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN0IG9mIHRpbWVzLg="
      "=",
      "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz",
      "QWFCYkNjRGRFZUZmR2dIaElpSmpLa0xsTW1Obk9vUHBRcVJyU3NUdFV1VnZXd1h4WXlaeg="
      "=",
      "{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }",
      "eyAwLCAxLCAyLCAzLCA0LCA1LCA2LCA3LCA4LCA5IH0=",
      "xyzzy!",
      "eHl6enkh",
      0,
      0,
  };
  plainp = base64_vector;
  base64p = base64_vector + 1;
  while (*plainp && *base64p) {
    _base64_test_vector(*plainp, strlen(*plainp), *base64p);
    plainp += 2;
    base64p += 2;
  }
}


x86 assembly (clang, -O0):
<test_base64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0x2f11(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0x2f06(%rip),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x11(%rbp)
je     1163 <test_base64+0x43>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1173 <test_base64+0x53>
jmp    11b9 <test_base64+0x99>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
call   1030 <_base64_test_vector@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
jmp    1142 <test_base64+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_base64>:
push   %rbx
lea    0x10dd(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <_base64_test_vector@plt>
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xeaf(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_base64_test_vector@plt>
lea    0xea3(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe97(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_base64_test_vector@plt>
lea    0xe8b(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe80(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_base64_test_vector@plt>
lea    0xe74(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe6a(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_base64_test_vector@plt>
lea    0xe62(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe59(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_base64_test_vector@plt>
lea    0xe51(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe49(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_base64_test_vector@plt>
lea    0xe41(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe61(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_base64_test_vector@plt>
lea    0xe91(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xeb7(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_base64_test_vector@plt>
lea    0xeef(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xf15(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_base64_test_vector@plt>
lea    0xf4d(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xf5f(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_base64_test_vector@plt>
lea    0xf7b(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xf73(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_base64_test_vector@plt>

LLVM IR (-O0):
@test_base64.base64_vector = internal global [26 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i32 0, i32 0), i8* null, i8* null]
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"f\00"
@.str.2 = [5 x i8] c"Zg==\00"
@.str.3 = [3 x i8] c"fo\00"
@.str.4 = [5 x i8] c"Zm8=\00"
@.str.5 = [4 x i8] c"foo\00"
@.str.6 = [5 x i8] c"Zm9v\00"
@.str.7 = [5 x i8] c"foob\00"
@.str.8 = [9 x i8] c"Zm9vYg==\00"
@.str.9 = [6 x i8] c"fooba\00"
@.str.10 = [9 x i8] c"Zm9vYmE=\00"
@.str.11 = [7 x i8] c"foobar\00"
@.str.12 = [9 x i8] c"Zm9vYmFy\00"
@.str.13 = [47 x i8] c"The quick brown fox jumped over the lazy dogs.\00"
@.str.14 = [65 x i8] c"VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2dzLg==\00"
@.str.15 = [53 x i8] c"It was the best of times, it was the worst of times.\00"
@.str.16 = [73 x i8] c"SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN0IG9mIHRpbWVzLg==\00"
@.str.17 = [53 x i8] c"AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz\00"
@.str.18 = [73 x i8] c"QWFCYkNjRGRFZUZmR2dIaElpSmpLa0xsTW1Obk9vUHBRcVJyU3NUdFV1VnZXd1h4WXlaeg==\00"
@.str.19 = [33 x i8] c"{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }\00"
@.str.20 = [45 x i8] c"eyAwLCAxLCAyLCAzLCA0LCA1LCA2LCA3LCA4LCA5IH0=\00"
@.str.21 = [7 x i8] c"xyzzy!\00"
@.str.22 = [9 x i8] c"eHl6enkh\00"
define void @test_base64() {
%1 = alloca i8**
%2 = alloca i8**
store i8** getelementptr inbounds ([26 x i8*], [26 x i8*]* @test_base64.base64_vector, i64 0, i64 0), i8*** %1
store i8** getelementptr inbounds ([26 x i8*], [26 x i8*]* @test_base64.base64_vector, i64 0, i64 1), i8*** %2
br label %3
3: ; preds = %13, %0
%4 = load i8**, i8*** %1
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i8**, i8*** %2
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br label %11
11: ; preds = %7, %3
%12 = phi i1 [ false, %3 ], [ %10, %7 ]
br i1 %12, label %13, label %26
13: ; preds = %11
%14 = load i8**, i8*** %1
%15 = load i8*, i8** %14
%16 = load i8**, i8*** %1
%17 = load i8*, i8** %16
%18 = call i32 @strlen(i8* %17)
%19 = load i8**, i8*** %2
%20 = load i8*, i8** %19
%21 = call i32 @_base64_test_vector(i8* %15, i32 %18, i8* %20)
%22 = load i8**, i8*** %1
%23 = getelementptr inbounds i8*, i8** %22, i64 2
store i8** %23, i8*** %1
%24 = load i8**, i8*** %2
%25 = getelementptr inbounds i8*, i8** %24, i64 2
store i8** %25, i8*** %2
br label %3
26: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"f\00"
@.str.2 = [5 x i8] c"Zg==\00"
@.str.3 = [3 x i8] c"fo\00"
@.str.4 = [5 x i8] c"Zm8=\00"
@.str.5 = [4 x i8] c"foo\00"
@.str.6 = [5 x i8] c"Zm9v\00"
@.str.7 = [5 x i8] c"foob\00"
@.str.8 = [9 x i8] c"Zm9vYg==\00"
@.str.9 = [6 x i8] c"fooba\00"
@.str.10 = [9 x i8] c"Zm9vYmE=\00"
@.str.11 = [7 x i8] c"foobar\00"
@.str.12 = [9 x i8] c"Zm9vYmFy\00"
@.str.13 = [47 x i8] c"The quick brown fox jumped over the lazy dogs.\00"
@.str.14 = [65 x i8] c"VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2dzLg==\00"
@.str.15 = [53 x i8] c"It was the best of times, it was the worst of times.\00"
@.str.16 = [73 x i8] c"SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN0IG9mIHRpbWVzLg==\00"
@.str.17 = [53 x i8] c"AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz\00"
@.str.18 = [73 x i8] c"QWFCYkNjRGRFZUZmR2dIaElpSmpLa0xsTW1Obk9vUHBRcVJyU3NUdFV1VnZXd1h4WXlaeg==\00"
@.str.19 = [33 x i8] c"{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }\00"
@.str.20 = [45 x i8] c"eyAwLCAxLCAyLCAzLCA0LCA1LCA2LCA3LCA4LCA5IH0=\00"
@.str.21 = [7 x i8] c"xyzzy!\00"
@.str.22 = [9 x i8] c"eHl6enkh\00"
define void @test_base64() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%11 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%12 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%13 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%14 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%15 = tail call i32 @strlen(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i64 0, i64 0))
%16 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i64 0, i64 0), i32 %15, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.14, i64 0, i64 0))
%17 = tail call i32 @strlen(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.15, i64 0, i64 0))
%18 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.15, i64 0, i64 0), i32 %17, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.16, i64 0, i64 0))
%19 = tail call i32 @strlen(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.17, i64 0, i64 0))
%20 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.17, i64 0, i64 0), i32 %19, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.18, i64 0, i64 0))
%21 = tail call i32 @strlen(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i64 0, i64 0))
%22 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i64 0, i64 0), i32 %21, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.20, i64 0, i64 0))
%23 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0))
%24 = tail call i32 @_base64_test_vector(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), i32 %23, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i64 0, i64 0))
ret void
}