xunge/DecIR huggingface dataset:
int main() {
  char t[] = "asdf";
  return t[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeef(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xeea(%rip),%al
mov    %al,-0x5(%rbp)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.t = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = bitcast [5 x i8]* %2 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 97
}
/* Variables and functions */
int /*<<< orphan*/ use(char *);
void test_most_a() {
  char a[] = "aaaaazaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
  use(a);
}


x86 assembly (clang, -O0):
<test_most_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x3f,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <use@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_most_a>:
sub    $0x48,%rsp
movups 0xf14(%rip),%xmm0
movups %xmm0,0x2f(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <use@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.test_most_a.a = [63 x i8] c"aaaaazaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
define void @test_most_a() {
%1 = alloca [63 x i8]
%2 = bitcast [63 x i8]* %1 to i8*
%3 = getelementptr inbounds [63 x i8], [63 x i8]* %1, i64 0, i64 0
%4 = call i32 @use(i8* %3)
ret void
}

LLVM IR (-O2):
@__const.test_most_a.a = [63 x i8] c"aaaaazaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
define void @test_most_a() {
%1 = alloca [63 x i8]
%2 = getelementptr inbounds [63 x i8], [63 x i8]* %1, i64 0, i64 0
%3 = call i32 @use(i8* %2)
ret void
}
double clad_clampd(double value, double min, double max) {
  if (value < min)
    return min;
  if (value > max)
    return max;
  return value;
}


x86 assembly (clang, -O0):
<clad_clampd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <clad_clampd+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clad_clampd+0x5f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <clad_clampd+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clad_clampd+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_clampd>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @clad_clampd(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @clad_clampd(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ float_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  if (sizeof(float_t) == sizeof(double) && 0 != 1)
    abort();
  if (sizeof(float_t) == sizeof(float) && 0 != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void abcde2fghijklmn9opqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcde2fghijklmn9opqrstuvwxzy() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int __infer_nondet_int();
int pthread_mutex_init(pthread_mutex_t *__restrict mutex,
                       const pthread_mutexattr_t *__restrict attr) {
  if (mutex == 0)
    while (1)
      ;
  return __infer_nondet_int();
}


x86 assembly (clang, -O0):
<pthread_mutex_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1135 <pthread_mutex_init+0x25>
jmp    1130 <pthread_mutex_init+0x20>
jmp    1130 <pthread_mutex_init+0x20>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_init>:
test   %rdi,%rdi
je     1120 <pthread_mutex_init+0x10>
xor    %eax,%eax
jmp    1030 <__infer_nondet_int@plt>
nopl   0x0(%rax)
jmp    1120 <pthread_mutex_init+0x10>

LLVM IR (-O0):
define i32 @pthread_mutex_init(i32* noalias %0, i32* noalias %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
br label %8
8: ; preds = %7, %8
br label %8
9: ; preds = %2
%10 = call i32 (...) @__infer_nondet_int()
ret i32 %10
}

LLVM IR (-O2):
define i32 @pthread_mutex_init(i32* noalias readnone %0, i32* noalias nocapture readnone %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %4, label %5
4: ; preds = %2, %4
br label %4
5: ; preds = %2
%6 = tail call i32 (...) @__infer_nondet_int()
ret i32 %6
}
void create_spin_CCW(int speed) {}


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

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

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

LLVM IR (-O2):
define void @create_spin_CCW(i32 %0) {
ret void
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int addrcmp(const void *s1, const void *s2) { return memcmp(s1, s2, 6); }


x86 assembly (clang, -O0):
<addrcmp>:
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    $0x6,%edx
call   1030 <memcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addrcmp>:
mov    $0x6,%edx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define i32 @addrcmp(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 i32 @memcmp(i8* %5, i8* %6, i32 6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @addrcmp(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 6)
ret i32 %3
}
/* Variables and functions */
scalar_t__ manhattan_dist(short *);
short is_solved(short *puzzle) { return manhattan_dist(puzzle) == 0; }


x86 assembly (clang, -O0):
<is_solved>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <manhattan_dist@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_solved>:
push   %rax
call   1030 <manhattan_dist@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @is_solved(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = call i64 @manhattan_dist(i16* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = trunc i32 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @is_solved(i16* %0) {
%2 = tail call i64 @manhattan_dist(i16* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i16
ret i16 %4
}
/* Variables and functions */
scalar_t__ dl_get_sym(char *);
int stub1();
int dl_reduce() { return (*(int (*)())dl_get_sym("dl_reduce"))(); }


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

x86 assembly (clang, -O2):
<dl_reduce>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <dl_get_sym@plt>
mov    %rax,%rcx
xor    %eax,%eax
pop    %rdx
jmp    *%rcx

LLVM IR (-O0):
@.str = [10 x i8] c"dl_reduce\00"
define i32 @dl_reduce() {
%1 = call i64 @dl_get_sym(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = inttoptr i64 %1 to i32 (...)*
%3 = call i32 (...) %2()
ret i32 %3
}

LLVM IR (-O2):
@.str = [10 x i8] c"dl_reduce\00"
define i32 @dl_reduce() {
%1 = tail call i64 @dl_get_sym(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = inttoptr i64 %1 to i32 (...)*
%3 = tail call i32 (...) %2()
ret i32 %3
}
/* Variables and functions */
scalar_t__ is_keyword(char *, char *);
scalar_t__ matches(char *, char *);
int is_end(char *line, char *type) {
  return is_keyword(line, "end") && matches(line + 1 + 4, type);
}


x86 assembly (clang, -O0):
<is_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <is_keyword@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1171 <is_end+0x51>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <matches@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_end>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
call   1030 <is_keyword@plt>
test   %rax,%rax
je     1157 <is_end+0x37>
add    $0x5,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <matches@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1159 <is_end+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"end\00"
define i32 @is_end(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 = call i64 @is_keyword(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = getelementptr inbounds i8, i8* %10, i64 4
%12 = load i8*, i8** %4
%13 = call i64 @matches(i8* %11, i8* %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %8, %2
%16 = phi i1 [ false, %2 ], [ %14, %8 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"end\00"
define i32 @is_end(i8* %0, i8* %1) {
%3 = tail call i64 @is_keyword(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 5
%7 = tail call i64 @matches(i8* %6, i8* %1)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %2
%11 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ CogerTenedores(int);
int /*<<< orphan*/ Comer(int);
int /*<<< orphan*/ Pensar(int);
int /*<<< orphan*/ SoltarTenedores(int);
void *Filosofo(void *id) {
  int indice, i;
  indice = *(int *)id;
  for (i = 0; i < 100; i++) {
    Pensar(indice);
    CogerTenedores(indice);
    Comer(indice);
    SoltarTenedores(indice);
  }
}


x86 assembly (clang, -O0):
<Filosofo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x64,-0x18(%rbp)
jge    1194 <Filosofo+0x54>
mov    -0x14(%rbp),%edi
call   1060 <Pensar@plt>
mov    -0x14(%rbp),%edi
call   1040 <CogerTenedores@plt>
mov    -0x14(%rbp),%edi
call   1030 <Comer@plt>
mov    -0x14(%rbp),%edi
call   1050 <SoltarTenedores@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115c <Filosofo+0x1c>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Filosofo>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%ebx
mov    $0x64,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1060 <Pensar@plt>
mov    %ebx,%edi
call   1040 <CogerTenedores@plt>
mov    %ebx,%edi
call   1030 <Comer@plt>
mov    %ebx,%edi
call   1050 <SoltarTenedores@plt>
add    $0xffffffff,%ebp
jne    1150 <Filosofo+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @Filosofo(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
br label %4
4: ; preds = %1, %4
%5 = phi i32 [ 0, %1 ], [ %10, %4 ]
%6 = tail call i32 @Pensar(i32 %3)
%7 = tail call i32 @CogerTenedores(i32 %3)
%8 = tail call i32 @Comer(i32 %3)
%9 = tail call i32 @SoltarTenedores(i32 %3)
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, 100
br i1 %11, label %12, label %4
12: ; preds = %4
ret i8* undef
}
/* Type definitions */
struct splaytree_node {
  int dummy;
};

/* Variables and functions */
struct splaytree_node *get_left(struct splaytree_node *);
struct splaytree_node *get_first(struct splaytree_node *node) {
  struct splaytree_node *left;
  while ((left = get_left(node)))
    node = left;
  return node;
}


x86 assembly (clang, -O0):
<get_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_left@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1140 <get_first+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    111c <get_first+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_first>:
push   %rbx
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <get_left@plt>
test   %rax,%rax
jne    1120 <get_first+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.splaytree_node = type { i32 }
define %struct.splaytree_node* @get_first(%struct.splaytree_node* %0) {
%2 = alloca %struct.splaytree_node*
%3 = alloca %struct.splaytree_node*
store %struct.splaytree_node* %0, %struct.splaytree_node** %2
br label %4
4: ; preds = %8, %1
%5 = load %struct.splaytree_node*, %struct.splaytree_node** %2
%6 = call %struct.splaytree_node* @get_left(%struct.splaytree_node* %5)
store %struct.splaytree_node* %6, %struct.splaytree_node** %3
%7 = icmp ne %struct.splaytree_node* %6, null
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load %struct.splaytree_node*, %struct.splaytree_node** %3
store %struct.splaytree_node* %9, %struct.splaytree_node** %2
br label %4
10: ; preds = %4
%11 = load %struct.splaytree_node*, %struct.splaytree_node** %2
ret %struct.splaytree_node* %11
}

LLVM IR (-O2):
%struct.splaytree_node = type { i32 }
define %struct.splaytree_node* @get_first(%struct.splaytree_node* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi %struct.splaytree_node* [ %0, %1 ], [ %4, %2 ]
%4 = tail call %struct.splaytree_node* @get_left(%struct.splaytree_node* %3)
%5 = icmp eq %struct.splaytree_node* %4, null
br i1 %5, label %6, label %2
6: ; preds = %2
ret %struct.splaytree_node* %3
}
/* Variables and functions */
double exp(double);
double pow(double, double);
double f(double x, void *params) {
  double n = *(double *)params;
  double f = exp(-x) * pow(x, n);
  return f;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x28,%rsp
movaps %xmm0,%xmm1
movaps %xmm0,0x10(%rsp)
movsd  (%rdi),%xmm0
movsd  %xmm0,0x8(%rsp)
movaps 0xec3(%rip),%xmm0
xorps  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <pow@plt>
mulsd  (%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @f(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
store double %9, double* %5
%10 = load double, double* %3
%11 = fneg double %10
%12 = call double @exp(double %11)
%13 = load double, double* %3
%14 = load double, double* %5
%15 = call double @pow(double %13, double %14)
%16 = fmul double %12, %15
store double %16, double* %6
%17 = load double, double* %6
ret double %17
}

LLVM IR (-O2):
define double @f(double %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to double*
%4 = load double, double* %3
%5 = fneg double %0
%6 = tail call double @exp(double %5)
%7 = tail call double @pow(double %0, double %4)
%8 = fmul double %6, %7
ret double %8
}
void arch_local_irq_disable(void) { asm volatile("cli" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @arch_local_irq_disable() {
tail call void asm sideeffect "cli", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M260_f(char *s) {
  debug("M260_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M260_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M260_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M260_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M260_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M260_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M260_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int cpuid_eax(int /*<<< orphan*/);
int cpuid_ecx(int);
int cpu_has_effective_freq() {
  if (cpuid_eax(0) < 6)
    return 0;
  return cpuid_ecx(6) & 0x1;
}


x86 assembly (clang, -O0):
<cpu_has_effective_freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <cpuid_eax@plt>
cmp    $0x6,%eax
jge    1144 <cpu_has_effective_freq+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1154 <cpu_has_effective_freq+0x34>
mov    $0x6,%edi
call   1030 <cpuid_ecx@plt>
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_has_effective_freq>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <cpuid_eax@plt>
cmp    $0x6,%eax
jl     113e <cpu_has_effective_freq+0x1e>
mov    $0x6,%edi
call   1030 <cpuid_ecx@plt>
mov    %eax,%ebx
and    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpu_has_effective_freq() {
%1 = alloca i32
%2 = call i32 @cpuid_eax(i32 0)
%3 = icmp slt i32 %2, 6
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %8
5: ; preds = %0
%6 = call i32 @cpuid_ecx(i32 6)
%7 = and i32 %6, 1
store i32 %7, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpu_has_effective_freq() {
%1 = tail call i32 @cpuid_eax(i32 0)
%2 = icmp slt i32 %1, 6
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @cpuid_ecx(i32 6)
%5 = and i32 %4, 1
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 0, %0 ]
ret i32 %7
}
unsigned long long umin2(unsigned long long a, unsigned long long b) {
  return a ^ ((a ^ b) & -(a >= b));
}


x86 assembly (clang, -O0):
<umin2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
xor    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
cmp    -0x10(%rbp),%rdx
setae  %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
movslq %edx,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umin2>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @umin2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = xor i64 %6, %7
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = icmp uge i64 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
%14 = sext i32 %13 to i64
%15 = and i64 %8, %14
%16 = xor i64 %5, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @umin2(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a;
  int b;
  scanf("%d%d", &a, &b);
  printf("%d, %d\n", a, b);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [8 x i8] c"%d, %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 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: sm64geo [-l LENGTH] [-o OFFSET] FILE\n"
                  "\n"
                  "sm64geo v"
                  "0.1"
                  ": Super Mario 64 geometry layout decoder\n"
                  "\n"
                  "Optional arguments:\n"
                  " -l LENGTH    length of data to decode in bytes (default: "
                  "length of file)\n"
                  " -o OFFSET    starting offset in FILE (default: 0)\n"
                  "\n"
                  "File arguments:\n"
                  " FILE        input file\n"
                  " [OUTPUT]    output file (default: stdout)\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [329 x i8] c"Usage: sm64geo [-l LENGTH] [-o OFFSET] FILE\0A\0Asm64geo v0.1: Super Mario 64 geometry layout decoder\0A\0AOptional arguments:\0A -l LENGTH length of data to decode in bytes (default: length of file)\0A -o OFFSET starting offset in FILE (default: 0)\0A\0AFile arguments:\0A FILE input file\0A [OUTPUT] output file (default: stdout)\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([329 x i8], [329 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [329 x i8] c"Usage: sm64geo [-l LENGTH] [-o OFFSET] FILE\0A\0Asm64geo v0.1: Super Mario 64 geometry layout decoder\0A\0AOptional arguments:\0A -l LENGTH length of data to decode in bytes (default: length of file)\0A -o OFFSET starting offset in FILE (default: 0)\0A\0AFile arguments:\0A FILE input file\0A [OUTPUT] output file (default: stdout)\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([329 x i8], [329 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int g5_get_jmemsize();
int(g5_get_jmemsize_)() { return g5_get_jmemsize(); }


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

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

LLVM IR (-O0):
define i32 @g5_get_jmemsize_() {
%1 = call i32 (...) @g5_get_jmemsize()
ret i32 %1
}

LLVM IR (-O2):
define i32 @g5_get_jmemsize_() {
%1 = tail call i32 (...) @g5_get_jmemsize()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ init_map_types_shared_sub(int /*<<< orphan*/, int, int);
void init_map_lakes() {
  init_map_types_shared_sub(0, 5, 3);
  init_map_types_shared_sub(0, 3, 2);
  init_map_types_shared_sub(0, 2, 1);
}


x86 assembly (clang, -O0):
<init_map_lakes>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x5,%esi
mov    $0x3,%edx
call   1030 <init_map_types_shared_sub@plt>
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <init_map_types_shared_sub@plt>
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <init_map_types_shared_sub@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_map_lakes>:
push   %rax
xor    %edi,%edi
mov    $0x5,%esi
mov    $0x3,%edx
call   1030 <init_map_types_shared_sub@plt>
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <init_map_types_shared_sub@plt>
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <init_map_types_shared_sub@plt>

LLVM IR (-O0):
define void @init_map_lakes() {
%1 = call i32 @init_map_types_shared_sub(i32 0, i32 5, i32 3)
%2 = call i32 @init_map_types_shared_sub(i32 0, i32 3, i32 2)
%3 = call i32 @init_map_types_shared_sub(i32 0, i32 2, i32 1)
ret void
}

LLVM IR (-O2):
define void @init_map_lakes() {
%1 = tail call i32 @init_map_types_shared_sub(i32 0, i32 5, i32 3)
%2 = tail call i32 @init_map_types_shared_sub(i32 0, i32 3, i32 2)
%3 = tail call i32 @init_map_types_shared_sub(i32 0, i32 2, i32 1)
ret void
}
int test_imm_63uint16_reg(unsigned short val) {
  return ((val) & (0x63 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_63uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x63,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_63uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 99
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_randombytes();
int init_randombytes();
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ print_buffer(unsigned char *);
int /*<<< orphan*/ randombytes(unsigned char *, int);
int main(int argc, char **argv) {
  unsigned char randomness[8];
  int retval = init_randombytes();
  memset(randomness, 0, 8);
  print_buffer(randomness);
  randombytes(randomness, 8);
  print_buffer(randomness);
  cleanup_randombytes();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <init_randombytes@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x18(%rbp),%rdi
call   1070 <print_buffer@plt>
lea    -0x18(%rbp),%rdi
mov    $0x8,%esi
call   1050 <randombytes@plt>
lea    -0x18(%rbp),%rdi
call   1070 <print_buffer@plt>
mov    $0x0,%al
call   1030 <cleanup_randombytes@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <init_randombytes@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1070 <print_buffer@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1050 <randombytes@plt>
mov    %rbx,%rdi
call   1070 <print_buffer@plt>
xor    %eax,%eax
call   1030 <cleanup_randombytes@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @init_randombytes()
store i32 %8, i32* %7
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%10 = call i32 @memset(i8* %9, i32 0, i32 8)
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%12 = call i32 @print_buffer(i8* %11)
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%14 = call i32 @randombytes(i8* %13, i32 8)
%15 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%16 = call i32 @print_buffer(i8* %15)
%17 = call i32 (...) @cleanup_randombytes()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (...) @init_randombytes()
%6 = call i32 @memset(i8* %4, i32 0, i32 8)
%7 = call i32 @print_buffer(i8* %4)
%8 = call i32 @randombytes(i8* %4, i32 8)
%9 = call i32 @print_buffer(i8* %4)
%10 = call i32 (...) @cleanup_randombytes()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmx_cluster(int, char **);
int main(int argc, char *argv[]) {
  gmx_cluster(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_cluster(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(unsigned int, unsigned int *, unsigned int *,
                         unsigned int *, unsigned int *);
__attribute__((always_)) unsigned int cpuid_ebx(unsigned int op) {
  unsigned int eax, ebx, ecx, edx;
  cpuid(op, &eax, &ebx, &ecx, &edx);
  return ebx;
}


x86 assembly (clang, -O0):
<cpuid_ebx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ebx>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @cpuid_ebx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @cpuid(i32 %0, i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %3
ret i32 %11
}
int absval(int n) { return n < 0 ? -n : n; }


x86 assembly (clang, -O0):
<absval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <absval+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <absval+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @absval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @absval(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int ENXIO;
int pm8921_is_dc_chg_plugged_in(void) { return -ENXIO; }


x86 assembly (clang, -O0):
<pm8921_is_dc_chg_plugged_in>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_is_dc_chg_plugged_in>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @pm8921_is_dc_chg_plugged_in() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @pm8921_is_dc_chg_plugged_in() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
char *strrchr(char *, char);
char *dirname(char *path) {
  char *p;
  p = strrchr(path, '/');
  if (!p)
    return path + strlen(path);
  *p = '\0';
  return path;
}


x86 assembly (clang, -O0):
<dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <dirname+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    117e <dirname+0x5e>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirname>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1138 <dirname+0x18>
movb   $0x0,(%rax)
jmp    1145 <dirname+0x25>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @dirname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
br label %9
8: ; preds = %1
store i8 0, i8* %2
br label %9
9: ; preds = %8, %4
%10 = phi i8* [ %0, %8 ], [ %7, %4 ]
ret i8* %10
}
void t1() {
  int array[1] = {0};
  char sudirript = 0;
  int val = array[sudirript];
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movb   $0x0,-0x5(%rbp)
movsbq -0x5(%rbp),%rax
mov    -0x4(%rbp,%rax,4),%eax
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @t1() {
%1 = alloca [1 x i32]
%2 = alloca i8
%3 = alloca i32
%4 = bitcast [1 x i32]* %1 to i8*
store i8 0, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i64
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 %6
%8 = load i32, i32* %7
store i32 %8, i32* %3
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @buildList() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void ui_info(const char *msg) { printf("%s\n", msg); }


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

x86 assembly (clang, -O2):
<ui_info>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @ui_info(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @ui_info(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int fork();
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0, status, j = 0;
  i = fork();
  if (i > 0) {
    i = fork();
  }
  printf("Ha terminato %d\n", getpid());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    116b <main+0x3b>
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
jle    1143 <main+0x13>
xor    %eax,%eax
call   1050 <fork@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Ha terminato %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %4
%5 = call i32 (...) @fork()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @fork()
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %0
%11 = call i32 (...) @getpid()
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [17 x i8] c"Ha terminato %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @fork()
br label %5
5: ; preds = %3, %0
%6 = tail call i32 (...) @getpid()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DelayMs(int);
int /*<<< orphan*/ nokia_lcd_cmd(int);
void nokia_lcd_flash(char flash_number) {
  while (flash_number > 0) {
    DelayMs(1500);
    nokia_lcd_cmd(0x0d);
    DelayMs(1500);
    nokia_lcd_cmd(0x0c);
    flash_number--;
  }
}


x86 assembly (clang, -O0):
<nokia_lcd_flash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jle    1170 <nokia_lcd_flash+0x50>
mov    $0x5dc,%edi
call   1040 <DelayMs@plt>
mov    $0xd,%edi
call   1030 <nokia_lcd_cmd@plt>
mov    $0x5dc,%edi
call   1040 <DelayMs@plt>
mov    $0xc,%edi
call   1030 <nokia_lcd_cmd@plt>
mov    -0x1(%rbp),%al
add    $0xff,%al
mov    %al,-0x1(%rbp)
jmp    112e <nokia_lcd_flash+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nokia_lcd_flash>:
push   %rbx
mov    %edi,%ebx
test   %bl,%bl
jle    1160 <nokia_lcd_flash+0x40>
add    $0x1,%bl
nopw   0x0(%rax,%rax,1)
mov    $0x5dc,%edi
call   1040 <DelayMs@plt>
mov    $0xd,%edi
call   1030 <nokia_lcd_cmd@plt>
mov    $0x5dc,%edi
call   1040 <DelayMs@plt>
mov    $0xc,%edi
call   1030 <nokia_lcd_cmd@plt>
add    $0xff,%bl
cmp    $0x1,%bl
ja     1130 <nokia_lcd_flash+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @nokia_lcd_flash(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = call i32 @DelayMs(i32 1500)
%9 = call i32 @nokia_lcd_cmd(i32 13)
%10 = call i32 @DelayMs(i32 1500)
%11 = call i32 @nokia_lcd_cmd(i32 12)
%12 = load i8, i8* %2
%13 = add i8 %12, -1
store i8 %13, i8* %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @nokia_lcd_flash(i8 signext %0) {
%2 = icmp sgt i8 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i8 [ %9, %3 ], [ %0, %1 ]
%5 = tail call i32 @DelayMs(i32 1500)
%6 = tail call i32 @nokia_lcd_cmd(i32 13)
%7 = tail call i32 @DelayMs(i32 1500)
%8 = tail call i32 @nokia_lcd_cmd(i32 12)
%9 = add nsw i8 %4, -1
%10 = icmp ugt i8 %4, 1
br i1 %10, label %3, label %11
11: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handler(int i) { exit(0); }


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
page1() {
  printf("  You wake up face down on the red and pink checked E-Z-Kleen "
         "linoleum floor.\n");
  printf("  You recognise the pattern, it\'s the type preferred in the "
         "internal security\nbriefing cells.  When you finally look around "
         "you, you see that you are alone\n");
  printf("in a large mission briefing room.\n");
  return 57;
}


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

x86 assembly (clang, -O2):
<page1>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2a(%rip),%rdi
call   1030 <puts@plt>
lea    0xfba(%rip),%rdi
call   1030 <puts@plt>
mov    $0x39,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [79 x i8] c" You wake up face down on the red and pink checked E-Z-Kleen linoleum floor.\0A\00"
@.str.1 = [157 x i8] c" You recognise the pattern, it's the type preferred in the internal security\0Abriefing cells. When you finally look around you, you see that you are alone\0A\00"
@.str.2 = [35 x i8] c"in a large mission briefing room.\0A\00"
define i32 @page1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret i32 57
}

LLVM IR (-O2):
@str = [78 x i8] c" You wake up face down on the red and pink checked E-Z-Kleen linoleum floor.\00"
@str.3 = [156 x i8] c" You recognise the pattern, it's the type preferred in the internal security\0Abriefing cells. When you finally look around you, you see that you are alone\00"
@str.4 = [34 x i8] c"in a large mission briefing room.\00"
define i32 @page1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([156 x i8], [156 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
ret i32 57
}