xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sorted2_mode();
int /*<<< orphan*/ sorted_mode();
int /*<<< orphan*/ unsorted_mode();
int main(int argc, char *argv[]) {
  unsorted_mode();
  sorted_mode();
  sorted2_mode();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @unsorted_mode()
%4 = tail call i32 (...) @sorted_mode()
%5 = tail call i32 (...) @sorted2_mode()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int usage(char *prog, int error) {
  fprintf(error ? stderr : stdout,
          "usage: %s"
          "\n",
          prog);
  exit(error);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114a <usage+0x2a>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <usage+0x36>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
test   %esi,%esi
jne    1133 <usage+0x13>
mov    0x2ea7(%rip),%rax
jmp    113a <usage+0x1a>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [11 x i8] c"usage: %s\0A\00"
define i32 @usage(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* @stderr
br label %11
9: ; preds = %2
%10 = load i32, i32* @stdout
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* %4
%16 = call i32 @exit(i32 %15)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [11 x i8] c"usage: %s\0A\00"
define i32 @usage(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load i32, i32* @stderr
%5 = load i32, i32* @stdout
%6 = select i1 %3, i32 %5, i32 %4
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall(int);
gid_t getegid(void) { return __syscall(50); }


x86 assembly (clang, -O0):
<getegid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
call   1030 <__syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getegid>:
mov    $0x32,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define i32 @getegid() {
%1 = call i32 @__syscall(i32 50)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getegid() {
%1 = tail call i32 @__syscall(i32 50)
ret i32 %1
}
void standt(on) int on;
{
  if (on) {
    standout();
  } else {
    standend();
  }
}


x86 assembly (clang, -O0):
<standt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <standt+0x21>
mov    $0x0,%al
call   1040 <standout@plt>
jmp    1148 <standt+0x28>
mov    $0x0,%al
call   1030 <standend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standt>:
xor    %eax,%eax
test   %edi,%edi
je     112b <standt+0xb>
jmp    1040 <standout@plt>
jmp    1030 <standend@plt>

LLVM IR (-O0):
define void @standt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @standout()
br label %9
7: ; preds = %1
%8 = call i32 (...) @standend()
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @standt(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @standout()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @standend()
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 23;
  int height = 178;
  printf("I am %-10d years old.\n", age);
  printf("And  %10d cm tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x17,-0x8(%rbp)
movl   $0xb2,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xed1(%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
mov    $0x17,%esi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0xb2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"I am %-10d years old.\0A\00"
@.str.1 = [20 x i8] c"And %10d cm tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 23, i32* %2
store i32 178, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"I am %-10d years old.\0A\00"
@.str.1 = [20 x i8] c"And %10d cm tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 23)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 178)
ret i32 0
}
void free_ivector(v, nl, nh) int *v, nl, nh;
{ free((char *)(v + nl)); }


x86 assembly (clang, -O0):
<free_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ivector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_ivector(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** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = bitcast i32* %10 to i8*
ret void
}

LLVM IR (-O2):
define void @free_ivector(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = bitcast i32* %5 to i8*
tail call void @free(i8* %6)
ret void
}
/* Type definitions */
struct buffer_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tux3_mark_buffer_dirty(struct buffer_head *);
void mark_buffer_dirty_atomic(struct buffer_head *buffer) {
  tux3_mark_buffer_dirty(buffer);
}


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

x86 assembly (clang, -O2):
<mark_buffer_dirty_atomic>:
jmp    1030 <tux3_mark_buffer_dirty@plt>

LLVM IR (-O0):
%struct.buffer_head = type { i32 }
define void @mark_buffer_dirty_atomic(%struct.buffer_head* %0) {
%2 = alloca %struct.buffer_head*
store %struct.buffer_head* %0, %struct.buffer_head** %2
%3 = load %struct.buffer_head*, %struct.buffer_head** %2
%4 = call i32 @tux3_mark_buffer_dirty(%struct.buffer_head* %3)
ret void
}

LLVM IR (-O2):
%struct.buffer_head = type { i32 }
define void @mark_buffer_dirty_atomic(%struct.buffer_head* %0) {
%2 = tail call i32 @tux3_mark_buffer_dirty(%struct.buffer_head* %0)
ret void
}
/* Variables and functions */
int write_value(int /*<<< orphan*/, char *);
int stop(void) { return write_value(0, "/sys/kernel/mm/ksm/run"); }


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <write_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <write_value@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"/sys/kernel/mm/ksm/run\00"
define i32 @stop() {
%1 = call i32 @write_value(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [23 x i8] c"/sys/kernel/mm/ksm/run\00"
define i32 @stop() {
%1 = tail call i32 @write_value(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
struct spin_lock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hcos_noinstrument)) void
__unlock_hook(void *owner, struct spin_lock *lock, int success,
              const char *struct_name, const char *lock_name,
              const char *filename, int lineno) {
  printf("FAIL: Inappropriate unlock hook call.\n");
}


x86 assembly (clang, -O0):
<__unlock_hook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.spin_lock = type { i32 }
@.str = [39 x i8] c"FAIL: Inappropriate unlock hook call.\0A\00"
define void @__unlock_hook(i8* %0, %struct.spin_lock* %1, i32 %2, i8* %3, i8* %4, i8* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca %struct.spin_lock*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
store i8* %0, i8** %8
store %struct.spin_lock* %1, %struct.spin_lock** %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.spin_lock = type { i32 }
@str = [38 x i8] c"FAIL: Inappropriate unlock hook call.\00"
define void @__unlock_hook(i8* nocapture readnone %0, %struct.spin_lock* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i32 %6) {
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret void
}
char inbyte(void) {
  volatile int *const rxdata = (int *)0x20001a20;
  volatile int *const rxqs = (int *)0x20001a30;
  int bytes_in_fifo = 0;
  while (!bytes_in_fifo)
    bytes_in_fifo = *rxqs;
  return (*rxdata) & 0xff;
}


x86 assembly (clang, -O0):
<inbyte>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20001a20,%eax
mov    %rax,-0x8(%rbp)
mov    $0x20001a30,%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1133 <inbyte+0x33>
jmp    1142 <inbyte+0x42>
mov    $0x20001a30,%eax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    111d <inbyte+0x1d>
mov    $0x20001a20,%eax
mov    (%rax),%eax
and    $0xff,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inbyte>:
cmpl   $0x0,0x20001a30
je     1100 <inbyte>
mov    0x20001a20,%eax
ret

LLVM IR (-O0):
define signext i8 @inbyte() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
store i32* inttoptr (i64 536877600 to i32*), i32** %1
store i32* inttoptr (i64 536877616 to i32*), i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load volatile i32, i32* inttoptr (i64 536877616 to i32*)
store i32 %9, i32* %3
br label %4
10: ; preds = %4
%11 = load volatile i32, i32* inttoptr (i64 536877600 to i32*)
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @inbyte() {
br label %1
1: ; preds = %0, %1
%2 = load volatile i32, i32* inttoptr (i64 536877616 to i32*)
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = load volatile i32, i32* inttoptr (i64 536877600 to i32*)
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Variables and functions */
int breadth_first_search(int);
int /*<<< orphan*/ create_adjacent_table(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int length;
  int n;
  scanf("%d", &n);
  create_adjacent_table(n);
  length = breadth_first_search(n);
  printf("%d\n", length);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <create_adjacent_table@plt>
mov    0x4(%rsp),%edi
call   1030 <breadth_first_search@plt>
lea    0xe98(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 @create_adjacent_table(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @breadth_first_search(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tos_tcli_printf(char *, ...);
void run_my_cmd(int i, char *s) {
  tos_tcli_printf("i=%d\n", i);
  tos_tcli_printf("s=%s\n", s);
}


x86 assembly (clang, -O0):
<run_my_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <tos_tcli_printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <tos_tcli_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_my_cmd>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
xor    %eax,%eax
call   1030 <tos_tcli_printf@plt>
lea    0xedb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <tos_tcli_printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"i=%d\0A\00"
@.str.1 = [6 x i8] c"s=%s\0A\00"
define void @run_my_cmd(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @tos_tcli_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 (i8*, ...) @tos_tcli_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
void mark_line_end(char *in_line) {
  while (*in_line) {
    if ((*in_line == '#') || (*in_line == '\r') || (*in_line == '\n')) {
      *in_line = 0;
      return;
    }
    in_line++;
  }
}


x86 assembly (clang, -O0):
<mark_line_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <mark_line_end+0x62>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     1145 <mark_line_end+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1145 <mark_line_end+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1151 <mark_line_end+0x51>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1162 <mark_line_end+0x62>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <mark_line_end+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark_line_end>:
lea    0xef9(%rip),%rax
jmp    1114 <mark_line_end+0x14>
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x23,%rcx
ja     1110 <mark_line_end+0x10>
movslq (%rax,%rcx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @mark_line_end(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 35, label %5
i8 13, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strnlen(char *, int /*<<< orphan*/);
void strnlen_zero() {
  clang_analyzer_eval(strnlen("abc", 0) == 0);
  clang_analyzer_eval(strnlen(0, 0) == 0);
}


x86 assembly (clang, -O0):
<strnlen_zero>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
xor    %esi,%esi
call   1030 <strnlen@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <strnlen@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen_zero>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1030 <strnlen@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <clang_analyzer_eval@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <strnlen@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
define void @strnlen_zero() {
%1 = call i64 @strnlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @clang_analyzer_eval(i32 %3)
%5 = call i64 @strnlen(i8* null, i32 0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define void @strnlen_zero() {
%1 = tail call i64 @strnlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
%5 = tail call i64 @strnlen(i8* null, i32 0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @clang_analyzer_eval(i32 %7)
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long mstime(void) {
  struct timeval tv;
  long long mst;
  gettimeofday(&tv, NULL);
  mst = ((long long)tv.tv_sec) * 1000;
  mst += tv.tv_usec / 1000;
  return mst;
}


x86 assembly (clang, -O0):
<mstime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%rcx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @mstime() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
store i64 %6, i64* %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = load i64, i64* %2
%12 = add nsw i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @mstime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
void dequeue_pushable_dl_task(struct rq *rq, struct task_struct *p) {}


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

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

LLVM IR (-O0):
%struct.rq = type opaque
%struct.task_struct = type opaque
define void @dequeue_pushable_dl_task(%struct.rq* %0, %struct.task_struct* %1) {
%3 = alloca %struct.rq*
%4 = alloca %struct.task_struct*
store %struct.rq* %0, %struct.rq** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret void
}

LLVM IR (-O2):
%struct.rq = type opaque
%struct.task_struct = type opaque
define void @dequeue_pushable_dl_task(%struct.rq* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
int test_implication(int x, int y) { return !(x & (!y)); }


x86 assembly (clang, -O0):
<test_implication>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmpl   $0x0,-0x8(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_implication>:
xor    %eax,%eax
test   %esi,%esi
sete   %al
and    %edi,%eax
xor    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_implication(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 ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = and i32 %5, %9
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_implication(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = zext i1 %3 to i32
%5 = and i32 %4, %0
%6 = xor i32 %5, 1
ret i32 %6
}
char *memchr(s, c, n)
register char *s;
register c, n;
{
  while (--n >= 0)
    if (*s++ == c)
      return (--s);
  return (0);
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jl     1155 <memchr+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1150 <memchr+0x50>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    115d <memchr+0x5d>
jmp    110e <memchr+0xe>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
test   %edx,%edx
jle    1124 <memchr+0x24>
add    $0xffffffff,%edx
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <memchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %8, %3
%5 = phi i8* [ %0, %3 ], [ %10, %8 ]
%6 = phi i32 [ %2, %3 ], [ %9, %8 ]
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = add nsw i32 %6, -1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, %1
br i1 %13, label %14, label %4
14: ; preds = %4, %8
%15 = phi i8* [ %5, %8 ], [ null, %4 ]
ret i8* %15
}
/* Type definitions */
typedef size_t int32_t;

/* Variables and functions */
size_t strlen(char const *);
char *convert_reverse(const char *src, char *dst) {
  int32_t len = strlen(src) - 1;
  char *ret = dst;
  while (len >= 0) {
    *dst = src[len];
    ++dst;
    --len;
  }
  *dst = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<convert_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jb     1172 <convert_reverse+0x62>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1139 <convert_reverse+0x29>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_reverse>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    %r14,%rax
add    $0xffffffffffffffff,%rax
cs nopw 0x0(%rax,%rax,1)
movzbl (%rax),%ecx
mov    %cl,(%rbx)
add    $0x1,%rbx
add    $0xffffffffffffffff,%rax
jmp    1130 <convert_reverse+0x20>

LLVM IR (-O0):
define i8* @convert_reverse(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = sub i64 %8, 1
store i64 %9, i64* %5
%10 = load i8*, i8** %4
store i8* %10, i8** %6
br label %11
11: ; preds = %14, %2
%12 = load i64, i64* %5
%13 = icmp uge i64 %12, 0
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i8*, i8** %3
%16 = load i64, i64* %5
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
store i8 %18, i8* %19
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
%22 = load i64, i64* %5
%23 = add i64 %22, -1
store i64 %23, i64* %5
br label %11
24: ; preds = %11
%25 = load i8*, i8** %4
store i8 0, i8* %25
%26 = load i8*, i8** %6
ret i8* %26
}

LLVM IR (-O2):
define noalias i8* @convert_reverse(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %3, %2 ], [ %7, %4 ]
%6 = phi i8* [ %1, %2 ], [ %10, %4 ]
%7 = add i64 %5, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
br label %4
}
/* Type definitions */
typedef size_t int32_t;

/* Variables and functions */
scalar_t__ is_space(char const);
void parse_skip_spaces(const char *expression, int32_t *offset) {
  while (is_space(expression[*offset])) {
    (*offset)++;
  }
}


x86 assembly (clang, -O0):
<parse_skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <is_space@plt>
cmp    $0x0,%rax
je     1151 <parse_skip_spaces+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1120 <parse_skip_spaces+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_skip_spaces>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%rax
movsbl (%rdi,%rax,1),%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <is_space@plt>
test   %rax,%rax
je     114c <parse_skip_spaces+0x3c>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%r14,%rax,1),%edi
jmp    1130 <parse_skip_spaces+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @parse_skip_spaces(i8* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i64 @is_space(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %2, %8
%9 = load i64, i64* %1
%10 = add i64 %9, 1
store i64 %10, i64* %1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = tail call i64 @is_space(i8 signext %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret void
}
/* Variables and functions */
double ephAngleRed(double);
double ephCalcT(double);
double ephMSTG(double jd) {
  double t;
  t = ephCalcT(jd);
  return ephAngleRed(280.46061837 + 360.98564736629 * (jd - 2451545.0) +
                     t * t * (0.000387933 - t / 38710000.0));
}


x86 assembly (clang, -O0):
<ephMSTG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <ephCalcT@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xed7(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xebb(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xeb7(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm3
movsd  0xe8c(%rip),%xmm2
divsd  %xmm2,%xmm3
movsd  0xe78(%rip),%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <ephAngleRed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ephMSTG>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <ephCalcT@plt>
movsd  (%rsp),%xmm1
addsd  0xec8(%rip),%xmm1
mulsd  0xec8(%rip),%xmm1
addsd  0xec8(%rip),%xmm1
movapd %xmm1,%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
divsd  0xebc(%rip),%xmm0
addsd  0xebc(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
pop    %rax
jmp    1030 <ephAngleRed@plt>

LLVM IR (-O0):
define double @ephMSTG(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @ephCalcT(double %4)
store double %5, double* %3
%6 = load double, double* %2
%7 = fsub double %6, 0x4142B42C80000000
%8 = call double @llvm.fmuladd.f64(double 0x40768FC5362C39AA, double %7, double 0x4071875EB15E3164)
%9 = load double, double* %3
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = load double, double* %3
%13 = fdiv double %12, 3.871000e+07
%14 = fsub double 3.879330e-04, %13
%15 = call double @llvm.fmuladd.f64(double %11, double %14, double %8)
%16 = call double @ephAngleRed(double %15)
ret double %16
}

LLVM IR (-O2):
define double @ephMSTG(double %0) {
%2 = tail call double @ephCalcT(double %0)
%3 = fadd double %0, 0xC142B42C80000000
%4 = tail call double @llvm.fmuladd.f64(double %3, double 0x40768FC5362C39AA, double 0x4071875EB15E3164)
%5 = fmul double %2, %2
%6 = fdiv double %2, 3.871000e+07
%7 = fsub double 3.879330e-04, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %7, double %4)
%9 = tail call double @ephAngleRed(double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, unsigned char,
                          unsigned char);
void printip(unsigned char *buffer) {
  printf("%d.%d.%d.%d", buffer[0], buffer[1], buffer[2], buffer[3]);
}


x86 assembly (clang, -O0):
<printip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%sil
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
lea    0xec4(%rip),%rdi
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl 0x3(%rax),%r8d
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printip>:
movzbl (%rdi),%esi
movzbl 0x1(%rdi),%edx
movzbl 0x2(%rdi),%ecx
movzbl 0x3(%rdi),%r8d
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define void @printip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 3
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %5, i8 zeroext %8, i8 zeroext %11, i8 zeroext %14)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define void @printip(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %2, i8 zeroext %4, i8 zeroext %6, i8 zeroext %8)
ret void
}
/* Variables and functions */
void *malloc(int);
void alloc_matrix(void **pv) { *pv = malloc(sizeof(double) * 10); }


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

x86 assembly (clang, -O2):
<alloc_matrix>:
push   %rbx
mov    %rdi,%rbx
mov    $0x50,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @alloc_matrix(i8** nocapture writeonly %0) {
%2 = tail call dereferenceable_or_null(80) i8* @malloc(i32 80)
store i8* %2, i8** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
int inet6_opt_get_val(void *databuf, int offset, void *val, socklen_t vallen) {
  memcpy(val, (uint8_t *)databuf + offset, vallen);
  return (offset + vallen);
}


x86 assembly (clang, -O0):
<inet6_opt_get_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_opt_get_val>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
movslq %esi,%rbx
lea    (%rdi,%rbx,4),%rsi
mov    %rdx,%rdi
mov    %ecx,%edx
call   1030 <memcpy@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inet6_opt_get_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %8
%16 = call i32 @memcpy(i8* %9, i32* %14, i32 %15)
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @inet6_opt_get_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = tail call i32 @memcpy(i8* %2, i32* %7, i32 %3)
%9 = add nsw i32 %3, %1
ret i32 %9
}
void fp32_to_hex(double dataf, unsigned char datahex[4]) {
  union _fp32hex {
    float dataf;
    unsigned char datahex[4];
  } fp32hex;
  fp32hex.dataf = (float)dataf;
  datahex[0] = fp32hex.datahex[0];
  datahex[1] = fp32hex.datahex[1];
  datahex[2] = fp32hex.datahex[2];
  datahex[3] = fp32hex.datahex[3];
}


x86 assembly (clang, -O0):
<fp32_to_hex>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x17(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x16(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x15(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp32_to_hex>:
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
%union._fp32hex = type { float }
define void @fp32_to_hex(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca %union._fp32hex
store double %0, double* %3
store i8* %1, i8** %4
%6 = load double, double* %3
%7 = fptrunc double %6 to float
%8 = bitcast %union._fp32hex* %5 to float*
store float %7, float* %8
%9 = bitcast %union._fp32hex* %5 to [4 x i8]*
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%11 = load i8, i8* %10
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = bitcast %union._fp32hex* %5 to [4 x i8]*
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 1
%16 = load i8, i8* %15
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
%19 = bitcast %union._fp32hex* %5 to [4 x i8]*
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %19, i64 0, i64 2
%21 = load i8, i8* %20
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8 %21, i8* %23
%24 = bitcast %union._fp32hex* %5 to [4 x i8]*
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %24, i64 0, i64 3
%26 = load i8, i8* %25
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i64 3
store i8 %26, i8* %28
ret void
}

LLVM IR (-O2):
define void @fp32_to_hex(double %0, i8* nocapture writeonly %1) {
%3 = fptrunc double %0 to float
%4 = bitcast float %3 to i32
%5 = trunc i32 %4 to i8
store i8 %5, i8* %1
%6 = lshr i32 %4, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %4, 16
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %10, i8* %11
%12 = lshr i32 %4, 24
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %13, i8* %14
ret void
}
int Operand_brall_decode(unsigned int *valp) {
  *valp = *valp << 4;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_brall_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x4,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_brall_decode>:
shll   $0x4,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_brall_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 4
store i32 %3, i32* %0
ret i32 0
}
int fib(int param1) {
  int eax;
  int eax_1;
  int local2;
  if (param1 <= 1) {
    local2 = param1;
  } else {
    eax = fib(param1 - 1);
    eax_1 = fib(param1 - 2);
    local2 = eax + eax_1;
  }
  return local2;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     1130 <fib+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <fib+0x45>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t reverseBits(uint32_t n) {
  uint32_t m = 0;
  for (int i = 0; i < 31; ++i) {
    m |= (n & 0x1);
    m <<= 1;
    n >>= 1;
  }
  return m | (n & 0x1);
}


x86 assembly (clang, -O0):
<reverseBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1f,-0xc(%rbp)
jge    114b <reverseBits+0x4b>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <reverseBits+0x15>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits>:
xor    %eax,%eax
mov    $0x1c,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
or     %eax,%edx
mov    %edi,%eax
and    $0x2,%eax
lea    (%rax,%rdx,4),%edx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
or     %edx,%eax
add    %eax,%eax
mov    %edi,%edx
sar    $0x3,%edx
and    $0x1,%edx
or     %edx,%eax
test   %ecx,%ecx
je     1143 <reverseBits+0x43>
add    %eax,%eax
sar    $0x4,%edi
add    $0xfffffffc,%ecx
jmp    1110 <reverseBits+0x10>
ret

LLVM IR (-O0):
define i32 @reverseBits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 31
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %2
%10 = and i32 %9, 1
%11 = load i32, i32* %3
%12 = or i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = shl i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = ashr i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %8
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
%21 = load i32, i32* %3
%22 = load i32, i32* %2
%23 = and i32 %22, 1
%24 = or i32 %21, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @reverseBits(i32 %0) {
br label %5
2: ; preds = %5
%3 = and i32 %18, 1
%4 = or i32 %17, %3
ret i32 %4
5: ; preds = %20, %1
%6 = phi i32 [ 0, %1 ], [ %25, %20 ]
%7 = phi i32 [ 0, %1 ], [ %23, %20 ]
%8 = phi i32 [ %0, %1 ], [ %24, %20 ]
%9 = and i32 %8, 1
%10 = or i32 %7, %9
%11 = shl i32 %10, 2
%12 = and i32 %8, 2
%13 = or i32 %11, %12
%14 = lshr i32 %8, 2
%15 = and i32 %14, 1
%16 = or i32 %13, %15
%17 = shl i32 %16, 1
%18 = ashr i32 %8, 3
%19 = icmp eq i32 %6, 28
br i1 %19, label %2, label %20
20: ; preds = %5
%21 = and i32 %18, 1
%22 = or i32 %17, %21
%23 = shl i32 %22, 1
%24 = ashr i32 %8, 4
%25 = add nuw nsw i32 %6, 4
br label %5
}