xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help11(void) {
  printf("  mw                show memory word at PC\n");
  printf("  mw <addr>         show memory word at <addr>\n");
  printf("  mw <addr> <data>  set memory word at <addr> to <data>\n");
}


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

x86 assembly (clang, -O2):
<help11>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [44 x i8] c" mw show memory word at PC\0A\00"
@.str.1 = [48 x i8] c" mw <addr> show memory word at <addr>\0A\00"
@.str.2 = [57 x i8] c" mw <addr> <data> set memory word at <addr> to <data>\0A\00"
define void @help11() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c" mw show memory word at PC\00"
@str.3 = [47 x i8] c" mw <addr> show memory word at <addr>\00"
@str.4 = [56 x i8] c" mw <addr> <data> set memory word at <addr> to <data>\00"
define void @help11() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int /*<<< orphan*/ OBJ_NAME_TYPE_MD_METH;
scalar_t__ OBJ_NAME_get(char const *, int /*<<< orphan*/);
const EVP_MD *EVP_get_digestbyname(const char *name) {
  const EVP_MD *cp;
  cp = (const EVP_MD *)OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH);
  return (cp);
}


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

x86 assembly (clang, -O2):
<EVP_get_digestbyname>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <OBJ_NAME_get@plt>

LLVM IR (-O0):
@OBJ_NAME_TYPE_MD_METH = global i32 0
define i32* @EVP_get_digestbyname(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @OBJ_NAME_TYPE_MD_METH
%6 = call i64 @OBJ_NAME_get(i8* %4, i32 %5)
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
ret i32* %8
}

