int main(void) {
  int len;
  char data[] = "For a simple illumination model this means that we"
                " only apply the ambient term\nfor that light source."
                " First Intersection point in the shadow of the second\nobject"
                "  Also, when a ray hits an object, a reflected ray is gene"
                "rated which i\ntested against all of the objects in the s"
                "cene.\n";
  char *enc, *dec;
  enc = b64encode(data, strlen(data));
  dec = b64decode(enc, &len);
  printf("Original data(%d):\n%s\n\nEncoded data(%x):\n%s\n\nDecoded data"
         "(%x,%d):\n%s\n\n",
         strlen(data), data, enc, enc, dec, len, dec);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x130(%rbp),%rdi
lea    0xe90(%rip),%rsi
mov    $0x11a,%edx
call   1050 <memcpy@plt>
lea    -0x130(%rbp),%rax
mov    %rax,-0x148(%rbp)
lea    -0x130(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x148(%rbp),%rdi
mov    %rax,%rsi
mov    $0x0,%al
call   1070 <b64encode@plt>
cltq
mov    %rax,-0x138(%rbp)
mov    -0x138(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <b64decode@plt>
cltq
mov    %rax,-0x140(%rbp)
lea    -0x130(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
lea    -0x130(%rbp),%rdx
mov    -0x138(%rbp),%rcx
mov    -0x138(%rbp),%r8
mov    -0x140(%rbp),%r9
mov    -0x8(%rbp),%r10d
mov    -0x140(%rbp),%rax
lea    0xf14(%rip),%rdi
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x130,%rsp
lea    0xe9d(%rip),%rsi
lea    0x10(%rsp),%r14
mov    $0x11a,%edx
mov    %r14,%rdi
call   1050 <memcpy@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <b64encode@plt>
movslq %eax,%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <b64decode@plt>
movslq %eax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    0xc(%rsp),%r10d
lea    0xf67(%rip),%rdi
mov    %rax,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %rbx,%r8
mov    %r15,%r9
xor    %eax,%eax
push   %r15
push   %r10
call   1040 <printf@plt>
add    $0x10,%rsp
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.data = [282 x i8] c"For a simple illumination model this means that we only apply the ambient term\0Afor that light source. First Intersection point in the shadow of the second\0Aobject Also, when a ray hits an object, a reflected ray is generated which i\0Atested against all of the objects in the scene.\0A\00"
@.str = [71 x i8] c"Original data(%d):\0A%s\0A\0AEncoded data(%x):\0A%s\0A\0ADecoded data(%x,%d):\0A%s\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [282 x i8]
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
%6 = bitcast [282 x i8]* %3 to i8*
%7 = getelementptr inbounds [282 x i8], [282 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [282 x i8], [282 x i8]* %3, i64 0, i64 0
%9 = call i64 @strlen(i8* %8)
%10 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @b64encode to i32 (i8*, i64, ...)*)(i8* %7, i64 %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @b64decode to i32 (i8*, i32*, ...)*)(i8* %13, i32* %2)
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %5
%17 = getelementptr inbounds [282 x i8], [282 x i8]* %3, i64 0, i64 0
%18 = call i64 @strlen(i8* %17)
%19 = getelementptr inbounds [282 x i8], [282 x i8]* %3, i64 0, i64 0
%20 = load i8*, i8** %4
%21 = load i8*, i8** %4
%22 = load i8*, i8** %5
%23 = load i32, i32* %2
%24 = load i8*, i8** %5
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i64 %18, i8* %19, i8* %20, i8* %21, i8* %22, i32 %23, i8* %24)
ret i32 0
}

LLVM IR (-O2):
@__const.main.data = [282 x i8] c"For a simple illumination model this means that we only apply the ambient term\0Afor that light source. First Intersection point in the shadow of the second\0Aobject Also, when a ray hits an object, a reflected ray is generated which i\0Atested against all of the objects in the scene.\0A\00"
@.str = [71 x i8] c"Original data(%d):\0A%s\0A\0AEncoded data(%x):\0A%s\0A\0ADecoded data(%x,%d):\0A%s\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [282 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [282 x i8], [282 x i8]* %2, i64 0, i64 0
%5 = call i64 @strlen(i8* %4)
%6 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @b64encode to i32 (i8*, i64, ...)*)(i8* %4, i64 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @b64decode to i32 (i8*, i32*, ...)*)(i8* %8, i32* %1)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = call i64 @strlen(i8* %4)
%13 = load i32, i32* %1
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i64 %12, i8* %4, i8* %8, i8* %8, i8* %11, i32 %13, i8* %11)
ret i32 0
}