xunge/DecIR huggingface dataset:
/* Type definitions */
struct block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ intern_blocks(struct block *);
int /*<<< orphan*/ opt_cleanup();
int /*<<< orphan*/ opt_init(struct block *);
int /*<<< orphan*/ opt_loop(struct block *, int);
int /*<<< orphan*/ opt_root(struct block **);
void bpf_optimize(struct block **rootp) {
  struct block *root;
  root = *rootp;
  opt_init(root);
  opt_loop(root, 0);
  opt_loop(root, 1);
  intern_blocks(root);
  opt_root(rootp);
  opt_cleanup();
}


x86 assembly (clang, -O0):
<bpf_optimize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <opt_init@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1050 <opt_loop@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <opt_loop@plt>
mov    -0x10(%rbp),%rdi
call   1030 <intern_blocks@plt>
mov    -0x8(%rbp),%rdi
call   1040 <opt_root@plt>
mov    $0x0,%al
call   1060 <opt_cleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_optimize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1070 <opt_init@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <opt_loop@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <opt_loop@plt>
mov    %rbx,%rdi
call   1030 <intern_blocks@plt>
mov    %r14,%rdi
call   1040 <opt_root@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <opt_cleanup@plt>

LLVM IR (-O0):
%struct.block = type { i32 }
define void @bpf_optimize(%struct.block** %0) {
%2 = alloca %struct.block**
%3 = alloca %struct.block*
store %struct.block** %0, %struct.block*** %2
%4 = load %struct.block**, %struct.block*** %2
%5 = load %struct.block*, %struct.block** %4
store %struct.block* %5, %struct.block** %3
%6 = load %struct.block*, %struct.block** %3
%7 = call i32 @opt_init(%struct.block* %6)
%8 = load %struct.block*, %struct.block** %3
%9 = call i32 @opt_loop(%struct.block* %8, i32 0)
%10 = load %struct.block*, %struct.block** %3
%11 = call i32 @opt_loop(%struct.block* %10, i32 1)
%12 = load %struct.block*, %struct.block** %3
%13 = call i32 @intern_blocks(%struct.block* %12)
%14 = load %struct.block**, %struct.block*** %2
%15 = call i32 @opt_root(%struct.block** %14)
%16 = call i32 (...) @opt_cleanup()
ret void
}

