#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 *, char *);
int main() {
  char *base64EncodeOutput;
  Base64Encode("Hello World", &base64EncodeOutput);
  printf("Output (base64): %s\n", base64EncodeOutput);
  char *base64DecodeOutput;
  Base64Decode("SGVsbG8gV29ybGQ=", &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
lea    -0x10(%rbp),%rsi
call   1030 <Base64Encode@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <Base64Decode@plt>
mov    -0x18(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1030 <Base64Encode@plt>
mov    0x10(%rsp),%rsi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <Base64Decode@plt>
mov    0x8(%rsp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [21 x i8] c"Output (base64): %s\0A\00"
@.str.2 = [17 x i8] c"SGVsbG8gV29ybGQ=\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 @Base64Encode(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @Base64Decode(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8** %3)
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %8)
ret i32 0
}

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