xunge/DecIR huggingface dataset:
int main() {
  int a[3] = {1, 2, 3};
  return a[2];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
scalar_t__ is_numeric(char *);
long strtol(char *, int /*<<< orphan*/ *, int);
long go_long(char *s) {
  if (is_numeric(s)) {
    return strtol(s, NULL, 10);
  }
  return -1;
}


x86 assembly (clang, -O0):
<go_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_numeric@plt>
cmp    $0x0,%rax
je     115a <go_long+0x3a>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x8(%rbp)
jmp    1162 <go_long+0x42>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_long>:
push   %rbx
mov    %rdi,%rbx
call   1030 <is_numeric@plt>
test   %rax,%rax
je     113e <go_long+0x1e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
pop    %rbx
jmp    1040 <strtol@plt>
mov    $0xffffffffffffffff,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @go_long(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @is_numeric(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strtol(i8* %8, i32* null, i32 10)
store i64 %9, i64* %2
br label %11
10: ; preds = %1
store i64 -1, i64* %2
br label %11
11: ; preds = %10, %7
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @go_long(i8* %0) {
%2 = tail call i64 @is_numeric(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
br label %6
6: ; preds = %1, %4
%7 = phi i64 [ %5, %4 ], [ -1, %1 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ LD_R_A();
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0x4f(void) {
  LD_R_A();
  T_WAIT_UNTIL(5);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0x4f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LD_R_A@plt>
mov    $0x5,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0x4f>:
push   %rax
xor    %eax,%eax
call   1030 <LD_R_A@plt>
mov    $0x5,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0x4f() {
%1 = call i32 (...) @LD_R_A()
%2 = call i32 @T_WAIT_UNTIL(i32 5)
ret void
}

LLVM IR (-O2):
define void @op_ED_0x4f() {
%1 = tail call i32 (...) @LD_R_A()
%2 = tail call i32 @T_WAIT_UNTIL(i32 5)
ret void
}
void tick_broadcast_on_off(unsigned long reason, int *oncpu) {}


x86 assembly (clang, -O0):
<tick_broadcast_on_off>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @tick_broadcast_on_off(i64 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help() {
  fprintf(stderr, "lv usage:\n");
  fprintf(stderr, "./lv -input\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"lv usage:\0A\00"
@.str.1 = [13 x i8] c"./lv -input\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"lv usage:\0A\00"
@.str.1 = [13 x i8] c"./lv -input\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int abs(int /*<<< orphan*/);
int /*<<< orphan*/ arc4random();
int rand_int() { return abs(arc4random()); }


x86 assembly (clang, -O0):
<rand_int>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arc4random@plt>
mov    %eax,%edi
call   1030 <abs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int>:
push   %rax
xor    %eax,%eax
call   1030 <arc4random@plt>
mov    %eax,%ecx
neg    %ecx
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_int() {
%1 = call i32 (...) @arc4random()
%2 = call i32 @abs(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @rand_int() {
%1 = tail call i32 (...) @arc4random()
%2 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
ret i32 %2
}
const char *libccnxCommonAbout_LongNotice(void) {
  return "Copyright (c) 2017 Cisco and/or its affiliates.\nLicensed under the "
         "Apache License, Version 2.0 (the \"License\");\nyou may not use this "
         "file except in compliance with the License.\nYou may obtain a copy "
         "of the License at:\n\n    "
         "http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by "
         "applicable law or agreed to in writing, software\ndistributed under "
         "the License is distributed on an \"AS IS\" BASIS,\nWITHOUT "
         "WARRANTIES OR CONDITIONS OF ANY KIND, either express or "
         "implied.\nSee the License for the specific language governing "
         "permissions and\nlimitations under the License.\n";
}


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

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

LLVM IR (-O0):
@.str = [574 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0ALicensed under the Apache License, Version 2.0 (the \22License\22);\0Ayou may not use this file except in compliance with the License.\0AYou may obtain a copy of the License at:\0A\0A http://www.apache.org/licenses/LICENSE-2.0\0A\0AUnless required by applicable law or agreed to in writing, software\0Adistributed under the License is distributed on an \22AS IS\22 BASIS,\0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\0ASee the License for the specific language governing permissions and\0Alimitations under the License.\0A\00"
define i8* @libccnxCommonAbout_LongNotice() {
ret i8* getelementptr inbounds ([574 x i8], [574 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [574 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0ALicensed under the Apache License, Version 2.0 (the \22License\22);\0Ayou may not use this file except in compliance with the License.\0AYou may obtain a copy of the License at:\0A\0A http://www.apache.org/licenses/LICENSE-2.0\0A\0AUnless required by applicable law or agreed to in writing, software\0Adistributed under the License is distributed on an \22AS IS\22 BASIS,\0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\0ASee the License for the specific language governing permissions and\0Alimitations under the License.\0A\00"
define i8* @libccnxCommonAbout_LongNotice() {
ret i8* getelementptr inbounds ([574 x i8], [574 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
scalar_t__ getpid();
void write_pid(char *file) {
  FILE *fp;
  fp = fopen(file, "w");
  if (fp == NULL)
    return;
  fprintf(fp, "%d\n", (int)getpid());
  fclose(fp);
  return;
}


x86 assembly (clang, -O0):
<write_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <write_pid+0x30>
jmp    119a <write_pid+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xe76(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pid>:
push   %rbx
lea    0xeb8(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     1176 <write_pid+0x36>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @write_pid(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %16
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = call i64 (...) @getpid()
%12 = trunc i64 %11 to i32
%13 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32*, i32** %3
%15 = call i32 @fclose(i32* %14)
br label %16
16: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @write_pid(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 (...) @getpid()
%6 = trunc i64 %5 to i32
%7 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = tail call i32 @fclose(i32* %2)
br label %9
9: ; preds = %1, %4
ret void
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
int xatoll_range_sfx(char const *, int, int, struct suffix_mult const *);
__attribute__((always_)) int xatoi_range_sfx(const char *str, int l, int u,
                                             const struct suffix_mult *sfx) {
  return xatoll_range_sfx(str, l, u, sfx);
}


x86 assembly (clang, -O0):
<xatoi_range_sfx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <xatoll_range_sfx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xatoi_range_sfx>:
jmp    1030 <xatoll_range_sfx@plt>

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

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i32 @xatoi_range_sfx(i8* %0, i32 %1, i32 %2, %struct.suffix_mult* %3) {
%5 = tail call i32 @xatoll_range_sfx(i8* %0, i32 %1, i32 %2, %struct.suffix_mult* %3)
ret i32 %5
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int sqliteBinCompare(const void *pKey1, int n1, const void *pKey2, int n2) {
  if (n1 != n2)
    return 1;
  return memcmp(pKey1, pKey2, n1);
}


x86 assembly (clang, -O0):
<sqliteBinCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     113e <sqliteBinCompare+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1151 <sqliteBinCompare+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqliteBinCompare>:
cmp    %ecx,%esi
jne    1120 <sqliteBinCompare+0x10>
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <memcmp@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sqliteBinCompare(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @memcmp(i8* %0, i8* %2, i32 %1)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ 1, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Fatal(char *, int);
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void SigHandler(int signo) {
  signal(signo, SIG_IGN);
  Fatal("Caught signal %d. Exiting\n", signo);
}


x86 assembly (clang, -O0):
<SigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1040 <Fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SigHandler>:
push   %rbx
mov    %edi,%ebx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
lea    0xec8(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <Fatal@plt>

LLVM IR (-O0):
@SIG_IGN = global i32 0
@.str = [27 x i8] c"Caught signal %d. Exiting\0A\00"
define void @SigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @signal(i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @Fatal(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@SIG_IGN = global i32 0
@.str = [27 x i8] c"Caught signal %d. Exiting\0A\00"
define void @SigHandler(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %0, i32 %2)
%4 = tail call i32 @Fatal(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void av_strtod() {}


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

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

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

LLVM IR (-O2):
define void @av_strtod() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: armdsp-mkobj infile outfile\n");
  exit(1);
}


x86 assembly (clang, -O0):
<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):
<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 = [36 x i8] c"usage: armdsp-mkobj infile outfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"usage: armdsp-mkobj infile outfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void _swapshort(bp, n) register char *bp;
register unsigned n;
{
  register char c;
  register char *ep = bp + n;
  while (bp < ep) {
    c = *bp;
    *bp = *(bp + 1);
    bp++;
    *bp++ = c;
  }
}


x86 assembly (clang, -O0):
<_swapshort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1162 <_swapshort+0x62>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1119 <_swapshort+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swapshort>:
test   %esi,%esi
je     111d <_swapshort+0x1d>
mov    %esi,%eax
add    %rdi,%rax
nopl   0x0(%rax)
rolw   $0x8,(%rdi)
add    $0x2,%rdi
cmp    %rax,%rdi
jb     1110 <_swapshort+0x10>
ret

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

LLVM IR (-O2):
define void @_swapshort(i8* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp eq i32 %1, 0
br i1 %5, label %13, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %11, %6 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %7
%11 = getelementptr inbounds i8, i8* %7, i64 2
store i8 %8, i8* %9
%12 = icmp ult i8* %11, %4
br i1 %12, label %6, label %13
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int ioctl(int, int, int *);
int mms_ioc_getpagesize(int fd, int *page_size) {
  return ioctl(fd, 0x80046D02, page_size);
}


x86 assembly (clang, -O0):
<mms_ioc_getpagesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x80046d02,%esi
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mms_ioc_getpagesize>:
mov    %rsi,%rdx
mov    $0x80046d02,%esi
jmp    1030 <ioctl@plt>

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

LLVM IR (-O2):
define i32 @mms_ioc_getpagesize(i32 %0, i32* %1) {
%3 = tail call i32 @ioctl(i32 %0, i32 -2147193598, i32* %1)
ret i32 %3
}
unsigned long rdgsbase(void) {
  unsigned long gsbase;
  asm volatile("rdgsbase %0" : "=r"(gsbase)::"memory");
  return gsbase;
}


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

x86 assembly (clang, -O2):
<rdgsbase>:
rdgsbase %rax
ret

LLVM IR (-O0):
define i64 @rdgsbase() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdgsbase $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @rdgsbase() {
%1 = tail call i64 asm sideeffect "rdgsbase $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int recvfrom(int, void *, size_t, int, struct sockaddr *, int /*<<< orphan*/ *);
int rt_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from,
                socklen_t *fromlen) {
  return recvfrom(s, buf, len, flags, from, fromlen);
}


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

x86 assembly (clang, -O2):
<rt_recvfrom>:
jmp    1030 <recvfrom@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @rt_recvfrom(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32*
store i32 %0, i32* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32* %5, i32** %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i32, i32* %10
%17 = load %struct.sockaddr*, %struct.sockaddr** %11
%18 = load i32*, i32** %12
%19 = call i32 @recvfrom(i32 %13, i8* %14, i64 %15, i32 %16, %struct.sockaddr* %17, i32* %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @rt_recvfrom(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32* %5) {
%7 = tail call i32 @recvfrom(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int main() {
  unsigned long long a = 0x123456789abcdef1LL;
  if (a != 0x123456789abcdef1LL) {
    _exit(-1);
  }
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x123456789abcdef1,%rax
56 34 12
mov    %rax,-0x10(%rbp)
movabs $0x123456789abcdef1,%rax
56 34 12
cmp    %rax,-0x10(%rbp)
je     114b <main+0x3b>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 1311768467463790321, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 1311768467463790321
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @_exit(i32 -1)
unreachable
7: ; preds = %0
%8 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @_exit(i32 0)
unreachable
}
void dbg_printValue(str, value, num) char *str;
char **value;
int num;
{}


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

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

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

LLVM IR (-O2):
define void @dbg_printValue(i8* nocapture %0, i8** nocapture %1, i32 %2) {
ret void
}
int min2(int a, int b) { return (a <= b) ? a : b; }


x86 assembly (clang, -O0):
<min2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1121 <min2+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min2+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min2>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @min2(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 = icmp sle i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min2(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ car(struct object *);
struct object *cdr(struct object *);
struct object *cons(void *, int /*<<< orphan*/, int /*<<< orphan*/);
struct object *prim_cons(void *workspace, struct object *args) {
  return cons(workspace, car(args), (car(cdr((args)))));
}


x86 assembly (clang, -O0):
<prim_cons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <car@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cdr@plt>
mov    %rax,%rdi
call   1050 <car@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1040 <cons@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prim_cons>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <car@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <cdr@plt>
mov    %rax,%rdi
call   1050 <car@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <cons@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
define %struct.object* @prim_cons(i8* %0, %struct.object* %1) {
%3 = alloca i8*
%4 = alloca %struct.object*
store i8* %0, i8** %3
store %struct.object* %1, %struct.object** %4
%5 = load i8*, i8** %3
%6 = load %struct.object*, %struct.object** %4
%7 = call i32 @car(%struct.object* %6)
%8 = load %struct.object*, %struct.object** %4
%9 = call %struct.object* @cdr(%struct.object* %8)
%10 = call i32 @car(%struct.object* %9)
%11 = call %struct.object* @cons(i8* %5, i32 %7, i32 %10)
ret %struct.object* %11
}

LLVM IR (-O2):
%struct.object = type { i32 }
define %struct.object* @prim_cons(i8* %0, %struct.object* %1) {
%3 = tail call i32 @car(%struct.object* %1)
%4 = tail call %struct.object* @cdr(%struct.object* %1)
%5 = tail call i32 @car(%struct.object* %4)
%6 = tail call %struct.object* @cons(i8* %0, i32 %3, i32 %5)
ret %struct.object* %6
}
/* Variables and functions */
scalar_t__ acosh(double);
int /*<<< orphan*/ link_failure_acosh();
void test_acosh(double d) {
  if (acosh(d) != acosh(d))
    link_failure_acosh();
}


x86 assembly (clang, -O0):
<test_acosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <acosh@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <acosh@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_acosh+0x3c>
mov    $0x0,%al
call   1030 <link_failure_acosh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_acosh>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <acosh@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <acosh@plt>
cmp    %rax,%rbx
jne    1149 <test_acosh+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_acosh@plt>

LLVM IR (-O0):
define void @test_acosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @acosh(double %3)
%5 = load double, double* %2
%6 = call i64 @acosh(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_acosh()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_acosh(double %0) {
%2 = tail call i64 @acosh(double %0)
%3 = tail call i64 @acosh(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_acosh()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
char *get_line_word(char *, char **);
char *strdup(char *);
int copy_str(void *d, char *next) {
  char **sd = (char **)d;
  char *v;
  while ((v = get_line_word(next, &next))) {
    *sd = strdup(v);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<copy_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <get_line_word@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     1172 <copy_str+0x52>
mov    -0x28(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1179 <copy_str+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_str>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
mov    %rsi,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1030 <get_line_word@plt>
test   %rax,%rax
je     1151 <copy_str+0x31>
mov    %rax,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
jmp    1156 <copy_str+0x36>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @copy_str(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
store i8** %9, i8*** %6
br label %10
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i8* @get_line_word(i8* %11, i8** %5)
store i8* %12, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8*, i8** %7
%16 = call i8* @strdup(i8* %15)
%17 = load i8**, i8*** %6
store i8* %16, i8** %17
store i32 0, i32* %3
br label %19
18: ; preds = %10
store i32 1, i32* %3
br label %19
19: ; preds = %18, %14
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @copy_str(i8* nocapture writeonly %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i8* @get_line_word(i8* %1, i8** %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = bitcast i8* %0 to i8**
%8 = call i8* @strdup(i8* %4)
store i8* %8, i8** %7
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
bool usub_is_oor(unsigned a, unsigned b) { return (a - b > a); }


x86 assembly (clang, -O0):
<usub_is_oor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usub_is_oor>:
xor    %eax,%eax
cmp    %edi,%esi
seta   %al
ret

LLVM IR (-O0):
define i32 @usub_is_oor(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 = sub i32 %5, %6
%8 = load i32, i32* %3
%9 = icmp ugt i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @usub_is_oor(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int sq2_size_impl() { return 8; }


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

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

LLVM IR (-O0):
define i32 @sq2_size_impl() {
ret i32 8
}

LLVM IR (-O2):
define i32 @sq2_size_impl() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void unknownword(char *word, int type) {
  if (type == 1) {
    printf("I don't know how to %s.\n", word);
  } else {
    printf("I don't know what %s is.\n", word);
  }
}


x86 assembly (clang, -O0):
<unknownword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    113e <unknownword+0x2e>
mov    -0x8(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <unknownword+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknownword>:
mov    %rdi,%rax
cmp    $0x1,%esi
lea    0xee3(%rip),%rcx
lea    0xef5(%rip),%rdi
cmove  %rcx,%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"I don't know how to %s.\0A\00"
@.str.1 = [26 x i8] c"I don't know what %s is.\0A\00"
define void @unknownword(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"I don't know how to %s.\0A\00"
@.str.1 = [26 x i8] c"I don't know what %s is.\0A\00"
define void @unknownword(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = select i1 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ readnext(int);
void op_rdnxexp() { readnext(2); }


x86 assembly (clang, -O0):
<op_rdnxexp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <readnext@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_rdnxexp>:
mov    $0x2,%edi
jmp    1030 <readnext@plt>

LLVM IR (-O0):
define void @op_rdnxexp() {
%1 = call i32 @readnext(i32 2)
ret void
}

LLVM IR (-O2):
define void @op_rdnxexp() {
%1 = tail call i32 @readnext(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(unsigned long const);
int /*<<< orphan*/ test_ram_block(unsigned long *, unsigned long const);
int main() {
  const unsigned long mem_size = 16 * 1024 * 1024;
  char *mem_chunck = (char *)malloc(mem_size);
  test_ram_block((unsigned long *)mem_chunck, mem_size);
  free(mem_chunck);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1000000,-0x10(%rbp)
01
mov    $0x1000000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1000000,%esi
call   1050 <test_ram_block@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1000000,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0x1000000,%esi
mov    %rax,%rdi
call   1050 <test_ram_block@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
store i32 0, i32* %1
store i64 16777216, i64* %2
%4 = call i64 @malloc(i64 16777216)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
%8 = call i32 @test_ram_block(i64* %7, i64 16777216)
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i64 16777216)
%2 = inttoptr i64 %1 to i8*
%3 = inttoptr i64 %1 to i64*
%4 = tail call i32 @test_ram_block(i64* %3, i64 16777216)
%5 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printRed(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printRed(10);
  printf("\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printRed(i32 10)
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
int add_numbers(int a, int b) {
  int sum;
  sum = a + b;
  return sum;
}


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

x86 assembly (clang, -O2):
<add_numbers>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add_numbers(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void rlCloseExperimentConnection() {}


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

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

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

LLVM IR (-O2):
define void @rlCloseExperimentConnection() {
ret void
}
/* Variables and functions */
int socketcall(int (*)(int, int), int, int, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int shutdown(int fd, int how) {
  return socketcall(shutdown, fd, how, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    0x2ebd(%rip),%rdi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <socketcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shutdown>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    0x2ec5(%rip),%rdi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <socketcall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @shutdown(i32 %0, i32 %1) {
%3 = tail call i32 @socketcall(i32 (i32, i32)* @shutdown, i32 %0, i32 %1, i32 0, i32 0, i32 0, i32 0)
ret i32 %3
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ g(int *, struct S *);
void f(int *x, struct S *s) { g(x, s); }


x86 assembly (clang, -O0):
<f>:
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 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
jmp    1030 <g@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
define void @f(i32* %0, %struct.S* %1) {
%3 = alloca i32*
%4 = alloca %struct.S*
store i32* %0, i32** %3
store %struct.S* %1, %struct.S** %4
%5 = load i32*, i32** %3
%6 = load %struct.S*, %struct.S** %4
%7 = call i32 @g(i32* %5, %struct.S* %6)
ret void
}

LLVM IR (-O2):
%struct.S = type { i32 }
define void @f(i32* %0, %struct.S* %1) {
%3 = tail call i32 @g(i32* %0, %struct.S* %1)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t swap_endian64(uint64_t x) {
  return ((x << 24) & 0xFF000000FF000000ll) |
         ((x << 8) & 0x00FF000000FF0000ll) | ((x >> 8) & 0x0000ff000000ff00ll) |
         ((x >> 24) & 0x000000FF000000FFll);
}


x86 assembly (clang, -O0):
<swap_endian64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
cltq
movabs $0xff000000ff000000,%rcx
and    %rcx,%rax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
movslq %ecx,%rcx
movabs $0xff000000ff0000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
movabs $0xff000000ff00,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
movslq %ecx,%rcx
movabs $0xff000000ff,%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_endian64>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @swap_endian64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = sext i32 %4 to i64
%6 = and i64 %5, -72057589759737856
%7 = load i32, i32* %2
%8 = shl i32 %7, 8
%9 = sext i32 %8 to i64
%10 = and i64 %9, 71776119077928960
%11 = or i64 %6, %10
%12 = load i32, i32* %2
%13 = ashr i32 %12, 8
%14 = sext i32 %13 to i64
%15 = and i64 %14, 280375465148160
%16 = or i64 %11, %15
%17 = load i32, i32* %2
%18 = ashr i32 %17, 24
%19 = sext i32 %18 to i64
%20 = and i64 %19, 1095216660735
%21 = or i64 %16, %20
%22 = trunc i64 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @swap_endian64(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
float Saturatef(float, float, float);
int /*<<< orphan*/ lroundf(float);
uint16_t OverVoltFloatToRaw(float val) {
  val = Saturatef(val, 0.0016f, 6.5536f);
  return (uint16_t)(lroundf(val * 625.0f));
}


x86 assembly (clang, -O0):
<OverVoltFloatToRaw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeca(%rip),%xmm1
movss  0xec6(%rip),%xmm2
call   1030 <Saturatef@plt>
movss  %xmm0,-0x4(%rbp)
movss  0xeac(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1040 <lroundf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OverVoltFloatToRaw>:
push   %rax
movss  0xed7(%rip),%xmm1
movss  0xed3(%rip),%xmm2
call   1030 <Saturatef@plt>
mulss  0xeca(%rip),%xmm0
pop    %rax
jmp    1040 <lroundf@plt>

LLVM IR (-O0):
define i32 @OverVoltFloatToRaw(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @Saturatef(float %3, float 0x3F5A36E2E0000000, float 0x401A36E2E0000000)
store float %4, float* %2
%5 = load float, float* %2
%6 = fmul float %5, 6.250000e+02
%7 = call i32 @lroundf(float %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @OverVoltFloatToRaw(float %0) {
%2 = tail call float @Saturatef(float %0, float 0x3F5A36E2E0000000, float 0x401A36E2E0000000)
%3 = fmul float %2, 6.250000e+02
%4 = tail call i32 @lroundf(float %3)
ret i32 %4
}
/* Variables and functions */
int LOG_CONS;
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ LOG_LOCAL1;
int LOG_NDELAY;
int LOG_PID;
int /*<<< orphan*/ LOG_UPTO(int /*<<< orphan*/);
int /*<<< orphan*/ openlog(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ setlogmask(int /*<<< orphan*/);
int eu_log_init(const char *name) {
  setlogmask(LOG_UPTO(LOG_DEBUG));
  openlog(name, LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
  return 0;
}


x86 assembly (clang, -O0):
<eu_log_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
call   1040 <setlogmask@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
mov    0x2e7b(%rip),%rax
or     (%rax),%esi
mov    0x2e4a(%rip),%rax
or     (%rax),%esi
mov    0x2e59(%rip),%rax
mov    (%rax),%edx
call   1050 <openlog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eu_log_init>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
call   1040 <setlogmask@plt>
mov    0x2e88(%rip),%rax
mov    0x2e89(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e56(%rip),%rax
or     (%rax),%esi
mov    0x2e65(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   1050 <openlog@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@LOG_DEBUG = global i32 0
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_LOCAL1 = global i32 0
define i32 @eu_log_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_DEBUG
%4 = call i32 @LOG_UPTO(i32 %3)
%5 = call i32 @setlogmask(i32 %4)
%6 = load i8*, i8** %2
%7 = load i32, i32* @LOG_CONS
%8 = load i32, i32* @LOG_PID
%9 = or i32 %7, %8
%10 = load i32, i32* @LOG_NDELAY
%11 = or i32 %9, %10
%12 = load i32, i32* @LOG_LOCAL1
%13 = call i32 @openlog(i8* %6, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@LOG_DEBUG = global i32 0
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_LOCAL1 = global i32 0
define i32 @eu_log_init(i8* %0) {
%2 = load i32, i32* @LOG_DEBUG
%3 = tail call i32 @LOG_UPTO(i32 %2)
%4 = tail call i32 @setlogmask(i32 %3)
%5 = load i32, i32* @LOG_CONS
%6 = load i32, i32* @LOG_PID
%7 = or i32 %6, %5
%8 = load i32, i32* @LOG_NDELAY
%9 = or i32 %7, %8
%10 = load i32, i32* @LOG_LOCAL1
%11 = tail call i32 @openlog(i8* %0, i32 %9, i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ savegame();
void agt_save(void) { savegame(); }


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

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

LLVM IR (-O0):
define void @agt_save() {
%1 = call i32 (...) @savegame()
ret void
}

LLVM IR (-O2):
define void @agt_save() {
%1 = tail call i32 (...) @savegame()
ret void
}