xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ baz();
void foo() { baz(); }


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

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @baz()
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ handle_error(char *);
void *Calloc(size_t nmemb, size_t size) {
  if (size == 0) {
    handle_error("Cannot Calloc a size of 0!");
  }
  void *ptr = calloc(nmemb, size);
  if (ptr == NULL) {
    handle_error("Error on calloc");
  }
  return ptr;
}


x86 assembly (clang, -O0):
<Calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <Calloc+0x27>
lea    0xebe(%rip),%rdi
call   1040 <handle_error@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <Calloc+0x4f>
lea    0xeb1(%rip),%rdi
call   1040 <handle_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
jne    113b <Calloc+0x1b>
lea    0xeca(%rip),%rdi
call   1040 <handle_error@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <Calloc+0x3a>
lea    0xec6(%rip),%rdi
call   1040 <handle_error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Cannot Calloc a size of 0!\00"
@.str.1 = [16 x i8] c"Error on calloc\00"
define i8* @Calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @handle_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = call i8* @calloc(i64 %11, i64 %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @handle_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %10
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [27 x i8] c"Cannot Calloc a size of 0!\00"
@.str.1 = [16 x i8] c"Error on calloc\00"
define noalias i8* @Calloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @handle_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = tail call i8* @calloc(i64 %0, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @handle_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret i8* %7
}
double muld(double a, double b) { return a * b; }


x86 assembly (clang, -O0):
<muld>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<muld>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @muld(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @muld(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int f224(int *);
int f225(int *p) { return f224(p); }


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

x86 assembly (clang, -O2):
<f225>:
jmp    1030 <f224@plt>

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

LLVM IR (-O2):
define i32 @f225(i32* %0) {
%2 = tail call i32 @f224(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bar(short *, int);
__attribute__((no, noclone)) void foo(void) {
  short stuff[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1};
  if (bar(stuff, 9) != 36)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%ax
mov    %ax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x9,%esi
call   1040 <bar@plt>
cmp    $0x24,%eax
je     1167 <foo+0x47>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x18,%rsp
movzwl 0xee5(%rip),%eax
mov    %ax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <bar@plt>
cmp    $0x24,%eax
jne    1152 <foo+0x32>
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.foo.stuff = [9 x i16] [i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1]
define void @foo() {
%1 = alloca [9 x i16]
%2 = bitcast [9 x i16]* %1 to i8*
%3 = getelementptr inbounds [9 x i16], [9 x i16]* %1, i64 0, i64 0
%4 = call i32 @bar(i16* %3, i32 9)
%5 = icmp ne i32 %4, 36
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret void
}

LLVM IR (-O2):
@__const.foo.stuff = [9 x i16] [i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1]
define void @foo() {
%1 = alloca [9 x i16]
%2 = bitcast [9 x i16]* %1 to i8*
%3 = getelementptr inbounds [9 x i16], [9 x i16]* %1, i64 0, i64 0
%4 = call i32 @bar(i16* %3, i32 9)
%5 = icmp eq i32 %4, 36
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvwget_wstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvwget_wstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvwget_wstr+0x2a>
jmp    1170 <cmd_mvwget_wstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvwget_wstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvwget_wstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvwget_wstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Type definitions */
struct clk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG_ON(int);
int clk_set_rate(struct clk *, unsigned long);
int tegra_dvfs_set_rate(struct clk *c, unsigned long rate) {
  int ret = clk_set_rate(c, rate);
  BUG_ON(ret != 0);
  return ret;
}


x86 assembly (clang, -O0):
<tegra_dvfs_set_rate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <clk_set_rate@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <BUG_ON@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tegra_dvfs_set_rate>:
push   %rbx
call   1040 <clk_set_rate@plt>
mov    %eax,%ebx
xor    %edi,%edi
test   %eax,%eax
setne  %dil
call   1030 <BUG_ON@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.clk = type { i32 }
define i32 @tegra_dvfs_set_rate(%struct.clk* %0, i64 %1) {
%3 = alloca %struct.clk*
%4 = alloca i64
%5 = alloca i32
store %struct.clk* %0, %struct.clk** %3
store i64 %1, i64* %4
%6 = load %struct.clk*, %struct.clk** %3
%7 = load i64, i64* %4
%8 = call i32 @clk_set_rate(%struct.clk* %6, i64 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @BUG_ON(i32 %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
%struct.clk = type { i32 }
define i32 @tegra_dvfs_set_rate(%struct.clk* %0, i64 %1) {
%3 = tail call i32 @clk_set_rate(%struct.clk* %0, i64 %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @BUG_ON(i32 %5)
ret i32 %3
}
void *test_anti_range_56(int n) {
  extern void *alloc_anti_range_56(int) __attribute__((alloc_size(1)));
  if (0 <= n && n <= 12)
    n = 0 - 1;
  return alloc_anti_range_56(n);
}


x86 assembly (clang, -O0):
<test_anti_range_56>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jg     1137 <test_anti_range_56+0x27>
cmpl   $0xc,-0x4(%rbp)
jg     1137 <test_anti_range_56+0x27>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_56@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_56>:
cmp    $0xd,%edi
mov    $0xffffffff,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_56@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_56(i32 %0) {
%2 = icmp ult i32 %0, 13
%3 = select i1 %2, i32 -1, i32 %0
%4 = tail call i8* @alloc_anti_range_56(i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ sweepcircle(int, int);
void rotateclockarm() {
  int i, j;
  for (i = 0; i < 4 - 1; ++i) {
    for (j = i; j < 4 - 1 - i; ++j) {
      sweepcircle(i, j);
    }
  }
}


x86 assembly (clang, -O0):
<rotateclockarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    116e <rotateclockarm+0x5e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
sub    -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    115b <rotateclockarm+0x4b>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <sweepcircle@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <rotateclockarm+0x1f>
jmp    1160 <rotateclockarm+0x50>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <rotateclockarm+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @rotateclockarm() {
%1 = tail call i32 @sweepcircle(i32 0, i32 0)
%2 = tail call i32 @sweepcircle(i32 0, i32 1)
%3 = tail call i32 @sweepcircle(i32 0, i32 2)
%4 = tail call i32 @sweepcircle(i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
void fs_error(const char *prefix) {
  char fmt[256];
  sprintf(fmt, "fs: %s: error", prefix);
  perror(fmt);
}


x86 assembly (clang, -O0):
<fs_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <perror@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_error>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <perror@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"fs: %s: error\00"
define void @fs_error(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 @perror(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fs: %s: error\00"
define void @fs_error(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @perror(i8* %3)
ret void
}
const char *get_local_data_path() { return "."; }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i8* @get_local_data_path() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i8* @get_local_data_path() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char *prv_end_of_space(char *);
int check_end_of_args(char *buffer) {
  buffer = prv_end_of_space(buffer);
  return ((buffer[0] == 0) ? (1) : (0));
}


x86 assembly (clang, -O0):
<check_end_of_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <prv_end_of_space@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_end_of_args>:
push   %rax
call   1030 <prv_end_of_space@plt>
xor    %ecx,%ecx
cmpb   $0x0,(%rax)
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check_end_of_args(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @prv_end_of_space(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @check_end_of_args(i8* %0) {
%2 = tail call i8* @prv_end_of_space(i8* %0)
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned int databits_decode_ascii8(char *dataout_p, unsigned int dataout_size,
                                    unsigned long long bits,
                                    unsigned int n_databits) {
  if (!dataout_p)
    return 0;
  bits &= 0xFF;
  *dataout_p = bits;
  return 1;
}


x86 assembly (clang, -O0):
<databits_decode_ascii8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1129 <databits_decode_ascii8+0x29>
movl   $0x0,-0x4(%rbp)
jmp    114a <databits_decode_ascii8+0x4a>
mov    -0x20(%rbp),%rax
and    $0xff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<databits_decode_ascii8>:
test   %rdi,%rdi
je     110d <databits_decode_ascii8+0xd>
mov    %dl,(%rdi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @databits_decode_ascii8(i8* writeonly %0, i32 %1, i64 %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = trunc i64 %2 to i8
store i8 %7, i8* %0
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ 1, %6 ], [ 0, %4 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ is_numeric(char);
int is_possible_first_char(char c) {
  return is_numeric(c) || c == '-' || c == '+';
}


x86 assembly (clang, -O0):
<is_possible_first_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <is_numeric@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1158 <is_possible_first_char+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     1158 <is_possible_first_char+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x2b,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_possible_first_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_numeric@plt>
test   %rax,%rax
setne  %al
cmp    $0x2d,%bl
sete   %cl
cmp    $0x2b,%bl
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_possible_first_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_numeric(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 43
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_possible_first_char(i8 signext %0) {
%2 = tail call i64 @is_numeric(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 45
%5 = or i1 %4, %3
%6 = icmp eq i8 %0, 43
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
void util_speak_(const char *string, int len) {}


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

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

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

LLVM IR (-O2):
define void @util_speak_(i8* nocapture %0, i32 %1) {
ret void
}
int get_flag_value(unsigned char first_byte) { return (first_byte & 0x08) > 0; }


x86 assembly (clang, -O0):
<get_flag_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_flag_value>:
shr    $0x3,%dil
and    $0x1,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @get_flag_value(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 8
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_flag_value(i8 zeroext %0) {
%2 = lshr i8 %0, 3
%3 = and i8 %2, 1
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ds2751_writeBit(int);
void ds2751_writeByte(int hexNum) {
  int i;
  for (i = 0; i < 8; i++) {
    ds2751_writeBit(hexNum & 0x01);
    hexNum >>= 1;
  }
}


x86 assembly (clang, -O0):
<ds2751_writeByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    114e <ds2751_writeByte+0x3e>
mov    -0x4(%rbp),%edi
and    $0x1,%edi
call   1030 <ds2751_writeBit@plt>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <ds2751_writeByte+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds2751_writeByte>:
push   %rbx
mov    %edi,%ebx
and    $0x1,%edi
call   1030 <ds2751_writeBit@plt>
mov    %ebx,%edi
shr    %edi
and    $0x1,%edi
call   1030 <ds2751_writeBit@plt>
mov    %ebx,%edi
shr    $0x2,%edi
and    $0x1,%edi
call   1030 <ds2751_writeBit@plt>
mov    %ebx,%edi
shr    $0x3,%edi
and    $0x1,%edi
call   1030 <ds2751_writeBit@plt>
mov    %ebx,%edi
shr    $0x4,%edi
and    $0x1,%edi
call   1030 <ds2751_writeBit@plt>
mov    %ebx,%edi
shr    $0x5,%edi
and    $0x1,%edi
call   1030 <ds2751_writeBit@plt>
mov    %ebx,%edi
shr    $0x6,%edi
and    $0x1,%edi
call   1030 <ds2751_writeBit@plt>
shr    $0x7,%ebx
and    $0x1,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ds2751_writeBit@plt>

LLVM IR (-O0):
define void @ds2751_writeByte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%10 = call i32 @ds2751_writeBit(i32 %9)
%11 = load i32, i32* %2
%12 = ashr i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @ds2751_writeByte(i32 %0) {
%2 = and i32 %0, 1
%3 = tail call i32 @ds2751_writeBit(i32 %2)
%4 = lshr i32 %0, 1
%5 = and i32 %4, 1
%6 = tail call i32 @ds2751_writeBit(i32 %5)
%7 = lshr i32 %0, 2
%8 = and i32 %7, 1
%9 = tail call i32 @ds2751_writeBit(i32 %8)
%10 = lshr i32 %0, 3
%11 = and i32 %10, 1
%12 = tail call i32 @ds2751_writeBit(i32 %11)
%13 = lshr i32 %0, 4
%14 = and i32 %13, 1
%15 = tail call i32 @ds2751_writeBit(i32 %14)
%16 = lshr i32 %0, 5
%17 = and i32 %16, 1
%18 = tail call i32 @ds2751_writeBit(i32 %17)
%19 = lshr i32 %0, 6
%20 = and i32 %19, 1
%21 = tail call i32 @ds2751_writeBit(i32 %20)
%22 = lshr i32 %0, 7
%23 = and i32 %22, 1
%24 = tail call i32 @ds2751_writeBit(i32 %23)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int t(int a) {
  printf("%d ", a);
  return a;
}


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

x86 assembly (clang, -O2):
<t>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @t(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  if (!scanf("%d", &n)) {
    printf("%d \n", -1);
  } else {
    printf("%d \n", is_prime(n));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%eax
jne    116e <main+0x3e>
lea    0xea4(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
jmp    1184 <main+0x54>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
test   %eax,%eax
je     1153 <main+0x23>
mov    0x4(%rsp),%edi
call   1040 <is_prime@plt>
mov    %eax,%esi
jmp    1158 <main+0x28>
mov    $0xffffffff,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @is_prime(i32 %6)
br label %8
8: ; preds = %0, %5
%9 = phi i32 [ %7, %5 ], [ -1, %0 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
char *s_dup(const char *s) {
  if (!s)
    return NULL;
  return strdup(s);
}


x86 assembly (clang, -O0):
<s_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <s_dup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <s_dup+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_dup>:
test   %rdi,%rdi
je     111a <s_dup+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @s_dup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
void rop3_201_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | *D;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_201_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_201_1_0>:
mov    (%rdi),%al
or     %esi,%edx
or     %al,%dl
not    %dl
and    %al,%sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_201_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = trunc i32 %38 to i8
%40 = load i8*, i8** %4
store i8 %39, i8* %40
ret void
}

LLVM IR (-O2):
define void @rop3_201_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
store i8 %9, i8* %0
ret void
}
int fib(int param1) {
  int i0;
  int o0;
  int o0_1;
  i0 = param1;
  if (param1 > 1) {
    o0_1 = fib(param1 - 1);
    o0 = fib(param1 - 2);
    i0 = o0_1 + o0;
  }
  return i0;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1150 <fib+0x40>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1136 <fib+0x26>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1120 <fib+0x10>
jmp    1138 <fib+0x28>
mov    %ebx,%ecx
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ugt i32 %4, 3
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
void intel_gvt_driver_remove(struct drm_i915_private *dev_priv) {}


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

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

LLVM IR (-O0):
%struct.drm_i915_private = type opaque
define void @intel_gvt_driver_remove(%struct.drm_i915_private* %0) {
%2 = alloca %struct.drm_i915_private*
store %struct.drm_i915_private* %0, %struct.drm_i915_private** %2
ret void
}

LLVM IR (-O2):
%struct.drm_i915_private = type opaque
define void @intel_gvt_driver_remove(%struct.drm_i915_private* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void SmFreeReasons(int count, char **reasonMsgs) {
  if (reasonMsgs) {
    int i;
    for (i = 0; i < count; i++)
      free(reasonMsgs[i]);
    free((char *)reasonMsgs);
  }
}


x86 assembly (clang, -O0):
<SmFreeReasons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <SmFreeReasons+0x55>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115c <SmFreeReasons+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <SmFreeReasons+0x21>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SmFreeReasons(i32 %0, i8** %1) {
%3 = icmp eq i8** %1, null
br i1 %3, label %18, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @free(i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
%16 = bitcast i8** %1 to i8*
%17 = tail call i32 @free(i8* %16)
br label %18
18: ; preds = %15, %2
ret void
}
/* Variables and functions */
char readb(int);
char getch(void) { return readb(0x11100003); }


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11100003,%edi
call   1030 <readb@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
mov    $0x11100003,%edi
jmp    1030 <readb@plt>

LLVM IR (-O0):
define signext i8 @getch() {
%1 = call signext i8 @readb(i32 286261251)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @getch() {
%1 = tail call signext i8 @readb(i32 286261251)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void fd_cleanup(int *fd_arr, size_t n) {
  for (size_t i = 0; i < n; i++) {
    if (fd_arr[i] != (int)i) {
      close(fd_arr[i]);
    }
  }
}


x86 assembly (clang, -O0):
<fd_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1173 <fd_cleanup+0x63>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
cmp    %ecx,%eax
je     115d <fd_cleanup+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <close@plt>
jmp    1162 <fd_cleanup+0x52>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <fd_cleanup+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_cleanup>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1148 <fd_cleanup+0x38>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
jmp    1139 <fd_cleanup+0x29>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %rbx,%r15
je     1148 <fd_cleanup+0x38>
mov    (%r14,%rbx,4),%edi
cmp    %edi,%ebx
je     1130 <fd_cleanup+0x20>
call   1030 <close@plt>
jmp    1130 <fd_cleanup+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @fd_cleanup(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %13, %2
ret void
5: ; preds = %2, %13
%6 = phi i64 [ %14, %13 ], [ 0, %2 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = trunc i64 %6 to i32
%10 = icmp eq i32 %8, %9
br i1 %10, label %13, label %11
11: ; preds = %5
%12 = tail call i32 @close(i32 %8)
br label %13
13: ; preds = %5, %11
%14 = add nuw i64 %6, 1
%15 = icmp eq i64 %14, %1
br i1 %15, label %4, label %5
}
char *ft_strcpy(char *dst, const char *src) {
  int i;
  i = -1;
  while (src[++i] != '\0')
    dst[i] = src[i];
  dst[i] = '\0';
  return (dst);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114b <ft_strcpy+0x4b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1113 <ft_strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     1120 <ft_strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <ft_strcpy+0x10>
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i64 [ 0, %2 ], [ %9, %5 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret i8* %0
}
void *dlopen(path, mode)
char *path;
int mode;
{ return 0; }


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

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

LLVM IR (-O0):
define i8* @dlopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @dlopen(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Type definitions */
struct bulk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bulk_cleanup(struct bulk *);
int /*<<< orphan*/ free(struct bulk *);
void bulk_end(struct bulk *b) {
  if (b == NULL)
    return;
  bulk_cleanup(b);
  free(b);
}


x86 assembly (clang, -O0):
<bulk_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <bulk_end+0x1c>
jmp    114e <bulk_end+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <bulk_cleanup@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bulk_end>:
test   %rdi,%rdi
je     1137 <bulk_end+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <bulk_cleanup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.bulk = type { i32 }
define void @bulk_end(%struct.bulk* %0) {
%2 = icmp eq %struct.bulk* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @bulk_cleanup(%struct.bulk* %0)
%5 = tail call i32 @free(%struct.bulk* %0)
br label %6
6: ; preds = %1, %3
ret void
}
int do_973() { return 973; }


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

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

LLVM IR (-O0):
define i32 @do_973() {
ret i32 973
}

LLVM IR (-O2):
define i32 @do_973() {
ret i32 973
}
/* Variables and functions */
int /*<<< orphan*/ output_0();
int /*<<< orphan*/ output_1();
void energenie_plug3() {
  output_1();
  output_0();
  output_1();
}


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

x86 assembly (clang, -O2):
<energenie_plug3>:
push   %rax
xor    %eax,%eax
call   1030 <output_1@plt>
xor    %eax,%eax
call   1040 <output_0@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <output_1@plt>

LLVM IR (-O0):
define void @energenie_plug3() {
%1 = call i32 (...) @output_1()
%2 = call i32 (...) @output_0()
%3 = call i32 (...) @output_1()
ret void
}

LLVM IR (-O2):
define void @energenie_plug3() {
%1 = tail call i32 (...) @output_1()
%2 = tail call i32 (...) @output_0()
%3 = tail call i32 (...) @output_1()
ret void
}
int maxLetterCount(char numeral) {
  switch (numeral) {
  case 'I':
    return 3;
  case 'V':
    return 1;
  case 'X':
    return 3;
  case 'L':
    return 1;
  case 'C':
    return 3;
  case 'D':
    return 1;
  case 'M':
    return 3;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<maxLetterCount>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1188 <maxLetterCount+0x88>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    118f <maxLetterCount+0x8f>
movl   $0x1,-0x4(%rbp)
jmp    118f <maxLetterCount+0x8f>
movl   $0x3,-0x4(%rbp)
jmp    118f <maxLetterCount+0x8f>
movl   $0x1,-0x4(%rbp)
jmp    118f <maxLetterCount+0x8f>
movl   $0x3,-0x4(%rbp)
jmp    118f <maxLetterCount+0x8f>
movl   $0x1,-0x4(%rbp)
jmp    118f <maxLetterCount+0x8f>
movl   $0x3,-0x4(%rbp)
jmp    118f <maxLetterCount+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxLetterCount>:
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     1124 <maxLetterCount+0x24>
mov    $0x3,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @maxLetterCount(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
switch i32 %5, label %13 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
i32 68, label %11
i32 77, label %12
]
6: ; preds = %1
store i32 3, i32* %2
br label %14
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
store i32 3, i32* %2
br label %14
9: ; preds = %1
store i32 1, i32* %2
br label %14
10: ; preds = %1
store i32 3, i32* %2
br label %14
11: ; preds = %1
store i32 1, i32* %2
br label %14
12: ; preds = %1
store i32 3, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @maxLetterCount(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 73, label %7
i32 86, label %3
i32 88, label %7
i32 76, label %4
i32 67, label %7
i32 68, label %5
i32 77, label %7
]
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %1, %1, %6, %5, %4, %3
%8 = phi i32 [ 0, %6 ], [ 1, %5 ], [ 1, %4 ], [ 1, %3 ], [ 3, %1 ], [ 3, %1 ], [ 3, %1 ], [ 3, %1 ]
ret i32 %8
}