xunge/DecIR huggingface dataset:
void _exit(int i) {
  while (1)
    ;
}


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

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

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
int __C_isalpha(int);
int isalpha(int c) { return __C_isalpha(c); }


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

x86 assembly (clang, -O2):
<isalpha>:
jmp    1030 <__C_isalpha@plt>

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

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = tail call i32 @__C_isalpha(i32 %0)
ret i32 %2
}
/* Variables and functions */
double tml_dr_vMaxExt(double const *, int, int *);
double tml_dr_vMax(const double *vec, int n) {
  int index;
  return tml_dr_vMaxExt(vec, n, &index);
}


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

x86 assembly (clang, -O2):
<tml_dr_vMax>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <tml_dr_vMaxExt@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @tml_dr_vMax(double* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call double @tml_dr_vMaxExt(double* %0, i32 %1, i32* %3)
ret double %5
}
void __outl(unsigned int value, unsigned short port) {
  __asm__ __volatile__("out"
                       "l"
                       " %"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "d"(port));
}


x86 assembly (clang, -O0):
<__outl>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outl>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @__outl(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @__outl(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
ret void
}
/* Variables and functions */
void ThreadSemaphoreWait(void) {}


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

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

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

LLVM IR (-O2):
define void @ThreadSemaphoreWait() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char x = 'a';
  char y = 'b';
  printf("%c %c\n", x, y);
  char tmp = x;
  x = y;
  y = tmp;
  ;
  printf("%c %c\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movb   $0x62,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    0xecf(%rip),%rdi
movsbl %al,%esi
movsbl -0x6(%rbp),%edx
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
mov    %al,-0x7(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    0xea7(%rip),%rdi
movsbl %al,%esi
movsbl -0x6(%rbp),%edx
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
mov    $0x61,%esi
mov    $0x62,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
mov    $0x61,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 97, i8 signext 98)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 98, i8 signext 97)
ret i32 0
}
void NewRobot(struct Robot *robot) {}


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

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

LLVM IR (-O0):
%struct.Robot = type opaque
define void @NewRobot(%struct.Robot* %0) {
%2 = alloca %struct.Robot*
store %struct.Robot* %0, %struct.Robot** %2
ret void
}

LLVM IR (-O2):
%struct.Robot = type opaque
define void @NewRobot(%struct.Robot* nocapture %0) {
ret void
}
int main(int argc, char **argv) {
  void *a = argv;
  void *b = *argv;
  argv = (void *)0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int revncmp(const char *s, const char *t, int len) {
  int cmp = 0;
  while (len > 0 && ((cmp = *--s - *--t) == 0)) {
    len--;
  }
  return cmp;
}


x86 assembly (clang, -O0):
<revncmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x19(%rbp)
jle    1159 <revncmp+0x59>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
movsbl -0x1(%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
movsbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1169 <revncmp+0x69>
jmp    1177 <revncmp+0x77>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <revncmp+0x16>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<revncmp>:
test   %edx,%edx
jle    112d <revncmp+0x2d>
add    $0x1,%edx
xor    %r8d,%r8d
nopw   0x0(%rax,%rax,1)
movsbl -0x1(%rdi,%r8,1),%eax
movsbl -0x1(%rsi,%r8,1),%ecx
sub    %ecx,%eax
jne    112f <revncmp+0x2f>
add    $0xffffffffffffffff,%r8
lea    (%rdx,%r8,1),%eax
cmp    $0x2,%eax
jge    1110 <revncmp+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @revncmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %24, %3
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 -1
store i8* %13, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i32 -1
store i8* %17, i8** %5
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %15, %19
store i32 %20, i32* %7
%21 = icmp eq i32 %20, 0
br label %22
22: ; preds = %11, %8
%23 = phi i1 [ false, %8 ], [ %21, %11 ]
br i1 %23, label %24, label %27
24: ; preds = %22
%25 = load i32, i32* %6
%26 = add nsw i32 %25, -1
store i32 %26, i32* %6
br label %8
27: ; preds = %22
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @revncmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %8, label %20
5: ; preds = %8
%6 = add nsw i32 %9, -1
%7 = icmp sgt i32 %9, 1
br i1 %7, label %8, label %20
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ %2, %3 ]
%10 = phi i8* [ %15, %5 ], [ %1, %3 ]
%11 = phi i8* [ %12, %5 ], [ %0, %3 ]
%12 = getelementptr inbounds i8, i8* %11, i64 -1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = getelementptr inbounds i8, i8* %10, i64 -1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %14, %17
%19 = icmp eq i32 %18, 0
br i1 %19, label %5, label %20
20: ; preds = %8, %5, %3
%21 = phi i32 [ 0, %3 ], [ 0, %5 ], [ %18, %8 ]
ret i32 %21
}
/* Variables and functions */
int drand48();
double getRand(void) { return (drand48() * 1000); }


