xunge/DecIR huggingface dataset:
/* Variables and functions */
double distance(double, double, double, double);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *, double *, double *);
void main(void) {
  double x1, y1, x2, y2, num;
  scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
  num = distance(x1, y1, x2, y2);
  printf("%lf", num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1050 <distance@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xec5(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm3
call   1050 <distance@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%lf %lf %lf %lf\00"
@.str.1 = [4 x i8] c"%lf\00"
define void @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = call i32 @scanf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3, double* %4)
%7 = load double, double* %1
%8 = load double, double* %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call double @distance(double %7, double %8, double %9, double %10)
store double %11, double* %5
%12 = load double, double* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %12)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%lf %lf %lf %lf\00"
@.str.1 = [4 x i8] c"%lf\00"
define void @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = bitcast double* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3, double* %4)
%10 = load double, double* %1
%11 = load double, double* %2
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call double @distance(double %10, double %11, double %12, double %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %14)
ret void
}
/* Type definitions */
struct kqueue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void linux_kqueue_free(struct kqueue *kq __attribute__((unused))) { abort(); }


x86 assembly (clang, -O0):
<linux_kqueue_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<linux_kqueue_free>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.kqueue = type { i32 }
define void @linux_kqueue_free(%struct.kqueue* %0) {
%2 = alloca %struct.kqueue*
store %struct.kqueue* %0, %struct.kqueue** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.kqueue = type { i32 }
define void @linux_kqueue_free(%struct.kqueue* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
void gtk_image_set_from_file() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_set_from_file() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
void *grab_fd(int, unsigned long *);
int open(char const *, int /*<<< orphan*/, int /*<<< orphan*/);
void *grab_file(const char *filename, unsigned long *size) {
  int fd;
  void *map;
  fd = open(filename, O_RDONLY, 0);
  if (fd < 0)
    return NULL;
  map = grab_fd(fd, size);
  close(fd);
  return map;
}


x86 assembly (clang, -O0):
<grab_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    116e <grab_file+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    118e <grab_file+0x5e>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <grab_fd@plt>
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <close@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grab_file>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <open@plt>
test   %eax,%eax
js     1165 <grab_file+0x35>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <grab_fd@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <close@plt>
mov    %rbx,%rax
jmp    1167 <grab_file+0x37>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i8* @grab_file(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i64* %1, i64** %5
%8 = load i8*, i8** %4
%9 = load i32, i32* @O_RDONLY
%10 = call i32 @open(i8* %8, i32 %9, i32 0)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i8* null, i8** %3
br label %21
14: ; preds = %2
%15 = load i32, i32* %6
%16 = load i64*, i64** %5
%17 = call i8* @grab_fd(i32 %15, i64* %16)
store i8* %17, i8** %7
%18 = load i32, i32* %6
%19 = call i32 @close(i32 %18)
%20 = load i8*, i8** %7
store i8* %20, i8** %3
br label %21
21: ; preds = %14, %13
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i8* @grab_file(i8* nocapture %0, i64* %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* %0, i32 %3, i32 0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i8* @grab_fd(i32 %4, i64* %1)
%8 = tail call i32 @close(i32 %4)
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %10
}
unsigned xrop3_11_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S & stk3;
  stk1 = T | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_11_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_11_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_11_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = load i32, i32* %6
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_11_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ nc_advise(char *, int const, char *, int);
int nc_inq_dimid(int, char const *, int *);
int ncdimid(int ncid, const char *name) {
  int dimid;
  const int status = nc_inq_dimid(ncid, name, &dimid);
  if (status != 0) {
    nc_advise("ncdimid", status, "ncid %d", ncid);
    return -1;
  }
  return dimid;
}


x86 assembly (clang, -O0):
<ncdimid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <nc_inq_dimid@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1171 <ncdimid+0x51>
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xea7(%rip),%rdi
lea    0xea8(%rip),%rdx
call   1040 <nc_advise@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <ncdimid+0x57>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncdimid>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xc(%rsp),%rdx
call   1030 <nc_inq_dimid@plt>
test   %eax,%eax
je     1153 <ncdimid+0x33>
lea    0xec4(%rip),%rdi
lea    0xec5(%rip),%rdx
mov    %eax,%esi
mov    %ebx,%ecx
call   1040 <nc_advise@plt>
mov    $0xffffffff,%eax
jmp    1157 <ncdimid+0x37>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"ncdimid\00"
@.str.1 = [8 x i8] c"ncid %d\00"
define i32 @ncdimid(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = call i32 @nc_inq_dimid(i32 %8, i8* %9, i32* %6)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* %7
%15 = load i32, i32* %4
%16 = call i32 @nc_advise(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %15)
store i32 -1, i32* %3
br label %19
17: ; preds = %2
%18 = load i32, i32* %6
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [8 x i8] c"ncdimid\00"
@.str.1 = [8 x i8] c"ncid %d\00"
define i32 @ncdimid(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @nc_inq_dimid(i32 %0, i8* %1, i32* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @nc_advise(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %11
9: ; preds = %2
%10 = load i32, i32* %3
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ -1, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ sqrt(int);
unsigned char is_prime(int n) {
  int x = (int)sqrt(n), i;
  for (i = 2; i <= x; ++i)
    if (n % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1165 <is_prime+0x55>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1152 <is_prime+0x42>
movb   $0x0,-0x1(%rbp)
jmp    1169 <is_prime+0x59>
jmp    1157 <is_prime+0x47>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <is_prime+0x1d>
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    %rax,%rsi
mov    $0x1,%cl
cmp    $0x2,%esi
jl     114f <is_prime+0x3f>
neg    %esi
mov    $0x2,%edi
nopl   0x0(%rax)
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     114d <is_prime+0x3d>
lea    (%rsi,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%edx
add    $0x1,%edx
mov    %edx,%edi
cmp    $0x1,%eax
jne    1130 <is_prime+0x20>
jmp    114f <is_prime+0x3f>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @is_prime(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call i64 @sqrt(i32 %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %4
store i32 2, i32* %5
br label %9
9: ; preds = %20, %1
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = srem i32 %14, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i8 0, i8* %2
br label %24
19: ; preds = %13
br label %20
20: ; preds = %19
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %9
23: ; preds = %9
store i8 1, i8* %2
br label %24
24: ; preds = %23, %18
%25 = load i8, i8* %2
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @is_prime(i32 %0) {
%2 = tail call i64 @sqrt(i32 %0)
%3 = trunc i64 %2 to i32
%4 = icmp slt i32 %3, 2
br i1 %4, label %12, label %8
5: ; preds = %8
%6 = add nuw i32 %9, 1
%7 = icmp eq i32 %9, %3
br i1 %7, label %12, label %8
8: ; preds = %1, %5
%9 = phi i32 [ %6, %5 ], [ 2, %1 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i8 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sample_format_is_le() {
  printf("NOT IMPLEMENTED:"
         "pa_sample_format_is_le"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_sample_format_is_le\00"
define i32 @pa_sample_format_is_le() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ calltrap(int);
int ExitEmu(void) { calltrap(13); }


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

x86 assembly (clang, -O2):
<ExitEmu>:
mov    $0xd,%edi
jmp    1030 <calltrap@plt>

LLVM IR (-O0):
define i32 @ExitEmu() {
%1 = alloca i32
%2 = call i32 @calltrap(i32 13)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @ExitEmu() {
%1 = tail call i32 @calltrap(i32 13)
ret i32 undef
}
/* Type definitions */
struct completion {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __wait_completion(struct completion *);
void wait_for_completion(struct completion *work) { __wait_completion(work); }


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

x86 assembly (clang, -O2):
<wait_for_completion>:
jmp    1030 <__wait_completion@plt>

LLVM IR (-O0):
%struct.completion = type { i32 }
define void @wait_for_completion(%struct.completion* %0) {
%2 = alloca %struct.completion*
store %struct.completion* %0, %struct.completion** %2
%3 = load %struct.completion*, %struct.completion** %2
%4 = call i32 @__wait_completion(%struct.completion* %3)
ret void
}

LLVM IR (-O2):
%struct.completion = type { i32 }
define void @wait_for_completion(%struct.completion* %0) {
%2 = tail call i32 @__wait_completion(%struct.completion* %0)
ret void
}
/* Variables and functions */
int addDigits(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d \n", addDigits(3589));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i32 @addDigits(i32 3589)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned int ft_collatz_conjecture(unsigned int base) {
  if (base != 1) {
    if ((base % 2) == 0)
      return (ft_collatz_conjecture(base / 2));
    else
      return (ft_collatz_conjecture((base * 3) + 1));
  } else
    return (0);
}


x86 assembly (clang, -O0):
<ft_collatz_conjecture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     115b <ft_collatz_conjecture+0x4b>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1147 <ft_collatz_conjecture+0x37>
mov    -0x8(%rbp),%edi
shr    $0x1,%edi
call   1030 <ft_collatz_conjecture@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <ft_collatz_conjecture+0x52>
imul   $0x3,-0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <ft_collatz_conjecture@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <ft_collatz_conjecture+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_collatz_conjecture>:
cmp    $0x1,%edi
je     1124 <ft_collatz_conjecture+0x24>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%eax
shr    %eax
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%edi
cmove  %eax,%edi
cmp    $0x1,%edi
jne    1110 <ft_collatz_conjecture+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_collatz_conjecture(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ %0, %1 ]
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = lshr i32 %4, 1
%8 = mul i32 %4, 3
%9 = add i32 %8, 1
%10 = select i1 %6, i32 %7, i32 %9
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %3
12: ; preds = %3, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, char *, int);
int /*<<< orphan*/ writeToAllClients(char *);
int setupClients(int type, char *fname, int nThread) {
  char message[512];
  sprintf(message, "%d:%s:%d::", type, fname, nThread);
  writeToAllClients(message);
  return 0;
}


x86 assembly (clang, -O0):
<setupClients>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xeb2(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x220(%rbp),%rdi
call   1030 <writeToAllClients@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupClients>:
push   %rbx
sub    $0x200,%rsp
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %edi,%edx
lea    0xec9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <writeToAllClients@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d:%s:%d::\00"
define i32 @setupClients(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [512 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i32 %11)
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%14 = call i32 @writeToAllClients(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d:%s:%d::\00"
define i32 @setupClients(i32 %0, i8* %1, i32 %2) {
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i32 %2)
%7 = call i32 @writeToAllClients(i8* %5)
ret i32 0
}
/* Variables and functions */
float nextafterf(float, float);
float __ocl_nextafter_float(float src1, float src2) {
  return nextafterf(src1, src2);
}


x86 assembly (clang, -O0):
<__ocl_nextafter_float>:
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 <nextafterf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_nextafter_float>:
jmp    1030 <nextafterf@plt>

LLVM IR (-O0):
define float @__ocl_nextafter_float(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 @nextafterf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__ocl_nextafter_float(float %0, float %1) {
%3 = tail call float @nextafterf(float %0, float %1)
ret float %3
}
/* Variables and functions */
long _tailRecursionHelper(long, int /*<<< orphan*/);
long _tailRecursion(long EV_value) { return _tailRecursionHelper(EV_value, 0); }


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

x86 assembly (clang, -O2):
<_tailRecursion>:
xor    %esi,%esi
jmp    1030 <_tailRecursionHelper@plt>

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

LLVM IR (-O2):
define i64 @_tailRecursion(i64 %0) {
%2 = tail call i64 @_tailRecursionHelper(i64 %0, i32 0)
ret i64 %2
}
int find_max_VT() { return 12; }


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

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

LLVM IR (-O0):
define i32 @find_max_VT() {
ret i32 12
}

LLVM IR (-O2):
define i32 @find_max_VT() {
ret i32 12
}
void sdb_init_msql(void) { ; }


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

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

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

LLVM IR (-O2):
define void @sdb_init_msql() {
ret void
}
/* Variables and functions */
int inb(unsigned int);
int b1_tx_empty(unsigned int base) { return inb(base + 0x03) & 0x1; }


x86 assembly (clang, -O0):
<b1_tx_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x3,%edi
call   1030 <inb@plt>
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b1_tx_empty>:
push   %rax
add    $0x3,%edi
call   1030 <inb@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @b1_tx_empty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 3
%5 = call i32 @inb(i32 %4)
%6 = and i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @b1_tx_empty(i32 %0) {
%2 = add i32 %0, 3
%3 = tail call i32 @inb(i32 %2)
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
int fopen_t02(void) {
  FILE *f;
  f = fopen("t0/2", "w");
  if (f == NULL) {
    perror("fopen");
    return 1;
  }
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<fopen_t02>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1172 <fopen_t02+0x42>
lea    0xea6(%rip),%rdi
call   1050 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1182 <fopen_t02+0x52>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_t02>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1155 <fopen_t02+0x25>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeab(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"t0/2\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [6 x i8] c"fopen\00"
define i32 @fopen_t02() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %11
8: ; preds = %0
%9 = load i32*, i32** %2
%10 = call i32 @fclose(i32* %9)
store i32 0, i32* %1
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"t0/2\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [6 x i8] c"fopen\00"
define i32 @fopen_t02() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 @fclose(i32* %1)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ 1, %3 ], [ 0, %5 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_shuffle_pi16(int /*<<< orphan*/, int);
__m64 test_mm_shuffle_pi16(__m64 a) { return _mm_shuffle_pi16(a, 3); }


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

x86 assembly (clang, -O2):
<test_mm_shuffle_pi16>:
mov    $0x3,%esi
jmp    1030 <_mm_shuffle_pi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_shuffle_pi16(i32 %0) {
%2 = tail call i32 @_mm_shuffle_pi16(i32 %0, i32 3)
ret i32 %2
}
AR0AX1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((p0[10000000]) <= (((unsigned char *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x989680(%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     114a <AR0AX1+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <AR0AX1+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0AX1>:
mov    0x989680(%r8),%dl
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx),%dl
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @AR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = getelementptr inbounds i8, i8* %4, i64 10000000
%8 = load i8, i8* %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %9
%11 = load i8, i8* %10
%12 = icmp ule i8 %8, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
__attribute__((visibility("default"))) char echo_byte(char arg, ...) {
  return arg;
}


x86 assembly (clang, -O0):
<echo_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @echo_byte(i8 returned signext %0, ...) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ Off_Reg_Bank(int);
void Move_To_Reg_X(int index) {
  Inst_Printf("movq", "%%rdx,%s", Off_Reg_Bank(index * 8));
}


x86 assembly (clang, -O0):
<Move_To_Reg_X>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
call   1040 <Off_Reg_Bank@plt>
mov    %eax,%edx
lea    0xec1(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Move_To_Reg_X>:
push   %rax
shl    $0x3,%edi
call   1040 <Off_Reg_Bank@plt>
lea    0xed0(%rip),%rdi
lea    0xece(%rip),%rsi
mov    %eax,%edx
pop    %rax
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"movq\00"
@.str.1 = [9 x i8] c"%%rdx,%s\00"
define void @Move_To_Reg_X(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 8
%5 = call i32 @Off_Reg_Bank(i32 %4)
%6 = call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"movq\00"
@.str.1 = [9 x i8] c"%%rdx,%s\00"
define void @Move_To_Reg_X(i32 %0) {
%2 = shl nsw i32 %0, 3
%3 = tail call i32 @Off_Reg_Bank(i32 %2)
%4 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ errnum;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
const char *err2str(int error) {
  static char errnum[8];
  switch (error) {
  default:
    snprintf(errnum, sizeof(errnum), "%d", error);
    return (errnum);
  }
}


x86 assembly (clang, -O0):
<err2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f04(%rip),%rdi
mov    $0x8,%esi
lea    0xecf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2eec(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err2str>:
push   %rbx
mov    %edi,%ecx
lea    0x2f0f(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@err2str.errnum = internal global [8 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @err2str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @err2str.errnum, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @err2str.errnum, i64 0, i64 0)
}

LLVM IR (-O2):
@err2str.errnum = internal global [8 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @err2str(i32 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @err2str.errnum, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @err2str.errnum, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ cgiMakeButton(char *, char *);
void cgiMakeSubmitButton() { cgiMakeButton("Submit", "Submit"); }


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

x86 assembly (clang, -O2):
<cgiMakeSubmitButton>:
lea    0xee9(%rip),%rdi
mov    %rdi,%rsi
jmp    1030 <cgiMakeButton@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Submit\00"
define void @cgiMakeSubmitButton() {
%1 = call i32 @cgiMakeButton(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Submit\00"
define void @cgiMakeSubmitButton() {
%1 = tail call i32 @cgiMakeButton(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int isleap(int year) {
  if ((year % 400) == 0)
    return 1;
  if ((year % 100) == 0)
    return 0;
  if ((year % 4) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <isleap+0x27>
movl   $0x1,-0x4(%rbp)
jmp    116e <isleap+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <isleap+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116e <isleap+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <isleap+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <isleap+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <isleap+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <isleap+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isleap(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
short get_max_edge_cost() { return 4; }


x86 assembly (clang, -O0):
<get_max_edge_cost>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max_edge_cost>:
mov    $0x4,%ax
ret

LLVM IR (-O0):
define signext i16 @get_max_edge_cost() {
ret i16 4
}

LLVM IR (-O2):
define signext i16 @get_max_edge_cost() {
ret i16 4
}
int thread_sleep(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @thread_sleep() {
ret i32 0
}
int fun1059() { return 1059; }


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

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

LLVM IR (-O0):
define i32 @fun1059() {
ret i32 1059
}

LLVM IR (-O2):
define i32 @fun1059() {
ret i32 1059
}
int stats(char *arguments) {}


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

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

LLVM IR (-O0):
define i32 @stats(i8* %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 @stats(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
scalar_t__ sign_and_verify(int);
int dsa_exact_size_test(void) {
  return sign_and_verify(224 / 8) && sign_and_verify(256 / 8);
}


x86 assembly (clang, -O0):
<dsa_exact_size_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1c,%edi
call   1030 <sign_and_verify@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1148 <dsa_exact_size_test+0x38>
mov    $0x20,%edi
call   1030 <sign_and_verify@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsa_exact_size_test>:
push   %rax
mov    $0x1c,%edi
call   1030 <sign_and_verify@plt>
test   %rax,%rax
je     1137 <dsa_exact_size_test+0x27>
mov    $0x20,%edi
call   1030 <sign_and_verify@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dsa_exact_size_test() {
%1 = call i64 @sign_and_verify(i32 28)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i64 @sign_and_verify(i32 32)
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @dsa_exact_size_test() {
%1 = tail call i64 @sign_and_verify(i32 28)
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @sign_and_verify(i32 32)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
float test_scalbnf(float x, int y) { return __builtin_scalbnf(x, y); }


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

x86 assembly (clang, -O2):
<test_scalbnf>:
jmp    1030 <scalbnf@plt>

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

LLVM IR (-O2):
define float @test_scalbnf(float %0, i32 %1) {
%3 = tail call float @scalbnf(float %0, i32 %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ krb5_init_ets();
int /*<<< orphan*/ tkt_test_1();
main() {
  krb5_init_ets();
  tkt_test_1();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <krb5_init_ets@plt>
mov    $0x0,%al
call   1040 <tkt_test_1@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @krb5_init_ets()
%2 = call i32 (...) @tkt_test_1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @krb5_init_ets()
%2 = tail call i32 (...) @tkt_test_1()
ret i32 0
}
/* Variables and functions */
int gAnd(int const, int const);
int gNot(int const);
void demux(const int s, const int *in, int *out) {
  int notS = gNot(s);
  out[0] = gAnd(*in, notS);
  out[1] = gAnd(*in, s);
}


x86 assembly (clang, -O0):
<demux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <gNot@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%esi
call   1040 <gAnd@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1040 <gAnd@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<demux>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <gNot@plt>
mov    (%rbx),%edi
mov    %eax,%esi
call   1040 <gAnd@plt>
mov    %eax,(%r14)
mov    (%rbx),%edi
mov    %ebp,%esi
call   1040 <gAnd@plt>
mov    %eax,0x4(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @demux(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = call i32 @gNot(i32 %8)
store i32 %9, i32* %7
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = load i32, i32* %7
%13 = call i32 @gAnd(i32 %11, i32 %12)
%14 = load i32*, i32** %6
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 %13, i32* %15
%16 = load i32*, i32** %5
%17 = load i32, i32* %16
%18 = load i32, i32* %4
%19 = call i32 @gAnd(i32 %17, i32 %18)
%20 = load i32*, i32** %6
%21 = getelementptr inbounds i32, i32* %20, i64 1
store i32 %19, i32* %21
ret void
}

LLVM IR (-O2):
define void @demux(i32 %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @gNot(i32 %0)
%5 = load i32, i32* %1
%6 = tail call i32 @gAnd(i32 %5, i32 %4)
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = tail call i32 @gAnd(i32 %7, i32 %0)
%9 = getelementptr inbounds i32, i32* %2, i64 1
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void javacall_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<javacall_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @javacall_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int ls_costN_nm3_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 1;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 1;
  return 0;
}


x86 assembly (clang, -O0):
<ls_costN_nm3_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <ls_costN_nm3_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <ls_costN_nm3_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <ls_costN_nm3_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <ls_costN_nm3_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm3_work>:
test   %rdi,%rdi
je     110b <ls_costN_nm3_work+0xb>
movl   $0x1,(%rdi)
test   %rsi,%rsi
je     1116 <ls_costN_nm3_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <ls_costN_nm3_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <ls_costN_nm3_work+0x2c>
movl   $0x1,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ls_costN_nm3_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 1, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 1, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}