xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  long long st_size;
};

/* Variables and functions */
int /*<<< orphan*/ drop(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fstat(int, struct stat *);
long long filesize(int fd) {
  struct stat filestat;
  drop(fstat(fd, &filestat), "file status error");
  return filestat.st_size;
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
call   1030 <drop@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
lea    0xed0(%rip),%rsi
mov    %eax,%edi
call   1030 <drop@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
@.str = [18 x i8] c"file status error\00"
define i64 @filesize(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fstat(i32 %4, %struct.stat* %3)
%6 = call i32 @drop(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%8 = load i64, i64* %7
ret i64 %8
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [18 x i8] c"file status error\00"
define i64 @filesize(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = tail call i32 @drop(i32 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}
void fa110(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    p02A:
      goto p02A;
      goto a;
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
a:
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa110>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa110+0x4>

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

LLVM IR (-O0):
define void @fa110() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; preds = %19
br label %19
20: ; No predecessors!
br label %21
21: ; preds = %21, %20
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
br label %24
24: ; preds = %24, %23
br label %24
25: ; preds = %25
br label %25
26: ; No predecessors!
br label %27
27: ; preds = %27, %26
br label %27
}

LLVM IR (-O2):
define void @fa110() {
br label %1
1: ; preds = %1, %0
br label %1
}
float Sleef_atan2f_u35(float x, float y) { return __builtin_atan2f(x, y); }


x86 assembly (clang, -O0):
<Sleef_atan2f_u35>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <atan2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_atan2f_u35>:
jmp    1030 <atan2f@plt>

LLVM IR (-O0):
define float @Sleef_atan2f_u35(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @atan2f(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @Sleef_atan2f_u35(float %0, float %1) {
%3 = tail call float @atan2f(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ foo_constant();
int loop0_constant() {
  for (int i = 0; i < 100; i++) {
    foo_constant();
  }
  return 0;
}


x86 assembly (clang, -O0):
<loop0_constant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    113e <loop0_constant+0x2e>
mov    $0x0,%al
call   1030 <foo_constant@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <loop0_constant+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop0_constant>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <foo_constant@plt>
add    $0xffffffff,%ebx
jne    1120 <loop0_constant+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @loop0_constant() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (...) @foo_constant()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %1, label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ i;
typedef int /*<<< orphan*/ f;
typedef int /*<<< orphan*/ d;
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char c;
  int i;
  float f;
  double d;
  printf("char:%ld\n", sizeof(c));
  printf("int:%ld\n", sizeof(i));
  printf("float:%ld\n", sizeof(f));
  printf("double:%ld\n", sizeof(d));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"char:%ld\0A\00"
@.str.1 = [9 x i8] c"int:%ld\0A\00"
@.str.2 = [11 x i8] c"float:%ld\0A\00"
@.str.3 = [12 x i8] c"double:%ld\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca float
%4 = alloca double
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 4)
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 4)
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"char:%ld\0A\00"
@.str.1 = [9 x i8] c"int:%ld\0A\00"
@.str.2 = [11 x i8] c"float:%ld\0A\00"
@.str.3 = [12 x i8] c"double:%ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}
void third_point(double x0, double y0, double x1, double y1, double *tx,
                 double *ty) {
  *tx = (2 * x0 + x1) / 3.0;
  *ty = (2 * y0 + y1) / 3.0;
}


x86 assembly (clang, -O0):
<third_point>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<third_point>:
addsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
movsd  0xef0(%rip),%xmm2
divsd  %xmm2,%xmm0
movsd  %xmm0,(%rdi)
addsd  %xmm1,%xmm1
addsd  %xmm3,%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @third_point(double %0, double %1, double %2, double %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load double, double* %7
%14 = load double, double* %9
%15 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %13, double %14)
%16 = fdiv double %15, 3.000000e+00
%17 = load double*, double** %11
store double %16, double* %17
%18 = load double, double* %8
%19 = load double, double* %10
%20 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %18, double %19)
%21 = fdiv double %20, 3.000000e+00
%22 = load double*, double** %12
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @third_point(double %0, double %1, double %2, double %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double %2)
%8 = fdiv double %7, 3.000000e+00
store double %8, double* %4
%9 = tail call double @llvm.fmuladd.f64(double %1, double 2.000000e+00, double %3)
%10 = fdiv double %9, 3.000000e+00
store double %10, double* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void tipMenu(char *msg) {
  printf("===========================\n");
  printf("%s\n", msg);
  printf("===========================\n");
}


x86 assembly (clang, -O0):
<tipMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tipMenu>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str.2 = [28 x i8] c"===========================\00"
define void @tipMenu(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0))
ret void
}
void XkbLatchGroup() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C9int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 201
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void OBJ_add_object(void) {}


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

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

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

LLVM IR (-O2):
define void @OBJ_add_object() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rndTwoDecimals(double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double num1;
  printf("\n\nEnter a positive number with 1-6 decimal places: ");
  scanf("%lf", &num1);
  rndTwoDecimals(num1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <rndTwoDecimals@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1030 <rndTwoDecimals@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"\0A\0AEnter a positive number with 1-6 decimal places: \00"
@.str.1 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 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 i32 @rndTwoDecimals(double %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"\0A\0AEnter a positive number with 1-6 decimal places: \00"
@.str.1 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 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* %1)
%5 = load double, double* %1
%6 = call i32 @rndTwoDecimals(double %5)
ret i32 0
}
/* Variables and functions */
unsigned char bitreverse(int);
void buildrevtab(unsigned char revtab[256]) {
  int i;
  for (i = 0; i < 256; i++) {
    revtab[i] = bitreverse(i);
  }
}


x86 assembly (clang, -O0):
<buildrevtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    1153 <buildrevtab+0x43>
mov    -0xc(%rbp),%edi
call   1030 <bitreverse@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <buildrevtab+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildrevtab>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <bitreverse@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1120 <buildrevtab+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @buildrevtab(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = trunc i64 %3 to i32
%5 = tail call zeroext i8 @bitreverse(i32 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %5, i8* %6
%7 = add nuw nsw i64 %3, 1
%8 = icmp eq i64 %7, 256
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
double wrap(z, a, b)
double z;
double a, b;
{
  double w;
  w = z;
  while (w > b)
    w -= b - a;
  while (w < a)
    w += b - a;
  return (w);
}


x86 assembly (clang, -O0):
<wrap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    114a <wrap+0x4a>
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    111d <wrap+0x1d>
jmp    114f <wrap+0x4f>
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    117c <wrap+0x7c>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    114f <wrap+0x4f>
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap>:
ucomisd %xmm2,%xmm0
jbe    111a <wrap+0x1a>
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
xchg   %ax,%ax
subsd  %xmm3,%xmm0
ucomisd %xmm2,%xmm0
ja     1110 <wrap+0x10>
ucomisd %xmm0,%xmm1
jbe    113a <wrap+0x3a>
subsd  %xmm1,%xmm2
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
ja     1130 <wrap+0x30>
ret

LLVM IR (-O0):
define double @wrap(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
store double %8, double* %7
br label %9
9: ; preds = %13, %3
%10 = load double, double* %7
%11 = load double, double* %6
%12 = fcmp ogt double %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load double, double* %6
%15 = load double, double* %5
%16 = fsub double %14, %15
%17 = load double, double* %7
%18 = fsub double %17, %16
store double %18, double* %7
br label %9
19: ; preds = %9
br label %20
20: ; preds = %24, %19
%21 = load double, double* %7
%22 = load double, double* %5
%23 = fcmp olt double %21, %22
br i1 %23, label %24, label %30
24: ; preds = %20
%25 = load double, double* %6
%26 = load double, double* %5
%27 = fsub double %25, %26
%28 = load double, double* %7
%29 = fadd double %28, %27
store double %29, double* %7
br label %20
30: ; preds = %20
%31 = load double, double* %7
ret double %31
}

LLVM IR (-O2):
define double @wrap(double %0, double %1, double %2) {
%4 = fcmp ogt double %0, %2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = fsub double %2, %1
br label %12
7: ; preds = %12, %3
%8 = phi double [ %0, %3 ], [ %14, %12 ]
%9 = fcmp olt double %8, %1
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = fsub double %2, %1
br label %16
12: ; preds = %5, %12
%13 = phi double [ %0, %5 ], [ %14, %12 ]
%14 = fsub double %13, %6
%15 = fcmp ogt double %14, %2
br i1 %15, label %12, label %7
16: ; preds = %10, %16
%17 = phi double [ %8, %10 ], [ %18, %16 ]
%18 = fadd double %11, %17
%19 = fcmp olt double %18, %1
br i1 %19, label %16, label %20
20: ; preds = %16, %7
%21 = phi double [ %8, %7 ], [ %18, %16 ]
ret double %21
}
void ConvertSector(void) {}


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

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

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

LLVM IR (-O2):
define void @ConvertSector() {
ret void
}
/* Variables and functions */
double atan(int /*<<< orphan*/);
int /*<<< orphan*/ exp(double);
double lat_mm_to_deg(double x) {
  return (2.0 * atan(exp(x / 6356752.3142)) - 3.14159265358979323846 / 2.0) /
         0.017453292;
}


x86 assembly (clang, -O0):
<lat_mm_to_deg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
call   1030 <atan@plt>
addsd  %xmm0,%xmm0
movsd  0xeb2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe9e(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lat_mm_to_deg>:
push   %rax
divsd  0xed7(%rip),%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
call   1030 <atan@plt>
addsd  %xmm0,%xmm0
addsd  0xec7(%rip),%xmm0
divsd  0xec7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @lat_mm_to_deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x41583FC4141BDA51
%5 = call i32 @exp(double %4)
%6 = call double @atan(i32 %5)
%7 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %6, double 0xBFF921FB54442D18)
%8 = fdiv double %7, 0x3F91DF469963E11D
ret double %8
}

LLVM IR (-O2):
define double @lat_mm_to_deg(double %0) {
%2 = fdiv double %0, 0x41583FC4141BDA51
%3 = tail call i32 @exp(double %2)
%4 = tail call double @atan(i32 %3)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 2.000000e+00, double 0xBFF921FB54442D18)
%6 = fdiv double %5, 0x3F91DF469963E11D
ret double %6
}
int main(void) {
  enum { FOO = 2, BAR };
  return BAR - FOO;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void foo293(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo293(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int bailout(char *message, int status) {
  fprintf(stderr, "autologout: %s\n", message);
  exit(status);
}


x86 assembly (clang, -O0):
<bailout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bailout>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"autologout: %s\0A\00"
define i32 @bailout(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SYS_execveat;
long syscall(int /*<<< orphan*/, int, char const *, char **, char **, int);
long sys_execveat(int dirfd, const char *pathname, char **argv, char **envp,
                  int flags) {
  return syscall(SYS_execveat, dirfd, pathname, argv, envp, flags);
}


x86 assembly (clang, -O0):
<sys_execveat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_execveat>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_execveat = global i32 0
define i64 @sys_execveat(i32 %0, i8* %1, i8** %2, i8** %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
store i32 %4, i32* %10
%11 = load i32, i32* @SYS_execveat
%12 = load i32, i32* %6
%13 = load i8*, i8** %7
%14 = load i8**, i8*** %8
%15 = load i8**, i8*** %9
%16 = load i32, i32* %10
%17 = call i64 @syscall(i32 %11, i32 %12, i8* %13, i8** %14, i8** %15, i32 %16)
ret i64 %17
}

LLVM IR (-O2):
@SYS_execveat = global i32 0
define i64 @sys_execveat(i32 %0, i8* %1, i8** %2, i8** %3, i32 %4) {
%6 = load i32, i32* @SYS_execveat
%7 = tail call i64 @syscall(i32 %6, i32 %0, i8* %1, i8** %2, i8** %3, i32 %4)
ret i64 %7
}
char *unpack8(int jb) {
  int i;
  unsigned char *bi;
  static char bc[4];
  bi = (unsigned char *)&jb;
  for (i = 0; i < 3; i++)
    bc[2 - i] = (char)((jb >> (8 * i)) & 0x7f);
  bc[3] = '\0';
  return bc;
}


x86 assembly (clang, -O0):
<unpack8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1153 <unpack8+0x53>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%eax
and    $0x7f,%eax
mov    %al,%dl
mov    $0x2,%eax
sub    -0x8(%rbp),%eax
movslq %eax,%rcx
lea    0x2edf(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1116 <unpack8+0x16>
movb   $0x0,0x2eca(%rip)
lea    0x2ec0(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack8>:
mov    %edi,%eax
and    $0x7f,%al
mov    %al,0x2f19(%rip)
lea    0x2f10(%rip),%rax
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0x7f,%cl
mov    %cl,0x2f03(%rip)
shr    $0x10,%edi
and    $0x7f,%dil
mov    %dil,0x2ef4(%rip)
movb   $0x0,0x2ef0(%rip)
ret

LLVM IR (-O0):
@unpack8.bc = internal global [4 x i8] zeroinitializer
define i8* @unpack8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
%5 = bitcast i32* %2 to i8*
store i8* %5, i8** %4
store i32 0, i32* %3
br label %6
6: ; preds = %20, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = mul nsw i32 8, %11
%13 = ashr i32 %10, %12
%14 = and i32 %13, 127
%15 = trunc i32 %14 to i8
%16 = load i32, i32* %3
%17 = sub nsw i32 2, %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [4 x i8], [4 x i8]* @unpack8.bc, i64 0, i64 %18
store i8 %15, i8* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %6
23: ; preds = %6
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @unpack8.bc, i64 0, i64 3)
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @unpack8.bc, i64 0, i64 0)
}

LLVM IR (-O2):
@unpack8.bc = internal global [4 x i8] zeroinitializer
define i8* @unpack8(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = and i8 %2, 127
store i8 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @unpack8.bc, i64 0, i64 2)
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = and i8 %5, 127
store i8 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @unpack8.bc, i64 0, i64 1)
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = and i8 %8, 127
store i8 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @unpack8.bc, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @unpack8.bc, i64 0, i64 3)
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @unpack8.bc, i64 0, i64 0)
}
int GetSensorType(int snum, unsigned char *stype, unsigned char *rtype) {
  return (-1);
}


x86 assembly (clang, -O0):
<GetSensorType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @GetSensorType(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 -1
}
void handle_44(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_44(i32 %0) {
ret void
}
/* Variables and functions */
int IFF_TAP;
int tap() { return IFF_TAP; }


x86 assembly (clang, -O0):
<tap>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tap>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@IFF_TAP = global i32 0
define i32 @tap() {
%1 = load i32, i32* @IFF_TAP
ret i32 %1
}

LLVM IR (-O2):
@IFF_TAP = global i32 0
define i32 @tap() {
%1 = load i32, i32* @IFF_TAP
ret i32 %1
}
/* Variables and functions */
int strcmp(char *, char *);
int checkCardCryptogram(char *returnedCardCryptogram,
                        char *computedCardCryptogram) {
  int r;
  r = strcmp(returnedCardCryptogram, computedCardCryptogram);
  if (r == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<checkCardCryptogram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1146 <checkCardCryptogram+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114d <checkCardCryptogram+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @checkCardCryptogram(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcmp(i8* %7, i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @checkCardCryptogram(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned sizechar(char n) {}


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

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

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

LLVM IR (-O2):
define i32 @sizechar(i8 signext %0) {
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t WatchdogIntStatus(uint32_t ui32Base, bool bMasked) {
  ;
  if (bMasked) {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000014))));
  } else {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000010))));
  }
}


x86 assembly (clang, -O0):
<WatchdogIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1126 <WatchdogIntStatus+0x26>
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <WatchdogIntStatus+0x32>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntStatus>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    -0x8(%rsp),%rcx
mov    0x10(%rcx,%rax,4),%rax
ret

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

LLVM IR (-O2):
define i64 @WatchdogIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = icmp eq i32 %1, 0
%5 = load volatile i64, i64* %3
%6 = select i1 %4, i64 16, i64 20
%7 = add nsw i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ *wcsstr;
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
wchar_t *(wcswcs)(const wchar_t *haystack, const wchar_t *needle) {
  return (wcsstr)(haystack, needle);
}


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

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

LLVM IR (-O0):
define i32* @wcswcs(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
ret i32* %6
}

LLVM IR (-O2):
define i32* @wcswcs(i32* nocapture readnone %0, i32* readnone returned %1) {
ret i32* %1
}
/* Variables and functions */
int chdir(char const *);
__attribute__((__weak__, __always___)) int
softboundcets_chdir(const char *path) {
  return chdir(path);
}


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

x86 assembly (clang, -O2):
<softboundcets_chdir>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_chdir(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_CTRL_WPENDING;
size_t BIO_ctrl(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/ *);
size_t BIO_ctrl_wpending(BIO *bio) {
  return BIO_ctrl(bio, BIO_CTRL_WPENDING, 0, NULL);
}


x86 assembly (clang, -O0):
<BIO_ctrl_wpending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <BIO_ctrl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_ctrl_wpending>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <BIO_ctrl@plt>

LLVM IR (-O0):
@BIO_CTRL_WPENDING = global i32 0
define i64 @BIO_ctrl_wpending(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @BIO_CTRL_WPENDING
%5 = call i64 @BIO_ctrl(i32* %3, i32 %4, i32 0, i32* null)
ret i64 %5
}

LLVM IR (-O2):
@BIO_CTRL_WPENDING = global i32 0
define i64 @BIO_ctrl_wpending(i32* %0) {
%2 = load i32, i32* @BIO_CTRL_WPENDING
%3 = tail call i64 @BIO_ctrl(i32* %0, i32 %2, i32 0, i32* null)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ cPrintf(char *);
void help14(void) {
  cPrintf("  t                 show TLB contents\n");
  cPrintf("  t  <i>            show TLB contents at <i>\n");
  cPrintf("  t  <i> p <data>   set TLB contents at <i> to page <data>\n");
  cPrintf("  t  <i> f <data>   set TLB contents at <i> to frame <data>\n");
}


x86 assembly (clang, -O0):
<help14>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf00(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf22(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf52(%rip),%rdi
call   1030 <cPrintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help14>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf03(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf25(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf55(%rip),%rdi
pop    %rax
jmp    1030 <cPrintf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c" t show TLB contents\0A\00"
@.str.1 = [46 x i8] c" t <i> show TLB contents at <i>\0A\00"
@.str.2 = [60 x i8] c" t <i> p <data> set TLB contents at <i> to page <data>\0A\00"
@.str.3 = [61 x i8] c" t <i> f <data> set TLB contents at <i> to frame <data>\0A\00"
define void @help14() {
%1 = call i32 @cPrintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cPrintf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @cPrintf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @cPrintf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c" t show TLB contents\0A\00"
@.str.1 = [46 x i8] c" t <i> show TLB contents at <i>\0A\00"
@.str.2 = [60 x i8] c" t <i> p <data> set TLB contents at <i> to page <data>\0A\00"
@.str.3 = [61 x i8] c" t <i> f <data> set TLB contents at <i> to frame <data>\0A\00"
define void @help14() {
%1 = tail call i32 @cPrintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cPrintf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @cPrintf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @cPrintf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void test_safelen_simdlen() {
  int i;
#pragma omp target parallel for simd simdlen(6) safelen(5)
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target parallel for simd safelen(5) simdlen(6)
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_safelen_simdlen>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_safelen_simdlen+0x28>
jmp    111a <test_safelen_simdlen+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_safelen_simdlen+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_safelen_simdlen+0x4c>
jmp    113e <test_safelen_simdlen+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_safelen_simdlen+0x2f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_safelen_simdlen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AT_SECURE;
int getauxval(int /*<<< orphan*/);
int main(void) { return getauxval(AT_SECURE); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
call   1030 <getauxval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getauxval@plt>

LLVM IR (-O0):
@AT_SECURE = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @AT_SECURE
%3 = call i32 @getauxval(i32 %2)
ret i32 %3
}

LLVM IR (-O2):
@AT_SECURE = global i32 0
define i32 @main() {
%1 = load i32, i32* @AT_SECURE
%2 = tail call i32 @getauxval(i32 %1)
ret i32 %2
}
/* Variables and functions */
double foo2(double);
double bar2(double bar2param) { return foo2(bar2param); }


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

x86 assembly (clang, -O2):
<bar2>:
jmp    1030 <foo2@plt>

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

LLVM IR (-O2):
define double @bar2(double %0) {
%2 = tail call double @foo2(double %0)
ret double %2
}
/* Type definitions */
struct Cyc_Absyn_Tvar {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Absyn_naive_tvar_cmp2(struct Cyc_Absyn_Tvar *,
                                             struct Cyc_Absyn_Tvar *);
int Cyc_Absyn_rgneffect_tvar_cmp(struct Cyc_Absyn_Tvar *x,
                                 struct Cyc_Absyn_Tvar *y) {
  return ({ Cyc_Absyn_naive_tvar_cmp2(x, y); });
}


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

x86 assembly (clang, -O2):
<Cyc_Absyn_rgneffect_tvar_cmp>:
jmp    1030 <Cyc_Absyn_naive_tvar_cmp2@plt>

LLVM IR (-O0):
%struct.Cyc_Absyn_Tvar = type { i32 }
define i32 @Cyc_Absyn_rgneffect_tvar_cmp(%struct.Cyc_Absyn_Tvar* %0, %struct.Cyc_Absyn_Tvar* %1) {
%3 = alloca %struct.Cyc_Absyn_Tvar*
%4 = alloca %struct.Cyc_Absyn_Tvar*
%5 = alloca i32
store %struct.Cyc_Absyn_Tvar* %0, %struct.Cyc_Absyn_Tvar** %3
store %struct.Cyc_Absyn_Tvar* %1, %struct.Cyc_Absyn_Tvar** %4
%6 = load %struct.Cyc_Absyn_Tvar*, %struct.Cyc_Absyn_Tvar** %3
%7 = load %struct.Cyc_Absyn_Tvar*, %struct.Cyc_Absyn_Tvar** %4
%8 = call i32 @Cyc_Absyn_naive_tvar_cmp2(%struct.Cyc_Absyn_Tvar* %6, %struct.Cyc_Absyn_Tvar* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Tvar = type { i32 }
define i32 @Cyc_Absyn_rgneffect_tvar_cmp(%struct.Cyc_Absyn_Tvar* %0, %struct.Cyc_Absyn_Tvar* %1) {
%3 = tail call i32 @Cyc_Absyn_naive_tvar_cmp2(%struct.Cyc_Absyn_Tvar* %0, %struct.Cyc_Absyn_Tvar* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ seq_utils_clamp(scalar_t__, int /*<<< orphan*/, int);
scalar_t__ song_get_midi_autolive();
int /*<<< orphan*/ song_set_midi_autolive(int /*<<< orphan*/);
void seq_ctrl_adjust_midi_autolive(int change) {
  song_set_midi_autolive(
      seq_utils_clamp(song_get_midi_autolive() + change, 0, 1));
}


x86 assembly (clang, -O0):
<seq_ctrl_adjust_midi_autolive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <song_get_midi_autolive@plt>
mov    %rax,%rdi
movslq -0x4(%rbp),%rax
add    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <seq_utils_clamp@plt>
mov    %eax,%edi
call   1040 <song_set_midi_autolive@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_ctrl_adjust_midi_autolive>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <song_get_midi_autolive@plt>
movslq %ebx,%rdi
add    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <seq_utils_clamp@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <song_set_midi_autolive@plt>

LLVM IR (-O0):
define void @seq_ctrl_adjust_midi_autolive(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @song_get_midi_autolive()
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %3, %5
%7 = call i32 @seq_utils_clamp(i64 %6, i32 0, i32 1)
%8 = call i32 @song_set_midi_autolive(i32 %7)
ret void
}

LLVM IR (-O2):
define void @seq_ctrl_adjust_midi_autolive(i32 %0) {
%2 = tail call i64 (...) @song_get_midi_autolive()
%3 = sext i32 %0 to i64
%4 = add nsw i64 %2, %3
%5 = tail call i32 @seq_utils_clamp(i64 %4, i32 0, i32 1)
%6 = tail call i32 @song_set_midi_autolive(i32 %5)
ret void
}
void sys_closesocket(int fd) {}


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

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

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

LLVM IR (-O2):
define void @sys_closesocket(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ SysCtlDelay(int);
void _EEPROMSectorMaskSet(uint32_t ui32Address) {
  uint32_t ui32Mask;
  ui32Mask = ~(1 << (ui32Address >> 7));
  SysCtlDelay(10);
  (*((volatile unsigned long *)(0x400FD0FC))) = 3;
  SysCtlDelay(10);
  (*((volatile unsigned long *)(0x400AE2C0))) = ui32Mask;
  SysCtlDelay(10);
  (*((volatile unsigned long *)(0x400FD0FC))) = 0;
  SysCtlDelay(10);
}


x86 assembly (clang, -O0):
<_EEPROMSectorMaskSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400fd0fc,%eax
movq   $0x3,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movslq -0x8(%rbp),%rcx
mov    $0x400ae2c0,%eax
mov    %rcx,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400fd0fc,%eax
movq   $0x0,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_EEPROMSectorMaskSet>:
push   %rbx
mov    %edi,%ecx
shr    $0x7,%ecx
mov    $0xfffffffe,%ebx
rol    %cl,%ebx
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movq   $0x3,0x400fd0fc
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movslq %ebx,%rax
mov    %rax,0x400ae2c0
40
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movq   $0x0,0x400fd0fc
mov    $0xa,%edi
pop    %rbx
jmp    1030 <SysCtlDelay@plt>

LLVM IR (-O0):
define void @_EEPROMSectorMaskSet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 7
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
store i32 %7, i32* %3
%8 = call i32 @SysCtlDelay(i32 10)
store volatile i64 3, i64* inttoptr (i64 1074778364 to i64*)
%9 = call i32 @SysCtlDelay(i32 10)
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
store volatile i64 %11, i64* inttoptr (i64 1074455232 to i64*)
%12 = call i32 @SysCtlDelay(i32 10)
store volatile i64 0, i64* inttoptr (i64 1074778364 to i64*)
%13 = call i32 @SysCtlDelay(i32 10)
ret void
}

LLVM IR (-O2):
define void @_EEPROMSectorMaskSet(i32 %0) {
%2 = ashr i32 %0, 7
%3 = shl nuw i32 1, %2
%4 = xor i32 %3, -1
%5 = tail call i32 @SysCtlDelay(i32 10)
store volatile i64 3, i64* inttoptr (i64 1074778364 to i64*)
%6 = tail call i32 @SysCtlDelay(i32 10)
%7 = sext i32 %4 to i64
store volatile i64 %7, i64* inttoptr (i64 1074455232 to i64*)
%8 = tail call i32 @SysCtlDelay(i32 10)
store volatile i64 0, i64* inttoptr (i64 1074778364 to i64*)
%9 = tail call i32 @SysCtlDelay(i32 10)
ret void
}