xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ glutTimerFunc(int, void (*)(int), int);
void onTimer(int value) {
  glutPostRedisplay();
  glutTimerFunc(5, &onTimer, value);
}


x86 assembly (clang, -O0):
<onTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
mov    -0x4(%rbp),%edx
mov    $0x5,%edi
mov    0x2e9f(%rip),%rsi
call   1030 <glutTimerFunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onTimer>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <glutPostRedisplay@plt>
mov    0x2eaf(%rip),%rsi
mov    $0x5,%edi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <glutTimerFunc@plt>

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

LLVM IR (-O2):
define void @onTimer(i32 %0) {
%2 = tail call i32 (...) @glutPostRedisplay()
%3 = tail call i32 @glutTimerFunc(i32 5, void (i32)* @onTimer, i32 %0)
ret void
}
void NotifyBox(int timeout, char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @NotifyBox(i32 %0, i8* nocapture %1, ...) {
ret void
}
void mt_dcm_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @mt_dcm_disable() {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1;
  --a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, -1
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
struct lobject {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lemon_collector_mark(struct lemon *, struct lobject *);
scalar_t__ lobject_is_pointer(struct lemon *, struct lobject *);
struct lobject *lobject_mark(struct lemon *lemon, struct lobject *self) {
  if (lobject_is_pointer(lemon, self)) {
    lemon_collector_mark(lemon, self);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<lobject_mark>:
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 <lobject_is_pointer@plt>
cmp    $0x0,%rax
je     1154 <lobject_mark+0x34>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <lemon_collector_mark@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lobject_mark>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <lobject_is_pointer@plt>
test   %rax,%rax
je     113f <lobject_mark+0x1f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <lemon_collector_mark@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lobject_mark(%struct.lemon* %0, %struct.lobject* %1) {
%3 = alloca %struct.lemon*
%4 = alloca %struct.lobject*
store %struct.lemon* %0, %struct.lemon** %3
store %struct.lobject* %1, %struct.lobject** %4
%5 = load %struct.lemon*, %struct.lemon** %3
%6 = load %struct.lobject*, %struct.lobject** %4
%7 = call i64 @lobject_is_pointer(%struct.lemon* %5, %struct.lobject* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load %struct.lemon*, %struct.lemon** %3
%11 = load %struct.lobject*, %struct.lobject** %4
%12 = call i32 @lemon_collector_mark(%struct.lemon* %10, %struct.lobject* %11)
br label %13
13: ; preds = %9, %2
ret %struct.lobject* null
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define noalias %struct.lobject* @lobject_mark(%struct.lemon* %0, %struct.lobject* %1) {
%3 = tail call i64 @lobject_is_pointer(%struct.lemon* %0, %struct.lobject* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @lemon_collector_mark(%struct.lemon* %0, %struct.lobject* %1)
br label %7
7: ; preds = %5, %2
ret %struct.lobject* null
}
struct block *gen_inbound(dir)
int dir;
{
  register struct block *b0;
  b0 = gen_relation(0x10, gen_load(1, gen_loadi(0), 1), gen_loadi(0), dir);
  return (b0);
}


x86 assembly (clang, -O0):
<gen_inbound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1050 <gen_loadi@plt>
mov    %eax,%esi
mov    $0x1,%edx
mov    %edx,%edi
mov    $0x0,%al
call   1030 <gen_load@plt>
mov    %eax,-0x14(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1050 <gen_loadi@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
mov    -0x4(%rbp),%ecx
mov    $0x10,%edi
mov    $0x0,%al
call   1040 <gen_relation@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_inbound>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
xor    %eax,%eax
call   1050 <gen_loadi@plt>
mov    $0x1,%edi
mov    %eax,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <gen_load@plt>
mov    %eax,%ebp
xor    %edi,%edi
xor    %eax,%eax
call   1050 <gen_loadi@plt>
mov    $0x10,%edi
mov    %ebp,%esi
mov    %eax,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <gen_relation@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.block = type opaque
define %struct.block* @gen_inbound(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.block*
store i32 %0, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @gen_loadi to i32 (i32, ...)*)(i32 0)
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @gen_load to i32 (i32, i32, i32, ...)*)(i32 1, i32 %4, i32 1)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @gen_loadi to i32 (i32, ...)*)(i32 0)
%7 = load i32, i32* %2
%8 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @gen_relation to i32 (i32, i32, i32, i32, ...)*)(i32 16, i32 %5, i32 %6, i32 %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to %struct.block*
store %struct.block* %10, %struct.block** %3
%11 = load %struct.block*, %struct.block** %3
ret %struct.block* %11
}

LLVM IR (-O2):
%struct.block = type opaque
define %struct.block* @gen_inbound(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @gen_loadi to i32 (i32, ...)*)(i32 0)
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @gen_load to i32 (i32, i32, i32, ...)*)(i32 1, i32 %2, i32 1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @gen_loadi to i32 (i32, ...)*)(i32 0)
%5 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @gen_relation to i32 (i32, i32, i32, i32, ...)*)(i32 16, i32 %3, i32 %4, i32 %0)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.block*
ret %struct.block* %7
}
/* Variables and functions */
char *gnu_get_libc_version();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("%s\n", gnu_get_libc_version());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @gnu_get_libc_version()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
long long atoll(char *);
char *getenv(char const *);
int getenv_ull(const char *v, unsigned long long *y) {
  char *x = getenv(v);
  if (!x)
    return 0;
  long long z = atoll(x);
  *y = (unsigned long long)z;
  return 1;
}


x86 assembly (clang, -O0):
<getenv_ull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1154 <getenv_ull+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1173 <getenv_ull+0x53>
mov    -0x20(%rbp),%rdi
call   1040 <atoll@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_ull>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1140 <getenv_ull+0x20>
mov    %rax,%rdi
call   1040 <atoll@plt>
mov    %rax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getenv_ull(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i64 @atoll(i8* %3)
store i64 %6, i64* %1
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int *);
int /*<<< orphan*/ strftime(char *, size_t, char *, int /*<<< orphan*/);
char *get_log_rename(int ts, char *date_str, size_t date_size) {
  time_t t = ts;
  strftime(date_str, date_size, "%Y-%m-%d-%H-%M-%S", localtime(&t));
  return date_str;
}


x86 assembly (clang, -O0):
<get_log_rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%ecx
lea    0xe9d(%rip),%rdx
call   1040 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_log_rename>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xec1(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%ecx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%Y-%m-%d-%H-%M-%S\00"
define i8* @get_log_rename(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
store i32 %8, i32* %7
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @localtime(i32* %7)
%12 = call i32 @strftime(i8* %9, i64 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
@.str = [18 x i8] c"%Y-%m-%d-%H-%M-%S\00"
define i8* @get_log_rename(i32 %0, i8* returned %1, i64 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 %0, i32* %4
%6 = call i32 @localtime(i32* %4)
%7 = call i32 @strftime(i8* %1, i64 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void impl() { abort(); }


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

x86 assembly (clang, -O2):
<impl>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @impl() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @impl() {
%1 = tail call i32 (...) @abort()
unreachable
}
char *strsubst(char *str, char from, char to) {
  register char *p;
  for (p = str; *p != 0; ++p)
    if (*p == from)
      *p = to;
  return str;
}


x86 assembly (clang, -O0):
<strsubst>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <strsubst+0x5d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1147 <strsubst+0x47>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    114c <strsubst+0x4c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <strsubst+0x1b>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsubst>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <strsubst+0x25>
lea    0x1(%rax),%rdi
jmp    111b <strsubst+0x1b>
nop
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     1125 <strsubst+0x25>
cmp    %sil,%cl
jne    1110 <strsubst+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <strsubst+0x10>
ret

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

LLVM IR (-O2):
define i8* @strsubst(i8* returned %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ str_id(char *);
int /*<<< orphan*/ str_reverse(char *);
int main(int argc, char *argv[]) {
  str_reverse("foo");
  str_id("foo");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <str_reverse@plt>
mov    %rbx,%rdi
call   1040 <str_id@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @str_reverse(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @str_id(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @str_reverse(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @str_id(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char *p = malloc(16);
  p[16] = 0;
  printf(p);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10,%edi
call   1040 <malloc@plt>
movb   $0x0,0x10(%rax)
mov    %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(16) i8* @malloc(i32 16)
%4 = getelementptr inbounds i8, i8* %3, i64 16
store i8 0, i8* %4
%5 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
int findTrip();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", findTrip()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <findTrip@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 (...) @findTrip()
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hostcall_test_func_hostcall_error_unwind()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ __mempcpy(char *, char *, size_t);
wchar_t *__wmempcpy(wchar_t *s1, const wchar_t *s2, size_t n) {
  return (wchar_t *)__mempcpy((char *)s1, (char *)s2, n * sizeof(wchar_t));
}


x86 assembly (clang, -O0):
<__wmempcpy>:
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
shl    $0x2,%rdx
call   1030 <__mempcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wmempcpy>:
shl    $0x2,%rdx
jmp    1030 <__mempcpy@plt>

LLVM IR (-O0):
define i32* @__wmempcpy(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to i8*
%9 = load i32*, i32** %5
%10 = bitcast i32* %9 to i8*
%11 = load i64, i64* %6
%12 = mul i64 %11, 4
%13 = call i64 @__mempcpy(i8* %8, i8* %10, i64 %12)
%14 = inttoptr i64 %13 to i32*
ret i32* %14
}

LLVM IR (-O2):
define i32* @__wmempcpy(i32* %0, i32* %1, i64 %2) {
%4 = bitcast i32* %0 to i8*
%5 = bitcast i32* %1 to i8*
%6 = shl i64 %2, 2
%7 = tail call i64 @__mempcpy(i8* %4, i8* %5, i64 %6)
%8 = inttoptr i64 %7 to i32*
ret i32* %8
}
signed long int signedlongint_ignoring_signedlong(signed long int x,
                                                  signed long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlongint_ignoring_signedlong(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlongint_ignoring_signedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Type definitions */
struct TLVs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_value(struct TLVs *, double *);
double get_next_float64(struct TLVs *params) {
  double val = 0;
  get_value(params, &val);
  return val;
}


x86 assembly (clang, -O0):
<get_next_float64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <get_value@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_float64>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <get_value@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.TLVs = type { i32 }
define double @get_next_float64(%struct.TLVs* %0) {
%2 = alloca %struct.TLVs*
%3 = alloca double
store %struct.TLVs* %0, %struct.TLVs** %2
store double 0.000000e+00, double* %3
%4 = load %struct.TLVs*, %struct.TLVs** %2
%5 = call i32 @get_value(%struct.TLVs* %4, double* %3)
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
%struct.TLVs = type { i32 }
define double @get_next_float64(%struct.TLVs* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store double 0.000000e+00, double* %2
%4 = call i32 @get_value(%struct.TLVs* %0, double* %2)
%5 = load double, double* %2
ret double %5
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int random();
void wait_random() {
  struct timespec wait_time;
  wait_time.tv_sec = random() % 5;
  wait_time.tv_nsec = 500 * 1000000;
  nanosleep(&wait_time, NULL);
}


x86 assembly (clang, -O0):
<wait_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <random@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
movl   $0x1dcd6500,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_random>:
push   %rax
xor    %eax,%eax
call   1040 <random@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,(%rsp)
movl   $0x1dcd6500,0x4(%rsp)
1d
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @wait_random() {
%1 = alloca %struct.timespec
%2 = call i32 (...) @random()
%3 = srem i32 %2, 5
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
store i32 %3, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
store i32 500000000, i32* %5
%6 = call i32 @nanosleep(%struct.timespec* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @wait_random() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = tail call i32 (...) @random()
%4 = srem i32 %3, 5
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i32 500000000, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int i;
  int max = 10;
  int still_looping = 0x00;
  for (i = 0; i < max && still_looping; ++i) {
    printf("Still looping...\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0x18(%rbp),%ecx
mov    %al,-0x1d(%rbp)
jge    1156 <main+0x46>
cmpl   $0x0,-0x1c(%rbp)
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1166 <main+0x56>
jmp    1180 <main+0x70>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __syscall(int, struct timeval *, int /*<<< orphan*/);
int gettimeofday(struct timeval *tv, void *tz) {
  __syscall(78, tv, 0);
  return 0;
}


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

x86 assembly (clang, -O2):
<gettimeofday>:
push   %rax
mov    %rdi,%rsi
mov    $0x4e,%edi
xor    %edx,%edx
call   1030 <__syscall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = call i32 @__syscall(i32 78, %struct.timeval* %5, i32 0)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @gettimeofday(%struct.timeval* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @__syscall(i32 78, %struct.timeval* %0, i32 0)
ret i32 0
}
int test_imm_F0uint16_reg(unsigned short val) {
  return ((val) & (0xF0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F0uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xf0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F0uint16_reg>:
test   $0xf0,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F0uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 240
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_F0uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 240
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void PrintHelp(char *buffer) {
  strcat(buffer, "\nLZMA Utility "
                 "4.65"
                 " "
                 ": Igor Pavlov : Public domain"
                 " : "
                 "2009-02-03"
                 "\n"
                 "\nUsage:  lzma <e|d> inputFile outputFile\n"
                 "  e: encode file\n"
                 "  d: decode file\n");
}


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

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

LLVM IR (-O0):
@.str = [138 x i8] c"\0ALZMA Utility 4.65 : Igor Pavlov : Public domain : 2009-02-03\0A\0AUsage: lzma <e|d> inputFile outputFile\0A e: encode file\0A d: decode file\0A\00"
define void @PrintHelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [138 x i8] c"\0ALZMA Utility 4.65 : Igor Pavlov : Public domain : 2009-02-03\0A\0AUsage: lzma <e|d> inputFile outputFile\0A e: encode file\0A d: decode file\0A\00"
define void @PrintHelp(i8* %0) {
%2 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;

/* Variables and functions */
int /*<<< orphan*/ get_next_input_from_fuzzer();
ushort map2check_non_det_ushort() {
  return (ushort)get_next_input_from_fuzzer();
}


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

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

LLVM IR (-O0):
define i32 @map2check_non_det_ushort() {
%1 = call i32 (...) @get_next_input_from_fuzzer()
ret i32 %1
}

LLVM IR (-O2):
define i32 @map2check_non_det_ushort() {
%1 = tail call i32 (...) @get_next_input_from_fuzzer()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u32;
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
volatile __u16 gtx_in16(volatile __u8 *mmioaddr, __u32 reg) {
  return *((volatile __u16 *)(mmioaddr + reg));
}


x86 assembly (clang, -O0):
<gtx_in16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtx_in16>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @gtx_in16(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load volatile i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @gtx_in16(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load volatile i32, i32* %4
ret i32 %5
}
int isCommentCL(char *str) {
  while (*str != '\0' && (*str == ' ' || *str == '\t')) {
    str++;
  }
  if (*str == '#') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isCommentCL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1148 <isCommentCL+0x48>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x12(%rbp)
je     1142 <isCommentCL+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1158 <isCommentCL+0x58>
jmp    1169 <isCommentCL+0x69>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <isCommentCL+0x8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1185 <isCommentCL+0x85>
movl   $0x1,-0x4(%rbp)
jmp    118c <isCommentCL+0x8c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCommentCL>:
jmp    1114 <isCommentCL+0x14>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x20,%cl
je     1110 <isCommentCL+0x10>
cmp    $0x9,%cl
je     1110 <isCommentCL+0x10>
xor    %eax,%eax
cmp    $0x23,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isCommentCL(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 9, label %5
i8 32, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
%8 = icmp eq i8 %4, 35
%9 = zext i1 %8 to i32
ret i32 %9
}
void VDP_setPaletteColor(unsigned short index, unsigned short value) {
  volatile unsigned short *pw;
  volatile unsigned long *pl;
  unsigned short addr;
  pw = (unsigned short *)0xC00000;
  pl = (unsigned long *)0xC00004;
  addr = index * 2;
  *pl = ((0xC000 + ((addr)&0x3FFF)) << 16) + (((addr) >> 14) | 0x00);
  *pw = value;
}


x86 assembly (clang, -O0):
<VDP_setPaletteColor>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0xc00000,%eax
mov    %rax,-0x10(%rbp)
mov    $0xc00004,%eax
mov    %rax,-0x18(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %ax,-0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
and    $0x3fff,%eax
add    $0xc000,%eax
shl    $0x10,%eax
movzwl -0x1a(%rbp),%ecx
sar    $0xe,%ecx
or     $0x0,%ecx
add    %ecx,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VDP_setPaletteColor>:
mov    %edi,%eax
shl    $0x11,%eax
shr    $0xd,%edi
and    $0x3,%edi
or     %eax,%edi
or     $0xc0000000,%edi
movslq %edi,%rax
mov    %rax,0xc00004
mov    %si,0xc00000
ret

LLVM IR (-O0):
define void @VDP_setPaletteColor(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16*
%6 = alloca i64*
%7 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
store i16* inttoptr (i64 12582912 to i16*), i16** %5
store i64* inttoptr (i64 12582916 to i64*), i64** %6
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = mul nsw i32 %9, 2
%11 = trunc i32 %10 to i16
store i16 %11, i16* %7
%12 = load i16, i16* %7
%13 = zext i16 %12 to i32
%14 = and i32 %13, 16383
%15 = add nsw i32 49152, %14
%16 = shl i32 %15, 16
%17 = load i16, i16* %7
%18 = zext i16 %17 to i32
%19 = ashr i32 %18, 14
%20 = or i32 %19, 0
%21 = add nsw i32 %16, %20
%22 = sext i32 %21 to i64
%23 = load i64*, i64** %6
store volatile i64 %22, i64* %23
%24 = load i16, i16* %4
%25 = load i16*, i16** %5
store volatile i16 %24, i16* %25
ret void
}

LLVM IR (-O2):
define void @VDP_setPaletteColor(i16 zeroext %0, i16 zeroext %1) {
%3 = shl i16 %0, 1
%4 = zext i16 %3 to i32
%5 = shl nuw i32 %4, 16
%6 = lshr i32 %4, 14
%7 = or i32 %5, %6
%8 = or i32 %7, -1073741824
%9 = sext i32 %8 to i64
store volatile i64 %9, i64* inttoptr (i64 12582916 to i64*)
store volatile i16 %1, i16* inttoptr (i64 12582912 to i16*)
ret void
}
int test_imm_4Eint32_reg(int val) { return ((val) & (0x4E << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_4Eint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x4e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Eint32_reg>:
test   $0x4e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Eint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 78
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_4Eint32_reg(i32 %0) {
%2 = and i32 %0, 78
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ val_r(double);
double dr_dtau(double tau) { return -1. / sqrt(val_r(tau)); }


x86 assembly (clang, -O0):
<dr_dtau>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <val_r@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xeb6(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dr_dtau>:
push   %rax
call   1030 <val_r@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec7(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dr_dtau(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @val_r(double %3)
%5 = call i32 @sqrt(i32 %4)
%6 = sitofp i32 %5 to double
%7 = fdiv double -1.000000e+00, %6
ret double %7
}

LLVM IR (-O2):
define double @dr_dtau(double %0) {
%2 = tail call i32 @val_r(double %0)
%3 = tail call i32 @sqrt(i32 %2)
%4 = sitofp i32 %3 to double
%5 = fdiv double -1.000000e+00, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: mk500boot <options> <input file> [output file]\n"
         "options:\n"
         "\t-decrypt   Decrypt the input file and save the output file\n"
         "\t-encrypt   Encrypt the input file and save the output file\n"
         "\t-patch     Patch the input file with the SVF hack\n\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [236 x i8] c"Usage: mk500boot <options> <input file> [output file]\0Aoptions:\0A\09-decrypt Decrypt the input file and save the output file\0A\09-encrypt Encrypt the input file and save the output file\0A\09-patch Patch the input file with the SVF hack\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([236 x i8], [236 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [235 x i8] c"Usage: mk500boot <options> <input file> [output file]\0Aoptions:\0A\09-decrypt Decrypt the input file and save the output file\0A\09-encrypt Encrypt the input file and save the output file\0A\09-patch Patch the input file with the SVF hack\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([235 x i8], [235 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_single_ll();
int main(int argc, char *argv[]) { test_single_ll(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @test_single_ll()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_single_ll()
ret i32 0
}
/* Variables and functions */
scalar_t__ ERR_get_error_line(char const **, int *);
scalar_t__ ERR_peek_error();
void drain_openssl_errors(void) {
  const char *file;
  int line;
  if (ERR_peek_error() == 0) {
    return;
  }
  while (ERR_get_error_line(&file, &line)) {
  }
}


x86 assembly (clang, -O0):
<drain_openssl_errors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ERR_peek_error@plt>
cmp    $0x0,%rax
jne    113e <drain_openssl_errors+0x1e>
jmp    115f <drain_openssl_errors+0x3f>
jmp    1143 <drain_openssl_errors+0x23>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <ERR_get_error_line@plt>
cmp    $0x0,%rax
je     115f <drain_openssl_errors+0x3f>
jmp    1143 <drain_openssl_errors+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drain_openssl_errors>:
push   %r14
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <ERR_peek_error@plt>
test   %rax,%rax
je     1150 <drain_openssl_errors+0x30>
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%rbx
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <ERR_get_error_line@plt>
test   %rax,%rax
jne    1140 <drain_openssl_errors+0x20>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @drain_openssl_errors() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i64 (...) @ERR_peek_error()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
br label %11
6: ; preds = %0
br label %7
7: ; preds = %10, %6
%8 = call i64 @ERR_get_error_line(i8** %1, i32* %2)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %7
11: ; preds = %5, %7
ret void
}

LLVM IR (-O2):
define void @drain_openssl_errors() {
%1 = alloca i8*
%2 = alloca i32
%3 = bitcast i8** %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i64 (...) @ERR_peek_error()
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %0, %7
%8 = call i64 @ERR_get_error_line(i8** %1, i32* %2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %7
10: ; preds = %7, %0
ret void
}
__attribute__((always_)) void f2(char x) {}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f2(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetMotor(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ SetMotors(int);
int /*<<< orphan*/ SetTime(int);
int /*<<< orphan*/ random(int /*<<< orphan*/, int);
int pulse2(int seq) {
  if (seq % 2)
    SetMotors(100);
  else
    SetMotor(random(0, 3), 0);
  SetTime(100);
  return 1;
}


x86 assembly (clang, -O0):
<pulse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116e <pulse2+0x2e>
mov    $0x64,%edi
call   1030 <SetMotors@plt>
jmp    1183 <pulse2+0x43>
xor    %edi,%edi
mov    $0x3,%esi
call   1050 <random@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <SetMotor@plt>
mov    $0x64,%edi
call   1060 <SetTime@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pulse2>:
push   %rax
test   $0x1,%dil
jne    115e <pulse2+0x1e>
xor    %edi,%edi
mov    $0x3,%esi
call   1050 <random@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <SetMotor@plt>
jmp    1168 <pulse2+0x28>
mov    $0x64,%edi
call   1030 <SetMotors@plt>
mov    $0x64,%edi
call   1060 <SetTime@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pulse2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @SetMotors(i32 100)
br label %11
8: ; preds = %1
%9 = call i32 @random(i32 0, i32 3)
%10 = call i32 @SetMotor(i32 %9, i32 0)
br label %11
11: ; preds = %8, %6
%12 = call i32 @SetTime(i32 100)
ret i32 1
}

LLVM IR (-O2):
define i32 @pulse2(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @SetMotors(i32 100)
br label %9
6: ; preds = %1
%7 = tail call i32 @random(i32 0, i32 3)
%8 = tail call i32 @SetMotor(i32 %7, i32 0)
br label %9
9: ; preds = %6, %4
%10 = tail call i32 @SetTime(i32 100)
ret i32 1
}
int test_imm_66uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x66 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_66uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x66,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_66uint64_midword_mem>:
testb  $0x66,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_66uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 102
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_66uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6684672
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}