xunge/DecIR huggingface dataset:
int type_subst(int prim, int second) {
  if (!(prim & (0x04 | 0x02 | 0x01)))
    prim |= (second & (0x04 | 0x02 | 0x01));
  if (!(prim & (0x80 | 0x40 | 0x100)))
    prim |= (second & (0x80 | 0x40 | 0x100));
  if (!(prim & (0x20 | 0x10 | 0x08)))
    prim |= (second & (0x20 | 0x10 | 0x08));
  return prim;
}


x86 assembly (clang, -O0):
<type_subst>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
cmp    $0x0,%eax
jne    1125 <type_subst+0x25>
mov    -0x8(%rbp),%eax
and    $0x7,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1c0,%eax
cmp    $0x0,%eax
jne    1144 <type_subst+0x44>
mov    -0x8(%rbp),%eax
and    $0x1c0,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x38,%eax
cmp    $0x0,%eax
jne    115f <type_subst+0x5f>
mov    -0x8(%rbp),%eax
and    $0x38,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_subst>:
mov    %esi,%ecx
and    $0x7,%ecx
xor    %eax,%eax
test   $0x7,%dil
cmovne %eax,%ecx
or     %edi,%ecx
mov    %esi,%edx
and    $0x1c0,%edx
test   $0x1c0,%edi
cmovne %eax,%edx
and    $0x38,%esi
test   $0x38,%dil
cmove  %esi,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @type_subst(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 7
%7 = icmp ne i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = and i32 %9, 7
%11 = load i32, i32* %3
%12 = or i32 %11, %10
store i32 %12, i32* %3
br label %13
13: ; preds = %8, %2
%14 = load i32, i32* %3
%15 = and i32 %14, 448
%16 = icmp ne i32 %15, 0
br i1 %16, label %22, label %17
17: ; preds = %13
%18 = load i32, i32* %4
%19 = and i32 %18, 448
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
br label %22
22: ; preds = %17, %13
%23 = load i32, i32* %3
%24 = and i32 %23, 56
%25 = icmp ne i32 %24, 0
br i1 %25, label %31, label %26
26: ; preds = %22
%27 = load i32, i32* %4
%28 = and i32 %27, 56
%29 = load i32, i32* %3
%30 = or i32 %29, %28
store i32 %30, i32* %3
br label %31
31: ; preds = %26, %22
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @type_subst(i32 %0, i32 %1) {
%3 = and i32 %0, 7
%4 = icmp eq i32 %3, 0
%5 = and i32 %1, 7
%6 = select i1 %4, i32 %5, i32 0
%7 = or i32 %6, %0
%8 = and i32 %0, 448
%9 = icmp eq i32 %8, 0
%10 = and i32 %1, 448
%11 = select i1 %9, i32 %10, i32 0
%12 = or i32 %7, %11
%13 = and i32 %0, 56
%14 = icmp eq i32 %13, 0
%15 = and i32 %1, 56
%16 = select i1 %14, i32 %15, i32 0
%17 = or i32 %12, %16
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ pb_is_little_endian();
bool pb_is_big_endian() { return !pb_is_little_endian(); }


x86 assembly (clang, -O0):
<pb_is_big_endian>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pb_is_little_endian@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pb_is_big_endian>:
push   %rax
xor    %eax,%eax
call   1030 <pb_is_little_endian@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pb_is_big_endian() {
%1 = call i32 (...) @pb_is_little_endian()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @pb_is_big_endian() {
%1 = tail call i32 (...) @pb_is_little_endian()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int exposed_function() { return 42; }


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

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

LLVM IR (-O0):
define i32 @exposed_function() {
ret i32 42
}

LLVM IR (-O2):
define i32 @exposed_function() {
ret i32 42
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ EVP_MD_CTX_md_data(int /*<<< orphan*/ *);
int SHA256_Final(unsigned char *, int /*<<< orphan*/);
int final256(EVP_MD_CTX *ctx, unsigned char *md) {
  return SHA256_Final(md, EVP_MD_CTX_md_data(ctx));
}


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

x86 assembly (clang, -O2):
<final256>:
push   %rbx
mov    %rsi,%rbx
call   1030 <EVP_MD_CTX_md_data@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <SHA256_Final@plt>

LLVM IR (-O0):
define i32 @final256(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32*, i32** %3
%7 = call i32 @EVP_MD_CTX_md_data(i32* %6)
%8 = call i32 @SHA256_Final(i8* %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @final256(i32* %0, i8* %1) {
%3 = tail call i32 @EVP_MD_CTX_md_data(i32* %0)
%4 = tail call i32 @SHA256_Final(i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
struct cli_def {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cli_print(struct cli_def *, char *, char const *);
int hook_help(struct cli_def *cli, const char *command, char *argv[],
              int argc) {
  cli_print(cli, "Hook (help): %s", command);
  return 0;
}


x86 assembly (clang, -O0):
<hook_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeca(%rip),%rsi
call   1030 <cli_print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hook_help>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <cli_print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cli_def = type { i32 }
@.str = [16 x i8] c"Hook (help): %s\00"
define i32 @hook_help(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca %struct.cli_def*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
store %struct.cli_def* %0, %struct.cli_def** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load %struct.cli_def*, %struct.cli_def** %5
%10 = load i8*, i8** %6
%11 = call i32 @cli_print(%struct.cli_def* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
@.str = [16 x i8] c"Hook (help): %s\00"
define i32 @hook_help(%struct.cli_def* %0, i8* %1, i8** nocapture readnone %2, i32 %3) {
%5 = tail call i32 @cli_print(%struct.cli_def* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ insertion_sort(int *, int);
int main() {
  int array[] = {0, 1, 2, -1, 4, 2, 3};
  insertion_sort(array, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1030 <insertion_sort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <insertion_sort@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [7 x i32] [i32 0, i32 1, i32 2, i32 -1, i32 4, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
store i32 0, i32* %1
%3 = bitcast [7 x i32]* %2 to i8*
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%5 = call i32 @insertion_sort(i32* %4, i32 7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [7 x i32] [i32 0, i32 1, i32 2, i32 -1, i32 4, i32 2, i32 3]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @insertion_sort(i32* %3, i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_blob_to_node();
int /*<<< orphan*/ test_double_to_node();
int /*<<< orphan*/ test_integer_to_node();
int /*<<< orphan*/ test_node_equals();
int /*<<< orphan*/ test_node_from_string();
int /*<<< orphan*/ test_node_from_substring();
int /*<<< orphan*/ test_string_to_double();
int main(void) {
  test_string_to_double();
  test_double_to_node();
  test_integer_to_node();
  test_blob_to_node();
  test_node_equals();
  test_node_from_string();
  test_node_from_substring();
  printf("Success\n");
  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_string_to_double@plt>
mov    $0x0,%al
call   1050 <test_double_to_node@plt>
mov    $0x0,%al
call   1070 <test_integer_to_node@plt>
mov    $0x0,%al
call   1030 <test_blob_to_node@plt>
mov    $0x0,%al
call   1090 <test_node_equals@plt>
mov    $0x0,%al
call   10a0 <test_node_from_string@plt>
mov    $0x0,%al
call   1080 <test_node_from_substring@plt>
lea    0xe39(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_string_to_double@plt>
xor    %eax,%eax
call   1050 <test_double_to_node@plt>
xor    %eax,%eax
call   1070 <test_integer_to_node@plt>
xor    %eax,%eax
call   1030 <test_blob_to_node@plt>
xor    %eax,%eax
call   1090 <test_node_equals@plt>
xor    %eax,%eax
call   10a0 <test_node_from_string@plt>
xor    %eax,%eax
call   1080 <test_node_from_substring@plt>
lea    0xe47(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_string_to_double()
%3 = call i32 (...) @test_double_to_node()
%4 = call i32 (...) @test_integer_to_node()
%5 = call i32 (...) @test_blob_to_node()
%6 = call i32 (...) @test_node_equals()
%7 = call i32 (...) @test_node_from_string()
%8 = call i32 (...) @test_node_from_substring()
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 (...) @test_string_to_double()
%2 = tail call i32 (...) @test_double_to_node()
%3 = tail call i32 (...) @test_integer_to_node()
%4 = tail call i32 (...) @test_blob_to_node()
%5 = tail call i32 (...) @test_node_equals()
%6 = tail call i32 (...) @test_node_from_string()
%7 = tail call i32 (...) @test_node_from_substring()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void sme_event_auth_timed_out(struct wpa_supplicant *wpa_s,
                              union wpa_event_data *data) {}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%union.wpa_event_data = type opaque
define void @sme_event_auth_timed_out(%struct.wpa_supplicant* %0, %union.wpa_event_data* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %union.wpa_event_data*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %union.wpa_event_data* %1, %union.wpa_event_data** %4
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%union.wpa_event_data = type opaque
define void @sme_event_auth_timed_out(%struct.wpa_supplicant* nocapture %0, %union.wpa_event_data* nocapture %1) {
ret void
}
int f(a, b)
int a;
char b;
{ return (a + b); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
movsbl -0x5(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movsbl %sil,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = trunc i32 %1 to i8
store i32 %0, i32* %3
store i8 %5, i8* %4
%6 = load i32, i32* %3
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char const *, int /*<<< orphan*/);
void *memory_alloc(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int plog_cache(const char *log) {
  void *begin;
  begin = memory_alloc(strlen(log));
  memcpy(begin, log, strlen(log));
  return 0;
}


x86 assembly (clang, -O0):
<plog_cache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1040 <memory_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1050 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plog_cache>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%edi
call   1040 <memory_alloc@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <memcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @plog_cache(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @memory_alloc(i32 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = load i8*, i8** %2
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @memcpy(i8* %7, i8* %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @plog_cache(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @memory_alloc(i32 %2)
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %4)
ret i32 0
}
void gtk_paint_layout() {}


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

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

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

LLVM IR (-O2):
define void @gtk_paint_layout() {
ret void
}
int Operand_uimm16x4_decode(unsigned int *valp) {
  unsigned uimm16x4_0, imm16_0;
  imm16_0 = *valp & 0xffff;
  uimm16x4_0 = (((0xffff) << 16) | imm16_0) << 2;
  *valp = uimm16x4_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_uimm16x4_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     $0xffff0000,%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_uimm16x4_decode>:
mov    (%rdi),%eax
shl    $0x2,%eax
or     $0xfffc0000,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_uimm16x4_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 65535
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = or i32 -65536, %8
%10 = shl i32 %9, 2
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32*, i32** %2
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_uimm16x4_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 2
%4 = or i32 %3, -262144
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
int snprintf(char *, int, char *, double);
int real2str(char *str, double num) {
  int n;
  n = snprintf(str, 20, "+%.5e", num);
  return n == 20 + 1;
}


x86 assembly (clang, -O0):
<real2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    $0x14,%esi
lea    0xeca(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x15,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real2str>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x14,%esi
call   1030 <snprintf@plt>
xor    %ecx,%ecx
cmp    $0x15,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"+%.5e\00"
define i32 @real2str(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca i32
store i8* %0, i8** %3
store double %1, double* %4
%6 = load i8*, i8** %3
%7 = load double, double* %4
%8 = call i32 @snprintf(i8* %6, i32 20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 21
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"+%.5e\00"
define i32 @real2str(i8* %0, double %1) {
%3 = tail call i32 @snprintf(i8* %0, i32 20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %1)
%4 = icmp eq i32 %3, 21
%5 = zext i1 %4 to i32
ret i32 %5
}
void tpm_bios_log_teardown(struct dentry **dir) {}


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define void @tpm_bios_log_teardown(%struct.dentry** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void foo(int *p) {
l1:
  printf("%d, %d\n", p[0], p[1]);
}


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

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define void @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *lcec_zalloc(size_t size) {
  void *p = malloc(size);
  if (p)
    memset(p, 0, size);
  return p;
}


x86 assembly (clang, -O0):
<lcec_zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <lcec_zalloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcec_zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <lcec_zalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @lcec_zalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i64, i64* %2
%11 = call i32 @memset(i8* %9, i32 0, i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @lcec_zalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, I'm in dir1\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hello, I'm in dir1\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 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello, I'm in dir1\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))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_sub_ss(__m128 A, __m128 B) { return _mm_sub_ss(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_sub_ss>:
jmp    1030 <_mm_sub_ss@plt>

LLVM IR (-O0):
define i32 @test_mm_sub_ss(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_sub_ss(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_sub_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sub_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bsd_htonl(uint32_t a) {
  return (((uint32_t)((((((uint32_t)a) & 0xff) << 24) |
                       (((((uint32_t)a) >> 8) & 0xff) << 16) |
                       (((((uint32_t)a) >> 16) & 0xff) << 8) |
                       (((((uint32_t)a) >> 24) & 0xff))))));
}


x86 assembly (clang, -O0):
<bsd_htonl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsd_htonl>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @bsd_htonl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = shl i32 %8, 16
%10 = or i32 %5, %9
%11 = load i32, i32* %2
%12 = ashr i32 %11, 16
%13 = and i32 %12, 255
%14 = shl i32 %13, 8
%15 = or i32 %10, %14
%16 = load i32, i32* %2
%17 = ashr i32 %16, 24
%18 = and i32 %17, 255
%19 = or i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @bsd_htonl(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XDestroyIC() {
  printf("XDestroyIC called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"XDestroyIC called\00"
define i32 @XDestroyIC() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
const char *module_address_lookup(unsigned long addr, unsigned long *symbolsize,
                                  unsigned long *offset, char **modname,
                                  char *namebuf) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
define i8* @module_address_lookup(i64 %0, i64* %1, i64* %2, i8** %3, i8* %4) {
%6 = alloca i64
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i8**
%10 = alloca i8*
store i64 %0, i64* %6
store i64* %1, i64** %7
store i64* %2, i64** %8
store i8** %3, i8*** %9
store i8* %4, i8** %10
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @module_address_lookup(i64 %0, i64* nocapture readnone %1, i64* nocapture readnone %2, i8** nocapture readnone %3, i8* nocapture readnone %4) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ TestJ();
int main() {
  TestJ();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @TestJ()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  double i;
  for (i = 0; i != 10; i += 0.1)
    printf("%.1f\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1149 <main+0x39>
jp     1149 <main+0x39>
jmp    1171 <main+0x61>
movsd  -0x10(%rbp),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movsd  0xea6(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1127 <main+0x17>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xorpd  %xmm0,%xmm0
lea    0xef0(%rip),%rbx
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xebe(%rip),%xmm0
ucomisd 0xebe(%rip),%xmm0
jne    1120 <main+0x10>
jp     1120 <main+0x10>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %9, %0
%4 = load double, double* %2
%5 = fcmp une double %4, 1.000000e+01
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load double, double* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %7)
br label %9
9: ; preds = %6
%10 = load double, double* %2
%11 = fadd double %10, 1.000000e-01
store double %11, double* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi double [ 0.000000e+00, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %2)
%4 = fadd double %2, 1.000000e-01
%5 = fcmp une double %4, 1.000000e+01
br i1 %5, label %1, label %6
6: ; preds = %1
ret i32 0
}
void mylocalfoo() {
  int functionvar;
  printf("variable functionvar \t location: 0x%x\n", &functionvar);
}


x86 assembly (clang, -O0):
<mylocalfoo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"variable functionvar \09 location: 0x%x\0A\00"
define void @mylocalfoo() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"variable functionvar \09 location: 0x%x\0A\00"
define void @mylocalfoo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
void border_sw_ext_corner_special_sand_long_hori(unsigned char *pic,
                                                 unsigned char *mirr) {
  *pic = 0x30;
  *mirr = 0x01;
}


x86 assembly (clang, -O0):
<border_sw_ext_corner_special_sand_long_hori>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x30,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_sw_ext_corner_special_sand_long_hori>:
movb   $0x30,(%rdi)
movb   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @border_sw_ext_corner_special_sand_long_hori(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 48, i8* %5
%6 = load i8*, i8** %4
store i8 1, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_sw_ext_corner_special_sand_long_hori(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 48, i8* %0
store i8 1, i8* %1
ret void
}
int test_imm_DEuint32_reg(unsigned int val) {
  return ((val) & (0xDE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DEuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xde,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DEuint32_reg>:
test   $0xde,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DEuint32_reg(i32 %0) {
%2 = and i32 %0, 222
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
main() {
  printf("WARNING: No automated network interface determination\n");
  printf("ERROR: No disk free routine!\n");
  exit(1);
  printf("ERROR: No random or srandom routine!\n");
  exit(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [55 x i8] c"WARNING: No automated network interface determination\0A\00"
@.str.1 = [30 x i8] c"ERROR: No disk free routine!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [54 x i8] c"WARNING: No automated network interface determination\00"
@str.2 = [29 x i8] c"ERROR: No disk free routine!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int strlen(const char *str) {
  int len = 0;
  if (str == (char *)0)
    return 0;
  while (*str++ != 0)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <strlen+0x26>
movl   $0x0,-0x4(%rbp)
jmp    115a <strlen+0x5a>
jmp    112b <strlen+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1154 <strlen+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <strlen+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <strlen+0x1b>
cmpb   $0x0,(%rdi)
je     111b <strlen+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = add nuw nsw i32 %7, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
unsigned f(unsigned i) { return i & 0x7fffff; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
and    $0x7fffff,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = and i32 %0, 8388607
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ const *);
char *ctime(const time_t *tp) { return asctime(localtime(tp)); }


x86 assembly (clang, -O0):
<ctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime>:
push   %rax
call   1030 <localtime@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <asctime@plt>

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

LLVM IR (-O2):
define i8* @ctime(i32* %0) {
%2 = tail call i32 @localtime(i32* %0)
%3 = tail call i8* @asctime(i32 %2)
ret i8* %3
}
void glLinkProgram(unsigned int program) {}


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

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

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

LLVM IR (-O2):
define void @glLinkProgram(i32 %0) {
ret void
}
void close_fake_quartz(void) {}


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

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

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

LLVM IR (-O2):
define void @close_fake_quartz() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fbo_cleanup_buffer(void *buf) { free(buf); }


x86 assembly (clang, -O0):
<fbo_cleanup_buffer>:
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):
<fbo_cleanup_buffer>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @fbo_cleanup_buffer(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_FBuint8_reg(unsigned char val) {
  return ((val) & (-0xFB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FBuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff05,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FBuint8_reg>:
test   $0x5,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FBuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 5
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ endutent();
void endutxent(void) { endutent(); }


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

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

LLVM IR (-O0):
define void @endutxent() {
%1 = call i32 (...) @endutent()
ret void
}

LLVM IR (-O2):
define void @endutxent() {
%1 = tail call i32 (...) @endutent()
ret void
}
void perfmon_start(void) {}


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

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

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

LLVM IR (-O2):
define void @perfmon_start() {
ret void
}
void *deconstify_void_ptr(const void *p) { return (void *)p; }


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

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

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

LLVM IR (-O2):
define i8* @deconstify_void_ptr(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
struct mb_interpreter_t {
  int dummy;
};

/* Variables and functions */
int _remove_func(struct mb_interpreter_t *, char const *, int /*<<< orphan*/);
int mb_remove_func(struct mb_interpreter_t *s, const char *n) {
  return _remove_func(s, n, (0));
}


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

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

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

LLVM IR (-O2):
%struct.mb_interpreter_t = type { i32 }
define i32 @mb_remove_func(%struct.mb_interpreter_t* %0, i8* %1) {
%3 = tail call i32 @_remove_func(%struct.mb_interpreter_t* %0, i8* %1, i32 0)
ret i32 %3
}
double difftime(unsigned int time1, unsigned int time0) {
  return (time1 - time0);
}


x86 assembly (clang, -O0):
<difftime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    %ecx,%eax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<difftime>:
sub    %esi,%edi
cvtsi2sd %rdi,%xmm0
ret

LLVM IR (-O0):
define double @difftime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub i32 %5, %6
%8 = uitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @difftime(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
%4 = uitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, c;
  printf("Number:\n");
  scanf("%d", &n);
  c = exact_square(n);
  printf("%d\n", c);
  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    0xeb5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9a(%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    0xebf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <exact_square@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Number:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 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 @exact_square(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [8 x i8] c"Number:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 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 @exact_square(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef scalar_t__ loff_t;

/* Variables and functions */
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int);
loff_t lseek64(int fd, loff_t offset, int whence) {
  return (loff_t)(lseek(fd, (off_t)(offset), whence));
}


x86 assembly (clang, -O0):
<lseek64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    -0x14(%rbp),%edx
call   1030 <lseek@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek64>:
push   %rax
call   1030 <lseek@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @lseek64(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i64, i64* %5
%9 = trunc i64 %8 to i32
%10 = load i32, i32* %6
%11 = call i32 @lseek(i32 %7, i32 %9, i32 %10)
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @lseek64(i32 %0, i64 %1, i32 %2) {
%4 = trunc i64 %1 to i32
%5 = tail call i32 @lseek(i32 %0, i32 %4, i32 %2)
%6 = sext i32 %5 to i64
ret i64 %6
}
double s_r(double redchan, double nirchan) {
  double result;
  if ((redchan) == 0.0) {
    result = -1.0;
  } else {
    result = (nirchan / redchan);
  }
  return result;
}


x86 assembly (clang, -O0):
<s_r>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1138 <s_r+0x38>
jp     1138 <s_r+0x38>
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1147 <s_r+0x47>
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_r>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    1115 <s_r+0x15>
jp     1115 <s_r+0x15>
movsd  0xeec(%rip),%xmm0
ret
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @s_r(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store double -1.000000e+00, double* %5
br label %13
9: ; preds = %2
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fdiv double %10, %11
store double %12, double* %5
br label %13
13: ; preds = %9, %8
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @s_r(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
%4 = fdiv double %1, %0
%5 = select i1 %3, double -1.000000e+00, double %4
ret double %5
}