xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ callFunction();
int main() {
  int i;
  int sum = 0;
  for (i = 0; i < 1000; i++) {
    sum += callFunction();
  }
  return sum == 2000000;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    115c <main+0x4c>
mov    $0x0,%al
call   1030 <callFunction@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x1e8480,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3e8,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <callFunction@plt>
add    %eax,%ebx
add    $0xffffffff,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
cmp    $0x1e8480,%ebx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i64 (...) @callFunction()
%5 = trunc i64 %4 to i32
%6 = add i32 %2, %5
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 1000
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = icmp eq i32 %6, 2000000
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ listen(int, int);
void make_listen(int sockfd) { listen(sockfd, 5); }


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

x86 assembly (clang, -O2):
<make_listen>:
mov    $0x5,%esi
jmp    1030 <listen@plt>

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

LLVM IR (-O2):
define void @make_listen(i32 %0) {
%2 = tail call i32 @listen(i32 %0, i32 5)
ret void
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ netif_wake_queue(struct net_device *);
void netif_tx_wake_all_queues(struct net_device *dev) { netif_wake_queue(dev); }


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

x86 assembly (clang, -O2):
<netif_tx_wake_all_queues>:
jmp    1030 <netif_wake_queue@plt>

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

LLVM IR (-O2):
%struct.net_device = type { i32 }
define void @netif_tx_wake_all_queues(%struct.net_device* %0) {
%2 = tail call i32 @netif_wake_queue(%struct.net_device* %0)
ret void
}
/* Variables and functions */
unsigned int cp15_read_control();
unsigned int cp15_is_dcache_enabled(void) {
  unsigned int control;
  control = cp15_read_control();
  return ((control & ((1 << 2) || (1 << 0))) != 0);
}


x86 assembly (clang, -O0):
<cp15_is_dcache_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <cp15_read_control@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp15_is_dcache_enabled>:
push   %rax
xor    %eax,%eax
call   1030 <cp15_read_control@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cp15_is_dcache_enabled() {
%1 = alloca i32
%2 = call i32 (...) @cp15_read_control()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @cp15_is_dcache_enabled() {
%1 = tail call i32 (...) @cp15_read_control()
%2 = and i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ localme(int, char *);
int /*<<< orphan*/ localyou(int, char *);
int main(int argc, char *argv[]) {
  localme(10, "cxxxxyyyy");
  localyou(10, "cxxxxxxxx");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
lea    0xec5(%rip),%rsi
call   1040 <localme@plt>
mov    $0xa,%edi
lea    0xebe(%rip),%rsi
call   1030 <localyou@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0xa,%edi
call   1040 <localme@plt>
lea    0xed1(%rip),%rsi
mov    $0xa,%edi
call   1030 <localyou@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"cxxxxyyyy\00"
@.str.1 = [10 x i8] c"cxxxxxxxx\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @localme(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @localyou(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"cxxxxyyyy\00"
@.str.1 = [10 x i8] c"cxxxxxxxx\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @localme(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @localyou(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void g_free() {}


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

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

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

LLVM IR (-O2):
define void @g_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run();
int main(int argc, char *argv[]) {
  while (1) {
    run();
  }
}


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)
mov    $0x0,%al
call   1030 <run@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <run@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
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
br label %6
6: ; preds = %2, %6
%7 = call i32 (...) @run()
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 (...) @run()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("usage: eg encode [-c <input>]\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"usage: eg encode [-c <input>]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"usage: eg encode [-c <input>]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
void set_signals() {}


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

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

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

LLVM IR (-O2):
define void @set_signals() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TwoFunction();
void FiveFunction() { TwoFunction(); }


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

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

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

LLVM IR (-O2):
define void @FiveFunction() {
%1 = tail call i32 (...) @TwoFunction()
ret void
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
ssize_t __writev(int fd, const struct iovec *vector, int count) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__writev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__writev>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
@ENOSYS = global i32 0
define i32 @__writev(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.iovec*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.iovec* %1, %struct.iovec** %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
@ENOSYS = global i32 0
define i32 @__writev(i32 %0, %struct.iovec* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
void _infix_operator_plus_i64_i64(signed long long lhs, signed long long rhs,
                                  signed long long *__rval_1) {
  *__rval_1 = lhs + rhs;
}


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

x86 assembly (clang, -O2):
<_infix_operator_plus_i64_i64>:
add    %rsi,%rdi
mov    %rdi,(%rdx)
ret

LLVM IR (-O0):
define void @_infix_operator_plus_i64_i64(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = add nsw i64 %7, %8
%10 = load i64*, i64** %6
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @_infix_operator_plus_i64_i64(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = add nsw i64 %1, %0
store i64 %4, i64* %2
ret void
}
unsigned char I2CMasterDataGet(unsigned int baseAdd) {
  unsigned char rData;
  rData = (unsigned char)(*((volatile unsigned int *)(baseAdd + (0x9C))));
  return rData;
}


x86 assembly (clang, -O0):
<I2CMasterDataGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x9c,%eax
mov    %eax,%eax
mov    (%rax),%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterDataGet>:
add    $0x9c,%edi
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i8 @I2CMasterDataGet(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 156
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i8, i8* %3
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @I2CMasterDataGet(i32 %0) {
%2 = add i32 %0, 156
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ context_switch_keep_keys_generic(struct __test_metadata *);
void wrapper_context_switch_keep_keys_generic(
    struct __test_metadata *_metadata,
    struct __fixture_variant_metadata *variant) {
  context_switch_keep_keys_generic(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_context_switch_keep_keys_generic>:
jmp    1030 <context_switch_keep_keys_generic@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_context_switch_keep_keys_generic(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @context_switch_keep_keys_generic(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_context_switch_keep_keys_generic(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @context_switch_keep_keys_generic(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *program_name) {
  printf("Usage: %s <-d|-e> <text>\n", program_name);
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: %s <-d|-e> <text>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: %s <-d|-e> <text>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
float unif_rnd(float max) { return (rand() / (RAND_MAX / 2.0) - 1.0) * max; }


x86 assembly (clang, -O0):
<unif_rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ebd(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xed1(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
subsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unif_rnd>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec3(%rip),%rax
movsd  (%rax),%xmm1
mulsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  0xecb(%rip),%xmm0
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define float @unif_rnd(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call double (...) @rand()
%4 = load double, double* @RAND_MAX
%5 = fdiv double %4, 2.000000e+00
%6 = fdiv double %3, %5
%7 = fsub double %6, 1.000000e+00
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fmul double %7, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define float @unif_rnd(float %0) {
%2 = tail call double (...) @rand()
%3 = load double, double* @RAND_MAX
%4 = fmul double %3, 5.000000e-01
%5 = fdiv double %2, %4
%6 = fadd double %5, -1.000000e+00
%7 = fpext float %0 to double
%8 = fmul double %6, %7
%9 = fptrunc double %8 to float
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int send_command_expect_ok(int, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int netplot_replot(int server_connection_index, int plot_index) {
  char buffer[256];
  memset(buffer, 0, 256);
  snprintf(buffer, 256, "replot %d\n", plot_index);
  return send_command_expect_ok(server_connection_index, buffer);
}


x86 assembly (clang, -O0):
<netplot_replot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x100,%esi
lea    0xe96(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
call   1050 <send_command_expect_ok@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netplot_replot>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %esi,%ebx
mov    %edi,%r14d
mov    %rsp,%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    0xea7(%rip),%rdx
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %ebx,%ecx
call   1030 <snprintf@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
call   1050 <send_command_expect_ok@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"replot %d\0A\00"
define i32 @netplot_replot(i32 %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 256)
%6 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%7 = call i32 @send_command_expect_ok(i32 %0, i8* %4)
ret i32 %7
}
int(strcmp)(char const *cs, char const *ct) {
  int __res;
  {
    ;
    return (__res);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SystemInit();
int main(void) {
  SystemInit();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <SystemInit@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <SystemInit@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @SystemInit()
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @SystemInit()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgexit(void) {
  gen("popl\t%ebp");
  gen("ret");
}


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

x86 assembly (clang, -O2):
<cgexit>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <gen@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"popl\09%ebp\00"
@.str.1 = [4 x i8] c"ret\00"
define void @cgexit() {
%1 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"popl\09%ebp\00"
@.str.1 = [4 x i8] c"ret\00"
define void @cgexit() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int comp(const void *a, const void *b) {
  int *x = (int *)a;
  int *y = (int *)b;
  return x[1] - y[1];
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x20(%rbp),%rcx
sub    0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    0x4(%rdi),%eax
sub    0x4(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = load i32*, i32** %6
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = sub nsw i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = getelementptr inbounds i8, i8* %1, i64 4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = sub nsw i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char *temp = "Paras";
  int i;
  i = 0;
  temp[3] = 'F';
  for (i = 0; i < 5; i++)
    printf("%c\n", temp[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x46,0x3(%rax)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1170 <main+0x60>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
lea    0xead(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1140 <main+0x30>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x72,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x73,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Paras\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
store i8 70, i8* %5
store i32 0, i32* %3
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %14)
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 80)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 97)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 114)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 97)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 115)
ret i32 0
}
void port_suspend(void) {}


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

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

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

LLVM IR (-O2):
define void @port_suspend() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int get_ioctl_sock() {
  static int s = -1;
  if (s < 0) {
    s = socket(PF_INET, SOCK_DGRAM, 0);
    if (s < 0)
      return -1;
  }
  return s;
}


x86 assembly (clang, -O0):
<get_ioctl_sock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f09(%rip)
jge    1162 <get_ioctl_sock+0x52>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
mov    %eax,0x2ee4(%rip)
cmpl   $0x0,0x2edd(%rip)
jge    115d <get_ioctl_sock+0x4d>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <get_ioctl_sock+0x5b>
jmp    1162 <get_ioctl_sock+0x52>
mov    0x2ec0(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ioctl_sock>:
push   %rax
mov    0x2f11(%rip),%eax
test   %eax,%eax
js     111d <get_ioctl_sock+0xd>
pop    %rcx
ret
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
mov    %eax,0x2eec(%rip)
test   %eax,%eax
jns    111b <get_ioctl_sock+0xb>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@get_ioctl_sock.s = internal global i32 -1
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @get_ioctl_sock() {
%1 = alloca i32
%2 = load i32, i32* @get_ioctl_sock.s
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %0
%5 = load i32, i32* @PF_INET
%6 = load i32, i32* @SOCK_DGRAM
%7 = call i32 @socket(i32 %5, i32 %6, i32 0)
store i32 %7, i32* @get_ioctl_sock.s
%8 = load i32, i32* @get_ioctl_sock.s
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %4
store i32 -1, i32* %1
br label %14
11: ; preds = %4
br label %12
12: ; preds = %11, %0
%13 = load i32, i32* @get_ioctl_sock.s
store i32 %13, i32* %1
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@get_ioctl_sock.s = internal unnamed_addr global i32 -1
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @get_ioctl_sock() {
%1 = load i32, i32* @get_ioctl_sock.s
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @PF_INET
%5 = load i32, i32* @SOCK_DGRAM
%6 = tail call i32 @socket(i32 %4, i32 %5, i32 0)
store i32 %6, i32* @get_ioctl_sock.s
%7 = icmp slt i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3, %0
%9 = phi i32 [ %6, %3 ], [ %1, %0 ]
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ %9, %8 ], [ -1, %3 ]
ret i32 %11
}
void disable_interrupts(void) { __asm__("cli"); }


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

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

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

LLVM IR (-O2):
define void @disable_interrupts() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ le64toh(int /*<<< orphan*/);
uint64_t unaligned_read_le64(const void *_u) {
  const struct __attribute__((__packed__, __may_alias__)) {
    uint64_t x;
  } *u = _u;
  return le64toh(u->x);
}


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

x86 assembly (clang, -O2):
<unaligned_read_le64>:
mov    (%rdi),%edi
jmp    1030 <le64toh@plt>

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @unaligned_read_le64(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.anon*
store %struct.anon* %5, %struct.anon** %3
%6 = load %struct.anon*, %struct.anon** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @le64toh(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @unaligned_read_le64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @le64toh(i32 %3)
ret i32 %4
}
/* Variables and functions */
int strlen(char const *);
int gnu_mbswidth(const char *string, int flags) { return strlen(string); }


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

x86 assembly (clang, -O2):
<gnu_mbswidth>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @gnu_mbswidth(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
ret i32 %3
}
/* Variables and functions */
int raytype(char *);
int isglossyray() { return raytype("glossy"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"glossy\00"
define i32 @isglossyray() {
%1 = call i32 @raytype(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [7 x i8] c"glossy\00"
define i32 @isglossyray() {
%1 = tail call i32 @raytype(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ m3d_(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello from C!\n");
  m3d_("Hello from Fortran!");
  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    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
call   1040 <m3d_@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello from C!\0A\00"
@.str.1 = [20 x i8] c"Hello from Fortran!\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 ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @m3d_(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"Hello from Fortran!\00"
@str = [14 x i8] c"Hello from C!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @m3d_(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int _libkb_kbos_lock(void) {
  int x = 0;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @_libkb_kbos_lock() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
void __ii__xx(int i, const char *v) { printf("args[%d]=%s", i, v); }


x86 assembly (clang, -O0):
<__ii__xx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"args[%d]=%s\00"
define void @__ii__xx(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Type definitions */
typedef int uint_fast32_t;
typedef int uint8_t;

/* Variables and functions */
uint_fast32_t color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
  return r | g << 8 | b << 16 | a << 24;
}


x86 assembly (clang, -O0):
<color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color>:
mov    %ecx,%eax
shl    $0x8,%esi
or     %edi,%esi
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @color(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %1, 8
%6 = or i32 %5, %0
%7 = shl i32 %2, 16
%8 = or i32 %6, %7
%9 = shl i32 %3, 24
%10 = or i32 %8, %9
ret i32 %10
}
int rtapi_is_kernelspace() { return 0; }


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

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

LLVM IR (-O0):
define i32 @rtapi_is_kernelspace() {
ret i32 0
}

LLVM IR (-O2):
define i32 @rtapi_is_kernelspace() {
ret i32 0
}
void BN_mod_word(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_mod_word() {
ret void
}
void SOCKET_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @SOCKET_Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char *argv[]) {
  printf("%s -- %s\n", argv[1], argv[2]);
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rax
mov    0x10(%rsi),%rdx
lea    0xee0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s -- %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
ret i32 0
}
double oddhs_get_activityD(const long int val) {
  const double dmax = 16384;
  const double dval = dmax - val;
  double result = dval / dmax;
  return result;
}


x86 assembly (clang, -O0):
<oddhs_get_activityD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xef0(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xedd(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<oddhs_get_activityD>:
cvtsi2sd %rdi,%xmm1
movsd  0xef3(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  0xeef(%rip),%xmm0
ret

LLVM IR (-O0):
define double @oddhs_get_activityD(i64 %0) {
%2 = alloca i64
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i64 %0, i64* %2
store double 1.638400e+04, double* %3
%6 = load i64, i64* %2
%7 = sitofp i64 %6 to double
%8 = fsub double 1.638400e+04, %7
store double %8, double* %4
%9 = load double, double* %4
%10 = fdiv double %9, 1.638400e+04
store double %10, double* %5
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
define double @oddhs_get_activityD(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = fsub double 1.638400e+04, %2
%4 = fmul double %3, 0x3F10000000000000
ret double %4
}
int unset_bits_less(int number, int index) {
  return number & ~((1 << index) - 1);
}


x86 assembly (clang, -O0):
<unset_bits_less>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unset_bits_less>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @unset_bits_less(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 = shl i32 1, %6
%8 = sub nsw i32 %7, 1
%9 = xor i32 %8, -1
%10 = and i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @unset_bits_less(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = and i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ command;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int /*<<< orphan*/ stdout;
void erase_display(int n) {
  char command[13];
  snprintf(command, sizeof(command), "%c[%dJ", 0x1B, n);
  fprintf(stdout, "%s", command);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<erase_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x11(%rbp),%rdi
mov    -0x4(%rbp),%r8d
mov    $0xd,%esi
lea    0xeb1(%rip),%rdx
mov    $0x1b,%ecx
call   1030 <snprintf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    -0x11(%rbp),%rdx
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_display>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%r8d
lea    0xebf(%rip),%rdx
lea    0xb(%rsp),%r14
mov    %r14,%rdi
mov    $0xd,%esi
mov    $0x1b,%ecx
call   1030 <snprintf@plt>
mov    0x2e81(%rip),%rbx
mov    (%rbx),%edi
lea    0xe9f(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%c[%dJ\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @erase_display(i32 %0) {
%2 = alloca i32
%3 = alloca [13 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %5)
%7 = load i32, i32* @stdout
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dJ\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @erase_display(i32 %0) {
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0)
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void iowrite_single(int val, int port) {
  if (val == 0 || val == 1) {
    outb(val, port);
  }
}


x86 assembly (clang, -O0):
<iowrite_single>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <iowrite_single+0x22>
cmpl   $0x1,-0x4(%rbp)
jne    113d <iowrite_single+0x2d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iowrite_single>:
cmp    $0x1,%edi
ja     111a <iowrite_single+0xa>
jmp    1030 <outb@plt>
ret

LLVM IR (-O0):
define void @iowrite_single(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 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %7, %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @outb(i32 %11, i32 %12)
br label %14
14: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
define void @iowrite_single(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @outb(i32 %0, i32 %1)
br label %6
6: ; preds = %2, %4
ret void
}
int limitDetection(int depth, int decoded_bytes) {
  if (!depth)
    return decoded_bytes;
  else if (depth < 0)
    return 0;
  else if (depth < decoded_bytes)
    return depth;
  else
    return decoded_bytes;
}


x86 assembly (clang, -O0):
<limitDetection>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111f <limitDetection+0x1f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <limitDetection+0x52>
cmpl   $0x0,-0x8(%rbp)
jge    1135 <limitDetection+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1152 <limitDetection+0x52>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114c <limitDetection+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <limitDetection+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<limitDetection>:
mov    %esi,%eax
test   %edi,%edi
je     110d <limitDetection+0xd>
js     110e <limitDetection+0xe>
cmp    %eax,%edi
cmovl  %edi,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @limitDetection(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = icmp slt i32 %0, 0
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = icmp slt i32 %0, %1
%8 = select i1 %7, i32 %0, i32 %1
br label %9
9: ; preds = %6, %4, %2
%10 = phi i32 [ %1, %2 ], [ 0, %4 ], [ %8, %6 ]
ret i32 %10
}