xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ mtspr(scalar_t__, unsigned long);
unsigned long set_mode(unsigned long, unsigned long);
unsigned long set_period(unsigned long, unsigned long);
unsigned long int new_timer(unsigned long int period, unsigned long int mode,
                            unsigned long int flags) {
  unsigned long int ttmr;
  ttmr = 0;
  ttmr = set_period(ttmr, period);
  ttmr = set_mode(ttmr, mode);
  ttmr |= flags;
  (mtspr(((10 << (11)) + 0), ttmr));
  return ttmr;
}


x86 assembly (clang, -O0):
<new_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <set_period@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <set_mode@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    $0x5000,%edi
call   1050 <mtspr@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_timer>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
xor    %edi,%edi
call   1030 <set_period@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <set_mode@plt>
mov    %rax,%rbx
or     %r14,%rbx
mov    $0x5000,%edi
mov    %rbx,%rsi
call   1050 <mtspr@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @new_timer(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
store i64 0, i64* %7
%8 = load i64, i64* %7
%9 = load i64, i64* %4
%10 = call i64 @set_period(i64 %8, i64 %9)
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = load i64, i64* %5
%13 = call i64 @set_mode(i64 %11, i64 %12)
store i64 %13, i64* %7
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = or i64 %15, %14
store i64 %16, i64* %7
%17 = load i64, i64* %7
%18 = call i32 @mtspr(i64 20480, i64 %17)
%19 = load i64, i64* %7
ret i64 %19
}