LLVM IR (-O2):
@OBJ_NAME_TYPE_MD_METH = global i32 0
define i32* @EVP_get_digestbyname(i8* %0) {
%2 = load i32, i32* @OBJ_NAME_TYPE_MD_METH
%3 = tail call i64 @OBJ_NAME_get(i8* %0, i32 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
void gdk_keyval_from_name() {}


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

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

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

LLVM IR (-O2):
define void @gdk_keyval_from_name() {
ret void
}
int is_from(const char c, const char *from) {
  if (from && c) {
    while (*from) {
      if (c == *from)
        return 1;
      from++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_from>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <is_from+0x6d>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     116d <is_from+0x6d>
jmp    112b <is_from+0x2b>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <is_from+0x68>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1157 <is_from+0x57>
movl   $0x1,-0x4(%rbp)
jmp    1174 <is_from+0x74>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <is_from+0x2b>
jmp    116d <is_from+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_from>:
xor    %eax,%eax
test   %dil,%dil
je     1130 <is_from+0x30>
test   %rsi,%rsi
je     1130 <is_from+0x30>
mov    (%rsi),%cl
test   %cl,%cl
je     1130 <is_from+0x30>
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
cmp    %dil,%cl
je     1131 <is_from+0x31>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <is_from+0x20>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_from(i8 signext %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** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %29
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %29
12: ; preds = %8
br label %13
13: ; preds = %25, %12
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = icmp ne i8 %15, 0
br i1 %16, label %17, label %28
17: ; preds = %13
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = load i8*, i8** %5
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %19, %22
br i1 %23, label %24, label %25
24: ; preds = %17
store i32 1, i32* %3
br label %30
25: ; preds = %17
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %5
br label %13
28: ; preds = %13
br label %29
29: ; preds = %28, %8, %2
store i32 0, i32* %3
br label %30
30: ; preds = %29, %24
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @is_from(i8 signext %0, i8* %1) {
%3 = icmp ne i8* %1, null
%4 = icmp ne i8 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %12
9: ; preds = %12
%10 = load i8, i8* %16
%11 = icmp eq i8 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %6, %9
%13 = phi i8 [ %10, %9 ], [ %7, %6 ]
%14 = phi i8* [ %16, %9 ], [ %1, %6 ]
%15 = icmp eq i8 %13, %0
%16 = getelementptr inbounds i8, i8* %14, i64 1
br i1 %15, label %17, label %9
17: ; preds = %12, %9, %6, %2
%18 = phi i32 [ 0, %2 ], [ 0, %6 ], [ 1, %12 ], [ 0, %9 ]
ret i32 %18
}
/* Type definitions */
struct instrument {
  int dummy;
};

/* Variables and functions */
int inst_qryint(struct instrument *, char *);
int inst_488_2_ese(struct instrument *gd) { return inst_qryint(gd, "*ESE?\n"); }


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

x86 assembly (clang, -O2):
<inst_488_2_ese>:
lea    0xee9(%rip),%rsi
jmp    1030 <inst_qryint@plt>

LLVM IR (-O0):
%struct.instrument = type { i32 }
@.str = [7 x i8] c"*ESE?\0A\00"
define i32 @inst_488_2_ese(%struct.instrument* %0) {
%2 = alloca %struct.instrument*
store %struct.instrument* %0, %struct.instrument** %2
%3 = load %struct.instrument*, %struct.instrument** %2
%4 = call i32 @inst_qryint(%struct.instrument* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
%struct.instrument = type { i32 }
@.str = [7 x i8] c"*ESE?\0A\00"
define i32 @inst_488_2_ese(%struct.instrument* %0) {
%2 = tail call i32 @inst_qryint(%struct.instrument* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
double atof(char *);
int atoi(char *);
long atol(char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, long, double);
main() {
  char str[] = "123";
  int int_num;
  long long_num;
  double double_num;
  int_num = atoi(str);
  long_num = atol(str);
  double_num = atof(str);
  printf("%d\n%f\n%f", int_num, long_num, double_num);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xea2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
call   1060 <atol@plt>
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <atof@plt>
lea    0xec0(%rip),%rdi
mov    $0x7b,%edx
mov    $0x7b,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [4 x i8] c"123\00"
@.str = [9 x i8] c"%d\0A%f\0A%f\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = alloca i32
%3 = alloca i64
%4 = alloca double
%5 = bitcast [4 x i8]* %1 to i8*
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%7 = call i32 @atoi(i8* %6)
store i32 %7, i32* %2
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%9 = call i64 @atol(i8* %8)
store i64 %9, i64* %3
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%11 = call double @atof(i8* %10)
store double %11, double* %4
%12 = load i32, i32* %2
%13 = load i64, i64* %3
%14 = load double, double* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12, i64 %13, double %14)
%16 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [4 x i8] c"123\00"
@.str = [9 x i8] c"%d\0A%f\0A%f\00"
define i32 @main() {
%1 = tail call double @atof(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__const.main.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 123, i64 123, double %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
unsigned int bar();
void foo0x3f(void) {
  unsigned int a = bar();
  if (a <= 0x3f)
    bar();
}


x86 assembly (clang, -O0):
<foo0x3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x3f,-0x4(%rbp)
ja     1133 <foo0x3f+0x23>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo0x3f>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
cmp    $0x3f,%eax
ja     1125 <foo0x3f+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @foo0x3f() {
%1 = alloca i32
%2 = call i32 (...) @bar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ule i32 %3, 63
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @bar()
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @foo0x3f() {
%1 = tail call i32 (...) @bar()
%2 = icmp ult i32 %1, 64
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @bar()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(int);
void main() {
  int c;
  while ((c = getchar()) != EOF) {
    printf("%d\n", getchar() != EOF);
  }
  putchar(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
je     117a <main+0x4a>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
jmp    1138 <main+0x8>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea6(%rip),%rbx
cmp    (%rbx),%eax
je     1172 <main+0x42>
lea    0xeb3(%rip),%r14
nopl   (%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %esi,%esi
cmp    (%rbx),%eax
setne  %sil
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @getchar()
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ %1, %0 ], [ %10, %4 ]
%15 = tail call i32 @putchar(i32 %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int /*<<< orphan*/ __VERIFIER_assume(int);
void main() {
  int i, n, m, r;
  __VERIFIER_assume(n > 0);
  i = 0;
  r = 0;
  m = m;
  n = n;
  while (i < n) {
    r = r + m;
    i++;
  }
  __VERIFIER_assert(r == n * m);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assume@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1176 <main+0x56>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <main+0x33>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <__VERIFIER_assume@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <__VERIFIER_assert@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__VERIFIER_assume(i32 0)
%2 = tail call i32 @__VERIFIER_assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int);
int /*<<< orphan*/ stdout;
void waypt_status_disp(int total_ct, int myct) {
  fprintf(stdout, "%d/%d/%d\r", myct * 100 / total_ct, myct, total_ct);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<waypt_status_disp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
imul   $0x64,-0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,%edx
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%r8d
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waypt_status_disp>:
push   %rbx
mov    %esi,%ecx
mov    %edi,%r8d
mov    0x2eb3(%rip),%rbx
mov    (%rbx),%edi
imul   $0x64,%esi,%eax
cltd
idiv   %r8d
lea    0xec3(%rip),%rsi
mov    %eax,%edx
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"%d/%d/%d\0D\00"
define void @waypt_status_disp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 100
%8 = load i32, i32* %3
%9 = sdiv i32 %7, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* @stdout
%14 = call i32 @fflush(i32 %13)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"%d/%d/%d\0D\00"
define void @waypt_status_disp(i32 %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = mul nsw i32 %1, 100
%5 = sdiv i32 %4, %0
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1, i32 %0)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
ret void
}
void TranspositionTableCleanUp(char **enc_table, int rows) {
  int i;
  for (i = 0; i < rows; i++)
    free(enc_table[i]);
  free(enc_table);
}


x86 assembly (clang, -O0):
<TranspositionTableCleanUp>:
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    1151 <TranspositionTableCleanUp+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <TranspositionTableCleanUp+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @TranspositionTableCleanUp(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 i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
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
%20 = load i8**, i8*** %3
%21 = bitcast i8** %20 to i8*
ret void
}

LLVM IR (-O2):
define void @TranspositionTableCleanUp(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int oraCmp(int **, int **);
oraCmpInv(int **x, int **y) { return (-oraCmp(x, y)); }


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

x86 assembly (clang, -O2):
<oraCmpInv>:
push   %rax
call   1030 <oraCmp@plt>
neg    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @oraCmpInv(i32** %0, i32** %1) {
%3 = tail call i32 @oraCmp(i32** %0, i32** %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0;
  printf("%c\n", (char)a);
  printf("%d\n", a);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

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


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

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

LLVM IR (-O0):
define i32 @PicoInit() {
ret i32 1
}

LLVM IR (-O2):
define i32 @PicoInit() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void main() {
  FILE *fp;
  char *x = "thisisabook";
  fp = fopen("abc.txt", "w");
  fputs(x, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec2(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed4(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xeb2(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"thisisabook\00"
@.str.1 = [8 x i8] c"abc.txt\00"
@.str.2 = [2 x i8] c"w\00"
define void @main() {
%1 = alloca i32*
%2 = alloca i8*
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i8*, i8** %2
%5 = load i32*, i32** %1
%6 = call i32 @fputs(i8* %4, i32* %5)
%7 = load i32*, i32** %1
%8 = call i32 @fclose(i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"thisisabook\00"
@.str.1 = [8 x i8] c"abc.txt\00"
@.str.2 = [2 x i8] c"w\00"
define void @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
/* Type definitions */
struct statistics {
  int dummy;
};

/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ stats_var(struct statistics *);
double stats_stdev(struct statistics *stats) { return sqrt(stats_var(stats)); }


x86 assembly (clang, -O0):
<stats_stdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <stats_var@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stats_stdev>:
push   %rax
call   1030 <stats_var@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
%struct.statistics = type { i32 }
define double @stats_stdev(%struct.statistics* %0) {
%2 = alloca %struct.statistics*
store %struct.statistics* %0, %struct.statistics** %2
%3 = load %struct.statistics*, %struct.statistics** %2
%4 = call i32 @stats_var(%struct.statistics* %3)
%5 = call double @sqrt(i32 %4)
ret double %5
}

LLVM IR (-O2):
%struct.statistics = type { i32 }
define double @stats_stdev(%struct.statistics* %0) {
%2 = tail call i32 @stats_var(%struct.statistics* %0)
%3 = tail call double @sqrt(i32 %2)
ret double %3
}
/* Variables and functions */
scalar_t__ compare_strings(void *, void *);
int equal_strings(void *lp, void *rp) { return compare_strings(lp, rp) == 0; }


x86 assembly (clang, -O0):
<equal_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <compare_strings@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @equal_strings(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @compare_strings(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @equal_strings(i8* %0, i8* %1) {
%3 = tail call i64 @compare_strings(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ logMsg(char *, char const *, char const *);
void logCmdOption(const char *aOption, const char *aDescr) {
  logMsg("\t%s\n\t\t%s\n", aOption, aDescr);
}


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

x86 assembly (clang, -O2):
<logCmdOption>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <logMsg@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\09%s\0A\09\09%s\0A\00"
define void @logCmdOption(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @logMsg(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\09%s\0A\09\09%s\0A\00"
define void @logCmdOption(i8* %0, i8* %1) {
%3 = tail call i32 @logMsg(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
double exp(double);
double AUX2bp0b(double x) { return 1.0 + exp(x); }


x86 assembly (clang, -O0):
<AUX2bp0b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AUX2bp0b>:
push   %rax
call   1030 <exp@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @AUX2bp0b(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @exp(double %3)
%5 = fadd double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @AUX2bp0b(double %0) {
%2 = tail call double @exp(double %0)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int fibonacci(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  printf("你想看第几个斐波那契数？");
  int num;
  scanf("%d", &num);
  printf("第 %d 个斐波那契数是: %d\n", num, fibonacci(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fibonacci@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <fibonacci@plt>
lea    0xec2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\E4\BD\A0\E6\83\B3\E7\9C\8B\E7\AC\AC\E5\87\A0\E4\B8\AA\E6\96\90\E6\B3\A2\E9\82\A3\E5\A5\91\E6\95\B0\EF\BC\9F\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [34 x i8] c"\E7\AC\AC %d \E4\B8\AA\E6\96\90\E6\B3\A2\E9\82\A3\E5\A5\91\E6\95\B0\E6\98\AF: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @fibonacci(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"\E4\BD\A0\E6\83\B3\E7\9C\8B\E7\AC\AC\E5\87\A0\E4\B8\AA\E6\96\90\E6\B3\A2\E9\82\A3\E5\A5\91\E6\95\B0\EF\BC\9F\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [34 x i8] c"\E7\AC\AC %d \E4\B8\AA\E6\96\90\E6\B3\A2\E9\82\A3\E5\A5\91\E6\95\B0\E6\98\AF: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fibonacci(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
void gtk_list_store_set() {}


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

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

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

LLVM IR (-O2):
define void @gtk_list_store_set() {
ret void
}
/* Variables and functions */
double RAND_MAX;
double random();
double random_ab(double a, double b) {
  return a + (b - a) * (random() / RAND_MAX);
}


x86 assembly (clang, -O0):
<random_ab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mov    0x2e92(%rip),%rax
divsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_ab>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
mov    0x2eb6(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @random_ab(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 = load double, double* %3
%8 = fsub double %6, %7
%9 = call double (...) @random()
%10 = load double, double* @RAND_MAX
%11 = fdiv double %9, %10
%12 = call double @llvm.fmuladd.f64(double %8, double %11, double %5)
ret double %12
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @random_ab(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call double (...) @random()
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = tail call double @llvm.fmuladd.f64(double %3, double %6, double %0)
ret double %7
}
int fun1130() { return 1130; }


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

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

LLVM IR (-O0):
define i32 @fun1130() {
ret i32 1130
}

LLVM IR (-O2):
define i32 @fun1130() {
ret i32 1130
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ strcmp(char *, char *);
void check_exit(char *buf) {
  if (!strcmp(buf, "exit\n")) {
    exit(EXIT_SUCCESS);
  }
}


x86 assembly (clang, -O0):
<check_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1153 <check_exit+0x33>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_exit>:
push   %rax
lea    0xed8(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1133 <check_exit+0x13>
pop    %rax
ret
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"exit\0A\00"
@EXIT_SUCCESS = global i32 0
define void @check_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"exit\0A\00"
@EXIT_SUCCESS = global i32 0
define void @check_exit(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ juman_log_err(char *);
int /*<<< orphan*/ my_free(unsigned char *);
char *my_strdup(unsigned char *);
char *_replace_buffer(unsigned char *buf) {
  char *str;
  if ((str = my_strdup(buf)) == NULL) {
    juman_log_err("Can't malloc string buffer\n");
    exit(2);
  }
  my_free(buf);
  return str;
}


x86 assembly (clang, -O0):
<_replace_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <my_strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1179 <_replace_buffer+0x39>
lea    0xe96(%rip),%rdi
call   1030 <juman_log_err@plt>
mov    $0x2,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1050 <my_free@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_replace_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <my_strdup@plt>
test   %rax,%rax
je     1167 <_replace_buffer+0x27>
mov    %rax,%rbx
mov    %r14,%rdi
call   1050 <my_free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe92(%rip),%rdi
call   1030 <juman_log_err@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Can't malloc string buffer\0A\00"
define i8* @_replace_buffer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @my_strdup(i8* %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @juman_log_err(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 2)
unreachable
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @my_free(i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [28 x i8] c"Can't malloc string buffer\0A\00"
define i8* @_replace_buffer(i8* %0) {
%2 = tail call i8* @my_strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @juman_log_err(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %1
%8 = tail call i32 @my_free(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
int readmemw(int, scalar_t__);
uint32_t readmeml(uint32_t s, uint16_t a) {
  uint32_t temp;
  temp = (uint32_t)(readmemw(s, a + 2)) << 16;
  temp |= readmemw(s, a);
  return temp;
}


x86 assembly (clang, -O0):
<readmeml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x2,%rsi
call   1030 <readmemw@plt>
shl    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <readmemw@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readmeml>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
add    $0x2,%rsi
call   1030 <readmemw@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <readmemw@plt>
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readmeml(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = load i64, i64* %4
%8 = add nsw i64 %7, 2
%9 = call i32 @readmemw(i32 %6, i64 %8)
%10 = shl i32 %9, 16
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = call i32 @readmemw(i32 %11, i64 %12)
%14 = load i32, i32* %5
%15 = or i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @readmeml(i32 %0, i64 %1) {
%3 = add nsw i64 %1, 2
%4 = tail call i32 @readmemw(i32 %0, i64 %3)
%5 = shl i32 %4, 16
%6 = tail call i32 @readmemw(i32 %0, i64 %1)
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *print2(void *data) { printf("2 "); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"2 \00"
define noalias i8* @print2(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* undef
}
void del_nop(void *node) { (void)node; }


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

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

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

LLVM IR (-O2):
define void @del_nop(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Unregister(void *);
void cnfUregp(void *cpointer) { (void)Unregister(cpointer); }


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

x86 assembly (clang, -O2):
<cnfUregp>:
jmp    1030 <Unregister@plt>

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

LLVM IR (-O2):
define void @cnfUregp(i8* %0) {
%2 = tail call i32 @Unregister(i8* %0)
ret void
}
void put1a(int n) { (void)n; }


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

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

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

LLVM IR (-O2):
define void @put1a(i32 %0) {
ret void
}
/* Type definitions */
struct fid_poll {
  int dummy;
};
struct fid_domain {
  int dummy;
};
struct fi_poll_attr {
  int dummy;
};

/* Variables and functions */
int gnix_poll_open(struct fid_domain *, struct fi_poll_attr *,
                   struct fid_poll **);
int fi_poll_open(struct fid_domain *domain, struct fi_poll_attr *attr,
                 struct fid_poll **pollset) {
  return gnix_poll_open(domain, attr, pollset);
}


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

x86 assembly (clang, -O2):
<fi_poll_open>:
jmp    1030 <gnix_poll_open@plt>

LLVM IR (-O0):
%struct.fid_domain = type { i32 }
%struct.fi_poll_attr = type { i32 }
%struct.fid_poll = type { i32 }
define i32 @fi_poll_open(%struct.fid_domain* %0, %struct.fi_poll_attr* %1, %struct.fid_poll** %2) {
%4 = alloca %struct.fid_domain*
%5 = alloca %struct.fi_poll_attr*
%6 = alloca %struct.fid_poll**
store %struct.fid_domain* %0, %struct.fid_domain** %4
store %struct.fi_poll_attr* %1, %struct.fi_poll_attr** %5
store %struct.fid_poll** %2, %struct.fid_poll*** %6
%7 = load %struct.fid_domain*, %struct.fid_domain** %4
%8 = load %struct.fi_poll_attr*, %struct.fi_poll_attr** %5
%9 = load %struct.fid_poll**, %struct.fid_poll*** %6
%10 = call i32 @gnix_poll_open(%struct.fid_domain* %7, %struct.fi_poll_attr* %8, %struct.fid_poll** %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.fid_domain = type { i32 }
%struct.fi_poll_attr = type { i32 }
%struct.fid_poll = type { i32 }
define i32 @fi_poll_open(%struct.fid_domain* %0, %struct.fi_poll_attr* %1, %struct.fid_poll** %2) {
%4 = tail call i32 @gnix_poll_open(%struct.fid_domain* %0, %struct.fi_poll_attr* %1, %struct.fid_poll** %2)
ret i32 %4
}
unsigned char f15(unsigned char x, unsigned int y) {
  return (x << y) | (x >> ((-y) & (8 * sizeof(unsigned char) - 1)));
}


x86 assembly (clang, -O0):
<f15>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    %ecx,%ecx
and    $0x7,%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f15>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0x7,%cl
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f15(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sub i32 0, %11
%13 = zext i32 %12 to i64
%14 = and i64 %13, 7
%15 = trunc i64 %14 to i32
%16 = ashr i32 %10, %15
%17 = or i32 %8, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f15(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = shl i32 %3, %1
%5 = sub i32 0, %1
%6 = and i32 %5, 7
%7 = lshr i32 %3, %6
%8 = or i32 %7, %4
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int *wsk;
  int tab[2][2] = {{12, 14}, {16}};
  wsk = tab[0];
  printf("%d\n", *wsk);
  printf("%d\n", *wsk + 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
add    $0x2,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 14)
ret i32 0
}
/* Variables and functions */
char *getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("bffy awaiting your command.\n>");
  char *cmd = getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [30 x i8] c"bffy awaiting your command.\0A>\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* (...) @getchar()
ret i32 0
}