xunge/DecIR huggingface dataset:
int oph_subset_is_in_subset(unsigned long index, unsigned long start,
                            unsigned long stride, unsigned long end) {
  return (!((index - start) % stride) && (index >= start) && (index <= end));
}


x86 assembly (clang, -O0):
<oph_subset_is_in_subset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
xor    %eax,%eax
cmp    $0x0,%rdx
mov    %al,-0x21(%rbp)
jne    1154 <oph_subset_is_in_subset+0x54>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x21(%rbp)
jb     1154 <oph_subset_is_in_subset+0x54>
mov    -0x8(%rbp),%rax
cmp    -0x20(%rbp),%rax
setbe  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oph_subset_is_in_subset>:
mov    %rdx,%r8
mov    %rdi,%rax
sub    %rsi,%rax
mov    %rax,%rdx
or     %r8,%rdx
shr    $0x20,%rdx
je     111c <oph_subset_is_in_subset+0x1c>
xor    %edx,%edx
div    %r8
jmp    1121 <oph_subset_is_in_subset+0x21>
xor    %edx,%edx
div    %r8d
test   %rdx,%rdx
sete   %al
cmp    %rsi,%rdi
setae  %dl
cmp    %rcx,%rdi
setbe  %cl
and    %dl,%cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @oph_subset_is_in_subset(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = sub i64 %9, %10
%12 = load i64, i64* %7
%13 = urem i64 %11, %12
%14 = icmp ne i64 %13, 0
br i1 %14, label %23, label %15
15: ; preds = %4
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = icmp uge i64 %16, %17
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i64, i64* %5
%21 = load i64, i64* %8
%22 = icmp ule i64 %20, %21
br label %23
23: ; preds = %19, %15, %4
%24 = phi i1 [ false, %15 ], [ false, %4 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @oph_subset_is_in_subset(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub i64 %0, %1
%6 = urem i64 %5, %2
%7 = icmp eq i64 %6, 0
%8 = icmp uge i64 %0, %1
%9 = icmp ule i64 %0, %3
%10 = and i1 %8, %7
%11 = and i1 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRSELECTOBJECT_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 1, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRSELECTOBJECT_swap>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

LLVM IR (-O0):
define void @U_WMRSELECTOBJECT_swap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @U_WMRCORE_N16_swap(i8* %5, i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRSELECTOBJECT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 1, i32 %1)
ret void
}
unsigned short int f62(unsigned short int x, unsigned long int y) {
  return (x << (8 * sizeof(unsigned short) - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f62>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f62>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f62(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = sub i64 16, %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %6, %9
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = ashr i32 %12, %14
%16 = xor i32 %10, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f62(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 16, %4
%6 = shl i32 %3, %5
%7 = lshr i32 %3, %4
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}
void gtk_tree_view_insert_column_with_attributes() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_insert_column_with_attributes() {
ret void
}
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int nms_term_cols(void) {
  struct winsize w;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  return w.ws_col;
}


x86 assembly (clang, -O0):
<nms_term_cols>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nms_term_cols>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @nms_term_cols() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @nms_term_cols() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
int foo(int n) {
  int i;
#pragma omp for
  for (i = 0; i < 6; i++) {
    int v[n], w[n * 3 + i];
    v[0] = 1;
    w[0] = 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1188 <foo+0x88>
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    %edx,%eax
lea    (%rax,%rax,2),%eax
mov    -0x8(%rbp),%edx
add    %edx,%eax
mov    %eax,%edx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rax
sub    %rsi,%rax
mov    %rax,%rsp
mov    %rdx,-0x20(%rbp)
movl   $0x1,(%rcx)
movl   $0x2,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <foo+0x12>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int result__(int b) {
  printf("%s\n", (b) ? "true" : "false");
  return b;
}


x86 assembly (clang, -O0):
<result__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xee4(%rip),%rsi
lea    0xed8(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<result__>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
lea    0xeed(%rip),%rax
lea    0xee1(%rip),%rsi
cmove  %rax,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @result__(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @result__(i32 returned %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %0
}
int startsWith(char *start, char *string) {
  char c;
  int i;
  for (i = 0;; i += 1) {
    if ((c = start[i]) == 0)
      return 1;
    if (string[i] != c)
      return 0;
  }
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
jne    1139 <startsWith+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1170 <startsWith+0x70>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
je     115d <startsWith+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1170 <startsWith+0x70>
jmp    1162 <startsWith+0x62>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1113 <startsWith+0x13>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1122 <startsWith+0x22>
xor    %edx,%edx
nopl   (%rax)
cmp    %cl,(%rsi,%rdx,1)
jne    1123 <startsWith+0x23>
movzbl 0x1(%rdi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <startsWith+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @startsWith(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %0, i64 %15
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %15, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = getelementptr inbounds i8, i8* %1, i64 %10
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, %11
%15 = add nuw i64 %10, 1
br i1 %14, label %5, label %16
16: ; preds = %5, %9, %2
%17 = phi i32 [ 1, %2 ], [ 0, %9 ], [ 1, %5 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x6e() {
  Assert_real((isxdigit(110) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              555, ("isxdigit should be 0 for n"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x6e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6e,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x22b,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x6e>:
push   %rax
mov    $0x6e,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x22b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for n\00"
define void @t_isxdigit_0x6e() {
%1 = call i64 @isxdigit(i32 110)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 555, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for n\00"
define void @t_isxdigit_0x6e() {
%1 = tail call i64 @isxdigit(i32 110)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 555, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ select_operation_mode(int, char **);
int init_board_connect_server(int argc, char **command) {
  select_operation_mode(argc, command);
}


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

x86 assembly (clang, -O2):
<init_board_connect_server>:
jmp    1030 <select_operation_mode@plt>

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

LLVM IR (-O2):
define i32 @init_board_connect_server(i32 %0, i8** %1) {
%3 = tail call i32 @select_operation_mode(i32 %0, i8** %1)
ret i32 undef
}
int f6(int x __attribute__((__unused__))) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @f6(i32 returned %0) {
ret i32 %0
}
char *find_ext(char *c) {
  char *l = ((void *)0);
  while (*c) {
    if (*c == '/')
      l = ((void *)0);
    else if (*c == '.')
      l = c;
    c++;
  }
  return l;
}


x86 assembly (clang, -O0):
<find_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <find_ext+0x68>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    113a <find_ext+0x3a>
movq   $0x0,-0x10(%rbp)
jmp    1157 <find_ext+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1152 <find_ext+0x52>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1157 <find_ext+0x57>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <find_ext+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_ext>:
xor    %eax,%eax
jmp    1119 <find_ext+0x19>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %ecx,%ecx
add    $0x1,%rdi
mov    %rcx,%rax
movzbl (%rdi),%edx
mov    %rdi,%rcx
cmp    $0x2e,%dl
je     1112 <find_ext+0x12>
cmp    $0x2f,%dl
je     1110 <find_ext+0x10>
test   %dl,%dl
je     1132 <find_ext+0x32>
mov    %rax,%rcx
jmp    1112 <find_ext+0x12>
ret

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

LLVM IR (-O2):
define i8* @find_ext(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ null, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %7 [
i8 0, label %11
i8 47, label %8
i8 46, label %6
]
6: ; preds = %2
br label %8
7: ; preds = %2
br label %8
8: ; preds = %2, %7, %6
%9 = phi i8* [ %3, %6 ], [ null, %2 ], [ %4, %7 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
int f(int a, char o, int b) {
  if (o == '+')
    return a + b;
  if (o == '-')
    return a - b;
  if (o == '*')
    return a * b;
  if (o == '/')
    return a / b;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x2b,%eax
jne    112b <f+0x2b>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <f+0x85>
movsbl -0x9(%rbp),%eax
cmp    $0x2d,%eax
jne    1146 <f+0x46>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <f+0x85>
movsbl -0x9(%rbp),%eax
cmp    $0x2a,%eax
jne    1162 <f+0x62>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <f+0x85>
movsbl -0x9(%rbp),%eax
cmp    $0x2f,%eax
jne    117e <f+0x7e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1185 <f+0x85>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
add    $0xd6,%sil
cmp    $0x5,%sil
ja     1137 <f+0x37>
mov    %edx,%ecx
movzbl %sil,%edx
lea    0xee7(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
imul   %edi,%ecx
mov    %ecx,%eax
ret
add    %edi,%ecx
mov    %ecx,%eax
ret
sub    %ecx,%edi
mov    %edi,%eax
ret
mov    %edi,%eax
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i8 signext %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i32 %0, i32* %5
store i8 %1, i8* %6
store i32 %2, i32* %7
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 43
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = add nsw i32 %12, %13
store i32 %14, i32* %4
br label %40
15: ; preds = %3
%16 = load i8, i8* %6
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 45
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i32, i32* %5
%21 = load i32, i32* %7
%22 = sub nsw i32 %20, %21
store i32 %22, i32* %4
br label %40
23: ; preds = %15
%24 = load i8, i8* %6
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 42
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i32, i32* %5
%29 = load i32, i32* %7
%30 = mul nsw i32 %28, %29
store i32 %30, i32* %4
br label %40
31: ; preds = %23
%32 = load i8, i8* %6
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 47
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load i32, i32* %5
%37 = load i32, i32* %7
%38 = sdiv i32 %36, %37
store i32 %38, i32* %4
br label %40
39: ; preds = %31
store i32 0, i32* %4
br label %40
40: ; preds = %39, %35, %27, %19, %11
%41 = load i32, i32* %4
ret i32 %41
}

LLVM IR (-O2):
define i32 @f(i32 %0, i8 signext %1, i32 %2) {
switch i8 %1, label %12 [
i8 43, label %4
i8 45, label %6
i8 42, label %8
i8 47, label %10
]
4: ; preds = %3
%5 = add nsw i32 %2, %0
br label %12
6: ; preds = %3
%7 = sub nsw i32 %0, %2
br label %12
8: ; preds = %3
%9 = mul nsw i32 %2, %0
br label %12
10: ; preds = %3
%11 = sdiv i32 %0, %2
br label %12
12: ; preds = %3, %10, %8, %6, %4
%13 = phi i32 [ %5, %4 ], [ %7, %6 ], [ %9, %8 ], [ %11, %10 ], [ 0, %3 ]
ret i32 %13
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
long int timecheck(void) {
  time_t time0;
  time0 = time(NULL);
  return (long int)time0;
}


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

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

LLVM IR (-O0):
define i64 @timecheck() {
%1 = alloca i64
%2 = call i64 @time(i32* null)
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @timecheck() {
%1 = tail call i64 @time(i32* null)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int fn(int i) {
  i = 0;
  if (i <= 5) {
    i += 1;
    write(1, "F", 1);
    fn(i);
    return (0);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     116c <fn+0x4c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edx
lea    0xeaf(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    -0x8(%rbp),%edi
call   1030 <fn@plt>
movl   $0x0,-0x4(%rbp)
jmp    1173 <fn+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1120 <fn+0x10>

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

LLVM IR (-O2):
@.str = [2 x i8] c"F\00"
define i32 @fn(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %2
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int CadenasIguales(char *c1, char *c2) {
  if (strcmp(c1, c2) == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<CadenasIguales>:
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   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1143 <CadenasIguales+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <CadenasIguales+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CadenasIguales>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CadenasIguales(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 i64 @strcmp(i8* %6, i8* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @CadenasIguales(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putp(int /*<<< orphan*/);
int /*<<< orphan*/ tigetstr(char *);
int main(int argc, char *argv[]) {
  putp(tigetstr("clear"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <tigetstr@plt>
mov    %eax,%edi
call   1030 <putp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\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 @tigetstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @putp(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @tigetstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @putp(i32 %3)
ret i32 0
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_reflect(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ *);
__attribute__((always_)) struct vec2i *
psvec2i_reflect(struct vec2i *result, struct vec2i *a, struct vec2i *b) {
  vec2i_reflect((int32_t *)result, (int32_t *)a, (int32_t *)b);
  return result;
}


x86 assembly (clang, -O0):
<psvec2i_reflect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <vec2i_reflect@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2i_reflect>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2i_reflect@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_reflect(%struct.vec2i* %0, %struct.vec2i* %1, %struct.vec2i* %2) {
%4 = alloca %struct.vec2i*
%5 = alloca %struct.vec2i*
%6 = alloca %struct.vec2i*
store %struct.vec2i* %0, %struct.vec2i** %4
store %struct.vec2i* %1, %struct.vec2i** %5
store %struct.vec2i* %2, %struct.vec2i** %6
%7 = load %struct.vec2i*, %struct.vec2i** %4
%8 = bitcast %struct.vec2i* %7 to i32*
%9 = load %struct.vec2i*, %struct.vec2i** %5
%10 = bitcast %struct.vec2i* %9 to i32*
%11 = load %struct.vec2i*, %struct.vec2i** %6
%12 = bitcast %struct.vec2i* %11 to i32*
%13 = call i32 @vec2i_reflect(i32* %8, i32* %10, i32* %12)
%14 = load %struct.vec2i*, %struct.vec2i** %4
ret %struct.vec2i* %14
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_reflect(%struct.vec2i* returned %0, %struct.vec2i* %1, %struct.vec2i* %2) {
%4 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%5 = getelementptr %struct.vec2i, %struct.vec2i* %1, i64 0, i32 0
%6 = getelementptr %struct.vec2i, %struct.vec2i* %2, i64 0, i32 0
%7 = tail call i32 @vec2i_reflect(i32* %4, i32* %5, i32* %6)
ret %struct.vec2i* %0
}
char *gen_basename(char *fn) {
  char *r = strrchr(fn, '/');
  if (r != ((void *)0))
    return r + 1;
  else
    return fn;
}


x86 assembly (clang, -O0):
<gen_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <gen_basename+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <gen_basename+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @gen_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vuln();
int main() {
  setbuf(stdout, NULL);
  puts("HELLO. I AM SMARTBOT ALPHA 0.1.0.");
  vuln();
  puts("YOUR WISHES ARE DENIED.");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <setbuf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <vuln@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <setbuf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <vuln@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [34 x i8] c"HELLO. I AM SMARTBOT ALPHA 0.1.0.\00"
@.str.1 = [24 x i8] c"YOUR WISHES ARE DENIED.\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = call i32 @setbuf(i32 %1, i32* null)
%3 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @vuln()
%5 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [34 x i8] c"HELLO. I AM SMARTBOT ALPHA 0.1.0.\00"
@.str.1 = [24 x i8] c"YOUR WISHES ARE DENIED.\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32* null)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @vuln()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("%s: great on anything.\n", "Bacon");
  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
lea    0xee4(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"%s: great on anything.\0A\00"
@.str.1 = [6 x i8] c"Bacon\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 ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s: great on anything.\0A\00"
@.str.1 = [6 x i8] c"Bacon\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rp_AcqReset();
int /*<<< orphan*/ rp_ApinReset();
int /*<<< orphan*/ rp_DpinReset();
int /*<<< orphan*/ rp_GenReset();
void reset() {
  rp_DpinReset();
  rp_ApinReset();
  rp_GenReset();
  rp_AcqReset();
}


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <rp_DpinReset@plt>
mov    $0x0,%al
call   1040 <rp_ApinReset@plt>
mov    $0x0,%al
call   1060 <rp_GenReset@plt>
mov    $0x0,%al
call   1030 <rp_AcqReset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
push   %rax
xor    %eax,%eax
call   1050 <rp_DpinReset@plt>
xor    %eax,%eax
call   1040 <rp_ApinReset@plt>
xor    %eax,%eax
call   1060 <rp_GenReset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <rp_AcqReset@plt>

LLVM IR (-O0):
define void @reset() {
%1 = call i32 (...) @rp_DpinReset()
%2 = call i32 (...) @rp_ApinReset()
%3 = call i32 (...) @rp_GenReset()
%4 = call i32 (...) @rp_AcqReset()
ret void
}

LLVM IR (-O2):
define void @reset() {
%1 = tail call i32 (...) @rp_DpinReset()
%2 = tail call i32 (...) @rp_ApinReset()
%3 = tail call i32 (...) @rp_GenReset()
%4 = tail call i32 (...) @rp_AcqReset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char);
void printf_l(char *text, int length) {
  int i;
  for (i = 0; i < length; i++) {
    print(*text);
    text++;
  }
}


x86 assembly (clang, -O0):
<printf_l>:
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
jge    1158 <printf_l+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <print@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printf_l+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_l>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <printf_l+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <print@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <printf_l+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @printf_l(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i8* [ %9, %4 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call i32 @print(i8 signext %7)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ assert(int);
int mean(int *, int, int *);
void test_too_big_sum(void) {
  int res;
  int arr[] = {INT_MAX, INT_MAX};
  assert((mean(arr, 2, &res) == 3));
}


x86 assembly (clang, -O0):
<test_too_big_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
lea    -0x4(%rbp),%rdx
call   1040 <mean@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_too_big_sum>:
sub    $0x18,%rsp
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    %eax,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x14(%rsp),%rdx
mov    $0x2,%esi
call   1040 <mean@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1030 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define void @test_too_big_sum() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%4 = load i32, i32* @INT_MAX
store i32 %4, i32* %3
%5 = getelementptr inbounds i32, i32* %3, i64 1
%6 = load i32, i32* @INT_MAX
store i32 %6, i32* %5
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%8 = call i32 @mean(i32* %7, i32 2, i32* %1)
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @test_too_big_sum() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [2 x i32]* %2 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* @INT_MAX
store i32 %6, i32* %5
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32 %6, i32* %7
%8 = call i32 @mean(i32* %5, i32 2, i32* %1)
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}
/* Variables and functions */
double log(int);
double Log2(double n) { return log(n) / log(2); }


x86 assembly (clang, -O0):
<Log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log2>:
push   %rax
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = call double @log(i32 %4)
%6 = call double @log(i32 2)
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Log2(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call double @log(i32 %2)
%4 = tail call double @log(i32 2)
%5 = fdiv double %3, %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void print_set(FILE *f, int n, int v[]) {
  int i = 0;
  for (i = 0; i < n; i++)
    fprintf(f, " %d", v[i]);
}


x86 assembly (clang, -O0):
<print_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1166 <print_set+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <print_set+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_set>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %esi,%esi
jle    1148 <print_set+0x38>
mov    %rdx,%r14
mov    %rdi,%r12
mov    %esi,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
mov    (%r14,%rbx,4),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <print_set+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @print_set(i32* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %2, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
void DMTimerModeConfigure(unsigned int baseAdd, unsigned int timerMode) {
  (*((volatile unsigned int *)(baseAdd + (0x38)))) &=
      ~((0x00000002u) | (0x00000040u));
  (*((volatile unsigned int *)(baseAdd + (0x38)))) |=
      (timerMode & ((0x00000002u) | (0x00000040u)));
}


x86 assembly (clang, -O0):
<DMTimerModeConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x38,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffbd,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x42,%edx
mov    -0x4(%rbp),%eax
add    $0x38,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMTimerModeConfigure>:
add    $0x38,%edi
andl   $0xffffffbd,(%rdi)
and    $0x42,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @DMTimerModeConfigure(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 = add i32 %5, 56
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -67
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 66
%13 = load i32, i32* %3
%14 = add i32 %13, 56
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @DMTimerModeConfigure(i32 %0, i32 %1) {
%3 = add i32 %0, 56
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -67
store volatile i32 %7, i32* %5
%8 = and i32 %1, 66
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
void SetNaClSwitchExpectations(void) {}


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

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

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

LLVM IR (-O2):
define void @SetNaClSwitchExpectations() {
ret void
}
/* Variables and functions */
void stats_delete(size_t sz) {}


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

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

LLVM IR (-O0):
define void @stats_delete(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret void
}

LLVM IR (-O2):
define void @stats_delete(i64 %0) {
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR9B_set(void) { return U_WMRCORENONE_set("U_WMR9B"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR9B\00"
define i8* @U_WMR9B_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR9B\00"
define i8* @U_WMR9B_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
struct pci_device {
  unsigned short device_id;
};

/* Variables and functions */
unsigned short pcidev_to_devid(struct pci_device *pdev) {
  return pdev->device_id;
}


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

x86 assembly (clang, -O2):
<pcidev_to_devid>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.pci_device = type { i16 }
define zeroext i16 @pcidev_to_devid(%struct.pci_device* %0) {
%2 = alloca %struct.pci_device*
store %struct.pci_device* %0, %struct.pci_device** %2
%3 = load %struct.pci_device*, %struct.pci_device** %2
%4 = getelementptr inbounds %struct.pci_device, %struct.pci_device* %3, i32 0, i32 0
%5 = load i16, i16* %4
ret i16 %5
}

LLVM IR (-O2):
%struct.pci_device = type { i16 }
define zeroext i16 @pcidev_to_devid(%struct.pci_device* nocapture %0) {
%2 = getelementptr inbounds %struct.pci_device, %struct.pci_device* %0, i64 0, i32 0
%3 = load i16, i16* %2
ret i16 %3
}