LLVM IR (-O2):
define i64 @new_timer(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 @set_period(i64 0, i64 %0)
%5 = tail call i64 @set_mode(i64 %4, i64 %1)
%6 = or i64 %5, %2
%7 = tail call i32 @mtspr(i64 20480, i64 %6)
ret i64 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int same_screen;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
void set_XButtonPressedEvent_same_screen(void *_p, int _v) {
  ((XButtonPressedEvent *)_p)->same_screen = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonPressedEvent_same_screen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonPressedEvent_same_screen(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int string_length(char *address) {
  int length = 0;
  while ('\0' != address[length]) {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<string_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1133 <string_length+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <string_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <string_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @string_length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int getc() { return syscall(90, 0, 0) & 0x7F; }


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5a,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
and    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
push   %rax
mov    $0x5a,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <syscall@plt>
and    $0x7f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getc() {
%1 = call i32 @syscall(i32 90, i32 0, i32 0)
%2 = and i32 %1, 127
ret i32 %2
}

LLVM IR (-O2):
define i32 @getc() {
%1 = tail call i32 @syscall(i32 90, i32 0, i32 0)
%2 = and i32 %1, 127
ret i32 %2
}
/* Variables and functions */
int palindrom2(char const *, int const);
int palindrome(const char *word, const int length) {
  return palindrom2(word, length);
}


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

x86 assembly (clang, -O2):
<palindrome>:
jmp    1030 <palindrom2@plt>

LLVM IR (-O0):
define i32 @palindrome(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 @palindrom2(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @palindrome(i8* %0, i32 %1) {
%3 = tail call i32 @palindrom2(i8* %0, i32 %1)
ret i32 %3
}
void main(void) {
  int i = 1;
  return;
  i++;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-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
ret void
}

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

/* Variables and functions */
char *get_file(struct file_p *, unsigned int);
int is_file_dir(struct file_p *filep, unsigned int nr) {
  char *c;
  c = get_file(filep, nr);
  if (c == NULL)
    return 1;
  return c[0] == '/' ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_file_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <get_file@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1146 <is_file_dir+0x36>
movl   $0x1,-0x4(%rbp)
jmp    115d <is_file_dir+0x4d>
mov    -0x20(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x2f,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file_dir>:
push   %rax
call   1030 <get_file@plt>
test   %rax,%rax
je     1128 <is_file_dir+0x18>
mov    %rax,%rcx
xor    %eax,%eax
cmpb   $0x2f,(%rcx)
sete   %al
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.file_p = type { i32 }
define i32 @is_file_dir(%struct.file_p* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.file_p*
%5 = alloca i32
%6 = alloca i8*
store %struct.file_p* %0, %struct.file_p** %4
store i32 %1, i32* %5
%7 = load %struct.file_p*, %struct.file_p** %4
%8 = load i32, i32* %5
%9 = call i8* @get_file(%struct.file_p* %7, i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %21
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 47
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 1, i32 0
store i32 %20, i32* %3
br label %21
21: ; preds = %13, %12
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
%struct.file_p = type { i32 }
define i32 @is_file_dir(%struct.file_p* %0, i32 %1) {
%3 = tail call i8* @get_file(%struct.file_p* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 47
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
int pop();
int /*<<< orphan*/ push(int);
void apply_dup(void) {
  int arg1 = pop();
  push(arg1);
  push(arg1);
}


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

x86 assembly (clang, -O2):
<apply_dup>:
push   %rbx
xor    %eax,%eax
call   1030 <pop@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <push@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @apply_dup() {
%1 = alloca i32
%2 = call i32 (...) @pop()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @push(i32 %3)
%5 = load i32, i32* %1
%6 = call i32 @push(i32 %5)
ret void
}

LLVM IR (-O2):
define void @apply_dup() {
%1 = tail call i32 (...) @pop()
%2 = tail call i32 @push(i32 %1)
%3 = tail call i32 @push(i32 %1)
ret void
}
void ARGB1555ToYRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGB1555ToYRow_C() {
ret void
}
void foo(char *boom, void (*boomer)(char *)) {
  char F = 'f';
  boomer(boom);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x66,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    *%rsi

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

LLVM IR (-O2):
define void @foo(i8* %0, void (i8*)* nocapture %1) {
tail call void %1(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ address();
int age(int);
int /*<<< orphan*/ clr();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  clr();
  address();
  getchar();
  printf("\nMy age is %d", age(2));
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clr@plt>
mov    $0x0,%al
call   1050 <address@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    $0x2,%edi
call   1070 <age@plt>
mov    %eax,%esi
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <clr@plt>
xor    %eax,%eax
call   1050 <address@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    $0x2,%edi
call   1070 <age@plt>
lea    0xe89(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0AMy age is %d\00"
define i32 @main() {
%1 = call i32 (...) @clr()
%2 = call i32 (...) @address()
%3 = call i32 (...) @getchar()
%4 = call i32 @age(i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0AMy age is %d\00"
define i32 @main() {
%1 = tail call i32 (...) @clr()
%2 = tail call i32 (...) @address()
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 @age(i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _mv_error(char const *message, int ret) {
  fputs("mv"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_mv_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mv_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"mv: \00"
@stderr = global i32 0
define i32 @_mv_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"mv: \00"
@stderr = global i32 0
define i32 @_mv_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
int nfs_fscache_register(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @nfs_fscache_register() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nfs_fscache_register() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_RFM_TXD_OUTPUT() { set_io_bit(0x39, 3); }


x86 assembly (clang, -O0):
<TOSH_MAKE_RFM_TXD_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
mov    $0x3,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_RFM_TXD_OUTPUT>:
mov    $0x39,%edi
mov    $0x3,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_RFM_TXD_OUTPUT() {
%1 = call i32 @set_io_bit(i32 57, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_RFM_TXD_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 57, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void display_version(void) {
  printf("nanddump"
         " "
         "$Revision: 1.29 $"
         "\n"
         "\n"
         "nanddump"
         " comes with NO WARRANTY\n"
         "to the extent permitted by law.\n"
         "\n"
         "You may redistribute copies of "
         "nanddump"
         "\n"
         "under the terms of the GNU General Public Licence.\n"
         "See the file `COPYING' for more information.\n");
  exit(EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [230 x i8] c"nanddump $Revision: 1.29 $\0A\0Ananddump comes with NO WARRANTY\0Ato the extent permitted by law.\0A\0AYou may redistribute copies of nanddump\0Aunder the terms of the GNU General Public Licence.\0ASee the file `COPYING' for more information.\0A\00"
@EXIT_SUCCESS = global i32 0
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [229 x i8] c"nanddump $Revision: 1.29 $\0A\0Ananddump comes with NO WARRANTY\0Ato the extent permitted by law.\0A\0AYou may redistribute copies of nanddump\0Aunder the terms of the GNU General Public Licence.\0ASee the file `COPYING' for more information.\00"
define void @display_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([229 x i8], [229 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
char *mdup(s)
char *s;
{
  char *p;
  p = mallo(strlen(s) + 1);
  strcpy(p, s);
  return (p);
}


x86 assembly (clang, -O0):
<mdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <mallo@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <mallo@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @mdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, ...) bitcast (i32 (...)* @mallo to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @mdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @mallo to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no)) foo(uint64_t state, uint32_t last) {
  if (state == last)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1135 <foo+0x25>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    %rsi,%rdi
je     1116 <foo+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int num;
  char num_str[200];
  num = 1023;
  itoa(num, num_str);
  printf("%s\n", num_str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
mov    %rsp,%rbx
mov    $0x3ff,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 1023, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
struct strbuf **strbuf_split_max(struct strbuf const *, int,
                                 int /*<<< orphan*/);
struct strbuf **strbuf_split(const struct strbuf *sb, int delim) {
  return strbuf_split_max(sb, delim, 0);
}


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

x86 assembly (clang, -O2):
<strbuf_split>:
xor    %edx,%edx
jmp    1030 <strbuf_split_max@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define %struct.strbuf** @strbuf_split(%struct.strbuf* %0, i32 %1) {
%3 = alloca %struct.strbuf*
%4 = alloca i32
store %struct.strbuf* %0, %struct.strbuf** %3
store i32 %1, i32* %4
%5 = load %struct.strbuf*, %struct.strbuf** %3
%6 = load i32, i32* %4
%7 = call %struct.strbuf** @strbuf_split_max(%struct.strbuf* %5, i32 %6, i32 0)
ret %struct.strbuf** %7
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define %struct.strbuf** @strbuf_split(%struct.strbuf* %0, i32 %1) {
%3 = tail call %struct.strbuf** @strbuf_split_max(%struct.strbuf* %0, i32 %1, i32 0)
ret %struct.strbuf** %3
}
void rop3_85_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = ~*D;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_85_0_1>:
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
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_85_0_1>:
mov    %edx,%eax
not    %al
or     %sil,%al
not    %sil
and    %dl,%sil
xor    %al,%sil
and    (%rdi),%sil
xor    %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_85_0_1(i8* %0, i8 zeroext %1, i8 zeroext %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
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %7
%13 = load i8, i8* %7
%14 = zext i8 %13 to i32
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = and i32 %14, %16
%18 = load i8, i8* %7
%19 = zext i8 %18 to i32
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = xor i32 %21, -1
%23 = and i32 %19, %22
%24 = or i32 %17, %23
%25 = load i8, i8* %6
%26 = zext i8 %25 to i32
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = and i32 %26, %29
%31 = load i8*, i8** %4
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = and i32 %30, %33
%35 = or i32 %24, %34
%36 = trunc i32 %35 to i8
%37 = load i8*, i8** %4
store i8 %36, i8* %37
ret void
}

LLVM IR (-O2):
define void @rop3_85_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = xor i8 %2, -1
%7 = or i8 %6, %1
%8 = and i8 %7, %5
%9 = xor i8 %1, -1
%10 = and i8 %9, %2
%11 = and i8 %10, %4
%12 = or i8 %8, %11
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showhelp(void) {
  printf("Usage: procppp [options] type filename [outputfile]\n");
  printf("\nOptions:\n");
  printf("\t-un\nInclude unnamed items in output too\n");
  printf("\nExample: procae -f Airport airport\n");
}


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

x86 assembly (clang, -O2):
<showhelp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Usage: procppp [options] type filename [outputfile]\0A\00"
@.str.1 = [11 x i8] c"\0AOptions:\0A\00"
@.str.2 = [42 x i8] c"\09-un\0AInclude unnamed items in output too\0A\00"
@.str.3 = [37 x i8] c"\0AExample: procae -f Airport airport\0A\00"
define void @showhelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"Usage: procppp [options] type filename [outputfile]\00"
@str.4 = [10 x i8] c"\0AOptions:\00"
@str.5 = [41 x i8] c"\09-un\0AInclude unnamed items in output too\00"
@str.6 = [36 x i8] c"\0AExample: procae -f Airport airport\00"
define void @showhelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.6, i64 0, i64 0))
ret void
}
int fun962() { return 962; }


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

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

LLVM IR (-O0):
define i32 @fun962() {
ret i32 962
}

LLVM IR (-O2):
define i32 @fun962() {
ret i32 962
}
/* Variables and functions */
char *stringprep_convert(char const *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stringprep_locale_charset();
char *stringprep_locale_to_utf8(const char *str) {
  return stringprep_convert(str, "UTF-8", stringprep_locale_charset());
}


x86 assembly (clang, -O0):
<stringprep_locale_to_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <stringprep_locale_charset@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
lea    0xeb8(%rip),%rsi
call   1040 <stringprep_convert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringprep_locale_to_utf8>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <stringprep_locale_charset@plt>
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
pop    %rbx
jmp    1040 <stringprep_convert@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"UTF-8\00"
define i8* @stringprep_locale_to_utf8(i8* %0) {
%2 = tail call i32 (...) @stringprep_locale_charset()
%3 = tail call i8* @stringprep_convert(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* %3
}
int Cyc_Position_segment_equals(unsigned s1, unsigned s2) { return s1 == s2; }


x86 assembly (clang, -O0):
<Cyc_Position_segment_equals>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Position_segment_equals>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @Cyc_Position_segment_equals(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int nzd(int, int);
int euklidNzd(int a, int b) {
  if (b == 0)
    return a;
  return nzd(b, a % b);
}


x86 assembly (clang, -O0):
<euklidNzd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <euklidNzd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <euklidNzd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <nzd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euklidNzd>:
mov    %edi,%eax
test   %esi,%esi
je     1122 <euklidNzd+0x12>
cltd
idiv   %esi
mov    %esi,%edi
mov    %edx,%esi
jmp    1030 <nzd@plt>
ret

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

LLVM IR (-O2):
define i32 @euklidNzd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = srem i32 %0, %1
%6 = tail call i32 @nzd(i32 %1, i32 %5)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ %0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ add_upper(int /*<<< orphan*/);
void add_upper_string(char *p) {
  while (*p)
    add_upper(*p++);
}


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

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

LLVM IR (-O0):
define void @add_upper_string(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 @add_upper(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @add_upper_string(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 @add_upper(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 /*<<< orphan*/ printf(char *);
int main() {
  printf("password");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"password\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double exp(double);
double pow(double, int);
double nnet_softmax_derivative(double y) {
  double ex = exp(y);
  return ex / pow(ex + 1, 2);
}


x86 assembly (clang, -O0):
<nnet_softmax_derivative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb2(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nnet_softmax_derivative>:
push   %rax
call   1030 <exp@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0xec9(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @nnet_softmax_derivative(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @exp(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fadd double %7, 1.000000e+00
%9 = call double @pow(double %8, i32 2)
%10 = fdiv double %6, %9
ret double %10
}

LLVM IR (-O2):
define double @nnet_softmax_derivative(double %0) {
%2 = tail call double @exp(double %0)
%3 = fadd double %2, 1.000000e+00
%4 = tail call double @pow(double %3, i32 2)
%5 = fdiv double %2, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_prompt() { printf("> "); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
define void @show_prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
void interrupt_handler(int signum) { pthread_exit(0); }


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

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

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

LLVM IR (-O2):
define void @interrupt_handler(i32 %0) {
%2 = tail call i32 @pthread_exit(i32 0)
ret void
}
int clip(int x, int a) { return x > a - 1 ? a - 1 : (x < 0 ? 0 : x); }


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    1129 <clip+0x29>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <clip+0x49>
cmpl   $0x0,-0x4(%rbp)
jge    113d <clip+0x3d>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <clip+0x43>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
lea    -0x1(%rsi),%ecx
cmp    %edi,%esi
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @clip(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 = sub nsw i32 %6, 1
%8 = icmp sgt i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
br label %20
12: ; preds = %2
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
br label %18
16: ; preds = %12
%17 = load i32, i32* %3
br label %18
18: ; preds = %16, %15
%19 = phi i32 [ 0, %15 ], [ %17, %16 ]
br label %20
20: ; preds = %18, %9
%21 = phi i32 [ %11, %9 ], [ %19, %18 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @clip(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = add nsw i32 %1, -1
%5 = icmp sgt i32 %0, 0
%6 = select i1 %5, i32 %0, i32 0
%7 = select i1 %3, i32 %6, i32 %4
ret i32 %7
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void sighandler(int signo) {
  printf("Caught %d\n", signo);
  cleanup();
  if (signo == SIGINT)
    exit(-1);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    -0x4(%rbp),%eax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%eax
jne    116d <sighandler+0x3d>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandler>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
mov    0x2e99(%rip),%rax
cmp    %ebx,(%rax)
je     1155 <sighandler+0x25>
pop    %rbx
ret
mov    $0xffffffff,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Caught %d\0A\00"
@SIGINT = global i32 0
define void @sighandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @cleanup()
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %4, %0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ process_profile();
int /*<<< orphan*/ read_args(int, char const **);
int /*<<< orphan*/ read_map();
int /*<<< orphan*/ read_profile();
int main(int argc, const char *argv[]) {
  read_args(argc, argv);
  read_profile();
  read_map();
  process_profile();
  return EXIT_SUCCESS;
}


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <read_args@plt>
mov    $0x0,%al
call   1060 <read_profile@plt>
mov    $0x0,%al
call   1030 <read_map@plt>
mov    $0x0,%al
call   1040 <process_profile@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <read_args@plt>
xor    %eax,%eax
call   1060 <read_profile@plt>
xor    %eax,%eax
call   1030 <read_map@plt>
xor    %eax,%eax
call   1040 <process_profile@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @read_args(i32 %6, i8** %7)
%9 = call i32 (...) @read_profile()
%10 = call i32 (...) @read_map()
%11 = call i32 (...) @process_profile()
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @read_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @read_profile()
%5 = tail call i32 (...) @read_map()
%6 = tail call i32 (...) @process_profile()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
void Default_Handler() {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Default_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_Handler+0x9>
jmp    1109 <Default_Handler+0x9>

x86 assembly (clang, -O2):
<Default_Handler>:
jmp    1100 <Default_Handler>

LLVM IR (-O0):
define void @Default_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void av_md5_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_md5_alloc() {
ret void
}
void helptext(void) { ; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ cintern(char *);
int /*<<< orphan*/ setvar(int /*<<< orphan*/, int /*<<< orphan*/, struct obj *);
void init_slib_version(void) {
  setvar(cintern("*slib-version*"),
         cintern("$Id: slib.c,v 1.21 2003/02/21 12:58:39 cedars Exp $"),
         ((struct obj *)0));
}


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

x86 assembly (clang, -O2):
<init_slib_version>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,%ebx
lea    0xed9(%rip),%rdi
call   1040 <cintern@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <setvar@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [15 x i8] c"*slib-version*\00"
@.str.1 = [52 x i8] c"$Id: slib.c,v 1.21 2003/02/21 12:58:39 cedars Exp $\00"
define void @init_slib_version() {
%1 = call i32 @cintern(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cintern(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [15 x i8] c"*slib-version*\00"
@.str.1 = [52 x i8] c"$Id: slib.c,v 1.21 2003/02/21 12:58:39 cedars Exp $\00"
define void @init_slib_version() {
%1 = tail call i32 @cintern(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cintern(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SCLKHigh();
int /*<<< orphan*/ SCLKLow();
void RunClock(unsigned int iNumCycles) {
  int i;
  for (i = 0; i < iNumCycles; i++) {
    SCLKLow();
    SCLKHigh();
  }
}


x86 assembly (clang, -O0):
<RunClock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    115a <RunClock+0x3a>
mov    $0x0,%al
call   1040 <SCLKLow@plt>
mov    $0x0,%al
call   1030 <SCLKHigh@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <RunClock+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RunClock>:
push   %rbx
test   %edi,%edi
je     1143 <RunClock+0x23>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <SCLKLow@plt>
xor    %eax,%eax
call   1030 <SCLKHigh@plt>
add    $0xffffffff,%ebx
jne    1130 <RunClock+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @RunClock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = call i32 (...) @SCLKLow()
%10 = call i32 (...) @SCLKHigh()
br label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @RunClock(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @SCLKLow()
%6 = tail call i32 (...) @SCLKHigh()
%7 = add nuw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}