xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EACCES;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int unlink(const char *p) {
  fprintf(stderr,
          "try unlink %s"
          "\n",
          p);
  errno = EACCES;
  return -1;
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
mov    0x2e8b(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
push   %rax
mov    %rdi,%rdx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    0x2e97(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"try unlink %s\0A\00"
@EACCES = global i32 0
@errno = global i32 0
define i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EACCES
store i32 %6, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"try unlink %s\0A\00"
@EACCES = global i32 0
@errno = global i32 0
define i32 @unlink(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EACCES
store i32 %4, i32* @errno
ret i32 -1
}
void LockMagickMutex(void) {}


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

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

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

LLVM IR (-O2):
define void @LockMagickMutex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void err_exit(int n) {
  printf("SSTL_c error %d\n", n);
  exit(n);
}


x86 assembly (clang, -O0):
<err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_exit>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"SSTL_c error %d\0A\00"
define void @err_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"SSTL_c error %d\0A\00"
define void @err_exit(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int fgetbit(FILE *f, int x) {
  static int buf = 0;
  static int shi = 1;
  if (shi == 1 || x) {
    buf = fgetc(f);
    shi = 0x80;
  } else
    shi >>= 1;
  return (buf & shi) ? 1 : 0;
}


x86 assembly (clang, -O0):
<fgetbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,0x2f02(%rip)
je     1136 <fgetbit+0x26>
cmpl   $0x0,-0xc(%rbp)
je     1154 <fgetbit+0x44>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,0x2eeb(%rip)
movl   $0x80,0x2ed9(%rip)
jmp    1163 <fgetbit+0x53>
mov    0x2ece(%rip),%eax
sar    $0x1,%eax
mov    %eax,0x2ec5(%rip)
mov    0x2ec7(%rip),%edx
and    0x2eb9(%rip),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetbit>:
push   %rax
test   %esi,%esi
jne    112a <fgetbit+0x1a>
mov    0x2f0d(%rip),%edx
cmp    $0x1,%edx
je     112a <fgetbit+0x1a>
sar    %edx
mov    0x2f08(%rip),%eax
jmp    113a <fgetbit+0x2a>
call   1030 <fgetc@plt>
mov    %eax,0x2efb(%rip)
mov    $0x80,%edx
mov    %edx,0x2ee8(%rip)
xor    %ecx,%ecx
test   %edx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@fgetbit.buf = internal global i32 0
@fgetbit.shi = internal global i32 1
define i32 @fgetbit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @fgetbit.shi
%6 = icmp eq i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7, %2
%11 = load i32*, i32** %3
%12 = call i32 @fgetc(i32* %11)
store i32 %12, i32* @fgetbit.buf
store i32 128, i32* @fgetbit.shi
br label %16
13: ; preds = %7
%14 = load i32, i32* @fgetbit.shi
%15 = ashr i32 %14, 1
store i32 %15, i32* @fgetbit.shi
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* @fgetbit.buf
%18 = load i32, i32* @fgetbit.shi
%19 = and i32 %17, %18
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
ret i32 %22
}

LLVM IR (-O2):
@fgetbit.buf = internal unnamed_addr global i32 0
@fgetbit.shi = internal unnamed_addr global i32 1
define i32 @fgetbit(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* @fgetbit.shi
%4 = icmp eq i32 %3, 1
%5 = icmp ne i32 %1, 0
%6 = or i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @fgetc(i32* %0)
store i32 %8, i32* @fgetbit.buf
br label %12
9: ; preds = %2
%10 = ashr i32 %3, 1
%11 = load i32, i32* @fgetbit.buf
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ %11, %9 ], [ %8, %7 ]
%14 = phi i32 [ %10, %9 ], [ 128, %7 ]
store i32 %14, i32* @fgetbit.shi
%15 = and i32 %13, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}
int right_child(int parent) { return (2 * parent + 1); }


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

x86 assembly (clang, -O2):
<right_child>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @right_child(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Type definitions */
struct td {
  int dummy;
};
struct ohci {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct td *);
void td_free(struct ohci *hc, struct td *td) { kfree(td); }


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

x86 assembly (clang, -O2):
<td_free>:
mov    %rsi,%rdi
jmp    1030 <kfree@plt>

LLVM IR (-O0):
%struct.ohci = type { i32 }
%struct.td = type { i32 }
define void @td_free(%struct.ohci* %0, %struct.td* %1) {
%3 = alloca %struct.ohci*
%4 = alloca %struct.td*
store %struct.ohci* %0, %struct.ohci** %3
store %struct.td* %1, %struct.td** %4
%5 = load %struct.td*, %struct.td** %4
%6 = call i32 @kfree(%struct.td* %5)
ret void
}

LLVM IR (-O2):
%struct.ohci = type { i32 }
%struct.td = type { i32 }
define void @td_free(%struct.ohci* nocapture readnone %0, %struct.td* %1) {
%3 = tail call i32 @kfree(%struct.td* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ argz_delete(char **, size_t *, char *);
char *envz_entry(char *, size_t, char const *);
void envz_remove(char **envz, size_t *envz_len, const char *name) {
  char *entry = envz_entry(*envz, *envz_len, name);
  if (entry)
    argz_delete(envz, envz_len, entry);
}


x86 assembly (clang, -O0):
<envz_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <envz_entry@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116b <envz_remove+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <argz_delete@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<envz_remove>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1040 <envz_entry@plt>
test   %rax,%rax
je     114f <envz_remove+0x2f>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <argz_delete@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @envz_remove(i8** %0, i64* %1, i8* %2) {
%4 = load i8*, i8** %0
%5 = load i64, i64* %1
%6 = tail call i8* @envz_entry(i8* %4, i64 %5, i8* %2)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @argz_delete(i8** %0, i64* %1, i8* %6)
br label %10
10: ; preds = %8, %3
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *arg_value(const char *arg) {
  const char *delimiter = strrchr(arg, '=');
  if (delimiter)
    return ++delimiter;
  return NULL;
}


x86 assembly (clang, -O0):
<arg_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114e <arg_value+0x3e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1156 <arg_value+0x46>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_value>:
push   %rax
mov    $0x3d,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @arg_value(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 61)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
store i8* %11, i8** %2
br label %13
12: ; preds = %1
store i8* null, i8** %2
br label %13
13: ; preds = %12, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @arg_value(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 61)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}
double minlin(double x, double x0, double dx, double y0) {
  double Fangle(double x);
  return (y0 + dx * Fangle((x - x0) / dx));
}


x86 assembly (clang, -O0):
<minlin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1030 <Fangle@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minlin>:
sub    $0x18,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
call   1030 <Fangle@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @minlin(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %8
%10 = load double, double* %7
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fsub double %11, %12
%14 = load double, double* %7
%15 = fdiv double %13, %14
%16 = call double @Fangle(double %15)
%17 = call double @llvm.fmuladd.f64(double %10, double %16, double %9)
ret double %17
}

LLVM IR (-O2):
define double @minlin(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %1
%6 = fdiv double %5, %2
%7 = tail call double @Fangle(double %6)
%8 = tail call double @llvm.fmuladd.f64(double %2, double %7, double %3)
ret double %8
}
int test_imm_96uint8_reg(unsigned char val) {
  return ((val) & (0x96 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_96uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x96,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_96uint8_reg>:
test   $0x96,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_96uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 150
%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_96uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -106
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *complete_path(char *path) { return path; }


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

x86 assembly (clang, -O2):
<complete_path>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @complete_path(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
char *strrchr(char const *, int);
char *BaseName(const char *pathname) {
  register const char *base;
  base = strrchr(pathname, 1024);
  if (base++ == "")
    base = pathname;
  return ((char *)base);
}


x86 assembly (clang, -O0):
<BaseName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x400,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xebc(%rip),%rcx
cmp    %rcx,%rax
jne    1155 <BaseName+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BaseName>:
push   %rbx
mov    %rdi,%rbx
mov    $0x400,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
lea    0xed7(%rip),%rdx
cmp    %rdx,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @BaseName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i32 1024)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
%8 = icmp eq i8* %6, getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %2
store i8* %10, i8** %3
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @BaseName(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 1024)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = icmp eq i8* %2, getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%5 = select i1 %4, i8* %0, i8* %3
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int tbLogRateLoss(double sendtstamp, double timestamp, int size,
                  unsigned long seq, unsigned long maxseq,
                  unsigned long *lastseq, unsigned long *totrecvd,
                  double *lastbucket, int *bucketbytes, FILE *fp) {
  return 0;
}


x86 assembly (clang, -O0):
<tbLogRateLoss>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tbLogRateLoss(double %0, double %1, i32 %2, i64 %3, i64 %4, i64* %5, i64* %6, double* %7, i32* %8, i32* %9) {
%11 = alloca double
%12 = alloca double
%13 = alloca i32
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64*
%17 = alloca i64*
%18 = alloca double*
%19 = alloca i32*
%20 = alloca i32*
store double %0, double* %11
store double %1, double* %12
store i32 %2, i32* %13
store i64 %3, i64* %14
store i64 %4, i64* %15
store i64* %5, i64** %16
store i64* %6, i64** %17
store double* %7, double** %18
store i32* %8, i32** %19
store i32* %9, i32** %20
ret i32 0
}

LLVM IR (-O2):
define i32 @tbLogRateLoss(double %0, double %1, i32 %2, i64 %3, i64 %4, i64* nocapture readnone %5, i64* nocapture readnone %6, double* nocapture readnone %7, i32* nocapture readnone %8, i32* nocapture readnone %9) {
ret i32 0
}
int IsNumber(int ch) { return (ch >= 48 && ch <= 57); }


x86 assembly (clang, -O0):
<IsNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <IsNumber+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsNumber>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @IsNumber(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @IsNumber(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
char *ptime(void) {
  char *tmstr;
  time_t mytime;
  mytime = time(0);
  tmstr = asctime(localtime(&mytime));
  *(tmstr + strlen(tmstr) - 1) = '\0';
  return tmstr;
}


x86 assembly (clang, -O0):
<ptime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1050 <asctime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptime>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1050 <asctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ptime() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 @time(i32 0)
store i32 %3, i32* %2
%4 = call i32 @localtime(i32* %2)
%5 = call i8* @asctime(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = load i8*, i8** %1
%8 = call i32 @strlen(i8* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 -1
store i8 0, i8* %11
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
define i8* @ptime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32 0)
store i32 %3, i32* %1
%4 = call i32 @localtime(i32* %1)
%5 = call i8* @asctime(i32 %4)
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = getelementptr inbounds i8, i8* %8, i64 -1
store i8 0, i8* %9
ret i8* %5
}
int test_imm_C6int32_mem(int *val) {
  return ((*val) & (0xC6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C6int32_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, 198
%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_C6int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 198
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int sendInteger(int, int);
void onTestConnectionRequest(int socketfd) {
  if (sendInteger(socketfd, 1) == -1)
    perror("send indexing result status");
}


x86 assembly (clang, -O0):
<onTestConnectionRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <sendInteger@plt>
cmp    $0xffffffff,%eax
jne    114d <onTestConnectionRequest+0x2d>
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onTestConnectionRequest>:
push   %rax
mov    $0x1,%esi
call   1030 <sendInteger@plt>
cmp    $0xffffffff,%eax
je     1132 <onTestConnectionRequest+0x12>
pop    %rax
ret
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"send indexing result status\00"
define void @onTestConnectionRequest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sendInteger(i32 %3, i32 1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"send indexing result status\00"
define void @onTestConnectionRequest(i32 %0) {
%2 = tail call i32 @sendInteger(i32 %0, i32 1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
int isalpha(int c) { return (((unsigned)c | 32) - 'a' < 26); }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x20,%eax
sub    $0x61,%eax
cmp    $0x1a,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
or     $0x20,%edi
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, 32
%5 = sub i32 %4, 97
%6 = icmp ult i32 %5, 26
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = or i32 %0, 32
%3 = add i32 %2, -97
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
double calculate_acceleration_m_sec(double init_velocity, double final_velocity,
                                    double amount_time) {
  double acceleration = 0.0;
  acceleration = ((final_velocity - init_velocity) * (1608.0 / 3600.0)) /
                 (amount_time * 60.0);
  return acceleration;
}


x86 assembly (clang, -O0):
<calculate_acceleration_m_sec>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xedb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec7(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_acceleration_m_sec>:
subsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm1
mulsd  0xef4(%rip),%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calculate_acceleration_m_sec(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
store double 0.000000e+00, double* %7
%8 = load double, double* %5
%9 = load double, double* %4
%10 = fsub double %8, %9
%11 = fmul double %10, 0x3FDC962FC962FC96
%12 = load double, double* %6
%13 = fmul double %12, 6.000000e+01
%14 = fdiv double %11, %13
store double %14, double* %7
%15 = load double, double* %7
ret double %15
}

LLVM IR (-O2):
define double @calculate_acceleration_m_sec(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = fmul double %4, 0x3FDC962FC962FC96
%6 = fmul double %2, 6.000000e+01
%7 = fdiv double %5, %6
ret double %7
}
/* Variables and functions */
int atoi(char *);
char *strchr(char *, char);
void get2args(char *args, int *a1, int *a2) {
  char *tmp;
  *a1 = atoi(args);
  tmp = strchr(args, ';');
  if (!tmp)
    *a2 = 0;
  else
    *a2 = atoi(tmp + 1);
}


x86 assembly (clang, -O0):
<get2args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x3b,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1171 <get2args+0x51>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    1186 <get2args+0x66>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get2args>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <atoi@plt>
mov    %eax,(%r15)
mov    %rbx,%rdi
mov    $0x3b,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1156 <get2args+0x36>
add    $0x1,%rax
mov    %rax,%rdi
call   1040 <atoi@plt>
jmp    1158 <get2args+0x38>
xor    %eax,%eax
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @get2args(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = call i32 @atoi(i8* %8)
%10 = load i32*, i32** %5
store i32 %9, i32* %10
%11 = load i8*, i8** %4
%12 = call i8* @strchr(i8* %11, i8 signext 59)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = icmp ne i8* %13, null
br i1 %14, label %17, label %15
15: ; preds = %3
%16 = load i32*, i32** %6
store i32 0, i32* %16
br label %22
17: ; preds = %3
%18 = load i8*, i8** %7
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = call i32 @atoi(i8* %19)
%21 = load i32*, i32** %6
store i32 %20, i32* %21
br label %22
22: ; preds = %17, %15
ret void
}

LLVM IR (-O2):
define void @get2args(i8* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @atoi(i8* %0)
store i32 %4, i32* %1
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 59)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = tail call i32 @atoi(i8* %8)
br label %10
10: ; preds = %3, %7
%11 = phi i32 [ %9, %7 ], [ 0, %3 ]
store i32 %11, i32* %2
ret void
}
/* Variables and functions */
double exp(int /*<<< orphan*/);
int /*<<< orphan*/ ln_comb(unsigned int, unsigned int);
double comb(unsigned int n, unsigned int r) {
  if (r > n)
    return 0;
  if (n == 0 || r == 0 || n == r)
    return 1;
  return exp(ln_comb(n, r));
}


x86 assembly (clang, -O0):
<comb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1147 <comb+0x27>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1190 <comb+0x70>
cmpl   $0x0,-0xc(%rbp)
je     1167 <comb+0x47>
cmpl   $0x0,-0x10(%rbp)
je     1167 <comb+0x47>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1179 <comb+0x59>
movsd  0xe91(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1190 <comb+0x70>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <ln_comb@plt>
mov    %eax,%edi
call   1040 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comb>:
push   %rax
xorps  %xmm0,%xmm0
cmp    %edi,%esi
jbe    112a <comb+0xa>
pop    %rax
ret
movsd  0xece(%rip),%xmm0
je     1128 <comb+0x8>
test   %edi,%edi
je     1128 <comb+0x8>
test   %esi,%esi
je     1128 <comb+0x8>
call   1030 <ln_comb@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <exp@plt>

LLVM IR (-O0):
define double @comb(i32 %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = icmp ugt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store double 0.000000e+00, double* %3
br label %26
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %13
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16, %13, %10
store double 1.000000e+00, double* %3
br label %26
21: ; preds = %16
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = call i32 @ln_comb(i32 %22, i32 %23)
%25 = call double @exp(i32 %24)
store double %25, double* %3
br label %26
26: ; preds = %21, %20, %9
%27 = load double, double* %3
ret double %27
}

LLVM IR (-O2):
define double @comb(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, %0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, 0
%6 = icmp eq i32 %1, 0
%7 = or i1 %5, %6
%8 = icmp eq i32 %0, %1
%9 = or i1 %8, %7
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @ln_comb(i32 %0, i32 %1)
%12 = tail call double @exp(i32 %11)
br label %13
13: ; preds = %4, %2, %10
%14 = phi double [ %12, %10 ], [ 0.000000e+00, %2 ], [ 1.000000e+00, %4 ]
ret double %14
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int __api(int, unsigned long);
int rt_run(struct timeval *tv) {
  unsigned long ms = tv->tv_sec * 1000 + tv->tv_usec / 1000;
  return (__api(3, ms) == 1) ? 0 : 1;
}


x86 assembly (clang, -O0):
<rt_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x3,%edi
call   1030 <__api@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_run>:
push   %rax
movslq (%rdi),%rax
imul   $0x3e8,%rax,%rax
movslq 0x4(%rdi),%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
movslq %ecx,%rsi
add    %rax,%rsi
mov    $0x3,%edi
call   1030 <__api@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @rt_run(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca i64
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %7, %11
%13 = sext i32 %12 to i64
store i64 %13, i64* %3
%14 = load i64, i64* %3
%15 = call i32 @__api(i32 3, i64 %14)
%16 = icmp eq i32 %15, 1
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 1
ret i32 %18
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @rt_run(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000
%8 = add nsw i32 %7, %4
%9 = sext i32 %8 to i64
%10 = tail call i32 @__api(i32 3, i64 %9)
%11 = icmp ne i32 %10, 1
%12 = zext i1 %11 to i32
ret i32 %12
}
int is_up(int key) { return key == 0x415b1b; }


x86 assembly (clang, -O0):
<is_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x415b1b,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_up>:
xor    %eax,%eax
cmp    $0x415b1b,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_up(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 4283163
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_up(i32 %0) {
%2 = icmp eq i32 %0, 4283163
%3 = zext i1 %2 to i32
ret i32 %3
}
void X509at_add1_attr_by_NID(void) {}


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

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

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

LLVM IR (-O2):
define void @X509at_add1_attr_by_NID() {
ret void
}
/* Variables and functions */
int is_map_symbol_name(char *);
int is_map_symbol_end(char *s) { return is_map_symbol_name(s); }


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

x86 assembly (clang, -O2):
<is_map_symbol_end>:
jmp    1030 <is_map_symbol_name@plt>

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

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

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ print_bit(void *, int);
int /*<<< orphan*/ print_byte(void *, int);
int main(void) {
  float f = 178.125f;
  print_byte((void *)&f, sizeof(f));
  print_bit((void *)&f, sizeof(f));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <print_byte@plt>
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <print_bit@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x43322000,0xc(%rsp)
43
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <print_byte@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <print_bit@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 1.781250e+02, float* %2
%3 = bitcast float* %2 to i8*
%4 = call i32 @print_byte(i8* %3, i32 4)
%5 = bitcast float* %2 to i8*
%6 = call i32 @print_bit(i8* %5, i32 4)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 1.781250e+02, float* %1
%3 = call i32 @print_byte(i8* %2, i32 4)
%4 = call i32 @print_bit(i8* %2, i32 4)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
int test_imm_3Eint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x3E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Eint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 266287972352
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void list_usage(int code) {
  fprintf(stderr,
          "Lists all VM instances managed by honeycomb.\n"
          "\n"
          "Usage: %s list [-v]\n"
          "\n"
          "	-v: Show verbose information about VM instaces\n"
          "\n",
          "hc");
  exit(code);
}


x86 assembly (clang, -O0):
<list_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
lea    0xf33(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<list_usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
lea    0xf3b(%rip),%rdx
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [117 x i8] c"Lists all VM instances managed by honeycomb.\0A\0AUsage: %s list [-v]\0A\0A\09-v: Show verbose information about VM instaces\0A\0A\00"
@.str.1 = [3 x i8] c"hc\00"
define void @list_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [117 x i8] c"Lists all VM instances managed by honeycomb.\0A\0AUsage: %s list [-v]\0A\0A\09-v: Show verbose information about VM instaces\0A\0A\00"
@.str.1 = [3 x i8] c"hc\00"
define void @list_usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateTamperEventsClearNoLock(void) {
  _HibernateWriteComplete();
  (*((volatile uint32_t *)(0x400FC400))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<HibernateTamperEventsClearNoLock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc400,%eax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    $0x400fc400,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateTamperEventsClearNoLock>:
push   %rax
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
orl    $0x10,0x400fc400
10
pop    %rax
ret

LLVM IR (-O0):
define void @HibernateTamperEventsClearNoLock() {
%1 = call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i32, i32* inttoptr (i64 1074775040 to i32*)
%3 = or i32 %2, 16
store volatile i32 %3, i32* inttoptr (i64 1074775040 to i32*)
ret void
}

LLVM IR (-O2):
define void @HibernateTamperEventsClearNoLock() {
%1 = tail call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i32, i32* inttoptr (i64 1074775040 to i32*)
%3 = or i32 %2, 16
store volatile i32 %3, i32* inttoptr (i64 1074775040 to i32*)
ret void
}
/* Variables and functions */
char *memmove(char *, char const *, int);
char *bcopy(const char *src, char *dest, int count) {
  return memmove(dest, src, count);
}


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

x86 assembly (clang, -O2):
<bcopy>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define i8* @bcopy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = call i8* @memmove(i8* %7, i8* %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @bcopy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @memmove(i8* %1, i8* %0, i32 %2)
ret i8* %4
}
OP(ed, dc) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
void disable_interrupts() { asm volatile("cli"); }


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

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

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

LLVM IR (-O2):
define void @disable_interrupts() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
char const *remote_l1();
const char *call_remote_l1(void) { return remote_l1() + 1; }


x86 assembly (clang, -O0):
<call_remote_l1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <remote_l1@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_remote_l1>:
push   %rax
xor    %eax,%eax
call   1030 <remote_l1@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_remote_l1() {
%1 = call i8* (...) @remote_l1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_remote_l1() {
%1 = tail call i8* (...) @remote_l1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_program_get_versions_from_tarball() {
  printf("test_program_get_versions_from_tarball...");
  printf("Ok\n");
}


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

x86 assembly (clang, -O2):
<test_program_get_versions_from_tarball>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xef6(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [42 x i8] c"test_program_get_versions_from_tarball...\00"
@str = [3 x i8] c"Ok\00"
define void @test_program_get_versions_from_tarball() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stest(int);
int /*<<< orphan*/ utest(int);
int main() {
  utest(9);
  utest(0);
  stest(9);
  stest(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1040 <utest@plt>
xor    %edi,%edi
call   1040 <utest@plt>
mov    $0x9,%edi
call   1030 <stest@plt>
xor    %edi,%edi
call   1030 <stest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @utest(i32 9)
%3 = call i32 @utest(i32 0)
%4 = call i32 @stest(i32 9)
%5 = call i32 @stest(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @utest(i32 9)
%2 = tail call i32 @utest(i32 0)
%3 = tail call i32 @stest(i32 9)
%4 = tail call i32 @stest(i32 0)
ret i32 0
}
char *langDbgMemYmf278() { return "YMF278 Sample RAM"; }


x86 assembly (clang, -O0):
<langDbgMemYmf278>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgMemYmf278>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"YMF278 Sample RAM\00"
define i8* @langDbgMemYmf278() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"YMF278 Sample RAM\00"
define i8* @langDbgMemYmf278() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ XtPointer;
typedef int /*<<< orphan*/ XtIntervalId;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void time_out(XtPointer client_data, XtIntervalId *iid) { exit(0); }


x86 assembly (clang, -O0):
<time_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<time_out>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @time_out(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @time_out(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}