xunge/DecIR huggingface dataset:
int round_up(x, y)
int x, y;
{
  int rem = x % y;
  if (rem == 0)
    return x;
  return x - rem + y;
}


x86 assembly (clang, -O0):
<round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1129 <round_up+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <round_up+0x35>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rsi,%rdi,1),%eax
sub    %edx,%eax
test   %edx,%edx
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @round_up(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = add i32 %1, %0
%6 = sub i32 %5, %3
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
/* Variables and functions */
int rand();
int getRandomNumberBetween(int min, int max) {
  int random = min;
  while (1) {
    random = (rand() % (max + 1)) + min;
    if ((random >= min) && (random <= max)) {
      break;
    }
  }
  return random;
}


x86 assembly (clang, -O0):
<getRandomNumberBetween>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1157 <getRandomNumberBetween+0x47>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1157 <getRandomNumberBetween+0x47>
jmp    115c <getRandomNumberBetween+0x4c>
jmp    1124 <getRandomNumberBetween+0x14>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomNumberBetween>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
lea    0x1(%r14),%ebp
nopl   (%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
lea    (%rdx,%rbx,1),%eax
test   %edx,%edx
js     1120 <getRandomNumberBetween+0x10>
cmp    %r14d,%eax
jg     1120 <getRandomNumberBetween+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getRandomNumberBetween(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
store i32 %6, i32* %5
br label %7
7: ; preds = %2, %22
%8 = call i32 (...) @rand()
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
%11 = srem i32 %8, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* %3
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %7
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %17
br label %23
22: ; preds = %17, %7
br label %7
23: ; preds = %21
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @getRandomNumberBetween(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
br label %4
4: ; preds = %4, %2
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, %3
%7 = add nsw i32 %6, %0
%8 = icmp slt i32 %6, 0
%9 = icmp sgt i32 %7, %1
%10 = select i1 %8, i1 true, i1 %9
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void bzero_fast(void *s, size_t len) { memset(s, 0, len); }


x86 assembly (clang, -O0):
<bzero_fast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero_fast>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @bzero_fast(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @memset(i8* %5, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @bzero_fast(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
int cmp(const void *a, const void *b) {
  unsigned ua = *(unsigned *)a, ub = *(unsigned *)b;
  if (ua < ub)
    return -1;
  else if (ua > ub)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    1136 <cmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <cmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    114e <cmp+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <cmp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(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 = icmp ult i32 %4, %6
%8 = icmp ugt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void foo_2_1_1_1_1_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_1_2_2_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_setfontname(int, int);
void j_setfontname(int arg0, int arg1) { japi_setfontname(arg0, arg1); }


x86 assembly (clang, -O0):
<j_setfontname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <japi_setfontname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_setfontname>:
jmp    1030 <japi_setfontname@plt>

LLVM IR (-O0):
define void @j_setfontname(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 @japi_setfontname(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @j_setfontname(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setfontname(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int, int);
int main() {
  printf("%ld %ld %ld %ld %ld %ld %ld %ld\n", sizeof(char), sizeof(short int),
         sizeof(int), sizeof(long int), sizeof(long long int), sizeof(float),
         sizeof(double), sizeof(long double));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
mov    $0x8,%r9d
mov    %r9d,%r8d
movl   $0x4,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x10,0x10(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
lea    0xee4(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
mov    $0x8,%r8d
mov    $0x8,%r9d
push   $0x10
push   $0x8
push   $0x4
call   1030 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [33 x i8] c"%ld %ld %ld %ld %ld %ld %ld %ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 4, i32 8, i32 8, i32 4, i32 8, i32 16)
ret i32 0
}
int neiln42(long a) { return -(a != 42); }


x86 assembly (clang, -O0):
<neiln42>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x2a,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neiln42>:
xor    %eax,%eax
cmp    $0x2a,%rdi
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @neiln42(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 42
%5 = zext i1 %4 to i32
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @neiln42(i64 %0) {
%2 = icmp ne i64 %0, 42
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  float a = 0.98f;
  printf("%d", a > 0.98f);
  printf("%d", a > 0.97f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xecb(%rip),%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xea3(%rip),%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
void fd184(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  p02B:
    goto p02B;
    goto a;
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
a:;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd184>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd184+0x7>

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

LLVM IR (-O0):
define void @fd184(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; preds = %37
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd184(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ print_header(char *);
void sch_hed(void) {
  print_header("The College of Ularn offers the exciting opportunity of higher "
               "education to ");
  print_header("all inhabitants of the caves.  Here is the class schedule. ");
  print_header("All courses cost 250 gold pieces.");
}


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

x86 assembly (clang, -O2):
<sch_hed>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <print_header@plt>
lea    0xf29(%rip),%rdi
call   1030 <print_header@plt>
lea    0xf59(%rip),%rdi
pop    %rax
jmp    1030 <print_header@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"The College of Ularn offers the exciting opportunity of higher education to \00"
@.str.1 = [60 x i8] c"all inhabitants of the caves. Here is the class schedule. \00"
@.str.2 = [34 x i8] c"All courses cost 250 gold pieces.\00"
define void @sch_hed() {
%1 = call i32 @print_header(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print_header(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @print_header(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [77 x i8] c"The College of Ularn offers the exciting opportunity of higher education to \00"
@.str.1 = [60 x i8] c"all inhabitants of the caves. Here is the class schedule. \00"
@.str.2 = [34 x i8] c"All courses cost 250 gold pieces.\00"
define void @sch_hed() {
%1 = tail call i32 @print_header(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_header(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @print_header(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int is_prime(int n) {
  int i;
  if (n <= 2)
    return 1;
  if (n % 2 == 0)
    return 0;
  for (i = 3; i < n; i += 2) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     111d <is_prime+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1186 <is_prime+0x86>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113d <is_prime+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1186 <is_prime+0x86>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117f <is_prime+0x7f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    116c <is_prime+0x6c>
movl   $0x0,-0x4(%rbp)
jmp    1186 <is_prime+0x86>
jmp    1171 <is_prime+0x71>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <is_prime+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1130 <is_prime+0x30>
test   $0x1,%dil
jne    1114 <is_prime+0x14>
xor    %ecx,%ecx
jmp    1130 <is_prime+0x30>
cmp    $0x4,%edi
jb     1130 <is_prime+0x30>
mov    $0x3,%esi
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1110 <is_prime+0x10>
add    $0x2,%esi
cmp    %edi,%esi
jl     1120 <is_prime+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3
%7 = icmp ugt i32 %0, 3
br i1 %7, label %10, label %15
8: ; preds = %10
%9 = icmp slt i32 %14, %0
br i1 %9, label %10, label %15
10: ; preds = %6, %8
%11 = phi i32 [ %14, %8 ], [ 3, %6 ]
%12 = srem i32 %0, %11
%13 = icmp eq i32 %12, 0
%14 = add nuw nsw i32 %11, 2
br i1 %13, label %15, label %8
15: ; preds = %10, %8, %6, %3, %1
%16 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 1, %6 ], [ 0, %10 ], [ 1, %8 ]
ret i32 %16
}
/* Variables and functions */
int yaffs_mount_common(int /*<<< orphan*/, char const *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int yaffs_mount(const char *path) {
  return yaffs_mount_common((0), path, 0, 0);
}


x86 assembly (clang, -O0):
<yaffs_mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%edx
call   1030 <yaffs_mount_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_mount>:
mov    %rdi,%rsi
xor    %edi,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <yaffs_mount_common@plt>

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

LLVM IR (-O2):
define i32 @yaffs_mount(i8* %0) {
%2 = tail call i32 @yaffs_mount_common(i32 0, i8* %0, i32 0, i32 0)
ret i32 %2
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
int fsize(char *name) {
  struct stat st;
  stat(name, &st);
  return st.st_size;
}


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

x86 assembly (clang, -O2):
<fsize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fsize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fsize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ analogRead(int /*<<< orphan*/);
int /*<<< orphan*/ *boxUnsigned(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ unboxUnsigned(int /*<<< orphan*/ *);
uint32_t *arduinoAnalogRead(uint32_t context_len, uint32_t *stackvar) {
  uint32_t pin;
  uint32_t value;
  pin = unboxUnsigned(stackvar);
  value = analogRead(pin);
  return boxUnsigned(context_len, value);
}


x86 assembly (clang, -O0):
<arduinoAnalogRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <unboxUnsigned@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <analogRead@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <boxUnsigned@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arduinoAnalogRead>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1040 <unboxUnsigned@plt>
mov    %eax,%edi
call   1050 <analogRead@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <boxUnsigned@plt>

LLVM IR (-O0):
define i32* @arduinoAnalogRead(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = call i32 @unboxUnsigned(i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @analogRead(i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %3
%12 = load i32, i32* %6
%13 = call i32* @boxUnsigned(i32 %11, i32 %12)
ret i32* %13
}

LLVM IR (-O2):
define i32* @arduinoAnalogRead(i32 %0, i32* %1) {
%3 = tail call i32 @unboxUnsigned(i32* %1)
%4 = tail call i32 @analogRead(i32 %3)
%5 = tail call i32* @boxUnsigned(i32 %0, i32 %4)
ret i32* %5
}
/* Type definitions */
struct timeval {
  unsigned long long tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long get_usec() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (((unsigned long long)t.tv_sec) * 1000000) + t.tv_usec;
}


x86 assembly (clang, -O0):
<get_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_usec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @get_usec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = add i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @get_usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}
int main(int argc, char **argv) {
  int x = 3 + 7;
  int y = 22;
  return 30 + y - x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0x16,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1e,%eax
sub    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i32 22, i32* %7
%8 = load i32, i32* %7
%9 = add nsw i32 30, %8
%10 = load i32, i32* %6
%11 = sub nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 42
}
int CheckEndcode(int dot, int endcode, int *code) {
  if (dot == endcode) {
    code[0]++;
    if (code[0] == 2) {
      code[0] = 0;
      return 2;
    }
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<CheckEndcode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1154 <CheckEndcode+0x54>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x2,(%rax)
jne    1148 <CheckEndcode+0x48>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    115b <CheckEndcode+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    115b <CheckEndcode+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckEndcode>:
xor    %eax,%eax
cmp    %esi,%edi
jne    111d <CheckEndcode+0x1d>
mov    (%rdx),%ecx
add    $0x1,%ecx
xor    %esi,%esi
xor    %eax,%eax
cmp    $0x2,%ecx
sete   %al
cmovne %ecx,%esi
mov    %esi,(%rdx)
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @CheckEndcode(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 eq i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %7
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
%16 = load i32*, i32** %7
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %23
20: ; preds = %11
%21 = load i32*, i32** %7
%22 = getelementptr inbounds i32, i32* %21, i64 0
store i32 0, i32* %22
store i32 2, i32* %4
br label %25
23: ; preds = %11
store i32 1, i32* %4
br label %25
24: ; preds = %3
store i32 0, i32* %4
br label %25
25: ; preds = %24, %23, %20
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @CheckEndcode(i32 %0, i32 %1, i32* nocapture %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = icmp eq i32 %7, 2
%9 = select i1 %8, i32 0, i32 %7
store i32 %9, i32* %2
%10 = select i1 %8, i32 2, i32 1
br label %11
11: ; preds = %5, %3
%12 = phi i32 [ 0, %3 ], [ %10, %5 ]
ret i32 %12
}
int checkmz(int x) {
  if (x == 2147483647) {
    return -1;
  }
  return x;
}


x86 assembly (clang, -O0):
<checkmz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7fffffff,-0x8(%rbp)
jne    1120 <checkmz+0x20>
movl   $0xffffffff,-0x4(%rbp)
jmp    1126 <checkmz+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkmz>:
cmp    $0x7fffffff,%edi
mov    $0xffffffff,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @checkmz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 2147483647
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %9
9: ; preds = %7, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @checkmz(i32 %0) {
%2 = icmp eq i32 %0, 2147483647
%3 = select i1 %2, i32 -1, i32 %0
ret i32 %3
}
/* Variables and functions */
int sumfif(int);
int euler30(int lim) {
  int res = 0, i = lim;
  while (i > 10) {
    if (i == sumfif(i)) {
      res += i;
    }
    i--;
  }
  return res;
}


x86 assembly (clang, -O0):
<euler30>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jle    1164 <euler30+0x54>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <sumfif@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jne    1156 <euler30+0x46>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <euler30+0x18>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euler30>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
cmp    $0xb,%edi
jl     113d <euler30+0x2d>
mov    %edi,%ebx
xor    %ebp,%ebp
jmp    112c <euler30+0x1c>
add    %ecx,%ebp
lea    -0x1(%rbx),%eax
cmp    $0xb,%ebx
mov    %eax,%ebx
jbe    113d <euler30+0x2d>
mov    %ebx,%edi
call   1030 <sumfif@plt>
mov    %ebx,%ecx
cmp    %eax,%ebx
je     1120 <euler30+0x10>
xor    %ecx,%ecx
jmp    1120 <euler30+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @euler30(i32 %0) {
%2 = icmp sgt i32 %0, 10
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = tail call i32 @sumfif(i32 %4)
%7 = icmp eq i32 %4, %6
%8 = select i1 %7, i32 %4, i32 0
%9 = add nsw i32 %8, %5
%10 = add nsw i32 %4, -1
%11 = icmp ugt i32 %4, 11
br i1 %11, label %3, label %12
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %13
}
int foo(short a) { return (!a & 1) != ((a == 0) & 1); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
and    $0x1,%eax
movswl -0x2(%rbp),%ecx
cmp    $0x0,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    $0x1,%ecx
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = icmp ne i16 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = and i32 %6, 1
%8 = load i16, i16* %2
%9 = sext i16 %8 to i32
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = and i32 %11, 1
%13 = icmp ne i32 %7, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @foo(i16 signext %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errAbort(char *, char *, int, char *);
void gffSyntaxError(char *fileName, int line, char *msg) {
  errAbort("%s Bad line %d of %s:\n", msg, line, fileName);
}


x86 assembly (clang, -O0):
<gffSyntaxError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <errAbort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gffSyntaxError>:
mov    %esi,%eax
mov    %rdi,%rcx
lea    0xee4(%rip),%rdi
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <errAbort@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%s Bad line %d of %s:\0A\00"
define void @gffSyntaxError(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i32, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @errAbort(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s Bad line %d of %s:\0A\00"
define void @gffSyntaxError(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @errAbort(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *, char *, int);
int test(int d, char *out, char *in, int len) {
  if (out != in)
    foo(out, in, len);
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1144 <test+0x34>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
cmp    %rdx,%rsi
je     1127 <test+0x17>
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <foo@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i8* %1, %2
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @foo(i8* %1, i8* %2, i32 %3)
br label %8
8: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int exp(double);
double logphi1(double lp) { return 1 / (1 + exp(-lp)); }


x86 assembly (clang, -O0):
<logphi1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logphi1>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
lea    0x1(%rax),%ecx
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @logphi1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 @exp(double %4)
%6 = add nsw i32 1, %5
%7 = sdiv i32 1, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @logphi1(double %0) {
%2 = fneg double %0
%3 = tail call i32 @exp(double %2)
%4 = add nsw i32 %3, 1
%5 = add i32 %3, 2
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %4, i32 0
%8 = sitofp i32 %7 to double
ret double %8
}
void mg_init() {}


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

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

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

LLVM IR (-O2):
define void @mg_init() {
ret void
}
int ft_isupper(int c) {
  if (c >= 'A' && c <= 'Z')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <ft_isupper+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <ft_isupper+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
float MAX(float x, float y) { return (x < y) ? y : x; }


x86 assembly (clang, -O0):
<MAX>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <MAX+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <MAX+0x3a>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAX>:
maxss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @MAX(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %4
br label %12
10: ; preds = %2
%11 = load float, float* %3
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @MAX(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %1, float %0
ret float %4
}
void SKY_module_list_refresh(void) {}


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

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

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

LLVM IR (-O2):
define void @SKY_module_list_refresh() {
ret void
}
char *skip_left_pad(char *buff) {
  char *finger = buff;
  while ((*finger == ' ') || (*finger == '\t'))
    finger++;
  return finger;
}


x86 assembly (clang, -O0):
<skip_left_pad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     1135 <skip_left_pad+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1145 <skip_left_pad+0x45>
jmp    1156 <skip_left_pad+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <skip_left_pad+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_left_pad>:
mov    %rdi,%rax
jmp    1114 <skip_left_pad+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_left_pad+0x10>
cmp    $0x9,%cl
je     1110 <skip_left_pad+0x10>
ret

LLVM IR (-O0):
define i8* @skip_left_pad(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %17, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 32
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 9
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ true, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
br label %5
20: ; preds = %15
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @skip_left_pad(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
int AllBlanks(register char *cp) {
  while (*cp)
    if (*cp++ > 32)
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<AllBlanks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <AllBlanks+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x20,%eax
jle    113c <AllBlanks+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1148 <AllBlanks+0x48>
jmp    1108 <AllBlanks+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AllBlanks>:
movzbl (%rdi),%eax
test   %al,%al
je     1112 <AllBlanks+0x12>
add    $0x1,%rdi
cmp    $0x21,%al
jl     1100 <AllBlanks>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @AllBlanks(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = icmp sgt i8 %4, 32
br i1 %8, label %9, label %2
9: ; preds = %2, %6
%10 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, float, int);
void apreciate_hair(int cliente, int barbeiro, float tempo, int numero_gerado) {
  printf("tempo até o cliente #%d ser atendido pelo barbeiro #%d: %.10f\nO "
         "numero gerado e %d\n\n",
         cliente, barbeiro, tempo, numero_gerado);
}


x86 assembly (clang, -O0):
<apreciate_hair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movss  -0xc(%rbp),%xmm0
mov    -0x10(%rbp),%ecx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apreciate_hair>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [86 x i8] c"tempo at\C3\A9 o cliente #%d ser atendido pelo barbeiro #%d: %.10f\0AO numero gerado e %d\0A\0A\00"
define void @apreciate_hair(i32 %0, i32 %1, float %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store float %2, float* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load float, float* %7
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, float %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [86 x i8] c"tempo at\C3\A9 o cliente #%d ser atendido pelo barbeiro #%d: %.10f\0AO numero gerado e %d\0A\0A\00"
define void @apreciate_hair(i32 %0, i32 %1, float %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, float %2, i32 %3)
ret void
}
void DEBUG_printf(char *msg, int level) {}


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

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

LLVM IR (-O0):
define void @DEBUG_printf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @DEBUG_printf(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int xor_l(int *, int *);
int intr_wrap_539(int p1, int p2) { return xor_l(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_539>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <xor_l@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_539>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <xor_l@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @intr_wrap_539(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @xor_l(i32* %3, i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @intr_wrap_539(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @xor_l(i32* %3, i32* %4)
ret i32 %5
}
char *maliastr(source)
char *source;
{ return (aliastr(source)); }


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

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

LLVM IR (-O0):
define i8* @maliastr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @aliastr to i32 (i8*, ...)*)(i8* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @maliastr(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @aliastr to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}