xunge/DecIR huggingface dataset:
/* Variables and functions */
char EOF;
int /*<<< orphan*/ affiche_entier(int);
char getchar();
int main(void) {
  int cpt_char;
  char c;
  while ((c = getchar()) != EOF) {
    cpt_char++;
  }
  affiche_entier(cpt_char - 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115c <main+0x3c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0xf>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <affiche_entier@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
add    $0x1,%ebx
cmp    (%r14),%al
jne    1130 <main+0x10>
mov    %ebx,%edi
call   1040 <affiche_entier@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
br label %4
4: ; preds = %10, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 1
%16 = call i32 @affiche_entier(i32 %15)
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ undef, %0 ], [ %6, %1 ]
%3 = tail call signext i8 (...) @getchar()
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
%6 = add nsw i32 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = add nsw i32 %2, -1
%9 = tail call i32 @affiche_entier(i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func1(int *);
int func2(const int *fb) { func1((int *)fb); }


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

x86 assembly (clang, -O2):
<func2>:
jmp    1030 <func1@plt>

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

LLVM IR (-O2):
define i32 @func2(i32* %0) {
%2 = tail call i32 @func1(i32* %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ mpgdecoder_new(void *, int, int, int, int);
FILE *mpgdecoder_open(void *ctx, int sample_rate, int stereo) {
  return (FILE *)mpgdecoder_new(ctx, sample_rate, stereo, -1, -1);
}


x86 assembly (clang, -O0):
<mpgdecoder_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0xffffffff,%r8d
mov    %r8d,%ecx
call   1030 <mpgdecoder_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpgdecoder_open>:
mov    $0xffffffff,%ecx
mov    $0xffffffff,%r8d
jmp    1030 <mpgdecoder_new@plt>

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

LLVM IR (-O2):
define i32* @mpgdecoder_open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i64 @mpgdecoder_new(i8* %0, i32 %1, i32 %2, i32 -1, i32 -1)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int fun846() { return 846; }


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

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

LLVM IR (-O0):
define i32 @fun846() {
ret i32 846
}

LLVM IR (-O2):
define i32 @fun846() {
ret i32 846
}
void zlextinit(void) {}


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

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

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

LLVM IR (-O2):
define void @zlextinit() {
ret void
}
int fMax5(int a, int b) {
  int c[2] = {a, b};
  int z = a - b;
  z = (z >> 31) & 1;
  return c[z];
}


x86 assembly (clang, -O0):
<fMax5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fMax5>:
mov    %edi,-0x8(%rsp)
mov    %esi,-0x4(%rsp)
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
mov    -0x8(%rsp,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @fMax5(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%8 = load i32, i32* %3
store i32 %8, i32* %7
%9 = getelementptr inbounds i32, i32* %7, i64 1
%10 = load i32, i32* %4
store i32 %10, i32* %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = ashr i32 %14, 31
%16 = and i32 %15, 1
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 %18
%20 = load i32, i32* %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @fMax5(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %0, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %1, i32* %6
%7 = icmp slt i32 %0, %1
%8 = zext i1 %7 to i64
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned long);
char *str_new(char *);
char *str_from_u(unsigned long v) {
  char buf[30];
  sprintf(buf, "%lu", v);
  return str_new(buf);
}


x86 assembly (clang, -O0):
<str_from_u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <str_new@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_from_u>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <str_new@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lu\00"
define i8* @str_from_u(i64 %0) {
%2 = alloca i64
%3 = alloca [30 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%8 = call i8* @str_new(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
define i8* @str_from_u(i64 %0) {
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = call i8* @str_new(i8* %3)
ret i8* %5
}
char const *IcsGetLibVersion(void) { return "1.5.1"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"1.5.1\00"
define i8* @IcsGetLibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.5.1\00"
define i8* @IcsGetLibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int test_stdarg_va(int *, char, int, char, int *);
int test_stdarg(int r) {
  char c1 = 1, c2 = 2;
  if (test_stdarg_va(&r, c1, 0x76214365ul, c2, &r) != 1)
    return 0;
  return r & 1;
}


x86 assembly (clang, -O0):
<test_stdarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movb   $0x1,-0x9(%rbp)
movb   $0x2,-0xa(%rbp)
mov    -0x9(%rbp),%al
lea    -0x8(%rbp),%r8
mov    $0x76214365,%edx
mov    %r8,%rdi
movsbl %al,%esi
movsbl -0xa(%rbp),%ecx
call   1030 <test_stdarg_va@plt>
cmp    $0x1,%eax
je     1153 <test_stdarg+0x43>
movl   $0x0,-0x4(%rbp)
jmp    115c <test_stdarg+0x4c>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_stdarg>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x76214365,%edx
mov    $0x2,%ecx
mov    %rdi,%r8
call   1030 <test_stdarg_va@plt>
mov    0x4(%rsp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
cmp    $0x1,%eax
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_stdarg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @test_stdarg_va(i32* %2, i8 signext 1, i32 1981891429, i8 signext 2, i32* %2)
%4 = icmp eq i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %5, 1
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
scalar_t__ strpbrk(char const *, char const *);
char *c_strpbrk(const char *s, const char *accept) {
  return (char *)strpbrk(s, accept);
}


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

x86 assembly (clang, -O2):
<c_strpbrk>:
jmp    1030 <strpbrk@plt>

LLVM IR (-O0):
define i8* @c_strpbrk(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strpbrk(i8* %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @c_strpbrk(i8* %0, i8* %1) {
%3 = tail call i64 @strpbrk(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void qd_real(double a, double *b) {
  b[0] = a;
  b[1] = 0.0;
  b[2] = 0.0;
  b[3] = 0.0;
}


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

x86 assembly (clang, -O2):
<qd_real>:
movsd  %xmm0,(%rdi)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rdi)
movq   $0x0,0x18(%rdi)
ret

LLVM IR (-O0):
define void @qd_real(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
store double %5, double* %7
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 1
store double 0.000000e+00, double* %9
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 2
store double 0.000000e+00, double* %11
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 3
store double 0.000000e+00, double* %13
ret void
}

LLVM IR (-O2):
define void @qd_real(double %0, double* nocapture writeonly %1) {
store double %0, double* %1
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = bitcast double* %3 to i8*
ret void
}
int func(void) {
  int n = 3;
  int m = 5;
  n -= m;
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_queens_puzzle();
int main() {
  ft_queens_puzzle();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ft_queens_puzzle()
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
char *get_time_str_fmt(int /*<<< orphan*/, struct timeval *, char *, size_t,
                       int /*<<< orphan*/ *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_time_str(char *time_str, size_t len) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return get_time_str_fmt(time(NULL), &tv, time_str, len, NULL);
}


x86 assembly (clang, -O0):
<get_time_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <get_time_str_fmt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_str>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %r8d,%r8d
call   1040 <get_time_str_fmt@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i8* @get_time_str(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca %struct.timeval
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%7 = call i32 @time(i32* null)
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i8* @get_time_str_fmt(i32 %7, %struct.timeval* %5, i8* %8, i64 %9, i32* null)
ret i8* %10
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i8* @get_time_str(i8* %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = tail call i32 @time(i32* null)
%7 = call i8* @get_time_str_fmt(i32 %6, %struct.timeval* %3, i8* %0, i64 %1, i32* null)
ret i8* %7
}
/* Variables and functions */
long double gammavariate(long double, int);
long double betavariate(long double alpha, long double beta) {
  long double x = gammavariate(alpha, 1);
  long double y = gammavariate(beta, 1);
  return x / (x + y);
}


x86 assembly (clang, -O0):
<betavariate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x1,%edi
mov    %edi,-0x44(%rbp)
call   1030 <gammavariate@plt>
mov    -0x44(%rbp),%edi
fstpt  -0x30(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <gammavariate@plt>
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fadd   %st(1),%st
fdivrp %st,%st(1)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<betavariate>:
sub    $0x28,%rsp
fldt   0x40(%rsp)
fstpt  0x1c(%rsp)
fldt   0x30(%rsp)
fstpt  (%rsp)
mov    $0x1,%edi
call   1030 <gammavariate@plt>
fstpt  0x10(%rsp)
fldt   0x1c(%rsp)
fstpt  (%rsp)
mov    $0x1,%edi
call   1030 <gammavariate@plt>
fldt   0x10(%rsp)
fadd   %st,%st(1)
fdivp  %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @betavariate(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%7 = load x86_fp80, x86_fp80* %3
%8 = call x86_fp80 @gammavariate(x86_fp80 %7, i32 1)
store x86_fp80 %8, x86_fp80* %5
%9 = load x86_fp80, x86_fp80* %4
%10 = call x86_fp80 @gammavariate(x86_fp80 %9, i32 1)
store x86_fp80 %10, x86_fp80* %6
%11 = load x86_fp80, x86_fp80* %5
%12 = load x86_fp80, x86_fp80* %5
%13 = load x86_fp80, x86_fp80* %6
%14 = fadd x86_fp80 %12, %13
%15 = fdiv x86_fp80 %11, %14
ret x86_fp80 %15
}

LLVM IR (-O2):
define x86_fp80 @betavariate(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @gammavariate(x86_fp80 %0, i32 1)
%4 = tail call x86_fp80 @gammavariate(x86_fp80 %1, i32 1)
%5 = fadd x86_fp80 %3, %4
%6 = fdiv x86_fp80 %3, %5
ret x86_fp80 %6
}
void COM_StripExtension(char *in, char *out) {
  while (*in && *in != '.') {
    *out++ = *in++;
  }
  *out = 0;
}


x86 assembly (clang, -O0):
<COM_StripExtension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1131 <COM_StripExtension+0x31>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1141 <COM_StripExtension+0x41>
jmp    1168 <COM_StripExtension+0x68>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <COM_StripExtension+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_StripExtension>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1126 <COM_StripExtension+0x26>
cmp    $0x2e,%cl
je     1126 <COM_StripExtension+0x26>
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
jmp    1110 <COM_StripExtension+0x10>
movb   $0x0,(%rsi,%rax,1)
ret

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

LLVM IR (-O2):
define void @COM_StripExtension(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = phi i8* [ %1, %2 ], [ %9, %7 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 0, label %10
i8 46, label %10
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
br label %3
10: ; preds = %3, %3
store i8 0, i8* %5
ret void
}
double dnot(double x) { return ((double)(x == 0.0)); }


x86 assembly (clang, -O0):
<dnot>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnot>:
xorpd  %xmm1,%xmm1
cmpeqsd %xmm1,%xmm0
movsd  0xeef(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dnot(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @dnot(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = uitofp i1 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, unsigned long long *);
int _sum_cb(const char *s, void *ctx) {
  unsigned long long ull = 0;
  sscanf(s, "%llu", &ull);
  *(unsigned long long *)ctx += ull;
  return 1;
}


x86 assembly (clang, -O0):
<_sum_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sum_cb>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movq   $0x0,0x8(%rsp)
lea    0xed8(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x8(%rsp),%rax
add    %rax,(%rbx)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%llu\00"
define i32 @_sum_cb(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
store i64 0, i64* %5
%6 = load i8*, i8** %3
%7 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %5)
%8 = load i64, i64* %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10
%12 = add i64 %11, %8
store i64 %12, i64* %10
ret i32 1
}

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
define i32 @_sum_cb(i8* nocapture %0, i8* nocapture %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3)
%6 = load i64, i64* %3
%7 = bitcast i8* %1 to i64*
%8 = load i64, i64* %7
%9 = add i64 %8, %6
store i64 %9, i64* %7
ret i32 1
}
/* Variables and functions */
void VIDDummyVdp2DrawScreens(void) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp2DrawScreens() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int main(void) {
  int32_t i;
  while (1) {
    *((uint32_t *)(0xA0000000)) = 0x3FF;
    for (i = 0; i < 0x1FFFFF; i++)
      ;
    *((uint32_t *)(0xA0000000)) = 0x000;
    for (i = 0; i < 0x1FFFFF; i++)
      ;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xa0000000,%eax
movl   $0x3ff,(%rax)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1fffff,-0x8(%rbp)
jge    113d <main+0x3d>
jmp    112f <main+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111d <main+0x1d>
mov    $0xa0000000,%eax
movl   $0x0,(%rax)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1fffff,-0x8(%rbp)
jge    116f <main+0x6f>
jmp    1161 <main+0x61>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <main+0x4f>
jmp    110b <main+0xb>

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
void *dlopen(void) { return (void *)"XXX"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"XXX\00"
define i8* @dlopen() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"XXX\00"
define i8* @dlopen() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
int wext_proc_init(struct net *net) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.net = type opaque
define i32 @wext_proc_init(%struct.net* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int isatty(int /*<<< orphan*/);
int isHuman(FILE *F) { return (isatty(fileno(F))); }


x86 assembly (clang, -O0):
<isHuman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isHuman>:
push   %rax
call   1040 <fileno@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <isatty@plt>

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

LLVM IR (-O2):
define i32 @isHuman(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = tail call i32 @isatty(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void yearUsage() { printf("Please type \"--years startYear-endYear\".\n"); }


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"Please type \22--years startYear-endYear\22.\0A\00"
define void @yearUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"Please type \22--years startYear-endYear\22.\00"
define void @yearUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret void
}
int flt_cmp(void *a, void *b) {
  if (*(int *)a == *(int *)b) {
    return 0;
  } else if (*(int *)a < *(int *)b) {
    return -1;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<flt_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    112a <flt_cmp+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    114f <flt_cmp+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <flt_cmp+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <flt_cmp+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt_cmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @flt_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
int strchrcount(char *s, int c) {
  char *x;
  int count = 0;
  for (x = s; *x; x++)
    if (*x == c)
      count++;
  return count;
}


x86 assembly (clang, -O0):
<strchrcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strchrcount+0x56>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1140 <strchrcount+0x40>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1145 <strchrcount+0x45>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <strchrcount+0x1a>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrcount>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <strchrcount+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
xor    %edx,%edx
cmp    %esi,%ecx
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strchrcount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strchrcount(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %13, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %17
}
/* Variables and functions */
scalar_t__ framer_preset_result(char *, int, unsigned long *);
int /*<<< orphan*/ framer_reset_actaddr();
int waitfor(int, char *, int);
int framer_waitfor(int fd, char *w_buf, int w_len) {
  unsigned long etime;
  if (framer_preset_result(w_buf, w_len, &etime)) {
    framer_reset_actaddr();
    return 1;
  }
  return waitfor(fd, w_buf, w_len);
}


x86 assembly (clang, -O0):
<framer_waitfor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x20(%rbp),%rdx
call   1040 <framer_preset_result@plt>
cmp    $0x0,%rax
je     116f <framer_waitfor+0x3f>
mov    $0x0,%al
call   1030 <framer_reset_actaddr@plt>
movl   $0x1,-0x4(%rbp)
jmp    1181 <framer_waitfor+0x51>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <waitfor@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<framer_waitfor>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %edi,%r14d
lea    0x8(%rsp),%rdx
mov    %rsi,%rdi
mov    %ebp,%esi
call   1040 <framer_preset_result@plt>
test   %rax,%rax
je     1162 <framer_waitfor+0x32>
xor    %eax,%eax
call   1030 <framer_reset_actaddr@plt>
mov    $0x1,%eax
jmp    116f <framer_waitfor+0x3f>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1050 <waitfor@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @framer_waitfor(i32 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i64 @framer_preset_result(i8* %1, i32 %2, i64* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = call i32 (...) @framer_reset_actaddr()
br label %12
10: ; preds = %3
%11 = call i32 @waitfor(i32 %0, i8* %1, i32 %2)
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ 1, %8 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRDRAWTEXT_get(void) { return U_WMRCORENONE_get("U_WMRDRAWTEXT"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"U_WMRDRAWTEXT\00"
define i32 @U_WMRDRAWTEXT_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"U_WMRDRAWTEXT\00"
define i32 @U_WMRDRAWTEXT_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int /*<<< orphan*/ stderr;
void sigusr1(int sig) {
  signal(SIGUSR1, sigusr1);
  fprintf(stderr, "W:\t%s\n", "trapped USR1 and continue");
}


x86 assembly (clang, -O0):
<sigusr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2ea5(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
lea    0xeb0(%rip),%rdx
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigusr1>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
lea    0xeba(%rip),%rdx
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@stderr = global i32 0
@.str = [7 x i8] c"W:\09%s\0A\00"
@.str.1 = [26 x i8] c"trapped USR1 and continue\00"
define void @sigusr1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGUSR1
%4 = call i32 @signal(i32 %3, void (i32)* @sigusr1)
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@stderr = global i32 0
@.str = [7 x i8] c"W:\09%s\0A\00"
@.str.1 = [26 x i8] c"trapped USR1 and continue\00"
define void @sigusr1(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = tail call i32 @signal(i32 %2, void (i32)* @sigusr1)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((always_)) void hlt(void) {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @hlt() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ error(char const *);
int /*<<< orphan*/ exit(int);
void die(const char *msg) {
  error(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @die(i8* %0) {
%2 = tail call i32 @error(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t base64_decoded_size(size_t len) {
  size_t k = len % 4;
  size_t n = len / 4 * 3;
  switch (k) {
  case 3:
    return n + 2;
  case 2:
    return n + 1;
  case 1:
  case 0:
  default:
    return n;
  }
}


x86 assembly (clang, -O0):
<base64_decoded_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x2,%rax
lea    (%rax,%rax,2),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
sub    $0x2,%rax
jb     1182 <base64_decoded_size+0x82>
jmp    113a <base64_decoded_size+0x3a>
mov    -0x28(%rbp),%rax
sub    $0x2,%rax
je     1171 <base64_decoded_size+0x71>
jmp    114d <base64_decoded_size+0x4d>
mov    -0x28(%rbp),%rax
sub    $0x3,%rax
jne    1187 <base64_decoded_size+0x87>
jmp    1160 <base64_decoded_size+0x60>
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    118f <base64_decoded_size+0x8f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    118f <base64_decoded_size+0x8f>
jmp    1187 <base64_decoded_size+0x87>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decoded_size>:
mov    %edi,%ecx
and    $0x3,%ecx
shr    $0x2,%rdi
lea    (%rdi,%rdi,2),%rax
cmp    $0x2,%rcx
je     111d <base64_decoded_size+0x1d>
cmp    $0x3,%ecx
jne    1121 <base64_decoded_size+0x21>
add    $0x2,%rax
ret
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @base64_decoded_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
%6 = load i64, i64* %3
%7 = urem i64 %6, 4
store i64 %7, i64* %4
%8 = load i64, i64* %3
%9 = udiv i64 %8, 4
%10 = mul i64 %9, 3
store i64 %10, i64* %5
%11 = load i64, i64* %4
switch i64 %11, label %19 [
i64 3, label %12
i64 2, label %15
i64 1, label %18
i64 0, label %18
]
12: ; preds = %1
%13 = load i64, i64* %5
%14 = add i64 %13, 2
store i64 %14, i64* %2
br label %21
15: ; preds = %1
%16 = load i64, i64* %5
%17 = add i64 %16, 1
store i64 %17, i64* %2
br label %21
18: ; preds = %1, %1
br label %19
19: ; preds = %1, %18
%20 = load i64, i64* %5
store i64 %20, i64* %2
br label %21
21: ; preds = %19, %15, %12
%22 = load i64, i64* %2
ret i64 %22
}

LLVM IR (-O2):
define i64 @base64_decoded_size(i64 %0) {
%2 = and i64 %0, 3
%3 = lshr i64 %0, 2
%4 = mul nuw i64 %3, 3
switch i64 %2, label %9 [
i64 3, label %5
i64 2, label %7
]
5: ; preds = %1
%6 = add nuw i64 %4, 2
br label %9
7: ; preds = %1
%8 = add nuw i64 %4, 1
br label %9
9: ; preds = %1, %7, %5
%10 = phi i64 [ %8, %7 ], [ %6, %5 ], [ %4, %1 ]
ret i64 %10
}
/* Variables and functions */
char *strcat(char *, char *);
void test1(char *to, int to_size, char *from) {
  char *r = strcat(to + to_size, from);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcat@plt>
mov    %rax,-0x20(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
movslq %esi,%rax
add    %rax,%rdi
mov    %rdx,%rsi
jmp    1030 <strcat@plt>

LLVM IR (-O0):
define void @test1(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8*, i8** %6
%13 = call i8* @strcat(i8* %11, i8* %12)
store i8* %13, i8** %7
ret void
}

LLVM IR (-O2):
define void @test1(i8* %0, i32 %1, i8* nocapture %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i8* @strcat(i8* dereferenceable(1) %5, i8* dereferenceable(1) %2)
ret void
}
/* Variables and functions */
int get_random_int(int, int /*<<< orphan*/);
int *fill_with_random_integers(int *a, const size_t size) {
  for (int i = 0; i < size; i++)
    a[i] = get_random_int(100, 0);
  return a;
}


x86 assembly (clang, -O0):
<fill_with_random_integers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115c <fill_with_random_integers+0x4c>
mov    $0x64,%edi
xor    %esi,%esi
call   1030 <get_random_int@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <fill_with_random_integers+0x17>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_with_random_integers>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     1149 <fill_with_random_integers+0x39>
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x64,%edi
xor    %esi,%esi
call   1030 <get_random_int@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <fill_with_random_integers+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @fill_with_random_integers(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
store i32* %0, i32** %3
store i64 %1, i64* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %6
%12 = call i32 @get_random_int(i32 100, i32 0)
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
br label %17
17: ; preds = %11
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load i32*, i32** %3
ret i32* %21
}

LLVM IR (-O2):
define i32* @fill_with_random_integers(i32* returned writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret i32* %0
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = tail call i32 @get_random_int(i32 100, i32 0)
%8 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %7, i32* %8
%9 = add nuw i64 %6, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %4, label %5
}
void __attribute__((weak)) spi3_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<spi3_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi3_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.spi3_isr = [9 x i8] c"spi3_isr\00"
define weak void @spi3_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.spi3_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.spi3_isr = [9 x i8] c"spi3_isr\00"
define weak void @spi3_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.spi3_isr, i64 0, i64 0))
ret void
}
int compareInt(void *ip, void *ip2) { return (*(int *)ip) - (*(int *)ip2); }


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

x86 assembly (clang, -O2):
<compareInt>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compareInt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compareInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
AR0I1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[10000000]) = 33; }


x86 assembly (clang, -O0):
<AR0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x21,0x2625a00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0I1>:
movl   $0x21,0x2625a00(%r8)
ret

LLVM IR (-O0):
define i32 @AR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %12
%15 = getelementptr inbounds i32, i32* %14, i64 10000000
store i32 33, i32* %15
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @AR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture readnone %5) {
%7 = getelementptr inbounds i32, i32* %4, i64 10000000
store i32 33, i32* %7
ret i32 undef
}