xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  register unsigned i, j = 0;
  for (i = 0; i < (150000 * 10); i++)
    j += i;
  printf("Done (%d)\n", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x16e360,-0x8(%rbp)
jae    1151 <main+0x41>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea5(%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
mov    $0xef2e4050,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Done (%d)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp ult i32 %5, 1500000
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add i32 %9, %8
store i32 %10, i32* %3
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Done (%d)\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 -282181552)
ret i32 0
}
void t() {
  char g[100];
  char j[23];
  j[22] = 'd';
  g[0] = 'd';
  g[67] = 'f;';
  g[101] = 'g';
  g[100] = 'f';
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x64,-0x7a(%rbp)
movb   $0x64,-0x70(%rbp)
movb   $0x3b,-0x2d(%rbp)
movb   $0x67,-0xb(%rbp)
movb   $0x66,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @t() {
%1 = alloca [100 x i8]
%2 = alloca [23 x i8]
%3 = getelementptr inbounds [23 x i8], [23 x i8]* %2, i64 0, i64 22
store i8 100, i8* %3
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
store i8 100, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 67
store i8 59, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 101
store i8 103, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 100
store i8 102, i8* %7
ret void
}

LLVM IR (-O2):
define void @t() {
ret void
}
double bot_vector_dot_2d(const double v1[2], const double v2[2]) {
  return v1[0] * v2[0] + v1[1] * v2[1];
}


x86 assembly (clang, -O0):
<bot_vector_dot_2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_vector_dot_2d>:
movsd  0x8(%rdi),%xmm1
mulsd  0x8(%rsi),%xmm1
movsd  (%rdi),%xmm0
mulsd  (%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @bot_vector_dot_2d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
ret double %18
}

LLVM IR (-O2):
define double @bot_vector_dot_2d(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
ret double %10
}
int do_887() { return 887; }


x86 assembly (clang, -O0):
<do_887>:
push   %rbp
mov    %rsp,%rbp
mov    $0x377,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_887() {
ret i32 887
}

LLVM IR (-O2):
define i32 @do_887() {
ret i32 887
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int safe_fclose(FILE **f) {
  int r = 0;
  if (*f)
    r = fclose(*f);
  *f = NULL;
  return r;
}


x86 assembly (clang, -O0):
<safe_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1140 <safe_fclose+0x30>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fclose>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1123 <safe_fclose+0x13>
call   1030 <fclose@plt>
jmp    1125 <safe_fclose+0x15>
xor    %eax,%eax
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @safe_fclose(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
store i32* null, i32** %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int retournerEtatBouton(int);
void testRetournerEtatBouton2() {
  int identifiantBouton;
  int result = retournerEtatBouton(identifiantBouton);
  if (1) {
    printf("%%TEST_FAILED%% time=0 testname=testRetournerEtatBouton2 "
           "(Test_gestioncommandes) message=error message sample\n");
  }
}


x86 assembly (clang, -O0):
<testRetournerEtatBouton2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1040 <retournerEtatBouton@plt>
mov    %eax,-0x8(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testRetournerEtatBouton2>:
push   %rax
call   1040 <retournerEtatBouton@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [111 x i8] c"%%TEST_FAILED%% time=0 testname=testRetournerEtatBouton2 (Test_gestioncommandes) message=error message sample\0A\00"
define void @testRetournerEtatBouton2() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = call i32 @retournerEtatBouton(i32 %3)
store i32 %4, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [111 x i8] c"%%TEST_FAILED%% time=0 testname=testRetournerEtatBouton2 (Test_gestioncommandes) message=error message sample\0A\00"
define void @testRetournerEtatBouton2() {
%1 = tail call i32 @retournerEtatBouton(i32 undef)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ulong;

/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ xfail(char *, int /*<<< orphan*/);
void *xmalloc(size_t size) {
  void *p;
  if ((p = malloc(size)) == NULL)
    xfail("ERROR: xmalloc(): malloc(%lu) failed\n", (ulong)size);
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1155 <xmalloc+0x35>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <xfail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14d,%esi
call   1030 <xfail@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [38 x i8] c"ERROR: xmalloc(): malloc(%lu) failed\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64, i64* %2
%9 = trunc i64 %8 to i32
%10 = call i32 @xfail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [38 x i8] c"ERROR: xmalloc(): malloc(%lu) failed\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = trunc i64 %0 to i32
%6 = tail call i32 @xfail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ displays_expect_null_failed(void *, char const *, int);
void Displayer_display_expect_null_failed(void *act, const char *file,
                                          int line) {
  displays_expect_null_failed(act, file, line);
}


x86 assembly (clang, -O0):
<Displayer_display_expect_null_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <displays_expect_null_failed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Displayer_display_expect_null_failed>:
jmp    1030 <displays_expect_null_failed@plt>

LLVM IR (-O0):
define void @Displayer_display_expect_null_failed(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @displays_expect_null_failed(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @Displayer_display_expect_null_failed(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @displays_expect_null_failed(i8* %0, i8* %1, i32 %2)
ret void
}
void gdSpreadSheet_init() {}


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

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

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

LLVM IR (-O2):
define void @gdSpreadSheet_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void error(char *s) {
  printf("%s\n", s);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(size_t const);
int /*<<< orphan*/ snprintf(char *, size_t const, char *, char const *,
                            char const *, char const *);
char *concat_three_str(const size_t bufsize, const char *str1, const char *str2,
                       const char *str3) {
  char *buf = (char *)malloc(bufsize);
  snprintf(buf, bufsize, "%s%s%s", str1, str2, str3);
  return buf;
}


x86 assembly (clang, -O0):
<concat_three_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xea0(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat_three_str>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r13
lea    0xebc(%rip),%rdx
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1030 <snprintf@plt>
mov    %r13,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s%s%s\00"
define i8* @concat_three_str(i64 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i64 %0, i64* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i64, i64* %5
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %9
%13 = load i8*, i8** %9
%14 = load i64, i64* %5
%15 = load i8*, i8** %6
%16 = load i8*, i8** %7
%17 = load i8*, i8** %8
%18 = call i32 @snprintf(i8* %13, i64 %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16, i8* %17)
%19 = load i8*, i8** %9
ret i8* %19
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%s%s\00"
define i8* @concat_three_str(i64 %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i64 @malloc(i64 %0)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @snprintf(i8* %6, i64 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pdispatch_unref() {
  printf("NOT IMPLEMENTED:"
         "pa_pdispatch_unref"
         "\n");
}


x86 assembly (clang, -O0):
<pa_pdispatch_unref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"NOT IMPLEMENTED:pa_pdispatch_unref\0A\00"
define i32 @pa_pdispatch_unref() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_pdispatch_unref\00"
define i32 @pa_pdispatch_unref() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _sim_check_for_interrupts();
void port_wait_for_interrupt(void) { _sim_check_for_interrupts(); }


x86 assembly (clang, -O0):
<port_wait_for_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_sim_check_for_interrupts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_wait_for_interrupt>:
xor    %eax,%eax
jmp    1030 <_sim_check_for_interrupts@plt>

LLVM IR (-O0):
define void @port_wait_for_interrupt() {
%1 = call i32 (...) @_sim_check_for_interrupts()
ret void
}

LLVM IR (-O2):
define void @port_wait_for_interrupt() {
%1 = tail call i32 (...) @_sim_check_for_interrupts()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
float *malloc(int);
int /*<<< orphan*/ stderr;
__attribute__((no)) int t2(void) {
  float *ptr_to_undef_float = malloc(sizeof(float));
  float undef_float = *ptr_to_undef_float;
  fprintf(stderr, "\nUndef 2 of 3 (32-bit FP)\n");
  return (undef_float < (float)234.56 ? 13 : 24);
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
movss  -0xc(%rbp),%xmm1
movss  0xe9b(%rip),%xmm0
mov    $0x18,%eax
mov    $0xd,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%edi
lea    0xec9(%rip),%rsi
movss  0xebd(%rip),%xmm0
ucomiss (%rax),%xmm0
mov    $0xd,%eax
mov    $0x18,%ebx
cmova  %eax,%ebx
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"\0AUndef 2 of 3 (32-bit FP)\0A\00"
define i32 @t2() {
%1 = alloca float*
%2 = alloca float
%3 = call float* @malloc(i32 4)
store float* %3, float** %1
%4 = load float*, float** %1
%5 = load float, float* %4
store float %5, float* %2
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = load float, float* %2
%9 = fcmp olt float %8, 0x406D51EB80000000
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 13, i32 24
ret i32 %11
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"\0AUndef 2 of 3 (32-bit FP)\0A\00"
define i32 @t2() {
%1 = tail call float* @malloc(i32 4)
%2 = load float, float* %1
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = fcmp olt float %2, 0x406D51EB80000000
%6 = select i1 %5, i32 13, i32 24
ret i32 %6
}
void g_io_create_watch() {}


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

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

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

LLVM IR (-O2):
define void @g_io_create_watch() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ main();
void main_rpc() {
  main();
  exit(0);
}


x86 assembly (clang, -O0):
<main_rpc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <main@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main_rpc>:
push   %rax
xor    %eax,%eax
call   1030 <main@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @main_rpc() {
%1 = call i32 (...) @main()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @main_rpc() {
%1 = tail call i32 (...) @main()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float sin(float);
float wssin_(float *x) { return sin(*x); }


x86 assembly (clang, -O0):
<wssin_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wssin_>:
movss  (%rdi),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define float @wssin_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call float @sin(float %4)
ret float %5
}

LLVM IR (-O2):
define float @wssin_(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @sin(float %2)
ret float %3
}
/* Variables and functions */
long round(double value) {
  long intpart;
  intpart = (long)value;
  value = value - intpart;
  if (value >= 0.5)
    intpart++;
  return intpart;
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     114a <round+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
ucomisd 0xeea(%rip),%xmm0
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @round(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
store i64 %5, i64* %3
%6 = load double, double* %2
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
%9 = fsub double %6, %8
store double %9, double* %2
%10 = load double, double* %2
%11 = fcmp oge double %10, 5.000000e-01
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %1
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @round(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fcmp oge double %4, 5.000000e-01
%6 = zext i1 %5 to i64
%7 = add nsw i64 %6, %2
ret i64 %7
}
int sum_last_bits(int n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else {
    return 2 * (sum_last_bits(n - 1)) + 1;
  }
}


x86 assembly (clang, -O0):
<sum_last_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <sum_last_bits+0x21>
movl   $0x0,-0x4(%rbp)
jmp    115b <sum_last_bits+0x4b>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <sum_last_bits+0x37>
movl   $0x1,-0x4(%rbp)
jmp    115b <sum_last_bits+0x4b>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sum_last_bits@plt>
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_last_bits>:
test   %edi,%edi
je     111e <sum_last_bits+0xe>
cmp    $0x1,%edi
jne    1121 <sum_last_bits+0x11>
mov    $0x1,%edi
mov    %edi,%eax
ret
push   %rax
add    $0xffffffff,%edi
call   1030 <sum_last_bits@plt>
add    %eax,%eax
add    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @sum_last_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %17
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %17
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = call i32 @sum_last_bits(i32 %13)
%15 = mul nsw i32 2, %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @sum_last_bits(i32 %0) {
switch i32 %0, label %5 [
i32 0, label %3
i32 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %2, %1, %5
%4 = phi i32 [ %9, %5 ], [ 1, %2 ], [ %0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @sum_last_bits(i32 %6)
%8 = shl nsw i32 %7, 1
%9 = or i32 %8, 1
br label %3
}
int p2(int *a, int *b) {
  int c;
  c = *a;
  *a = *b;
  *b = c + 1;
  return c;
}


x86 assembly (clang, -O0):
<p2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p2>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
lea    0x1(%rax),%ecx
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define i32 @p2(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = load i32*, i32** %4
store i32 %12, i32* %13
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @p2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
%5 = add nsw i32 %3, 1
store i32 %5, i32* %1
ret i32 %3
}
void UI_method_set_writer(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_method_set_writer() {
ret void
}
void nop(int *p) {}


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

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

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

LLVM IR (-O2):
define void @nop(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int smp_id();
void ipi_test(void *data) {
  int n = (long)data;
  printf("ipi called, cpu %d\n", n);
  if (n != smp_id())
    printf("but wrong cpu %d\n", smp_id());
}


x86 assembly (clang, -O0):
<ipi_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <smp_id@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
je     1171 <ipi_test+0x51>
mov    $0x0,%al
call   1030 <smp_id@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipi_test>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <smp_id@plt>
cmp    %ebx,%eax
jne    113f <ipi_test+0x1f>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <smp_id@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"ipi called, cpu %d\0A\00"
@.str.1 = [18 x i8] c"but wrong cpu %d\0A\00"
define void @ipi_test(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = call i32 (...) @smp_id()
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = call i32 (...) @smp_id()
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"ipi called, cpu %d\0A\00"
@.str.1 = [18 x i8] c"but wrong cpu %d\0A\00"
define void @ipi_test(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @smp_id()
%6 = icmp eq i32 %5, %3
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = tail call i32 (...) @smp_id()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %1
ret void
}
int max3(int a, int b, int c) {
  if (a > b) {
    if (a > c)
      return a;
    else
      return c;
  }
  if (b > c)
    return b;
  return c;
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <max3+0x3b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1130 <max3+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max3+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max3+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1152 <max3+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max3+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
mov    %edx,%eax
cmp    %edx,%edi
cmovg  %edi,%eax
cmp    %esi,%eax
cmovle %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned bitCountUInt32(uint32_t v) {
  v = v - ((v >> 1) & (uint32_t)0x55555555UL);
  v = (v & (uint32_t)0x33333333UL) + ((v >> 2) & (uint32_t)0x33333333UL);
  return (((v + (v >> 4)) & (uint32_t)0xF0F0F0FUL) * (uint32_t)0x1010101UL) >>
         24;
}


x86 assembly (clang, -O0):
<bitCountUInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
sar    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitCountUInt32>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @bitCountUInt32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = sub nsw i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add nsw i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 4
%17 = add nsw i32 %14, %16
%18 = and i32 %17, 252645135
%19 = mul nsw i32 %18, 16843009
%20 = ashr i32 %19, 24
ret i32 %20
}

LLVM IR (-O2):
define i32 @bitCountUInt32(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub nsw i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul nsw i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ be_nice_to_people();
int /*<<< orphan*/ vulnerable_function();
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main(int argc, char **argv) {
  be_nice_to_people();
  vulnerable_function();
  write(STDOUT_FILENO, "Hello, World\n", 13);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <be_nice_to_people@plt>
mov    $0x0,%al
call   1040 <vulnerable_function@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <be_nice_to_people@plt>
xor    %eax,%eax
call   1040 <vulnerable_function@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [14 x i8] c"Hello, World\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @be_nice_to_people()
%6 = call i32 (...) @vulnerable_function()
%7 = load i32, i32* @STDOUT_FILENO
%8 = call i32 @write(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [14 x i8] c"Hello, World\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @be_nice_to_people()
%4 = tail call i32 (...) @vulnerable_function()
%5 = load i32, i32* @STDOUT_FILENO
%6 = tail call i32 @write(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int SIGINT;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void termhandler(int sig) {
  if (sig == SIGINT) {
    cleanup();
    exit(EXIT_SUCCESS);
  }
}


x86 assembly (clang, -O0):
<termhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    1152 <termhandler+0x32>
mov    $0x0,%al
call   1030 <cleanup@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termhandler>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
je     112e <termhandler+0xe>
pop    %rax
ret
xor    %eax,%eax
call   1030 <cleanup@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@EXIT_SUCCESS = global i32 0
define void @termhandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 (...) @cleanup()
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@EXIT_SUCCESS = global i32 0
define void @termhandler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (...) @cleanup()
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void idle(void) {
  puts("IDLE Running!\n\r");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<idle>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
jmp    1120 <idle+0x10>

x86 assembly (clang, -O2):
<idle>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <idle+0x10>

LLVM IR (-O0):
@.str = [16 x i8] c"IDLE Running!\0A\0D\00"
define void @idle() {
%1 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@.str = [16 x i8] c"IDLE Running!\0A\0D\00"
define void @idle() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *);
main() {
  int c;
  while (getchar() != EOF)
    printf("1");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
je     1157 <main+0x37>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%rax
je     1156 <main+0x36>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x31,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%rax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [2 x i8] c"1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %3
9: ; preds = %3
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 @putchar(i32 49)
%6 = tail call i64 (...) @getchar()
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ PKCS7;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int PEM_ASN1_write(int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_PKCS7;
scalar_t__ i2d_PKCS7;
int PEM_write_PKCS7(FILE *fp, PKCS7 *x) {
  return PEM_ASN1_write((i2d_of_void *)i2d_PKCS7, PEM_STRING_PKCS7, fp, x, NULL,
                        NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_PKCS7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_PKCS7>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebf(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_PKCS7 = global i64 0
@PEM_STRING_PKCS7 = global i32 0
define i32 @PEM_write_PKCS7(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_PKCS7
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_PKCS7
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_PKCS7 = global i64 0
@PEM_STRING_PKCS7 = global i32 0
define i32 @PEM_write_PKCS7(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_PKCS7
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_PKCS7
%6 = tail call i32 @PEM_ASN1_write(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t div_u64(uint64_t n, uint32_t d) { return n / d; }


x86 assembly (clang, -O0):
<div_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_u64>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @div_u64(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @div_u64(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
int dzzIntDivide(int numerator, int denominator) {
  return numerator / denominator;
}


x86 assembly (clang, -O0):
<dzzIntDivide>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dzzIntDivide>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @dzzIntDivide(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @dzzIntDivide(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double hmmgetrand(void) { return (double)rand() / RAND_MAX; }


x86 assembly (clang, -O0):
<hmmgetrand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmmgetrand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @hmmgetrand() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @hmmgetrand() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
/* Type definitions */
struct hdr_histogram {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ lowest_equivalent_value(struct hdr_histogram *,
                                           int /*<<< orphan*/);
int64_t hdr_lowest_equivalent_value(struct hdr_histogram *h, int64_t value) {
  return lowest_equivalent_value(h, value);
}


x86 assembly (clang, -O0):
<hdr_lowest_equivalent_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <lowest_equivalent_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdr_lowest_equivalent_value>:
jmp    1030 <lowest_equivalent_value@plt>

LLVM IR (-O0):
%struct.hdr_histogram = type { i32 }
define i32 @hdr_lowest_equivalent_value(%struct.hdr_histogram* %0, i32 %1) {
%3 = alloca %struct.hdr_histogram*
%4 = alloca i32
store %struct.hdr_histogram* %0, %struct.hdr_histogram** %3
store i32 %1, i32* %4
%5 = load %struct.hdr_histogram*, %struct.hdr_histogram** %3
%6 = load i32, i32* %4
%7 = call i32 @lowest_equivalent_value(%struct.hdr_histogram* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.hdr_histogram = type { i32 }
define i32 @hdr_lowest_equivalent_value(%struct.hdr_histogram* %0, i32 %1) {
%3 = tail call i32 @lowest_equivalent_value(%struct.hdr_histogram* %0, i32 %1)
ret i32 %3
}
void glGetUniformfv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetUniformfv() {
ret void
}
int main(void) {
  volatile int x = 5;
  *(volatile int *)&x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x5,-0x4(%rsp)
mov    -0x4(%rsp),%eax
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store volatile i32 5, i32* %2
%3 = load volatile i32, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 5, i32* %1
%3 = load volatile i32, i32* %1
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (i != 0) {
    if (-5 <= i && i <= 35) {
      if (i < 0) {
        i = -5;
      } else {
        if (i > 30) {
          i = 35;
        } else {
          i = i - 1;
        }
      }
    } else {
      i = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1196 <main+0x86>
mov    $0xfffffffb,%eax
cmp    -0x8(%rbp),%eax
jg     118a <main+0x7a>
cmpl   $0x23,-0x8(%rbp)
jg     118a <main+0x7a>
cmpl   $0x0,-0x8(%rbp)
jge    1161 <main+0x51>
movl   $0xfffffffb,-0x8(%rbp)
jmp    1185 <main+0x75>
cmpl   $0x1e,-0x8(%rbp)
jle    1177 <main+0x67>
movl   $0x23,-0x8(%rbp)
jmp    1180 <main+0x70>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1185 <main+0x75>
jmp    1191 <main+0x81>
movl   $0x0,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(char);
void main(void) { foo('a'); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x61,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @foo(i8 signext 97)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @foo(i8 signext 97)
ret void
}