xunge/DecIR huggingface dataset:
double exp(double x) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(x);
  return 0;
}


x86 assembly (clang, -O0):
<exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.exp = [4 x i8] c"exp\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @exp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.exp, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%7 = load double, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.exp = [4 x i8] c"exp\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @exp(double %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.exp, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int dup(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int first_avail_fd() {
  int fd;
  fd = dup(0);
  printf("fd = %d\n", fd);
  close(fd);
  return fd;
}


x86 assembly (clang, -O0):
<first_avail_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <dup@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_avail_fd>:
push   %rbx
xor    %edi,%edi
call   1040 <dup@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1050 <close@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"fd = %d\0A\00"
define i32 @first_avail_fd() {
%1 = tail call i32 @dup(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @close(i32 %1)
ret i32 %1
}
void drawSpeedometer(void) {}


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

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

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

LLVM IR (-O2):
define void @drawSpeedometer() {
ret void
}
int test_imm_87int32_mem(int *val) {
  return ((*val) & (0x87 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_87int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 135
%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_87int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 135
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SomeFunction(int, int);
int main(int argc, const char *argv[]) {
  int someInt = 5;
  int anotherInt = 6;
  SomeFunction(someInt, anotherInt);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x6,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <SomeFunction@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x6,%esi
call   1030 <SomeFunction@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @SomeFunction(i32 5, i32 6)
ret i32 0
}
void ignore_return_value(int ignored) {}


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

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

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

LLVM IR (-O2):
define void @ignore_return_value(i32 %0) {
ret void
}
double dBAirplane(double b) { return 12 * b * b - 12; }


x86 assembly (clang, -O0):
<dBAirplane>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dBAirplane>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @dBAirplane(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 1.200000e+01, %3
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double -1.200000e+01)
ret double %6
}

LLVM IR (-O2):
define double @dBAirplane(double %0) {
%2 = fmul double %0, 1.200000e+01
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double -1.200000e+01)
ret double %3
}
char maxchar(char a, char b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<maxchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jle    112c <maxchar+0x2c>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <maxchar+0x33>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxchar>:
mov    %esi,%eax
cmp    %al,%dil
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @maxchar(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xdb() {
  Assert_real((isodigit(219) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1100, ("isodigit should be 0 for 0xdb"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xdb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdb,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x44c,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xdb>:
push   %rax
mov    $0xdb,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x44c,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xdb\00"
define void @t_isodigit_0xdb() {
%1 = call i64 @isodigit(i32 219)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1100, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xdb\00"
define void @t_isodigit_0xdb() {
%1 = tail call i64 @isodigit(i32 219)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1100, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void errr(char *program, char *filespc) {
  fprintf(stderr, "%s: %s read error\n", program, filespc);
  exit(-1);
}


x86 assembly (clang, -O0):
<errr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errr>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"%s: %s read error\0A\00"
define void @errr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"%s: %s read error\0A\00"
define void @errr(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ handle_SOUND(int /*<<< orphan*/);
int gen_SOUND() {
  handle_SOUND(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @gen_SOUND() {
%1 = tail call i32 @handle_SOUND(i32 0)
ret i32 0
}
/* Variables and functions */
void overwriteViewfield(int distance, bool *collided, char *original,
                        char newval) {
  if (newval == 'o' || *collided) {
    return;
  }
  *collided = true;
  if (distance > 2 && newval == 'w') {
    return;
  }
  *original = newval;
}


x86 assembly (clang, -O0):
<overwriteViewfield>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x6f,%eax
je     112e <overwriteViewfield+0x2e>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1133 <overwriteViewfield+0x33>
jmp    1162 <overwriteViewfield+0x62>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x2,-0x4(%rbp)
jle    1159 <overwriteViewfield+0x59>
movsbl -0x19(%rbp),%eax
cmp    $0x77,%eax
jne    1159 <overwriteViewfield+0x59>
jmp    1162 <overwriteViewfield+0x62>
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<overwriteViewfield>:
cmp    $0x6f,%cl
je     110a <overwriteViewfield+0xa>
cmpl   $0x0,(%rsi)
je     110b <overwriteViewfield+0xb>
ret
movl   $0x1,(%rsi)
cmp    $0x3,%edi
jl     111b <overwriteViewfield+0x1b>
cmp    $0x77,%cl
je     110a <overwriteViewfield+0xa>
mov    %cl,(%rdx)
ret

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

LLVM IR (-O2):
define void @overwriteViewfield(i32 %0, i32* nocapture %1, i8* nocapture writeonly %2, i8 signext %3) {
%5 = icmp eq i8 %3, 111
br i1 %5, label %14, label %6
6: ; preds = %4
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %6
store i32 1, i32* %1
%10 = icmp sgt i32 %0, 2
%11 = icmp eq i8 %3, 119
%12 = and i1 %10, %11
br i1 %12, label %14, label %13
13: ; preds = %9
store i8 %3, i8* %2
br label %14
14: ; preds = %9, %4, %6, %13
ret void
}
int getID(void) {
  static int id = 0;
  return id++;
}


x86 assembly (clang, -O0):
<getID>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getID>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@getID.id = internal global i32 0
define i32 @getID() {
%1 = load i32, i32* @getID.id
%2 = add nsw i32 %1, 1
store i32 %2, i32* @getID.id
ret i32 %1
}

LLVM IR (-O2):
@getID.id = internal unnamed_addr global i32 0
define i32 @getID() {
%1 = load i32, i32* @getID.id
%2 = add nsw i32 %1, 1
store i32 %2, i32* @getID.id
ret i32 %1
}
/* Variables and functions */
int O_DSYNC;
int O_RDONLY;
int O_SYNC;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fdatasync(int);
int /*<<< orphan*/ fsync(int);
int open(char *, int);
int /*<<< orphan*/ sync();
int main(int argc, char *argv[]) {
  int fd;
  fd = open(argv[0], O_RDONLY | O_SYNC | O_DSYNC);
  fsync(fd);
  fdatasync(fd);
  sync();
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2e6c(%rip),%rax
mov    (%rax),%esi
mov    0x2e6b(%rip),%rax
or     (%rax),%esi
mov    0x2e4a(%rip),%rax
or     (%rax),%esi
call   1070 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <fsync@plt>
mov    -0x14(%rbp),%edi
call   1030 <fdatasync@plt>
mov    $0x0,%al
call   1050 <sync@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e88(%rip),%rcx
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    (%rsi),%rdi
mov    0x2e63(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
call   1070 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1060 <fsync@plt>
mov    %ebx,%edi
call   1030 <fdatasync@plt>
xor    %eax,%eax
call   1050 <sync@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@O_SYNC = global i32 0
@O_DSYNC = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = load i32, i32* @O_RDONLY
%11 = load i32, i32* @O_SYNC
%12 = or i32 %10, %11
%13 = load i32, i32* @O_DSYNC
%14 = or i32 %12, %13
%15 = call i32 @open(i8* %9, i32 %14)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = call i32 @fsync(i32 %16)
%18 = load i32, i32* %6
%19 = call i32 @fdatasync(i32 %18)
%20 = call i32 (...) @sync()
%21 = load i32, i32* %6
%22 = call i32 @close(i32 %21)
ret i32 0
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@O_SYNC = global i32 0
@O_DSYNC = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i32, i32* @O_RDONLY
%5 = load i32, i32* @O_SYNC
%6 = or i32 %5, %4
%7 = load i32, i32* @O_DSYNC
%8 = or i32 %6, %7
%9 = tail call i32 @open(i8* %3, i32 %8)
%10 = tail call i32 @fsync(i32 %9)
%11 = tail call i32 @fdatasync(i32 %9)
%12 = tail call i32 (...) @sync()
%13 = tail call i32 @close(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Start of the program....\n");
  printf("Exiting the program....\n");
  exit(0);
  printf("End of the program....\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Start of the program....\0A\00"
@.str.1 = [25 x i8] c"Exiting the program....\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [25 x i8] c"Start of the program....\00"
@str.2 = [24 x i8] c"Exiting the program....\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sbrk(int /*<<< orphan*/);
main() { printf("%x\n", sbrk(0)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <sbrk@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <sbrk@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @sbrk(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int get_index(char c) { return (c - 97); }


x86 assembly (clang, -O0):
<get_index>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index>:
lea    -0x61(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_index(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 97
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_index(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -97
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ srand48(unsigned int);
void srand(unsigned int __s) { srand48(__s); }


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

x86 assembly (clang, -O2):
<srand>:
jmp    1030 <srand48@plt>

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

LLVM IR (-O2):
define void @srand(i32 %0) {
%2 = tail call i32 @srand48(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ dpush(int /*<<< orphan*/);
void primitive_dup_impl(void) { dpush(dpeek()); }


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

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

LLVM IR (-O0):
define void @primitive_dup_impl() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @dpush(i32 %1)
ret void
}

LLVM IR (-O2):
define void @primitive_dup_impl() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @dpush(i32 %1)
ret void
}
int nargs_readcol(char *fmt) {
  const char *fp;
  int j;
  j = 0;
  for (fp = fmt; *fp != '\0'; fp++)
    if (*fp == '%' && (*(fp + 1) != '*'))
      j++;
  return j;
}


x86 assembly (clang, -O0):
<nargs_readcol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1167 <nargs_readcol+0x67>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    1151 <nargs_readcol+0x51>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2a,%eax
je     1151 <nargs_readcol+0x51>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <nargs_readcol+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <nargs_readcol+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nargs_readcol>:
add    $0x1,%rdi
xor    %eax,%eax
jmp    111e <nargs_readcol+0x1e>
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmpb   $0x2a,(%rdi)
setne  %cl
add    %ecx,%eax
add    $0x1,%rdi
movzbl -0x1(%rdi),%ecx
cmp    $0x25,%cl
je     1110 <nargs_readcol+0x10>
test   %cl,%cl
jne    111a <nargs_readcol+0x1a>
ret

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

LLVM IR (-O2):
define i32 @nargs_readcol(i8* nocapture %0) {
br label %2
2: ; preds = %12, %1
%3 = phi i8* [ %0, %1 ], [ %14, %12 ]
%4 = phi i32 [ 0, %1 ], [ %13, %12 ]
%5 = load i8, i8* %3
switch i8 %5, label %12 [
i8 0, label %15
i8 37, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 42
%10 = zext i1 %9 to i32
%11 = add nsw i32 %4, %10
br label %12
12: ; preds = %6, %2
%13 = phi i32 [ %4, %2 ], [ %11, %6 ]
%14 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
15: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int tcpaccfdata(int sock) {
  (void)sock;
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<tcpaccfdata>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpaccfdata>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @tcpaccfdata(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @tcpaccfdata(i32 %0) {
%2 = load i32, i32* @EINVAL
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
unsigned isgraph(char c) { return (c >= 0x21 && c <= 0x7e); }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x21,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isgraph+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xdf,%dil
xor    %eax,%eax
cmp    $0x5e,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isgraph(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 33
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 126
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isgraph(i8 signext %0) {
%2 = add i8 %0, -33
%3 = icmp ult i8 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
void ARGBShuffleRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBShuffleRow_Any_AVX2() {
ret void
}
/* Type definitions */
struct tree_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __print_tree(struct tree_node *, int /*<<< orphan*/);
void print_tree(struct tree_node *root) { __print_tree(root, 0); }


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

x86 assembly (clang, -O2):
<print_tree>:
xor    %esi,%esi
jmp    1030 <__print_tree@plt>

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

LLVM IR (-O2):
%struct.tree_node = type { i32 }
define void @print_tree(%struct.tree_node* %0) {
%2 = tail call i32 @__print_tree(%struct.tree_node* %0, i32 0)
ret void
}
int main(int argc, char **argv) {
  int a = 5, b = 5;
  const int c = 10;
  const int *cp = &a;
  cp = &c;
  int const *pc = &a;
  pc = &b;
  int *p = &a;
  p = &c;
  if ((pc == cp) && p) {
    a = 6;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x5,-0x18(%rbp)
movl   $0xa,-0x1c(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1177 <main+0x77>
cmpq   $0x0,-0x38(%rbp)
je     1177 <main+0x77>
movl   $0x6,-0x14(%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 i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store i32 5, i32* %7
store i32 10, i32* %8
store i32* %6, i32** %9
store i32* %8, i32** %9
store i32* %6, i32** %10
store i32* %7, i32** %10
store i32* %6, i32** %11
store i32* %8, i32** %11
%12 = load i32*, i32** %10
%13 = load i32*, i32** %9
%14 = icmp eq i32* %12, %13
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i32*, i32** %11
%17 = icmp ne i32* %16, null
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 6, i32* %6
br label %19
19: ; preds = %18, %15, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void print(const char *str) { fprintf(stdout, "%s", str); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @print(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int fnGCD(int m, int n) {
  if (n == 0)
    return m;
  else
    return fnGCD(n, m % n);
}


x86 assembly (clang, -O0):
<fnGCD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <fnGCD+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <fnGCD+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <fnGCD@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnGCD>:
mov    %edi,%eax
test   %esi,%esi
je     111d <fnGCD+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <fnGCD+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fnGCD(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* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @fnGCD(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @fnGCD(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destroy_wep_key(char *key) { free(key); }


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

x86 assembly (clang, -O2):
<destroy_wep_key>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy_wep_key(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ readPWM(int);
void PWM_ISR_4() { readPWM(4); }


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

x86 assembly (clang, -O2):
<PWM_ISR_4>:
mov    $0x4,%edi
jmp    1030 <readPWM@plt>

LLVM IR (-O0):
define void @PWM_ISR_4() {
%1 = call i32 @readPWM(i32 4)
ret void
}

LLVM IR (-O2):
define void @PWM_ISR_4() {
%1 = tail call i32 @readPWM(i32 4)
ret void
}
void CardTracking(int Lun) {}


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

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

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

LLVM IR (-O2):
define void @CardTracking(i32 %0) {
ret void
}
/* Variables and functions */
int splice(int, int /*<<< orphan*/ *, int, int /*<<< orphan*/ *, int,
           int /*<<< orphan*/);
int main(void) {
  int fd_in = 3;
  int fd_out = 4;
  return splice(fd_in, NULL, fd_out, NULL, 1024, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x400,%r8d
xor    %r9d,%r9d
mov    %rcx,%rsi
call   1030 <splice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x3,%edi
xor    %esi,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x400,%r8d
xor    %r9d,%r9d
jmp    1030 <splice@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 4, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @splice(i32 %4, i32* null, i32 %5, i32* null, i32 1024, i32 0)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @splice(i32 3, i32* null, i32 4, i32* null, i32 1024, i32 0)
ret i32 %1
}
int f(int x, int y) { return x * y; }


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
unsigned long ulong_compare_and_swap(volatile unsigned long *ptr,
                                     unsigned long oldval,
                                     unsigned long newval) {
  return __sync_val_compare_and_swap(ptr, oldval, newval);
}


x86 assembly (clang, -O0):
<ulong_compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulong_compare_and_swap>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i64 @ulong_compare_and_swap(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = cmpxchg i64* %7, i64 %8, i64 %9 seq_cst seq_cst
%11 = extractvalue { i64, i1 } %10, 0
ret i64 %11
}

LLVM IR (-O2):
define i64 @ulong_compare_and_swap(i64* nocapture %0, i64 %1, i64 %2) {
%4 = cmpxchg i64* %0, i64 %1, i64 %2 seq_cst seq_cst
%5 = extractvalue { i64, i1 } %4, 0
ret i64 %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ attributes;
};
struct TYPE_4__ {
  TYPE_1__ min_bounds;
};
typedef TYPE_2__ XFontStruct;

/* Variables and functions */
unsigned short get_XFontStruct_min_bounds_attributes(void *_p) {
  return (unsigned short)((XFontStruct *)_p)->min_bounds.attributes;
}


x86 assembly (clang, -O0):
<get_XFontStruct_min_bounds_attributes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_XFontStruct_min_bounds_attributes>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define zeroext i16 @get_XFontStruct_min_bounds_attributes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @get_XFontStruct_min_bounds_attributes(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Variables and functions */
unsigned long nam2num(char const *);
void *rtai_malloc(unsigned long, int);
void *rtai_shm_attach(const char *name, int size) {
  unsigned long name_as_num = nam2num(name);
  return rtai_malloc(name_as_num, size);
}


x86 assembly (clang, -O0):
<rtai_shm_attach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nam2num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <rtai_malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtai_shm_attach>:
push   %rbx
mov    %esi,%ebx
call   1040 <nam2num@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <rtai_malloc@plt>

LLVM IR (-O0):
define i8* @rtai_shm_attach(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i64 @nam2num(i8* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i32, i32* %4
%10 = call i8* @rtai_malloc(i64 %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @rtai_shm_attach(i8* %0, i32 %1) {
%3 = tail call i64 @nam2num(i8* %0)
%4 = tail call i8* @rtai_malloc(i64 %3, i32 %1)
ret i8* %4
}
/* Variables and functions */
int evaluateOperationsArray(char, int, int);
int /*<<< orphan*/ initializeOperationsArray();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  initializeOperationsArray();
  printf("suma:%d\n", evaluateOperationsArray('+', 3, 7));
  printf("resta:%d\n", evaluateOperationsArray('-', 7, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initializeOperationsArray@plt>
mov    $0x2b,%edi
mov    $0x3,%esi
mov    $0x7,%edx
call   1050 <evaluateOperationsArray@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2d,%edi
mov    $0x7,%esi
mov    $0x3,%edx
call   1050 <evaluateOperationsArray@plt>
mov    %eax,%esi
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initializeOperationsArray@plt>
mov    $0x2b,%edi
mov    $0x3,%esi
mov    $0x7,%edx
call   1050 <evaluateOperationsArray@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x2d,%edi
mov    $0x7,%esi
mov    $0x3,%edx
call   1050 <evaluateOperationsArray@plt>
lea    0xe94(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"suma:%d\0A\00"
@.str.1 = [10 x i8] c"resta:%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initializeOperationsArray()
%3 = call i32 @evaluateOperationsArray(i8 signext 43, i32 3, i32 7)
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @evaluateOperationsArray(i8 signext 45, i32 7, i32 3)
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"suma:%d\0A\00"
@.str.1 = [10 x i8] c"resta:%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @initializeOperationsArray()
%2 = tail call i32 @evaluateOperationsArray(i8 signext 43, i32 3, i32 7)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @evaluateOperationsArray(i8 signext 45, i32 7, i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void rop3_117_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = S | stk3;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_117_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_117_0_0>:
not    %dl
or     %sil,%dl
and    (%rdi),%dl
not    %dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_117_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = load i8*, i8** %4
store i8 %31, i8* %32
ret void
}

LLVM IR (-O2):
define void @rop3_117_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = or i8 %4, %1
%6 = load i8, i8* %0
%7 = and i8 %6, %5
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
/* Type definitions */
struct timeval {
  long long tv_usec;
  scalar_t__ tv_sec;
};

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


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

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

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

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}
int __attribute__((nomips16)) f8(unsigned long long y) {
  return (short)((short)(y >> 61) + 1);
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3d,%rax
cwtl
add    $0x1,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
shr    $0x3d,%rdi
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f8(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 61
%5 = trunc i64 %4 to i16
%6 = sext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = trunc i32 %7 to i16
%9 = sext i16 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f8(i64 %0) {
%2 = lshr i64 %0, 61
%3 = trunc i64 %2 to i32
%4 = add nuw nsw i32 %3, 1
ret i32 %4
}