xunge/DecIR huggingface dataset:
int some_helper() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @some_helper() {
ret i32 1
}
int __attribute__((no, noclone)) sort(int L) {
  int end[2] =
      {
          10,
          10,
      },
      i = 0, R;
  while (i < 2) {
    R = end[i];
    if (L < R) {
      end[i + 1] = 1;
      end[i] = 10;
      ++i;
    } else
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    116e <sort+0x6e>
movslq -0x10(%rbp),%rax
mov    -0xc(%rbp,%rax,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1164 <sort+0x64>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
movl   $0x1,-0xc(%rbp,%rax,4)
movslq -0x10(%rbp),%rax
movl   $0xa,-0xc(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <sort+0x69>
jmp    116e <sort+0x6e>
jmp    1119 <sort+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
xor    %ecx,%ecx
test   %edi,%edi
setle  %cl
add    $0x1,%ecx
xor    %eax,%eax
cmp    $0xa,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sort(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 2, i32 1
%5 = select i1 %2, i32 %4, i32 0
ret i32 %5
}
double adc_to_percent(double x) {
  x -= (65535 / 4);
  x /= (65535 - (65535 / 4));
  return x > 1.0 ? 1.0 : (x < 0.0 ? 0.0 : x);
}


x86 assembly (clang, -O0):
<adc_to_percent>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115e <adc_to_percent+0x5e>
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    118d <adc_to_percent+0x8d>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1179 <adc_to_percent+0x79>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1183 <adc_to_percent+0x83>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<adc_to_percent>:
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
xorpd  %xmm2,%xmm2
maxsd  %xmm0,%xmm2
movsd  0xef0(%rip),%xmm3
movapd %xmm3,%xmm1
cmpltsd %xmm0,%xmm1
movapd %xmm1,%xmm0
andnpd %xmm2,%xmm0
andpd  %xmm3,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @adc_to_percent(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.638300e+04
store double %4, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 4.915200e+04
store double %6, double* %2
%7 = load double, double* %2
%8 = fcmp ogt double %7, 1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %1
br label %18
10: ; preds = %1
%11 = load double, double* %2
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %10
br label %16
14: ; preds = %10
%15 = load double, double* %2
br label %16
16: ; preds = %14, %13
%17 = phi double [ 0.000000e+00, %13 ], [ %15, %14 ]
br label %18
18: ; preds = %16, %9
%19 = phi double [ 1.000000e+00, %9 ], [ %17, %16 ]
ret double %19
}

LLVM IR (-O2):
define double @adc_to_percent(double %0) {
%2 = fadd double %0, -1.638300e+04
%3 = fdiv double %2, 4.915200e+04
%4 = fcmp ogt double %3, 1.000000e+00
%5 = fcmp olt double %3, 0.000000e+00
%6 = select i1 %5, double 0.000000e+00, double %3
%7 = select i1 %4, double 1.000000e+00, double %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ mag_free(void *);
void mag_freep(void **arg) {
  mag_free(*arg);
  *arg = NULL;
}


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

x86 assembly (clang, -O2):
<mag_freep>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <mag_free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @mag_freep(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @mag_free(i8* %4)
%6 = load i8**, i8*** %2
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @mag_freep(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @mag_free(i8* %2)
store i8* null, i8** %0
ret void
}
int main(int argc, char **argv) {
  union {
    int a[4];
    int b[2];
  } u;
  u.a[0] = 1;
  u.a[1] = 42;
  u.a[2] = 3;
  u.a[3] = 4;
  __builtin_printf("%d\n", u.a[argc]);
  return u.b[1];
}


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   $0x1,-0x20(%rbp)
movl   $0x2a,-0x1c(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x4,-0x14(%rbp)
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movslq %edi,%rax
mov    (%rsp,%rax,4),%esi
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x2a,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%union.anon = type { [4 x i32] }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %union.anon
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast %union.anon* %6 to [4 x i32]*
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
store i32 1, i32* %8
%9 = bitcast %union.anon* %6 to [4 x i32]*
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
store i32 42, i32* %10
%11 = bitcast %union.anon* %6 to [4 x i32]*
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 2
store i32 3, i32* %12
%13 = bitcast %union.anon* %6 to [4 x i32]*
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 3
store i32 4, i32* %14
%15 = bitcast %union.anon* %6 to [4 x i32]*
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = bitcast %union.anon* %6 to [2 x i32]*
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %21, i64 0, i64 1
%23 = load i32, i32* %22
ret i32 %23
}

LLVM IR (-O2):
%union.anon = type { [4 x i32] }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca <4 x i32>
%4 = bitcast <4 x i32>* %3 to %union.anon*
%5 = bitcast <4 x i32>* %3 to i8*
store <4 x i32> <i32 1, i32 42, i32 3, i32 4>, <4 x i32>* %3
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds %union.anon, %union.anon* %4, i64 0, i32 0, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ camc(int const, int const, int /*<<< orphan*/, int);
void cam_lam_clear(const int c, const int n) { camc(c, n, 0, 10); }


x86 assembly (clang, -O0):
<cam_lam_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
mov    $0xa,%ecx
call   1030 <camc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cam_lam_clear>:
xor    %edx,%edx
mov    $0xa,%ecx
jmp    1030 <camc@plt>

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

LLVM IR (-O2):
define void @cam_lam_clear(i32 %0, i32 %1) {
%3 = tail call i32 @camc(i32 %0, i32 %1, i32 0, i32 10)
ret void
}
int my_abs(int i) {
  if (i < 0) {
    i = -i;
  }
  return i;
}


x86 assembly (clang, -O0):
<my_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1119 <my_abs+0x19>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @my_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
float vcuboid(float a, float b, float c) { return (a * b * c); }


x86 assembly (clang, -O0):
<vcuboid>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcuboid>:
mulss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @vcuboid(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* %4
%8 = load float, float* %5
%9 = fmul float %7, %8
%10 = load float, float* %6
%11 = fmul float %9, %10
ret float %11
}

LLVM IR (-O2):
define float @vcuboid(float %0, float %1, float %2) {
%4 = fmul float %0, %1
%5 = fmul float %4, %2
ret float %5
}
/* Variables and functions */
int AngleDir8(float);
int RadianAngleDir8(float angle) { return AngleDir8(angle * 57.2958); }


x86 assembly (clang, -O0):
<RadianAngleDir8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <AngleDir8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RadianAngleDir8>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1030 <AngleDir8@plt>

LLVM IR (-O0):
define i32 @RadianAngleDir8(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 5.729580e+01
%6 = fptrunc double %5 to float
%7 = call i32 @AngleDir8(float %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @RadianAngleDir8(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 5.729580e+01
%4 = fptrunc double %3 to float
%5 = tail call i32 @AngleDir8(float %4)
ret i32 %5
}
int nolibc_strlen(const char *str) {
  int i;
  for (i = 0; str[i] != '\0'; i++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<nolibc_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <nolibc_strlen+0x37>
jmp    1129 <nolibc_strlen+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <nolibc_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nolibc_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <nolibc_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @nolibc_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ DoDiff(char const *, char const *);
int main(void) {
  const char *filename1 = "google.txt";
  const char *filename2 = "microsoft.txt";
  DoDiff(filename1, filename2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <DoDiff@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeec(%rip),%rsi
call   1030 <DoDiff@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"google.txt\00"
@.str.1 = [14 x i8] c"microsoft.txt\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @DoDiff(i8* %3, i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"google.txt\00"
@.str.1 = [14 x i8] c"microsoft.txt\00"
define i32 @main() {
%1 = tail call i32 @DoDiff(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
__attribute__((__always___)) int _xtest(void) {
  unsigned char out;
  asm volatile(".byte 0x0f,0x01,0xd6 ; setnz %0" : "=r"(out)::"memory");
  return out;
}


x86 assembly (clang, -O0):
<_xtest>:
push   %rbp
mov    %rsp,%rbp
xtest
setne  %al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xtest>:
xtest
setne  %al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @_xtest() {
%1 = alloca i8
%2 = call i8 asm sideeffect ".byte 0x0f,0x01,0xd6 ; setnz $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @_xtest() {
%1 = tail call i8 asm sideeffect ".byte 0x0f,0x01,0xd6 ; setnz $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
%2 = zext i8 %1 to i32
ret i32 %2
}
double fabs(d)
double d;
{
  if (d < 0.0)
    return -d;
  return d;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <fabs+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <fabs+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getStr();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *myString = getStr();
  printf("Your input String:\n%s\n", myString);
  free(myString);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getStr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getStr@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Your input String:\0A%s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i8* (...) @getStr()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Your input String:\0A%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @getStr()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void add_m32_imm32(unsigned int *m32, unsigned int imm32) {
  put8(0x81);
  put8(0x05);
  put32((unsigned int)(m32));
  put32(imm32);
}


x86 assembly (clang, -O0):
<add_m32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x81,%edi
call   1030 <put8@plt>
mov    $0x5,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
mov    -0xc(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_m32_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x81,%edi
call   1030 <put8@plt>
mov    $0x5,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
call   1040 <put32@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @add_m32_imm32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 129)
%6 = call i32 @put8(i32 5)
%7 = load i32*, i32** %3
%8 = ptrtoint i32* %7 to i32
%9 = call i32 @put32(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @put32(i32 %10)
ret void
}

LLVM IR (-O2):
define void @add_m32_imm32(i32* %0, i32 %1) {
%3 = tail call i32 @put8(i32 129)
%4 = tail call i32 @put8(i32 5)
%5 = ptrtoint i32* %0 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @put32(i32 %6)
%8 = tail call i32 @put32(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checkNotNull(void *, char *);
void *malloc(size_t);
void *malloc_s(size_t size) {
  void *r = malloc(size);
  checkNotNull(r, "malloc() failed");
  return r;
}


x86 assembly (clang, -O0):
<malloc_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <checkNotNull@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_s>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xed0(%rip),%rsi
mov    %rax,%rdi
call   1030 <checkNotNull@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"malloc() failed\00"
define i8* @malloc_s(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @checkNotNull(i8* %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [16 x i8] c"malloc() failed\00"
define i8* @malloc_s(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @checkNotNull(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
double exp(double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double Exponencial(double x) {
  printf("Enter a number: ");
  scanf("%lf", &x);
  return (exp(x));
}


x86 assembly (clang, -O0):
<Exponencial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exponencial>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <exp@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Exponencial(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @exp(double %5)
ret double %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Exponencial(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @exp(double %5)
ret double %6
}
float neg_f(float f) { return -f; }


x86 assembly (clang, -O0):
<neg_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_f>:
xorps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @neg_f(float %0) {
%2 = fneg float %0
ret float %2
}
/* Variables and functions */
scalar_t__ klock_getT2();
int getTIssue(int x) {
  int *a, *b;
  int c = 30;
  b = (int *)klock_getT2();
  a = b;
  while (c > 20) {
    b = (int *)klock_getT2();
    c = *a - *b;
    a = b;
  }
  return c;
}


x86 assembly (clang, -O0):
<getTIssue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1e,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <klock_getT2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jle    1166 <getTIssue+0x56>
mov    $0x0,%al
call   1030 <klock_getT2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1135 <getTIssue+0x25>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTIssue>:
push   %rbx
xor    %eax,%eax
call   1030 <klock_getT2@plt>
mov    %rax,%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <klock_getT2@plt>
mov    %rax,%rcx
mov    (%rbx),%eax
sub    (%rcx),%eax
mov    %rcx,%rbx
cmp    $0x14,%eax
jg     1120 <getTIssue+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getTIssue(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %2
store i32 30, i32* %5
%6 = call i64 (...) @klock_getT2()
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %4
%8 = load i32*, i32** %4
store i32* %8, i32** %3
br label %9
9: ; preds = %12, %1
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 20
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = call i64 (...) @klock_getT2()
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %4
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
%19 = sub nsw i32 %16, %18
store i32 %19, i32* %5
%20 = load i32*, i32** %4
store i32* %20, i32** %3
br label %9
21: ; preds = %9
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @getTIssue(i32 %0) {
%2 = tail call i64 (...) @klock_getT2()
%3 = inttoptr i64 %2 to i32*
br label %4
4: ; preds = %1, %4
%5 = phi i32* [ %3, %1 ], [ %7, %4 ]
%6 = tail call i64 (...) @klock_getT2()
%7 = inttoptr i64 %6 to i32*
%8 = load i32, i32* %5
%9 = load i32, i32* %7
%10 = sub nsw i32 %8, %9
%11 = icmp sgt i32 %10, 20
br i1 %11, label %4, label %12
12: ; preds = %4
ret i32 %10
}
void clock_init() {
  (*((volatile unsigned int *)(0x40048000 + 0x040))) = 0;
  (*((volatile unsigned int *)(0x40048000 + 0x008))) = (3 << 0) | (1 << 5);
  (*((volatile unsigned int *)(0x40048000 + 0x238))) &= ~(1 << 7);
  (*((volatile unsigned int *)(0x40048000 + 0x044))) = 1;
  (*((volatile unsigned int *)(0x40048000 + 0x070))) = 3;
  (*((volatile unsigned int *)(0x40048000 + 0x074))) = 1;
}


x86 assembly (clang, -O0):
<clock_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40048040,%eax
movl   $0x0,(%rax)
mov    $0x40048008,%eax
movl   $0x23,(%rax)
mov    $0x40048238,%eax
mov    (%rax),%ecx
and    $0xffffff7f,%ecx
mov    $0x40048238,%eax
mov    %ecx,(%rax)
mov    $0x40048044,%eax
movl   $0x1,(%rax)
mov    $0x40048070,%eax
movl   $0x3,(%rax)
mov    $0x40048074,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_init>:
movl   $0x0,0x40048040
movl   $0x23,0x40048008
andl   $0xffffff7f,0x40048238
7f ff ff ff
movl   $0x1,0x40048044
movl   $0x3,0x40048070
movl   $0x1,0x40048074
ret

LLVM IR (-O0):
define void @clock_init() {
store volatile i32 0, i32* inttoptr (i64 1074036800 to i32*)
store volatile i32 35, i32* inttoptr (i64 1074036744 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 1074037304 to i32*)
%2 = and i32 %1, -129
store volatile i32 %2, i32* inttoptr (i64 1074037304 to i32*)
store volatile i32 1, i32* inttoptr (i64 1074036804 to i32*)
store volatile i32 3, i32* inttoptr (i64 1074036848 to i32*)
store volatile i32 1, i32* inttoptr (i64 1074036852 to i32*)
ret void
}

LLVM IR (-O2):
define void @clock_init() {
store volatile i32 0, i32* inttoptr (i64 1074036800 to i32*)
store volatile i32 35, i32* inttoptr (i64 1074036744 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 1074037304 to i32*)
%2 = and i32 %1, -129
store volatile i32 %2, i32* inttoptr (i64 1074037304 to i32*)
store volatile i32 1, i32* inttoptr (i64 1074036804 to i32*)
store volatile i32 3, i32* inttoptr (i64 1074036848 to i32*)
store volatile i32 1, i32* inttoptr (i64 1074036852 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RLIMIT_CORE;
int /*<<< orphan*/ cdecl_func__RLIMIT_CORE(int /*<<< orphan*/);
void cdecl_expr__RLIMIT_CORE() { cdecl_func__RLIMIT_CORE(RLIMIT_CORE); }


x86 assembly (clang, -O0):
<cdecl_expr__RLIMIT_CORE>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <cdecl_func__RLIMIT_CORE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdecl_expr__RLIMIT_CORE>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <cdecl_func__RLIMIT_CORE@plt>

LLVM IR (-O0):
@RLIMIT_CORE = global i32 0
define void @cdecl_expr__RLIMIT_CORE() {
%1 = load i32, i32* @RLIMIT_CORE
%2 = call i32 @cdecl_func__RLIMIT_CORE(i32 %1)
ret void
}

LLVM IR (-O2):
@RLIMIT_CORE = global i32 0
define void @cdecl_expr__RLIMIT_CORE() {
%1 = load i32, i32* @RLIMIT_CORE
%2 = tail call i32 @cdecl_func__RLIMIT_CORE(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
void fun() {
  int i;
  for (i = 0; i < 1000; i++) {
    __VERIFIER_assert(i < 2000);
  }
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jge    114e <fun+0x3e>
cmpl   $0x7d0,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <fun+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0xffffffff,%ebx
jne    1120 <fun+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @fun() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1000
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 2000
%8 = zext i1 %7 to i32
%9 = call i32 @__VERIFIER_assert(i32 %8)
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @fun() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @__VERIFIER_assert(i32 1)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
double satan(double);
double atan(double arg) {
  if (arg > 0)
    return satan(arg);
  return -satan(-arg);
}


x86 assembly (clang, -O0):
<atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1143 <atan+0x33>
movsd  -0x10(%rbp),%xmm0
call   1030 <satan@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <atan+0x70>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <satan@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    111f <atan+0xf>
jmp    1030 <satan@plt>
push   %rax
xorpd  0xed8(%rip),%xmm0
call   1030 <satan@plt>
xorpd  0xecb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @atan(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @satan(double %7)
store double %8, double* %2
br label %14
9: ; preds = %1
%10 = load double, double* %3
%11 = fneg double %10
%12 = call double @satan(double %11)
%13 = fneg double %12
store double %13, double* %2
br label %14
14: ; preds = %9, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @atan(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @satan(double %0)
br label %9
5: ; preds = %1
%6 = fneg double %0
%7 = tail call double @satan(double %6)
%8 = fneg double %7
br label %9
9: ; preds = %5, %3
%10 = phi double [ %4, %3 ], [ %8, %5 ]
ret double %10
}
unsigned _is_leap_year(unsigned year) {
  return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
}


x86 assembly (clang, -O0):
<_is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1150 <_is_leap_year+0x50>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114a <_is_leap_year+0x4a>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <_is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <_is_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @_is_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = urem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = urem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = urem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @_is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = urem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = urem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() { printf("f(%d)=%d\n", 10, f(10)); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"f(%d)=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @f(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 10, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void destroy_array(int **array_reference, int size) {
  int i;
  int *temp = *array_reference;
  for (i = 0; i < size; i++)
    temp[i] = 0;
  free(temp);
  *array_reference = NULL;
}


x86 assembly (clang, -O0):
<destroy_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <destroy_array+0x4a>
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1131 <destroy_array+0x21>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_array>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%r14
test   %esi,%esi
jle    113e <destroy_array+0x1e>
mov    %esi,%edx
shl    $0x2,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %r14,%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @destroy_array(i32** nocapture %0, i32 %1) {
%3 = load i32*, i32** %0
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = bitcast i32* %3 to i8*
%7 = zext i32 %1 to i64
%8 = shl nuw nsw i64 %7, 2
br label %9
9: ; preds = %5, %2
%10 = tail call i32 @free(i32* %3)
store i32* null, i32** %0
ret void
}
w() {}


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

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

LLVM IR (-O0):
define i32 @w() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @w() {
ret i32 undef
}
void glBlendColor(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glBlendColor() {
ret void
}
/* Variables and functions */
char *calloc(int, int);
int zz_inttostring(int i) {
  char *q = calloc(2, sizeof(char));
  int ret;
  q[0] = (char)i;
  q[1] = '\0';
  return (int)q;
}


x86 assembly (clang, -O0):
<zz_inttostring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zz_inttostring>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %bl,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @zz_inttostring(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i8* @calloc(i32 2, i32 1)
store i8* %5, i8** %3
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 0, i8* %11
%12 = load i8*, i8** %3
%13 = ptrtoint i8* %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @zz_inttostring(i32 %0) {
%2 = tail call dereferenceable_or_null(2) i8* @calloc(i32 2, i32 1)
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Type definitions */
struct in_addr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ inet_ntop(int /*<<< orphan*/, struct in_addr *, char *,
                             int /*<<< orphan*/);
char *_inet_ntoa_r(struct in_addr *addr, char *buf, socklen_t size) {
  inet_ntop(PF_INET, addr, buf, size);
  return buf;
}


x86 assembly (clang, -O0):
<_inet_ntoa_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <inet_ntop@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_inet_ntoa_r>:
push   %rbx
mov    %edx,%ecx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rdx
call   1030 <inet_ntop@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@PF_INET = global i32 0
define i8* @_inet_ntoa_r(%struct.in_addr* %0, i8* %1, i32 %2) {
%4 = alloca %struct.in_addr*
%5 = alloca i8*
%6 = alloca i32
store %struct.in_addr* %0, %struct.in_addr** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @PF_INET
%8 = load %struct.in_addr*, %struct.in_addr** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @inet_ntop(i32 %7, %struct.in_addr* %8, i8* %9, i32 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@PF_INET = global i32 0
define i8* @_inet_ntoa_r(%struct.in_addr* %0, i8* returned %1, i32 %2) {
%4 = load i32, i32* @PF_INET
%5 = tail call i32 @inet_ntop(i32 %4, %struct.in_addr* %0, i8* %1, i32 %2)
ret i8* %1
}
char *mktemp(path)
char *path;
{ return (_mktemp(path)); }


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

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

LLVM IR (-O0):
define i8* @mktemp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @_mktemp to i32 (i8*, ...)*)(i8* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @mktemp(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @_mktemp to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void ff_hevc_put_hevc_uni_qpel_v48_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_v48_8_sse4() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ MAG3110_ReadRawData(int, int, int);
int16_t MAG3110_ReadRawData_z() {
  return MAG3110_ReadRawData(0x05, 0x06, (0x01 << 2));
}


x86 assembly (clang, -O0):
<MAG3110_ReadRawData_z>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x6,%esi
mov    $0x4,%edx
call   1030 <MAG3110_ReadRawData@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAG3110_ReadRawData_z>:
mov    $0x5,%edi
mov    $0x6,%esi
mov    $0x4,%edx
jmp    1030 <MAG3110_ReadRawData@plt>

LLVM IR (-O0):
define i32 @MAG3110_ReadRawData_z() {
%1 = call i32 @MAG3110_ReadRawData(i32 5, i32 6, i32 4)
ret i32 %1
}

LLVM IR (-O2):
define i32 @MAG3110_ReadRawData_z() {
%1 = tail call i32 @MAG3110_ReadRawData(i32 5, i32 6, i32 4)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%u\n", sizeof(unsigned int));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x4,%esi
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    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_line_r(int /*<<< orphan*/, float, float);
void g2_line_r_(float *dev, float *dx, float *dy) {
  g2_line_r(dtoi(*dev), *dx, *dy);
}


x86 assembly (clang, -O0):
<g2_line_r_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <dtoi@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
call   1030 <g2_line_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_line_r_>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1040 <dtoi@plt>
movss  (%rbx),%xmm0
movss  (%r14),%xmm1
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <g2_line_r@plt>

LLVM IR (-O0):
define void @g2_line_r_(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** %4
%8 = load float, float* %7
%9 = call i32 @dtoi(float %8)
%10 = load float*, float** %5
%11 = load float, float* %10
%12 = load float*, float** %6
%13 = load float, float* %12
%14 = call i32 @g2_line_r(i32 %9, float %11, float %13)
ret void
}

LLVM IR (-O2):
define void @g2_line_r_(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %0
%5 = tail call i32 @dtoi(float %4)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = tail call i32 @g2_line_r(i32 %5, float %6, float %7)
ret void
}
/* Variables and functions */
int va_func(char *, char *, int, char);
int main(void) { return va_func("%s %d %c", "string", 100, 'x'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x64,%edx
mov    $0x78,%ecx
call   1030 <va_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x64,%edx
mov    $0x78,%ecx
jmp    1030 <va_func@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s %d %c\00"
@.str.1 = [7 x i8] c"string\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @va_func(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 100, i8 signext 120)
ret i32 %2
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s %d %c\00"
@.str.1 = [7 x i8] c"string\00"
define i32 @main() {
%1 = tail call i32 @va_func(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 100, i8 signext 120)
ret i32 %1
}