xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int asuint64(double);
uint32_t top12(double x) { return asuint64(x) >> 52; }


x86 assembly (clang, -O0):
<top12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <asuint64@plt>
mov    $0x34,%ecx
sar    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<top12>:
jmp    1030 <asuint64@plt>

LLVM IR (-O0):
define i32 @top12(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @asuint64(double %3)
%5 = ashr i32 %4, 52
ret i32 %5
}

LLVM IR (-O2):
define i32 @top12(double %0) {
%2 = tail call i32 @asuint64(double %0)
ret i32 poison
}
/* Variables and functions */
float expf(float);
float intr_wrap_039(float p1) { return expf(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_039>:
jmp    1030 <expf@plt>

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

LLVM IR (-O2):
define float @intr_wrap_039(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ exit(int);
void sys_bail(int n) {
  static int reentered = 0;
  if (!reentered) {
    reentered = 1;
    exit(n);
  } else
    _exit(1);
}


x86 assembly (clang, -O0):
<sys_bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,0x2f02(%rip)
jne    114a <sys_bail+0x2a>
movl   $0x1,0x2ef2(%rip)
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<sys_bail>:
push   %rax
cmpb   $0x0,0x2f0c(%rip)
je     1134 <sys_bail+0x14>
mov    $0x1,%edi
call   1030 <_exit@plt>
movb   $0x1,0x2ef9(%rip)
call   1040 <exit@plt>

LLVM IR (-O0):
@sys_bail.reentered = internal global i32 0
define void @sys_bail(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @sys_bail.reentered
%4 = icmp ne i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
store i32 1, i32* @sys_bail.reentered
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@sys_bail.reentered = internal unnamed_addr global i1 false
define void @sys_bail(i32 %0) {
%2 = load i1, i1* @sys_bail.reentered
br i1 %2, label %5, label %3
3: ; preds = %1
store i1 true, i1* @sys_bail.reentered
%4 = tail call i32 @exit(i32 %0)
unreachable
5: ; preds = %1
%6 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int iso9660_serial(char const *, char *, int, int);
int vcd_serial(const char *path, char *serial) {
  return iso9660_serial(path, serial, 0x0930, 0x100000 + 0x18);
}


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

x86 assembly (clang, -O2):
<vcd_serial>:
mov    $0x930,%edx
mov    $0x100018,%ecx
jmp    1030 <iso9660_serial@plt>

LLVM IR (-O0):
define i32 @vcd_serial(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @iso9660_serial(i8* %5, i8* %6, i32 2352, i32 1048600)
ret i32 %7
}

LLVM IR (-O2):
define i32 @vcd_serial(i8* %0, i8* %1) {
%3 = tail call i32 @iso9660_serial(i8* %0, i8* %1, i32 2352, i32 1048600)
ret i32 %3
}
double minimum(double a, double b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<minimum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <minimum+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <minimum+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @minimum(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int main() {
  struct a {
    int x;
    int y;
    int z : 10;
  };
  struct b {
    int x;
    int y;
  };
  volatile struct b k;
  volatile struct a *p;
  p = (struct a *)&k;
  p->z = 'q';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%cx
and    $0xfc00,%cx
or     $0x71,%cx
mov    %cx,0x8(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.b = type { i32, i32 }
%struct.a = type { i32, i32, i16 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.b
%3 = alloca %struct.a*
store i32 0, i32* %1
%4 = bitcast %struct.b* %2 to %struct.a*
store %struct.a* %4, %struct.a** %3
%5 = load %struct.a*, %struct.a** %3
%6 = getelementptr inbounds %struct.a, %struct.a* %5, i32 0, i32 2
%7 = load volatile i16, i16* %6
%8 = and i16 %7, -1024
%9 = or i16 %8, 113
store volatile i16 %9, i16* %6
ret i32 0
}

LLVM IR (-O2):
%struct.b = type { i32, i32 }
%struct.a = type { i32, i32, i16 }
define i32 @main() {
ret i32 0
}
int gcd(int x, int y) {
  int r;
  if (x < 0)
    x = -x;
  if (y < 0)
    y = -y;
  while (y > 0) {
    r = x;
    while (r >= y)
      r = r - y;
    x = y;
    y = r;
  }
  return x;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111c <gcd+0x1c>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    112e <gcd+0x2e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <gcd+0x33>
cmpl   $0x0,-0x8(%rbp)
jle    116e <gcd+0x6e>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     115d <gcd+0x5d>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <gcd+0x43>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <gcd+0x33>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
test   %esi,%esi
je     113c <gcd+0x3c>
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%edx
mov    %ecx,%eax
add    %ecx,%edx
mov    %edx,%ecx
nopl   0x0(%rax,%rax,1)
sub    %eax,%ecx
sub    %eax,%edx
cmp    %eax,%edx
jge    1130 <gcd+0x30>
test   %ecx,%ecx
jg     1120 <gcd+0x20>
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = icmp eq i32 %1, 0
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
br label %9
7: ; preds = %12
%8 = icmp sgt i32 %13, 0
br i1 %8, label %9, label %16
9: ; preds = %5, %7
%10 = phi i32 [ %13, %7 ], [ %6, %5 ]
%11 = phi i32 [ %10, %7 ], [ %3, %5 ]
br label %12
12: ; preds = %12, %9
%13 = phi i32 [ %15, %12 ], [ %11, %9 ]
%14 = icmp slt i32 %13, %10
%15 = sub nsw i32 %13, %10
br i1 %14, label %7, label %12
16: ; preds = %7, %2
%17 = phi i32 [ %3, %2 ], [ %10, %7 ]
ret i32 %17
}
void ASN1_T61STRING_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_T61STRING_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main(int argc, char **argv) {
  char *s = argc == 2 ? argv[1] : argv[0];
  reverse(s);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1151 <main+0x31>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    115c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x18(%rbp),%rsi
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
mov    (%rsi,%rax,8),%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
%4 = zext i1 %3 to i64
%5 = getelementptr i8*, i8** %1, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i32 @reverse(i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}
int bigendianp(void) {
  int test = 1;
  char *hack = (char *)(&test);
  if (hack[0])
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<bigendianp>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112c <bigendianp+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1133 <bigendianp+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bigendianp() {
ret i32 0
}
/* Variables and functions */
double MBtoATM(double);
double HPAtoATM(double HPA) {
  double ATM = MBtoATM(HPA);
  return ATM;
}


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

x86 assembly (clang, -O2):
<HPAtoATM>:
jmp    1030 <MBtoATM@plt>

LLVM IR (-O0):
define double @HPAtoATM(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @MBtoATM(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @HPAtoATM(double %0) {
%2 = tail call double @MBtoATM(double %0)
ret double %2
}
int canMonitorConsoleBell(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @canMonitorConsoleBell() {
ret i32 0
}

LLVM IR (-O2):
define i32 @canMonitorConsoleBell() {
ret i32 0
}
OP(fd, ca) {
  illegal_1();
  op_ca();
}


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1040 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <op_ca@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ca()
ret i32 undef
}
long long my_llabs(long long n) { return n < 0 ? -n : n; }


x86 assembly (clang, -O0):
<my_llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <my_llabs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <my_llabs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_llabs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @my_llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @my_llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ write_line(char *);
void ipf_itemize(void) { write_line(":ul."); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c":ul.\00"
define void @ipf_itemize() {
%1 = call i32 @write_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c":ul.\00"
define void @ipf_itemize() {
%1 = tail call i32 @write_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __disable_irq();
void port_disable(void) { __disable_irq(); }


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

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

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

LLVM IR (-O2):
define void @port_disable() {
%1 = tail call i32 (...) @__disable_irq()
ret void
}
int test_imm_29uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x29 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_29uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x29,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_29uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 41
%7 = icmp ne i64 %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_29uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 176093659136
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_2Fint16_mem(short *val) {
  return ((*val) & (0x2F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Fint16_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, 47
%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_2Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 47
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ERR_release_err_state_table(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_release_err_state_table() {
ret void
}
int z$$1(struct _Data$$1 *this$1) { return g$$1(this$1); }


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

x86 assembly (clang, -O2):
<z$$1>:
xor    %eax,%eax
jmp    1030 <g$$1@plt>

LLVM IR (-O0):
%"struct._Data$$1" = type opaque
define i32 @"z$$1"(%"struct._Data$$1"* %0) {
%2 = alloca %"struct._Data$$1"*
store %"struct._Data$$1"* %0, %"struct._Data$$1"** %2
%3 = load %"struct._Data$$1"*, %"struct._Data$$1"** %2
%4 = call i32 (%"struct._Data$$1"*, ...) bitcast (i32 (...)* @"g$$1" to i32 (%"struct._Data$$1"*, ...)*)(%"struct._Data$$1"* %3)
ret i32 %4
}

LLVM IR (-O2):
%"struct._Data$$1" = type opaque
define i32 @"z$$1"(%"struct._Data$$1"* %0) {
%2 = tail call i32 (%"struct._Data$$1"*, ...) bitcast (i32 (...)* @"g$$1" to i32 (%"struct._Data$$1"*, ...)*)(%"struct._Data$$1"* %0)
ret i32 %2
}
/* Variables and functions */
int fact(int);
int pow(float, int);
float calc(int a, float x) {
  int i;
  if (a % 2 == 0)
    i = 1;
  else
    i = -1;
  return (i * (pow(x, 2 * a + 1))) / (fact(2 * a + 1));
}


x86 assembly (clang, -O0):
<calc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1150 <calc+0x30>
movl   $0x1,-0xc(%rbp)
jmp    1157 <calc+0x37>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%edi
call   1030 <fact@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    (%rbx,%rbx,1),%r14d
add    $0x1,%r14d
mov    %r14d,%edi
call   1040 <pow@plt>
mov    %eax,%ebp
neg    %eax
test   $0x1,%bl
cmovne %eax,%ebp
mov    %r14d,%edi
call   1030 <fact@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define float @calc(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
store i32 %0, i32* %3
store float %1, float* %4
%6 = load i32, i32* %3
%7 = srem i32 %6, 2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %5
br label %11
10: ; preds = %2
store i32 -1, i32* %5
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %5
%13 = load float, float* %4
%14 = load i32, i32* %3
%15 = mul nsw i32 2, %14
%16 = add nsw i32 %15, 1
%17 = call i32 @pow(float %13, i32 %16)
%18 = mul nsw i32 %12, %17
%19 = load i32, i32* %3
%20 = mul nsw i32 2, %19
%21 = add nsw i32 %20, 1
%22 = call i32 @fact(i32 %21)
%23 = sdiv i32 %18, %22
%24 = sitofp i32 %23 to float
ret float %24
}

LLVM IR (-O2):
define float @calc(i32 %0, float %1) {
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
%5 = shl nsw i32 %0, 1
%6 = or i32 %5, 1
%7 = tail call i32 @pow(float %1, i32 %6)
%8 = sub nsw i32 0, %7
%9 = select i1 %4, i32 %7, i32 %8
%10 = tail call i32 @fact(i32 %6)
%11 = sdiv i32 %9, %10
%12 = sitofp i32 %11 to float
ret float %12
}
void swr_get_out_samples() {}


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

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

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

LLVM IR (-O2):
define void @swr_get_out_samples() {
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
scalar_t__ isupper(int);
int ispunct(int c) {
  if (islower(c))
    return 0;
  if (isupper(c))
    return 0;
  if (c == ' ')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1149 <ispunct+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1184 <ispunct+0x64>
mov    -0x8(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1167 <ispunct+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1184 <ispunct+0x64>
cmpl   $0x20,-0x8(%rbp)
jne    117d <ispunct+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <ispunct+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <islower@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    1145 <ispunct+0x25>
mov    %ebp,%edi
call   1040 <isupper@plt>
test   %rax,%rax
jne    1145 <ispunct+0x25>
xor    %ebx,%ebx
cmp    $0x20,%ebp
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i64 @isupper(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = icmp ne i32 %0, 32
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %7, %4, %1
%11 = phi i32 [ 0, %1 ], [ 0, %4 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_136(void) {
  if (*(uint32_t *)0x10000130ul == 0x8ul) {
    if (*(uint32_t *)0x10000134ul == 0x0ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x1ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x2ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x3ul) {
      return true;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<errata_136>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0x8,%rax
jne    1193 <errata_136+0x93>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_136+0x34>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_136+0x9a>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x1,%rax
jne    1152 <errata_136+0x52>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_136+0x9a>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x2,%rax
jne    1170 <errata_136+0x70>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_136+0x9a>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x3,%rax
jne    118e <errata_136+0x8e>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_136+0x9a>
jmp    1193 <errata_136+0x93>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @errata_136() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int vfork();
int vfork_fn(const char *cgroup, void *arg) {
  int pid = vfork();
  if (pid == 0)
    while (true)
      sleep(1);
  return pid;
}


x86 assembly (clang, -O0):
<vfork_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
call   1030 <vfork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1156 <vfork_fn+0x36>
jmp    1147 <vfork_fn+0x27>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1147 <vfork_fn+0x27>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfork_fn>:
push   %rbx
call   1030 <vfork@plt>
test   %eax,%eax
je     112c <vfork_fn+0xc>
pop    %rbx
ret
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <sleep@plt>
jmp    1140 <vfork_fn+0x20>

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

LLVM IR (-O2):
define i32 @vfork_fn(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = call i32 @vfork()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2, %5
%6 = call i32 @sleep(i32 1)
br label %5
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int SafeOpenWrite(char *);
int /*<<< orphan*/ SafeWrite(int, void *, long);
int /*<<< orphan*/ close(int);
void SaveFile(char *filename, void *buffer, long count) {
  int handle;
  handle = SafeOpenWrite(filename);
  SafeWrite(handle, buffer, count);
  close(handle);
}


x86 assembly (clang, -O0):
<SaveFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <SafeOpenWrite@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <SafeWrite@plt>
mov    -0x1c(%rbp),%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SaveFile>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <SafeOpenWrite@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <SafeWrite@plt>
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <close@plt>

LLVM IR (-O0):
define void @SaveFile(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i32 @SafeOpenWrite(i8* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 @SafeWrite(i32 %10, i8* %11, i64 %12)
%14 = load i32, i32* %7
%15 = call i32 @close(i32 %14)
ret void
}

LLVM IR (-O2):
define void @SaveFile(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @SafeOpenWrite(i8* %0)
%5 = tail call i32 @SafeWrite(i32 %4, i8* %1, i64 %2)
%6 = tail call i32 @close(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char msg1[] = "World";
  printf("Hello %s\n", msg1);
  system("ls /");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x64,0x4(%rsp)
movl   $0x6c726f57,(%rsp)
lea    0xed0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.msg1 = [6 x i8] c"World\00"
@.str = [10 x i8] c"Hello %s\0A\00"
@.str.1 = [5 x i8] c"ls /\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.msg1 = [6 x i8] c"World\00"
@.str = [10 x i8] c"Hello %s\0A\00"
@.str.1 = [5 x i8] c"ls /\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ circle(int);
unsigned long long clock();
int /*<<< orphan*/ printf(char *, unsigned long long);
int main() {
  unsigned long long clo = clock();
  circle(4800);
  printf("%d\n", (clock() - clo) / 1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
mov    $0x12c0,%edi
call   1050 <circle@plt>
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rsi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    $0x12c0,%edi
call   1050 <circle@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
shr    $0x4,%rdx
lea    0xe95(%rip),%rdi
mov    %rdx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @clock()
%2 = tail call i32 @circle(i32 4800)
%3 = tail call i64 (...) @clock()
%4 = sub i64 %3, %1
%5 = udiv i64 %4, 1000
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %5)
ret i32 0
}
void printchar(char **str, int c) {
  extern int putchar(int c);
  if (str) {
    **str = c;
    ++(*str);
  } else
    (void)putchar(c);
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <printchar+0x43>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
mov    %esi,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %2
%10 = tail call i32 @putchar(i32 %1)
br label %11
11: ; preds = %9, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_logging(int /*<<< orphan*/);
int subsys_logging_initialize(void) {
  init_logging(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @subsys_logging_initialize() {
%1 = call i32 @init_logging(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @subsys_logging_initialize() {
%1 = tail call i32 @init_logging(i32 0)
ret i32 0
}
void aha_log(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @aha_log(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_outbyte(int);
int putchar(int c) {
  if (c == '\n')
    serial_outbyte('\r');
  serial_outbyte(c);
  return ((unsigned char)c);
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    112f <putchar+0x1f>
mov    $0xd,%edi
call   1030 <serial_outbyte@plt>
mov    -0x4(%rbp),%edi
call   1030 <serial_outbyte@plt>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jne    1122 <putchar+0x12>
mov    $0xd,%edi
call   1030 <serial_outbyte@plt>
mov    %ebx,%edi
call   1030 <serial_outbyte@plt>
movzbl %bl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @serial_outbyte(i32 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @serial_outbyte(i32 %0)
%7 = and i32 %0, 255
ret i32 %7
}
/* Type definitions */
struct pagevec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __pagevec_lru_add(struct pagevec *);
scalar_t__ pagevec_count(struct pagevec *);
void pagevec_lru_add(struct pagevec *pvec) {
  if (pagevec_count(pvec))
    __pagevec_lru_add(pvec);
}


x86 assembly (clang, -O0):
<pagevec_lru_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pagevec_count@plt>
cmp    $0x0,%rax
je     1148 <pagevec_lru_add+0x28>
mov    -0x8(%rbp),%rdi
call   1040 <__pagevec_lru_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pagevec_lru_add>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pagevec_count@plt>
test   %rax,%rax
je     1137 <pagevec_lru_add+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <__pagevec_lru_add@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.pagevec = type { i32 }
define void @pagevec_lru_add(%struct.pagevec* %0) {
%2 = alloca %struct.pagevec*
store %struct.pagevec* %0, %struct.pagevec** %2
%3 = load %struct.pagevec*, %struct.pagevec** %2
%4 = call i64 @pagevec_count(%struct.pagevec* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.pagevec*, %struct.pagevec** %2
%8 = call i32 @__pagevec_lru_add(%struct.pagevec* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.pagevec = type { i32 }
define void @pagevec_lru_add(%struct.pagevec* %0) {
%2 = tail call i64 @pagevec_count(%struct.pagevec* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__pagevec_lru_add(%struct.pagevec* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<accept>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @accept(i32 %0, %struct.sockaddr* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ teste_hash();
void main(void) {
  printf("\nWelcome!");
  teste_hash();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <teste_hash@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\0AWelcome!\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @teste_hash()
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0AWelcome!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @teste_hash()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ iap_entry(unsigned int *, unsigned int *);
unsigned int FLASH_PrepareSectors(unsigned int startSector,
                                  unsigned int endSector) {
  unsigned int iap_command[5], iap_result[3];
  iap_command[0] = 50;
  iap_command[1] = startSector;
  iap_command[2] = endSector;
  iap_entry(iap_command, iap_result);
  return iap_result[0];
}


x86 assembly (clang, -O0):
<FLASH_PrepareSectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x32,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
call   1030 <iap_entry@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLASH_PrepareSectors>:
sub    $0x28,%rsp
movl   $0x32,(%rsp)
mov    %edi,0x4(%rsp)
mov    %esi,0x8(%rsp)
mov    %rsp,%rdi
lea    0x1c(%rsp),%rsi
call   1030 <iap_entry@plt>
mov    0x1c(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @FLASH_PrepareSectors(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [5 x i32]
%6 = alloca [3 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
store i32 50, i32* %7
%8 = load i32, i32* %3
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 1
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 2
store i32 %10, i32* %11
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%14 = call i32 @iap_entry(i32* %12, i32* %13)
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @FLASH_PrepareSectors(i32 %0, i32 %1) {
%3 = alloca [5 x i32]
%4 = alloca [3 x i32]
%5 = bitcast [5 x i32]* %3 to i8*
%6 = bitcast [3 x i32]* %4 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
store i32 50, i32* %7
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 1
store i32 %0, i32* %8
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 2
store i32 %1, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%11 = call i32 @iap_entry(i32* %7, i32* %10)
%12 = load i32, i32* %10
ret i32 %12
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
#define KEY_DOWN 131
#define KEY_LEFT 130
#define KEY_RIGHT 129
#define KEY_UP 128
int8_t cw_rotations_of_key(int key) {
  switch (key) {
  case KEY_LEFT:
    return 0;
  case KEY_DOWN:
    return 1;
  case KEY_RIGHT:
    return 2;
  case KEY_UP:
    return 3;
  default:
    return -1;
  }
}


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

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

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

LLVM IR (-O2):
@switch.table.cw_rotations_of_key = [4 x i32] [i32 3, i32 2, i32 0, i32 1]
define i32 @cw_rotations_of_key(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.cw_rotations_of_key, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ CLRWDT();
int /*<<< orphan*/ ConfigureOscillator();
int /*<<< orphan*/ InitApp();
void main(void) {
  ConfigureOscillator();
  InitApp();
  while (1) {
    CLRWDT();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ConfigureOscillator@plt>
mov    $0x0,%al
call   1030 <InitApp@plt>
mov    $0x0,%al
call   1050 <CLRWDT@plt>
jmp    1142 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <ConfigureOscillator@plt>
xor    %eax,%eax
call   1030 <InitApp@plt>
nop
xor    %eax,%eax
call   1050 <CLRWDT@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @ConfigureOscillator()
%2 = call i32 (...) @InitApp()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @CLRWDT()
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @ConfigureOscillator()
%2 = tail call i32 (...) @InitApp()
br label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @CLRWDT()
br label %3
}