xunge/DecIR huggingface dataset:
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ dtype_normalize(char *, char const *);
int dtype_itemsize(const char *dtype) {
  char ndtype[8];
  dtype_normalize(ndtype, dtype);
  return atoi(&ndtype[2]);
}


x86 assembly (clang, -O0):
<dtype_itemsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <dtype_normalize@plt>
lea    -0x10(%rbp),%rdi
add    $0x2,%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtype_itemsize>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <dtype_normalize@plt>
lea    0x2(%rsp),%rdi
call   1040 <atoi@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dtype_itemsize(i8* %0) {
%2 = alloca i8*
%3 = alloca [8 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @dtype_normalize(i8* %4, i8* %5)
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 2
%8 = call i32 @atoi(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @dtype_itemsize(i8* %0) {
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = call i32 @dtype_normalize(i8* %3, i8* %0)
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 2
%6 = call i32 @atoi(i8* %5)
ret i32 %6
}
/* Variables and functions */
int add_match(char *const);
char *add_path_hook(char const *);
int vle_compl_add_path_match(const char path[]) {
  char *const match = add_path_hook(path);
  return add_match(match);
}


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

x86 assembly (clang, -O2):
<vle_compl_add_path_match>:
push   %rax
call   1040 <add_path_hook@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <add_match@plt>

LLVM IR (-O0):
define i32 @vle_compl_add_path_match(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @add_path_hook(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @add_match(i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @vle_compl_add_path_match(i8* %0) {
%2 = tail call i8* @add_path_hook(i8* %0)
%3 = tail call i32 @add_match(i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int back_track(__attribute__((__unused__)) int argc,
               __attribute__((__unused__)) char **argv) {
  fprintf(stderr, "[BACK] "
                  "error"
                  ": "
                  "subcommand 'track' not yet implemented"
                  "\n");
  return -1;
}


x86 assembly (clang, -O0):
<back_track>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_track>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"[BACK] error: subcommand 'track' not yet implemented\0A\00"
define i32 @back_track(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"[BACK] error: subcommand 'track' not yet implemented\0A\00"
define i32 @back_track(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
char CharToUpper(char in) {
  if (in >= 'a' && in <= 'z')
    return in - 'a' + 'A';
  else
    return in;
}


x86 assembly (clang, -O0):
<CharToUpper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <CharToUpper+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1136 <CharToUpper+0x36>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    113c <CharToUpper+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharToUpper>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @CharToUpper(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 65
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %19
17: ; preds = %7, %1
%18 = load i8, i8* %3
store i8 %18, i8* %2
br label %19
19: ; preds = %17, %11
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @CharToUpper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ not_enough();
void stack_underflow() { not_enough(); }


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

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

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

LLVM IR (-O2):
define void @stack_underflow() {
%1 = tail call i32 (...) @not_enough()
ret void
}
unsigned max(unsigned a, unsigned b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmova  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp ugt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int abs(int a) {
  if (a >= 0)
    return a;
  return -a;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111c <abs+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ GetProcessHeap();
int /*<<< orphan*/ HeapFree(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void strfreeU(char *str) { HeapFree(GetProcessHeap(), 0, str); }


x86 assembly (clang, -O0):
<strfreeU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <GetProcessHeap@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <HeapFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strfreeU>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <GetProcessHeap@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <HeapFree@plt>

LLVM IR (-O0):
define void @strfreeU(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @GetProcessHeap()
%4 = load i8*, i8** %2
%5 = call i32 @HeapFree(i32 %3, i32 0, i8* %4)
ret void
}

LLVM IR (-O2):
define void @strfreeU(i8* %0) {
%2 = tail call i32 (...) @GetProcessHeap()
%3 = tail call i32 @HeapFree(i32 %2, i32 0, i8* %0)
ret void
}
int max_int(int a, int b) { return a < b ? b : a; }


x86 assembly (clang, -O0):
<max_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <max_int+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max_int+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_int>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @max_int(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_svariancech(int, float, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_svariancech(N, 1.0f, x, stride);
  printf("sample variance: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
movss  0xe8c(%rip),%xmm0
call   1040 <stdlib_strided_svariancech@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movss  0xebd(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_svariancech@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [21 x i8] c"sample variance: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_svariancech(i32 %6, float 1.000000e+00, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [21 x i8] c"sample variance: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_svariancech(i32 4, float 1.000000e+00, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *xfopen(char *nam, char *mod) {
  FILE *r;
  if ((r = fopen(nam, mod)) == NULL) {
    exit(errno);
  }
  return r;
}


x86 assembly (clang, -O0):
<xfopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1159 <xfopen+0x39>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfopen>:
push   %rax
call   1030 <fopen@plt>
test   %rax,%rax
je     112d <xfopen+0xd>
pop    %rcx
ret
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32* @xfopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @errno
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
@errno = global i32 0
define noalias i32* @xfopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ quit(int);
void terminated(int sig) { quit(1); }


x86 assembly (clang, -O0):
<terminated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <quit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminated>:
mov    $0x1,%edi
jmp    1030 <quit@plt>

LLVM IR (-O0):
define void @terminated(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @quit(i32 1)
ret void
}

LLVM IR (-O2):
define void @terminated(i32 %0) {
%2 = tail call i32 @quit(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct smc_call {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ smc32_arg(struct smc_call const *, int);
uint32_t smc_session_id(const struct smc_call *smc) {
  return smc32_arg(smc, 6);
}


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

x86 assembly (clang, -O2):
<smc_session_id>:
mov    $0x6,%esi
jmp    1030 <smc32_arg@plt>

LLVM IR (-O0):
%struct.smc_call = type { i32 }
define i32 @smc_session_id(%struct.smc_call* %0) {
%2 = alloca %struct.smc_call*
store %struct.smc_call* %0, %struct.smc_call** %2
%3 = load %struct.smc_call*, %struct.smc_call** %2
%4 = call i32 @smc32_arg(%struct.smc_call* %3, i32 6)
ret i32 %4
}

LLVM IR (-O2):
%struct.smc_call = type { i32 }
define i32 @smc_session_id(%struct.smc_call* %0) {
%2 = tail call i32 @smc32_arg(%struct.smc_call* %0, i32 6)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void set_dir(unsigned int cycle_count, uint8_t port, uint8_t data) {}


x86 assembly (clang, -O0):
<set_dir>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @set_dir(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @set_dir(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ x_private;
};
typedef TYPE_1__ XDR;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
void xdrstdio_destroy(XDR *xdrs) { (void)fflush((FILE *)xdrs->x_private); }


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

x86 assembly (clang, -O2):
<xdrstdio_destroy>:
mov    (%rdi),%rdi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define void @xdrstdio_destroy(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i32*
%7 = call i32 @fflush(i32* %6)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
define void @xdrstdio_destroy(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @fflush(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *wrapper_malloc(scalar_t__, char const *, int const);
char *wrapper_strdup(const char *str, const char *file, const int line) {
  char *new_str = wrapper_malloc(strlen(str) + 1, file, line);
  strcpy(new_str, str);
  return new_str;
}


x86 assembly (clang, -O0):
<wrapper_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <wrapper_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapper_strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <wrapper_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @wrapper_strdup(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i8* @wrapper_malloc(i64 %10, i8* %11, i32 %12)
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = load i8*, i8** %4
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
define i8* @wrapper_strdup(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @wrapper_malloc(i64 %5, i8* %1, i32 %2)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
ret i8* %6
}
unsigned int td_ilog2(unsigned int v) {
  unsigned int l = 0;
  while (v >>= 1)
    l++;
  return l;
}


x86 assembly (clang, -O0):
<td_ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <td_ilog2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <td_ilog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<td_ilog2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <td_ilog2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <td_ilog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @td_ilog2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
void _removelast(path) char *path;
{
  register char *p;
  for (p = path + strlen(path); *--p != '/' && p >= path;)
    *p = '\0';
}


x86 assembly (clang, -O0):
<_removelast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movsbl -0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0x19(%rbp)
je     116a <_removelast+0x5a>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
setae  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    117a <_removelast+0x6a>
jmp    1186 <_removelast+0x76>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    113b <_removelast+0x2b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_removelast>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmpb   $0x2f,-0x1(%rbx,%rax,1)
je     1155 <_removelast+0x45>
lea    (%rbx,%rax,1),%rcx
add    $0xffffffffffffffff,%rcx
cmp    %rbx,%rcx
jb     1155 <_removelast+0x45>
add    %rbx,%rax
add    $0xfffffffffffffffe,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x0,0x1(%rax)
cmpb   $0x2f,(%rax)
je     1155 <_removelast+0x45>
lea    -0x1(%rax),%rcx
cmp    %rbx,%rax
mov    %rcx,%rax
jae    1140 <_removelast+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @_removelast(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8* %7, i8** %3
br label %8
8: ; preds = %20, %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 -1
store i8* %10, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 47
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = icmp uge i8* %15, %16
br label %18
18: ; preds = %14, %8
%19 = phi i1 [ false, %8 ], [ %17, %14 ]
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = load i8*, i8** %3
store i8 0, i8* %21
br label %8
22: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @_removelast(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 47
%7 = icmp uge i8* %4, %0
%8 = and i1 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %1, %9
%10 = phi i8* [ %11, %9 ], [ %4, %1 ]
store i8 0, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 -1
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 47
%14 = icmp uge i8* %11, %0
%15 = and i1 %13, %14
br i1 %15, label %9, label %16
16: ; preds = %9, %1
ret void
}
void logprint(char const *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @logprint(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TCXONC;
int ioctl(int, int /*<<< orphan*/, int);
int tcflow(int fd, int action) { return ioctl(fd, TCXONC, action); }


x86 assembly (clang, -O0):
<tcflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcflow>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@TCXONC = global i32 0
define i32 @tcflow(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* @TCXONC
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@TCXONC = global i32 0
define i32 @tcflow(i32 %0, i32 %1) {
%3 = load i32, i32* @TCXONC
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
int main(void) {
  int i;
  unsigned char in[512], out[512];
  check_vect();
  for (i = 0; i < 512; i++) {
    in[i] = i;
    out[i] = 255;
    __asm__ volatile("");
  }
  foo(in, out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_vect@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jge    1177 <main+0x57>
mov    -0x8(%rbp),%eax
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x210(%rbp,%rax,1)
movslq -0x8(%rbp),%rax
movb   $0xff,-0x410(%rbp,%rax,1)
ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rsi
mov    $0x0,%al
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <check_vect@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %bl,0x200(%rsp,%rbx,1)
movb   $0xff,(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x200,%rbx
jne    1140 <main+0x20>
lea    0x200(%rsp),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [512 x i8]
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (...) @check_vect()
br label %6
6: ; preds = %0, %6
%7 = phi i64 [ 0, %0 ], [ %11, %6 ]
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 %7
store i8 %8, i8* %9
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 %7
store i8 -1, i8* %10
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, 512
br i1 %12, label %13, label %6
13: ; preds = %6
%14 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @foo to i32 (i8*, i8*, ...)*)(i8* %3, i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int interpretrc(int trc) {
  int rc;
  rc = 0;
  if (trc == 1)
    rc = 2;
  else if (trc == 2)
    rc = 1;
  else
    printf("Unexpected return code %d from token_stream_add.\n", trc);
  return rc;
}


x86 assembly (clang, -O0):
<interpretrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1138 <interpretrc+0x28>
movl   $0x2,-0x8(%rbp)
jmp    1162 <interpretrc+0x52>
cmpl   $0x2,-0x4(%rbp)
jne    114e <interpretrc+0x3e>
movl   $0x1,-0x8(%rbp)
jmp    115d <interpretrc+0x4d>
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    1162 <interpretrc+0x52>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpretrc>:
cmp    $0x1,%edi
je     1122 <interpretrc+0x12>
mov    %edi,%esi
cmp    $0x2,%edi
jne    1128 <interpretrc+0x18>
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret
push   %rax
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Unexpected return code %d from token_stream_add.\0A\00"
define i32 @interpretrc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 2, i32* %3
br label %15
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %3
br label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %10
br label %15
15: ; preds = %14, %6
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [50 x i8] c"Unexpected return code %d from token_stream_add.\0A\00"
define i32 @interpretrc(i32 %0) {
switch i32 %0, label %3 [
i32 1, label %5
i32 2, label %2
]
2: ; preds = %1
br label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %1, %2, %3
%6 = phi i32 [ 1, %2 ], [ 0, %3 ], [ 2, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ get_random_bytes(unsigned int *, int);
unsigned int get_random_uint() {
  unsigned int i;
  get_random_bytes(&i, sizeof(unsigned int));
  return i;
}


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

x86 assembly (clang, -O2):
<get_random_uint>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <get_random_bytes@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_random_uint() {
%1 = alloca i32
%2 = call i32 @get_random_bytes(i32* %1, i32 4)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_random_uint() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @get_random_bytes(i32* %1, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void takeoff(register void *any, const char *info) {
  printf("Monkey takeoff %s\n", info);
}


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"Monkey takeoff %s\0A\00"
define void @takeoff(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int librlc_crs_repair_cleanup(char *out_data) {
  free(out_data);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @librlc_crs_repair_cleanup(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
void ARGB1555ToUVRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGB1555ToUVRow_Any_NEON() {
ret void
}
unsigned f6(int x, unsigned y) {
  int a = y;
  return x | a;
}


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

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

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

LLVM IR (-O2):
define i32 @f6(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Test(char *);
int BocomRecruit() {
  char *p;
  Test(p);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @BocomRecruit() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @Test(i8* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @BocomRecruit() {
%1 = tail call i32 @Test(i8* undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open(char const *, int, int);
int /*<<< orphan*/ perror(char *);
int safe_open(const char *path, int flags, int mode) {
  int ret = open(path, flags, mode);
  if (ret < 0) {
    perror("open");
    exit(EXIT_FAILURE);
  }
  return ret;
}


x86 assembly (clang, -O0):
<safe_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1178 <safe_open+0x48>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_open>:
push   %rax
call   1030 <open@plt>
test   %eax,%eax
js     113c <safe_open+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"open\00"
@EXIT_FAILURE = global i32 0
define i32 @safe_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @open(i8* %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %3
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@.str = [5 x i8] c"open\00"
@EXIT_FAILURE = global i32 0
define i32 @safe_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %3
ret i32 %4
}
int main_thread(void *refer) {}


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

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

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

LLVM IR (-O2):
define i32 @main_thread(i8* nocapture readnone %0) {
ret i32 undef
}
float fmaf(float x, float y, float z) { return x * y + z; }


x86 assembly (clang, -O0):
<fmaf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaf>:
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @fmaf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fmuladd.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @fmaf(float %0, float %1, float %2) {
%4 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int __test_and_set_bit(int, unsigned long volatile *);
int test_and_set_bit(int nr, volatile unsigned long *addr) {
  return __test_and_set_bit(nr, addr);
}


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

x86 assembly (clang, -O2):
<test_and_set_bit>:
jmp    1030 <__test_and_set_bit@plt>

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

LLVM IR (-O2):
define i32 @test_and_set_bit(i32 %0, i64* %1) {
%3 = tail call i32 @__test_and_set_bit(i32 %0, i64* %1)
ret i32 %3
}
void g_log(const char *log_domain, int log_level, const char *format, ...) {}


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

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

LLVM IR (-O0):
define void @g_log(i8* %0, i32 %1, i8* %2, ...) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @g_log(i8* nocapture %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
long func3(long a, long b) { return a * b; }


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

x86 assembly (clang, -O2):
<func3>:
mov    %rdi,%rax
imul   %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @func3(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, char const *, int);
void zby_assert(const char *file, const char *func, int line, int val) {
  if (!val) {
    printf("assert failed at file: %s  func: %s  line: %d\n", file, func, line);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<zby_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1161 <zby_assert+0x41>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zby_assert>:
test   %ecx,%ecx
je     1125 <zby_assert+0x5>
ret
push   %rax
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xecb(%rip),%rdi
mov    %eax,%ecx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"assert failed at file: %s func: %s line: %d\0A\00"
define void @zby_assert(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i32 %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"assert failed at file: %s func: %s line: %d\0A\00"
define void @zby_assert(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glClearColor(float, float, float, float);
void yfunc(void) {
  static int state;
  if (state ^= 1)
    glClearColor(.0, .0f, .65, 0.f);
  else
    glClearColor(0.f, 0.f, 0.f, 0.f);
}


x86 assembly (clang, -O0):
<yfunc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x2f09(%rip)
cmp    $0x0,%eax
je     1147 <yfunc+0x37>
xorps  %xmm3,%xmm3
movss  0xec9(%rip),%xmm2
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
call   1030 <glClearColor@plt>
jmp    1158 <yfunc+0x48>
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yfunc>:
xorl   $0x1,0x2f15(%rip)
xorps  %xmm2,%xmm2
je     1124 <yfunc+0x14>
movss  0xedc(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm3,%xmm3
jmp    1030 <glClearColor@plt>

LLVM IR (-O0):
@yfunc.state = internal global i32 0
define void @yfunc() {
%1 = load i32, i32* @yfunc.state
%2 = xor i32 %1, 1
store i32 %2, i32* @yfunc.state
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0x3FE4CCCCC0000000, float 0.000000e+00)
br label %8
6: ; preds = %0
%7 = call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
br label %8
8: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@yfunc.state = internal unnamed_addr global i32 0
define void @yfunc() {
%1 = load i32, i32* @yfunc.state
%2 = xor i32 %1, 1
store i32 %2, i32* @yfunc.state
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, float 0.000000e+00, float 0x3FE4CCCCC0000000
%5 = tail call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float %4, float 0.000000e+00)
ret void
}
unsigned short int net2short(unsigned char **bufp) {
  short int i;
  i = **bufp;
  i <<= 8;
  i |= *(*bufp + 1);
  *bufp += 2;
  return i;
}


x86 assembly (clang, -O0):
<net2short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
shl    $0x8,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl 0x1(%rax),%ecx
movswl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<net2short>:
mov    (%rdi),%rcx
movzwl (%rcx),%eax
rol    $0x8,%ax
add    $0x2,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define zeroext i16 @net2short(i8** %0) {
%2 = alloca i8**
%3 = alloca i16
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
store i16 %7, i16* %3
%8 = load i16, i16* %3
%9 = sext i16 %8 to i32
%10 = shl i32 %9, 8
%11 = trunc i32 %10 to i16
store i16 %11, i16* %3
%12 = load i8**, i8*** %2
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i16, i16* %3
%18 = sext i16 %17 to i32
%19 = or i32 %18, %16
%20 = trunc i32 %19 to i16
store i16 %20, i16* %3
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8* %23, i8** %21
%24 = load i16, i16* %3
ret i16 %24
}

LLVM IR (-O2):
define zeroext i16 @net2short(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = or i16 %5, %8
%10 = getelementptr inbounds i8, i8* %2, i64 2
store i8* %10, i8** %0
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ CalcKaiserBeta(double);
double Kaiser(int /*<<< orphan*/, double);
double Sinc(double);
double SincKaiser(double r, double x) {
  return Kaiser(CalcKaiserBeta(60.0), x / r) * Sinc(x);
}


x86 assembly (clang, -O0):
<SincKaiser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeb6(%rip),%xmm0
call   1030 <CalcKaiserBeta@plt>
mov    %eax,%edi
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1050 <Kaiser@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <Sinc@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SincKaiser>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0xeb8(%rip),%xmm0
call   1030 <CalcKaiserBeta@plt>
movsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %eax,%edi
call   1050 <Kaiser@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <Sinc@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @SincKaiser(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 @CalcKaiserBeta(double 6.000000e+01)
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fdiv double %6, %7
%9 = call double @Kaiser(i32 %5, double %8)
%10 = load double, double* %4
%11 = call double @Sinc(double %10)
%12 = fmul double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @SincKaiser(double %0, double %1) {
%3 = tail call i32 @CalcKaiserBeta(double 6.000000e+01)
%4 = fdiv double %1, %0
%5 = tail call double @Kaiser(i32 %3, double %4)
%6 = tail call double @Sinc(double %1)
%7 = fmul double %5, %6
ret double %7
}