xunge/DecIR huggingface dataset:
double scalar_product(double V[3], double W[3]) {
  double value;
  int i;
  value = 0.0;
  for (i = 0; i < 3; i++)
    value += V[i] * W[i];
  return (value);
}


x86 assembly (clang, -O0):
<scalar_product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    115f <scalar_product+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <scalar_product+0x1b>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalar_product>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  (%rsi),%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
mulsd  0x8(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @scalar_product(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double 0.000000e+00)
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %9, double %5)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
int subs_si_test2(int a, int b, int c) {
  int d = a - 0xfff;
  if (d <= 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<subs_si_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0xfff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1130 <subs_si_test2+0x30>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113c <subs_si_test2+0x3c>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subs_si_test2>:
cmp    $0x1000,%edi
lea    -0xfff(%rdi,%rsi,1),%eax
cmovl  %edi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @subs_si_test2(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 4096
%5 = add nsw i32 %0, -4095
%6 = add nsw i32 %5, %1
%7 = select i1 %4, i32 %0, i32 %6
%8 = add nsw i32 %7, %2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_type(char *type) {
  write("json-task.json", "\"type\":\"%s\", ", type);
}


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

x86 assembly (clang, -O2):
<function_type>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [14 x i8] c"\22type\22:\22%s\22, \00"
define void @function_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [14 x i8] c"\22type\22:\22%s\22, \00"
define void @function_type(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int f143(int *);
int f144(int *p) { return f143(p); }


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

x86 assembly (clang, -O2):
<f144>:
jmp    1030 <f143@plt>

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

LLVM IR (-O2):
define i32 @f144(i32* %0) {
%2 = tail call i32 @f143(i32* %0)
ret i32 %2
}
unsigned int bitcount(unsigned int val) {
  unsigned int bc = 0;
  while (val != 0) {
    if ((val & 1))
      bc++;
    val >>= 1;
  }
  return bc;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <bitcount+0x3e>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <bitcount+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <bitcount+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_dump_path();
int test_6(int a, int b) {
  int problem = 0;
  if (a)
    problem = 1;
  if (b) {
    if (!problem)
      problem = 2;
    __analyzer_dump_path();
  }
  return problem;
}


x86 assembly (clang, -O0):
<test_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <test_6+0x26>
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1158 <test_6+0x48>
cmpl   $0x0,-0xc(%rbp)
jne    1151 <test_6+0x41>
movl   $0x2,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__analyzer_dump_path@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_6>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
setne  %bl
test   %esi,%esi
je     112d <test_6+0x1d>
test   %edi,%edi
mov    $0x2,%eax
cmove  %eax,%ebx
xor    %eax,%eax
call   1030 <__analyzer_dump_path@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @test_6(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
%6 = icmp eq i32 %1, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = select i1 %3, i32 2, i32 %5
%9 = tail call i32 (...) @__analyzer_dump_path()
br label %10
10: ; preds = %7, %2
%11 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %11
}
void stub_io_idle_hook(void) {}


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

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

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

LLVM IR (-O2):
define void @stub_io_idle_hook() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delete_record(int, int, char *);
void QMDelete(int fno, char *id) { delete_record(18, fno, id); }


x86 assembly (clang, -O0):
<QMDelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x12,%edi
call   1030 <delete_record@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QMDelete>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x12,%edi
jmp    1030 <delete_record@plt>

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

LLVM IR (-O2):
define void @QMDelete(i32 %0, i8* %1) {
%3 = tail call i32 @delete_record(i32 18, i32 %0, i8* %1)
ret void
}
void aofRewriteBufferSize(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               48, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<aofRewriteBufferSize>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x30,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aofRewriteBufferSize>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x30,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.aofRewriteBufferSize = [21 x i8] c"aofRewriteBufferSize\00"
define void @aofRewriteBufferSize() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 48, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.aofRewriteBufferSize, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.aofRewriteBufferSize = [21 x i8] c"aofRewriteBufferSize\00"
define void @aofRewriteBufferSize() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 48, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.aofRewriteBufferSize, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EOF;
int unget(int c, void *arg) {
  if (c == EOF)
    return EOF;
  const unsigned char **s = arg;
  (*s)--;
  return c;
}


x86 assembly (clang, -O0):
<unget>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed3(%rip),%rcx
cmp    (%rcx),%eax
jne    112e <unget+0x2e>
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <unget+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unget>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
cmp    %edi,(%rcx)
je     1111 <unget+0x11>
addq   $0xffffffffffffffff,(%rsi)
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @unget(i32 %0, i8* nocapture %1) {
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %3, %0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = bitcast i8* %1 to i8**
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 -1
store i8* %8, i8** %6
br label %9
9: ; preds = %2, %5
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t generate_upc_channel_dummy(uint32_t *sn) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @generate_upc_channel_dummy(i32* nocapture readnone %0) {
ret i32 0
}
int mask_reg(long long reg) { return reg & 0xffffffff; }


x86 assembly (clang, -O0):
<mask_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xffffffff,%rax
and    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mask_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4294967295
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @mask_reg(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
float f_square(float b_num) {
  float x;
  x = b_num * 4.0;
  return x;
}


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

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

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

LLVM IR (-O2):
define float @f_square(float %0) {
%2 = fmul float %0, 4.000000e+00
ret float %2
}
float track_AngleDistance(float nextAngle, float curAngle) {
  float deltaAngle;
  deltaAngle = nextAngle - curAngle;
  if (deltaAngle < -180)
    deltaAngle += 360;
  else if (deltaAngle > 180)
    deltaAngle -= 360;
  return deltaAngle;
}


x86 assembly (clang, -O0):
<track_AngleDistance>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1146 <track_AngleDistance+0x46>
movss  0xed1(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1177 <track_AngleDistance+0x77>
movss  -0xc(%rbp),%xmm0
movss  0xeb1(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1172 <track_AngleDistance+0x72>
movss  -0xc(%rbp),%xmm0
movss  0xe9f(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1177 <track_AngleDistance+0x77>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<track_AngleDistance>:
subss  %xmm1,%xmm0
movss  0xef4(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    111a <track_AngleDistance+0x1a>
addss  0xef3(%rip),%xmm0
ret
ucomiss 0xee3(%rip),%xmm0
jbe    112b <track_AngleDistance+0x2b>
addss  0xedd(%rip),%xmm0
ret

LLVM IR (-O0):
define float @track_AngleDistance(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fsub float %6, %7
store float %8, float* %5
%9 = load float, float* %5
%10 = fcmp olt float %9, -1.800000e+02
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load float, float* %5
%13 = fadd float %12, 3.600000e+02
store float %13, float* %5
br label %21
14: ; preds = %2
%15 = load float, float* %5
%16 = fcmp ogt float %15, 1.800000e+02
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load float, float* %5
%19 = fsub float %18, 3.600000e+02
store float %19, float* %5
br label %20
20: ; preds = %17, %14
br label %21
21: ; preds = %20, %11
%22 = load float, float* %5
ret float %22
}

LLVM IR (-O2):
define float @track_AngleDistance(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fcmp olt float %3, -1.800000e+02
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = fadd float %3, 3.600000e+02
br label %11
7: ; preds = %2
%8 = fcmp ogt float %3, 1.800000e+02
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = fadd float %3, -3.600000e+02
br label %11
11: ; preds = %7, %9, %5
%12 = phi float [ %6, %5 ], [ %10, %9 ], [ %3, %7 ]
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int test_var = 10;
  printf("Set a breakpoint here: %d.\n", test_var);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"Set a breakpoint here: %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Set a breakpoint here: %d.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
bool nrf52_errata_220(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_220() {
ret i32 0
}
void blockAsyncSignals(void) {}


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

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

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

LLVM IR (-O2):
define void @blockAsyncSignals() {
ret void
}
int main(int argc, char *argv[]) {
  int foo = 0;
  int bar = 4;
  bar /= foo;
  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   $0x0,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x18(%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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 4, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = sdiv i32 %9, %8
store i32 %10, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int str_comp(const char *a, const char *b) { return strcmp(a, b); }


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

x86 assembly (clang, -O2):
<str_comp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @str_comp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
scalar_t__ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
char *strerror(int /*<<< orphan*/);
int eslib_sock_axe(int sock) {
  shutdown(sock, SHUT_RDWR);
  if (close(sock)) {
    printf("socket close error: %s\n", strerror(errno));
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<eslib_sock_axe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    -0x8(%rbp),%edi
call   1050 <close@plt>
cmp    $0x0,%rax
je     1197 <eslib_sock_axe+0x57>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %rax,%rsi
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    119e <eslib_sock_axe+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eslib_sock_axe>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
call   1050 <close@plt>
test   %rax,%rax
je     1181 <eslib_sock_axe+0x41>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe8e(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SHUT_RDWR = global i32 0
@.str = [24 x i8] c"socket close error: %s\0A\00"
@errno = global i32 0
define i32 @eslib_sock_axe(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @SHUT_RDWR
%6 = call i32 @shutdown(i32 %4, i32 %5)
%7 = load i32, i32* %3
%8 = call i64 @close(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* @errno
%12 = call i8* @strerror(i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 -1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
@.str = [24 x i8] c"socket close error: %s\0A\00"
@errno = global i32 0
define i32 @eslib_sock_axe(i32 %0) {
%2 = load i32, i32* @SHUT_RDWR
%3 = tail call i32 @shutdown(i32 %0, i32 %2)
%4 = tail call i64 @close(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = tail call i8* @strerror(i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ -1, %6 ], [ 0, %1 ]
ret i32 %11
}
short test_55_2(short *mem) { return __atomic_fetch_or(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_55_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    0x8(%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
or     %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    1165 <test_55_2+0x65>
jmp    112d <test_55_2+0x2d>
mov    -0x1a(%rbp),%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_55_2>:
movzwl 0x8(%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%ecx
or     $0x1,%ecx
lock cmpxchg %cx,0x8(%rdi)
jne    1110 <test_55_2+0x10>
ret

LLVM IR (-O0):
define signext i16 @test_55_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 4
store i16 1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw or i16* %6, i16 %7 acq_rel
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @test_55_2(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 4
%3 = atomicrmw or i16* %2, i16 1 acq_rel
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "ndd [-dvh] [-c config] [-l lock_file]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"ndd [-dvh] [-c config] [-l lock_file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"ndd [-dvh] [-c config] [-l lock_file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int u_char;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int timerd_write(int, int *, int, int);
int s5auth_s_rep(int s, int method) {
  u_char buf[2];
  int r;
  buf[0] = 0x05;
  buf[1] = method & 0xff;
  r = timerd_write(s, buf, 2, 30);
  if (r < 2) {
    close(s);
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<s5auth_s_rep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x2,%edx
mov    $0x1e,%ecx
call   1040 <timerd_write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jge    1177 <s5auth_s_rep+0x57>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <s5auth_s_rep+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s5auth_s_rep>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x5,0x8(%rsp)
movzbl %sil,%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x2,%edx
mov    $0x1e,%ecx
call   1040 <timerd_write@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jg     1160 <s5auth_s_rep+0x40>
mov    %ebx,%edi
call   1030 <close@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @s5auth_s_rep(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x i32]
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 5, i32* %8
%9 = load i32, i32* %5
%10 = and i32 %9, 255
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 %10, i32* %11
%12 = load i32, i32* %4
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%14 = call i32 @timerd_write(i32 %12, i32* %13, i32 2, i32 30)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 2
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i32, i32* %4
%19 = call i32 @close(i32 %18)
store i32 -1, i32* %3
br label %21
20: ; preds = %2
store i32 0, i32* %3
br label %21
21: ; preds = %20, %17
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @s5auth_s_rep(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 5, i32* %5
%6 = and i32 %1, 255
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %6, i32* %7
%8 = call i32 @timerd_write(i32 %0, i32* %5, i32 2, i32 30)
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @close(i32 %0)
br label %12
12: ; preds = %2, %10
%13 = phi i32 [ -1, %10 ], [ 0, %2 ]
ret i32 %13
}
char *mystrcpy(char *dest, char *src) {
  char *s = src;
  char *d = dest;
  while (*s) {
    *d = *s;
    d++;
    s++;
  }
  *d = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <mystrcpy+0x52>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <mystrcpy+0x1c>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <mystrcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <mystrcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @mystrcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %1, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ numa_available();
int main(void) {
  numa_available();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @numa_available()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printVersion() { printf("repeat v1.2.1:2015.03.11\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"repeat v1.2.1:2015.03.11\0A\00"
define void @printVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"repeat v1.2.1:2015.03.11\00"
define void @printVersion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double sqrt(double);
double get_radius(double center_x, double center_y, double x, double y) {
  double dx = x - center_x;
  double dy = y - center_y;
  double squaredDistance = dx * dx + dy * dy;
  return sqrt(squaredDistance);
}


x86 assembly (clang, -O0):
<get_radius>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1030 <sqrt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_radius>:
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm3
mulsd  %xmm3,%xmm3
mulsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1136 <get_radius+0x26>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
ret
movapd %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @get_radius(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%12 = load double, double* %7
%13 = load double, double* %5
%14 = fsub double %12, %13
store double %14, double* %9
%15 = load double, double* %8
%16 = load double, double* %6
%17 = fsub double %15, %16
store double %17, double* %10
%18 = load double, double* %9
%19 = load double, double* %9
%20 = load double, double* %10
%21 = load double, double* %10
%22 = fmul double %20, %21
%23 = call double @llvm.fmuladd.f64(double %18, double %19, double %22)
store double %23, double* %11
%24 = load double, double* %11
%25 = call double @sqrt(double %24)
ret double %25
}

LLVM IR (-O2):
define double @get_radius(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %0
%6 = fsub double %3, %1
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
%9 = tail call double @sqrt(double %8)
ret double %9
}
void XAllocColorCells() {}


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

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

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

LLVM IR (-O2):
define void @XAllocColorCells() {
ret void
}
void gtk_image_new_from_image() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_new_from_image() {
ret void
}
int test(int arg) {
  int y = 0;
  if (arg > 0)
    y = arg;
  else
    y = -arg;
  return y;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1123 <test+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112b <test+0x2b>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
long vmprof_write_header_for_jit_addr(void **result, long n, void *ip,
                                      int max_depth) {
  return n;
}


x86 assembly (clang, -O0):
<vmprof_write_header_for_jit_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmprof_write_header_for_jit_addr>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @vmprof_write_header_for_jit_addr(i8** nocapture readnone %0, i64 returned %1, i8* nocapture readnone %2, i32 %3) {
ret i64 %1
}
/* Variables and functions */
float M_PI;
int cos(float);
float sine_io(float step, float max_steps, float max_val) {
  return -max_val / 2 * (cos(M_PI * step / max_steps) - 1);
}


x86 assembly (clang, -O0):
<sine_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xebf(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    0x2e97(%rip),%rax
movss  (%rax),%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movss  -0x10(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_io>:
push   %rax
mulss  0xee7(%rip),%xmm2
movss  %xmm2,0x4(%rsp)
mov    0x2ec2(%rip),%rax
mulss  (%rax),%xmm0
divss  %xmm1,%xmm0
call   1030 <cos@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @sine_io(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = fneg float %7
%9 = fdiv float %8, 2.000000e+00
%10 = load float, float* @M_PI
%11 = load float, float* %4
%12 = fmul float %10, %11
%13 = load float, float* %5
%14 = fdiv float %12, %13
%15 = call i32 @cos(float %14)
%16 = sub nsw i32 %15, 1
%17 = sitofp i32 %16 to float
%18 = fmul float %9, %17
ret float %18
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @sine_io(float %0, float %1, float %2) {
%4 = fmul float %2, -5.000000e-01
%5 = load float, float* @M_PI
%6 = fmul float %5, %0
%7 = fdiv float %6, %1
%8 = tail call i32 @cos(float %7)
%9 = add nsw i32 %8, -1
%10 = sitofp i32 %9 to float
%11 = fmul float %4, %10
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test_fail(int temp) { printf("Test failed(%d)\n", temp); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Test failed(%d)\0A\00"
define void @test_fail(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Test failed(%d)\0A\00"
define void @test_fail(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int config_WITH_DEBUG(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @config_WITH_DEBUG() {
ret i32 1
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_short(short const k1, short const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_short>:
xor    %eax,%eax
cmp    %si,%di
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_short(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp slt i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_short(i16 signext %0, i16 signext %1) {
%3 = icmp slt i16 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
mode(n) {
  if (n)
    system("stty raw -echo");
  else
    system("stty echo -raw");
}


x86 assembly (clang, -O0):
<mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1138 <mode+0x28>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <system@plt>
jmp    1146 <mode+0x36>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode>:
test   %edi,%edi
lea    0xef6(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"stty raw -echo\00"
@.str.1 = [15 x i8] c"stty echo -raw\00"
define i32 @mode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"stty raw -echo\00"
@.str.1 = [15 x i8] c"stty echo -raw\00"
define i32 @mode(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %3)
ret i32 undef
}
void add2(int *b) {
  *b += 1;
  *b += 1;
}


x86 assembly (clang, -O0):
<add2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2>:
addl   $0x2,(%rdi)
ret

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

LLVM IR (-O2):
define void @add2(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 2
store i32 %3, i32* %0
ret void
}