xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void parse_error(const char *message) {
  if (message)
    fprintf(stderr, "getopt: %s\n", message);
  fputs("Try `getopt --help' for more information.\n", stderr);
  exit(2);
}


x86 assembly (clang, -O0):
<parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <parse_error+0x30>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<parse_error>:
push   %rax
test   %rdi,%rdi
je     114e <parse_error+0x1e>
mov    %rdi,%rdx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    0xeae(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"getopt: %s\0A\00"
@.str.1 = [43 x i8] c"Try `getopt --help' for more information.\0A\00"
define void @parse_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
%10 = load i32, i32* @stderr
%11 = call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"getopt: %s\0A\00"
@.str.1 = [43 x i8] c"Try `getopt --help' for more information.\0A\00"
define void @parse_error(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @exit(i32 2)
unreachable
}
int write(struct img_pixmap *img, struct img_io *io) { return -1; }


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.img_pixmap = type opaque
%struct.img_io = type opaque
define i32 @write(%struct.img_pixmap* %0, %struct.img_io* %1) {
%3 = alloca %struct.img_pixmap*
%4 = alloca %struct.img_io*
store %struct.img_pixmap* %0, %struct.img_pixmap** %3
store %struct.img_io* %1, %struct.img_io** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.img_pixmap = type opaque
%struct.img_io = type opaque
define i32 @write(%struct.img_pixmap* nocapture readnone %0, %struct.img_io* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  int iam, np, i;
#pragma omp parallel private(iam, np, i)
  {
    np = omp_get_num_threads();
    iam = omp_get_thread_num();
#pragma omp critical
    {
      printf("Soy el thread %d, al inicio de la seccion critica\n", iam);
      sleep(1);
      printf("\t\tSoy el thread %d, al final de la seccion critica\n\n\n", iam);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xea8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xec3(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Soy el thread %d, al inicio de la seccion critica\0A\00"
@.str.1 = [54 x i8] c"\09\09Soy el thread %d, al final de la seccion critica\0A\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @omp_get_num_threads()
store i32 %4, i32* %2
%5 = call i32 (...) @omp_get_thread_num()
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @sleep(i32 1)
%9 = load i32, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"Soy el thread %d, al inicio de la seccion critica\0A\00"
@.str.1 = [54 x i8] c"\09\09Soy el thread %d, al final de la seccion critica\0A\0A\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_num_threads()
%2 = tail call i32 (...) @omp_get_thread_num()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ SSL_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_shutdown(int /*<<< orphan*/ *);
void closeSSL(SSL *ssl) {
  SSL_shutdown(ssl);
  SSL_free(ssl);
}


x86 assembly (clang, -O0):
<closeSSL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SSL_shutdown@plt>
mov    -0x8(%rbp),%rdi
call   1030 <SSL_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeSSL>:
push   %rbx
mov    %rdi,%rbx
call   1040 <SSL_shutdown@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <SSL_free@plt>

LLVM IR (-O0):
define void @closeSSL(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @SSL_shutdown(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @SSL_free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @closeSSL(i32* %0) {
%2 = tail call i32 @SSL_shutdown(i32* %0)
%3 = tail call i32 @SSL_free(i32* %0)
ret void
}
void PyThread__init_thread(void) {}


x86 assembly (clang, -O0):
<PyThread__init_thread>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PyThread__init_thread>:
ret

LLVM IR (-O0):
define void @PyThread__init_thread() {
ret void
}

LLVM IR (-O2):
define void @PyThread__init_thread() {
ret void
}
char getchar_str(void *data) {
  char **input;
  input = (char **)data;
  return *(*input)++;
}


x86 assembly (clang, -O0):
<getchar_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar_str>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    (%rax),%al
ret

LLVM IR (-O0):
define signext i8 @getchar_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
store i8** %5, i8*** %3
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %6
%9 = load i8, i8* %7
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @getchar_str(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %2
%5 = load i8, i8* %3
ret i8 %5
}
short tosMemory_peekShort(int base, int offs) {
  return *((short *)(base + offs));
}


x86 assembly (clang, -O0):
<tosMemory_peekShort>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltq
movswl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosMemory_peekShort>:
movslq %esi,%rax
movslq %edi,%rcx
movzwl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
define signext i16 @tosMemory_peekShort(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i16*
%10 = load i16, i16* %9
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @tosMemory_peekShort(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i16*
%6 = load i16, i16* %5
ret i16 %6
}
void string_all_permutation(char *s) {}


x86 assembly (clang, -O0):
<string_all_permutation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_all_permutation>:
ret

LLVM IR (-O0):
define void @string_all_permutation(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @string_all_permutation(i8* nocapture %0) {
ret void
}
void __attribute__((section(".after_vectors"))) MemManage_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<MemManage_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <MemManage_Handler+0x9>
jmp    1109 <MemManage_Handler+0x9>

x86 assembly (clang, -O2):
<MemManage_Handler>:
jmp    1100 <MemManage_Handler>

LLVM IR (-O0):
define void @MemManage_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @MemManage_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ mpl115a2_read_data(void *, float *, float *);
float mpl115a2_pressure(void *_s) {
  float t, p;
  mpl115a2_read_data(_s, &t, &p);
  return p;
}


x86 assembly (clang, -O0):
<mpl115a2_pressure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <mpl115a2_read_data@plt>
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpl115a2_pressure>:
push   %rax
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <mpl115a2_read_data@plt>
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mpl115a2_pressure(i8* %0) {
%2 = alloca i8*
%3 = alloca float
%4 = alloca float
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @mpl115a2_read_data(i8* %5, float* %3, float* %4)
%7 = load float, float* %4
ret float %7
}

LLVM IR (-O2):
define float @mpl115a2_pressure(i8* %0) {
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %2 to i8*
%5 = bitcast float* %3 to i8*
%6 = call i32 @mpl115a2_read_data(i8* %0, float* %2, float* %3)
%7 = load float, float* %3
ret float %7
}
/* Variables and functions */
int mod(int a, int b) {
  if (b < 0) {
    return mod(-a, -b);
  }
  int ret = a % b;
  if (ret < 0) {
    ret += b;
  }
  return ret;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    113f <mod+0x2f>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0xc(%rbp),%esi
call   1030 <mod@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <mod+0x52>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    115c <mod+0x4c>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
test   %esi,%esi
js     110a <mod+0xa>
mov    %esi,%ecx
jmp    111a <mod+0x1a>
mov    %esi,%ecx
nopl   0x0(%rax)
neg    %eax
neg    %ecx
test   %esi,%esi
mov    %ecx,%esi
jg     1110 <mod+0x10>
cltd
idiv   %ecx
mov    %edx,%eax
sar    $0x1f,%eax
and    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sub nsw i32 0, %10
%12 = load i32, i32* %5
%13 = sub nsw i32 0, %12
%14 = call i32 @mod(i32 %11, i32 %13)
store i32 %14, i32* %3
br label %27
15: ; preds = %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = srem i32 %16, %17
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %15
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = add nsw i32 %23, %22
store i32 %24, i32* %6
br label %25
25: ; preds = %21, %15
%26 = load i32, i32* %6
store i32 %26, i32* %3
br label %27
27: ; preds = %25, %9
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = sub nsw i32 0, %6
%8 = sub nsw i32 0, %5
%9 = icmp sgt i32 %5, 0
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi i32 [ %0, %2 ], [ %7, %4 ]
%12 = phi i32 [ %1, %2 ], [ %8, %4 ]
%13 = srem i32 %11, %12
%14 = icmp slt i32 %13, 0
%15 = select i1 %14, i32 %12, i32 0
%16 = add nsw i32 %15, %13
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ EVP_aes_256_cfb();
int do_test_bio_cipher(int /*<<< orphan*/, int);
int test_bio_enc_aes_256_cfb(int idx) {
  return do_test_bio_cipher(EVP_aes_256_cfb(), idx);
}


x86 assembly (clang, -O0):
<test_bio_enc_aes_256_cfb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <EVP_aes_256_cfb@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <do_test_bio_cipher@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bio_enc_aes_256_cfb>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <EVP_aes_256_cfb@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <do_test_bio_cipher@plt>

LLVM IR (-O0):
define i32 @test_bio_enc_aes_256_cfb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @EVP_aes_256_cfb()
%4 = load i32, i32* %2
%5 = call i32 @do_test_bio_cipher(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_bio_enc_aes_256_cfb(i32 %0) {
%2 = tail call i32 (...) @EVP_aes_256_cfb()
%3 = tail call i32 @do_test_bio_cipher(i32 %2, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void tiger_print(char *str) {
  fprintf(stdout, "%s", str);
  return;
}


x86 assembly (clang, -O0):
<tiger_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiger_print>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @tiger_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @tiger_print(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int /*<<< orphan*/);
void foo() { bar(0); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <bar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %edi,%edi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @bar(i32 0)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bar(i32 0)
ret void
}
void UART5_IRQHandler() {}


x86 assembly (clang, -O0):
<UART5_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART5_IRQHandler>:
ret

LLVM IR (-O0):
define void @UART5_IRQHandler() {
ret void
}

LLVM IR (-O2):
define void @UART5_IRQHandler() {
ret void
}
/* Variables and functions */
const char *EMU68error_get(void) { return NULL; }


x86 assembly (clang, -O0):
<EMU68error_get>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMU68error_get>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @EMU68error_get() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @EMU68error_get() {
ret i8* null
}
/* Type definitions */
struct frame_headers {
  int dummy;
};

/* Variables and functions */
size_t dng_get_header_size();
size_t dng_get_image_size(struct frame_headers *);
size_t dng_get_size(struct frame_headers *frame_headers) {
  return dng_get_header_size() + dng_get_image_size(frame_headers);
}


x86 assembly (clang, -O0):
<dng_get_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dng_get_header_size@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dng_get_image_size@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dng_get_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <dng_get_header_size@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <dng_get_image_size@plt>
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.frame_headers = type { i32 }
define i64 @dng_get_size(%struct.frame_headers* %0) {
%2 = alloca %struct.frame_headers*
store %struct.frame_headers* %0, %struct.frame_headers** %2
%3 = call i64 (...) @dng_get_header_size()
%4 = load %struct.frame_headers*, %struct.frame_headers** %2
%5 = call i64 @dng_get_image_size(%struct.frame_headers* %4)
%6 = add i64 %3, %5
ret i64 %6
}

LLVM IR (-O2):
%struct.frame_headers = type { i32 }
define i64 @dng_get_size(%struct.frame_headers* %0) {
%2 = tail call i64 (...) @dng_get_header_size()
%3 = tail call i64 @dng_get_image_size(%struct.frame_headers* %0)
%4 = add i64 %3, %2
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *fp;
  fp = fopen("test.txt", "a");
  fprintf(fp, "Testing...\n");
  fp++;
  fp--;
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32*, i32** %1
%6 = getelementptr inbounds i32, i32* %5, i32 1
store i32* %6, i32** %1
%7 = load i32*, i32** %1
%8 = getelementptr inbounds i32, i32* %7, i32 -1
store i32* %8, i32** %1
%9 = load i32*, i32** %1
%10 = call i32 @fclose(i32* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i64 11, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t a52_get_sync(const uint8_t *p_a52) {
  return (p_a52[0] << 8 | p_a52[1]);
}


x86 assembly (clang, -O0):
<a52_get_sync>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52_get_sync>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @a52_get_sync(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @a52_get_sync(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
char *sbcl_bin_extention(struct install_options *param) { return ".tar.bz2"; }


x86 assembly (clang, -O0):
<sbcl_bin_extention>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcl_bin_extention>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.install_options = type opaque
@.str = [9 x i8] c".tar.bz2\00"
define i8* @sbcl_bin_extention(%struct.install_options* %0) {
%2 = alloca %struct.install_options*
store %struct.install_options* %0, %struct.install_options** %2
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.install_options = type opaque
@.str = [9 x i8] c".tar.bz2\00"
define i8* @sbcl_bin_extention(%struct.install_options* nocapture readnone %0) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int getCap(void *mem) {
  int *p = mem;
  return p[(1)];
}


x86 assembly (clang, -O0):
<getCap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCap>:
mov    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getCap(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @getCap(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int a, b, l, s;
  printf("%d,%d\n", l = 2 * (a + b), s = a * b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
shl    $0x1,%esi
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%edx
imul   -0x8(%rbp),%edx
mov    %edx,-0x10(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d,%d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
%8 = mul nsw i32 2, %7
store i32 %8, i32* %3
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
store i32 %11, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d,%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sta_deauth_ext_usage(void) {
  printf("\nUsage : sta_deauth <STA_MAC_ADDRESS> <REASCON_CODE>\n");
  return;
}


x86 assembly (clang, -O0):
<print_sta_deauth_ext_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sta_deauth_ext_usage>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"\0AUsage : sta_deauth <STA_MAC_ADDRESS> <REASCON_CODE>\0A\00"
define void @print_sta_deauth_ext_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [53 x i8] c"\0AUsage : sta_deauth <STA_MAC_ADDRESS> <REASCON_CODE>\00"
define void @print_sta_deauth_ext_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  int i = 0;
  double num1, num2, tmp;
  num1 = 0;
  num2 = 0;
  tmp = 1;
  while (i < 30) {
    num1 += 10;
    num2 += tmp;
    tmp *= 2;
    i++;
  }
  printf("%.0f %.0f\n", num1, num2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jge    118e <main+0x7e>
movsd  0xebb(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe92(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <main+0x33>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%.0f %.0f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 1.000000e+00, double* %5
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 30
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load double, double* %3
%11 = fadd double %10, 1.000000e+01
store double %11, double* %3
%12 = load double, double* %5
%13 = load double, double* %4
%14 = fadd double %13, %12
store double %14, double* %4
%15 = load double, double* %5
%16 = fmul double %15, 2.000000e+00
store double %16, double* %5
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %6
19: ; preds = %6
%20 = load double, double* %3
%21 = load double, double* %4
%22 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %20, double %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%.0f %.0f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double 3.000000e+02, double 0x41CFFFFFFF800000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: kano-get-start-time <pid>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: kano-get-start-time <pid>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: kano-get-start-time <pid>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("perf\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"perf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"perf\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  char *buf;
  buf = malloc(1 << 31);
  fgets(buf, 1024, stdin);
  printf("Result: %s\n", buf);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x80000000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1040 <fgets@plt>
mov    -0x18(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x80000000,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <fgets@plt>
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [12 x i8] c"Result: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @malloc(i32 -2147483648)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 1024, i32 %9)
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 1
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [12 x i8] c"Result: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(2147483648) i8* @malloc(i32 -2147483648)
%4 = load i32, i32* @stdin
%5 = tail call i32 @fgets(i8* %3, i32 1024, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ drawhouse();
int /*<<< orphan*/ drawrotatedhouse();
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ rotate();
void display() {
  glClear(GL_COLOR_BUFFER_BIT);
  drawhouse();
  rotate();
  drawrotatedhouse();
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1040 <drawhouse@plt>
mov    $0x0,%al
call   1060 <rotate@plt>
mov    $0x0,%al
call   1070 <drawrotatedhouse@plt>
mov    $0x0,%al
call   1050 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1040 <drawhouse@plt>
xor    %eax,%eax
call   1060 <rotate@plt>
xor    %eax,%eax
call   1070 <drawrotatedhouse@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 (...) @drawhouse()
%4 = call i32 (...) @rotate()
%5 = call i32 (...) @drawrotatedhouse()
%6 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 (...) @drawhouse()
%4 = tail call i32 (...) @rotate()
%5 = tail call i32 (...) @drawrotatedhouse()
%6 = tail call i32 (...) @glFlush()
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) void LEPackUint32(uint8_t container[4],
                                           uint32_t data) {
  container[0] = (uint8_t)data;
  container[1] = (uint8_t)(data >> 8);
  container[2] = (uint8_t)(data >> 16);
  container[3] = (uint8_t)(data >> 24);
}


x86 assembly (clang, -O0):
<LEPackUint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEPackUint32>:
movslq %esi,%rax
mov    %rax,(%rdi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rdi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rdi)
sar    $0x18,%eax
cltq
mov    %rax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @LEPackUint32(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
store i64 %6, i64* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = sext i32 %10 to i64
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 1
store i64 %11, i64* %13
%14 = load i32, i32* %4
%15 = ashr i32 %14, 16
%16 = sext i32 %15 to i64
%17 = load i64*, i64** %3
%18 = getelementptr inbounds i64, i64* %17, i64 2
store i64 %16, i64* %18
%19 = load i32, i32* %4
%20 = ashr i32 %19, 24
%21 = sext i32 %20 to i64
%22 = load i64*, i64** %3
%23 = getelementptr inbounds i64, i64* %22, i64 3
store i64 %21, i64* %23
ret void
}

LLVM IR (-O2):
define void @LEPackUint32(i64* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
store i64 %3, i64* %0
%4 = ashr i32 %1, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %5, i64* %6
%7 = ashr i32 %1, 16
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %8, i64* %9
%10 = ashr i32 %1, 24
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %11, i64* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RLFL_wipe_map(unsigned int);
void RLFL_wipe_all() {
  unsigned int i;
  for (i = 0; i < 12; i++) {
    RLFL_wipe_map(i);
  }
}


x86 assembly (clang, -O0):
<RLFL_wipe_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xc,-0x4(%rbp)
jae    113f <RLFL_wipe_all+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <RLFL_wipe_map@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <RLFL_wipe_all+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RLFL_wipe_all>:
push   %rax
xor    %edi,%edi
call   1030 <RLFL_wipe_map@plt>
mov    $0x1,%edi
call   1030 <RLFL_wipe_map@plt>
mov    $0x2,%edi
call   1030 <RLFL_wipe_map@plt>
mov    $0x3,%edi
call   1030 <RLFL_wipe_map@plt>
mov    $0x4,%edi
call   1030 <RLFL_wipe_map@plt>
mov    $0x5,%edi
call   1030 <RLFL_wipe_map@plt>
mov    $0x6,%edi
call   1030 <RLFL_wipe_map@plt>
mov    $0x7,%edi
call   1030 <RLFL_wipe_map@plt>
mov    $0x8,%edi
call   1030 <RLFL_wipe_map@plt>
mov    $0x9,%edi
call   1030 <RLFL_wipe_map@plt>
mov    $0xa,%edi
call   1030 <RLFL_wipe_map@plt>
mov    $0xb,%edi
pop    %rax
jmp    1030 <RLFL_wipe_map@plt>

LLVM IR (-O0):
define void @RLFL_wipe_all() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp ult i32 %3, 12
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @RLFL_wipe_map(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @RLFL_wipe_all() {
%1 = tail call i32 @RLFL_wipe_map(i32 0)
%2 = tail call i32 @RLFL_wipe_map(i32 1)
%3 = tail call i32 @RLFL_wipe_map(i32 2)
%4 = tail call i32 @RLFL_wipe_map(i32 3)
%5 = tail call i32 @RLFL_wipe_map(i32 4)
%6 = tail call i32 @RLFL_wipe_map(i32 5)
%7 = tail call i32 @RLFL_wipe_map(i32 6)
%8 = tail call i32 @RLFL_wipe_map(i32 7)
%9 = tail call i32 @RLFL_wipe_map(i32 8)
%10 = tail call i32 @RLFL_wipe_map(i32 9)
%11 = tail call i32 @RLFL_wipe_map(i32 10)
%12 = tail call i32 @RLFL_wipe_map(i32 11)
ret void
}
/* Variables and functions */
int xorshift8();
char rand3() {
  unsigned char res = 13;
  while (res >= 3) {
    res = xorshift8() & 3;
  }
  return res;
}


x86 assembly (clang, -O0):
<rand3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xd,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x3,%eax
jl     113b <rand3+0x2b>
mov    $0x0,%al
call   1030 <xorshift8@plt>
and    $0x3,%eax
mov    %al,-0x1(%rbp)
jmp    111c <rand3+0xc>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand3>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <xorshift8@plt>
and    $0x3,%al
cmp    $0x3,%al
je     1120 <rand3+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @rand3() {
%1 = alloca i8
store i8 13, i8* %1
br label %2
2: ; preds = %6, %0
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 3
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = call i32 (...) @xorshift8()
%8 = and i32 %7, 3
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
br label %2
10: ; preds = %2
%11 = load i8, i8* %1
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @rand3() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @xorshift8()
%3 = trunc i32 %2 to i8
%4 = and i8 %3, 3
%5 = icmp eq i8 %4, 3
br i1 %5, label %1, label %6
6: ; preds = %1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(char const);
scalar_t__ startsWith(char const *, char const *);
size_t strlen(char const *);
int startsWithWordAlpha(const char *firstWord, const char *string) {
  return startsWith(firstWord, string) && !isalpha(string[strlen(firstWord)]);
}


x86 assembly (clang, -O0):
<startsWithWordAlpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <startsWith@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     118b <startsWithWordAlpha+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
movsbl (%rax,%rcx,1),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWithWordAlpha>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <startsWith@plt>
test   %rax,%rax
je     1161 <startsWithWordAlpha+0x31>
mov    %rbx,%rdi
call   1040 <strlen@plt>
movsbl (%r14,%rax,1),%edi
call   1050 <isalpha@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
jmp    1163 <startsWithWordAlpha+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @startsWithWordAlpha(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @startsWith(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = call i64 @strlen(i8* %11)
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @isalpha(i8 signext %14)
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br label %18
18: ; preds = %9, %2
%19 = phi i1 [ false, %2 ], [ %17, %9 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @startsWithWordAlpha(i8* %0, i8* %1) {
%3 = tail call i64 @startsWith(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @isalpha(i8 signext %8)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ io_hlt();
void HariMain(void) {
finish:
  io_hlt();
  goto finish;
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <HariMain+0x9>
mov    $0x0,%al
call   1030 <io_hlt@plt>
jmp    1119 <HariMain+0x9>

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <io_hlt@plt>
jmp    1120 <HariMain+0x10>

LLVM IR (-O0):
define void @HariMain() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @io_hlt()
br label %1
}

LLVM IR (-O2):
define void @HariMain() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @io_hlt()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ file_type(char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
extern int ends_in_cgi(char *f) { return (strcmp(file_type(f), "cgi") == 0); }


x86 assembly (clang, -O0):
<ends_in_cgi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <file_type@plt>
mov    %eax,%edi
lea    0xec2(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ends_in_cgi>:
push   %rax
call   1040 <file_type@plt>
lea    0xed3(%rip),%rsi
mov    %eax,%edi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cgi\00"
define i32 @ends_in_cgi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @file_type(i8* %3)
%5 = call i64 @strcmp(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"cgi\00"
define i32 @ends_in_cgi(i8* %0) {
%2 = tail call i32 @file_type(i8* %0)
%3 = tail call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int *f1() { return 0; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @f1() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @f1() {
ret i32* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int chown(const char *f, uid_t owner, gid_t group) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<chown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chown>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @chown(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @chown(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_STORE_CTX;
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ SSL_get0_dane(int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_STORE_CTX_set0_dane(int /*<<< orphan*/ *,
                                            int /*<<< orphan*/);
void store_ctx_dane_init(X509_STORE_CTX *store_ctx, SSL *ssl) {
  X509_STORE_CTX_set0_dane(store_ctx, SSL_get0_dane(ssl));
}


x86 assembly (clang, -O0):
<store_ctx_dane_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <SSL_get0_dane@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <X509_STORE_CTX_set0_dane@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_ctx_dane_init>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <SSL_get0_dane@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <X509_STORE_CTX_set0_dane@plt>

LLVM IR (-O0):
define void @store_ctx_dane_init(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @SSL_get0_dane(i32* %6)
%8 = call i32 @X509_STORE_CTX_set0_dane(i32* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @store_ctx_dane_init(i32* %0, i32* %1) {
%3 = tail call i32 @SSL_get0_dane(i32* %1)
%4 = tail call i32 @X509_STORE_CTX_set0_dane(i32* %0, i32 %3)
ret void
}