xunge/DecIR huggingface dataset:
/* Variables and functions */
int StatMomentDouble(double *, int, int, int);
double StatVarDouble(double a[], int n, int s) {
  return StatMomentDouble(a, n, s, 2) / (n - 1);
}


x86 assembly (clang, -O0):
<StatVarDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x2,%ecx
call   1030 <StatMomentDouble@plt>
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatVarDouble>:
push   %rbx
mov    %esi,%ebx
mov    $0x2,%ecx
call   1030 <StatMomentDouble@plt>
add    $0xffffffff,%ebx
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @StatVarDouble(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @StatMomentDouble(double* %7, i32 %8, i32 %9, i32 2)
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 1
%13 = sdiv i32 %10, %12
%14 = sitofp i32 %13 to double
ret double %14
}

LLVM IR (-O2):
define double @StatVarDouble(double* %0, i32 %1, i32 %2) {
%4 = tail call i32 @StatMomentDouble(double* %0, i32 %1, i32 %2, i32 2)
%5 = add nsw i32 %1, -1
%6 = sdiv i32 %4, %5
%7 = sitofp i32 %6 to double
ret double %7
}
int fun279() { return 279; }


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

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

LLVM IR (-O0):
define i32 @fun279() {
ret i32 279
}

LLVM IR (-O2):
define i32 @fun279() {
ret i32 279
}
void TestIsUnit(void) {
  (void)0;
  (void)0;
  (void)0;
  (void)0;
}


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

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

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

