xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *name = argv[1];
  if (name == NULL) {
    name = "anonymous";
  }
  printf("Hello, %s!\n", name);
}


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1148 <main+0x38>
lea    0xebc(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rax
test   %rax,%rax
lea    0xee1(%rip),%rsi
cmovne %rax,%rsi
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"anonymous\00"
@.str.1 = [12 x i8] c"Hello, %s!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}
void maximum(long double *result, const long double x, long double *unused) {
  *result = (((*result) > (x)) ? (*result) : (x));
}


x86 assembly (clang, -O0):
<maximum>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    113a <maximum+0x3a>
jmp    112c <maximum+0x2c>
mov    -0x8(%rbp),%rax
fldt   (%rax)
fstpt  -0x34(%rbp)
jmp    1140 <maximum+0x40>
fldt   -0x20(%rbp)
fstpt  -0x34(%rbp)
fldt   -0x34(%rbp)
mov    -0x8(%rbp),%rax
fstpt  (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximum>:
fldt   0x8(%rsp)
fldt   (%rdi)
fucomi %st(1),%st
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
fstpt  (%rdi)
ret

LLVM IR (-O0):
define void @maximum(x86_fp80* %0, x86_fp80 %1, x86_fp80* %2) {
%4 = alloca x86_fp80*
%5 = alloca x86_fp80
%6 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80* %2, x86_fp80** %6
%7 = load x86_fp80*, x86_fp80** %4
%8 = load x86_fp80, x86_fp80* %7
%9 = load x86_fp80, x86_fp80* %5
%10 = fcmp ogt x86_fp80 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load x86_fp80*, x86_fp80** %4
%13 = load x86_fp80, x86_fp80* %12
br label %16
14: ; preds = %3
%15 = load x86_fp80, x86_fp80* %5
br label %16
16: ; preds = %14, %11
%17 = phi x86_fp80 [ %13, %11 ], [ %15, %14 ]
%18 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %17, x86_fp80* %18
ret void
}

LLVM IR (-O2):
define void @maximum(x86_fp80* nocapture %0, x86_fp80 %1, x86_fp80* nocapture readnone %2) {
%4 = load x86_fp80, x86_fp80* %0
%5 = fcmp ogt x86_fp80 %4, %1
%6 = select i1 %5, x86_fp80 %4, x86_fp80 %1
store x86_fp80 %6, x86_fp80* %0
ret void
}
/* Type definitions */
struct stat {
  int st_dev;
  int st_ino;
};
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
key_t ftok(const char *path, int id) {
  struct stat st;
  if (stat(path, &st) < 0)
    return (key_t)-1;
  return (key_t)(id << 24 | (st.st_dev & 0xff) << 16 | (st.st_ino & 0xffff));
}


x86 assembly (clang, -O0):
<ftok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    1142 <ftok+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <ftok+0x54>
mov    -0x14(%rbp),%eax
shl    $0x18,%eax
mov    -0x20(%rbp),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x1c(%rbp),%ecx
and    $0xffff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftok>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     113e <ftok+0x2e>
shl    $0x18,%ebx
mov    0x8(%rsp),%eax
movzbl %al,%ecx
shl    $0x10,%ecx
or     %ebx,%ecx
movzwl 0xc(%rsp),%eax
or     %ecx,%eax
jmp    1143 <ftok+0x33>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32 }
define i32 @ftok(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.stat
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = call i64 @stat(i8* %7, %struct.stat* %6)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %23
11: ; preds = %2
%12 = load i32, i32* %5
%13 = shl i32 %12, 24
%14 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%15 = load i32, i32* %14
%16 = and i32 %15, 255
%17 = shl i32 %16, 16
%18 = or i32 %13, %17
%19 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 1
%20 = load i32, i32* %19
%21 = and i32 %20, 65535
%22 = or i32 %18, %21
store i32 %22, i32* %3
br label %23
23: ; preds = %11, %10
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
define i32 @ftok(i8* %0, i32 %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i64 @stat(i8* %0, %struct.stat* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %18, label %7
7: ; preds = %2
%8 = shl i32 %1, 24
%9 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%10 = load i32, i32* %9
%11 = shl i32 %10, 16
%12 = and i32 %11, 16711680
%13 = or i32 %12, %8
%14 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1
%15 = load i32, i32* %14
%16 = and i32 %15, 65535
%17 = or i32 %13, %16
br label %18
18: ; preds = %2, %7
%19 = phi i32 [ %17, %7 ], [ -1, %2 ]
ret i32 %19
}
int main() {
  int i = 0;
  do
    i++;
  while (i < 10);
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1112 <main+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(void) { foo(5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
void fput_int(int val, FILE *file) { fwrite(&val, sizeof(int), 1, file); }


x86 assembly (clang, -O0):
<fput_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fput_int>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @fput_int(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 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %5)
ret void
}

LLVM IR (-O2):
define void @fput_int(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %1)
ret void
}
void symbol11_optional() {}


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

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

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

LLVM IR (-O2):
define void @symbol11_optional() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M204_f(char *s) {
  debug("M204_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M204_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):
<M204_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"M204_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M204_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"M204_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M204_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
}
int sllq_version_patch(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @sllq_version_patch() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sllq_version_patch() {
ret i32 0
}
/* Variables and functions */
char *strrchr(char *, char);
char *getExtension(char *name) {
  if (name) {
    char *ext = strrchr(name, '.');
    if (ext) {
      return ext + 1;
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<getExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115a <getExtension+0x4a>
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1155 <getExtension+0x45>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <getExtension+0x52>
jmp    115a <getExtension+0x4a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getExtension>:
test   %rdi,%rdi
je     112f <getExtension+0x1f>
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     112f <getExtension+0x1f>
add    $0x1,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @getExtension(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 46)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %5, label %7, label %8
7: ; preds = %3, %1
br label %8
8: ; preds = %3, %7
%9 = phi i8* [ %6, %3 ], [ null, %7 ]
ret i8* %9
}
int check_rule_list(struct rule_list *rules, unsigned int rule_count) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct.rule_list = type opaque
define i32 @check_rule_list(%struct.rule_list* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
unsigned int bytestream_get_le32(const uint8_t **b) {
  (*b) += 4;
  return (((uint32_t)((const uint8_t *)(*b - 4))[3] << 24) |
          (((const uint8_t *)(*b - 4))[2] << 16) |
          (((const uint8_t *)(*b - 4))[1] << 8) |
          ((const uint8_t *)(*b - 4))[0]);
}


x86 assembly (clang, -O0):
<bytestream_get_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x4(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0xc(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
or     -0x10(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytestream_get_le32>:
mov    (%rdi),%rcx
lea    0x10(%rcx),%rax
mov    %rax,(%rdi)
mov    0xc(%rcx),%edx
shl    $0x18,%edx
mov    0x4(%rcx),%eax
mov    0x8(%rcx),%esi
shl    $0x10,%esi
or     %edx,%esi
shl    $0x8,%eax
or     %esi,%eax
or     (%rcx),%eax
ret

LLVM IR (-O0):
define i32 @bytestream_get_le32(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 4
store i32* %5, i32** %3
%6 = load i32**, i32*** %2
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 -4
%9 = getelementptr inbounds i32, i32* %8, i64 3
%10 = load i32, i32* %9
%11 = shl i32 %10, 24
%12 = load i32**, i32*** %2
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i64 -4
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = shl i32 %16, 16
%18 = or i32 %11, %17
%19 = load i32**, i32*** %2
%20 = load i32*, i32** %19
%21 = getelementptr inbounds i32, i32* %20, i64 -4
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = shl i32 %23, 8
%25 = or i32 %18, %24
%26 = load i32**, i32*** %2
%27 = load i32*, i32** %26
%28 = getelementptr inbounds i32, i32* %27, i64 -4
%29 = getelementptr inbounds i32, i32* %28, i64 0
%30 = load i32, i32* %29
%31 = or i32 %25, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @bytestream_get_le32(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 4
store i32* %3, i32** %0
%4 = getelementptr inbounds i32, i32* %2, i64 3
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = getelementptr inbounds i32, i32* %2, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %9, %6
%11 = getelementptr inbounds i32, i32* %2, i64 1
%12 = load i32, i32* %11
%13 = shl i32 %12, 8
%14 = or i32 %10, %13
%15 = load i32, i32* %2
%16 = or i32 %14, %15
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("enter main\n");
  printf("leave main\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"enter main\0A\00"
@.str.1 = [12 x i8] c"leave main\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"enter main\00"
@str.2 = [11 x i8] c"leave main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printStr(char *);
int __attribute__((weak)) main(int argc, char **argv) {
  printStr("Implement main(), foo!\n");
  return -1;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printStr@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"Implement main(), foo!\0A\00"
define weak 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 = call i32 @printStr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [24 x i8] c"Implement main(), foo!\0A\00"
define weak i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @printStr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int isless(float f1, float f2) {
  int r = __builtin_isless(f1, f2);
  return !r ? -1 : 1;
}


x86 assembly (clang, -O0):
<isless>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %dl
xor    $0xff,%dl
mov    $0x1,%eax
mov    $0xffffffff,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isless>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @isless(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fcmp olt float %6, %7
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 -1, i32 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @isless(float %0, float %1) {
%3 = fcmp uge float %0, %1
%4 = select i1 %3, i32 -1, i32 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void set_byte(int32_t id, int32_t addr, int32_t value) {}


x86 assembly (clang, -O0):
<set_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @set_byte(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @set_byte(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("This is a C program, and it's my first one too.\n");
  printf("In case you wanted to know, C is actually a simple language\n");
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"This is a C program, and it's my first one too.\0A\00"
@.str.1 = [61 x i8] c"In case you wanted to know, C is actually a simple language\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [48 x i8] c"This is a C program, and it's my first one too.\00"
@str.2 = [60 x i8] c"In case you wanted to know, C is actually a simple language\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gameplay_bombs_cleanup();
int /*<<< orphan*/ gameplay_items_cleanup();
int /*<<< orphan*/ gameplay_players_cleanup();
void gameplay_cleanup(void) {
  gameplay_players_cleanup();
  gameplay_bombs_cleanup();
  gameplay_items_cleanup();
}


x86 assembly (clang, -O0):
<gameplay_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <gameplay_players_cleanup@plt>
mov    $0x0,%al
call   1050 <gameplay_bombs_cleanup@plt>
mov    $0x0,%al
call   1030 <gameplay_items_cleanup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gameplay_cleanup>:
push   %rax
xor    %eax,%eax
call   1040 <gameplay_players_cleanup@plt>
xor    %eax,%eax
call   1050 <gameplay_bombs_cleanup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <gameplay_items_cleanup@plt>

LLVM IR (-O0):
define void @gameplay_cleanup() {
%1 = call i32 (...) @gameplay_players_cleanup()
%2 = call i32 (...) @gameplay_bombs_cleanup()
%3 = call i32 (...) @gameplay_items_cleanup()
ret void
}

LLVM IR (-O2):
define void @gameplay_cleanup() {
%1 = tail call i32 (...) @gameplay_players_cleanup()
%2 = tail call i32 (...) @gameplay_bombs_cleanup()
%3 = tail call i32 (...) @gameplay_items_cleanup()
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
double getTempo(struct timeval, struct timeval);
int /*<<< orphan*/ printf(char *, double);
void tempo(struct timeval start, struct timeval stop) {
  printf("%g ms\n", getTempo(start, stop));
}


x86 assembly (clang, -O0):
<tempo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <getTempo@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempo>:
push   %rax
call   1040 <getTempo@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [7 x i8] c"%g ms\0A\00"
define void @tempo(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call double @getTempo(i32 %8, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %11)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%g ms\0A\00"
define void @tempo(i32 %0, i32 %1) {
%3 = tail call double @getTempo(i32 %0, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}
void enqueue(int Q[], int x, int *tail, int size) {
  Q[*tail] = x;
  if (*tail == size - 1)
    *tail = 0;
  else
    (*tail)++;
  return;
}


x86 assembly (clang, -O0):
<enqueue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1146 <enqueue+0x46>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    1151 <enqueue+0x51>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<enqueue>:
movslq (%rdx),%rax
mov    %esi,(%rdi,%rax,4)
mov    (%rdx),%eax
add    $0xffffffff,%ecx
lea    0x1(%rax),%esi
xor    %edi,%edi
cmp    %ecx,%eax
cmovne %esi,%edi
mov    %edi,(%rdx)
ret

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

LLVM IR (-O2):
define void @enqueue(i32* nocapture writeonly %0, i32 %1, i32* nocapture %2, i32 %3) {
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %1, i32* %7
%8 = load i32, i32* %2
%9 = add nsw i32 %3, -1
%10 = icmp eq i32 %8, %9
%11 = add nsw i32 %8, 1
%12 = select i1 %10, i32 0, i32 %11
store i32 %12, i32* %2
ret void
}
/* Variables and functions */
int __builtin_nyuzi_read_control_reg(int /*<<< orphan*/);
int current_hw_thread(void) { return __builtin_nyuzi_read_control_reg(0); }


x86 assembly (clang, -O0):
<current_hw_thread>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <__builtin_nyuzi_read_control_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_hw_thread>:
xor    %edi,%edi
jmp    1030 <__builtin_nyuzi_read_control_reg@plt>

LLVM IR (-O0):
define i32 @current_hw_thread() {
%1 = call i32 @__builtin_nyuzi_read_control_reg(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @current_hw_thread() {
%1 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
int main(void) {
  char a[] = "foo";
  fprintf(stdout, "%s", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x6f6f66,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [4 x i8] c"foo\00"
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = bitcast [4 x i8]* %2 to i8*
%4 = load i32, i32* @stdout
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 7303014, i32* %1
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
void Strcat(char *dst, const char *src) { strcat(dst, src); }


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

x86 assembly (clang, -O2):
<Strcat>:
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
define void @Strcat(i8* %0, i8* %1) {
%3 = tail call i32 @strcat(i8* %0, i8* %1)
ret void
}
int energymon_is_exclusive_cray_pm(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @energymon_is_exclusive_cray_pm() {
ret i32 0
}

LLVM IR (-O2):
define i32 @energymon_is_exclusive_cray_pm() {
ret i32 0
}
/* Variables and functions */
long double expl(long double);
long double tanhl(long double x) {
  return (expl(x) - expl(-x)) / (expl(x) + expl(-x));
}


x86 assembly (clang, -O0):
<tanhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fstpt  -0x34(%rbp)
fldt   -0x10(%rbp)
fchs
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fldt   -0x34(%rbp)
fsubp  %st,%st(1)
fstpt  -0x1c(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fstpt  -0x28(%rbp)
fldt   -0x10(%rbp)
fchs
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fldt   -0x28(%rbp)
fldt   -0x1c(%rbp)
fxch   %st(1)
faddp  %st,%st(2)
fdivp  %st,%st(1)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanhl>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <expl@plt>
fstpt  0x20(%rsp)
fldt   0x14(%rsp)
fchs
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  (%rsp)
call   1030 <expl@plt>
fldt   0x20(%rsp)
fsubp  %st,%st(1)
fstpt  0x20(%rsp)
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <expl@plt>
fstpt  0x14(%rsp)
fldt   0x2c(%rsp)
fstpt  (%rsp)
call   1030 <expl@plt>
fldt   0x14(%rsp)
faddp  %st,%st(1)
fldt   0x20(%rsp)
fdivp  %st,%st(1)
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
define x86_fp80 @tanhl(x86_fp80 %0) {
%2 = tail call x86_fp80 @expl(x86_fp80 %0)
%3 = fneg x86_fp80 %0
%4 = tail call x86_fp80 @expl(x86_fp80 %3)
%5 = fsub x86_fp80 %2, %4
%6 = tail call x86_fp80 @expl(x86_fp80 %0)
%7 = tail call x86_fp80 @expl(x86_fp80 %3)
%8 = fadd x86_fp80 %6, %7
%9 = fdiv x86_fp80 %5, %8
ret x86_fp80 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t vga_entry(char c, uint8_t color) {
  uint16_t char16 = c;
  uint16_t color16 = color;
  return char16 | color16 << 8;
}


x86 assembly (clang, -O0):
<vga_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_entry>:
mov    %esi,%eax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @vga_entry(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = shl i32 %11, 8
%13 = or i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @vga_entry(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = shl i32 %1, 8
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
float strtod(char const *const, char **);
char const *parse_float(char const *const str, float *const valp) {
  char *endp;
  assert(str && "parse_float(): str == NULL");
  *valp = strtod(str, &endp);
  if (str == endp) {
    return NULL;
  }
  return endp;
}


x86 assembly (clang, -O0):
<parse_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x21(%rbp)
je     114a <parse_float+0x2a>
mov    $0x1,%al
mov    %al,-0x21(%rbp)
jmp    114a <parse_float+0x2a>
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1187 <parse_float+0x67>
movq   $0x0,-0x8(%rbp)
jmp    118f <parse_float+0x6f>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_float>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <strtod@plt>
movss  %xmm0,(%r14)
mov    (%rsp),%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
cmovne %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"parse_float(): str == NULL\00"
define i8* @parse_float(i8* %0, float* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float*
%6 = alloca i8*
store i8* %0, i8** %4
store float* %1, float** %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %2
%11 = phi i1 [ false, %2 ], [ true, %9 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call float @strtod(i8* %14, i8** %6)
%16 = load float*, float** %5
store float %15, float* %16
%17 = load i8*, i8** %4
%18 = load i8*, i8** %6
%19 = icmp eq i8* %17, %18
br i1 %19, label %20, label %21
20: ; preds = %10
store i8* null, i8** %3
br label %23
21: ; preds = %10
%22 = load i8*, i8** %6
store i8* %22, i8** %3
br label %23
23: ; preds = %21, %20
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @parse_float(i8* %0, float* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = icmp ne i8* %0, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = call float @strtod(i8* %0, i8** %3)
store float %8, float* %1
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, %0
%11 = select i1 %10, i8* null, i8* %9
ret i8* %11
}
void translate_v3fo(float x, float y, float z, const float *v, float *result) {
  result[0] = v[0] + x;
  result[1] = v[1] + y;
  result[2] = v[2] + z;
}


x86 assembly (clang, -O0):
<translate_v3fo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
addss  -0x4(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
addss  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
addss  -0xc(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate_v3fo>:
addss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
addss  0x4(%rdi),%xmm1
movss  %xmm1,0x4(%rsi)
addss  0x8(%rdi),%xmm2
movss  %xmm2,0x8(%rsi)
ret

LLVM IR (-O0):
define void @translate_v3fo(float %0, float %1, float %2, float* %3, float* %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float*
%10 = alloca float*
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float* %3, float** %9
store float* %4, float** %10
%11 = load float*, float** %9
%12 = getelementptr inbounds float, float* %11, i64 0
%13 = load float, float* %12
%14 = load float, float* %6
%15 = fadd float %13, %14
%16 = load float*, float** %10
%17 = getelementptr inbounds float, float* %16, i64 0
store float %15, float* %17
%18 = load float*, float** %9
%19 = getelementptr inbounds float, float* %18, i64 1
%20 = load float, float* %19
%21 = load float, float* %7
%22 = fadd float %20, %21
%23 = load float*, float** %10
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %9
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float, float* %8
%29 = fadd float %27, %28
%30 = load float*, float** %10
%31 = getelementptr inbounds float, float* %30, i64 2
store float %29, float* %31
ret void
}

LLVM IR (-O2):
define void @translate_v3fo(float %0, float %1, float %2, float* nocapture %3, float* nocapture writeonly %4) {
%6 = load float, float* %3
%7 = fadd float %6, %0
store float %7, float* %4
%8 = getelementptr inbounds float, float* %3, i64 1
%9 = load float, float* %8
%10 = fadd float %9, %1
%11 = getelementptr inbounds float, float* %4, i64 1
store float %10, float* %11
%12 = getelementptr inbounds float, float* %3, i64 2
%13 = load float, float* %12
%14 = fadd float %13, %2
%15 = getelementptr inbounds float, float* %4, i64 2
store float %14, float* %15
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeEthernetMII(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000004, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeEthernetMII>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x4,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeEthernetMII>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeEthernetMII(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @GPIODirModeSet(i32 %5, i32 %6, i32 2)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 4, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeEthernetMII(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 4, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int socket(int /*<<< orphan*/, int, int /*<<< orphan*/);
int get_socket_unpriv(int type) { return (socket(PF_INET, type, 0)); }


x86 assembly (clang, -O0):
<get_socket_unpriv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
xor    %edx,%edx
call   1030 <socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_socket_unpriv>:
mov    %edi,%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@PF_INET = global i32 0
define i32 @get_socket_unpriv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PF_INET
%4 = load i32, i32* %2
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@PF_INET = global i32 0
define i32 @get_socket_unpriv(i32 %0) {
%2 = load i32, i32* @PF_INET
%3 = tail call i32 @socket(i32 %2, i32 %0, i32 0)
ret i32 %3
}
void init_einspline(void) {}


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

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

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

LLVM IR (-O2):
define void @init_einspline() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ECHILD;
int /*<<< orphan*/ errno;
int _wait(int *status __attribute((unused))) {
  errno = ECHILD;
  return -1;
}


x86 assembly (clang, -O0):
<_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wait>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ECHILD = global i32 0
@errno = global i32 0
define i32 @_wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ECHILD
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ECHILD = global i32 0
@errno = global i32 0
define i32 @_wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @ECHILD
store i32 %2, i32* @errno
ret i32 -1
}
int lvar_node_init(struct iam_container *c, struct buffer_head *bh, int root) {
  return 0;
}


x86 assembly (clang, -O0):
<lvar_node_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.iam_container = type opaque
%struct.buffer_head = type opaque
define i32 @lvar_node_init(%struct.iam_container* %0, %struct.buffer_head* %1, i32 %2) {
%4 = alloca %struct.iam_container*
%5 = alloca %struct.buffer_head*
%6 = alloca i32
store %struct.iam_container* %0, %struct.iam_container** %4
store %struct.buffer_head* %1, %struct.buffer_head** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.iam_container = type opaque
%struct.buffer_head = type opaque
define i32 @lvar_node_init(%struct.iam_container* nocapture readnone %0, %struct.buffer_head* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wserror_fun(char const *);
void wserror(const char *msg) { wserror_fun(msg); }


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

x86 assembly (clang, -O2):
<wserror>:
jmp    1030 <wserror_fun@plt>

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

LLVM IR (-O2):
define void @wserror(i8* %0) {
%2 = tail call i32 @wserror_fun(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clean_zeros(double **, int *);
int /*<<< orphan*/ insertion_sort(double *, int);
void clean_sort(double **values, int *M) {
  insertion_sort(*values, *M);
  clean_zeros(values, M);
}


x86 assembly (clang, -O0):
<clean_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <insertion_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <clean_zeros@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_sort>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    (%rsi),%esi
call   1040 <insertion_sort@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <clean_zeros@plt>

LLVM IR (-O0):
define void @clean_sort(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 i32 @insertion_sort(double* %6, i32 %8)
%10 = load double**, double*** %3
%11 = load i32*, i32** %4
%12 = call i32 @clean_zeros(double** %10, i32* %11)
ret void
}

LLVM IR (-O2):
define void @clean_sort(double** %0, i32* %1) {
%3 = load double*, double** %0
%4 = load i32, i32* %1
%5 = tail call i32 @insertion_sort(double* %3, i32 %4)
%6 = tail call i32 @clean_zeros(double** %0, i32* %1)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __NR_gettimeofday;
scalar_t__ syscall2(int /*<<< orphan*/, unsigned long, unsigned long);
int gettimeofday(struct timeval *restrict tp, void *restrict tzp) {
  return (int)syscall2(__NR_gettimeofday, (unsigned long)tp,
                       (unsigned long)tzp);
}


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

x86 assembly (clang, -O2):
<gettimeofday>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall2@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@__NR_gettimeofday = global i32 0
define i32 @gettimeofday(%struct.timeval* noalias %0, i8* noalias %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%5 = load i32, i32* @__NR_gettimeofday
%6 = load %struct.timeval*, %struct.timeval** %3
%7 = ptrtoint %struct.timeval* %6 to i64
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = call i64 @syscall2(i32 %5, i64 %7, i64 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@__NR_gettimeofday = global i32 0
define i32 @gettimeofday(%struct.timeval* noalias %0, i8* noalias %1) {
%3 = load i32, i32* @__NR_gettimeofday
%4 = ptrtoint %struct.timeval* %0 to i64
%5 = ptrtoint i8* %1 to i64
%6 = tail call i64 @syscall2(i32 %3, i64 %4, i64 %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}