#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*/ Base64Decode(char *, char **);
int /*<<< orphan*/ Base64Encode(char *, char **);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char *base64EncodeOutput;
  char *base64DecodeOutput;
  printf("NOTE:Re-make current program\n");
  Base64Encode("Hello World", &base64EncodeOutput);
  printf("Output (base64): %s\n", base64EncodeOutput);
  Base64Decode(base64EncodeOutput, &base64DecodeOutput);
  printf("Output: %s\n", base64DecodeOutput);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <Base64Encode@plt>
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <Base64Decode@plt>
mov    -0x18(%rbp),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee2(%rip),%rdi
call   1040 <puts@plt>
lea    0xea9(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <Base64Encode@plt>
mov    0x8(%rsp),%rsi
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1060 <Base64Decode@plt>
mov    0x10(%rsp),%rsi
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"NOTE:Re-make current program\0A\00"
@.str.1 = [12 x i8] c"Hello World\00"
@.str.2 = [21 x i8] c"Output (base64): %s\0A\00"
@.str.3 = [12 x i8] c"Output: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @Base64Encode(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %2)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @Base64Decode(i8* %8, i8** %3)
%10 = load i8*, i8** %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"Hello World\00"
@.str.2 = [21 x i8] c"Output (base64): %s\0A\00"
@.str.3 = [12 x i8] c"Output: %s\0A\00"
@str = [29 x i8] c"NOTE:Re-make current program\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = bitcast i8** %1 to i8*
%4 = bitcast i8** %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%6 = call i32 @Base64Encode(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %1)
%7 = load i8*, i8** %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %1
%10 = call i32 @Base64Decode(i8* %9, i8** %2)
%11 = load i8*, i8** %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %11)
ret i32 0
}