xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("install-memtest: Tool for installing a simple program on a\n"
         "bootable disk, without a structured file system. Usage:\n\n"
         "install-memtest <memtest> <disk>\n\n"
         "Where memtest is the path to the program file to be copied onto\n"
         "the disk and disk is the path to the disk image file.\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [269 x i8] c"install-memtest: Tool for installing a simple program on a\0Abootable disk, without a structured file system. Usage:\0A\0Ainstall-memtest <memtest> <disk>\0A\0AWhere memtest is the path to the program file to be copied onto\0Athe disk and disk is the path to the disk image file.\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [268 x i8] c"install-memtest: Tool for installing a simple program on a\0Abootable disk, without a structured file system. Usage:\0A\0Ainstall-memtest <memtest> <disk>\0A\0AWhere memtest is the path to the program file to be copied onto\0Athe disk and disk is the path to the disk image file.\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([268 x i8], [268 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double cos(double);
double f(double x) { return cos(x); }


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

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

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
ret double %4
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ ex1();
int /*<<< orphan*/ ex2();
int /*<<< orphan*/ ex3();
int /*<<< orphan*/ ex4();
int /*<<< orphan*/ ex5();
int /*<<< orphan*/ ex6();
int /*<<< orphan*/ ex7();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ print(char *);
int main() {
  print("LISTA DE EXERCICIOS DE FDA - 05");
  ex1();
  ex2();
  ex3();
  ex4();
  ex5();
  ex6();
  ex7();
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe5a(%rip),%rdi
call   1070 <print@plt>
mov    $0x0,%al
call   1040 <ex1@plt>
mov    $0x0,%al
call   10b0 <ex2@plt>
mov    $0x0,%al
call   1050 <ex3@plt>
mov    $0x0,%al
call   10a0 <ex4@plt>
mov    $0x0,%al
call   1030 <ex5@plt>
mov    $0x0,%al
call   1090 <ex6@plt>
mov    $0x0,%al
call   1060 <ex7@plt>
mov    $0x0,%al
call   1080 <getchar@plt>
mov    $0x0,%al
call   1080 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe68(%rip),%rdi
call   1070 <print@plt>
xor    %eax,%eax
call   1040 <ex1@plt>
xor    %eax,%eax
call   10b0 <ex2@plt>
xor    %eax,%eax
call   1050 <ex3@plt>
xor    %eax,%eax
call   10a0 <ex4@plt>
xor    %eax,%eax
call   1030 <ex5@plt>
xor    %eax,%eax
call   1090 <ex6@plt>
xor    %eax,%eax
call   1060 <ex7@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"LISTA DE EXERCICIOS DE FDA - 05\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @ex1()
%4 = call i32 (...) @ex2()
%5 = call i32 (...) @ex3()
%6 = call i32 (...) @ex4()
%7 = call i32 (...) @ex5()
%8 = call i32 (...) @ex6()
%9 = call i32 (...) @ex7()
%10 = call i32 (...) @getchar()
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"LISTA DE EXERCICIOS DE FDA - 05\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @ex1()
%3 = tail call i32 (...) @ex2()
%4 = tail call i32 (...) @ex3()
%5 = tail call i32 (...) @ex4()
%6 = tail call i32 (...) @ex5()
%7 = tail call i32 (...) @ex6()
%8 = tail call i32 (...) @ex7()
%9 = tail call i32 (...) @getchar()
%10 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void to_binary(unsigned long n) {
  int r;
  r = n % 2;
  if (n >= 2) {
    to_binary(n / 2);
  }
  putchar(r == 0 ? '0' : '1');
  return;
}


x86 assembly (clang, -O0):
<to_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
mov    %eax,-0xc(%rbp)
cmpq   $0x2,-0x8(%rbp)
jb     114f <to_binary+0x2f>
mov    -0x8(%rbp),%rdi
shr    $0x1,%rdi
call   1040 <to_binary@plt>
mov    -0xc(%rbp),%edx
mov    $0x31,%eax
mov    $0x30,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_binary>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x2,%rdi
jb     1135 <to_binary+0x15>
mov    %rbx,%rdi
shr    %rdi
call   1040 <to_binary@plt>
and    $0x1,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @to_binary(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = urem i64 %4, 2
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i64, i64* %2
%8 = icmp uge i64 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i64, i64* %2
%11 = udiv i64 %10, 2
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 48, i32 49
%17 = trunc i32 %16 to i8
%18 = call i32 @putchar(i8 signext %17)
ret void
}

LLVM IR (-O2):
define void @to_binary(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i64 %0, 1
tail call void @to_binary(i64 %4)
br label %5
5: ; preds = %3, %1
%6 = and i64 %0, 1
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8 48, i8 49
%9 = tail call i32 @putchar(i8 signext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello world ! \n");
  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    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"hello world ! \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 ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"hello world ! \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int main(int argc, char *argv[]) { chdir(argv[1]); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <chdir@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @chdir(i8* %4)
ret i32 0
}
/* Variables and functions */
int INT_MIN;
int test11(int x) {
  int y = INT_MIN;
  int z = 0x1234;
  return (x - y) ^ z;
}


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1234,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test11>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
sub    (%rcx),%eax
xor    $0x1234,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @test11(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @INT_MIN
store i32 %5, i32* %3
store i32 4660, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = xor i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test11(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = sub nsw i32 %0, %2
%4 = xor i32 %3, 4660
ret i32 %4
}
int reset_game(int game[3][3]) {
  int x, y;
  for (x = 0; x < 3; x++)
    for (y = 0; y < 3; y++)
      game[x][y] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<reset_game>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1165 <reset_game+0x65>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1152 <reset_game+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <reset_game+0x20>
jmp    1157 <reset_game+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <reset_game+0xf>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_game>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x0,0x20(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @reset_game([3 x i32]* nocapture writeonly %0) {
%2 = bitcast [3 x i32]* %0 to i8*
ret i32 0
}
/* Variables and functions */
int is_equal(const void *r1, const void *r2, void *data) {
  int a = *(int *)r1;
  int b = *(int *)r2;
  return a == b;
}


x86 assembly (clang, -O0):
<is_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_equal>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_equal(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
store i32 %11, i32* %7
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
store i32 %14, i32* %8
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = icmp eq i32 %15, %16
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_equal(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = icmp eq i32 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int hea_test_u64_bit(int /*<<< orphan*/ const, int);
int hea_cq_aer_eq_format_err_check(const __u64 *aer) {
  return hea_test_u64_bit(*aer, 50);
}


x86 assembly (clang, -O0):
<hea_cq_aer_eq_format_err_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x32,%esi
call   1030 <hea_test_u64_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_cq_aer_eq_format_err_check>:
mov    (%rdi),%edi
mov    $0x32,%esi
jmp    1030 <hea_test_u64_bit@plt>

LLVM IR (-O0):
define i32 @hea_cq_aer_eq_format_err_check(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @hea_test_u64_bit(i32 %4, i32 50)
ret i32 %5
}

LLVM IR (-O2):
define i32 @hea_cq_aer_eq_format_err_check(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_test_u64_bit(i32 %2, i32 50)
ret i32 %3
}
void getCont() { return; }


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

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

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

LLVM IR (-O2):
define void @getCont() {
ret void
}
/* Type definitions */
typedef int int16_t;
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ hexlify(char *, int *, int);
void ex_arr4s16(void) {
  int16_t arr[4] = {1, -1, 3, -3};
  hexlify("arr[4] int16_t", arr, sizeof(arr));
}


x86 assembly (clang, -O0):
<ex_arr4s16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xed7(%rip),%rdi
mov    $0x10,%edx
call   1030 <hexlify@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_arr4s16>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeea(%rip),%rdi
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <hexlify@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.ex_arr4s16.arr = [4 x i32] [i32 1, i32 -1, i32 3, i32 -3]
@.str = [15 x i8] c"arr[4] int16_t\00"
define void @ex_arr4s16() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @hexlify(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %3, i32 16)
ret void
}

LLVM IR (-O2):
@__const.ex_arr4s16.arr = [4 x i32] [i32 1, i32 -1, i32 3, i32 -3]
@.str = [15 x i8] c"arr[4] int16_t\00"
define void @ex_arr4s16() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @hexlify(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %3, i32 16)
ret void
}
/* Variables and functions */
long double sin(long double);
long double sinl(long double a1) { return sin(a1); }


x86 assembly (clang, -O0):
<sinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sin@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinl>:
jmp    1030 <sin@plt>

LLVM IR (-O0):
define x86_fp80 @sinl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @sin(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @sinl(x86_fp80 %0) {
%2 = tail call x86_fp80 @sin(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void showUsageMessageAndExit() {
  puts("Usage: mkbkp <-c|-x> <backup_file> "
       "[file_to_backup|directory_to_backup]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<showUsageMessageAndExit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<showUsageMessageAndExit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [73 x i8] c"Usage: mkbkp <-c|-x> <backup_file> [file_to_backup|directory_to_backup]\0A\00"
define void @showUsageMessageAndExit() {
%1 = call i32 @puts(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [73 x i8] c"Usage: mkbkp <-c|-x> <backup_file> [file_to_backup|directory_to_backup]\0A\00"
define void @showUsageMessageAndExit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  double average;
  scanf("%d %d %d", &a, &b, &c);
  average = (a + b + c) / 3.0;
  printf("Score: %.1lf", average);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
add    0x14(%rsp),%eax
add    0xc(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xea9(%rip),%xmm0
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [13 x i8] c"Score: %.1lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = sitofp i32 %11 to double
%13 = fdiv double %12, 3.000000e+00
store double %13, double* %5
%14 = load double, double* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [13 x i8] c"Score: %.1lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = sitofp i32 %12 to double
%14 = fdiv double %13, 3.000000e+00
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %14)
ret i32 0
}
/* Variables and functions */
unsigned long long PRCMHIBRegRead(int);
unsigned long long PRCMSlowClkCtrMatchGet() {
  unsigned long long ullValue;
  ullValue = PRCMHIBRegRead(0x4402F800 + 0x0000005C);
  ullValue = ullValue << 32;
  ullValue |= PRCMHIBRegRead(0x4402F800 + 0x00000058);
  return ullValue;
}


x86 assembly (clang, -O0):
<PRCMSlowClkCtrMatchGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4402f85c,%edi
call   1030 <PRCMHIBRegRead@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x20,%rax
mov    %rax,-0x8(%rbp)
mov    $0x4402f858,%edi
call   1030 <PRCMHIBRegRead@plt>
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMSlowClkCtrMatchGet>:
push   %rbx
mov    $0x4402f85c,%edi
call   1030 <PRCMHIBRegRead@plt>
mov    %rax,%rbx
shl    $0x20,%rbx
mov    $0x4402f858,%edi
call   1030 <PRCMHIBRegRead@plt>
or     %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @PRCMSlowClkCtrMatchGet() {
%1 = alloca i64
%2 = call i64 @PRCMHIBRegRead(i32 1141045340)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = shl i64 %3, 32
store i64 %4, i64* %1
%5 = call i64 @PRCMHIBRegRead(i32 1141045336)
%6 = load i64, i64* %1
%7 = or i64 %6, %5
store i64 %7, i64* %1
%8 = load i64, i64* %1
ret i64 %8
}

LLVM IR (-O2):
define i64 @PRCMSlowClkCtrMatchGet() {
%1 = tail call i64 @PRCMHIBRegRead(i32 1141045340)
%2 = shl i64 %1, 32
%3 = tail call i64 @PRCMHIBRegRead(i32 1141045336)
%4 = or i64 %2, %3
ret i64 %4
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ send(int, char const *, int, int /*<<< orphan*/);
int tcpsocket_send(int socketfd, const char *buffer, int datalen) {
  int nRet = -1;
  ssize_t nSend = send(socketfd, buffer, datalen, 0);
  if (nSend < 0) {
    printf("tcpsocket_send fail!\n");
  }
  nRet = (int)nSend;
  return nRet;
}


x86 assembly (clang, -O0):
<tcpsocket_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1165 <tcpsocket_send+0x45>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpsocket_send>:
push   %rbx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %rax,%rbx
test   %rax,%rax
jns    113c <tcpsocket_send+0x1c>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"tcpsocket_send fail!\0A\00"
define i32 @tcpsocket_send(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 -1, i32* %7
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i64 @send(i32 %9, i8* %10, i32 %11, i32 0)
store i64 %12, i64* %8
%13 = load i64, i64* %8
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %3
%18 = load i64, i64* %8
%19 = trunc i64 %18 to i32
store i32 %19, i32* %7
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
@str = [21 x i8] c"tcpsocket_send fail!\00"
define i32 @tcpsocket_send(i32 %0, i8* %1, i32 %2) {
%4 = tail call i64 @send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = trunc i64 %4 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _Send1(char);
void LCD_X_Write01(char c) { _Send1(c); }


x86 assembly (clang, -O0):
<LCD_X_Write01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <_Send1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_X_Write01>:
jmp    1030 <_Send1@plt>

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

LLVM IR (-O2):
define void @LCD_X_Write01(i8 signext %0) {
%2 = tail call i32 @_Send1(i8 signext %0)
ret void
}
/* Variables and functions */
int printf(char *, char const *);
int output(const char *s) { return printf("%s", s); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @output(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
long s_align_to_page(long size) {
  return (size + (4096) - 1) / ((4096)) * ((4096));
}


x86 assembly (clang, -O0):
<s_align_to_page>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1000,%rax
sub    $0x1,%rax
mov    $0x1000,%ecx
cqto
idiv   %rcx
shl    $0xc,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_align_to_page>:
lea    0xfff(%rdi),%rcx
lea    0x1ffe(%rdi),%rax
test   %rcx,%rcx
cmovns %rcx,%rax
and    $0xfffffffffffff000,%rax
ret

LLVM IR (-O0):
define i64 @s_align_to_page(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 4096
%5 = sub nsw i64 %4, 1
%6 = sdiv i64 %5, 4096
%7 = mul nsw i64 %6, 4096
ret i64 %7
}

LLVM IR (-O2):
define i64 @s_align_to_page(i64 %0) {
%2 = add nsw i64 %0, 4095
%3 = sdiv i64 %2, 4096
%4 = shl nsw i64 %3, 12
ret i64 %4
}
unsigned int f49(unsigned int x, int y) {
  return (x << (8 * 4 - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f49>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f49>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f49(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 nsw i32 32, %6
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = lshr i32 %9, %10
%12 = xor i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f49(i32 %0, i32 %1) {
%3 = sub nsw i32 32, %1
%4 = shl i32 %0, %3
%5 = lshr i32 %0, %1
%6 = xor i32 %4, %5
ret i32 %6
}
void fc218(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    goto a;
    ;
    typedef int(*i)[n];
    0;
  };
a:;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc218(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
br label %20
17: ; No predecessors!
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %17, %1
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc218(i32 %0) {
ret void
}
void freePatternSetsIntersect(unsigned int **patternSets,
                              unsigned int numOfPatterns) {
  unsigned int i;
  for (i = 0; i < numOfPatterns; i++)
    free(patternSets[i]);
  free(patternSets);
}


x86 assembly (clang, -O0):
<freePatternSetsIntersect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <freePatternSetsIntersect+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freePatternSetsIntersect+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freePatternSetsIntersect>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <freePatternSetsIntersect+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freePatternSetsIntersect+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freePatternSetsIntersect(i32** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fdivd(int s1, int s2, int d) {
  assem_debug("fdivd d%d,d%d,d%d", d, s1, s2);
  output_w32(0xee800b00 | ((d & 7) << 12) | ((s1 & 7) << 16) | (s2 & 7));
}


x86 assembly (clang, -O0):
<emit_fdivd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebf(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0xc(%rbp),%edi
and    $0x7,%edi
shl    $0xc,%edi
or     $0xee800b00,%edi
mov    -0x4(%rbp),%eax
and    $0x7,%eax
shl    $0x10,%eax
or     %eax,%edi
mov    -0x8(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fdivd>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xece(%rip),%rdi
mov    %edx,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1030 <assem_debug@plt>
and    $0x7,%r14d
shl    $0xc,%r14d
and    $0x7,%ebp
shl    $0x10,%ebp
and    $0x7,%ebx
or     %ebp,%ebx
lea    (%r14,%rbx,1),%edi
add    $0xee800b00,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"fdivd d%d,d%d,d%d\00"
define void @emit_fdivd(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @assem_debug(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %6
%12 = and i32 %11, 7
%13 = shl i32 %12, 12
%14 = or i32 -293598464, %13
%15 = load i32, i32* %4
%16 = and i32 %15, 7
%17 = shl i32 %16, 16
%18 = or i32 %14, %17
%19 = load i32, i32* %5
%20 = and i32 %19, 7
%21 = or i32 %18, %20
%22 = call i32 @output_w32(i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"fdivd d%d,d%d,d%d\00"
define void @emit_fdivd(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @assem_debug(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0, i32 %1)
%5 = shl i32 %2, 12
%6 = and i32 %5, 28672
%7 = shl i32 %0, 16
%8 = and i32 %7, 458752
%9 = and i32 %1, 7
%10 = or i32 %8, %9
%11 = or i32 %10, %6
%12 = or i32 %11, -293598464
%13 = tail call i32 @output_w32(i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ foo();
int main() {
  check_vect();
  foo();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int execvp(char *, char **);
int /*<<< orphan*/ perror(char *);
int run(char *cmd, char **argv) {
  if (execvp(cmd, argv) == -1) {
    perror("nsdo"
           ": execvp");
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <execvp@plt>
cmp    $0xffffffff,%eax
jne    115e <run+0x3e>
lea    0xeb3(%rip),%rdi
call   1030 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1165 <run+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rax
call   1040 <execvp@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     1134 <run+0x14>
pop    %rcx
ret
lea    0xec5(%rip),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"nsdo: execvp\00"
define i32 @run(i8* %0, i8** %1) {
%3 = tail call i32 @execvp(i8* %0, i8** %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
int _is_hex_digit(char s) {
  if ((s >= 48 && s <= 57) || (s >= 65 && s <= 70) || (s >= 97 && s <= 102))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<_is_hex_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <_is_hex_digit+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1158 <_is_hex_digit+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     113e <_is_hex_digit+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jle    1158 <_is_hex_digit+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1164 <_is_hex_digit+0x64>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1164 <_is_hex_digit+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <_is_hex_digit+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_hex_digit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @_is_hex_digit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %27, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 70
br i1 %18, label %27, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 97
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 102
br i1 %26, label %27, label %28
27: ; preds = %23, %15, %7
store i32 1, i32* %2
br label %29
28: ; preds = %23, %19
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @_is_hex_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
double sqrt(int);
double EDDasin(double x) { return (x / sqrt(1. - x * x) / (1. - x * x)); }


x86 assembly (clang, -O0):
<EDDasin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeac(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe66(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EDDasin>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xed6(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
divsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @EDDasin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fneg double %4
%7 = call double @llvm.fmuladd.f64(double %6, double %5, double 1.000000e+00)
%8 = fptosi double %7 to i32
%9 = call double @sqrt(i32 %8)
%10 = fdiv double %3, %9
%11 = load double, double* %2
%12 = load double, double* %2
%13 = fneg double %11
%14 = call double @llvm.fmuladd.f64(double %13, double %12, double 1.000000e+00)
%15 = fdiv double %10, %14
ret double %15
}

LLVM IR (-O2):
define double @EDDasin(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fptosi double %3 to i32
%5 = tail call double @sqrt(i32 %4)
%6 = fdiv double %0, %5
%7 = fdiv double %6, %3
ret double %7
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ sleep(int);
int main(void) {
  int *data = (int *)calloc(1, sizeof(int));
  if (!data)
    return -1;
  *data = 0xdeadbeef;
  while (1) {
    sleep(1);
    if (*data != 0xdeadbeef)
      return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <main+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <main+0x6e>
mov    -0x10(%rbp),%rax
movl   $0xdeadbeef,(%rax)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x10(%rbp),%rax
cmpl   $0xdeadbeef,(%rax)
je     1189 <main+0x69>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <main+0x6e>
jmp    1163 <main+0x43>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1152 <main+0x32>
mov    %rax,%rbx
movl   $0xdeadbeef,(%rax)
xchg   %ax,%ax
mov    $0x1,%edi
call   1040 <sleep@plt>
cmpl   $0xdeadbeef,(%rbx)
je     1140 <main+0x20>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @calloc(i32 1, i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
br i1 %6, label %8, label %7
7: ; preds = %0
store i32 -1, i32* %1
br label %17
8: ; preds = %0
%9 = load i32*, i32** %2
store i32 -559038737, i32* %9
br label %10
10: ; preds = %8, %16
%11 = call i32 @sleep(i32 1)
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, -559038737
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 -1, i32* %1
br label %17
16: ; preds = %10
br label %10
17: ; preds = %15, %7
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @calloc(i32 1, i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %0
store i32 -559038737, i32* %2
br label %5
5: ; preds = %5, %4
%6 = tail call i32 @sleep(i32 1)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, -559038737
br i1 %8, label %5, label %9
9: ; preds = %5, %0
ret i32 -1
}
int WpeZeroFunction(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @WpeZeroFunction() {
ret i32 0
}
struct Value *handle_set_command(args)
char *args;
{
  return newint_fl(do_set(args, 0, 0),
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/"
                   "heads/master/src/command.c",
                   273);
}


x86 assembly (clang, -O0):
<handle_set_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1040 <do_set@plt>
mov    %eax,%edi
lea    0xebc(%rip),%rsi
mov    $0x111,%edx
mov    $0x0,%al
call   1030 <newint_fl@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_set_command>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <do_set@plt>
lea    0xecd(%rip),%rsi
mov    %eax,%edi
mov    $0x111,%edx
xor    %eax,%eax
call   1030 <newint_fl@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.Value = type opaque
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/heads/master/src/command.c\00"
define %struct.Value* @handle_set_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @do_set to i32 (i8*, i32, i32, ...)*)(i8* %3, i32 0, i32 0)
%5 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @newint_fl to i32 (i32, i8*, i32, ...)*)(i32 %4, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 273)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.Value*
ret %struct.Value* %7
}

LLVM IR (-O2):
%struct.Value = type opaque
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/heads/master/src/command.c\00"
define %struct.Value* @handle_set_command(i8* %0) {
%2 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @do_set to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 0, i32 0)
%3 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @newint_fl to i32 (i32, i8*, i32, ...)*)(i32 %2, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 273)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.Value*
ret %struct.Value* %5
}
/* Type definitions */
struct node {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct node *removeRear(struct list *list) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.node = type { i32 }
%struct.list = type { i32 }
define %struct.node* @removeRear(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
ret %struct.node* null
}

LLVM IR (-O2):
%struct.node = type { i32 }
%struct.list = type { i32 }
define noalias %struct.node* @removeRear(%struct.list* nocapture readnone %0) {
ret %struct.node* null
}
unsigned xrop3_66_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk1 = S ^ D;
  stk2 = T ^ D;
  stk1 = stk1 & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_66_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_66_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    $0xff,%ecx
xor    $0xff,%eax
and    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_66_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = xor i32 %6, 255
%9 = and i32 %8, %7
ret i32 %9
}