xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t count_white_spaces(char const *);
size_t strlen(char const *);
int row_starts_with_valid_char(const char *buf) {
  const size_t len = strlen(buf);
  const size_t i = count_white_spaces(buf);
  if ((i == len) || (buf[i] == '.')) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<row_starts_with_valid_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <count_white_spaces@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1169 <row_starts_with_valid_char+0x49>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1175 <row_starts_with_valid_char+0x55>
movl   $0x0,-0x4(%rbp)
jmp    117c <row_starts_with_valid_char+0x5c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_starts_with_valid_char>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <count_white_spaces@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %r14,%rcx
je     114a <row_starts_with_valid_char+0x2a>
xor    %eax,%eax
cmpb   $0x2e,(%rbx,%rcx,1)
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @row_starts_with_valid_char(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i64 @count_white_spaces(i8* %0)
%4 = icmp eq i64 %3, %2
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 46
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int *i;
  scanf("%d", i);
  printf("\n%d", *i + 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
add    $0xa,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed9(%rip),%rdi
call   1040 <scanf@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32*, i32** %1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 10
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void printVersion(const char *appName) {
  fprintf(stderr, "%s, version %s\n", appName, "0.9");
  fprintf(stderr, "  Copyright (c) Paul Chambers, 2005-06\n");
}


x86 assembly (clang, -O0):
<printVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
lea    0xed9(%rip),%rcx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printVersion>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
lea    0xee5(%rip),%rcx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed9(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"%s, version %s\0A\00"
@.str.1 = [4 x i8] c"0.9\00"
@.str.2 = [40 x i8] c" Copyright (c) Paul Chambers, 2005-06\0A\00"
define void @printVersion(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"%s, version %s\0A\00"
@.str.1 = [4 x i8] c"0.9\00"
@.str.2 = [40 x i8] c" Copyright (c) Paul Chambers, 2005-06\0A\00"
define void @printVersion(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main(void) {
  printf("Entered main()\n");
  system("ls -al");
  printf("Back to main.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <system@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Entered main()\0A\00"
@.str.1 = [7 x i8] c"ls -al\00"
@.str.2 = [15 x i8] c"Back to main.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"ls -al\00"
@str = [15 x i8] c"Entered main()\00"
@str.3 = [14 x i8] c"Back to main.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
void foo547() {}


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

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

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

LLVM IR (-O2):
define void @foo547() {
ret void
}
double CalculateESquared(double a, double b) {
  return ((a * a) - (b * b)) / (a * a);
}


x86 assembly (clang, -O0):
<CalculateESquared>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @CalculateESquared(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* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %5, double %6, double %10)
%12 = load double, double* %3
%13 = load double, double* %3
%14 = fmul double %12, %13
%15 = fdiv double %11, %14
ret double %15
}

LLVM IR (-O2):
define double @CalculateESquared(double %0, double %1) {
%3 = fneg double %1
%4 = fmul double %3, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = fmul double %0, %0
%7 = fdiv double %5, %6
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ double_t;

/* Variables and functions */
double pow(double, int /*<<< orphan*/);
double pow_dd(double *ap, double_t *bp) { return (pow(*ap, *bp)); }


x86 assembly (clang, -O0):
<pow_dd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_dd>:
movsd  (%rdi),%xmm0
mov    (%rsi),%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @pow_dd(double* %0, i32* %1) {
%3 = alloca double*
%4 = alloca i32*
store double* %0, double** %3
store i32* %1, i32** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call double @pow(double %6, i32 %8)
ret double %9
}

LLVM IR (-O2):
define double @pow_dd(double* nocapture %0, i32* nocapture %1) {
%3 = load double, double* %0
%4 = load i32, i32* %1
%5 = tail call double @pow(double %3, i32 %4)
ret double %5
}
int Cyc_putc_void(int c, int dummy) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Cyc_putc_void(i32 %0, i32 %1) {
ret i32 1
}
/* Type definitions */
struct fix_tag_classifier {
  int dummy;
};

/* Variables and functions */
const struct fix_tag_classifier *get_group_classifier_in_EvntGrp(size_t __tag) {
  (void)__tag;
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.fix_tag_classifier = type { i32 }
define %struct.fix_tag_classifier* @get_group_classifier_in_EvntGrp(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret %struct.fix_tag_classifier* null
}

LLVM IR (-O2):
%struct.fix_tag_classifier = type { i32 }
define noalias %struct.fix_tag_classifier* @get_group_classifier_in_EvntGrp(i64 %0) {
ret %struct.fix_tag_classifier* null
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_asm_comment_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_asm_comment(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_asm_comment_rec(lexbuf, 9); });
}


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

x86 assembly (clang, -O2):
<Cyc_asm_comment>:
mov    $0x9,%esi
jmp    1030 <Cyc_asm_comment_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_asm_comment(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_asm_comment_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 9)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_asm_comment(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_asm_comment_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 9)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ M_MkdirEachUntil(char const *, int, int, int);
void M_MkdirEach(const char *path, int start, int mode) {
  M_MkdirEachUntil(path, start, -1, mode);
}


x86 assembly (clang, -O0):
<M_MkdirEach>:
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),%ecx
mov    $0xffffffff,%edx
call   1030 <M_MkdirEachUntil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_MkdirEach>:
mov    %edx,%ecx
mov    $0xffffffff,%edx
jmp    1030 <M_MkdirEachUntil@plt>

LLVM IR (-O0):
define void @M_MkdirEach(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 i32 @M_MkdirEachUntil(i8* %7, i32 %8, i32 -1, i32 %9)
ret void
}

LLVM IR (-O2):
define void @M_MkdirEach(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @M_MkdirEachUntil(i8* %0, i32 %1, i32 -1, i32 %2)
ret void
}
/* Variables and functions */
int syscall(int, void *);
int brk(void *end) { return -(syscall(45, end) == -1); }


x86 assembly (clang, -O0):
<brk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x2d,%edi
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brk>:
push   %rax
mov    %rdi,%rsi
mov    $0x2d,%edi
call   1030 <syscall@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @brk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @syscall(i32 45, i8* %3)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
%7 = sub nsw i32 0, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @brk(i8* %0) {
%2 = tail call i32 @syscall(i32 45, i8* %0)
%3 = icmp eq i32 %2, -1
%4 = sext i1 %3 to i32
ret i32 %4
}
int test() {
  int I;
  float F;
  return try(&I) | try(&F);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x0,%al
call   1030 <try@plt>
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <try@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
xor    %eax,%eax
call   1030 <try@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1030 <try@plt>
or     %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca float
%3 = call i32 (i32*, ...) bitcast (i32 (...)* @try to i32 (i32*, ...)*)(i32* %1)
%4 = call i32 (float*, ...) bitcast (i32 (...)* @try to i32 (float*, ...)*)(float* %2)
%5 = or i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @test() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 (i32*, ...) bitcast (i32 (...)* @try to i32 (i32*, ...)*)(i32* %1)
%6 = call i32 (float*, ...) bitcast (i32 (...)* @try to i32 (float*, ...)*)(float* %2)
%7 = or i32 %6, %5
ret i32 %7
}
/* Type definitions */
struct signature {
  int dummy;
};

/* Variables and functions */
float approximate_cosine(struct signature *, struct signature *);
int dot(struct signature *sig1, struct signature *sig2, float thr) {
  return (approximate_cosine(sig1, sig2) > thr);
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <approximate_cosine@plt>
ucomiss -0x14(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <approximate_cosine@plt>
xor    %eax,%eax
ucomiss 0x4(%rsp),%xmm0
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.signature = type { i32 }
define i32 @dot(%struct.signature* %0, %struct.signature* %1, float %2) {
%4 = alloca %struct.signature*
%5 = alloca %struct.signature*
%6 = alloca float
store %struct.signature* %0, %struct.signature** %4
store %struct.signature* %1, %struct.signature** %5
store float %2, float* %6
%7 = load %struct.signature*, %struct.signature** %4
%8 = load %struct.signature*, %struct.signature** %5
%9 = call float @approximate_cosine(%struct.signature* %7, %struct.signature* %8)
%10 = load float, float* %6
%11 = fcmp ogt float %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.signature = type { i32 }
define i32 @dot(%struct.signature* %0, %struct.signature* %1, float %2) {
%4 = tail call float @approximate_cosine(%struct.signature* %0, %struct.signature* %1)
%5 = fcmp ogt float %4, %2
%6 = zext i1 %5 to i32
ret i32 %6
}
void ScaleFilterCols_16_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleFilterCols_16_C() {
ret void
}
void output_char(char c) {
  *(long *)(0x100000208) = (long)c;
  return;
}


x86 assembly (clang, -O0):
<output_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbq -0x1(%rbp),%rcx
movabs $0x100000208,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_char>:
movslq %edi,%rax
movabs $0x100000208,%rcx
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @output_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i64
store i64 %4, i64* inttoptr (i64 4294967816 to i64*)
ret void
}

LLVM IR (-O2):
define void @output_char(i8 signext %0) {
%2 = sext i8 %0 to i64
store i64 %2, i64* inttoptr (i64 4294967816 to i64*)
ret void
}
/* Type definitions */
typedef enum week { ____Placeholder_week } week;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  enum week { monday, tueday, wednesday, thursday, friday, saturday, sunday };
  enum week day = 7;
  if (day == 0) {
    printf("Happy Monday\n");
  } else if (day == 6 || 7) {
    printf("Enjoy the weekend\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    116b <main+0x5b>
cmpl   $0x6,-0x8(%rbp)
je     115a <main+0x4a>
mov    $0x1,%al
test   $0x1,%al
jne    115a <main+0x4a>
jmp    1166 <main+0x56>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    116b <main+0x5b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Happy Monday\0A\00"
@.str.1 = [19 x i8] c"Enjoy the weekend\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %14
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 6
br i1 %9, label %11, label %10
10: ; preds = %7
br i1 true, label %11, label %13
11: ; preds = %10, %7
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %10
br label %14
14: ; preds = %13, %5
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"Enjoy the weekend\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int _reboot(int, int, int);
int reboot(int flag) { return (_reboot((int)0xfee1dead, 672274793, flag)); }


x86 assembly (clang, -O0):
<reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xfee1dead,%edi
mov    $0x28121969,%esi
call   1030 <_reboot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reboot>:
mov    %edi,%edx
mov    $0xfee1dead,%edi
mov    $0x28121969,%esi
jmp    1030 <_reboot@plt>

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

LLVM IR (-O2):
define i32 @reboot(i32 %0) {
%2 = tail call i32 @_reboot(i32 -18751827, i32 672274793, i32 %0)
ret i32 %2
}
char *skip_dot(char *text) {
  char *current = text;
  if (*current == '.')
    return current + 1;
  else
    return current;
}


x86 assembly (clang, -O0):
<skip_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1131 <skip_dot+0x31>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1139 <skip_dot+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_dot>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
sete   %al
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @skip_dot(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
%4 = zext i1 %3 to i64
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
/* Variables and functions */
int Add(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int x, y, sum = 0;
  printf("Input two integers : ");
  scanf("%d%d", &x, &y);
  sum = Add(x, y);
  printf("The sum of %d and %d is %d\n", x, y, sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <Add@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <Add@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeae(%rip),%rdi
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Input two integers : \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [28 x i8] c"The sum of %d and %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @Add(i32 %6, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Input two integers : \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [28 x i8] c"The sum of %d and %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @Add(i32 %7, i32 %8)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11, i32 %9)
ret i32 0
}
int get_arch_reserved_keys(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @get_arch_reserved_keys() {
ret i32 2
}

LLVM IR (-O2):
define i32 @get_arch_reserved_keys() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ buildLogList();
int /*<<< orphan*/ free(char *);
char *getText(int);
int /*<<< orphan*/ send_http_header(int, int);
int /*<<< orphan*/ write_st(int, char *);
void write_loganalysis(int fd) {
  send_http_header(fd, 200);
  char *txt = getText(80);
  buildLogList();
  write_st(fd, txt);
  free(txt);
}


x86 assembly (clang, -O0):
<write_loganalysis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xc8,%esi
call   1050 <send_http_header@plt>
mov    $0x50,%edi
call   1060 <getText@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <buildLogList@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <write_st@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_loganalysis>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xc8,%esi
call   1050 <send_http_header@plt>
mov    $0x50,%edi
call   1060 <getText@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <buildLogList@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1070 <write_st@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <free@plt>

LLVM IR (-O0):
define void @write_loganalysis(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @send_http_header(i32 %4, i32 200)
%6 = call i8* @getText(i32 80)
store i8* %6, i8** %3
%7 = call i32 (...) @buildLogList()
%8 = load i32, i32* %2
%9 = load i8*, i8** %3
%10 = call i32 @write_st(i32 %8, i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @write_loganalysis(i32 %0) {
%2 = tail call i32 @send_http_header(i32 %0, i32 200)
%3 = tail call i8* @getText(i32 80)
%4 = tail call i32 (...) @buildLogList()
%5 = tail call i32 @write_st(i32 %0, i8* %3)
%6 = tail call i32 @free(i8* %3)
ret void
}
const char *config_cpu_type_read(void) { return "VEXRISCV"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"VEXRISCV\00"
define i8* @config_cpu_type_read() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ POLICYINFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ POLICYINFO_it;
int i2d_POLICYINFO(POLICYINFO *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &POLICYINFO_it);
}


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

x86 assembly (clang, -O2):
<i2d_POLICYINFO>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@POLICYINFO_it = global i32 0
define i32 @i2d_POLICYINFO(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @POLICYINFO_it)
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
int32_t Ina219BusRawToMillivolts(uint16_t bus_raw) {
  return (int32_t)(bus_raw >> 3) * 4;
}


x86 assembly (clang, -O0):
<Ina219BusRawToMillivolts>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ina219BusRawToMillivolts>:
mov    %edi,%eax
sar    %eax
and    $0xfffffffc,%eax
ret

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

LLVM IR (-O2):
define i32 @Ina219BusRawToMillivolts(i32 %0) {
%2 = ashr i32 %0, 1
%3 = and i32 %2, -4
ret i32 %3
}
int strlen(char *s) {
  int i = 0;
  while (*(i + s))
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1131 <strlen+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void cbt_remove(struct cbt_node *node, int index) {}


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

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

LLVM IR (-O0):
%struct.cbt_node = type opaque
define void @cbt_remove(%struct.cbt_node* %0, i32 %1) {
%3 = alloca %struct.cbt_node*
%4 = alloca i32
store %struct.cbt_node* %0, %struct.cbt_node** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.cbt_node = type opaque
define void @cbt_remove(%struct.cbt_node* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int /*<<< orphan*/);
int /*<<< orphan*/ IntRegister(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ _HibernateIntNumberGet();
void HibernateIntRegister(void (*pfnHandler)(void)) {
  uint32_t ui32Int;
  ui32Int = _HibernateIntNumberGet();
  ;
  IntRegister(ui32Int, pfnHandler);
  IntEnable(ui32Int);
}


x86 assembly (clang, -O0):
<HibernateIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <_HibernateIntNumberGet@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0xc(%rbp),%edi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntRegister>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <_HibernateIntNumberGet@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <IntRegister@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @HibernateIntRegister(void ()* %0) {
%2 = alloca void ()*
%3 = alloca i32
store void ()* %0, void ()** %2
%4 = call i32 (...) @_HibernateIntNumberGet()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load void ()*, void ()** %2
%7 = bitcast void ()* %6 to void (...)*
%8 = call i32 @IntRegister(i32 %5, void (...)* %7)
%9 = load i32, i32* %3
%10 = call i32 @IntEnable(i32 %9)
ret void
}

LLVM IR (-O2):
define void @HibernateIntRegister(void ()* %0) {
%2 = tail call i32 (...) @_HibernateIntNumberGet()
%3 = bitcast void ()* %0 to void (...)*
%4 = tail call i32 @IntRegister(i32 %2, void (...)* %3)
%5 = tail call i32 @IntEnable(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_putstr(char *str) {
  int index;
  index = 0;
  while (str[index] != '\0') {
    ft_putchar(str[index]);
    index += 1;
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <ft_putstr+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @ft_putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tqbq_common(int, char **, int);
void topq_cmd(int argc, char *argv[]) {
  if (argc < 3) {
    printf("usage: topq printer [jobspec ...]\n");
    return;
  }
  --argc;
  ++argv;
  tqbq_common(argc, argv, 1);
}


x86 assembly (clang, -O0):
<topq_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    114a <topq_cmd+0x2a>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
jmp    1170 <topq_cmd+0x50>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <tqbq_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<topq_cmd>:
cmp    $0x2,%edi
jg     1131 <topq_cmd+0x11>
lea    0xed4(%rip),%rdi
jmp    1030 <puts@plt>
add    $0xffffffff,%edi
add    $0x8,%rsi
mov    $0x1,%edx
jmp    1040 <tqbq_common@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"usage: topq printer [jobspec ...]\0A\00"
define void @topq_cmd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %17
9: ; preds = %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, -1
store i32 %11, i32* %3
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %4
%14 = load i32, i32* %3
%15 = load i8**, i8*** %4
%16 = call i32 @tqbq_common(i32 %14, i8** %15, i32 1)
br label %17
17: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"usage: topq printer [jobspec ...]\00"
define void @topq_cmd(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = tail call i32 @tqbq_common(i32 %7, i8** %8, i32 1)
br label %10
10: ; preds = %6, %4
ret void
}
int color_offset_f1(int x, int y) { return ((y) - ((547 * (x)) / 503) + 31); }


x86 assembly (clang, -O0):
<color_offset_f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x223,-0x4(%rbp),%eax
mov    $0x1f7,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
add    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f1>:
imul   $0x223,%edi,%eax
cltq
imul   $0x7db5b19f,%rax,%rcx
shr    $0x20,%rcx
sub    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x8,%ecx
add    %eax,%ecx
lea    (%rsi,%rcx,1),%eax
add    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 547, %6
%8 = sdiv i32 %7, 503
%9 = sub nsw i32 %5, %8
%10 = add nsw i32 %9, 31
ret i32 %10
}

LLVM IR (-O2):
define i32 @color_offset_f1(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 547
%4 = sdiv i32 %3, -503
%5 = add i32 %1, 31
%6 = add i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ log_f(char *);
unsigned keyb_none_get(unsigned keyboard, unsigned code) {
  log_f("keyb:none: keyb_none_get()\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<keyb_none_get>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <log_f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"keyb:none: keyb_none_get()\0A\00"
define i32 @keyb_none_get(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @log_f(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"keyb:none: keyb_none_get()\0A\00"
define i32 @keyb_none_get(i32 %0, i32 %1) {
%3 = tail call i32 @log_f(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int PAPI_ipc(float *, float *, long long *, float *);
void papif_ipc__(float *rtime, float *ptime, long long *ins, float *ipc,
                 int *check) {
  *check = PAPI_ipc(rtime, ptime, ins, ipc);
}


x86 assembly (clang, -O0):
<papif_ipc__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <PAPI_ipc@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_ipc__>:
push   %rbx
mov    %r8,%rbx
call   1030 <PAPI_ipc@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_ipc__(float* %0, float* %1, i64* %2, float* %3, i32* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64*
%9 = alloca float*
%10 = alloca i32*
store float* %0, float** %6
store float* %1, float** %7
store i64* %2, i64** %8
store float* %3, float** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load float*, float** %7
%13 = load i64*, i64** %8
%14 = load float*, float** %9
%15 = call i32 @PAPI_ipc(float* %11, float* %12, i64* %13, float* %14)
%16 = load i32*, i32** %10
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @papif_ipc__(float* %0, float* %1, i64* %2, float* %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @PAPI_ipc(float* %0, float* %1, i64* %2, float* %3)
store i32 %6, i32* %4
ret void
}
/* Type definitions */
struct imv_window {
  int dummy;
};

/* Variables and functions */
struct imv_window *imv_window_create(int w, int h, const char *title) {
  (void)w;
  (void)h;
  (void)title;
  return NULL;
}


x86 assembly (clang, -O0):
<imv_window_create>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.imv_window = type { i32 }
define %struct.imv_window* @imv_window_create(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
ret %struct.imv_window* null
}

LLVM IR (-O2):
%struct.imv_window = type { i32 }
define noalias %struct.imv_window* @imv_window_create(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret %struct.imv_window* null
}
unsigned f4(unsigned x) { return (x % 5) % 6; }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
mov    $0x6,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    %edi,%eax
mov    %edi,%ecx
mov    $0xcccccccd,%edx
imul   %rcx,%rdx
shr    $0x22,%rdx
lea    (%rdx,%rdx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f4(i32 %0) {
%2 = urem i32 %0, 5
ret i32 %2
}
char *__VERIFIER_nondet_pchar(void) {
  char *pc;
  { return (pc); }
}


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

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

LLVM IR (-O0):
define i8* @__VERIFIER_nondet_pchar() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @__VERIFIER_nondet_pchar() {
ret i8* undef
}
void ttywrch(int ch) {}


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

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

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

LLVM IR (-O2):
define void @ttywrch(i32 %0) {
ret void
}
void mat4_getTranslation(float *dst, float *mat) {
  dst[0] = mat[12];
  dst[1] = mat[13];
  dst[2] = mat[14];
}


x86 assembly (clang, -O0):
<mat4_getTranslation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  0x30(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x34(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x38(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4_getTranslation>:
movss  0x30(%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x34(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x38(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @mat4_getTranslation(float* nocapture writeonly %0, float* nocapture %1) {
%3 = getelementptr inbounds float, float* %1, i64 12
%4 = load float, float* %3
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 13
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %0, i64 1
store float %6, float* %7
%8 = getelementptr inbounds float, float* %1, i64 14
%9 = load float, float* %8
%10 = getelementptr inbounds float, float* %0, i64 2
store float %9, float* %10
ret void
}