xunge/DecIR huggingface dataset:
unsigned eq(const float *a, const float *b, int n) {
  int i;
  for (i = 0; i < n; ++i)
    if (a[i] != b[i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    116b <eq+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
ucomiss (%rax,%rcx,4),%xmm0
jne    114c <eq+0x4c>
jp     114c <eq+0x4c>
jmp    1158 <eq+0x58>
movl   $0x0,-0x4(%rbp)
jmp    1172 <eq+0x72>
jmp    115d <eq+0x5d>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <eq+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
mov    $0x1,%eax
test   %edx,%edx
jle    1126 <eq+0x26>
mov    %edx,%ecx
xor    %edx,%edx
nopl   (%rax)
movss  (%rdi,%rdx,4),%xmm0
ucomiss (%rsi,%rdx,4),%xmm0
jne    1127 <eq+0x27>
jp     1127 <eq+0x27>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <eq+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @eq(float* nocapture %0, float* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds float, float* %0, i64 %10
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 %10
%14 = load float, float* %13
%15 = fcmp une float %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %17, label %7
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
main(int argc, char **argv) {
  if (argc != 2) {
    fputs("Usage: ERRLVL number\n"
          "Returns the specified number as errorlevel (exit code)\n",
          stderr);
    return 127;
  }
  return atoi(argv[1]);
}


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)
cmpl   $0x2,-0x8(%rbp)
je     1161 <main+0x41>
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xeb0(%rip),%rdi
call   1030 <fputs@plt>
movl   $0x7f,-0x4(%rbp)
jmp    1171 <main+0x51>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1130 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1040 <atoi@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x7f,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [77 x i8] c"Usage: ERRLVL number\0AReturns the specified number as errorlevel (exit code)\0A\00"
@stderr = global i32 0
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 127, i32* %3
br label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %11, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [77 x i8] c"Usage: ERRLVL number\0AReturns the specified number as errorlevel (exit code)\0A\00"
@stderr = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 127, %4 ], [ %10, %7 ]
ret i32 %12
}
int umatch(char *s, char *p) {
  extern int gmatch(char *, char *);
  if (*p == 0)
    return (1);
  while (*s)
    if (gmatch(s++, p))
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<umatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113c <umatch+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1187 <umatch+0x77>
jmp    1141 <umatch+0x31>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1180 <umatch+0x70>
mov    -0x10(%rbp),%rdi
mov    %rdi,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
call   1030 <gmatch@plt>
cmp    $0x0,%eax
je     117b <umatch+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    1187 <umatch+0x77>
jmp    1141 <umatch+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umatch>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%r14d
cmpb   $0x0,(%rsi)
je     114d <umatch+0x3d>
mov    %rsi,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi)
je     114a <umatch+0x3a>
lea    0x1(%rdi),%rbp
mov    %rbx,%rsi
call   1030 <gmatch@plt>
mov    %rbp,%rdi
test   %eax,%eax
je     1130 <umatch+0x20>
jmp    114d <umatch+0x3d>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @umatch(i8* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = tail call i32 @gmatch(i8* %6, i8* %1)
%12 = icmp eq i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %9, %2
%14 = phi i32 [ 1, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %14
}
unsigned int djb_hash(const char *name) {
  unsigned int val = 5381;
  int i = 0;
  for (i = 0; name[i]; i++) {
    val = (33 * val) + name[i];
  }
  return val;
}


x86 assembly (clang, -O0):
<djb_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1152 <djb_hash+0x52>
imul   $0x21,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <djb_hash+0x1d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <djb_hash+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <djb_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @djb_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%8 = mul i32 %7, 33
%9 = sext i8 %6 to i32
%10 = add i32 %8, %9
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
extern int is_file(const char *path) {
  struct stat sr;
  if (!stat(path, &sr)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%eax
jne    113e <is_file+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <is_file+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file>:
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 @is_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_file(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
}
/* Type definitions */
struct timespec {
  double tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
double fmod(double, double);
int /*<<< orphan*/ lround(double);
void doubleToTimespec(double s, struct timespec *ts) {
  ts->tv_sec = lround(s);
  ts->tv_nsec = fmod(s, 1.0) * 1.0e9;
}


x86 assembly (clang, -O0):
<doubleToTimespec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <lround@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
call   1040 <fmod@plt>
movsd  0xea2(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleToTimespec>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
call   1030 <lround@plt>
mov    %eax,0x8(%rbx)
movsd  0xec2(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1040 <fmod@plt>
mulsd  0xeb7(%rip),%xmm0
movsd  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
define void @doubleToTimespec(double %0, %struct.timespec* %1) {
%3 = alloca double
%4 = alloca %struct.timespec*
store double %0, double* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load double, double* %3
%6 = call i32 @lround(double %5)
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
store i32 %6, i32* %8
%9 = load double, double* %3
%10 = call double @fmod(double %9, double 1.000000e+00)
%11 = fmul double %10, 1.000000e+09
%12 = load %struct.timespec*, %struct.timespec** %4
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 0
store double %11, double* %13
ret void
}

LLVM IR (-O2):
%struct.timespec = type { double, i32 }
define void @doubleToTimespec(double %0, %struct.timespec* nocapture writeonly %1) {
%3 = tail call i32 @lround(double %0)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i32 %3, i32* %4
%5 = tail call double @fmod(double %0, double 1.000000e+00)
%6 = fmul double %5, 1.000000e+09
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store double %6, double* %7
ret void
}
float AngleSubtract(float a1, float a2) {
  float a = a1 - a2;
  while (a > 180) {
    a -= 360;
  }
  while (a < -180) {
    a += 360;
  }
  return a;
}


x86 assembly (clang, -O0):
<AngleSubtract>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    114e <AngleSubtract+0x4e>
movss  -0xc(%rbp),%xmm0
movss  0xec8(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    111d <AngleSubtract+0x1d>
jmp    1153 <AngleSubtract+0x53>
movss  0xea9(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    117c <AngleSubtract+0x7c>
movss  0xe9b(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1153 <AngleSubtract+0x53>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AngleSubtract>:
subss  %xmm1,%xmm0
ucomiss 0xef5(%rip),%xmm0
jbe    1129 <AngleSubtract+0x29>
movss  0xeef(%rip),%xmm1
movss  0xee3(%rip),%xmm2
nopl   (%rax)
addss  %xmm1,%xmm0
ucomiss %xmm2,%xmm0
ja     1120 <AngleSubtract+0x20>
movss  0xed7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1149 <AngleSubtract+0x49>
movss  0xece(%rip),%xmm2
xchg   %ax,%ax
addss  %xmm2,%xmm0
ucomiss %xmm0,%xmm1
ja     1140 <AngleSubtract+0x40>
ret

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

LLVM IR (-O2):
define float @AngleSubtract(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fcmp ogt float %3, 1.800000e+02
br i1 %4, label %8, label %5
5: ; preds = %8, %2
%6 = phi float [ %3, %2 ], [ %10, %8 ]
%7 = fcmp olt float %6, -1.800000e+02
br i1 %7, label %12, label %16
8: ; preds = %2, %8
%9 = phi float [ %10, %8 ], [ %3, %2 ]
%10 = fadd float %9, -3.600000e+02
%11 = fcmp ogt float %10, 1.800000e+02
br i1 %11, label %8, label %5
12: ; preds = %5, %12
%13 = phi float [ %14, %12 ], [ %6, %5 ]
%14 = fadd float %13, 3.600000e+02
%15 = fcmp olt float %14, -1.800000e+02
br i1 %15, label %12, label %16
16: ; preds = %12, %5
%17 = phi float [ %6, %5 ], [ %14, %12 ]
ret float %17
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ft_memdel(void **ap) {
  if (ap) {
    free(*ap);
    *ap = NULL;
  }
}


x86 assembly (clang, -O0):
<ft_memdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <ft_memdel+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memdel>:
test   %rdi,%rdi
je     1129 <ft_memdel+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_memdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %6
6: ; preds = %3, %1
ret void
}
void bar(int x) {
bad1:
#pragma omp target
#pragma omp teams
  goto bad1;
  goto bad2;
#pragma omp target
#pragma omp teams
  {
  bad2:;
  }
#pragma omp target
#pragma omp teams
  {
    int i;
    goto ok1;
    for (i = 0; i < 10; ++i) {
    ok1:
      break;
    }
  }
  switch (x) {
#pragma omp target
#pragma omp teams
    { case 0:; }
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <bar+0x7>

x86 assembly (clang, -O2):
<bar>:
jmp    1100 <bar>

LLVM IR (-O0):
define void @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %4, %1
br label %4
5: ; No predecessors!
br label %11
6: ; No predecessors!
store i32 0, i32* %3
br label %7
7: ; preds = %12, %6
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %15
10: ; preds = %7
br label %11
11: ; preds = %10, %5
br label %15
12: ; No predecessors!
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %7
15: ; preds = %11, %7
%16 = load i32, i32* %2
switch i32 %16, label %18 [
i32 0, label %17
]
17: ; preds = %15
br label %18
18: ; preds = %17, %15
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ __startrek_entry_pt_OSEK_Task_ts2();
void cil_keeperOSEK_Task_ts2(void) {
  {
    __startrek_entry_pt_OSEK_Task_ts2();
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @cil_keeperOSEK_Task_ts2() {
%1 = tail call i32 (...) @__startrek_entry_pt_OSEK_Task_ts2()
ret void
}
int Not(int x, int y, int z) { return ~x; }


x86 assembly (clang, -O0):
<Not>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Not>:
mov    %edi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @Not(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %0, -1
ret i32 %4
}
void blogic_inc_count(unsigned short *count) {
  if (*count < 65535) {
    (*count)++;
  }
}


x86 assembly (clang, -O0):
<blogic_inc_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
cmp    $0xffff,%eax
jge    1128 <blogic_inc_count+0x28>
mov    -0x8(%rbp),%rax
mov    (%rax),%cx
add    $0x1,%cx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<blogic_inc_count>:
movzwl (%rdi),%eax
cmp    $0xffff,%ax
je     110f <blogic_inc_count+0xf>
add    $0x1,%eax
mov    %ax,(%rdi)
ret

LLVM IR (-O0):
define void @blogic_inc_count(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = icmp slt i32 %5, 65535
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i16*, i16** %2
%9 = load i16, i16* %8
%10 = add i16 %9, 1
store i16 %10, i16* %8
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @blogic_inc_count(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp eq i16 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add nuw i16 %2, 1
store i16 %5, i16* %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uc_sleep(int);
void adp_await_next_cycle() { uc_sleep(10); }


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

x86 assembly (clang, -O2):
<adp_await_next_cycle>:
mov    $0xa,%edi
jmp    1030 <uc_sleep@plt>

LLVM IR (-O0):
define void @adp_await_next_cycle() {
%1 = call i32 @uc_sleep(i32 10)
ret void
}

LLVM IR (-O2):
define void @adp_await_next_cycle() {
%1 = tail call i32 @uc_sleep(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
iconv_t iconv_open(const char *tocode, const char *fromcode) { return 0; }


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

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

LLVM IR (-O0):
define i32 @iconv_open(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @iconv_open(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int ap_cmd_get_int(int, int, int *);
int ap_get_position(int session, int *val) {
  return (ap_cmd_get_int(session, 0xcc19, val));
}


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

x86 assembly (clang, -O2):
<ap_get_position>:
mov    %rsi,%rdx
mov    $0xcc19,%esi
jmp    1030 <ap_cmd_get_int@plt>

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

LLVM IR (-O2):
define i32 @ap_get_position(i32 %0, i32* %1) {
%3 = tail call i32 @ap_cmd_get_int(i32 %0, i32 52249, i32* %1)
ret i32 %3
}
void zerar(int m[4][4]) {
  int i, j;
  for (i = 0; i < 4; i++)
    for (j = 0; j < 4; j++)
      m[i][j] = 0;
}


x86 assembly (clang, -O0):
<zerar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1165 <zerar+0x65>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1152 <zerar+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <zerar+0x20>
jmp    1157 <zerar+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <zerar+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zerar>:
xorps  %xmm0,%xmm0
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @zerar([4 x i32]* nocapture writeonly %0) {
%2 = bitcast [4 x i32]* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ end(int);
int /*<<< orphan*/ subr(int);
int /*<<< orphan*/ subr2(int);
main() {
  subr(1);
  end(1);
  subr(2);
  end(2);
  subr(3);
  end(3);
  subr(4);
  end(4);
  subr(5);
  subr2(5);
  end(5);
  subr(6);
  subr2(6);
  end(6);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <subr@plt>
mov    $0x1,%edi
call   1040 <end@plt>
mov    $0x2,%edi
call   1030 <subr@plt>
mov    $0x2,%edi
call   1040 <end@plt>
mov    $0x3,%edi
call   1030 <subr@plt>
mov    $0x3,%edi
call   1040 <end@plt>
mov    $0x4,%edi
call   1030 <subr@plt>
mov    $0x4,%edi
call   1040 <end@plt>
mov    $0x5,%edi
call   1030 <subr@plt>
mov    $0x5,%edi
call   1050 <subr2@plt>
mov    $0x5,%edi
call   1040 <end@plt>
mov    $0x6,%edi
call   1030 <subr@plt>
mov    $0x6,%edi
call   1050 <subr2@plt>
mov    $0x6,%edi
call   1040 <end@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <subr@plt>
mov    $0x1,%edi
call   1040 <end@plt>
mov    $0x2,%edi
call   1030 <subr@plt>
mov    $0x2,%edi
call   1040 <end@plt>
mov    $0x3,%edi
call   1030 <subr@plt>
mov    $0x3,%edi
call   1040 <end@plt>
mov    $0x4,%edi
call   1030 <subr@plt>
mov    $0x4,%edi
call   1040 <end@plt>
mov    $0x5,%edi
call   1030 <subr@plt>
mov    $0x5,%edi
call   1050 <subr2@plt>
mov    $0x5,%edi
call   1040 <end@plt>
mov    $0x6,%edi
call   1030 <subr@plt>
mov    $0x6,%edi
call   1050 <subr2@plt>
mov    $0x6,%edi
call   1040 <end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @subr(i32 1)
%2 = call i32 @end(i32 1)
%3 = call i32 @subr(i32 2)
%4 = call i32 @end(i32 2)
%5 = call i32 @subr(i32 3)
%6 = call i32 @end(i32 3)
%7 = call i32 @subr(i32 4)
%8 = call i32 @end(i32 4)
%9 = call i32 @subr(i32 5)
%10 = call i32 @subr2(i32 5)
%11 = call i32 @end(i32 5)
%12 = call i32 @subr(i32 6)
%13 = call i32 @subr2(i32 6)
%14 = call i32 @end(i32 6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @subr(i32 1)
%2 = tail call i32 @end(i32 1)
%3 = tail call i32 @subr(i32 2)
%4 = tail call i32 @end(i32 2)
%5 = tail call i32 @subr(i32 3)
%6 = tail call i32 @end(i32 3)
%7 = tail call i32 @subr(i32 4)
%8 = tail call i32 @end(i32 4)
%9 = tail call i32 @subr(i32 5)
%10 = tail call i32 @subr2(i32 5)
%11 = tail call i32 @end(i32 5)
%12 = tail call i32 @subr(i32 6)
%13 = tail call i32 @subr2(i32 6)
%14 = tail call i32 @end(i32 6)
ret i32 0
}
int totofun(int arg1, char *arg2) {}


x86 assembly (clang, -O0):
<totofun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @totofun(i32 %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ arch_ftrace_nmi_enter();
void ftrace_nmi_enter(void) { arch_ftrace_nmi_enter(); }


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

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

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

LLVM IR (-O2):
define void @ftrace_nmi_enter() {
%1 = tail call i32 (...) @arch_ftrace_nmi_enter()
ret void
}
int condPicco(int centro, int intorno) {
  return (intorno * 2 < centro) ? 1 : 0;
}


x86 assembly (clang, -O0):
<condPicco>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
shl    $0x1,%edx
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condPicco>:
add    %esi,%esi
xor    %eax,%eax
cmp    %edi,%esi
setl   %al
ret

LLVM IR (-O0):
define i32 @condPicco(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 2
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @condPicco(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = icmp slt i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x18_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x18_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x18_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x18_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x18_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
void f3(double **matrix) {
  matrix[0][4] = (matrix[1][3] - matrix[0][3]) / (matrix[3][0] - matrix[0][0]);
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
subsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
subsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    (%rdi),%rax
mov    0x8(%rdi),%rcx
movsd  0x18(%rcx),%xmm0
subsd  0x18(%rax),%xmm0
mov    0x18(%rdi),%rcx
movsd  (%rcx),%xmm1
subsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rax)
ret

LLVM IR (-O0):
define void @f3(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 1
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 3
%7 = load double, double* %6
%8 = load double**, double*** %2
%9 = getelementptr inbounds double*, double** %8, i64 0
%10 = load double*, double** %9
%11 = getelementptr inbounds double, double* %10, i64 3
%12 = load double, double* %11
%13 = fsub double %7, %12
%14 = load double**, double*** %2
%15 = getelementptr inbounds double*, double** %14, i64 3
%16 = load double*, double** %15
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = load double**, double*** %2
%20 = getelementptr inbounds double*, double** %19, i64 0
%21 = load double*, double** %20
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = fsub double %18, %23
%25 = fdiv double %13, %24
%26 = load double**, double*** %2
%27 = getelementptr inbounds double*, double** %26, i64 0
%28 = load double*, double** %27
%29 = getelementptr inbounds double, double* %28, i64 4
store double %25, double* %29
ret void
}

LLVM IR (-O2):
define void @f3(double** nocapture %0) {
%2 = getelementptr inbounds double*, double** %0, i64 1
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 3
%5 = load double, double* %4
%6 = load double*, double** %0
%7 = getelementptr inbounds double, double* %6, i64 3
%8 = load double, double* %7
%9 = fsub double %5, %8
%10 = getelementptr inbounds double*, double** %0, i64 3
%11 = load double*, double** %10
%12 = load double, double* %11
%13 = load double, double* %6
%14 = fsub double %12, %13
%15 = fdiv double %9, %14
%16 = getelementptr inbounds double, double* %6, i64 4
store double %15, double* %16
ret void
}
unsigned add_byte(unsigned char c, unsigned char *buf, unsigned indx) {
  if (c == 0x04 || c == 0x01 || c == 0x10)
    buf[indx++] = 0x10;
  buf[indx++] = c;
  return indx;
}


x86 assembly (clang, -O0):
<add_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x4,%eax
je     1138 <add_byte+0x38>
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
je     1138 <add_byte+0x38>
movzbl -0x1(%rbp),%eax
cmp    $0x10,%eax
jne    114d <add_byte+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
mov    %ecx,%ecx
movb   $0x10,(%rax,%rcx,1)
mov    -0x1(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
mov    %ecx,%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_byte>:
mov    %edx,%eax
cmp    $0x10,%dil
ja     111e <add_byte+0x1e>
mov    %edi,%ecx
mov    $0x10012,%edx
bt     %rcx,%rdx
jae    111e <add_byte+0x1e>
mov    %eax,%ecx
add    $0x1,%eax
movb   $0x10,(%rsi,%rcx,1)
mov    %eax,%ecx
add    $0x1,%eax
mov    %dil,(%rsi,%rcx,1)
ret

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

LLVM IR (-O2):
define i32 @add_byte(i8 zeroext %0, i8* nocapture writeonly %1, i32 %2) {
switch i8 %0, label %8 [
i8 16, label %4
i8 4, label %4
i8 1, label %4
]
4: ; preds = %3, %3, %3
%5 = add i32 %2, 1
%6 = zext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 16, i8* %7
br label %8
8: ; preds = %3, %4
%9 = phi i32 [ %5, %4 ], [ %2, %3 ]
%10 = add i32 %9, 1
%11 = zext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
store i8 %0, i8* %12
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void credits() { printf("\n Todo o codigo por TheSergioEduP"); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"\0A Todo o codigo por TheSergioEduP\00"
define void @credits() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0A Todo o codigo por TheSergioEduP\00"
define void @credits() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}
void default_interrupt(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<default_interrupt>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <default_interrupt+0x9>
jmp    1109 <default_interrupt+0x9>

x86 assembly (clang, -O2):
<default_interrupt>:
jmp    1100 <default_interrupt>

LLVM IR (-O0):
define void @default_interrupt() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @default_interrupt() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
long double nearbyintl(long double);
long double rintl(long double x) { return nearbyintl(x); }


x86 assembly (clang, -O0):
<rintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <nearbyintl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <nearbyintl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.nearbyint.f80(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.nearbyint.f80(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ I2C_OIS_mem_write(int, int);
int /*<<< orphan*/ I2C_OIS_per_write(int, int);
void DisableShiftOIS(void) {
  I2C_OIS_mem_write(0x10, 0x7FFF);
  I2C_OIS_per_write(0x8B, 0x0000);
  I2C_OIS_per_write(0xCB, 0x0000);
}


x86 assembly (clang, -O0):
<DisableShiftOIS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
mov    $0x7fff,%esi
call   1030 <I2C_OIS_mem_write@plt>
mov    $0x8b,%edi
xor    %esi,%esi
call   1040 <I2C_OIS_per_write@plt>
mov    $0xcb,%edi
xor    %esi,%esi
call   1040 <I2C_OIS_per_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisableShiftOIS>:
push   %rax
mov    $0x10,%edi
mov    $0x7fff,%esi
call   1030 <I2C_OIS_mem_write@plt>
mov    $0x8b,%edi
xor    %esi,%esi
call   1040 <I2C_OIS_per_write@plt>
mov    $0xcb,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <I2C_OIS_per_write@plt>

LLVM IR (-O0):
define void @DisableShiftOIS() {
%1 = call i32 @I2C_OIS_mem_write(i32 16, i32 32767)
%2 = call i32 @I2C_OIS_per_write(i32 139, i32 0)
%3 = call i32 @I2C_OIS_per_write(i32 203, i32 0)
ret void
}

LLVM IR (-O2):
define void @DisableShiftOIS() {
%1 = tail call i32 @I2C_OIS_mem_write(i32 16, i32 32767)
%2 = tail call i32 @I2C_OIS_per_write(i32 139, i32 0)
%3 = tail call i32 @I2C_OIS_per_write(i32 203, i32 0)
ret void
}
int five() { return 5; }


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

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

LLVM IR (-O0):
define i32 @five() {
ret i32 5
}

LLVM IR (-O2):
define i32 @five() {
ret i32 5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
scalar_t__ pthread_mutex_trylock(int /*<<< orphan*/ *);
int mutex_lock(pthread_mutex_t *mutex) {
  while (pthread_mutex_trylock(mutex))
    ;
  return 0;
}


x86 assembly (clang, -O0):
<mutex_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_trylock@plt>
cmp    $0x0,%rax
je     1134 <mutex_lock+0x24>
jmp    111c <mutex_lock+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_lock>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <pthread_mutex_trylock@plt>
test   %rax,%rax
jne    1120 <mutex_lock+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @mutex_lock(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @pthread_mutex_trylock(i32* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret i32 0
}
void ar9003_hw_rtt_clear_hist(struct ath_hw *ah) {}


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

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.ath_hw = type opaque
define void @ar9003_hw_rtt_clear_hist(%struct.ath_hw* %0) {
%2 = alloca %struct.ath_hw*
store %struct.ath_hw* %0, %struct.ath_hw** %2
ret void
}

LLVM IR (-O2):
%struct.ath_hw = type opaque
define void @ar9003_hw_rtt_clear_hist(%struct.ath_hw* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ compare_uint64_t(int, int);
int8_t compare_variantkey_chrom(uint64_t vka, uint64_t vkb) {
  return compare_uint64_t((vka >> 59), (vkb >> 59));
}


x86 assembly (clang, -O0):
<compare_variantkey_chrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3b,%ecx
sar    %cl,%edi
mov    -0x8(%rbp),%esi
mov    $0x3b,%ecx
sar    %cl,%esi
call   1030 <compare_uint64_t@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_variantkey_chrom>:
jmp    1030 <compare_uint64_t@plt>

LLVM IR (-O0):
define i32 @compare_variantkey_chrom(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 = ashr i32 %5, 59
%7 = load i32, i32* %4
%8 = ashr i32 %7, 59
%9 = call i32 @compare_uint64_t(i32 %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare_variantkey_chrom(i32 %0, i32 %1) {
%3 = tail call i32 @compare_uint64_t(i32 poison, i32 poison)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ vAssertCalled(char *, int);
void NmiSR(void) {
  while (1) {
    vAssertCalled(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/unpsjb-rtsg/slack-freertos/refs/heads/"
        "master/examples/lm3s6965evb/example1/startup.c",
        201);
  }
}


x86 assembly (clang, -O0):
<NmiSR>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <NmiSR+0x9>
lea    0xee0(%rip),%rdi
mov    $0xc9,%esi
call   1030 <vAssertCalled@plt>
jmp    1119 <NmiSR+0x9>

x86 assembly (clang, -O2):
<NmiSR>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0xc9,%esi
call   1030 <vAssertCalled@plt>
jmp    1120 <NmiSR+0x10>

LLVM IR (-O0):
@.str = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/unpsjb-rtsg/slack-freertos/refs/heads/master/examples/lm3s6965evb/example1/startup.c\00"
define void @NmiSR() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @vAssertCalled(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 201)
br label %1
}

LLVM IR (-O2):
@.str = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/unpsjb-rtsg/slack-freertos/refs/heads/master/examples/lm3s6965evb/example1/startup.c\00"
define void @NmiSR() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @vAssertCalled(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 201)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle8() { kprintf("ISR %d.\n", 8); }


x86 assembly (clang, -O0):
<isrHandle8>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x8,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle8>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle8() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle8() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printbits(int n) {
  int u, i;
  n = n & 0xFF;
  for (i = 1; i <= 8; i++) {
    u = n & (1 << (8 - i));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printbits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jg     115e <printbits+0x4e>
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
sub    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <printbits+0x1d>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printbits>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @printbits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 255
store i32 %6, i32* %2
store i32 1, i32* %4
br label %7
7: ; preds = %16, %1
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 8
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = sub nsw i32 8, %12
%14 = shl i32 1, %13
%15 = and i32 %11, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %10
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %7
19: ; preds = %7
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printbits(i32 %0) {
%2 = tail call i32 @putchar(i32 10)
ret void
}