LLVM IR (-O2):
%struct.block = type { i32 }
define void @bpf_optimize(%struct.block** %0) {
%2 = load %struct.block*, %struct.block** %0
%3 = tail call i32 @opt_init(%struct.block* %2)
%4 = tail call i32 @opt_loop(%struct.block* %2, i32 0)
%5 = tail call i32 @opt_loop(%struct.block* %2, i32 1)
%6 = tail call i32 @intern_blocks(%struct.block* %2)
%7 = tail call i32 @opt_root(%struct.block** %0)
%8 = tail call i32 (...) @opt_cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sw_cvolume_snprint_dB() {
  printf("NOT IMPLEMENTED:"
         "pa_sw_cvolume_snprint_dB"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_sw_cvolume_snprint_dB\00"
define i32 @pa_sw_cvolume_snprint_dB() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int __infer_nondet_int();
int islower(int x) { return __infer_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
/* Variables and functions */
double EstimatePi(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Estimating pi using 1,000,000,000 iterations of summation 4(1 - 1/3 "
         "+ 1/5 ... 1/(n+3))...\n");
  double pi = EstimatePi(1000000000);
  printf("%.15f\n", pi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x3b9aca00,%edi
call   1030 <EstimatePi@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xf03(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3b9aca00,%edi
call   1040 <EstimatePi@plt>
lea    0xeb2(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [91 x i8] c"Estimating pi using 1,000,000,000 iterations of summation 4(1 - 1/3 + 1/5 ... 1/(n+3))...\0A\00"
@.str.1 = [7 x i8] c"%.15f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
%4 = call double @EstimatePi(i32 1000000000)
store double %4, double* %2
%5 = load double, double* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%.15f\0A\00"
@str = [90 x i8] c"Estimating pi using 1,000,000,000 iterations of summation 4(1 - 1/3 + 1/5 ... 1/(n+3))...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([90 x i8], [90 x i8]* @str, i64 0, i64 0))
%2 = tail call double @EstimatePi(i32 1000000000)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %2)
ret i32 0
}
/* Variables and functions */
float atan(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void arctg(void) {
  float x, result;
  printf("Function arctg(x) - input x: ");
  scanf("%f", &x);
  result = atan(x);
  printf("acrtg(%f) = %f\n", x, result);
}


x86 assembly (clang, -O0):
<arctg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
call   1040 <atan@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xea3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arctg>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1040 <atan@plt>
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
lea    0xeae(%rip),%rdi
movaps %xmm2,%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Function arctg(x) - input x: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"acrtg(%f) = %f\0A\00"
define void @arctg() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call float @atan(float %5)
store float %6, float* %2
%7 = load float, float* %1
%8 = fpext float %7 to double
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %8, double %10)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Function arctg(x) - input x: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"acrtg(%f) = %f\0A\00"
define void @arctg() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call float @atan(float %5)
%7 = load float, float* %1
%8 = fpext float %7 to double
%9 = fpext float %6 to double
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %8, double %9)
ret void
}
int height(int *figure) {
  int max = 0;
  for (int i = 0; i < 4; i++) {
    int width = figure[i] / 10;
    if (width > max)
      max = width;
  }
  return max;
}


x86 assembly (clang, -O0):
<height>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    115b <height+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1148 <height+0x48>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114d <height+0x4d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <height+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<height>:
movslq (%rdi),%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
xor    %edx,%edx
add    %ecx,%eax
cmovs  %edx,%eax
movslq 0x4(%rdi),%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
cmp    %eax,%ecx
cmovle %eax,%ecx
movslq 0x8(%rdi),%rax
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x22,%rdx
add    %eax,%edx
cmp    %ecx,%edx
cmovle %ecx,%edx
movslq 0xc(%rdi),%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
cmp    %edx,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @height(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sdiv i32 %2, 10
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 10
%9 = icmp sgt i32 %8, %5
%10 = select i1 %9, i32 %8, i32 %5
%11 = getelementptr inbounds i32, i32* %0, i64 2
%12 = load i32, i32* %11
%13 = sdiv i32 %12, 10
%14 = icmp sgt i32 %13, %10
%15 = select i1 %14, i32 %13, i32 %10
%16 = getelementptr inbounds i32, i32* %0, i64 3
%17 = load i32, i32* %16
%18 = sdiv i32 %17, 10
%19 = icmp sgt i32 %18, %15
%20 = select i1 %19, i32 %18, i32 %15
ret i32 %20
}
extern int ckrand(rngstate)
long rngstate[57];
{
  if (((rngstate[57 - 1]) - (rngstate[57 - 2]) - 24) % 55 != 0)
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<ckrand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1c0(%rax),%rax
mov    -0x10(%rbp),%rcx
sub    0x1b8(%rcx),%rax
sub    $0x18,%rax
mov    $0x37,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     1142 <ckrand+0x42>
movl   $0x0,-0x4(%rbp)
jmp    1149 <ckrand+0x49>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckrand>:
mov    0x1c0(%rdi),%rax
sub    0x1b8(%rdi),%rax
movabs $0x6fb586fb586fb587,%rcx
86 b5 6f
imul   %rax,%rcx
movabs $0x894f2094f2094f20,%rdx
20 4f 89
add    %rcx,%rdx
movabs $0x4a7904a7904a791,%rcx
90 a7 04
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ckrand(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 56
%3 = load i64, i64* %2
%4 = getelementptr inbounds i64, i64* %0, i64 55
%5 = load i64, i64* %4
%6 = add i64 %3, -24
%7 = sub i64 %6, %5
%8 = srem i64 %7, 55
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ UnitTest_report();
int /*<<< orphan*/ testNew();
int main(int argc, char **argv) {
  testNew();
  UnitTest_report();
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @testNew()
%6 = call i32 (...) @UnitTest_report()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testNew()
%4 = tail call i32 (...) @UnitTest_report()
ret i32 0
}
void av_index_search_timestamp() {}


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

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

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

LLVM IR (-O2):
define void @av_index_search_timestamp() {
ret void
}
int test_imm_9Euint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x9E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Euint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 678604832768
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int grep_for_word(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *word = argv[1];
  int rval = grep_for_word(word);
  if (rval == 0) {
    printf("find word %s\n", word);
  } else {
    printf("not find word %s\n", word);
  }
  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    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <grep_for_word@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    116d <main+0x4d>
mov    -0x18(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <main+0x5d>
mov    -0x18(%rbp),%rsi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1040 <grep_for_word@plt>
test   %eax,%eax
lea    0xece(%rip),%rax
lea    0xec3(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"find word %s\0A\00"
@.str.1 = [18 x i8] c"not find word %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @grep_for_word(i8* %4)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @printf(i8* %7, i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int _unlink(const char *n) {
  assert(0);
  return -1;
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unlink>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @assert(i32 0)
ret i32 -1
}

LLVM IR (-O2):
define i32 @_unlink(i8* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 -1
}
void XkbRefreshKeyboardMapping() {}


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

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

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

LLVM IR (-O2):
define void @XkbRefreshKeyboardMapping() {
ret void
}
__attribute__((always_)) int arch_is_kernel_text(unsigned long addr) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @arch_is_kernel_text(i64 %0) {
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ findtoday(int);
int main(int argc, char **argv) {
  int days_before = 0;
  if (argc == 2)
    days_before = atoi(argv[1]);
  findtoday(days_before);
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1157 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <findtoday@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
xor    %edi,%edi
cmp    $0x2,%eax
jne    1135 <main+0x15>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <findtoday@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
br label %14
14: ; preds = %9, %2
%15 = load i32, i32* %6
%16 = call i32 @findtoday(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
%10 = tail call i32 @findtoday(i32 %9)
ret i32 0
}
/* Variables and functions */
int idris_utf8_charlen(char *);
int idris_utf8_findOffset(char *str, int i) {
  int offset = 0;
  while (i > 0) {
    int len = idris_utf8_charlen(str);
    str += len;
    offset += len;
    i--;
  }
  return offset;
}


x86 assembly (clang, -O0):
<idris_utf8_findOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1164 <idris_utf8_findOffset+0x54>
mov    -0x8(%rbp),%rdi
call   1030 <idris_utf8_charlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <idris_utf8_findOffset+0x16>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idris_utf8_findOffset>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <idris_utf8_findOffset+0x3a>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <idris_utf8_charlen@plt>
cltq
add    %rax,%rbx
add    %eax,%r14d
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <idris_utf8_findOffset+0x20>
jmp    114d <idris_utf8_findOffset+0x3d>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @idris_utf8_findOffset(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i32 [ %11, %4 ], [ 0, %2 ]
%7 = phi i32 [ %12, %4 ], [ %1, %2 ]
%8 = tail call i32 @idris_utf8_charlen(i8* %5)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
%11 = add nsw i32 %8, %6
%12 = add nsw i32 %7, -1
%13 = icmp ugt i32 %7, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %2
%15 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int is_new_car(void) {
  time_t t;
  int n;
  srand((unsigned)time(&t));
  n = rand() % 10;
  if (n <= 7) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_new_car>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jg     1170 <is_new_car+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1177 <is_new_car+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_new_car>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x8,%ecx
setl   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_new_car() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i64 @time(i32* %2)
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 10
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 7
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 1, i32* %1
br label %13
12: ; preds = %0
store i32 0, i32* %1
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_new_car() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @time(i32* %1)
%4 = trunc i64 %3 to i32
%5 = call i32 @srand(i32 %4)
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 10
%8 = icmp slt i32 %7, 8
%9 = zext i1 %8 to i32
ret i32 %9
}
int nextlkhd(int i) { return i + 1; }


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

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

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

LLVM IR (-O2):
define i32 @nextlkhd(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int netlink_socket_send(struct netlink *netlink) { int ret; }


x86 assembly (clang, -O0):
<netlink_socket_send>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.netlink = type opaque
define i32 @netlink_socket_send(%struct.netlink* %0) {
%2 = alloca i32
%3 = alloca %struct.netlink*
%4 = alloca i32
store %struct.netlink* %0, %struct.netlink** %3
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
%struct.netlink = type opaque
define i32 @netlink_socket_send(%struct.netlink* nocapture readnone %0) {
ret i32 undef
}
int addValueToTable(int cols, double table[][cols], int row, int col,
                    double value) {
  if (value < table[row][col])
    table[row][col] = value;
  return 0;
}


x86 assembly (clang, -O0):
<addValueToTable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edx
mov    %rdx,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    116f <addValueToTable+0x6f>
mov    -0x28(%rbp),%rdx
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addValueToTable>:
mov    %edi,%eax
movslq %edx,%rdx
imul   %rax,%rdx
lea    (%rsi,%rdx,8),%rax
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
ucomisd %xmm0,%xmm1
jbe    1120 <addValueToTable+0x20>
movsd  %xmm0,(%rax,%rcx,8)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @addValueToTable(i32 %0, double* %1, i32 %2, i32 %3, double %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
store i32 %0, i32* %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load i32, i32* %6
%12 = zext i32 %11 to i64
%13 = load double, double* %10
%14 = load double*, double** %7
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = mul nsw i64 %16, %12
%18 = getelementptr inbounds double, double* %14, i64 %17
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
%22 = load double, double* %21
%23 = fcmp olt double %13, %22
br i1 %23, label %24, label %34
24: ; preds = %5
%25 = load double, double* %10
%26 = load double*, double** %7
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = mul nsw i64 %28, %12
%30 = getelementptr inbounds double, double* %26, i64 %29
%31 = load i32, i32* %9
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %30, i64 %32
store double %25, double* %33
br label %34
34: ; preds = %24, %5
ret i32 0
}

LLVM IR (-O2):
define i32 @addValueToTable(i32 %0, double* nocapture %1, i32 %2, i32 %3, double %4) {
%6 = zext i32 %0 to i64
%7 = sext i32 %2 to i64
%8 = mul nsw i64 %7, %6
%9 = getelementptr inbounds double, double* %1, i64 %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds double, double* %9, i64 %10
%12 = load double, double* %11
%13 = fcmp ogt double %12, %4
br i1 %13, label %14, label %15
14: ; preds = %5
store double %4, double* %11
br label %15
15: ; preds = %14, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ memset(char *, char, int);
int strlen(char *);
void memset1_char_array_null() {
  char str[] = "abcd";
  clang_analyzer_eval(strlen(str) == 4);
  memset(str, '\0', 2);
  clang_analyzer_eval(strlen(str) == 0);
}


x86 assembly (clang, -O0):
<memset1_char_array_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <memset@plt>
lea    -0x5(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset1_char_array_null>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x64636261,0x8(%rsp)
64
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1050 <clang_analyzer_eval@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.memset1_char_array_null.str = [5 x i8] c"abcd\00"
define void @memset1_char_array_null() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @strlen(i8* %3)
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
%7 = call i32 @clang_analyzer_eval(i32 %6)
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%9 = call i32 @memset(i8* %8, i8 signext 0, i32 2)
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
ret void
}

LLVM IR (-O2):
@__const.memset1_char_array_null.str = [5 x i8] c"abcd\00"
define void @memset1_char_array_null() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = icmp eq i32 %3, 4
%5 = zext i1 %4 to i32
%6 = call i32 @clang_analyzer_eval(i32 %5)
%7 = call i32 @memset(i8* %2, i8 signext 0, i32 2)
%8 = call i32 @strlen(i8* %2)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @clang_analyzer_eval(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_immutable(char const *);
int /*<<< orphan*/ unlink(char const *);
void delete_file(const char *path) {
  if (!is_immutable(path))
    unlink(path);
}


x86 assembly (clang, -O0):
<delete_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <is_immutable@plt>
cmp    $0x0,%eax
jne    1147 <delete_file+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <is_immutable@plt>
test   %eax,%eax
je     112f <delete_file+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @delete_file(i8* %0) {
%2 = tail call i32 @is_immutable(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unlink(i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ receiveByte(int);
int /*<<< orphan*/ sendByte(int, unsigned int);
void tube_BPut(unsigned int *reg) {
  sendByte(2, 0x10);
  sendByte(2, reg[1]);
  sendByte(2, reg[0]);
  receiveByte(2);
}


x86 assembly (clang, -O0):
<tube_BPut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x10,%esi
call   1040 <sendByte@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    $0x2,%edi
call   1040 <sendByte@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    $0x2,%edi
call   1040 <sendByte@plt>
mov    $0x2,%edi
call   1030 <receiveByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tube_BPut>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
mov    $0x10,%esi
call   1040 <sendByte@plt>
mov    0x4(%rbx),%esi
mov    $0x2,%edi
call   1040 <sendByte@plt>
mov    (%rbx),%esi
mov    $0x2,%edi
call   1040 <sendByte@plt>
mov    $0x2,%edi
pop    %rbx
jmp    1030 <receiveByte@plt>

LLVM IR (-O0):
define void @tube_BPut(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @sendByte(i32 2, i32 16)
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
%7 = call i32 @sendByte(i32 2, i32 %6)
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = call i32 @sendByte(i32 2, i32 %10)
%12 = call i32 @receiveByte(i32 2)
ret void
}

LLVM IR (-O2):
define void @tube_BPut(i32* nocapture %0) {
%2 = tail call i32 @sendByte(i32 2, i32 16)
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @sendByte(i32 2, i32 %4)
%6 = load i32, i32* %0
%7 = tail call i32 @sendByte(i32 2, i32 %6)
%8 = tail call i32 @receiveByte(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRROUNDRECT_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 6, torev);
}


x86 assembly (clang, -O0):
<U_WMRROUNDRECT_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x6,%esi
call   1030 <U_WMRCORE_N16_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRROUNDRECT_swap>:
mov    %esi,%edx
mov    $0x6,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRROUNDRECT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 6, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int LOG_ERR;
int LOG_USER;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ syslog(int, char *);
int main(int argc, char *argv[]) {
  FILE *f;
  f = fopen("not_here", "r");
  if (!f)
    syslog(LOG_ERR | LOG_USER, "oops - %m\n");
  exit(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)
lea    0xeb3(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1186 <main+0x56>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    0x2e70(%rip),%rax
or     (%rax),%edi
lea    0xe8a(%rip),%rsi
call   1030 <syslog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
jne    1167 <main+0x37>
mov    0x2e80(%rip),%rax
mov    0x2e91(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
lea    0xea9(%rip),%rsi
call   1030 <syslog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"not_here\00"
@.str.1 = [2 x i8] c"r\00"
@LOG_ERR = global i32 0
@LOG_USER = global i32 0
@.str.2 = [11 x i8] c"oops - %m\0A\00"
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 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = icmp ne i32* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* @LOG_ERR
%12 = load i32, i32* @LOG_USER
%13 = or i32 %11, %12
%14 = call i32 @syslog(i32 %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %10, %2
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"not_here\00"
@.str.1 = [2 x i8] c"r\00"
@LOG_ERR = global i32 0
@LOG_USER = global i32 0
@.str.2 = [11 x i8] c"oops - %m\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @LOG_ERR
%7 = load i32, i32* @LOG_USER
%8 = or i32 %7, %6
%9 = tail call i32 @syslog(i32 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %5, %2
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
int btor_file_exists(const char *path) {
  struct stat buf;
  return !stat(path, &buf);
}


x86 assembly (clang, -O0):
<btor_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btor_file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @btor_file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @btor_file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int de_feat_is_support_smbl(unsigned int);
int disp_feat_is_support_smbl(unsigned int disp) {
  return de_feat_is_support_smbl(disp);
}


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

x86 assembly (clang, -O2):
<disp_feat_is_support_smbl>:
jmp    1030 <de_feat_is_support_smbl@plt>

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

LLVM IR (-O2):
define i32 @disp_feat_is_support_smbl(i32 %0) {
%2 = tail call i32 @de_feat_is_support_smbl(i32 %0)
ret i32 %2
}
/* Variables and functions */
long double erf(double);
__attribute__((weak)) long double erfl(long double x) { return erf((double)x); }


x86 assembly (clang, -O0):
<erfl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <erf@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erfl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <erf@plt>

LLVM IR (-O0):
define weak x86_fp80 @erfl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @erf(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @erfl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @erf(double %2)
ret x86_fp80 %3
}
unsigned short get_unsigned_short_min() {
  unsigned short min = 0;
  return (min);
}


x86 assembly (clang, -O0):
<get_unsigned_short_min>:
push   %rbp
mov    %rsp,%rbp
movw   $0x0,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @get_unsigned_short_min() {
%1 = alloca i16
store i16 0, i16* %1
%2 = load i16, i16* %1
ret i16 %2
}

LLVM IR (-O2):
define zeroext i16 @get_unsigned_short_min() {
ret i16 0
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("EOF - %d\n", EOF);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"EOF - %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct osc_state {
  int dummy;
};

/* Variables and functions */
double tick_osc_raw(struct osc_state *, double);
double tick_osc(struct osc_state *osc_state, double freq) {
  return tick_osc_raw(osc_state, freq);
}


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

x86 assembly (clang, -O2):
<tick_osc>:
jmp    1030 <tick_osc_raw@plt>

LLVM IR (-O0):
%struct.osc_state = type { i32 }
define double @tick_osc(%struct.osc_state* %0, double %1) {
%3 = alloca %struct.osc_state*
%4 = alloca double
store %struct.osc_state* %0, %struct.osc_state** %3
store double %1, double* %4
%5 = load %struct.osc_state*, %struct.osc_state** %3
%6 = load double, double* %4
%7 = call double @tick_osc_raw(%struct.osc_state* %5, double %6)
ret double %7
}

LLVM IR (-O2):
%struct.osc_state = type { i32 }
define double @tick_osc(%struct.osc_state* %0, double %1) {
%3 = tail call double @tick_osc_raw(%struct.osc_state* %0, double %1)
ret double %3
}
int isLessOrEqual(int x, int y) {
  int sub = y + (~x + 1);
  int signx = (x >> 31) & 1;
  int signy = (y >> 31) & 1;
  int subsign = !(sub >> 31);
  return ((signx ^ signy) & signx) | ((signx ^ signy ^ 1) & subsign);
}


x86 assembly (clang, -O0):
<isLessOrEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1f,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x14(%rbp),%eax
and    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    -0x14(%rbp),%ecx
xor    $0x1,%ecx
and    -0x18(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLessOrEqual>:
mov    %esi,%eax
shr    $0x1f,%eax
not    %esi
lea    (%rsi,%rdi,1),%ecx
shr    $0x1f,%edi
shr    $0x1f,%ecx
xor    %edi,%eax
xor    %ecx,%edi
and    %edi,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isLessOrEqual(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = xor i32 %10, -1
%12 = add nsw i32 %11, 1
%13 = add nsw i32 %9, %12
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = ashr i32 %14, 31
%16 = and i32 %15, 1
store i32 %16, i32* %6
%17 = load i32, i32* %4
%18 = ashr i32 %17, 31
%19 = and i32 %18, 1
store i32 %19, i32* %7
%20 = load i32, i32* %5
%21 = ashr i32 %20, 31
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
store i32 %24, i32* %8
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = xor i32 %25, %26
%28 = load i32, i32* %6
%29 = and i32 %27, %28
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = xor i32 %30, %31
%33 = xor i32 %32, 1
%34 = load i32, i32* %8
%35 = and i32 %33, %34
%36 = or i32 %29, %35
ret i32 %36
}

LLVM IR (-O2):
define i32 @isLessOrEqual(i32 %0, i32 %1) {
%3 = lshr i32 %0, 31
%4 = lshr i32 %1, 31
%5 = xor i32 %1, -1
%6 = add i32 %5, %0
%7 = lshr i32 %6, 31
%8 = xor i32 %4, %3
%9 = and i32 %8, %3
%10 = xor i32 %8, -1
%11 = and i32 %7, %10
%12 = or i32 %9, %11
ret i32 %12
}