x86 assembly (clang, -O0):
<getRand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <drand48@plt>
imul   $0x3e8,%eax,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRand>:
push   %rax
xor    %eax,%eax
call   1030 <drand48@plt>
imul   $0x3e8,%eax,%eax
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @getRand() {
%1 = call i32 (...) @drand48()
%2 = mul nsw i32 %1, 1000
%3 = sitofp i32 %2 to double
ret double %3
}

LLVM IR (-O2):
define double @getRand() {
%1 = tail call i32 (...) @drand48()
%2 = mul nsw i32 %1, 1000
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
int bar(int);
int foo(int a) { return bar(bar(a + 1)); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <bar@plt>
mov    %eax,%edi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
add    $0x1,%edi
call   1030 <bar@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @bar(i32 %4)
%6 = call i32 @bar(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @bar(i32 %2)
%4 = tail call i32 @bar(i32 %3)
ret i32 %4
}
int test_imm_EFint16_reg(short val) {
  return ((val) & (0xEF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EFint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xef,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EFint16_reg>:
test   $0xef,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EFint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 239
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_EFint16_reg(i16 signext %0) {
%2 = and i16 %0, 239
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void waitch() {}


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

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

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

LLVM IR (-O2):
define void @waitch() {
ret void
}
void border_se_ext_corner_special_sand_short_hori(unsigned char *pic,
                                                  unsigned char *mirr) {
  *pic = 0x2B;
  ;
}


x86 assembly (clang, -O0):
<border_se_ext_corner_special_sand_short_hori>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2b,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_se_ext_corner_special_sand_short_hori>:
movb   $0x2b,(%rdi)
ret

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

LLVM IR (-O2):
define void @border_se_ext_corner_special_sand_short_hori(i8* nocapture writeonly %0, i8* nocapture readnone %1) {
store i8 43, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Omega_Up(int value) {
  if (value) {
    cpc_key_press(0x50);
  } else {
    cpc_key_unpress(0x50);
  };
}


x86 assembly (clang, -O0):
<Joy_Omega_Up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Omega_Up+0x24>
mov    $0x50,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Omega_Up+0x2e>
mov    $0x50,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Omega_Up>:
test   %edi,%edi
je     112e <Joy_Omega_Up+0xe>
mov    $0x50,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x50,%edi
jmp    1040 <cpc_key_unpress@plt>

LLVM IR (-O0):
define void @Joy_Omega_Up(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @cpc_key_press(i32 80)
br label %9
7: ; preds = %1
%8 = call i32 @cpc_key_unpress(i32 80)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @Joy_Omega_Up(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 80)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 80)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *err) {
  fprintf(stderr, "gen_conf_lua conf.c conf_name start_value - Error = %s\n",
          err);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"gen_conf_lua conf.c conf_name start_value - Error = %s\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"gen_conf_lua conf.c conf_name start_value - Error = %s\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct vmklnx_fcoe_template {
  int dummy;
};

/* Variables and functions */
int vmklnx_fcoe_release_transport(struct vmklnx_fcoe_template *);
int fcoe_release_transport(struct vmklnx_fcoe_template *fcoe) {
  return vmklnx_fcoe_release_transport(fcoe);
}


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

x86 assembly (clang, -O2):
<fcoe_release_transport>:
jmp    1030 <vmklnx_fcoe_release_transport@plt>

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

LLVM IR (-O2):
%struct.vmklnx_fcoe_template = type { i32 }
define i32 @fcoe_release_transport(%struct.vmklnx_fcoe_template* %0) {
%2 = tail call i32 @vmklnx_fcoe_release_transport(%struct.vmklnx_fcoe_template* %0)
ret i32 %2
}
int isoperator(char c) {
  switch (c) {
  case '+':
  case '-':
  case '*':
  case '/':
  case '^':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isoperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffd6,%eax
sub    $0x2,%eax
jb     1155 <isoperator+0x55>
jmp    1122 <isoperator+0x22>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1155 <isoperator+0x55>
jmp    1133 <isoperator+0x33>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     1155 <isoperator+0x55>
jmp    1144 <isoperator+0x44>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
jne    1161 <isoperator+0x61>
jmp    1155 <isoperator+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1168 <isoperator+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isoperator>:
add    $0xffffffd6,%edi
cmp    $0x34,%edi
ja     111e <isoperator+0x1e>
mov    $0x1,%eax
movabs $0x1000000000002b,%rcx
bt     %rdi,%rcx
jae    111e <isoperator+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isoperator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 43, label %6
i32 45, label %6
i32 42, label %6
i32 47, label %6
i32 94, label %6
]
6: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isoperator(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 43, label %4
i32 45, label %4
i32 42, label %4
i32 47, label %4
i32 94, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int main() {
  char str[1000];
  gets(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1030 <gets@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x3e8,%rsp
mov    %rsp,%rdi
call   1030 <gets@plt>
xor    %eax,%eax
add    $0x3e8,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
ret i32 0
}
int test_imm_DAint16_mem(short *val) {
  return ((*val) & (0xDA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DAint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xda,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DAint16_mem>:
testb  $0xda,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DAint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 218
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_DAint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 218
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fun1305() { return 1305; }


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

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

LLVM IR (-O0):
define i32 @fun1305() {
ret i32 1305
}

LLVM IR (-O2):
define i32 @fun1305() {
ret i32 1305
}
int ceph_osd_op_type_attr(int op) { return (op & 0x0f00) == 0x0300; }


x86 assembly (clang, -O0):
<ceph_osd_op_type_attr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf00,%eax
cmp    $0x300,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_osd_op_type_attr>:
and    $0xf00,%edi
xor    %eax,%eax
cmp    $0x300,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ceph_osd_op_type_attr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3840
%5 = icmp eq i32 %4, 768
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ceph_osd_op_type_attr(i32 %0) {
%2 = and i32 %0, 3840
%3 = icmp eq i32 %2, 768
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
void *t(size_t n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<t>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @t(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void XUndefineCursor() {}


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

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

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

LLVM IR (-O2):
define void @XUndefineCursor() {
ret void
}
/* Variables and functions */
int f371(int *);
int f372(int *p) { return f371(p); }


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

x86 assembly (clang, -O2):
<f372>:
jmp    1030 <f371@plt>

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

LLVM IR (-O2):
define i32 @f372(i32* %0) {
%2 = tail call i32 @f371(i32* %0)
ret i32 %2
}
char *RCSid() {
  return RCSid("$Id: stdfn.c,v 1.25 2011/09/21 11:43:49 markisch Exp $");
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"$Id: stdfn.c,v 1.25 2011/09/21 11:43:49 markisch Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
int add2to3(int (*functionPtr)(int, int)) { return (*functionPtr)(2, 3); }


x86 assembly (clang, -O0):
<add2to3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2to3>:
mov    %rdi,%rax
mov    $0x2,%edi
mov    $0x3,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @add2to3(i32 (i32, i32)* nocapture %0) {
%2 = tail call i32 %0(i32 2, i32 3)
ret i32 %2
}
/* Variables and functions */
void _pico_unixify(char *path) {
  if (path == NULL) {
    return;
  }
  while (*path) {
    if (*path == '\\') {
      *path = '/';
    }
    path++;
  }
}


x86 assembly (clang, -O0):
<_pico_unixify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <_pico_unixify+0x18>
jmp    1152 <_pico_unixify+0x52>
jmp    111d <_pico_unixify+0x1d>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <_pico_unixify+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1141 <_pico_unixify+0x41>
mov    -0x8(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111d <_pico_unixify+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pico_unixify>:
test   %rdi,%rdi
jne    1117 <_pico_unixify+0x17>
jmp    1122 <_pico_unixify+0x22>
nopw   0x0(%rax,%rax,1)
movb   $0x2f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x5c,%al
je     1110 <_pico_unixify+0x10>
test   %al,%al
jne    1113 <_pico_unixify+0x13>
ret

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

LLVM IR (-O2):
define void @_pico_unixify(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 92, label %6
]
6: ; preds = %3
store i8 47, i8* %4
br label %7
7: ; preds = %3, %6
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
9: ; preds = %3, %1
ret void
}
float *search(float (*rowPointer)[4], int n) {
  float *pt;
  pt = *(rowPointer + n);
  return (pt);
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
movslq %esi,%rax
shl    $0x4,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define float* @search([4 x float]* %0, i32 %1) {
%3 = alloca [4 x float]*
%4 = alloca i32
%5 = alloca float*
store [4 x float]* %0, [4 x float]** %3
store i32 %1, i32* %4
%6 = load [4 x float]*, [4 x float]** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [4 x float], [4 x float]* %6, i64 %8
%10 = getelementptr inbounds [4 x float], [4 x float]* %9, i64 0, i64 0
store float* %10, float** %5
%11 = load float*, float** %5
ret float* %11
}

LLVM IR (-O2):
define float* @search([4 x float]* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %3, i64 0
ret float* %4
}
void fsemu_recording_on_save_state_finished(int slot, const char *path) {}


x86 assembly (clang, -O0):
<fsemu_recording_on_save_state_finished>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fsemu_recording_on_save_state_finished(i32 %0, i8* nocapture %1) {
ret void
}
void foo180() {}


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

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

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

LLVM IR (-O2):
define void @foo180() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ breakpt();
void func() { breakpt(); }


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

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

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

LLVM IR (-O2):
define void @func() {
%1 = tail call i32 (...) @breakpt()
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *eat_whitespace(char *a) {
  while (isspace(*a))
    a++;
  return a;
}


x86 assembly (clang, -O0):
<eat_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <eat_whitespace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <eat_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat_whitespace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <eat_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @eat_whitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @eat_whitespace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led0On();
void BaseStationUartC__Leds__led0On(void) { LedsP__Leds__led0On(); }


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

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

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

LLVM IR (-O2):
define void @BaseStationUartC__Leds__led0On() {
%1 = tail call i32 (...) @LedsP__Leds__led0On()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int mod2() {
  printf("mod2\n");
  return 2;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"mod2\00"
define i32 @mod2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *progname) {
  printf("Usage: %s [--listen addr] addr...\n", progname);
  exit(-1);
}


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

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

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

LLVM IR (-O2):
@.str = [35 x i8] c"Usage: %s [--listen addr] addr...\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
struct clock_event_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG();
void tick_broadcast_setup_oneshot(struct clock_event_device *bc) { BUG(); }


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

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

LLVM IR (-O0):
%struct.clock_event_device = type { i32 }
define void @tick_broadcast_setup_oneshot(%struct.clock_event_device* %0) {
%2 = alloca %struct.clock_event_device*
store %struct.clock_event_device* %0, %struct.clock_event_device** %2
%3 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
%struct.clock_event_device = type { i32 }
define void @tick_broadcast_setup_oneshot(%struct.clock_event_device* nocapture readnone %0) {
%2 = tail call i32 (...) @BUG()
ret void
}
char *strcpy(char *dest, const char *src) {
  char *p = dest;
  while ((*p++ = *src++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
int main() { return sizeof(signed int); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
int tmq_stop(struct tmq *tmq __attribute__((unused))) { return -1; }


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

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

LLVM IR (-O0):
%struct.tmq = type opaque
define i32 @tmq_stop(%struct.tmq* %0) {
%2 = alloca %struct.tmq*
store %struct.tmq* %0, %struct.tmq** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.tmq = type opaque
define i32 @tmq_stop(%struct.tmq* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int _is_leap_year(int);
int _month_length(int month, int year) {
  if (month == 1) {
    return 28 + _is_leap_year(year);
  }
  return 31 - ((month % 7) & 1);
}


x86 assembly (clang, -O0):
<_month_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113b <_month_length+0x2b>
mov    -0xc(%rbp),%edi
call   1030 <_is_leap_year@plt>
add    $0x1c,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <_month_length+0x43>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
and    $0x1,%edx
mov    $0x1f,%eax
sub    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_month_length>:
cmp    $0x1,%edi
jne    1125 <_month_length+0x15>
push   %rax
mov    %esi,%edi
call   1030 <_is_leap_year@plt>
add    $0x1c,%eax
add    $0x8,%rsp
ret
movslq %edi,%rax
imul   $0xffffffff92492493,%rax,%rax
shr    $0x20,%rax
add    %edi,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x2,%eax
add    %ecx,%eax
add    %edi,%eax
and    $0x1,%eax
xor    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @_month_length(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @_is_leap_year(i32 %1)
%6 = add nsw i32 %5, 28
br label %11
7: ; preds = %2
%8 = srem i32 %0, 7
%9 = and i32 %8, 1
%10 = xor i32 %9, 31
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ %6, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int debug(char *msg, char *buf) { printf("debug %s: %s\n", msg, buf); }


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

x86 assembly (clang, -O2):
<debug>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"debug %s: %s\0A\00"
define i32 @debug(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 undef
}
/* Variables and functions */
int mt19937_genrand_int32();
long mt19937_genrand_int31(void) {
  return (long)(mt19937_genrand_int32() >> 1);
}


x86 assembly (clang, -O0):
<mt19937_genrand_int31>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt19937_genrand_int32@plt>
sar    $0x1,%eax
cltq
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @mt19937_genrand_int31() {
%1 = call i32 (...) @mt19937_genrand_int32()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @mt19937_genrand_int31() {
%1 = tail call i32 (...) @mt19937_genrand_int32()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
int test_main(int, char **, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) { return test_main(argc, argv, NULL, NULL); }


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
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <test_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <test_main@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 @test_main(i32 %6, i8** %7, i32* null, i32* null)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_main(i32 %0, i8** %1, i32* null, i32* null)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_update_word(int /*<<< orphan*/ *, int);
void eeconfig_disable(void) { eeprom_update_word((uint16_t *)0, 0xFFFF); }


x86 assembly (clang, -O0):
<eeconfig_disable>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffff,%esi
call   1030 <eeprom_update_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_disable>:
xor    %edi,%edi
mov    $0xffff,%esi
jmp    1030 <eeprom_update_word@plt>

LLVM IR (-O0):
define void @eeconfig_disable() {
%1 = call i32 @eeprom_update_word(i32* null, i32 65535)
ret void
}

LLVM IR (-O2):
define void @eeconfig_disable() {
%1 = tail call i32 @eeprom_update_word(i32* null, i32 65535)
ret void
}
void TWI0_IRQHandler(void) {
  while (1)
    ;
}


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

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

LLVM IR (-O0):
define void @TWI0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @TWI0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int LZ4_compressBound(int isize) { return (isize + (isize / 255) + 16); }


x86 assembly (clang, -O0):
<LZ4_compressBound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compressBound>:
movslq %edi,%rax
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x7,%ecx
add    %edx,%ecx
add    %ecx,%eax
add    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @LZ4_compressBound(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 255
%6 = add nsw i32 %3, %5
%7 = add nsw i32 %6, 16
ret i32 %7
}

LLVM IR (-O2):
define i32 @LZ4_compressBound(i32 %0) {
%2 = sdiv i32 %0, 255
%3 = add i32 %0, 16
%4 = add i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ tty_end();
void xenv_finish(void) { tty_end(); }


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

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

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

LLVM IR (-O2):
define void @xenv_finish() {
%1 = tail call i32 (...) @tty_end()
ret void
}
char *RCSid() {
  return RCSid("$Id: version.c,v 1.100.2.8 2013/09/05 19:10:58 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"$Id: version.c,v 1.100.2.8 2013/09/05 19:10:58 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  for (i = 1; i <= 100; i++) {
    if (i % 2 == 0)
      printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1166 <main+0x56>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1153 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
jmp    1138 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x65,%ebx
je     1149 <main+0x39>
test   $0x1,%bl
jne    1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 1, %0 ], [ %8, %7 ]
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 101
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ general_error(int, char *);
void fail(char *msg) { general_error(19, msg); }


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

x86 assembly (clang, -O2):
<fail>:
mov    %rdi,%rsi
mov    $0x13,%edi
jmp    1030 <general_error@plt>

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

LLVM IR (-O2):
define void @fail(i8* %0) {
%2 = tail call i32 @general_error(i32 19, i8* %0)
ret void
}