xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *gettext(char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, gettext("usage: logger [-is] [-f file] [-p pri] [-t "
                                "tag] [-u socket] [ message ... ]\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <gettext@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
lea    0xebf(%rip),%rdi
call   1030 <gettext@plt>
mov    %ebx,%edi
mov    %rax,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [77 x i8] c"usage: logger [-is] [-f file] [-p pri] [-t tag] [-u socket] [ message ... ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* @gettext(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @fprintf(i32 %1, i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [77 x i8] c"usage: logger [-is] [-f file] [-p pri] [-t tag] [-u socket] [ message ... ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* @gettext(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32 %1, i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(FILE *stream __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getc(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void set_tree_index(uint32_t addr[8], uint32_t tree_index) {
  addr[6] = tree_index;
}


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

x86 assembly (clang, -O2):
<set_tree_index>:
mov    %esi,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @set_tree_index(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_no_check(int, char const *, int);
void fini(void) {
  static const char m[] = "@ HACK FINI\n";
  write_no_check(2, m, sizeof m - 1);
}


x86 assembly (clang, -O0):
<fini>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
mov    $0xc,%edx
call   1030 <write_no_check@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
mov    $0xc,%edx
jmp    1030 <write_no_check@plt>

LLVM IR (-O0):
@fini.m = internal constant [13 x i8] c"@ HACK FINI\0A\00"
define void @fini() {
%1 = call i32 @write_no_check(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @fini.m, i64 0, i64 0), i32 12)
ret void
}

LLVM IR (-O2):
@fini.m = internal constant [13 x i8] c"@ HACK FINI\0A\00"
define void @fini() {
%1 = tail call i32 @write_no_check(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @fini.m, i64 0, i64 0), i32 12)
ret void
}
void gtk_tool_item_set_expand() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_set_expand() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t minipack_unpack_uint16(void *ptr, size_t *sz) {
  *sz = 3;
  uint16_t value = *((uint16_t *)(ptr + 1));
  return ntohs(value);
}


x86 assembly (clang, -O0):
<minipack_unpack_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x3,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <ntohs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_uint16>:
movq   $0x3,(%rsi)
mov    0x1(%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
define i32 @minipack_unpack_uint16(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i32
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
store i64 3, i64* %6
%7 = load i8*, i8** %3
%8 = getelementptr i8, i8* %7, i64 1
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i32 @ntohs(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @minipack_unpack_uint16(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 3, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @ntohs(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ noobPrime(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  noobPrime(num);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @noobPrime(i32 %4)
ret i32 0
}
void *testClosureVrP(void *(*closure)(void)) { return (*closure)(); }


x86 assembly (clang, -O0):
<testClosureVrP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrP>:
jmp    *%rdi

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

LLVM IR (-O2):
define i8* @testClosureVrP(i8* ()* nocapture %0) {
%2 = tail call i8* %0()
ret i8* %2
}
void av_strstart() {}


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

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

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

LLVM IR (-O2):
define void @av_strstart() {
ret void
}
int f(int i) { return i & 0x0ffff000; }


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
and    $0xffff000,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = and i32 %0, 268431360
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
void *malloc(int);
int main() {
  int *x = malloc(sizeof(int));
  int **p = malloc(sizeof(int *));
  *x = 5;
  *p = x;
  __VERIFIER_assert(*x == 5);
  __VERIFIER_assert(**p == 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x5,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmpl   $0x5,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <__VERIFIER_assert@plt>
mov    $0x1,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
store i32 0, i32* %1
%4 = call i8* @malloc(i32 4)
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %2
%6 = call i8* @malloc(i32 8)
%7 = bitcast i8* %6 to i32**
store i32** %7, i32*** %3
%8 = load i32*, i32** %2
store i32 5, i32* %8
%9 = load i32*, i32** %2
%10 = load i32**, i32*** %3
store i32* %9, i32** %10
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 5
%14 = zext i1 %13 to i32
%15 = call i32 @__VERIFIER_assert(i32 %14)
%16 = load i32**, i32*** %3
%17 = load i32*, i32** %16
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 5
%20 = zext i1 %19 to i32
%21 = call i32 @__VERIFIER_assert(i32 %20)
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ ESPIPE;
int /*<<< orphan*/ errno;
off_t _lseek(int fd, off_t offset, int whence) {
  errno = ESPIPE;
  return ((off_t)-1);
}


x86 assembly (clang, -O0):
<_lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebb(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lseek>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ESPIPE = global i32 0
@errno = global i32 0
define i32 @_lseek(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
%7 = load i32, i32* @ESPIPE
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ESPIPE = global i32 0
@errno = global i32 0
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ESPIPE
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *strdup(char *);
void http_table_column_add_string(char **buff, char *val) {
  char tmp[100];
  sprintf(tmp, "%s", val);
  *buff = strdup(tmp);
}


x86 assembly (clang, -O0):
<http_table_column_add_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xebe(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x80(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_table_column_add_string>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @http_table_column_add_string(i8** nocapture writeonly %0, i8* nocapture %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i8* @strcpy(i8* %4, i8* dereferenceable(1) %1)
%6 = call i8* @strdup(i8* %4)
store i8* %6, i8** %0
ret void
}
int nbits(i)
unsigned i;
{
  int count = 0;
  while (i != 0) {
    i ^= (i & -i);
    ++count;
  }
  return count;
}


x86 assembly (clang, -O0):
<nbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <nbits+0x36>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
and    %ecx,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <nbits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nbits>:
xor    %eax,%eax
test   %edi,%edi
je     111c <nbits+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <nbits+0x10>
ret

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

LLVM IR (-O2):
define i32 @nbits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int f394(int *);
int f395(int *p) { return f394(p); }


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

x86 assembly (clang, -O2):
<f395>:
jmp    1030 <f394@plt>

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

LLVM IR (-O2):
define i32 @f395(i32* %0) {
%2 = tail call i32 @f394(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print(void) { printf("Hello\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\0A\00"
define void @print() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define void @print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(size_t);
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *getInfo() {
  char *name;
  size_t size;
  size = strlen("Stripes (C) 2004 Panayotis Katsaloulis "
                "http://www.panayotis.com under GNU GPL");
  name = malloc(size + 1);
  strncpy(name,
          ("Stripes (C) 2004 Panayotis Katsaloulis http://www.panayotis.com "
           "under GNU GPL"),
          size + 1);
  return name;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
lea    0xe94(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbx
mov    $0x4e,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    $0x4e,%edx
mov    %rax,%rdi
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [78 x i8] c"Stripes (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under GNU GPL\00"
define i8* @getInfo() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 @strlen(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 1
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = load i64, i64* %2
%9 = add i64 %8, 1
%10 = call i32 @strncpy(i8* %7, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [78 x i8] c"Stripes (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under GNU GPL\00"
define i8* @getInfo() {
%1 = tail call dereferenceable_or_null(78) i8* @malloc(i64 78)
%2 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i64 78)
ret i8* %1
}
/* Variables and functions */
int div(int, int);
int /*<<< orphan*/ interrupt(int, int, char *, int, int);
int mod(int, int);
void writeSector(char *buffer, int sector) {
  interrupt(0x13, 0x0301, buffer,
            ((div(sector, 36) << 8) | mod(sector, 18)) + 1,
            (div(sector, 18) & 1) << 8);
}


x86 assembly (clang, -O0):
<writeSector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x24,%esi
call   1050 <div@plt>
shl    $0x8,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x12,%esi
call   1030 <mod@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
or     %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x12,%esi
call   1050 <div@plt>
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%ecx
mov    %eax,%r8d
and    $0x1,%r8d
shl    $0x8,%r8d
mov    $0x13,%edi
mov    $0x301,%esi
call   1040 <interrupt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeSector>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
mov    $0x24,%esi
call   1050 <div@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
mov    %ebp,%edi
mov    $0x12,%esi
call   1030 <mod@plt>
or     %eax,%ebx
add    $0x1,%ebx
mov    %ebp,%edi
mov    $0x12,%esi
call   1050 <div@plt>
and    $0x1,%eax
shl    $0x8,%eax
mov    $0x13,%edi
mov    $0x301,%esi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <interrupt@plt>

LLVM IR (-O0):
define void @writeSector(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @div(i32 %6, i32 36)
%8 = shl i32 %7, 8
%9 = load i32, i32* %4
%10 = call i32 @mod(i32 %9, i32 18)
%11 = or i32 %8, %10
%12 = add nsw i32 %11, 1
%13 = load i32, i32* %4
%14 = call i32 @div(i32 %13, i32 18)
%15 = and i32 %14, 1
%16 = shl i32 %15, 8
%17 = call i32 @interrupt(i32 19, i32 769, i8* %5, i32 %12, i32 %16)
ret void
}

LLVM IR (-O2):
define void @writeSector(i8* %0, i32 %1) {
%3 = tail call i32 @div(i32 %1, i32 36)
%4 = shl i32 %3, 8
%5 = tail call i32 @mod(i32 %1, i32 18)
%6 = or i32 %4, %5
%7 = add nsw i32 %6, 1
%8 = tail call i32 @div(i32 %1, i32 18)
%9 = shl i32 %8, 8
%10 = and i32 %9, 256
%11 = tail call i32 @interrupt(i32 19, i32 769, i8* %0, i32 %7, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
void printstr(char *string) {
  int ret;
  ret = write(1, string, strlen(string));
}


x86 assembly (clang, -O0):
<printstr>:
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   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printstr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @printstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t csr_readw(uint32_t addr) { return *(volatile uint16_t *)addr; }


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

x86 assembly (clang, -O2):
<csr_readw>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @csr_readw(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @csr_readw(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int ntohs(unsigned short);
int is_caldata(unsigned char *ethp) {
  if (ntohs(*(unsigned short *)(ethp + 12)) == 0x0811)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_caldata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzwl 0xc(%rax),%edi
call   1030 <ntohs@plt>
cmp    $0x811,%eax
jne    1140 <is_caldata+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1147 <is_caldata+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_caldata>:
push   %rax
movzwl 0xc(%rdi),%edi
call   1030 <ntohs@plt>
xor    %ecx,%ecx
cmp    $0x811,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_caldata(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 12
%6 = bitcast i8* %5 to i16*
%7 = load i16, i16* %6
%8 = call i32 @ntohs(i16 zeroext %7)
%9 = icmp eq i32 %8, 2065
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_caldata(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = bitcast i8* %2 to i16*
%4 = load i16, i16* %3
%5 = tail call i32 @ntohs(i16 zeroext %4)
%6 = icmp eq i32 %5, 2065
%7 = zext i1 %6 to i32
ret i32 %7
}
unsigned ggd(a, b)
register unsigned a, b;
{
  register unsigned c;
  do {
    c = a % b;
    a = b;
    b = c;
  } while (c != 0);
  return (a);
}


x86 assembly (clang, -O0):
<ggd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    110a <ggd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ggd>:
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
mov    %edx,%edi
xor    %edx,%edx
div    %edi
test   %edx,%edx
jne    1110 <ggd+0x10>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ggd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %6, %3 ]
%5 = phi i32 [ %0, %2 ], [ %4, %3 ]
%6 = urem i32 %5, %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PacketWriteChar(int /*<<< orphan*/);
void PacketWriteString(char *str) {
  while (*str)
    PacketWriteChar(*str++);
}


x86 assembly (clang, -O0):
<PacketWriteString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <PacketWriteString+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <PacketWriteChar@plt>
jmp    111c <PacketWriteString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PacketWriteString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <PacketWriteString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <PacketWriteChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <PacketWriteString+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @PacketWriteString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @PacketWriteChar(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @PacketWriteString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @PacketWriteChar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int cpuid_simple(int);
int cpuinfo_has_sse() { return (cpuid_simple(1) & 0x02000000); }


x86 assembly (clang, -O0):
<cpuinfo_has_sse>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <cpuid_simple@plt>
and    $0x2000000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuinfo_has_sse>:
push   %rax
mov    $0x1,%edi
call   1030 <cpuid_simple@plt>
and    $0x2000000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cpuinfo_has_sse() {
%1 = call i32 @cpuid_simple(i32 1)
%2 = and i32 %1, 33554432
ret i32 %2
}

LLVM IR (-O2):
define i32 @cpuinfo_has_sse() {
%1 = tail call i32 @cpuid_simple(i32 1)
%2 = and i32 %1, 33554432
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ logb(double);
int /*<<< orphan*/ logbf(float);
int /*<<< orphan*/ logbl(long double);
void uninitvar_logb(void) {
  float f;
  (void)logbf(f);
  double d;
  (void)logb(d);
  long double ld;
  (void)logbl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_logb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1050 <logbf@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <logb@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <logbl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_logb>:
sub    $0x18,%rsp
call   1050 <logbf@plt>
call   1030 <logb@plt>
call   1040 <logbl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_logb() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @logbf(float %4)
%6 = load double, double* %2
%7 = call i32 @logb(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @logbl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_logb() {
%1 = tail call i32 @logbf(float undef)
%2 = tail call i32 @logb(double undef)
%3 = tail call i32 @logbl(x86_fp80 undef)
ret void
}
void xor_swap(char *a, char *b) {
  if (a != b) {
    *a ^= *b;
    *b ^= *a;
    *a ^= *b;
  }
}


x86 assembly (clang, -O0):
<xor_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1150 <xor_swap+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor_swap>:
cmp    %rsi,%rdi
je     1111 <xor_swap+0x11>
mov    (%rdi),%al
xor    (%rsi),%al
mov    %al,(%rdi)
xor    (%rsi),%al
mov    %al,(%rsi)
xor    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @xor_swap(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = load i8, i8* %0
%7 = xor i8 %6, %5
store i8 %7, i8* %0
%8 = load i8, i8* %1
%9 = xor i8 %8, %7
store i8 %9, i8* %1
%10 = load i8, i8* %0
%11 = xor i8 %10, %9
store i8 %11, i8* %0
br label %12
12: ; preds = %4, %2
ret void
}
int Media_DVD_SetSTC(unsigned int time) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Media_DVD_SetSTC(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "insomniad [OPTION...]\n"
          "    -n      dry run. Emit message instead of suspending\n"
          "    -t      hysteresis time in ms. Defaults to 10000 (10 seconds)\n"
          "            Will not sleep until at least this much time has "
          "elapsed since the last wakeup event\n"
          "    -v      Enable verbose message\n"
          "    -d      Enable debug messages (implies -v)\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [324 x i8] c"insomniad [OPTION...]\0A -n dry run. Emit message instead of suspending\0A -t hysteresis time in ms. Defaults to 10000 (10 seconds)\0A Will not sleep until at least this much time has elapsed since the last wakeup event\0A -v Enable verbose message\0A -d Enable debug messages (implies -v)\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([324 x i8], [324 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [324 x i8] c"insomniad [OPTION...]\0A -n dry run. Emit message instead of suspending\0A -t hysteresis time in ms. Defaults to 10000 (10 seconds)\0A Will not sleep until at least this much time has elapsed since the last wakeup event\0A -v Enable verbose message\0A -d Enable debug messages (implies -v)\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([324 x i8], [324 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ sspm_is_mime_boundary(char *);
scalar_t__ strstr(char *, char *);
int sspm_is_mime_terminating_boundary(char *line) {
  if (sspm_is_mime_boundary(line) && strstr(line, "--\n")) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sspm_is_mime_terminating_boundary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <sspm_is_mime_boundary@plt>
cmp    $0x0,%rax
je     1165 <sspm_is_mime_terminating_boundary+0x45>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1165 <sspm_is_mime_terminating_boundary+0x45>
movl   $0x1,-0x4(%rbp)
jmp    116c <sspm_is_mime_terminating_boundary+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sspm_is_mime_terminating_boundary>:
push   %rbx
mov    %rdi,%rbx
call   1040 <sspm_is_mime_boundary@plt>
test   %rax,%rax
je     114c <sspm_is_mime_terminating_boundary+0x2c>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     114c <sspm_is_mime_terminating_boundary+0x2c>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"--\0A\00"
define i32 @sspm_is_mime_terminating_boundary(i8* %0) {
%2 = tail call i64 @sspm_is_mime_boundary(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4, %1
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %9
}
void YUY2ToARGBRow_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToARGBRow_Any_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ tohRecursive(int, char, char, char);
int main() {
  int n;
  scanf(" %d", &n);
  tohRecursive(n, 'A', 'C', 'B');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    $0x41,%esi
mov    $0x43,%edx
mov    $0x42,%ecx
call   1030 <tohRecursive@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0x41,%esi
mov    $0x43,%edx
mov    $0x42,%ecx
call   1030 <tohRecursive@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @tohRecursive(i32 %4, i8 signext 65, i8 signext 67, i8 signext 66)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ redrawwin(int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
void gui_redraw() { redrawwin(stdscr); }


x86 assembly (clang, -O0):
<gui_redraw>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <redrawwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_redraw>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <redrawwin@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @gui_redraw() {
%1 = load i32, i32* @stdscr
%2 = call i32 @redrawwin(i32 %1)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @gui_redraw() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @redrawwin(i32 %1)
ret void
}
int fun276() { return 276; }


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

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

LLVM IR (-O0):
define i32 @fun276() {
ret i32 276
}

LLVM IR (-O2):
define i32 @fun276() {
ret i32 276
}
void playTone() { return; }


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

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

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

LLVM IR (-O2):
define void @playTone() {
ret void
}
int heightOfNode(int nodeID) {
  int minID = 1;
  int maxID = 2;
  int height = 1;
  while (!(nodeID >= minID && nodeID < maxID)) {
    minID <<= 1;
    maxID <<= 1;
    height++;
  }
  return height;
}


x86 assembly (clang, -O0):
<heightOfNode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x11(%rbp)
jl     1139 <heightOfNode+0x39>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    114b <heightOfNode+0x4b>
jmp    116b <heightOfNode+0x6b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <heightOfNode+0x1c>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<heightOfNode>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     112f <heightOfNode+0x2f>
mov    $0x2,%ecx
mov    $0x1,%eax
mov    $0x1,%edx
nopl   0x0(%rax)
add    %edx,%edx
add    %ecx,%ecx
add    $0x1,%eax
cmp    %edi,%edx
jg     1120 <heightOfNode+0x20>
cmp    %edi,%ecx
jle    1120 <heightOfNode+0x20>
ret

LLVM IR (-O0):
define i32 @heightOfNode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
%16 = xor i1 %15, true
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load i32, i32* %3
%19 = shl i32 %18, 1
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = shl i32 %20, 1
store i32 %21, i32* %4
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %14
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @heightOfNode(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 1, %1 ]
%5 = phi i32 [ %8, %3 ], [ 2, %1 ]
%6 = phi i32 [ %7, %3 ], [ 1, %1 ]
%7 = shl i32 %6, 1
%8 = shl i32 %5, 1
%9 = add nuw nsw i32 %4, 1
%10 = icmp sgt i32 %7, %0
%11 = icmp sle i32 %8, %0
%12 = select i1 %10, i1 true, i1 %11
br i1 %12, label %3, label %13
13: ; preds = %3, %1
%14 = phi i32 [ 1, %1 ], [ %9, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ bank2(int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Testing 1,2,3...");
  puts("Calling bank2()");
  bank2(3);
  puts("Back to main()");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1040 <bank2@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"Testing 1,2,3...\00"
@.str.1 = [16 x i8] c"Calling bank2()\00"
@.str.2 = [15 x i8] c"Back to main()\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @bank2(i32 3)
%5 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Testing 1,2,3...\00"
@.str.1 = [16 x i8] c"Calling bank2()\00"
@.str.2 = [15 x i8] c"Back to main()\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @bank2(i32 3)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void foo_1_2_1_2_1_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_1_2_1_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AirspeedSensorHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void AirspeedSensorLogging() { UAVObjLogging(AirspeedSensorHandle()); }


x86 assembly (clang, -O0):
<AirspeedSensorLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <AirspeedSensorHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AirspeedSensorLogging>:
push   %rax
xor    %eax,%eax
call   1040 <AirspeedSensorHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @AirspeedSensorLogging() {
%1 = call i32 (...) @AirspeedSensorHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AirspeedSensorLogging() {
%1 = tail call i32 (...) @AirspeedSensorHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
long function(char t1[4], char t2[4]) { return t1 == t2; }


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i64 @function(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int stockfish_write(int fd, char *buff) {
  printf("sending stockfish: \"%s\"\n", buff);
  write(fd, buff, strlen(buff));
  write(fd, "\n", strlen("\n"));
  return 0;
}


x86 assembly (clang, -O0):
<stockfish_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    0xe96(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xe85(%rip),%rsi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stockfish_write>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"sending stockfish: \22%s\22\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @stockfish_write(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write(i32 %7, i8* %8, i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @write(i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"sending stockfish: \22%s\22\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @stockfish_write(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @write(i32 %0, i8* %1, i32 %4)
%6 = tail call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}