xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(void *);
void *thr_fn1(void *arg) {
  printf("in thr_fn1:\n");
  pthread_exit((void *)1);
}


x86 assembly (clang, -O0):
<thr_fn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"in thr_fn1:\0A\00"
define i8* @thr_fn1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i8* inttoptr (i64 1 to i8*))
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@str = [12 x i8] c"in thr_fn1:\00"
define noalias i8* @thr_fn1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i8* inttoptr (i64 1 to i8*))
ret i8* undef
}
/* Variables and functions */
void SetStrings(char **null_ptr, char **const_ptr) {
  *null_ptr = NULL;
  *const_ptr = "Constant";
  return;
}


x86 assembly (clang, -O0):
<SetStrings>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
lea    0xede(%rip),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetStrings>:
movq   $0x0,(%rdi)
lea    0xef2(%rip),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Constant\00"
define void @SetStrings(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
store i8* null, i8** %5
%6 = load i8**, i8*** %4
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %6
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Constant\00"
define void @SetStrings(i8** nocapture writeonly %0, i8** nocapture writeonly %1) {
store i8* null, i8** %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ createPageTable();
int /*<<< orphan*/ enableMMU();
void initMMU(void) {
  createPageTable();
  enableMMU();
  return;
}


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

x86 assembly (clang, -O2):
<initMMU>:
push   %rax
xor    %eax,%eax
call   1040 <createPageTable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <enableMMU@plt>

LLVM IR (-O0):
define void @initMMU() {
%1 = call i32 (...) @createPageTable()
%2 = call i32 (...) @enableMMU()
ret void
}

LLVM IR (-O2):
define void @initMMU() {
%1 = tail call i32 (...) @createPageTable()
%2 = tail call i32 (...) @enableMMU()
ret void
}
int sdb_null(int n, char **p, void *closure) { return 0; }


x86 assembly (clang, -O0):
<sdb_null>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sdb_null(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @sdb_null(i32 %0, i8** nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() { foo(-30); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffe2,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo(i32 -30)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 -30)
ret i32 0
}
int test_imm_E6uint8_mem(unsigned char *val) {
  return ((*val) & (0xE6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E6uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xe6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E6uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -26
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int sgetpid() {
  int pid = syscall(0, 0, 0);
  printf("PID: %d\n", pid);
  return pid;
}


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

x86 assembly (clang, -O2):
<sgetpid>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <syscall@plt>
mov    %eax,%ebx
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"PID: %d\0A\00"
define i32 @sgetpid() {
%1 = tail call i32 @syscall(i32 0, i32 0, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_ptrs(void **ptrs, int n) {
  int i;
  for (i = 0; i < n; ++i)
    free(ptrs[i]);
  free(ptrs);
}


x86 assembly (clang, -O0):
<free_ptrs>:
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    1151 <free_ptrs+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_ptrs+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ptrs>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_ptrs+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_ptrs+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_ptrs(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = bitcast i8** %8 to i8***
%10 = load i8**, i8*** %9
%11 = tail call i32 @free(i8** %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int errno;
int gdbio_errno(void) { return errno; }


x86 assembly (clang, -O0):
<gdbio_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbio_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @gdbio_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @gdbio_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
size_t strnlen(const char *s, size_t maxlen) {
  size_t i = 0;
  while ((i < maxlen) && (s[i] != '\0')) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113c <strnlen+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <strnlen+0x4c>
jmp    115d <strnlen+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ bladerf_log_set_verbosity(int);
int get_loglevel();
void __attribute__((constructor)) __bladerf_init(void) {
  int log_level = get_loglevel();
  bladerf_log_set_verbosity(log_level);
  do {
    do {
    } while (0);
  } while (0);
}


x86 assembly (clang, -O0):
<__bladerf_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_loglevel@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bladerf_log_set_verbosity@plt>
jmp    113f <__bladerf_init+0x1f>
jmp    1144 <__bladerf_init+0x24>
jmp    1149 <__bladerf_init+0x29>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__bladerf_init, i8* null }]
define void @__bladerf_init() {
%1 = alloca i32
%2 = call i32 (...) @get_loglevel()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @bladerf_log_set_verbosity(i32 %3)
br label %5
5: ; preds = %0
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__bladerf_init, i8* null }]
define void @__bladerf_init() {
%1 = tail call i32 (...) @get_loglevel()
%2 = tail call i32 @bladerf_log_set_verbosity(i32 %1)
ret void
}
const char *ls_costN_nm10_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_costN_nm10_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_costN_nm10_name_out+0x2b>
jmp    111a <ls_costN_nm10_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_costN_nm10_name_out+0x3b>
jmp    114b <ls_costN_nm10_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_costN_nm10_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_costN_nm10_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm10_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_costN_nm10_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_costN_nm10_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void function(char *str) {
  char buffer[16];
  strcpy(buffer, str);
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
sub    $0x18,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @function(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @function(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}
/* Variables and functions */
int get_data_int();
int /*<<< orphan*/ send_int_to_srv(int);
int get_server_plist_serial() {
  send_int_to_srv(0x2b);
  return get_data_int();
}


x86 assembly (clang, -O0):
<get_server_plist_serial>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x0,%al
call   1040 <get_data_int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_server_plist_serial>:
push   %rax
mov    $0x2b,%edi
call   1030 <send_int_to_srv@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <get_data_int@plt>

LLVM IR (-O0):
define i32 @get_server_plist_serial() {
%1 = call i32 @send_int_to_srv(i32 43)
%2 = call i32 (...) @get_data_int()
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_server_plist_serial() {
%1 = tail call i32 @send_int_to_srv(i32 43)
%2 = tail call i32 (...) @get_data_int()
ret i32 %2
}
void in_def_get_def_binds(int *binds) {}


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

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

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

LLVM IR (-O2):
define void @in_def_get_def_binds(i32* nocapture %0) {
ret void
}
void event_init() { return; }


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

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

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

LLVM IR (-O2):
define void @event_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgincglob(char *, char *, int);
void cgincgb(char *s) { cgincglob("add", s, 1); }


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

x86 assembly (clang, -O2):
<cgincgb>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
mov    $0x1,%edx
jmp    1030 <cgincglob@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"add\00"
define void @cgincgb(i8* %0) {
%2 = tail call i32 @cgincglob(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void show_version(int exit_after) {
  puts("This is ACME, release "
       "0.96.4"
       " (\""
       "Fenchurch"
       "\"), "
       "1 Feb"
       " "
       "2019"
       "\n"
       "  "
       "Platform independent version.");
  if (exit_after)
    exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,-0x4(%rbp)
je     114f <show_version+0x2f>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_version>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
jne    1135 <show_version+0x15>
pop    %rbx
ret
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [87 x i8] c"This is ACME, release 0.96.4 (\22Fenchurch\22), 1 Feb 2019\0A Platform independent version.\00"
@EXIT_SUCCESS = global i32 0
define void @show_version(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [87 x i8] c"This is ACME, release 0.96.4 (\22Fenchurch\22), 1 Feb 2019\0A Platform independent version.\00"
@EXIT_SUCCESS = global i32 0
define void @show_version(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
struct mailimf_body {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mailimf_body *);
void mailimf_body_free(struct mailimf_body *body) { free(body); }


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

x86 assembly (clang, -O2):
<mailimf_body_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.mailimf_body = type { i32 }
define void @mailimf_body_free(%struct.mailimf_body* nocapture %0) {
%2 = tail call i32 @free(%struct.mailimf_body* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *user_agent() {
  static char ret[100];
  sprintf(ret, "GTimer/%s", "2.0.0");
  return (ret);
}


x86 assembly (clang, -O0):
<user_agent>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
lea    0xee1(%rip),%rdx
call   1030 <sprintf@plt>
lea    0x2f0b(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_agent>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
lea    0xee4(%rip),%rdx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@user_agent.ret = internal global [100 x i8] zeroinitializer
@.str = [10 x i8] c"GTimer/%s\00"
@.str.1 = [6 x i8] c"2.0.0\00"
define i8* @user_agent() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @user_agent.ret, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @user_agent.ret, i64 0, i64 0)
}

LLVM IR (-O2):
@user_agent.ret = internal global [100 x i8] zeroinitializer
@.str = [10 x i8] c"GTimer/%s\00"
@.str.1 = [6 x i8] c"2.0.0\00"
define i8* @user_agent() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @user_agent.ret, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @user_agent.ret, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int bfd_INIT() {
  printf("BFD in INIT state");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"BFD in INIT state\00"
define i32 @bfd_INIT() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"BFD in INIT state\00"
define i32 @bfd_INIT() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int test_card(int);
int main(int argc, char **argv) {
  int card = 0, numcards;
  do
    numcards = test_card(card);
  while (++card < numcards);
  return numcards < 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <test_card@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    -0x18(%rbp),%eax
jl     112d <main+0x1d>
cmpl   $0x0,-0x18(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <test_card@plt>
add    $0x1,%ebx
cmp    %eax,%ebx
jl     1120 <main+0x10>
shr    $0x1f,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @test_card(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp slt i32 %6, %5
br i1 %7, label %3, label %8
8: ; preds = %3
%9 = lshr i32 %5, 31
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_list();
int main(int argc, char *argv[]) {
  printf("Beginning tests...\n");
  test_list();
  printf("All tests completed.\n");
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Beginning tests...\0A\00"
@.str.1 = [22 x i8] c"All tests completed.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @test_list()
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Beginning tests...\00"
@str.2 = [21 x i8] c"All tests completed.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test_list()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int nn_xsurveyor_ispeer(int socktype) {
  return socktype == (6 * 16 + 1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<nn_xsurveyor_ispeer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x61,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_xsurveyor_ispeer>:
xor    %eax,%eax
cmp    $0x61,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @nn_xsurveyor_ispeer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 97
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @nn_xsurveyor_ispeer(i32 %0) {
%2 = icmp eq i32 %0, 97
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int *acc_deviceptr(int *);
int main(int argc, char *argv[]) {
  int x[1024], *xp2;
#pragma acc data copyin(x [0:N])
  {
    int *xp;
#pragma acc host_data use_device(x)
    {
#pragma acc data
      { xp = x; }
      xp2 = x;
    }
    if (xp != acc_deviceptr(x) || xp2 != xp)
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1030,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1020(%rbp)
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1018(%rbp)
mov    -0x1020(%rbp),%rax
mov    %rax,-0x1028(%rbp)
lea    -0x1010(%rbp),%rdi
call   1040 <acc_deviceptr@plt>
mov    %rax,%rcx
mov    -0x1028(%rbp),%rax
cmp    %rcx,%rax
jne    1196 <main+0x76>
mov    -0x1018(%rbp),%rax
cmp    -0x1020(%rbp),%rax
je     119d <main+0x7d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x1030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1000,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <acc_deviceptr@plt>
cmp    %rax,%rbx
jne    1143 <main+0x23>
xor    %eax,%eax
add    $0x1000,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i32]
%7 = alloca i32*
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [1024 x i32], [1024 x i32]* %6, i64 0, i64 0
store i32* %9, i32** %8
%10 = getelementptr inbounds [1024 x i32], [1024 x i32]* %6, i64 0, i64 0
store i32* %10, i32** %7
%11 = load i32*, i32** %8
%12 = getelementptr inbounds [1024 x i32], [1024 x i32]* %6, i64 0, i64 0
%13 = call i32* @acc_deviceptr(i32* %12)
%14 = icmp ne i32* %11, %13
br i1 %14, label %19, label %15
15: ; preds = %2
%16 = load i32*, i32** %7
%17 = load i32*, i32** %8
%18 = icmp ne i32* %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15, %2
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i32]
%4 = bitcast [1024 x i32]* %3 to i8*
%5 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 0
%6 = call i32* @acc_deviceptr(i32* %5)
%7 = icmp eq i32* %5, %6
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void __attribute__((noreturn)) exit(int status) {
  (void)(status);
  panic("exit()");
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <panic@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <panic@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"exit()\00"
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @panic(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"exit()\00"
define void @exit(i32 %0) {
%2 = tail call i32 @panic(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
int PAPI_epc(int, float *, float *, long long *, long long *, long long *,
             float *);
void papif_epc_(int event, float *rtime, float *ptime, long long *ref,
                long long *core, long long *evt, float *epc, int *check) {
  *check = PAPI_epc(event, rtime, ptime, ref, core, evt, epc);
}


x86 assembly (clang, -O0):
<papif_epc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <PAPI_epc@plt>
mov    %eax,%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_epc_>:
push   %rbx
sub    $0x10,%rsp
mov    0x28(%rsp),%rbx
mov    0x20(%rsp),%rax
mov    %rax,(%rsp)
call   1030 <PAPI_epc@plt>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_epc_(i32 %0, float* %1, float* %2, i64* %3, i64* %4, i64* %5, float* %6, i32* %7) {
%9 = alloca i32
%10 = alloca float*
%11 = alloca float*
%12 = alloca i64*
%13 = alloca i64*
%14 = alloca i64*
%15 = alloca float*
%16 = alloca i32*
store i32 %0, i32* %9
store float* %1, float** %10
store float* %2, float** %11
store i64* %3, i64** %12
store i64* %4, i64** %13
store i64* %5, i64** %14
store float* %6, float** %15
store i32* %7, i32** %16
%17 = load i32, i32* %9
%18 = load float*, float** %10
%19 = load float*, float** %11
%20 = load i64*, i64** %12
%21 = load i64*, i64** %13
%22 = load i64*, i64** %14
%23 = load float*, float** %15
%24 = call i32 @PAPI_epc(i32 %17, float* %18, float* %19, i64* %20, i64* %21, i64* %22, float* %23)
%25 = load i32*, i32** %16
store i32 %24, i32* %25
ret void
}

LLVM IR (-O2):
define void @papif_epc_(i32 %0, float* %1, float* %2, i64* %3, i64* %4, i64* %5, float* %6, i32* nocapture writeonly %7) {
%9 = tail call i32 @PAPI_epc(i32 %0, float* %1, float* %2, i64* %3, i64* %4, i64* %5, float* %6)
store i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tcsendbreak(int /*<<< orphan*/, int /*<<< orphan*/);
void break_sequence(void) { tcsendbreak(0, 0); }


x86 assembly (clang, -O0):
<break_sequence>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <tcsendbreak@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<break_sequence>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <tcsendbreak@plt>

LLVM IR (-O0):
define void @break_sequence() {
%1 = call i32 @tcsendbreak(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @break_sequence() {
%1 = tail call i32 @tcsendbreak(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_linux_file_name(char *);
int /*<<< orphan*/ tcp_veno_register();
void module_register(void) {
  tcp_veno_register();
  set_linux_file_name("tcp_veno.c");
}


x86 assembly (clang, -O0):
<module_register>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <tcp_veno_register@plt>
lea    0xece(%rip),%rdi
call   1040 <set_linux_file_name@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_register>:
push   %rax
xor    %eax,%eax
call   1030 <tcp_veno_register@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <set_linux_file_name@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"tcp_veno.c\00"
define void @module_register() {
%1 = call i32 (...) @tcp_veno_register()
%2 = call i32 @set_linux_file_name(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"tcp_veno.c\00"
define void @module_register() {
%1 = tail call i32 (...) @tcp_veno_register()
%2 = tail call i32 @set_linux_file_name(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
int array1() {
  int a[10];
  a[0] = 0;
  return a[2];
}


x86 assembly (clang, -O0):
<array1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x30(%rbp)
mov    -0x28(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @array1() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32 0, i32* %2
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @array1() {
ret i32 undef
}
/* Variables and functions */
long rul__conrg_get_cur_block_index();
int /*<<< orphan*/ sprintf(char *, char *, char *, long, long);
char *make_an_rhs_func_name(long rule_index) {
  static char buffer[50];
  long bl_num;
  bl_num = rul__conrg_get_cur_block_index();
  sprintf(buffer, "%s%ld_rule_%ld", "rul_", bl_num, rule_index);
  return (buffer);
}


x86 assembly (clang, -O0):
<make_an_rhs_func_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rul__conrg_get_cur_block_index@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0x2efa(%rip),%rdi
lea    0xeb3(%rip),%rsi
lea    0xebb(%rip),%rdx
call   1040 <sprintf@plt>
lea    0x2ee0(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_an_rhs_func_name>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rul__conrg_get_cur_block_index@plt>
lea    0x2f0b(%rip),%r14
lea    0xec4(%rip),%rsi
lea    0xecc(%rip),%rdx
mov    %r14,%rdi
mov    %rax,%rcx
mov    %rbx,%r8
call   1040 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@make_an_rhs_func_name.buffer = internal global [50 x i8] zeroinitializer
@.str = [15 x i8] c"%s%ld_rule_%ld\00"
@.str.1 = [5 x i8] c"rul_\00"
define i8* @make_an_rhs_func_name(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i64 (...) @rul__conrg_get_cur_block_index()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = call i32 @sprintf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @make_an_rhs_func_name.buffer, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %5, i64 %6)
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @make_an_rhs_func_name.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@make_an_rhs_func_name.buffer = internal global [50 x i8] zeroinitializer
@.str = [15 x i8] c"%s%ld_rule_%ld\00"
@.str.1 = [5 x i8] c"rul_\00"
define i8* @make_an_rhs_func_name(i64 %0) {
%2 = tail call i64 (...) @rul__conrg_get_cur_block_index()
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @make_an_rhs_func_name.buffer, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %2, i64 %0)
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @make_an_rhs_func_name.buffer, i64 0, i64 0)
}
int bitcount(unsigned x) {
  int b;
  for (b = 0; x != 0; x &= (x - 1))
    ++b;
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ dump(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc < 2)
    fprintf(stderr, "\nUsage: viewer file.bk\n");
  else
    dump(argv[1]);
  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)
cmpl   $0x2,-0x8(%rbp)
jge    115a <main+0x3a>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1167 <main+0x47>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <dump@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     113d <main+0x1d>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1146 <main+0x26>
mov    0x8(%rsi),%rdi
call   1030 <dump@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"\0AUsage: viewer file.bk\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @dump(i8* %14)
br label %16
16: ; preds = %11, %8
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"\0AUsage: viewer file.bk\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @dump(i8* %9)
br label %11
11: ; preds = %7, %4
ret i32 0
}
/* Variables and functions */
char *_strpbrk(char *, char *);
int /*<<< orphan*/ printf(char *, char);
int main() {
  char *s1 = "12g";
  char *s2 = "iphone 7g";
  char *c = _strpbrk(s1, s2);
  printf("%c\n", *c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <_strpbrk@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
lea    0xead(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1040 <_strpbrk@plt>
movsbl (%rax),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"12g\00"
@.str.1 = [10 x i8] c"iphone 7g\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i8* @_strpbrk(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = load i8, i8* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext %2)
ret i32 0
}
void act_neural_update(const struct XCSF *xcsf, const struct Cl *c,
                       const double *x, const double *y) {
  (void)xcsf;
  (void)c;
  (void)x;
  (void)y;
}


x86 assembly (clang, -O0):
<act_neural_update>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @act_neural_update(%struct.XCSF* %0, %struct.Cl* %1, double* %2, double* %3) {
%5 = alloca %struct.XCSF*
%6 = alloca %struct.Cl*
%7 = alloca double*
%8 = alloca double*
store %struct.XCSF* %0, %struct.XCSF** %5
store %struct.Cl* %1, %struct.Cl** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load %struct.XCSF*, %struct.XCSF** %5
%10 = load %struct.Cl*, %struct.Cl** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @act_neural_update(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, double* nocapture %2, double* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func_proc();
int /*<<< orphan*/ struct_dec();
int /*<<< orphan*/ var_dcl();
int yyselect();
program_parts() {
  switch (yyselect()) {
  case 3: {
    var_dcl();
  } break;
  case 4: {
    func_proc();
  } break;
  case 5: {
    struct_dec();
  } break;
  }
}


x86 assembly (clang, -O0):
<program_parts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x3,%eax
je     1184 <program_parts+0x44>
jmp    1162 <program_parts+0x22>
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
je     1190 <program_parts+0x50>
jmp    1173 <program_parts+0x33>
mov    -0x8(%rbp),%eax
sub    $0x5,%eax
je     119c <program_parts+0x5c>
jmp    11a3 <program_parts+0x63>
mov    $0x0,%al
call   1030 <var_dcl@plt>
jmp    11a3 <program_parts+0x63>
mov    $0x0,%al
call   1060 <func_proc@plt>
jmp    11a3 <program_parts+0x63>
mov    $0x0,%al
call   1040 <struct_dec@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<program_parts>:
push   %rax
xor    %eax,%eax
call   1050 <yyselect@plt>
cmp    $0x5,%eax
je     1160 <program_parts+0x20>
cmp    $0x4,%eax
je     1169 <program_parts+0x29>
cmp    $0x3,%eax
jne    1167 <program_parts+0x27>
xor    %eax,%eax
call   1030 <var_dcl@plt>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <struct_dec@plt>
pop    %rcx
ret
xor    %eax,%eax
call   1060 <func_proc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @program_parts() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %9 [
i32 3, label %3
i32 4, label %5
i32 5, label %7
]
3: ; preds = %0
%4 = call i32 (...) @var_dcl()
br label %9
5: ; preds = %0
%6 = call i32 (...) @func_proc()
br label %9
7: ; preds = %0
%8 = call i32 (...) @struct_dec()
br label %9
9: ; preds = %0, %7, %5, %3
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @program_parts() {
%1 = tail call i32 (...) @yyselect()
switch i32 %1, label %8 [
i32 3, label %2
i32 4, label %4
i32 5, label %6
]
2: ; preds = %0
%3 = tail call i32 (...) @var_dcl()
br label %8
4: ; preds = %0
%5 = tail call i32 (...) @func_proc()
br label %8
6: ; preds = %0
%7 = tail call i32 (...) @struct_dec()
br label %8
8: ; preds = %0, %6, %4, %2
ret i32 undef
}