LLVM IR (-O2):
define void @TestIsUnit() {
ret void
}
/* Variables and functions */
int example_dll_function();
int example_exe_function();
int main(void) { return example_dll_function() + example_exe_function(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <example_dll_function@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <example_exe_function@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <example_dll_function@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <example_exe_function@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @example_dll_function()
%3 = call i32 (...) @example_exe_function()
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @example_dll_function()
%2 = tail call i32 (...) @example_exe_function()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void SilentFreeLibrary(void *lib) { dlclose(lib); }


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

x86 assembly (clang, -O2):
<SilentFreeLibrary>:
jmp    1030 <dlclose@plt>

LLVM IR (-O0):
define void @SilentFreeLibrary(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @dlclose(i8* %3)
ret void
}

LLVM IR (-O2):
define void @SilentFreeLibrary(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
void gtk_text_attributes_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_attributes_new() {
ret void
}
void INT_Excep_TPU9_TGI9C(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU9_TGI9C() {
ret void
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
wchar_t *(wcschrnul)(const wchar_t *string, wchar_t c) {
  for (;; string++)
    if (*string == c)
      return string;
    else if (!*string)
      return string;
}


x86 assembly (clang, -O0):
<wcschrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    112a <wcschrnul+0x2a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <wcschrnul+0x60>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1145 <wcschrnul+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <wcschrnul+0x60>
jmp    114a <wcschrnul+0x4a>
jmp    114f <wcschrnul+0x4f>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <wcschrnul+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcschrnul>:
mov    %rdi,%rax
add    $0xfffffffffffffff8,%rax
nopw   0x0(%rax,%rax,1)
mov    0x8(%rax),%rcx
add    $0x8,%rax
cmp    %rsi,%rcx
je     1122 <wcschrnul+0x22>
test   %rcx,%rcx
jne    1110 <wcschrnul+0x10>
ret

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

LLVM IR (-O2):
define i64* @wcschrnul(i64* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64* [ %0, %2 ], [ %9, %3 ]
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, %1
%7 = icmp eq i64 %5, 0
%8 = or i1 %6, %7
%9 = getelementptr inbounds i64, i64* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i64* %4
}
void RTDirCreateFullPath(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDirCreateFullPath() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  printf("%f\n", (float)333334126.98);
  printf("%f\n", (float)333334125.31);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee9(%rip),%rdi
movss  0xedd(%rip),%xmm0
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
movss  0xec9(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeec(%rip),%rbx
movss  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
movss  0xecd(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x41B3DE4660000000)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x41B3DE4660000000)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x41B3DE4660000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x41B3DE4660000000)
ret i32 0
}
int getLimit(int level) {
  switch (level) {
  case 2:
    return 10;
  case 3:
    return 18;
  case 4:
    return 30;
  case 5:
    return 45;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<getLimit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1160 <getLimit+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xa,-0x4(%rbp)
jmp    1167 <getLimit+0x67>
movl   $0x12,-0x4(%rbp)
jmp    1167 <getLimit+0x67>
movl   $0x1e,-0x4(%rbp)
jmp    1167 <getLimit+0x67>
movl   $0x2d,-0x4(%rbp)
jmp    1167 <getLimit+0x67>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLimit>:
add    $0xfffffffe,%edi
mov    $0xffffffff,%eax
cmp    $0x3,%edi
ja     111a <getLimit+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getLimit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 2, label %5
i32 3, label %6
i32 4, label %7
i32 5, label %8
]
5: ; preds = %1
store i32 10, i32* %2
br label %10
6: ; preds = %1
store i32 18, i32* %2
br label %10
7: ; preds = %1
store i32 30, i32* %2
br label %10
8: ; preds = %1
store i32 45, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.getLimit = [4 x i32] [i32 10, i32 18, i32 30, i32 45]
define i32 @getLimit(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.getLimit, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
void foo343() {}


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

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

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

LLVM IR (-O2):
define void @foo343() {
ret void
}
int intAsVoidCompare(void *a, void *b) {
  int i = *((int *)a);
  int j = *((int *)b);
  return i - j;
}


x86 assembly (clang, -O0):
<intAsVoidCompare>:
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),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intAsVoidCompare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @intAsVoidCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int baz(int n) {
  int i = 0;
  while (n >= 64) {
    i++;
    n -= 64;
  }
  return i;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x40,-0x4(%rbp)
jl     112f <baz+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x40,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <baz+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
xor    %eax,%eax
cmp    $0x40,%edi
jl     111f <baz+0x1f>
cmp    $0x7f,%edi
mov    $0x7f,%eax
cmovl  %edi,%eax
neg    %eax
add    %edi,%eax
add    $0x3f,%eax
shr    $0x6,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @baz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 64
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 64
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @baz(i32 %0) {
%2 = icmp sgt i32 %0, 63
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = add nuw i32 %0, 63
%5 = call i32 @llvm.smin.i32(i32 %0, i32 127)
%6 = sub nuw i32 %4, %5
%7 = lshr i32 %6, 6
%8 = add nuw nsw i32 %7, 1
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *,
                           char const *, char const *);
int gfun_h(FILE *f, const char *op, const char *ops, const char *type1,
           const char *type2) {
  fprintf(f,
          "tuple_cell op_numeric_%s_%s_%s(const tuple_cell &a1, const "
          "tuple_cell &a2);\n",
          op, type1, type2);
  return 0;
}


x86 assembly (clang, -O0):
<gfun_h>:
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    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfun_h>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [77 x i8] c"tuple_cell op_numeric_%s_%s_%s(const tuple_cell &a1, const tuple_cell &a2);\0A\00"
define i32 @gfun_h(i32* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %9
%14 = load i8*, i8** %10
%15 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [77 x i8] c"tuple_cell op_numeric_%s_%s_%s(const tuple_cell &a1, const tuple_cell &a2);\0A\00"
define i32 @gfun_h(i32* nocapture %0, i8* %1, i8* nocapture readnone %2, i8* %3, i8* %4) {
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3, i8* %4)
ret i32 0
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 20;
  int b = 100;
  int result = gcd(a, b);
  printf("%d\n", result);
  printf("%d\n", sizeof(int));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <gcd@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x14,%edi
mov    $0x64,%esi
call   1040 <gcd@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @gcd(i32 20, i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
float dlinear(float z) { return 1.0; }


x86 assembly (clang, -O0):
<dlinear>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlinear>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @dlinear(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 1.000000e+00
}

LLVM IR (-O2):
define float @dlinear(float %0) {
ret float 1.000000e+00
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_bool(uint16_t value, uint16_t mask) {
  if ((value & mask) == 0) {
    printf("False");
  } else {
    printf("True");
  }
}


x86 assembly (clang, -O0):
<print_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    113e <print_bool+0x2e>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    114a <print_bool+0x3a>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bool>:
test   %edi,%esi
lea    0xee7(%rip),%rax
lea    0xee6(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"False\00"
@.str.1 = [5 x i8] c"True\00"
define void @print_bool(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 = and i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"False\00"
@.str.1 = [5 x i8] c"True\00"
define void @print_bool(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* dereferenceable(1) %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void _unloadlib(size_t hlib) { dlclose((void *)hlib); }


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

x86 assembly (clang, -O2):
<_unloadlib>:
jmp    1030 <dlclose@plt>

LLVM IR (-O0):
define void @_unloadlib(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
%5 = call i32 @dlclose(i8* %4)
ret void
}

LLVM IR (-O2):
define void @_unloadlib(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = tail call i32 @dlclose(i8* %2)
ret void
}
float fn2(float a) { return a + 2.0; }


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
addss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fn2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 2.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @fn2(float %0) {
%2 = fadd float %0, 2.000000e+00
ret float %2
}
__attribute__((always_)) void wrmsrl(unsigned long msr,
                                     unsigned long long val) {
  unsigned long lo, hi;
  lo = (unsigned long)val;
  hi = val >> 32;
  __asm__ __volatile__("wrmsr" : : "c"(msr), "a"(lo), "d"(hi));
}


x86 assembly (clang, -O0):
<wrmsrl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdx
wrmsr
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrmsrl>:
mov    %rsi,%rax
mov    %rdi,%rcx
mov    %rsi,%rdx
shr    $0x20,%rdx
wrmsr
ret

LLVM IR (-O0):
define void @wrmsrl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
store i64 %7, i64* %5
%8 = load i64, i64* %4
%9 = lshr i64 %8, 32
store i64 %9, i64* %6
%10 = load i64, i64* %3
%11 = load i64, i64* %5
%12 = load i64, i64* %6
ret void
}

LLVM IR (-O2):
define void @wrmsrl(i64 %0, i64 %1) {
%3 = lshr i64 %1, 32
tail call void asm sideeffect "wrmsr", "{cx},{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %3)
ret void
}
int strincmp(char s[], char t[]) {
  int i = 0;
  while (s[i] == t[i]) {
    if (s[i] == '\0') {
      return 0;
    }
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<strincmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1162 <strincmp+0x62>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1154 <strincmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1169 <strincmp+0x69>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <strincmp+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strincmp>:
mov    (%rdi),%cl
mov    $0x1,%eax
cmp    (%rsi),%cl
jne    1124 <strincmp+0x24>
mov    $0x1,%edx
test   %cl,%cl
je     1125 <strincmp+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <strincmp+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strincmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %30, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %13, %19
br i1 %20, label %21, label %33
21: ; preds = %7
%22 = load i8*, i8** %4
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %21
store i32 0, i32* %3
br label %34
30: ; preds = %21
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %7
33: ; preds = %7
store i32 1, i32* %3
br label %34
34: ; preds = %33, %29
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @strincmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %12, label %17
6: ; preds = %12
%7 = getelementptr inbounds i8, i8* %0, i64 %16
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %1, i64 %16
%10 = load i8, i8* %9
%11 = icmp eq i8 %8, %10
br i1 %11, label %12, label %17
12: ; preds = %2, %6
%13 = phi i64 [ %16, %6 ], [ 0, %2 ]
%14 = phi i8 [ %8, %6 ], [ %3, %2 ]
%15 = icmp eq i8 %14, 0
%16 = add nuw i64 %13, 1
br i1 %15, label %17, label %6
17: ; preds = %12, %6, %2
%18 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %12 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ __mmask8;
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm128_mask_cmp_pd_mask(int /*<<< orphan*/,
                                           int /*<<< orphan*/,
                                           int /*<<< orphan*/,
                                           int /*<<< orphan*/);
__mmask8 test_mm128_mask_cmp_pd_mask(__mmask8 m, __m128d __A, __m128d __B) {
  return _mm128_mask_cmp_pd_mask(m, __A, __B, 0);
}


x86 assembly (clang, -O0):
<test_mm128_mask_cmp_pd_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
call   1030 <_mm128_mask_cmp_pd_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm128_mask_cmp_pd_mask>:
xor    %ecx,%ecx
jmp    1030 <_mm128_mask_cmp_pd_mask@plt>

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

LLVM IR (-O2):
define i32 @test_mm128_mask_cmp_pd_mask(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_mm128_mask_cmp_pd_mask(i32 %0, i32 %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int nrf_802154_ack_pending_bit_for_addr_set(int /*<<< orphan*/ const *, int);
bool nrf_802154_pending_bit_for_addr_set(const uint8_t *p_addr, bool extended) {
  return nrf_802154_ack_pending_bit_for_addr_set(p_addr, extended);
}


x86 assembly (clang, -O0):
<nrf_802154_pending_bit_for_addr_set>:
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 <nrf_802154_ack_pending_bit_for_addr_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_802154_pending_bit_for_addr_set>:
jmp    1030 <nrf_802154_ack_pending_bit_for_addr_set@plt>

LLVM IR (-O0):
define i32 @nrf_802154_pending_bit_for_addr_set(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 @nrf_802154_ack_pending_bit_for_addr_set(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @nrf_802154_pending_bit_for_addr_set(i32* %0, i32 %1) {
%3 = tail call i32 @nrf_802154_ack_pending_bit_for_addr_set(i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ AccelStateHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void AccelStateUpdated() { UAVObjUpdated(AccelStateHandle()); }


x86 assembly (clang, -O0):
<AccelStateUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <AccelStateHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AccelStateUpdated>:
push   %rax
xor    %eax,%eax
call   1040 <AccelStateHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @AccelStateUpdated() {
%1 = call i32 (...) @AccelStateHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AccelStateUpdated() {
%1 = tail call i32 (...) @AccelStateHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int getpagesize();
int munmap(unsigned char *, size_t);
int iounmap(volatile void *start, size_t length) {
  unsigned long ofs_addr;
  ofs_addr = (unsigned long)start & (getpagesize() - 1);
  return munmap((unsigned char *)start - ofs_addr, length + ofs_addr);
}


x86 assembly (clang, -O0):
<iounmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
sub    -0x18(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
add    -0x18(%rbp),%rsi
call   1030 <munmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iounmap>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getpagesize@plt>
add    $0xffffffff,%eax
cltq
and    %rbx,%rax
sub    %rax,%rbx
add    %rax,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define i32 @iounmap(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = call i32 (...) @getpagesize()
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = and i64 %7, %10
store i64 %11, i64* %5
%12 = load i8*, i8** %3
%13 = load i64, i64* %5
%14 = sub i64 0, %13
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = add i64 %16, %17
%19 = call i32 @munmap(i8* %15, i64 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @iounmap(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 (...) @getpagesize()
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = and i64 %6, %3
%8 = sub i64 0, %7
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = add i64 %7, %1
%11 = tail call i32 @munmap(i8* %9, i64 %10)
ret i32 %11
}
/* Type definitions */
struct sock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ new_event(struct sock *);
void queue_upcall_deliver(struct sock *sk) { new_event(sk); }


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

x86 assembly (clang, -O2):
<queue_upcall_deliver>:
jmp    1030 <new_event@plt>

LLVM IR (-O0):
%struct.sock = type { i32 }
define void @queue_upcall_deliver(%struct.sock* %0) {
%2 = alloca %struct.sock*
store %struct.sock* %0, %struct.sock** %2
%3 = load %struct.sock*, %struct.sock** %2
%4 = call i32 @new_event(%struct.sock* %3)
ret void
}

LLVM IR (-O2):
%struct.sock = type { i32 }
define void @queue_upcall_deliver(%struct.sock* %0) {
%2 = tail call i32 @new_event(%struct.sock* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void pthread_mutex_eunlock(pthread_mutex_t *lock) {
  if ((errno = pthread_mutex_unlock(lock)))
    do {
      perror("pthread_mutex_unlock failed");
      exit(EXIT_FAILURE);
    } while (0);
}


x86 assembly (clang, -O0):
<pthread_mutex_eunlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
mov    0x2e94(%rip),%rcx
mov    %eax,(%rcx)
cmp    $0x0,%eax
je     1176 <pthread_mutex_eunlock+0x46>
jmp    115c <pthread_mutex_eunlock+0x2c>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_eunlock>:
push   %rax
call   1030 <pthread_mutex_unlock@plt>
mov    0x2ea3(%rip),%rcx
mov    %eax,(%rcx)
test   %eax,%eax
jne    1145 <pthread_mutex_eunlock+0x15>
pop    %rax
ret
lea    0xeb4(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [28 x i8] c"pthread_mutex_unlock failed\00"
@EXIT_FAILURE = global i32 0
define void @pthread_mutex_eunlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @pthread_mutex_unlock(i32* %3)
store i32 %4, i32* @errno
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
br label %7
7: ; preds = %6
%8 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; No predecessors!
br label %12
12: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [28 x i8] c"pthread_mutex_unlock failed\00"
@EXIT_FAILURE = global i32 0
define void @pthread_mutex_eunlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
store i32 %2, i32* @errno
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
void xf86JoystickInit() { return; }


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

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

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

LLVM IR (-O2):
define void @xf86JoystickInit() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int sprintf(char *, char *, char *);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  char buf[50];
  int n;
  ssize_t check;
  n = sprintf(buf, "Hello %s, welcome to 415!", "Aleksandr Kibis");
  check = write(1, buf, n);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
lea    0xed9(%rip),%rdx
call   1040 <sprintf@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rsi
mov    -0x44(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    %eax,-0x48(%rbp)
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xed4(%rip),%rsi
lea    0xee7(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Hello %s, welcome to 415!\00"
@.str.1 = [16 x i8] c"Aleksandr Kibis\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store i32 %6, i32* %3
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @write(i32 1, i8* %7, i32 %8)
store i32 %9, i32* %4
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Hello %s, welcome to 415!\00"
@.str.1 = [16 x i8] c"Aleksandr Kibis\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @write(i32 1, i8* %2, i32 %3)
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int n;
  n = atoi(argv[1]);
  if (n > 0) {
    printf("%d\n", n);
  }
  if (n > 10) {
    printf("%d\n", n);
  }
  return 0;
}


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    115f <main+0x3f>
mov    -0x14(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xa,-0x14(%rbp)
jle    1178 <main+0x58>
mov    -0x14(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
test   %eax,%eax
jle    1151 <main+0x31>
mov    %eax,%ebx
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
cmp    $0xb,%ebx
jb     1151 <main+0x31>
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%9 = icmp ugt i32 %5, 10
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %12
12: ; preds = %2, %10, %7
ret i32 0
}
void sys_unbashfilename(const char *from, char *to) {
  char c;
  while ((c = *from++)) {
    *to++ = c;
  }
  *to = 0;
}


x86 assembly (clang, -O0):
<sys_unbashfilename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1141 <sys_unbashfilename+0x41>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <sys_unbashfilename+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_unbashfilename>:
mov    (%rdi),%al
test   %al,%al
je     1121 <sys_unbashfilename+0x21>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rsi)
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <sys_unbashfilename+0x10>
movb   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @sys_unbashfilename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %11, %2
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = load i8, i8* %7
store i8 %9, i8* %5
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load i8, i8* %5
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
store i8 %12, i8* %13
br label %6
15: ; preds = %6
%16 = load i8*, i8** %4
store i8 0, i8* %16
ret void
}

LLVM IR (-O2):
define void @sys_unbashfilename(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %1, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
/* Type definitions */
struct termios {
  int /*<<< orphan*/ c_iflag;
};

/* Variables and functions */
int /*<<< orphan*/ IXON;
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void enable_flow_control(void) {
  struct termios term;
  tcgetattr(0, &term);
  term.c_iflag |= IXON;
  tcsetattr(0, TCSANOW, &term);
}


x86 assembly (clang, -O0):
<enable_flow_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1030 <tcgetattr@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_flow_control>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <tcgetattr@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
or     %eax,0x8(%rsp)
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@IXON = global i32 0
@TCSANOW = global i32 0
define void @enable_flow_control() {
%1 = alloca %struct.termios
%2 = call i32 @tcgetattr(i32 0, %struct.termios* %1)
%3 = load i32, i32* @IXON
%4 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = or i32 %5, %3
store i32 %6, i32* %4
%7 = load i32, i32* @TCSANOW
%8 = call i32 @tcsetattr(i32 0, i32 %7, %struct.termios* %1)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@IXON = global i32 0
@TCSANOW = global i32 0
define void @enable_flow_control() {
%1 = alloca %struct.termios
%2 = bitcast %struct.termios* %1 to i8*
%3 = call i32 @tcgetattr(i32 0, %struct.termios* %1)
%4 = load i32, i32* @IXON
%5 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = or i32 %6, %4
store i32 %7, i32* %5
%8 = load i32, i32* @TCSANOW
%9 = call i32 @tcsetattr(i32 0, i32 %8, %struct.termios* %1)
ret void
}
void init_vla(int size) {
  int i;
  int vla[size];
  for (i = 0; i < size; i++)
    vla[i] = size - i;
  vla[0] = size;
}


x86 assembly (clang, -O0):
<init_vla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1164 <init_vla+0x64>
mov    -0x20(%rbp),%rax
mov    -0x4(%rbp),%edx
sub    -0x8(%rbp),%edx
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <init_vla+0x39>
mov    -0x20(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init_vla(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %4
%9 = alloca i32, i64 %7
store i64 %7, i64* %5
store i32 0, i32* %3
br label %10
10: ; preds = %21, %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = sub nsw i32 %15, %16
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %9, i64 %19
store i32 %17, i32* %20
br label %21
21: ; preds = %14
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %10
24: ; preds = %10
%25 = load i32, i32* %2
%26 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %25, i32* %26
%27 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @init_vla(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_test(char *, char *, char *, char *);
void new_group(char *title) {
  write_test("shell", "echo -e $'\\n%s\\n'; %s", title, "let INDENT+=4;");
}


x86 assembly (clang, -O0):
<new_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xed8(%rip),%rsi
lea    0xee7(%rip),%rcx
call   1030 <write_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_group>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee5(%rip),%rsi
lea    0xef4(%rip),%rcx
jmp    1030 <write_test@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"shell\00"
@.str.1 = [22 x i8] c"echo -e $'\\n%s\\n'; %s\00"
@.str.2 = [15 x i8] c"let INDENT+=4;\00"
define void @new_group(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write_test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"shell\00"
@.str.1 = [22 x i8] c"echo -e $'\\n%s\\n'; %s\00"
@.str.2 = [15 x i8] c"let INDENT+=4;\00"
define void @new_group(i8* %0) {
%2 = tail call i32 @write_test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int rl_crlf(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @rl_crlf() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @rl_crlf() {
ret i32 -1
}
int fun1107() { return 1107; }


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

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

LLVM IR (-O0):
define i32 @fun1107() {
ret i32 1107
}

LLVM IR (-O2):
define i32 @fun1107() {
ret i32 1107
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ init();
int /*<<< orphan*/ initialize_linked_list();
int /*<<< orphan*/ procargs(int, char **);
int /*<<< orphan*/ procdir_entries();
int main(int argc, char *argv[]) {
  procargs(argc, argv);
  init();
  initialize_linked_list();
  procdir_entries();
  exit(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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <procargs@plt>
mov    $0x0,%al
call   1050 <init@plt>
mov    $0x0,%al
call   1060 <initialize_linked_list@plt>
mov    $0x0,%al
call   1030 <procdir_entries@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <procargs@plt>
xor    %eax,%eax
call   1050 <init@plt>
xor    %eax,%eax
call   1060 <initialize_linked_list@plt>
xor    %eax,%eax
call   1030 <procdir_entries@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @procargs(i32 %6, i8** %7)
%9 = call i32 (...) @init()
%10 = call i32 (...) @initialize_linked_list()
%11 = call i32 (...) @procdir_entries()
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @procargs(i32 %0, i8** %1)
%4 = tail call i32 (...) @init()
%5 = tail call i32 (...) @initialize_linked_list()
%6 = tail call i32 (...) @procdir_entries()
%7 = tail call i32 @exit(i32 0)
unreachable
}