xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void *, size_t);
void uninitvar_memmove(void) {
  void *ct;
  void *cs;
  size_t n;
  (void)memmove(ct, cs, n);
}


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

x86 assembly (clang, -O2):
<uninitvar_memmove>:
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @uninitvar_memmove() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i64
%4 = load i8*, i8** %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = call i32 @memmove(i8* %4, i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_memmove() {
%1 = tail call i32 @memmove(i8* undef, i8* undef, i64 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ barf(char *);
int socketpair(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int *);
void fdpair(int fds[2]) {
  if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == -1)
    barf("Creating fdpair");
}


x86 assembly (clang, -O0):
<fdpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
xor    %edx,%edx
call   1040 <socketpair@plt>
cmp    $0xffffffff,%eax
jne    115e <fdpair+0x3e>
lea    0xea7(%rip),%rdi
call   1030 <barf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdpair>:
push   %rax
mov    %rdi,%rcx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socketpair@plt>
cmp    $0xffffffff,%eax
je     1144 <fdpair+0x24>
pop    %rax
ret
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1030 <barf@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [16 x i8] c"Creating fdpair\00"
define void @fdpair(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @AF_UNIX
%4 = load i32, i32* @SOCK_STREAM
%5 = load i32*, i32** %2
%6 = call i32 @socketpair(i32 %3, i32 %4, i32 0, i32* %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @barf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [16 x i8] c"Creating fdpair\00"
define void @fdpair(i32* %0) {
%2 = load i32, i32* @AF_UNIX
%3 = load i32, i32* @SOCK_STREAM
%4 = tail call i32 @socketpair(i32 %2, i32 %3, i32 0, i32* %0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @barf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}
void PackSumDff(struct bit_stream *bs) {}


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

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

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

LLVM IR (-O2):
%struct.bit_stream = type opaque
define void @PackSumDff(%struct.bit_stream* nocapture %0) {
ret void
}
/* Type definitions */
struct cphy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct cphy *);
void mv88x201x_destroy(struct cphy *cphy) { kfree(cphy); }


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

x86 assembly (clang, -O2):
<mv88x201x_destroy>:
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
%struct.cphy = type { i32 }
define void @mv88x201x_destroy(%struct.cphy* %0) {
%2 = tail call i32 @kfree(%struct.cphy* %0)
ret void
}
/* Type definitions */
struct core_counter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ core_counter_reset(struct core_counter *);
void core_counter_init(struct core_counter *self) { core_counter_reset(self); }


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

x86 assembly (clang, -O2):
<core_counter_init>:
jmp    1030 <core_counter_reset@plt>

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

LLVM IR (-O2):
%struct.core_counter = type { i32 }
define void @core_counter_init(%struct.core_counter* %0) {
%2 = tail call i32 @core_counter_reset(%struct.core_counter* %0)
ret void
}
double babylonian_sqrt(double S) { return 0.0; }


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

x86 assembly (clang, -O2):
<babylonian_sqrt>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @babylonian_sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @babylonian_sqrt(double %0) {
ret double 0.000000e+00
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int sec_box_ring_module_inside_align_pow2(uint32_t num) {
  int offset = 0;
  uint32_t mark1, mark2;
  do {
    offset++;
    mark1 = (1 << offset);
    mark2 = (1 << (offset + 1));
  } while (num >= mark1);
  return (1 << offset);
}


x86 assembly (clang, -O0):
<sec_box_ring_module_inside_align_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    110e <sec_box_ring_module_inside_align_pow2+0xe>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec_box_ring_module_inside_align_pow2>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%edx
mov    $0x2,%eax
shl    %cl,%eax
mov    %edx,%ecx
cmp    %edi,%eax
jle    1110 <sec_box_ring_module_inside_align_pow2+0x10>
ret

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

LLVM IR (-O2):
define i32 @sec_box_ring_module_inside_align_pow2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %4, %2 ]
%4 = add nuw nsw i32 %3, 1
%5 = shl i32 2, %3
%6 = icmp sgt i32 %5, %0
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 %5
}
void gtk_tree_view_column_clear_attributes() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_clear_attributes() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_scale() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_scale"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_cvolume_scale\0A\00"
define i32 @pa_cvolume_scale() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_cvolume_scale\00"
define i32 @pa_cvolume_scale() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int __strcmp(const char *cs, const char *ct) {
  int d0, d1;
  int res;
  asm volatile("1:\tlodsb\n\t"
               "scasb\n\t"
               "jne 2f\n\t"
               "testb %%al,%%al\n\t"
               "jne 1b\n\t"
               "xorl %%eax,%%eax\n\t"
               "jmp 3f\n"
               "2:\tsbbl %%eax,%%eax\n\t"
               "orb $1,%%al\n"
               "3:"
               : "=a"(res), "=&S"(d0), "=&D"(d1)
               : "1"(cs), "2"(ct)
               : "memory");
  return res;
}


x86 assembly (clang, -O0):
<__strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    112b <__strcmp+0x2b>
test   %al,%al
jne    1114 <__strcmp+0x14>
xor    %eax,%eax
jmp    112f <__strcmp+0x2f>
sbb    %eax,%eax
or     $0x1,%al
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    %eax,-0x14(%rbp)
mov    %edi,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strcmp>:
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    1115 <__strcmp+0x15>
test   %al,%al
jne    1109 <__strcmp+0x9>
xor    %eax,%eax
jmp    1119 <__strcmp+0x19>
sbb    %eax,%eax
or     $0x1,%al
ret

LLVM IR (-O0):
define i32 @__strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9)
%11 = extractvalue { i32, i8*, i8* } %10, 0
%12 = extractvalue { i32, i8*, i8* } %10, 1
%13 = extractvalue { i32, i8*, i8* } %10, 2
store i32 %11, i32* %7
%14 = ptrtoint i8* %12 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = ptrtoint i8* %13 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @__strcmp(i8* %0, i8* %1) {
%3 = tail call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i32, i8*, i8* } %3, 0
ret i32 %4
}
/* Variables and functions */
void *b3(size_t);
void *e(size_t n) { return b3(n); }


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

x86 assembly (clang, -O2):
<e>:
jmp    1030 <b3@plt>

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

LLVM IR (-O2):
define i8* @e(i64 %0) {
%2 = tail call i8* @b3(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x56() {
  Assert_real((isspace(86) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              435, ("isspace should be 0 for V"));
}


x86 assembly (clang, -O0):
<t_isspace_0x56>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1b3,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x56>:
push   %rax
mov    $0x56,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1b3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for V\00"
define void @t_isspace_0x56() {
%1 = call i64 @isspace(i32 86)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 435, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for V\00"
define void @t_isspace_0x56() {
%1 = tail call i64 @isspace(i32 86)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 435, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int security_msg_queue_msgctl(struct msg_queue *msq, int cmd) { return 0; }


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

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

LLVM IR (-O0):
%struct.msg_queue = type opaque
define i32 @security_msg_queue_msgctl(%struct.msg_queue* %0, i32 %1) {
%3 = alloca %struct.msg_queue*
%4 = alloca i32
store %struct.msg_queue* %0, %struct.msg_queue** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.msg_queue = type opaque
define i32 @security_msg_queue_msgctl(%struct.msg_queue* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
__attribute__((always_)) void tu_clear_left(void) { fputs("\x1b[1K", stdout); }


x86 assembly (clang, -O0):
<tu_clear_left>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tu_clear_left>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[1K\00"
@stdout = global i32 0
define void @tu_clear_left() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[1K\00"
@stdout = global i32 0
define void @tu_clear_left() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ munmap(void *, int);
void unmap_device(volatile void *addr, const uint32_t len) {
  uint32_t virt = (uint32_t)addr;
  uint32_t start_page_addr = virt & (~((1 << 12) - 1));
  uint32_t end_page_addr = (virt + len) & (~((1 << 12) - 1));
  uint32_t pages = end_page_addr - start_page_addr + 1;
  munmap((void *)addr, (1 << 12) * pages);
}


x86 assembly (clang, -O0):
<unmap_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xfffff000,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
and    $0xfffff000,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
shl    $0xc,%esi
call   1030 <munmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmap_device>:
add    %edi,%esi
mov    %edi,%eax
and    $0xff000,%eax
and    $0xff000,%esi
sub    %eax,%esi
or     $0x1,%esi
shl    $0xc,%esi
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @unmap_device(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%9 = load i8*, i8** %3
%10 = ptrtoint i8* %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = and i32 %11, -4096
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
%16 = and i32 %15, -4096
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = sub nsw i32 %17, %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %8
%21 = load i8*, i8** %3
%22 = load i32, i32* %8
%23 = mul nsw i32 4096, %22
%24 = call i32 @munmap(i8* %21, i32 %23)
ret void
}

LLVM IR (-O2):
define void @unmap_device(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 1044480
%6 = add nsw i32 %4, %1
%7 = and i32 %6, 1044480
%8 = sub nsw i32 %7, %5
%9 = shl i32 %8, 12
%10 = or i32 %9, 4096
%11 = tail call i32 @munmap(i8* %0, i32 %10)
ret void
}
float stepf(const float in_EDGE, const float in_X) {
  return (in_X < in_EDGE) ? 0 : 1;
}


x86 assembly (clang, -O0):
<stepf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
mov    $0x1,%eax
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<stepf>:
cmpnltss %xmm0,%xmm1
movss  0xef3(%rip),%xmm0
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @stepf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fcmp olt float %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @stepf(float %0, float %1) {
%3 = fcmp uge float %1, %0
%4 = uitofp i1 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int LOG_PERROR;
int LOG_PID;
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
void open_log(void) { openlog("(unknown)", LOG_PERROR | LOG_PID, LOG_DAEMON); }


x86 assembly (clang, -O0):
<open_log>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    0x2eac(%rip),%rax
or     (%rax),%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
lea    0xeca(%rip),%rdi
call   1030 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_log>:
mov    0x2ec9(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
lea    0xece(%rip),%rdi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"(unknown)\00"
@LOG_PERROR = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @open_log() {
%1 = load i32, i32* @LOG_PERROR
%2 = load i32, i32* @LOG_PID
%3 = or i32 %1, %2
%4 = load i32, i32* @LOG_DAEMON
%5 = call i32 @openlog(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"(unknown)\00"
@LOG_PERROR = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @open_log() {
%1 = load i32, i32* @LOG_PERROR
%2 = load i32, i32* @LOG_PID
%3 = or i32 %2, %1
%4 = load i32, i32* @LOG_DAEMON
%5 = tail call i32 @openlog(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x;
  int *p = 0;
  x = 1;
  if (x || *p) {
    x = 0;
  }
  if (x && *p) {
    {
      printf("Error %d\n", (int)1);
      exit(1);
    };
  }
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1155 <main+0x35>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     115c <main+0x3c>
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1190 <main+0x70>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1190 <main+0x70>
lea    0xe86(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %3
store i32 1, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6, %0
store i32 0, i32* %2
br label %11
11: ; preds = %10, %6
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %14, %11
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void mexit() {
  lprintf(0, "%s: shutdown start\n", __func__);
  msend_clean();
  mrecv_clean();
  restoreguid();
  chexit();
  sock_clean();
  lprintf(0, "%s: shutdown complete\n", __func__);
}


x86 assembly (clang, -O0):
<mexit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xe93(%rip),%rsi
lea    0xea0(%rip),%rdx
mov    $0x0,%al
call   1080 <lprintf@plt>
mov    $0x0,%al
call   1030 <msend_clean@plt>
mov    $0x0,%al
call   1070 <mrecv_clean@plt>
mov    $0x0,%al
call   1040 <restoreguid@plt>
mov    $0x0,%al
call   1050 <chexit@plt>
mov    $0x0,%al
call   1060 <sock_clean@plt>
xor    %edi,%edi
lea    0xe73(%rip),%rsi
lea    0xe66(%rip),%rdx
mov    $0x0,%al
call   1080 <lprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mexit>:
push   %rbx
lea    0xe98(%rip),%rsi
lea    0xea5(%rip),%rbx
xor    %edi,%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <lprintf@plt>
xor    %eax,%eax
call   1030 <msend_clean@plt>
xor    %eax,%eax
call   1070 <mrecv_clean@plt>
xor    %eax,%eax
call   1040 <restoreguid@plt>
xor    %eax,%eax
call   1050 <chexit@plt>
xor    %eax,%eax
call   1060 <sock_clean@plt>
lea    0xe75(%rip),%rsi
xor    %edi,%edi
mov    %rbx,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1080 <lprintf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%s: shutdown start\0A\00"
@__func__.mexit = [6 x i8] c"mexit\00"
@.str.1 = [23 x i8] c"%s: shutdown complete\0A\00"
define void @mexit() {
%1 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.mexit, i64 0, i64 0))
%2 = call i32 (...) @msend_clean()
%3 = call i32 (...) @mrecv_clean()
%4 = call i32 (...) @restoreguid()
%5 = call i32 (...) @chexit()
%6 = call i32 (...) @sock_clean()
%7 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.mexit, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s: shutdown start\0A\00"
@__func__.mexit = [6 x i8] c"mexit\00"
@.str.1 = [23 x i8] c"%s: shutdown complete\0A\00"
define void @mexit() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.mexit, i64 0, i64 0))
%2 = tail call i32 (...) @msend_clean()
%3 = tail call i32 (...) @mrecv_clean()
%4 = tail call i32 (...) @restoreguid()
%5 = tail call i32 (...) @chexit()
%6 = tail call i32 (...) @sock_clean()
%7 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.mexit, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, m;
  scanf("%d", &n);
  m = n * n;
  printf("%d \n", m);
  m = m * n;
  printf("%d \n", m);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
imul   %ebx,%ebx
lea    0xec0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
imul   0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %5
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int gnu_ifunc(int);
int /*<<< orphan*/ gnu_ifunc_pre();
int main(void) {
  int i;
  gnu_ifunc_pre();
  i = gnu_ifunc(1);
  assert(i == 2);
  gnu_ifunc(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gnu_ifunc_pre@plt>
mov    $0x1,%edi
call   1050 <gnu_ifunc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x2,%edi
call   1050 <gnu_ifunc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <gnu_ifunc_pre@plt>
mov    $0x1,%edi
call   1050 <gnu_ifunc@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x2,%edi
call   1050 <gnu_ifunc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @gnu_ifunc_pre()
%4 = call i32 @gnu_ifunc(i32 1)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @gnu_ifunc(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gnu_ifunc_pre()
%2 = tail call i32 @gnu_ifunc(i32 1)
%3 = icmp eq i32 %2, 2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @gnu_ifunc(i32 2)
ret i32 0
}
void I2CMasterEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000020))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<I2CMasterEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterEnable>:
orq    $0x10,0x20(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 32
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 16
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CMasterEnable(i64 %0) {
%2 = add i64 %0, 32
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 16
store volatile i64 %5, i64* %3
ret void
}
__attribute__((always_)) void pci_msix_shutdown(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_msix_shutdown(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void int_print(size_t s, void *v) {
  (void)s;
  int *i = (int *)v;
  printf("%d", *i);
}


x86 assembly (clang, -O0):
<int_print>:
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    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_print>:
mov    (%rsi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @int_print(i64 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
double apply(double (*f)(int), int x) { return f(x); }


x86 assembly (clang, -O0):
<apply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

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

LLVM IR (-O2):
define double @apply(double (i32)* nocapture %0, i32 %1) {
%3 = tail call double %0(i32 %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int smdb_update_netkey(int, int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool smdb_update_kr_netkey(uint32_t idx, uint8_t *net_key, uint8_t nid,
                           uint8_t *nwk_id, uint8_t *enc_key, uint8_t *pri_key,
                           uint8_t *bcon_key) {
  idx |= (0x80000000);
  return smdb_update_netkey(idx, net_key, nid, nwk_id, enc_key, pri_key,
                            bcon_key);
}


x86 assembly (clang, -O0):
<smdb_update_kr_netkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <smdb_update_netkey@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smdb_update_kr_netkey>:
or     $0x80000000,%edi
jmp    1030 <smdb_update_netkey@plt>

LLVM IR (-O0):
define i32 @smdb_update_kr_netkey(i32 %0, i32* %1, i32 %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
store i32 %0, i32* %8
store i32* %1, i32** %9
store i32 %2, i32* %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i32, i32* %8
%16 = or i32 %15, -2147483648
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = load i32*, i32** %9
%19 = load i32, i32* %10
%20 = load i32*, i32** %11
%21 = load i32*, i32** %12
%22 = load i32*, i32** %13
%23 = load i32*, i32** %14
%24 = call i32 @smdb_update_netkey(i32 %17, i32* %18, i32 %19, i32* %20, i32* %21, i32* %22, i32* %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @smdb_update_kr_netkey(i32 %0, i32* %1, i32 %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = or i32 %0, -2147483648
%9 = tail call i32 @smdb_update_netkey(i32 %8, i32* %1, i32 %2, i32* %3, i32* %4, i32* %5, i32* %6)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ outportb(int, int);
void init_serial() {
  outportb(0x3f8 + 1, 0x00);
  outportb(0x3f8 + 3, 0x80);
  outportb(0x3f8 + 0, 0x03);
  outportb(0x3f8 + 1, 0x00);
  outportb(0x3f8 + 3, 0x03);
  outportb(0x3f8 + 2, 0xC7);
  outportb(0x3f8 + 4, 0x0B);
}


x86 assembly (clang, -O0):
<init_serial>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outportb@plt>
mov    $0x3fb,%edi
mov    $0x80,%esi
call   1030 <outportb@plt>
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1030 <outportb@plt>
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outportb@plt>
mov    $0x3fb,%edi
mov    $0x3,%esi
call   1030 <outportb@plt>
mov    $0x3fa,%edi
mov    $0xc7,%esi
call   1030 <outportb@plt>
mov    $0x3fc,%edi
mov    $0xb,%esi
call   1030 <outportb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_serial>:
push   %rax
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outportb@plt>
mov    $0x3fb,%edi
mov    $0x80,%esi
call   1030 <outportb@plt>
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1030 <outportb@plt>
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outportb@plt>
mov    $0x3fb,%edi
mov    $0x3,%esi
call   1030 <outportb@plt>
mov    $0x3fa,%edi
mov    $0xc7,%esi
call   1030 <outportb@plt>
mov    $0x3fc,%edi
mov    $0xb,%esi
pop    %rax
jmp    1030 <outportb@plt>

LLVM IR (-O0):
define void @init_serial() {
%1 = call i32 @outportb(i32 1017, i32 0)
%2 = call i32 @outportb(i32 1019, i32 128)
%3 = call i32 @outportb(i32 1016, i32 3)
%4 = call i32 @outportb(i32 1017, i32 0)
%5 = call i32 @outportb(i32 1019, i32 3)
%6 = call i32 @outportb(i32 1018, i32 199)
%7 = call i32 @outportb(i32 1020, i32 11)
ret void
}

LLVM IR (-O2):
define void @init_serial() {
%1 = tail call i32 @outportb(i32 1017, i32 0)
%2 = tail call i32 @outportb(i32 1019, i32 128)
%3 = tail call i32 @outportb(i32 1016, i32 3)
%4 = tail call i32 @outportb(i32 1017, i32 0)
%5 = tail call i32 @outportb(i32 1019, i32 3)
%6 = tail call i32 @outportb(i32 1018, i32 199)
%7 = tail call i32 @outportb(i32 1020, i32 11)
ret void
}
void caller_1_1_1_1_2_2_1() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ print_words(struct trie_node *, int /*<<< orphan*/);
void print_known_words(struct trie_node *root) { print_words(root, 0); }


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

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

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

LLVM IR (-O2):
%struct.trie_node = type { i32 }
define void @print_known_words(%struct.trie_node* %0) {
%2 = tail call i32 @print_words(%struct.trie_node* %0, i32 0)
ret void
}
int xmlUCSIsCJKCompatibilityForms(int code) {
  return (((code >= 0xFE30) && (code <= 0xFE4F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsCJKCompatibilityForms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xfe30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsCJKCompatibilityForms+0x26>
cmpl   $0xfe4f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsCJKCompatibilityForms>:
add    $0xffff01d0,%edi
xor    %eax,%eax
cmp    $0x20,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsCJKCompatibilityForms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65072
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 65103
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsCJKCompatibilityForms(i32 %0) {
%2 = add i32 %0, -65072
%3 = icmp ult i32 %2, 32
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ defineStartAndEnd(int *, int *, int);
int keysNumber(int offset, int limit, int (*keyFind)(int, int)) {
  int offend;
  int num = 0;
  defineStartAndEnd(&offset, &offend, limit);
  while ((offset = keyFind(offset, offend - offset)) > 0) {
    num++;
  }
  return num;
}


x86 assembly (clang, -O0):
<keysNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <defineStartAndEnd@plt>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
sub    -0x4(%rbp),%esi
call   *%rax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jle    1162 <keysNumber+0x52>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1139 <keysNumber+0x29>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keysNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%edx
mov    %edi,(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1030 <defineStartAndEnd@plt>
mov    $0xffffffff,%ebp
mov    (%rsp),%eax
mov    0x4(%rsp),%esi
sub    %eax,%esi
mov    %eax,%edi
call   *%rbx
mov    %eax,(%rsp)
add    $0x1,%ebp
test   %eax,%eax
jg     1130 <keysNumber+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @keysNumber(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
%6 = bitcast i32* %5 to i8*
%7 = call i32 @defineStartAndEnd(i32* %4, i32* %5, i32 %1)
%8 = load i32, i32* %4
br label %9
9: ; preds = %9, %3
%10 = phi i32 [ %8, %3 ], [ %14, %9 ]
%11 = phi i32 [ 0, %3 ], [ %16, %9 ]
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, %10
%14 = call i32 %2(i32 %10, i32 %13)
store i32 %14, i32* %4
%15 = icmp sgt i32 %14, 0
%16 = add nuw nsw i32 %11, 1
br i1 %15, label %9, label %17
17: ; preds = %9
ret i32 %11
}
/* Variables and functions */
long long __nv_llrint(double);
long long llrint(double __a) { return __nv_llrint(__a); }


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

x86 assembly (clang, -O2):
<llrint>:
jmp    1030 <__nv_llrint@plt>

LLVM IR (-O0):
define i64 @llrint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @__nv_llrint(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @llrint(double %0) {
%2 = tail call i64 @__nv_llrint(double %0)
ret i64 %2
}
int is_width(char c) {
  if ((c > '0' && c <= '9') || c == '*')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_width>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jle    1124 <is_width+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1131 <is_width+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
jne    113d <is_width+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <is_width+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_width>:
lea    -0x31(%rdi),%eax
cmp    $0x9,%al
setb   %al
cmp    $0x2a,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_width(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %15, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 42
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_width(i8 signext %0) {
%2 = add i8 %0, -49
%3 = icmp ult i8 %2, 9
%4 = icmp eq i8 %0, 42
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
apro(f, n) {
  char mstring[128];
  int status;
  status = mlreply("Apropos string: ", mstring, 128 - 1);
  if (status != 1)
    return (status);
  return (buildlist(0, mstring));
}


x86 assembly (clang, -O0):
<apro>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x90(%rbp),%rsi
lea    0xec1(%rip),%rdi
mov    $0x7f,%edx
mov    $0x0,%al
call   1040 <mlreply@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x1,-0x94(%rbp)
je     116c <apro+0x4c>
mov    -0x94(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <apro+0x5f>
lea    -0x90(%rbp),%rsi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <buildlist@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apro>:
sub    $0x88,%rsp
lea    0xed2(%rip),%rdi
mov    %rsp,%rsi
mov    $0x7f,%edx
xor    %eax,%eax
call   1040 <mlreply@plt>
cmp    $0x1,%eax
jne    114e <apro+0x2e>
mov    %rsp,%rsi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <buildlist@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Apropos string: \00"
define i32 @apro(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [128 x i8]
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%9 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mlreply to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %8, i32 127)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = icmp ne i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* %7
store i32 %13, i32* %3
br label %17
14: ; preds = %2
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%16 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @buildlist to i32 (i32, i8*, ...)*)(i32 0, i8* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [17 x i8] c"Apropos string: \00"
define i32 @apro(i32 %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mlreply to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4, i32 127)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @buildlist to i32 (i32, i8*, ...)*)(i32 0, i8* %4)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_get_host_name() {
  printf("NOT IMPLEMENTED:"
         "pa_get_host_name"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_get_host_name\0A\00"
define i32 @pa_get_host_name() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_get_host_name\00"
define i32 @pa_get_host_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}