xunge/DecIR huggingface dataset:
void _exit() { ; }


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
unreachable
}

LLVM IR (-O2):
/* Type definitions */
struct usernewkey_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int usernewkey_cmdline_parser_required(struct usernewkey_args_info *args_info,
                                       const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<usernewkey_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.usernewkey_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @usernewkey_cmdline_parser_required(%struct.usernewkey_args_info* %0, i8* %1) {
%3 = alloca %struct.usernewkey_args_info*
%4 = alloca i8*
store %struct.usernewkey_args_info* %0, %struct.usernewkey_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.usernewkey_args_info*, %struct.usernewkey_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.usernewkey_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @usernewkey_cmdline_parser_required(%struct.usernewkey_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
unsigned long setbit(unsigned long x, int n) {
  printf("NOT YET IMPLEMENTED\n");
  return x;
}


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

x86 assembly (clang, -O2):
<setbit>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"NOT YET IMPLEMENTED\0A\00"
define i64 @setbit(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
@str = [20 x i8] c"NOT YET IMPLEMENTED\00"
define i64 @setbit(i64 returned %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i64 %0
}
/* Variables and functions */
char const *f(char *);
const char *i(void) { return f("string constant"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"string constant\00"
define i8* @i() {
%1 = call i8* @f(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [16 x i8] c"string constant\00"
define i8* @i() {
%1 = tail call i8* @f(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void caller_2_2_1_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_1_2_1_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main_core(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("%s: "
         "starting the program.\n",
         "MAIN");
  ;
  main_core(1001, 0);
  main_core(1002, 0);
  printf("%s: "
         "closing the program.\n",
         "MAIN");
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <printf@plt>
mov    $0x3e9,%edi
xor    %esi,%esi
call   1040 <main_core@plt>
mov    $0x3ea,%edi
xor    %esi,%esi
call   1040 <main_core@plt>
lea    0xeb8(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xeec(%rip),%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x3e9,%edi
xor    %esi,%esi
call   1040 <main_core@plt>
mov    $0x3ea,%edi
xor    %esi,%esi
call   1040 <main_core@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%s: starting the program.\0A\00"
@.str.1 = [5 x i8] c"MAIN\00"
@.str.2 = [26 x i8] c"%s: closing the program.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @main_core(i32 1001, i32 0)
%8 = call i32 @main_core(i32 1002, i32 0)
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s: starting the program.\0A\00"
@.str.1 = [5 x i8] c"MAIN\00"
@.str.2 = [26 x i8] c"%s: closing the program.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @main_core(i32 1001, i32 0)
%5 = tail call i32 @main_core(i32 1002, i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int test_imm_37int64_midword_reg(long long val) {
  return ((val >> 16) & (0x37 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_37int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x37,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_37int64_midword_reg>:
test   $0x370000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_37int64_midword_reg(i64 %0) {
%2 = and i64 %0, 3604480
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ unsetenv(char *);
void x_cgo_unsetenv(char *arg) { unsetenv(arg); }


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

x86 assembly (clang, -O2):
<x_cgo_unsetenv>:
jmp    1030 <unsetenv@plt>

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

LLVM IR (-O2):
define void @x_cgo_unsetenv(i8* nocapture %0) {
%2 = tail call i32 @unsetenv(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int *);
int *blahblahptr() {
  int *p = (int *)malloc(sizeof(int));
  printf("p ptr = %p\n", p);
  *p = 65;
  return p;
}


x86 assembly (clang, -O0):
<blahblahptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movl   $0x41,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blahblahptr>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
movl   $0x41,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"p ptr = %p\0A\00"
define i32* @blahblahptr() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = load i32*, i32** %1
store i32 65, i32* %6
%7 = load i32*, i32** %1
ret i32* %7
}

LLVM IR (-O2):
@.str = [12 x i8] c"p ptr = %p\0A\00"
define i32* @blahblahptr() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 65, i32* %2
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int main(void) {
  alarm(60);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3c,%edi
call   1030 <alarm@plt>
jmp    1129 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3c,%edi
call   1030 <alarm@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @alarm(i32 60)
br label %3
3: ; preds = %3, %0
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @alarm(i32 60)
br label %2
2: ; preds = %2, %0
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clearScreen() { printf("\033[H\033[J"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[H\1B[J\00"
define void @clearScreen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[H\1B[J\00"
define void @clearScreen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ create_new_fs(char *);
int /*<<< orphan*/ fail(char *);
int /*<<< orphan*/ format();
void fs_init() {
  if (create_new_fs("fat.part") < 0)
    fail("'init' failed!\n");
  format();
}


x86 assembly (clang, -O0):
<fs_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <create_new_fs@plt>
cmp    $0x0,%rax
jge    1156 <fs_init+0x26>
lea    0xeb8(%rip),%rdi
call   1030 <fail@plt>
mov    $0x0,%al
call   1050 <format@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_init>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <create_new_fs@plt>
test   %rax,%rax
jns    114e <fs_init+0x1e>
lea    0xec0(%rip),%rdi
call   1030 <fail@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <format@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"fat.part\00"
@.str.1 = [16 x i8] c"'init' failed!\0A\00"
define void @fs_init() {
%1 = call i64 @create_new_fs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @fail(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = call i32 (...) @format()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"fat.part\00"
@.str.1 = [16 x i8] c"'init' failed!\0A\00"
define void @fs_init() {
%1 = tail call i64 @create_new_fs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @fail(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 (...) @format()
ret void
}
unsigned int hweight8(unsigned char w) {
  unsigned short res = (w & 0x55) + ((w >> 1) & 0x55);
  res = (res & 0x33) + ((res >> 2) & 0x33);
  return (res & 0x0F) + ((res >> 4) & 0x0F);
}


x86 assembly (clang, -O0):
<hweight8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x55,%eax
movzbl -0x1(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55,%ecx
add    %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0x33,%eax
movzwl -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33,%ecx
add    %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0xf,%eax
movzwl -0x4(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight8>:
mov    %edi,%eax
and    $0x55,%eax
shr    %edi
and    $0xffffffd5,%edi
add    %edi,%eax
mov    %eax,%ecx
and    $0x33,%ecx
shr    $0x2,%eax
and    $0xfffffff3,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x7,%ecx
shr    $0x4,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hweight8(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i16
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = and i32 %5, 85
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 1
%10 = and i32 %9, 85
%11 = add nsw i32 %6, %10
%12 = trunc i32 %11 to i16
store i16 %12, i16* %3
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = and i32 %14, 51
%16 = load i16, i16* %3
%17 = zext i16 %16 to i32
%18 = ashr i32 %17, 2
%19 = and i32 %18, 51
%20 = add nsw i32 %15, %19
%21 = trunc i32 %20 to i16
store i16 %21, i16* %3
%22 = load i16, i16* %3
%23 = zext i16 %22 to i32
%24 = and i32 %23, 15
%25 = load i16, i16* %3
%26 = zext i16 %25 to i32
%27 = ashr i32 %26, 4
%28 = and i32 %27, 15
%29 = add nsw i32 %24, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @hweight8(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 85
%4 = lshr i32 %2, 1
%5 = and i32 %4, 85
%6 = add nuw nsw i32 %5, %3
%7 = and i32 %6, 51
%8 = lshr i32 %6, 2
%9 = and i32 %8, 51
%10 = add nuw nsw i32 %9, %7
%11 = and i32 %10, 7
%12 = lshr i32 %10, 4
%13 = add nuw nsw i32 %11, %12
ret i32 %13
}
char *nth_string(int i, char **array) {
  char *s = array[i];
  return s == (char *)0 ? "(null)" : s;
}


x86 assembly (clang, -O0):
<nth_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1136 <nth_string+0x36>
lea    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    113e <nth_string+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_string>:
movslq %edi,%rax
mov    (%rsi,%rax,8),%rcx
test   %rcx,%rcx
lea    0xeef(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define i8* @nth_string(i32 %0, i8** nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i8*, i8** %1, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = select i1 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rightrot(int, int);
int main() {
  printf("rightrot(3052, 3) produces %u\n", rightrot(3052, 3));
  printf("rightrot(1, 1) produces %u\n", rightrot(1, 1));
  printf("rightrot(4096, 4) produces %u\n", rightrot(4096, 4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xbec,%edi
mov    $0x3,%esi
call   1040 <rightrot@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <rightrot@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1000,%edi
mov    $0x4,%esi
call   1040 <rightrot@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xbec,%edi
mov    $0x3,%esi
call   1040 <rightrot@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <rightrot@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1000,%edi
mov    $0x4,%esi
call   1040 <rightrot@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [31 x i8] c"rightrot(3052, 3) produces %u\0A\00"
@.str.1 = [28 x i8] c"rightrot(1, 1) produces %u\0A\00"
@.str.2 = [31 x i8] c"rightrot(4096, 4) produces %u\0A\00"
define i32 @main() {
%1 = tail call i32 @rightrot(i32 3052, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @rightrot(i32 1, i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @rightrot(i32 4096, i32 4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int timesync_now_timespec(int /*<<< orphan*/ *);
int timesync_now(void) { return timesync_now_timespec(NULL); }


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

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

LLVM IR (-O0):
define i32 @timesync_now() {
%1 = call i32 @timesync_now_timespec(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @timesync_now() {
%1 = tail call i32 @timesync_now_timespec(i32* null)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void test_2(void) {
  enum digit { ONE, TWO, THREE };
  enum color { RED = 2, BLACK };
  printf("%d, %d\n", ONE, BLACK);
}


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

x86 assembly (clang, -O2):
<test_2>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x3,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%d, %d\0A\00"
define void @test_2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0, i32 3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define void @test_2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0, i32 3)
ret void
}
/* Variables and functions */
int rand();
int znak() { return (rand() % 2 ? 1 : -1); }


x86 assembly (clang, -O0):
<znak>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<znak>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x1,%eax
cmp    $0x1,%eax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @znak() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 2
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 -1
ret i32 %5
}

LLVM IR (-O2):
define i32 @znak() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -1, i32 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_WR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
void finalaze_socket(int fd) {
  shutdown(fd, SHUT_WR);
  char buff[10];
  recv(fd, buff, 10 * sizeof(char), 0);
  close(fd);
}


x86 assembly (clang, -O0):
<finalaze_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1040 <shutdown@plt>
mov    -0x4(%rbp),%edi
lea    -0xe(%rbp),%rsi
mov    $0xa,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finalaze_socket>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
call   1040 <shutdown@plt>
lea    0x6(%rsp),%rsi
mov    %ebx,%edi
mov    $0xa,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %ebx,%edi
call   1050 <close@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SHUT_WR = global i32 0
define void @finalaze_socket(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SHUT_WR
%6 = call i32 @shutdown(i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @recv(i32 %7, i8* %8, i32 10, i32 0)
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
ret void
}

LLVM IR (-O2):
@SHUT_WR = global i32 0
define void @finalaze_socket(i32 %0) {
%2 = alloca [10 x i8]
%3 = load i32, i32* @SHUT_WR
%4 = tail call i32 @shutdown(i32 %0, i32 %3)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @recv(i32 %0, i8* %5, i32 10, i32 0)
%7 = call i32 @close(i32 %0)
ret void
}
unsigned int *FCache_GetStats() {
  static unsigned int stats[2];
  stats[0] = *(volatile unsigned int *)(0x40003000 + 0x14);
  stats[1] = *(volatile unsigned int *)(0x40003000 + 0x18);
  return stats;
}


x86 assembly (clang, -O0):
<FCache_GetStats>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40003014,%eax
mov    (%rax),%eax
mov    %eax,0x2f13(%rip)
mov    $0x40003018,%eax
mov    (%rax),%eax
mov    %eax,0x2f0a(%rip)
lea    0x2eff(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FCache_GetStats>:
mov    0x40003014,%eax
mov    %eax,0x2f17(%rip)
lea    0x2f10(%rip),%rax
mov    0x40003018,%ecx
mov    %ecx,0x2f07(%rip)
ret

LLVM IR (-O0):
@FCache_GetStats.stats = internal global [2 x i32] zeroinitializer
define i32* @FCache_GetStats() {
%1 = load volatile i32, i32* inttoptr (i64 1073754132 to i32*)
store i32 %1, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @FCache_GetStats.stats, i64 0, i64 0)
%2 = load volatile i32, i32* inttoptr (i64 1073754136 to i32*)
store i32 %2, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @FCache_GetStats.stats, i64 0, i64 1)
ret i32* getelementptr inbounds ([2 x i32], [2 x i32]* @FCache_GetStats.stats, i64 0, i64 0)
}

LLVM IR (-O2):
@FCache_GetStats.stats = internal global [2 x i32] zeroinitializer
define i32* @FCache_GetStats() {
%1 = load volatile i32, i32* inttoptr (i64 1073754132 to i32*)
store i32 %1, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @FCache_GetStats.stats, i64 0, i64 0)
%2 = load volatile i32, i32* inttoptr (i64 1073754136 to i32*)
store i32 %2, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @FCache_GetStats.stats, i64 0, i64 1)
ret i32* getelementptr inbounds ([2 x i32], [2 x i32]* @FCache_GetStats.stats, i64 0, i64 0)
}
void swap_cols(unsigned int *p, unsigned int i, unsigned int j) {
  unsigned int temp;
  temp = p[i];
  p[i] = p[j];
  p[j] = temp;
}


x86 assembly (clang, -O0):
<swap_cols>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_cols>:
mov    %esi,%eax
mov    (%rdi,%rax,4),%ecx
mov    %edx,%edx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap_cols(i32* nocapture %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int do_867() { return 867; }


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

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

LLVM IR (-O0):
define i32 @do_867() {
ret i32 867
}

LLVM IR (-O2):
define i32 @do_867() {
ret i32 867
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int remove_last_slack(int k) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(171, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<remove_last_slack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xab,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_last_slack>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xab,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @remove_last_slack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 171, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __sys_stat(char const *, struct stat *);
int stat(const char *file, struct stat *st) { return __sys_stat(file, st); }


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

x86 assembly (clang, -O2):
<stat>:
jmp    1030 <__sys_stat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 @__sys_stat(i8* %0, %struct.stat* %1)
ret i32 %3
}
int c098(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c098() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rob(int *, int);
int main(int argc, char const *argv[]) {
  int nums[] = {2, 1, 1, 2};
  printf("%d\n", rob(nums, 4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <rob@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <rob@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.nums = [4 x i32] [i32 2, i32 1, i32 1, i32 2]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @rob(i32* %5, i32 4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_CLEAR_BIT(int, int);
void xburst_cgm_ungate_compress() { MIPS_CLEAR_BIT((0xB0000000 + 0x28), 5); }


x86 assembly (clang, -O0):
<xburst_cgm_ungate_compress>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0x5,%esi
call   1030 <MIPS_CLEAR_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_ungate_compress>:
mov    $0xb0000028,%edi
mov    $0x5,%esi
jmp    1030 <MIPS_CLEAR_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_ungate_compress() {
%1 = call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 5)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_ungate_compress() {
%1 = tail call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long long test_di(int, int);
int test_si(int, int);
int main() {
  int v;
  long long w;
  v = test_si(0x00000004, 0x30000000);
  if (v != 0x00000086)
    abort();
  w = test_di(0x0001040040040004ll, 0x0070050066666666ll);
  if (w != 0x2002002000200380ll)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x30000000,%esi
call   1040 <test_si@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x86,-0x8(%rbp)
je     1165 <main+0x35>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x40040004,%edi
mov    $0x66666666,%esi
call   1050 <test_di@plt>
mov    %rax,-0x10(%rbp)
movabs $0x2002002000200380,%rax
cmp    %rax,-0x10(%rbp)
je     1193 <main+0x63>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x30000000,%esi
call   1040 <test_si@plt>
cmp    $0x86,%eax
jne    1169 <main+0x39>
mov    $0x40040004,%edi
mov    $0x66666666,%esi
call   1050 <test_di@plt>
movabs $0x2002002000200380,%rcx
cmp    %rcx,%rax
jne    1169 <main+0x39>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 @test_si(i32 4, i32 805306368)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 134
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
%10 = call i64 @test_di(i32 1074003972, i32 1717986918)
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = icmp ne i64 %11, 2306406096608166784
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_si(i32 4, i32 805306368)
%2 = icmp eq i32 %1, 134
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i64 @test_di(i32 1074003972, i32 1717986918)
%7 = icmp eq i64 %6, 2306406096608166784
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Merge_Sort(int *, int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ omp_set_num_threads(int);
void Merge_Sort_Par(int a[], int b[], int n, int nThreads) {
  omp_set_num_threads(nThreads);
#pragma omp parallel
  {
#pragma omp master
    Merge_Sort(a, b, 0, n - 1);
  }
}


x86 assembly (clang, -O0):
<Merge_Sort_Par>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <omp_set_num_threads@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <Merge_Sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Merge_Sort_Par>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %ecx,%edi
call   1040 <omp_set_num_threads@plt>
add    $0xffffffff,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <Merge_Sort@plt>

LLVM IR (-O0):
define void @Merge_Sort_Par(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* %8
%10 = call i32 @omp_set_num_threads(i32 %9)
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = load i32, i32* %7
%14 = sub nsw i32 %13, 1
%15 = call i32 @Merge_Sort(i32* %11, i32* %12, i32 0, i32 %14)
ret void
}

LLVM IR (-O2):
define void @Merge_Sort_Par(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @omp_set_num_threads(i32 %3)
%6 = add nsw i32 %2, -1
%7 = tail call i32 @Merge_Sort(i32* %0, i32* %1, i32 0, i32 %6)
ret void
}
/* Variables and functions */
long sumsub_pental(long);
long find_pental() {
  long i = 5;
  long res = sumsub_pental(i);
  while (res == 0) {
    i++;
    res = sumsub_pental(i);
  }
  return res;
}


x86 assembly (clang, -O0):
<find_pental>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sumsub_pental@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <find_pental+0x46>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sumsub_pental@plt>
mov    %rax,-0x10(%rbp)
jmp    112d <find_pental+0x1d>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_pental>:
push   %rbx
mov    $0x5,%edi
call   1030 <sumsub_pental@plt>
test   %rax,%rax
jne    1141 <find_pental+0x31>
mov    $0x6,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <sumsub_pental@plt>
add    $0x1,%rbx
test   %rax,%rax
je     1130 <find_pental+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define i64 @find_pental() {
%1 = alloca i64
%2 = alloca i64
store i64 5, i64* %1
%3 = load i64, i64* %1
%4 = call i64 @sumsub_pental(i64 %3)
store i64 %4, i64* %2
br label %5
5: ; preds = %8, %0
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i64, i64* %1
%10 = add nsw i64 %9, 1
store i64 %10, i64* %1
%11 = load i64, i64* %1
%12 = call i64 @sumsub_pental(i64 %11)
store i64 %12, i64* %2
br label %5
13: ; preds = %5
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
define i64 @find_pental() {
%1 = tail call i64 @sumsub_pental(i64 5)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0, %3
%4 = phi i64 [ %5, %3 ], [ 5, %0 ]
%5 = add nuw nsw i64 %4, 1
%6 = tail call i64 @sumsub_pental(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %3, %0
%9 = phi i64 [ %1, %0 ], [ %6, %3 ]
ret i64 %9
}
float catmullrom_w3(float x) { return x * x * (-0.5f + 0.5f * x); }


x86 assembly (clang, -O0):
<catmullrom_w3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xee0(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0xed8(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<catmullrom_w3>:
movaps %xmm0,%xmm1
mulss  0xef5(%rip),%xmm0
mulss  %xmm1,%xmm1
addss  0xeed(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @catmullrom_w3(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = call float @llvm.fmuladd.f32(float 5.000000e-01, float %6, float -5.000000e-01)
%8 = fmul float %5, %7
ret float %8
}

LLVM IR (-O2):
define float @catmullrom_w3(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @llvm.fmuladd.f32(float %0, float 5.000000e-01, float -5.000000e-01)
%4 = fmul float %2, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ runAllTests_dbparseexpr();
int main(void) {
  runAllTests_dbparseexpr();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runAllTests_dbparseexpr()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigchld_handler(int sig) {
  int state;
  printf("Catch SIGCHLD.\n");
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [15 x i8] c"Catch SIGCHLD.\00"
define void @sigchld_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int lwes_hash(const char *key) {
  int sum = 0;
  int i;
  for (i = 0; key[i] != '\0'; i++)
    sum += ((int)key[i]) * ((int)key[i]);
  return sum;
}


x86 assembly (clang, -O0):
<lwes_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115a <lwes_hash+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
imul   %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <lwes_hash+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lwes_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <lwes_hash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   %ecx,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <lwes_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @lwes_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = mul nsw i32 %8, %8
%10 = add nuw nsw i32 %9, %7
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void _Q_dtoq(void) {
  printf("Unimplemented %s called, exiting\n", "_Q_dtoq");
  exit(-1);
}


x86 assembly (clang, -O0):
<_Q_dtoq>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_Q_dtoq>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef3(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [8 x i8] c"_Q_dtoq\00"
define void @_Q_dtoq() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [8 x i8] c"_Q_dtoq\00"
define void @_Q_dtoq() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int stat(char const *, struct stat *);
int rpl_stat(const char *path, struct stat *buf) {
  if (*path == '\0') {
    errno = ENOENT;
    return -1;
  }
  return stat(path, buf);
}


x86 assembly (clang, -O0):
<rpl_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114e <rpl_stat+0x3e>
mov    0x2e99(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea0(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <rpl_stat+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_stat>:
cmpb   $0x0,(%rdi)
je     111a <rpl_stat+0xa>
jmp    1030 <stat@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    0x2eb6(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
define i32 @rpl_stat(i8* %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.stat*
store i8* %0, i8** %4
store %struct.stat* %1, %struct.stat** %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @ENOENT
store i32 %11, i32* @errno
store i32 -1, i32* %3
br label %16
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load %struct.stat*, %struct.stat** %5
%15 = call i32 @stat(i8* %13, %struct.stat* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
define i32 @rpl_stat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = load i32, i32* @ENOENT
store i32 %6, i32* @errno
br label %9
7: ; preds = %2
%8 = tail call i32 @stat(i8* %0, %struct.stat* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ -1, %5 ], [ %8, %7 ]
ret i32 %10
}
int audio_get_formats(struct audio_info_struct *ai) { return 0x110; }


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

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

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

LLVM IR (-O2):
%struct.audio_info_struct = type opaque
define i32 @audio_get_formats(%struct.audio_info_struct* nocapture readnone %0) {
ret i32 272
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO2(int, int /*<<< orphan*/);
int BNCLCDEchoOff() {
  int ii, stat = 99;
  char com1, data;
  BNCIO2(33, 0);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCLCDEchoOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <BNCIO2@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCLCDEchoOff>:
push   %rax
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <BNCIO2@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNCLCDEchoOff() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO2(i32 33, i32 0)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNCLCDEchoOff() {
%1 = tail call i32 @BNCIO2(i32 33, i32 0)
ret i32 99
}