xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((always_)) void nnue_init(const char *fname) {
  (void)fname;
  printf("info string Error: NNUE is disabled for this binary\n");
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"info string Error: NNUE is disabled for this binary\0A\00"
define void @nnue_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"info string Error: NNUE is disabled for this binary\00"
define void @nnue_init(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ has_int_tag(void *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void test_ptr(void *x) {
  printf("Test pointer: x = %p", x);
  assert(!has_int_tag(x));
  printf(": OK\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<test_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <has_int_tag@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ptr>:
push   %rbx
mov    %rdi,%rbx
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <has_int_tag@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
lea    0xe94(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1070 <fflush@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Test pointer: x = %p\00"
@.str.1 = [6 x i8] c": OK\0A\00"
@stdout = global i32 0
define void @test_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @has_int_tag(i8* %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @stdout
%13 = call i32 @fflush(i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Test pointer: x = %p\00"
@stdout = global i32 0
@str = [5 x i8] c": OK\00"
define void @test_ptr(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @has_int_tag(i8* %0)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = tail call i32 @fflush(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void addParam(char *param, char *value) {
  if (strlen(param) < 4) {
    strcat(param, value);
  } else {
    strcat(param, ",");
    strcat(param, value);
  }
}


x86 assembly (clang, -O0):
<addParam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jge    1154 <addParam+0x34>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
jmp    1171 <addParam+0x51>
mov    -0x8(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addParam>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x4,%eax
jl     1143 <addParam+0x23>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c",\00"
define void @addParam(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 @strlen(i8* %5)
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcat(i8* %9, i8* %10)
br label %18
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @strcat(i8* %15, i8* %16)
br label %18
18: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
define void @addParam(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, 4
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = tail call i32 @strcat(i8* %0, i8* %1)
ret void
}
char *langRomTypeBasic() { return "Basic ROM"; }


x86 assembly (clang, -O0):
<langRomTypeBasic>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeBasic>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Basic ROM\00"
define i8* @langRomTypeBasic() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"Basic ROM\00"
define i8* @langRomTypeBasic() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
void *Z_TagMalloc(int, int /*<<< orphan*/);
void *Z_Malloc(int size) { return Z_TagMalloc(size, 0); }


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

x86 assembly (clang, -O2):
<Z_Malloc>:
xor    %esi,%esi
jmp    1030 <Z_TagMalloc@plt>

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

LLVM IR (-O2):
define i8* @Z_Malloc(i32 %0) {
%2 = tail call i8* @Z_TagMalloc(i32 %0, i32 0)
ret i8* %2
}
char set_wall() { return '#'; }


x86 assembly (clang, -O0):
<set_wall>:
push   %rbp
mov    %rsp,%rbp
mov    $0x23,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_wall>:
mov    $0x23,%al
ret

LLVM IR (-O0):
define signext i8 @set_wall() {
ret i8 35
}

LLVM IR (-O2):
define signext i8 @set_wall() {
ret i8 35
}
/* Type definitions */
struct sockaddr_storage {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int idrnet_accept(int sockfd, void *sockaddr) {
  struct sockaddr *addr = (struct sockaddr *)sockaddr;
  socklen_t addr_size = sizeof(struct sockaddr_storage);
  return accept(sockfd, addr, &addr_size);
}


x86 assembly (clang, -O0):
<idrnet_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x4,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <accept@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idrnet_accept>:
push   %rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <accept@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @idrnet_accept(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i8* %1 to %struct.sockaddr*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = call i32 @accept(i32 %0, %struct.sockaddr* %4, i32* %3)
ret i32 %6
}
void *untag_buffer(void *p, int len, int test_mte) {
  (void)len;
  (void)test_mte;
  return p;
}


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

x86 assembly (clang, -O2):
<untag_buffer>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @untag_buffer(i8* readnone returned %0, i32 %1, i32 %2) {
ret i8* %0
}
/* Variables and functions */
long long __negdi2(long long u) {
  union lll {
    long long ll;
    long s[2];
  };
  union lll w, uu;
  uu.ll = u;
  w.s[1] = -uu.s[1];
  w.s[0] = -uu.s[0] - ((int)w.s[1] != 0);
  return w.ll;
}


x86 assembly (clang, -O0):
<__negdi2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
sub    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
sub    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    $0x0,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__negdi2>:
mov    %rdi,%rax
neg    %rax
ret

LLVM IR (-O0):
%union.lll = type { [2 x i64] }
define i64 @__negdi2(i64 %0) {
%2 = alloca i64
%3 = alloca %union.lll
%4 = alloca %union.lll
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = bitcast %union.lll* %4 to i64*
store i64 %5, i64* %6
%7 = bitcast %union.lll* %4 to [2 x i64]*
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 1
%9 = load i64, i64* %8
%10 = sub nsw i64 0, %9
%11 = bitcast %union.lll* %3 to [2 x i64]*
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
store i64 %10, i64* %12
%13 = bitcast %union.lll* %4 to [2 x i64]*
%14 = getelementptr inbounds [2 x i64], [2 x i64]* %13, i64 0, i64 0
%15 = load i64, i64* %14
%16 = sub nsw i64 0, %15
%17 = bitcast %union.lll* %3 to [2 x i64]*
%18 = getelementptr inbounds [2 x i64], [2 x i64]* %17, i64 0, i64 1
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
%23 = sext i32 %22 to i64
%24 = sub nsw i64 %16, %23
%25 = bitcast %union.lll* %3 to [2 x i64]*
%26 = getelementptr inbounds [2 x i64], [2 x i64]* %25, i64 0, i64 0
store i64 %24, i64* %26
%27 = bitcast %union.lll* %3 to i64*
%28 = load i64, i64* %27
ret i64 %28
}

LLVM IR (-O2):
define i64 @__negdi2(i64 %0) {
%2 = sub nsw i64 0, %0
ret i64 %2
}
void fg(int *y) {
  char x;
  asm(""
      : "=@cc"
        "g"(x));
  if (!x)
    *y = 0;
}


x86 assembly (clang, -O0):
<fg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
jne    1122 <fg+0x22>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fg>:
jle    1103 <fg+0x3>
ret
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @fg(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = call i8 asm "", "={@ccg},~{dirflag},~{fpsr},~{flags}"()
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load i32*, i32** %2
store i32 0, i32* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @fg(i32* nocapture writeonly %0) {
%2 = tail call i8 asm "", "={@ccg},~{dirflag},~{fpsr},~{flags}"()
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 0, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int UCHAR_MAX;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo();
int main(void) {
  if (UCHAR_MAX == 255)
    foo();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
cmpl   $0xff,(%rax)
jne    1149 <main+0x29>
mov    $0x0,%al
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
cmpl   $0xff,(%rax)
jne    1137 <main+0x17>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@UCHAR_MAX = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @UCHAR_MAX
%3 = icmp eq i32 %2, 255
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @foo()
br label %6
6: ; preds = %4, %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@UCHAR_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @UCHAR_MAX
%2 = icmp eq i32 %1, 255
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @foo()
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
int _cd30005_1(Value) { return Value + 1; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @_cd30005_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @_cd30005_1(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int main() {
  int a;
  for (a = 0; a < 30; a++)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jge    112f <main+0x2f>
jmp    1121 <main+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
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 i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 30
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void gtk_cell_view_get_size_of_row() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_view_get_size_of_row() {
ret void
}
int test_bit(int nr, const volatile void *vaddr) {
  return ((1UL << (nr & 31)) &
          (((const volatile unsigned int *)vaddr)[nr >> 5])) != 0;
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
sar    $0x5,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
mov    %ecx,%ecx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %edi,%eax
sar    $0x5,%eax
cltq
mov    (%rsi,%rax,4),%ecx
xor    %eax,%eax
bt     %edi,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @test_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 31
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %3
%12 = ashr i32 %11, 5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
%15 = load volatile i32, i32* %14
%16 = zext i32 %15 to i64
%17 = and i64 %8, %16
%18 = icmp ne i64 %17, 0
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i8* %1) {
%3 = and i32 %0, 31
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = bitcast i8* %1 to i32*
%7 = ashr i32 %0, 5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load volatile i32, i32* %9
%11 = zext i32 %10 to i64
%12 = and i64 %5, %11
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ test_bson_generic();
int /*<<< orphan*/ test_bson_iterator();
int main() {
  test_bson_generic();
  test_bson_iterator();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_bson_generic()
%2 = tail call i32 (...) @test_bson_iterator()
ret i32 0
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int number, value;
  printf("Input number: ");
  scanf("%d", &number);
  value = fib(number);
  printf("fibonacci(%d) = %d\n", number, value);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fib@plt>
mov    0x4(%rsp),%esi
lea    0xeae(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Input number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"fibonacci(%d) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 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
%6 = call i32 @fib(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ find(int *, int, int *, int *);
int test_many_elements() {
  int one = 0;
  int two = 0;
  int array[] = {5, 2, 9, 5, 3, 1, 9, 2};
  find(array, 8, &one, &two);
  return 3 == one && 1 == two;
}


x86 assembly (clang, -O0):
<test_many_elements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1030 <find@plt>
xor    %eax,%eax
mov    $0x3,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x31(%rbp)
jne    1189 <test_many_elements+0x79>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_many_elements>:
sub    $0x38,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    $0x8,%esi
call   1030 <find@plt>
mov    0xc(%rsp),%ecx
xor    $0x3,%ecx
mov    0x8(%rsp),%edx
xor    $0x1,%edx
xor    %eax,%eax
or     %ecx,%edx
sete   %al
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.test_many_elements.array = [8 x i32] [i32 5, i32 2, i32 9, i32 5, i32 3, i32 1, i32 9, i32 2]
define i32 @test_many_elements() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @find(i32* %5, i32 8, i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = icmp eq i32 3, %7
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp eq i32 1, %10
br label %12
12: ; preds = %9, %0
%13 = phi i1 [ false, %0 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@__const.test_many_elements.array = [8 x i32] [i32 5, i32 2, i32 9, i32 5, i32 3, i32 1, i32 9, i32 2]
define i32 @test_many_elements() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x i32]
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast [8 x i32]* %3 to i8*
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 @find(i32* %7, i32 8, i32* %1, i32* %2)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 3
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 1
%13 = select i1 %10, i1 %12, i1 false
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int html_string(char *, char *);
scalar_t__ html_tablealign(int);
int html_tableopenrow(int align) {
  int l = html_string("%s", "<TR");
  l += html_tablealign(align);
  l += html_string("%s\n", ">");
  return l;
}


x86 assembly (clang, -O0):
<html_tableopenrow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <html_string@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <html_tablealign@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xea7(%rip),%rsi
call   1030 <html_string@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_tableopenrow>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed4(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <html_string@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <html_tablealign@plt>
mov    %rax,%rbx
add    %ebp,%ebx
lea    0xeba(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <html_string@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"<TR\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [2 x i8] c">\00"
define i32 @html_tableopenrow(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @html_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i64 @html_tablealign(i32 %5)
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = add nsw i64 %8, %6
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
%11 = call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"<TR\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [2 x i8] c">\00"
define i32 @html_tableopenrow(i32 %0) {
%2 = tail call i32 @html_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i64 @html_tablealign(i32 %0)
%4 = trunc i64 %3 to i32
%5 = add i32 %2, %4
%6 = tail call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int f1();
int main() {
  int x;
  x = f1();
  if (x != 15) {
  ERROR:
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
je     1144 <main+0x34>
jmp    1138 <main+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <main+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f1@plt>
xor    %ecx,%ecx
cmp    $0xf,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = icmp ne i32 %1, 15
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
long rand();
long random() { return rand(); }


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

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

LLVM IR (-O0):
define i64 @random() {
%1 = call i64 (...) @rand()
ret i64 %1
}

LLVM IR (-O2):
define i64 @random() {
%1 = tail call i64 (...) @rand()
ret i64 %1
}
float FloatNoSwap(float f) { return f; }


x86 assembly (clang, -O0):
<FloatNoSwap>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @FloatNoSwap(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
ret float %3
}

LLVM IR (-O2):
define float @FloatNoSwap(float returned %0) {
ret float %0
}
void do_alternate_mode_step_by_step(void *data, int cmd) {}


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

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

LLVM IR (-O0):
define void @do_alternate_mode_step_by_step(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @do_alternate_mode_step_by_step(i8* nocapture %0, i32 %1) {
ret void
}
void omap_temp_sensor_resume_idle(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_temp_sensor_resume_idle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ benchmark(char *, char *, char *, int);
void benchmark_simple_request(char *tmpdir, int iter) {
  benchmark("Simple Request", "../clax -n -r . -l /dev/null > /dev/null",
            "GET /\r\n\r\n", iter);
}


x86 assembly (clang, -O0):
<benchmark_simple_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
lea    0xed7(%rip),%rdi
lea    0xedf(%rip),%rsi
lea    0xf01(%rip),%rdx
call   1030 <benchmark@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark_simple_request>:
mov    %esi,%ecx
lea    0xee7(%rip),%rdi
lea    0xeef(%rip),%rsi
lea    0xf11(%rip),%rdx
jmp    1030 <benchmark@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Simple Request\00"
@.str.1 = [41 x i8] c"../clax -n -r . -l /dev/null > /dev/null\00"
@.str.2 = [10 x i8] c"GET /\0D\0A\0D\0A\00"
define void @benchmark_simple_request(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 = call i32 @benchmark(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Simple Request\00"
@.str.1 = [41 x i8] c"../clax -n -r . -l /dev/null > /dev/null\00"
@.str.2 = [10 x i8] c"GET /\0D\0A\0D\0A\00"
define void @benchmark_simple_request(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @benchmark(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
bool nrf_drv_usbd_errata_171(void) { return 1 && true; }


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

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

LLVM IR (-O0):
define i32 @nrf_drv_usbd_errata_171() {
ret i32 1
}

LLVM IR (-O2):
define i32 @nrf_drv_usbd_errata_171() {
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned short height;
};
struct TYPE_4__ {
  TYPE_1__ max_ink_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
void set_XFontSetExtents_max_ink_extent_height(void *_p, unsigned short _v) {
  ((XFontSetExtents *)_p)->max_ink_extent.height = (unsigned short)_v;
}


x86 assembly (clang, -O0):
<set_XFontSetExtents_max_ink_extent_height>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XFontSetExtents_max_ink_extent_height>:
mov    %si,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XFontSetExtents_max_ink_extent_height(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void usage(int status) {
  puts("Usage: biotranslator");
  exit(status);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: biotranslator\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
void mg_allocate_vars(struct All_variables *E) { return; }


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

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

LLVM IR (-O0):
%struct.All_variables = type opaque
define void @mg_allocate_vars(%struct.All_variables* %0) {
%2 = alloca %struct.All_variables*
store %struct.All_variables* %0, %struct.All_variables** %2
ret void
}

LLVM IR (-O2):
%struct.All_variables = type opaque
define void @mg_allocate_vars(%struct.All_variables* nocapture %0) {
ret void
}
ttybin(bin) int bin;
{}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ attoHTTPwrite(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
uint32_t attoHTTPprint(const char *buffer) {
  return attoHTTPwrite((uint8_t *)buffer, strlen(buffer));
}


x86 assembly (clang, -O0):
<attoHTTPprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <attoHTTPwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attoHTTPprint>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <attoHTTPwrite@plt>

LLVM IR (-O0):
define i32 @attoHTTPprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @attoHTTPwrite(i32* %4, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @attoHTTPprint(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @attoHTTPwrite(i32* %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_message_get_errno(void *m) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_get_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_get_errno>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_errno(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_errno(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
int do_412() { return 412; }


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

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

LLVM IR (-O0):
define i32 @do_412() {
ret i32 412
}

LLVM IR (-O2):
define i32 @do_412() {
ret i32 412
}
int genBitCount_unsigned(unsigned v) {
  unsigned c;
  for (c = 0; v; c++)
    v &= v - 1;
  return c;
}


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

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

LLVM IR (-O0):
define i32 @genBitCount_unsigned(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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* %2
%9 = sub i32 %8, 1
%10 = load i32, i32* %2
%11 = and i32 %10, %9
store i32 %11, i32* %2
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @genBitCount_unsigned(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
int wp_hash_table_find_closest_shift(int n) {
  int i;
  for (i = 0; n; i++) {
    n >>= 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<wp_hash_table_find_closest_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <wp_hash_table_find_closest_shift+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <wp_hash_table_find_closest_shift+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wp_hash_table_find_closest_shift>:
xor    %eax,%eax
test   %edi,%edi
je     111c <wp_hash_table_find_closest_shift+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <wp_hash_table_find_closest_shift+0x10>
ret

LLVM IR (-O0):
define i32 @wp_hash_table_find_closest_shift(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 %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = ashr i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @wp_hash_table_find_closest_shift(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
int x43_process_synack(struct mypacket *packet) { return 0; }


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

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

LLVM IR (-O0):
%struct.mypacket = type opaque
define i32 @x43_process_synack(%struct.mypacket* %0) {
%2 = alloca %struct.mypacket*
store %struct.mypacket* %0, %struct.mypacket** %2
ret i32 0
}

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x43_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int memcmp(char *, char *, int);
int __ArrCompare(char *a, char *b, int size) { return memcmp(a, b, size); }


x86 assembly (clang, -O0):
<__ArrCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ArrCompare>:
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @__ArrCompare(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
void *_sbrk(int increment) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @_sbrk(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Sys_FreeClipboardData(char *);
void CL_FreeClipboardData(char *data) { Sys_FreeClipboardData(data); }


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

x86 assembly (clang, -O2):
<CL_FreeClipboardData>:
jmp    1030 <Sys_FreeClipboardData@plt>

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

LLVM IR (-O2):
define void @CL_FreeClipboardData(i8* %0) {
%2 = tail call i32 @Sys_FreeClipboardData(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char Mood[5] = {'f', 'u', 'n', ' ', '\0'};
  char myName[4] = {'I', 'a', 'n', '\0'};
  printf("This is %s now!\n", Mood);
  printf("My name is %s!\n", myName);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0xd(%rbp)
lea    -0x9(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
lea    -0xd(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movb   $0x0,0x10(%rsp)
movl   $0x206e7566,0xc(%rsp)
20
movl   $0x6e6149,0x14(%rsp)
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.Mood = [5 x i8] c"fun \00"
@__const.main.myName = [4 x i8] c"Ian\00"
@.str = [17 x i8] c"This is %s now!\0A\00"
@.str.1 = [16 x i8] c"My name is %s!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [4 x i8]
store i32 0, i32* %1
%4 = bitcast [5 x i8]* %2 to i8*
%5 = bitcast [4 x i8]* %3 to i8*
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.Mood = [5 x i8] c"fun \00"
@.str = [17 x i8] c"This is %s now!\0A\00"
@.str.1 = [16 x i8] c"My name is %s!\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 7233865, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc == 1) {
    fprintf(stderr, "kill: usage: kill [-s sigspec | -n signum | -sigspec] pid "
                    "| jobspec ... or kill -l [sigspec]\n");
    return 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   $0x1,-0x8(%rbp)
jne    1151 <main+0x41>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1158 <main+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x1,%edi
jne    1136 <main+0x26>
push   %rax
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [94 x i8] c"kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]\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 eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [94 x i8] c"kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
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 ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}