xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ MD5_CTX;

/* Variables and functions */
int /*<<< orphan*/ MD5_Final(unsigned char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Update(int /*<<< orphan*/ *, char const *,
                              int /*<<< orphan*/);
unsigned char *calloc(int, int);
int /*<<< orphan*/ strlen(char const *);
unsigned char *md(const char *s) {
  MD5_CTX c;
  MD5_Init(&c);
  MD5_Update(&c, s, strlen(s));
  unsigned char *d = calloc(16, sizeof(unsigned char));
  MD5_Final(d, &c);
  return d;
}


x86 assembly (clang, -O0):
<md>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1060 <MD5_Init@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    -0xc(%rbp),%rdi
call   1070 <MD5_Update@plt>
mov    $0x10,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <MD5_Final@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1060 <MD5_Init@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1070 <MD5_Update@plt>
mov    $0x10,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <MD5_Final@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @md(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i32 @MD5_Init(i32* %3)
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @MD5_Update(i32* %3, i8* %6, i32 %8)
%10 = call i8* @calloc(i32 16, i32 1)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @MD5_Final(i8* %11, i32* %3)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @md(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @MD5_Init(i32* %2)
%5 = call i32 @strlen(i8* %0)
%6 = call i32 @MD5_Update(i32* %2, i8* %0, i32 %5)
%7 = call dereferenceable_or_null(16) i8* @calloc(i32 16, i32 1)
%8 = call i32 @MD5_Final(i8* %7, i32* %2)
ret i8* %7
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dsvariance(int, int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dsvariance(N, 1, x, stride);
  printf("sample variance: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%ecx
mov    $0x1,%esi
call   1040 <stdlib_strided_dsvariance@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1040 <stdlib_strided_dsvariance@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [22 x i8] c"sample variance: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dsvariance(i32 %6, i32 1, float* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [22 x i8] c"sample variance: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dsvariance(i32 4, i32 1, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
void f() { extern int g(int, int); }


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
double f4_sum_pre_double_double_double_double_float(double v0, double v1,
                                                    double v2, double v3,
                                                    float v) {
  return v0 + v1 + v2 + v3 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_double_double_double_double_float>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movss  %xmm4,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_double_double_double_double_float>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm4,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_double_double_double_double_float(double %0, double %1, double %2, double %3, float %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca float
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store float %4, float* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fadd double %11, %12
%14 = load double, double* %8
%15 = fadd double %13, %14
%16 = load double, double* %9
%17 = fadd double %15, %16
%18 = load float, float* %10
%19 = fpext float %18 to double
%20 = fadd double %17, %19
ret double %20
}

LLVM IR (-O2):
define double @f4_sum_pre_double_double_double_double_float(double %0, double %1, double %2, double %3, float %4) {
%6 = fadd double %0, %1
%7 = fadd double %6, %2
%8 = fadd double %7, %3
%9 = fpext float %4 to double
%10 = fadd double %8, %9
ret double %10
}
/* Variables and functions */
int mkdir(char const *, int);
int common_mkdir(const char *dirname, int mode) { return mkdir(dirname, mode); }


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

x86 assembly (clang, -O2):
<common_mkdir>:
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define i32 @common_mkdir(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @mkdir(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
void printBase62(unsigned long long n) {
  const char base[] =
      "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  if (n / 62 > 0)
    printBase62(n / 62);
  putchar(base[n % 62]);
}


x86 assembly (clang, -O0):
<printBase62>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x3f,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    $0x3e,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rax
jbe    117f <printBase62+0x4f>
mov    -0x8(%rbp),%rax
mov    $0x3e,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
call   1040 <printBase62@plt>
mov    -0x8(%rbp),%rax
mov    $0x3e,%ecx
xor    %edx,%edx
div    %rcx
movsbl -0x50(%rbp,%rdx,1),%edi
call   1030 <putchar@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBase62>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movabs $0x8421084210842109,%r14
08 21 84
cmp    $0x3e,%rdi
jb     114c <printBase62+0x2c>
mov    %rbx,%rax
shr    %rax
mul    %r14
mov    %rdx,%rdi
shr    $0x4,%rdi
call   1040 <printBase62@plt>
mov    %rbx,%rax
shr    %rax
mul    %r14
shr    $0x4,%rdx
mov    %rdx,%rax
shl    $0x6,%rax
mov    %rdx,%rcx
sub    %rax,%rcx
add    %rdx,%rcx
add    %rbx,%rcx
lea    0xe8d(%rip),%rax
movsbl (%rax,%rcx,1),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__const.printBase62.base = [63 x i8] c"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define void @printBase62(i64 %0) {
%2 = alloca i64
%3 = alloca [63 x i8]
store i64 %0, i64* %2
%4 = bitcast [63 x i8]* %3 to i8*
%5 = load i64, i64* %2
%6 = udiv i64 %5, 62
%7 = icmp ugt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = udiv i64 %9, 62
br label %11
11: ; preds = %8, %1
%12 = load i64, i64* %2
%13 = urem i64 %12, 62
%14 = getelementptr inbounds [63 x i8], [63 x i8]* %3, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @putchar(i8 signext %15)
ret void
}

LLVM IR (-O2):
@__const.printBase62.base = [63 x i8] c"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define void @printBase62(i64 %0) {
%2 = icmp ult i64 %0, 62
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = udiv i64 %0, 62
tail call void @printBase62(i64 %4)
br label %5
5: ; preds = %3, %1
%6 = urem i64 %0, 62
%7 = getelementptr inbounds [63 x i8], [63 x i8]* @__const.printBase62.base, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @putchar(i8 signext %8)
ret void
}
/* Variables and functions */
int m_create(int, int);
int /*<<< orphan*/ m_putc(int, int /*<<< orphan*/);
int s_new(void) {
  int m = m_create(10, 1);
  m_putc(m, 0);
  return m;
}


x86 assembly (clang, -O0):
<s_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
mov    $0x1,%esi
call   1040 <m_create@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <m_putc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_new>:
push   %rbx
mov    $0xa,%edi
mov    $0x1,%esi
call   1040 <m_create@plt>
mov    %eax,%ebx
mov    %eax,%edi
xor    %esi,%esi
call   1030 <m_putc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @s_new() {
%1 = alloca i32
%2 = call i32 @m_create(i32 10, i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @m_putc(i32 %3, i32 0)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @s_new() {
%1 = tail call i32 @m_create(i32 10, i32 1)
%2 = tail call i32 @m_putc(i32 %1, i32 0)
ret i32 %1
}
int fileagrep_init(argc, argv, pattern_len, pattern_buffer)
int argc;
char *argv[];
int pattern_len;
char *pattern_buffer;
{ return (agrep_init(argc, argv, 3, pattern_len, pattern_buffer)); }


x86 assembly (clang, -O0):
<fileagrep_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    $0x3,%edx
mov    $0x0,%al
call   1030 <agrep_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileagrep_init>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    $0x3,%edx
xor    %eax,%eax
jmp    1030 <agrep_init@plt>

LLVM IR (-O0):
define i32 @fileagrep_init(i32 %0, i8** %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i8**, i8*** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 (i32, i8**, i32, i32, i8*, ...) bitcast (i32 (...)* @agrep_init to i32 (i32, i8**, i32, i32, i8*, ...)*)(i32 %9, i8** %10, i32 3, i32 %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @fileagrep_init(i32 %0, i8** %1, i32 %2, i8* %3) {
%5 = tail call i32 (i32, i8**, i32, i32, i8*, ...) bitcast (i32 (...)* @agrep_init to i32 (i32, i8**, i32, i32, i8*, ...)*)(i32 %0, i8** %1, i32 3, i32 %2, i8* %3)
ret i32 %5
}
int cputest_sse2(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @cputest_sse2() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "mkhdimage [-h <heads>] [-s <sectors>] [-c|-t <cylinders>]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"mkhdimage [-h <heads>] [-s <sectors>] [-c|-t <cylinders>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"mkhdimage [-h <heads>] [-s <sectors>] [-c|-t <cylinders>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void yh_c_buffer_free(void *p) { free(p); }


x86 assembly (clang, -O0):
<yh_c_buffer_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):
<yh_c_buffer_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @yh_c_buffer_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 @yh_c_buffer_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void fputs_timedate(FILE *fp) {
  char s[25];
  time_t t;
  t = time(NULL);
  struct tm *p = localtime(&t);
  strftime(s, 25, "%c", p);
  fputs(s, fp);
}


x86 assembly (clang, -O0):
<fputs_timedate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x34(%rbp)
lea    -0x34(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x40(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%rcx
mov    $0x19,%esi
lea    0xe87(%rip),%rdx
call   1060 <strftime@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs_timedate>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%r14
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe9a(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x19,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fputs@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%c\00"
define void @fputs_timedate(i32* %0) {
%2 = alloca i32*
%3 = alloca [25 x i8]
%4 = alloca i32
%5 = alloca %struct.tm*
store i32* %0, i32** %2
%6 = call i32 @time(i32* null)
store i32 %6, i32* %4
%7 = call %struct.tm* @localtime(i32* %4)
store %struct.tm* %7, %struct.tm** %5
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%9 = load %struct.tm*, %struct.tm** %5
%10 = call i32 @strftime(i8* %8, i32 25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %9)
%11 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%12 = load i32*, i32** %2
%13 = call i32 @fputs(i8* %11, i32* %12)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%c\00"
define void @fputs_timedate(i32* nocapture %0) {
%2 = alloca [25 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @time(i32* null)
store i32 %6, i32* %3
%7 = call %struct.tm* @localtime(i32* %3)
%8 = call i32 @strftime(i8* %4, i32 25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %7)
%9 = call i32 @fputs(i8* %4, i32* %0)
ret void
}
double no_crash_reinterpret_double_as_sym_ptr(double a, void *b) {
  *(void **)&a = b;
  return a * a;
}


x86 assembly (clang, -O0):
<no_crash_reinterpret_double_as_sym_ptr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_crash_reinterpret_double_as_sym_ptr>:
movq   %rdi,%xmm0
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @no_crash_reinterpret_double_as_sym_ptr(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast double* %3 to i8**
store i8* %5, i8** %6
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @no_crash_reinterpret_double_as_sym_ptr(double %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = bitcast i64 %3 to double
%5 = fmul double %4, %4
ret double %5
}
/* Variables and functions */
double floor(double);
double limit_zero2one(double value) {
  double limited;
  limited = value - floor(value);
  if (limited < 0)
    limited += 1.0;
  return limited;
}


x86 assembly (clang, -O0):
<limit_zero2one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1162 <limit_zero2one+0x52>
movsd  0xea8(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limit_zero2one>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
call   1030 <floor@plt>
movapd (%rsp),%xmm3
subsd  %xmm0,%xmm3
movsd  0xed1(%rip),%xmm1
addsd  %xmm3,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm3,%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm3,%xmm0
orpd   %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @limit_zero2one(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.floor.f64(double %5)
%7 = fsub double %4, %6
store double %7, double* %3
%8 = load double, double* %3
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load double, double* %3
%12 = fadd double %11, 1.000000e+00
store double %12, double* %3
br label %13
13: ; preds = %10, %1
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @limit_zero2one(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fsub double %0, %2
%4 = fcmp olt double %3, 0.000000e+00
%5 = fadd double %3, 1.000000e+00
%6 = select i1 %4, double %5, double %3
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ strstr_test1();
int main() {
  strstr_test1();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @strstr_test1()
ret i32 0
}
OP(fd, ef) {
  illegal_1();
  op_ef();
}


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_1@plt>
mov    $0x0,%al
call   1040 <op_ef@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_ef@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_1()
%7 = call i32 (...) @op_ef()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ef()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_userlist_callback(uint32_t user_id, char *name, char *last_seen,
                              int32_t last_channel, void *user_data) {
  printf("userlist_callback\n");
}


x86 assembly (clang, -O0):
<mumble_userlist_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"userlist_callback\0A\00"
define void @mumble_userlist_callback(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"userlist_callback\00"
define void @mumble_userlist_callback(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fabs(double);
double log(int);
double tauPDF(double r) {
  if ((r > 1) || (r < 0))
    r = 1. / fabs(r);
  ;
  return -log(1. - r);
}


x86 assembly (clang, -O0):
<tauPDF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1152 <tauPDF+0x32>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1171 <tauPDF+0x51>
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe98(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe87(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tauPDF>:
push   %rax
ucomisd 0xed7(%rip),%xmm0
ja     1135 <tauPDF+0x15>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    114d <tauPDF+0x2d>
call   1030 <fabs@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xeb7(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <log@plt>
xorpd  0xea6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tauPDF(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 1.000000e+00
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load double, double* %2
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %5, %1
%9 = load double, double* %2
%10 = call i32 @fabs(double %9)
%11 = sitofp i32 %10 to double
%12 = fdiv double 1.000000e+00, %11
store double %12, double* %2
br label %13
13: ; preds = %8, %5
%14 = load double, double* %2
%15 = fsub double 1.000000e+00, %14
%16 = fptosi double %15 to i32
%17 = call double @log(i32 %16)
%18 = fneg double %17
ret double %18
}

LLVM IR (-O2):
define double @tauPDF(double %0) {
%2 = fcmp ogt double %0, 1.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = or i1 %2, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @fabs(double %0)
%7 = sitofp i32 %6 to double
%8 = fdiv double 1.000000e+00, %7
br label %9
9: ; preds = %1, %5
%10 = phi double [ %8, %5 ], [ %0, %1 ]
%11 = fsub double 1.000000e+00, %10
%12 = fptosi double %11 to i32
%13 = tail call double @log(i32 %12)
%14 = fneg double %13
ret double %14
}
void byte2hex(unsigned char c, char s[2]) {
  int low, high;
  static char slots[] = "0123456789ABCDEF";
  s[0] = 0;
  s[1] = 0;
  low = c % 16;
  high = (c / 16) % 16;
  s[0] = slots[low];
  s[1] = slots[high];
}


x86 assembly (clang, -O0):
<byte2hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
movzbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
movslq -0x14(%rbp),%rcx
lea    0x2ee2(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movslq -0x18(%rbp),%rcx
lea    0x2ece(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte2hex>:
mov    %edi,%eax
mov    %eax,%ecx
and    $0xf,%ecx
shr    $0x4,%rax
lea    0xeee(%rip),%rdx
mov    (%rcx,%rdx,1),%cl
mov    %cl,(%rsi)
mov    (%rax,%rdx,1),%al
mov    %al,0x1(%rsi)
ret

LLVM IR (-O0):
@byte2hex.slots = internal global [17 x i8] c"0123456789ABCDEF\00"
define void @byte2hex(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 0, i8* %8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 0, i8* %10
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = srem i32 %12, 16
store i32 %13, i32* %5
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = sdiv i32 %15, 16
%17 = srem i32 %16, 16
store i32 %17, i32* %6
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [17 x i8], [17 x i8]* @byte2hex.slots, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 %21, i8* %23
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [17 x i8], [17 x i8]* @byte2hex.slots, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 1
store i8 %27, i8* %29
ret void
}

LLVM IR (-O2):
@byte2hex.slots = internal unnamed_addr constant [17 x i8] c"0123456789ABCDEF\00"
define void @byte2hex(i8 zeroext %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = zext i8 %0 to i32
%5 = and i32 %4, 15
%6 = lshr i32 %4, 4
%7 = zext i32 %5 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* @byte2hex.slots, i64 0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %1
%10 = zext i32 %6 to i64
%11 = getelementptr inbounds [17 x i8], [17 x i8]* @byte2hex.slots, i64 0, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %3
ret void
}
int CHECK_TEST(unsigned char v) { return v == 0xf6 || v == 0xf7; }


x86 assembly (clang, -O0):
<CHECK_TEST>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xf6,%ecx
mov    %al,-0x2(%rbp)
je     112e <CHECK_TEST+0x2e>
movzbl -0x1(%rbp),%eax
cmp    $0xf7,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CHECK_TEST>:
and    $0xfe,%dil
xor    %eax,%eax
cmp    $0xf6,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @CHECK_TEST(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 246
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 247
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @CHECK_TEST(i8 zeroext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, -10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Z_FreeTags(int, int);
void ST_UnloadGraphics(void) { Z_FreeTags(13, 13); }


x86 assembly (clang, -O0):
<ST_UnloadGraphics>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%esi
mov    %esi,%edi
call   1030 <Z_FreeTags@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ST_UnloadGraphics() {
%1 = call i32 @Z_FreeTags(i32 13, i32 13)
ret void
}

LLVM IR (-O2):
define void @ST_UnloadGraphics() {
%1 = tail call i32 @Z_FreeTags(i32 13, i32 13)
ret void
}
/* Variables and functions */
long double powl(long double, double);
long double sqrtl(long double x) { return powl(x, 0.5); }


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

x86 assembly (clang, -O2):
<sqrtl>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <powl@plt>

LLVM IR (-O0):
define x86_fp80 @sqrtl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @powl(x86_fp80 %3, double 5.000000e-01)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @sqrtl(x86_fp80 %0) {
%2 = tail call x86_fp80 @powl(x86_fp80 %0, double 5.000000e-01)
ret x86_fp80 %2
}
__attribute__((always_)) int pci_proc_domain(struct pci_bus *bus) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pci_bus = type opaque
define i32 @pci_proc_domain(%struct.pci_bus* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay();
int main(void) {
  int i;
  volatile unsigned char *ledoff = ((volatile unsigned char *)0xD4000008);
  volatile unsigned char *ledon = ((volatile unsigned char *)0xD400000C);
  for (i = 0; i < 10000; i++) {
    *ledon = 0x30;
    delay();
    *ledoff = 0x30;
    delay();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xd4000008,%eax
mov    %rax,-0x10(%rbp)
mov    $0xd400000c,%eax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    116f <main+0x5f>
mov    -0x18(%rbp),%rax
movb   $0x30,(%rax)
mov    $0x0,%al
call   1030 <delay@plt>
mov    -0x10(%rbp),%rax
movb   $0x30,(%rax)
mov    $0x0,%al
call   1030 <delay@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <main+0x28>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2710,%ebx
mov    $0xd4000008,%r14d
nop
movb   $0x30,0x4(%r14)
xor    %eax,%eax
call   1030 <delay@plt>
movb   $0x30,(%r14)
xor    %eax,%eax
call   1030 <delay@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
store i8* inttoptr (i64 3556769800 to i8*), i8** %3
store i8* inttoptr (i64 3556769804 to i8*), i8** %4
store i32 0, i32* %2
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10000
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i8*, i8** %4
store volatile i8 48, i8* %9
%10 = call i32 (...) @delay()
%11 = load i8*, i8** %3
store volatile i8 48, i8* %11
%12 = call i32 (...) @delay()
br label %13
13: ; preds = %8
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %5
16: ; preds = %5
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
store volatile i8 48, i8* inttoptr (i64 3556769804 to i8*)
%3 = tail call i32 (...) @delay()
store volatile i8 48, i8* inttoptr (i64 3556769800 to i8*)
%4 = tail call i32 (...) @delay()
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 10000
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fldl2e() {
  db(0xD9);
  db(0xEA);
}


x86 assembly (clang, -O0):
<fldl2e>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xea,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fldl2e>:
push   %rax
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xea,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fldl2e() {
%1 = call i32 @db(i32 217)
%2 = call i32 @db(i32 234)
ret void
}

LLVM IR (-O2):
define void @fldl2e() {
%1 = tail call i32 @db(i32 217)
%2 = tail call i32 @db(i32 234)
ret void
}
unsigned xrop3_245_1_1(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;
  stk2 = ~D;
  stk1 = T | stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_245_1_1>:
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,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_245_1_1(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 %5, -256
%8 = or i32 %6, %4
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = or i8 %1, %0
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
ret i32 %13
}
int socket_v_abi(void) { return 0x20161213; }


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

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

LLVM IR (-O0):
define i32 @socket_v_abi() {
ret i32 538317331
}

LLVM IR (-O2):
define i32 @socket_v_abi() {
ret i32 538317331
}
/* Type definitions */
struct usb_endpoint_descriptor {
  int dummy;
};

/* Variables and functions */
scalar_t__ usb_endpoint_dir_in(struct usb_endpoint_descriptor const *);
scalar_t__ usb_endpoint_xfer_int(struct usb_endpoint_descriptor const *);
int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) {
  return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd));
}


x86 assembly (clang, -O0):
<usb_endpoint_is_int_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <usb_endpoint_xfer_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115a <usb_endpoint_is_int_in+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <usb_endpoint_dir_in@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_endpoint_is_int_in>:
push   %rbx
mov    %rdi,%rbx
call   1040 <usb_endpoint_xfer_int@plt>
test   %rax,%rax
je     1143 <usb_endpoint_is_int_in+0x23>
mov    %rbx,%rdi
call   1030 <usb_endpoint_dir_in@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_int_in(%struct.usb_endpoint_descriptor* %0) {
%2 = alloca %struct.usb_endpoint_descriptor*
store %struct.usb_endpoint_descriptor* %0, %struct.usb_endpoint_descriptor** %2
%3 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%4 = call i64 @usb_endpoint_xfer_int(%struct.usb_endpoint_descriptor* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%8 = call i64 @usb_endpoint_dir_in(%struct.usb_endpoint_descriptor* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_int_in(%struct.usb_endpoint_descriptor* %0) {
%2 = tail call i64 @usb_endpoint_xfer_int(%struct.usb_endpoint_descriptor* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @usb_endpoint_dir_in(%struct.usb_endpoint_descriptor* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ die(int);
int /*<<< orphan*/ vdiagnostic(char *, char const *, unsigned int, char const *,
                               int /*<<< orphan*/);
void vfail(int status, const char *file, unsigned line, const char *fmt,
           va_list ap) {
  vdiagnostic("ERROR ", file, line, fmt, ap);
  die(status);
}


x86 assembly (clang, -O0):
<vfail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
lea    0xeb0(%rip),%rdi
call   1040 <vdiagnostic@plt>
mov    -0x4(%rbp),%edi
call   1030 <die@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfail>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <vdiagnostic@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ERROR \00"
define void @vfail(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = load i8*, i8** %9
%14 = load i32, i32* %10
%15 = call i32 @vdiagnostic(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i8* %13, i32 %14)
%16 = load i32, i32* %6
%17 = call i32 @die(i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ERROR \00"
define void @vfail(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @vdiagnostic(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3, i32 %4)
%7 = tail call i32 @die(i32 %0)
ret void
}
/* Variables and functions */
int translate_nodout2(char *, int);
int translate_nodout(int handle) {
  return translate_nodout2("/nodout", handle);
}


x86 assembly (clang, -O0):
<translate_nodout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <translate_nodout2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate_nodout>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <translate_nodout2@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/nodout\00"
define i32 @translate_nodout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @translate_nodout2(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"/nodout\00"
define i32 @translate_nodout(i32 %0) {
%2 = tail call i32 @translate_nodout2(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
int test_imm_35uint8_mem(unsigned char *val) {
  return ((*val) & (-0x35 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_35uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -53
%7 = icmp ne i32 %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_35uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -53
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float result;
  result = 3.0 * 5.0;
  printf("\nThe result is %f\n", result);
  result = 7.1 * 8.3 - 2.2;
  printf("The result is %f\n", result);
  result = 3.2 / (6.1 * 5);
  printf("The result is %f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
movss  0xe9d(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef4(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee1(%rip),%rbx
movss  0xed0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xec4(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0AThe result is %f\0A\00"
@.str.1 = [18 x i8] c"The result is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 1.500000e+01, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %3)
store float 0x404C5D70A0000000, float* %2
%5 = load float, float* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float %5)
store float 0x3FBADBE880000000, float* %2
%7 = load float, float* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0AThe result is %f\0A\00"
@.str.1 = [18 x i8] c"The result is %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float 1.500000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float 0x404C5D70A0000000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float 0x3FBADBE880000000)
ret i32 0
}
/* Variables and functions */
double drand48();
double nop_domain(void) { return (drand48()); }


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

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

LLVM IR (-O0):
define double @nop_domain() {
%1 = call double (...) @drand48()
ret double %1
}

LLVM IR (-O2):
define double @nop_domain() {
%1 = tail call double (...) @drand48()
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void OpcodeNotDone(void) { printf("CPU Error: Opcode not written yet!\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"CPU Error: Opcode not written yet!\0A\00"
define void @OpcodeNotDone() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"CPU Error: Opcode not written yet!\00"
define void @OpcodeNotDone() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
void ppr1() {}


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

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

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

LLVM IR (-O2):
define void @ppr1() {
ret void
}