xunge/DecIR huggingface dataset:
int dpagaix(parm1, parm2, parm3, parm4, parm5, parm6)
int parm1;
int parm2;
int parm3;
int parm4;
int parm5;
int parm6;
{ return (kafs_syscall(parm1, parm2, parm3, parm4, parm5, parm6)); }


x86 assembly (clang, -O0):
<dpagaix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    $0x0,%al
call   1030 <kafs_syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dpagaix(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @kafs_syscall to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 %13, i32 %14, i32 %15, i32 %16, i32 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @dpagaix(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @kafs_syscall to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
unsigned int ntohl(int);
int /*<<< orphan*/ stderr;
void traps(void) {
  static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
  unsigned int *p = (unsigned int *)test;
  if (*p != ntohl(0x434f4e46)) {
    fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", *p);
    exit(2);
  }
}


x86 assembly (clang, -O0):
<traps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2ef9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
je     1188 <traps+0x58>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traps>:
push   %rax
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
cmp    $0x464e4f43,%eax
jne    1144 <traps+0x14>
pop    %rax
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    $0x464e4f43,%edx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@traps.test = internal global [5 x i8] c"CONF\00"
@stderr = global i32 0
@.str = [50 x i8] c"fixdep: sizeof(int) != 4 or wrong endianess? %#x\0A\00"
define void @traps() {
%1 = alloca i32*
store i32* bitcast ([5 x i8]* @traps.test to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load i32, i32* %2
%4 = call i32 @ntohl(i32 1129270854)
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = load i32*, i32** %1
%9 = load i32, i32* %8
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 2)
unreachable
12: ; preds = %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"fixdep: sizeof(int) != 4 or wrong endianess? %#x\0A\00"
define void @traps() {
%1 = tail call i32 @ntohl(i32 1129270854)
%2 = icmp eq i32 %1, 1179537219
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 1179537219)
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %0
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int s_list_test_sort(const void *a, const void *b) {
  char *ca = *(char **)a;
  char *cb = *(char **)b;
  return strcmp(ca, cb);
}


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

x86 assembly (clang, -O2):
<s_list_test_sort>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @s_list_test_sort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void dev_puncher_reset(void *dev) {}


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

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

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

LLVM IR (-O2):
define void @dev_puncher_reset(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned long);
void Memcpy(void *dst, void *src, unsigned long len) { memcpy(dst, src, len); }


x86 assembly (clang, -O0):
<Memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Memcpy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @Memcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @Memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int accept(int, struct sockaddr *, unsigned int *);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/,
                          unsigned int);
int g_tcp_accept(int sck) {
  int ret;
  struct sockaddr_in s;
  unsigned int i;
  i = sizeof(struct sockaddr_in);
  memset(&s, 0, i);
  ret = accept(sck, (struct sockaddr *)&s, &i);
  return ret;
}


x86 assembly (clang, -O0):
<g_tcp_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_tcp_accept>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
mov    %r14,%rsi
call   1040 <accept@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @g_tcp_accept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %5
%6 = load i32, i32* %5
%7 = call i32 @memset(%struct.sockaddr_in* %4, i32 0, i32 %6)
%8 = load i32, i32* %2
%9 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%10 = call i32 @accept(i32 %8, %struct.sockaddr* %9, i32* %5)
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @g_tcp_accept(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = call i32 @memset(%struct.sockaddr_in* %2, i32 0, i32 4)
%7 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%8 = call i32 @accept(i32 %0, %struct.sockaddr* %7, i32* %3)
ret i32 %8
}
/* Variables and functions */
int is_dq_empty_impl();
bool is_dq_empty() { return is_dq_empty_impl(); }


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

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

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

LLVM IR (-O2):
define i32 @is_dq_empty() {
%1 = tail call i32 (...) @is_dq_empty_impl()
ret i32 %1
}
void arrCpy(int *a, int *b) {
  while (*a++ = *b++) {
  }
}


x86 assembly (clang, -O0):
<arrCpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %eax,(%rcx)
cmp    $0x0,%eax
je     113c <arrCpy+0x3c>
jmp    110c <arrCpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrCpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rsi,%rax,1),%ecx
mov    %ecx,(%rdi,%rax,1)
add    $0x4,%rax
test   %ecx,%ecx
jne    1110 <arrCpy+0x10>
ret

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

LLVM IR (-O2):
define void @arrCpy(i32* nocapture writeonly %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %0, %2 ], [ %8, %3 ]
%5 = phi i32* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %5
%8 = getelementptr inbounds i32, i32* %4, i64 1
store i32 %7, i32* %4
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ oled_status(char *);
void doOnConnect() { oled_status("-wifi ok"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"-wifi ok\00"
define void @doOnConnect() {
%1 = call i32 @oled_status(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"-wifi ok\00"
define void @doOnConnect() {
%1 = tail call i32 @oled_status(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_input(char *);
int error(void) {
  error_input("");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @error() {
%1 = call i32 @error_input(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @error() {
%1 = tail call i32 @error_input(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, int);
void function() {
  int var = 5;
  static int static_var = 5;
  printf("\t[in function] var @ %p = %d\n", (void *)&var, var);
  printf("\t[in function] static_var @ %p = %d\n", (void *)&static_var,
         static_var);
  var++;
  static_var++;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
lea    -0x4(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ef0(%rip),%edx
lea    0xedf(%rip),%rdi
lea    0x2ee2(%rip),%rsi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    0x2ece(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ec5(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x5,%edx
call   1030 <printf@plt>
mov    0x2ef3(%rip),%edx
lea    0x2eec(%rip),%rsi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
addl   $0x1,0x2ed9(%rip)
pop    %rax
ret

LLVM IR (-O0):
@function.static_var = internal global i32 5
@.str = [30 x i8] c"\09[in function] var @ %p = %d\0A\00"
@.str.1 = [37 x i8] c"\09[in function] static_var @ %p = %d\0A\00"
define void @function() {
%1 = alloca i32
store i32 5, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
%5 = load i32, i32* @function.static_var
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* bitcast (i32* @function.static_var to i8*), i32 %5)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = load i32, i32* @function.static_var
%10 = add nsw i32 %9, 1
store i32 %10, i32* @function.static_var
ret void
}

LLVM IR (-O2):
@function.static_var = internal global i32 5
@.str = [30 x i8] c"\09[in function] var @ %p = %d\0A\00"
@.str.1 = [37 x i8] c"\09[in function] static_var @ %p = %d\0A\00"
define void @function() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %2, i32 5)
%4 = load i32, i32* @function.static_var
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* bitcast (i32* @function.static_var to i8*), i32 %4)
%6 = load i32, i32* @function.static_var
%7 = add nsw i32 %6, 1
store i32 %7, i32* @function.static_var
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int subwindow_mode;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
void set_XGCValues_subwindow_mode(void *_p, int _v) {
  ((XGCValues *)_p)->subwindow_mode = (int)_v;
}


x86 assembly (clang, -O0):
<set_XGCValues_subwindow_mode>:
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_XGCValues_subwindow_mode>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGCValues_subwindow_mode(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_XGCValues_subwindow_mode(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ cgload();
int /*<<< orphan*/ cgshr();
int /*<<< orphan*/ cgswap();
int /*<<< orphan*/ gentext();
void genshr(int swapped) {
  gentext();
  if (cgload() || !swapped)
    cgswap();
  cgshr();
}


x86 assembly (clang, -O0):
<genshr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <gentext@plt>
mov    $0x0,%al
call   1040 <cgload@plt>
cmp    $0x0,%rax
jne    116d <genshr+0x2d>
cmpl   $0x0,-0x4(%rbp)
jne    1174 <genshr+0x34>
mov    $0x0,%al
call   1030 <cgswap@plt>
mov    $0x0,%al
call   1050 <cgshr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genshr>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <gentext@plt>
xor    %eax,%eax
call   1040 <cgload@plt>
test   %ebx,%ebx
je     115a <genshr+0x1a>
test   %rax,%rax
je     1161 <genshr+0x21>
xor    %eax,%eax
call   1030 <cgswap@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <cgshr@plt>

LLVM IR (-O0):
define void @genshr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gentext()
%4 = call i64 (...) @cgload()
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6, %1
%10 = call i32 (...) @cgswap()
br label %11
11: ; preds = %9, %6
%12 = call i32 (...) @cgshr()
ret void
}

LLVM IR (-O2):
define void @genshr(i32 %0) {
%2 = tail call i32 (...) @gentext()
%3 = tail call i64 (...) @cgload()
%4 = icmp eq i64 %3, 0
%5 = icmp ne i32 %0, 0
%6 = and i1 %5, %4
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 (...) @cgswap()
br label %9
9: ; preds = %1, %7
%10 = tail call i32 (...) @cgshr()
ret void
}
int is_ws(char c) { return (c == ' ' || c == '\t' || c == '\n') ? 1 : 0; }


x86 assembly (clang, -O0):
<is_ws>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_ws+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_ws+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ws>:
mov    $0x1,%eax
cmp    $0x9,%dil
je     1111 <is_ws+0x11>
cmp    $0x20,%dil
jne    1112 <is_ws+0x12>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_ws(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_ws(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int cache_invalidate_block_(char const *, int /*<<< orphan*/, int);
int cache_try_invalidate_block(const char *filename, uint32_t block) {
  return cache_invalidate_block_(filename, block, false);
}


x86 assembly (clang, -O0):
<cache_try_invalidate_block>:
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 <cache_invalidate_block_@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cache_try_invalidate_block(i8* %0, i32 %1) {
%3 = tail call i32 @cache_invalidate_block_(i8* %0, i32 %1, i32 0)
ret i32 %3
}
double jac_chain_nm3_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<jac_chain_nm3_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm3_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @jac_chain_nm3_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @jac_chain_nm3_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
int endswith(const char *s, char c) {
  while (*s) {
    s++;
  }
  s--;
  return *s == c;
}


x86 assembly (clang, -O0):
<endswith>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112c <endswith+0x2c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <endswith+0xe>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endswith>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <endswith>
xor    %eax,%eax
cmp    %sil,-0x2(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @endswith(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 -1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %1
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int open(char *, int, int);
int do_open(char *fname, int flags) { return open(fname, flags, 0775); }


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

x86 assembly (clang, -O2):
<do_open>:
mov    $0x1fd,%edx
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @do_open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1, i32 509)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gensym(char const *);
scalar_t__ glob_evalfile(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void *libpd_openfile(const char *basename, const char *dirname) {
  return (void *)glob_evalfile(NULL, gensym(basename), gensym(dirname));
}


x86 assembly (clang, -O0):
<libpd_openfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gensym@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <gensym@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
xor    %eax,%eax
mov    %eax,%edi
call   1040 <glob_evalfile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libpd_openfile>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <gensym@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <gensym@plt>
xor    %edi,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <glob_evalfile@plt>

LLVM IR (-O0):
define i8* @libpd_openfile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @gensym(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @gensym(i8* %7)
%9 = call i64 @glob_evalfile(i32* null, i32 %6, i32 %8)
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @libpd_openfile(i8* %0, i8* %1) {
%3 = tail call i32 @gensym(i8* %0)
%4 = tail call i32 @gensym(i8* %1)
%5 = tail call i64 @glob_evalfile(i32* null, i32 %3, i32 %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
unsigned bit_div7(unsigned num) {
  register unsigned x, y;
  x = (num >> 1) + (num >> 4);
  x += x >> 6;
  x += (x >> 12) + (x >> 24);
  x >>= 2;
  y = num - ((x << 3) - x);
  return x + ((y + 1) >> 3);
}


x86 assembly (clang, -O0):
<bit_div7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0xc,%eax
mov    -0x8(%rbp),%ecx
shr    $0x18,%ecx
add    %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
sub    -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
shr    $0x3,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_div7>:
mov    %edi,%eax
shr    %eax
mov    %edi,%ecx
shr    $0x4,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x6,%eax
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x18,%ecx
add    %eax,%ecx
shr    $0xc,%eax
add    %eax,%ecx
shr    $0x2,%ecx
lea    0x0(,%rcx,8),%eax
mov    %ecx,%edx
sub    %eax,%edx
lea    (%rdi,%rdx,1),%eax
add    $0x1,%eax
shr    $0x3,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bit_div7(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = load i32, i32* %2
%8 = lshr i32 %7, 4
%9 = add i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = lshr i32 %10, 6
%12 = load i32, i32* %3
%13 = add i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = lshr i32 %14, 12
%16 = load i32, i32* %3
%17 = lshr i32 %16, 24
%18 = add i32 %15, %17
%19 = load i32, i32* %3
%20 = add i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %3
%22 = lshr i32 %21, 2
store i32 %22, i32* %3
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = shl i32 %24, 3
%26 = load i32, i32* %3
%27 = sub i32 %25, %26
%28 = sub i32 %23, %27
store i32 %28, i32* %4
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = add i32 %30, 1
%32 = lshr i32 %31, 3
%33 = add i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @bit_div7(i32 %0) {
%2 = lshr i32 %0, 1
%3 = lshr i32 %0, 4
%4 = add nuw i32 %2, %3
%5 = lshr i32 %4, 6
%6 = add nuw i32 %5, %4
%7 = lshr i32 %6, 12
%8 = lshr i32 %6, 24
%9 = add nuw i32 %8, %6
%10 = add nuw i32 %9, %7
%11 = lshr i32 %10, 2
%12 = mul i32 %11, -7
%13 = add i32 %0, 1
%14 = add i32 %13, %12
%15 = lshr i32 %14, 3
%16 = add nuw nsw i32 %15, %11
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ strcmp_test1();
int /*<<< orphan*/ strcmp_test2();
int main() {
  strcmp_test1();
  strcmp_test2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @strcmp_test1()
%2 = tail call i32 (...) @strcmp_test2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ basicFunctionTest();
int main() {
  basicFunctionTest();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @basicFunctionTest()
ret i32 0
}
/* Type definitions */
struct dns_hints {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dns_hints_release(struct dns_hints *);
struct dns_hints *dns_hints_mortal(struct dns_hints *hints) {
  if (hints)
    dns_hints_release(hints);
  return hints;
}


x86 assembly (clang, -O0):
<dns_hints_mortal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <dns_hints_mortal+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <dns_hints_release@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_hints_mortal>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1121 <dns_hints_mortal+0x11>
mov    %rbx,%rdi
call   1030 <dns_hints_release@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.dns_hints = type { i32 }
define %struct.dns_hints* @dns_hints_mortal(%struct.dns_hints* %0) {
%2 = alloca %struct.dns_hints*
store %struct.dns_hints* %0, %struct.dns_hints** %2
%3 = load %struct.dns_hints*, %struct.dns_hints** %2
%4 = icmp ne %struct.dns_hints* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.dns_hints*, %struct.dns_hints** %2
%7 = call i32 @dns_hints_release(%struct.dns_hints* %6)
br label %8
8: ; preds = %5, %1
%9 = load %struct.dns_hints*, %struct.dns_hints** %2
ret %struct.dns_hints* %9
}

LLVM IR (-O2):
%struct.dns_hints = type { i32 }
define %struct.dns_hints* @dns_hints_mortal(%struct.dns_hints* returned %0) {
%2 = icmp eq %struct.dns_hints* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @dns_hints_release(%struct.dns_hints* %0)
br label %5
5: ; preds = %3, %1
ret %struct.dns_hints* %0
}
void objc_msgSend() {
  char *ptr = 0;
  ptr[0] = 0;
}


x86 assembly (clang, -O0):
<objc_msgSend>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @objc_msgSend() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
%3 = getelementptr inbounds i8, i8* %2, i64 0
store i8 0, i8* %3
ret void
}

LLVM IR (-O2):
_Noreturn void f(void) { return; }


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

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

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

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

/* Variables and functions */
unsigned long long const Distance(struct Simhasher const *, unsigned long long,
                                  unsigned long long);
const unsigned long long int distance(const struct Simhasher *segment,
                                      unsigned long long int lhs,
                                      unsigned long long int rhs) {
  return Distance(segment, lhs, rhs);
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <Distance@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
jmp    1030 <Distance@plt>

LLVM IR (-O0):
%struct.Simhasher = type { i32 }
define i64 @distance(%struct.Simhasher* %0, i64 %1, i64 %2) {
%4 = alloca %struct.Simhasher*
%5 = alloca i64
%6 = alloca i64
store %struct.Simhasher* %0, %struct.Simhasher** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load %struct.Simhasher*, %struct.Simhasher** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i64 @Distance(%struct.Simhasher* %7, i64 %8, i64 %9)
ret i64 %10
}

LLVM IR (-O2):
%struct.Simhasher = type { i32 }
define i64 @distance(%struct.Simhasher* %0, i64 %1, i64 %2) {
%4 = tail call i64 @Distance(%struct.Simhasher* %0, i64 %1, i64 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int get_temperature() {
  int temperature = 0;
  printf("Input temperature:\n");
  scanf("%d", &temperature);
  return temperature;
}


x86 assembly (clang, -O0):
<get_temperature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_temperature>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [19 x i8] c"Input temperature:\00"
define i32 @get_temperature() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
float log(float);
float expdev(long *seed) {
  float ran1(long *seed);
  float dum;
  do
    dum = ran1(seed);
  while (dum == 0.0);
  return (-log(dum));
}


x86 assembly (clang, -O0):
<expdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ran1@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115b <expdev+0x3b>
jp     115b <expdev+0x3b>
jmp    112c <expdev+0xc>
movss  -0xc(%rbp),%xmm0
call   1040 <log@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expdev>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <ran1@plt>
ucomiss 0xed1(%rip),%xmm0
jne    1143 <expdev+0x23>
jnp    1130 <expdev+0x10>
call   1040 <log@plt>
xorps  0xeb1(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @expdev(i64* %0) {
%2 = alloca i64*
%3 = alloca float
store i64* %0, i64** %2
br label %4
4: ; preds = %7, %1
%5 = load i64*, i64** %2
%6 = call float @ran1(i64* %5)
store float %6, float* %3
br label %7
7: ; preds = %4
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %4, label %11
11: ; preds = %7
%12 = load float, float* %3
%13 = call float @log(float %12)
%14 = fneg float %13
ret float %14
}

LLVM IR (-O2):
define float @expdev(i64* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call float @ran1(i64* %0)
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call float @log(float %3)
%7 = fneg float %6
ret float %7
}
/* Variables and functions */
int errno;
int rename(char const *, char const *);
int file_rename(const char *src, const char *dst) {
  int res;
  res = rename(src, dst);
  if (res < 0) {
    return errno;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <rename@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    114b <file_rename+0x3b>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <file_rename+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_rename>:
push   %rax
call   1030 <rename@plt>
mov    0x2ec3(%rip),%rcx
sar    $0x1f,%eax
and    (%rcx),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @file_rename(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
%4 = icmp slt i32 %3, 0
%5 = load i32, i32* @errno
%6 = select i1 %4, i32 %5, i32 0
ret i32 %6
}
__attribute__((always_)) void debug_object_init(void *addr,
                                                struct debug_obj_descr *descr) {
}


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

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

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

LLVM IR (-O2):
%struct.debug_obj_descr = type opaque
define void @debug_object_init(i8* nocapture %0, %struct.debug_obj_descr* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logFibonacci(int, unsigned long *, unsigned long *);
unsigned long Fibonacci(int n) {
  unsigned long fn1 = 0;
  unsigned long fn2 = 0;
  if (n % 2 == 0) {
    logFibonacci(n, &fn1, &fn2);
    return fn1;
  } else {
    logFibonacci(n - 1, &fn1, &fn2);
    return fn1 + fn2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115c <Fibonacci+0x4c>
mov    -0xc(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <logFibonacci@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117b <Fibonacci+0x6b>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <logFibonacci@plt>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fibonacci>:
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
test   $0x1,%dil
jne    1145 <Fibonacci+0x35>
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1030 <logFibonacci@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret
add    $0xffffffff,%edi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1030 <logFibonacci@plt>
mov    0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i64 @Fibonacci(i32 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%6 = and i32 %0, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @logFibonacci(i32 %0, i64* %2, i64* %3)
%10 = load i64, i64* %2
br label %17
11: ; preds = %1
%12 = add nsw i32 %0, -1
%13 = call i32 @logFibonacci(i32 %12, i64* %2, i64* %3)
%14 = load i64, i64* %2
%15 = load i64, i64* %3
%16 = add i64 %15, %14
br label %17
17: ; preds = %11, %8
%18 = phi i64 [ %10, %8 ], [ %16, %11 ]
ret i64 %18
}
int main() {
  typedef long long int v __attribute__((vector_size(16)));
  v a, b;
  a = b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movdqa -0x30(%rbp),%xmm0
movdqa %xmm0,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca <2 x i64>
%3 = alloca <2 x i64>
store i32 0, i32* %1
%4 = load <2 x i64>, <2 x i64>* %3
store <2 x i64> %4, <2 x i64>* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int eb_cmd_num_c(const char *str, const char c) {
  const char *p = str;
  int i = 0;
  do {
    if (*p == c)
      i++;
  } while (*(p++));
  return i;
}


x86 assembly (clang, -O0):
<eb_cmd_num_c>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1139 <eb_cmd_num_c+0x39>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113e <eb_cmd_num_c+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmpb   $0x0,(%rax)
jne    111d <eb_cmd_num_c+0x1d>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb_cmd_num_c>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <eb_cmd_num_c+0x10>
ret

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

LLVM IR (-O2):
define i32 @eb_cmd_num_c(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = phi i32 [ 0, %2 ], [ %9, %3 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, %1
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %5, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = icmp eq i8 %6, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i32 %9
}
int main(void) {
  float x = 0;
  x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
%3 = load float, float* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stgwrite(char *);
void defstorage(void) { stgwrite("dump "); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"dump \00"
define void @defstorage() {
%1 = tail call i32 @stgwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void message(void (*func)(int), int times) {
  int j;
  for (j = 0; j < times; ++j)
    func(j);
}


x86 assembly (clang, -O0):
<message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1139 <message+0x39>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%edi
call   *%rax
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <message+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    111c <message+0x1c>
mov    %esi,%ebx
mov    %rdi,%r14
xor    %ebp,%ebp
nop
mov    %ebp,%edi
call   *%r14
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1110 <message+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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