xunge/DecIR huggingface dataset:
/* Type definitions */
struct rbtree {
  int dummy;
};
struct rbnode {
  int dummy;
};

/* Variables and functions */
struct rbnode *rbtree_insert3(struct rbtree *, struct rbnode *, int);
struct rbnode *rbtree_insert_broken(struct rbtree *rbtree,
                                    struct rbnode *data) {
  return rbtree_insert3(rbtree, data, 1);
}


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

x86 assembly (clang, -O2):
<rbtree_insert_broken>:
mov    $0x1,%edx
jmp    1030 <rbtree_insert3@plt>

LLVM IR (-O0):
%struct.rbtree = type { i32 }
%struct.rbnode = type { i32 }
define %struct.rbnode* @rbtree_insert_broken(%struct.rbtree* %0, %struct.rbnode* %1) {
%3 = alloca %struct.rbtree*
%4 = alloca %struct.rbnode*
store %struct.rbtree* %0, %struct.rbtree** %3
store %struct.rbnode* %1, %struct.rbnode** %4
%5 = load %struct.rbtree*, %struct.rbtree** %3
%6 = load %struct.rbnode*, %struct.rbnode** %4
%7 = call %struct.rbnode* @rbtree_insert3(%struct.rbtree* %5, %struct.rbnode* %6, i32 1)
ret %struct.rbnode* %7
}

LLVM IR (-O2):
%struct.rbtree = type { i32 }
%struct.rbnode = type { i32 }
define %struct.rbnode* @rbtree_insert_broken(%struct.rbtree* %0, %struct.rbnode* %1) {
%3 = tail call %struct.rbnode* @rbtree_insert3(%struct.rbtree* %0, %struct.rbnode* %1, i32 1)
ret %struct.rbnode* %3
}
void convert_slash_to_underscore(char *path) {
  char *temp = path;
  while (*temp != '\0') {
    if (*temp == '/') {
      *temp = '_';
    }
    temp++;
  }
}


x86 assembly (clang, -O0):
<convert_slash_to_underscore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <convert_slash_to_underscore+0x48>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1137 <convert_slash_to_underscore+0x37>
mov    -0x10(%rbp),%rax
movb   $0x5f,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <convert_slash_to_underscore+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_slash_to_underscore>:
jmp    1117 <convert_slash_to_underscore+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x5f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2f,%al
je     1110 <convert_slash_to_underscore+0x10>
test   %al,%al
jne    1113 <convert_slash_to_underscore+0x13>
ret

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

LLVM IR (-O2):
define void @convert_slash_to_underscore(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 47, label %5
]
5: ; preds = %2
store i8 95, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int c_fun();
int a_fun() { return c_fun(); }


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

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

LLVM IR (-O0):
define i32 @a_fun() {
%1 = call i32 (...) @c_fun()
ret i32 %1
}

LLVM IR (-O2):
define i32 @a_fun() {
%1 = tail call i32 (...) @c_fun()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ attroff(int);
int /*<<< orphan*/ attron(int);
int /*<<< orphan*/ printw(char *);
void aprint(int i, char *str) {
  attron(i);
  printw(str);
  attroff(i);
}


x86 assembly (clang, -O0):
<aprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <attron@plt>
mov    -0x10(%rbp),%rdi
call   1050 <printw@plt>
mov    -0x4(%rbp),%edi
call   1030 <attroff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aprint>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <attron@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <attroff@plt>

LLVM IR (-O0):
define void @aprint(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 = call i32 @attron(i32 %5)
%7 = load i8*, i8** %4
%8 = call i32 @printw(i8* %7)
%9 = load i32, i32* %3
%10 = call i32 @attroff(i32 %9)
ret void
}

LLVM IR (-O2):
define void @aprint(i32 %0, i8* %1) {
%3 = tail call i32 @attron(i32 %0)
%4 = tail call i32 @printw(i8* %1)
%5 = tail call i32 @attroff(i32 %0)
ret void
}
int LZ4_sizeofStreamStateHC(void) {
  return (32774 * sizeof(unsigned long long));
}


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

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

LLVM IR (-O0):
define i32 @LZ4_sizeofStreamStateHC() {
ret i32 262192
}

LLVM IR (-O2):
define i32 @LZ4_sizeofStreamStateHC() {
ret i32 262192
}
int test_imm_F7uint8_mem(unsigned char *val) {
  return ((*val) & (-0xF7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F7uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 9
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
struct list *list_alloc_item(void *);
struct list *list_append_item(struct list *, struct list *);
struct list *list_append_data(struct list *list, void *data) {
  struct list *item = NULL;
  item = list_alloc_item(data);
  if (item) {
    item = list_append_item(list, item);
  }
  return item;
}


x86 assembly (clang, -O0):
<list_append_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <list_alloc_item@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <list_append_data+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <list_append_item@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_append_data>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <list_alloc_item@plt>
test   %rax,%rax
je     113d <list_append_data+0x1d>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <list_append_item@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @list_append_data(%struct.list* %0, i8* %1) {
%3 = alloca %struct.list*
%4 = alloca i8*
%5 = alloca %struct.list*
store %struct.list* %0, %struct.list** %3
store i8* %1, i8** %4
store %struct.list* null, %struct.list** %5
%6 = load i8*, i8** %4
%7 = call %struct.list* @list_alloc_item(i8* %6)
store %struct.list* %7, %struct.list** %5
%8 = load %struct.list*, %struct.list** %5
%9 = icmp ne %struct.list* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load %struct.list*, %struct.list** %3
%12 = load %struct.list*, %struct.list** %5
%13 = call %struct.list* @list_append_item(%struct.list* %11, %struct.list* %12)
store %struct.list* %13, %struct.list** %5
br label %14
14: ; preds = %10, %2
%15 = load %struct.list*, %struct.list** %5
ret %struct.list* %15
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @list_append_data(%struct.list* %0, i8* %1) {
%3 = tail call %struct.list* @list_alloc_item(i8* %1)
%4 = icmp eq %struct.list* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call %struct.list* @list_append_item(%struct.list* %0, %struct.list* %3)
br label %7
7: ; preds = %5, %2
%8 = phi %struct.list* [ %6, %5 ], [ null, %2 ]
ret %struct.list* %8
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ nomem();
void *n_calloc(size_t nmemb, size_t size) {
  register void *v = calloc(nmemb, size);
  if (v == 0)
    nomem();
  return v;
}


x86 assembly (clang, -O0):
<n_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <n_calloc+0x33>
mov    $0x0,%al
call   1040 <nomem@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_calloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <n_calloc+0x15>
xor    %eax,%eax
call   1040 <nomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @n_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @nomem()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void set_alt(volatile unsigned *gpio, int pin, int a) {
  *(gpio + (((pin) / 10))) |= (((a) <= 3   ? (a) + 4
                                : (a) == 4 ? 3
                                           : 2)
                               << (((pin) % 10) * 3));
}


x86 assembly (clang, -O0):
<set_alt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jg     1126 <set_alt+0x26>
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <set_alt+0x3c>
mov    -0x10(%rbp),%edx
mov    $0x2,%eax
mov    $0x3,%ecx
cmp    $0x4,%edx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
imul   $0x3,%edx,%ecx
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
or     %esi,%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_alt>:
lea    0x4(%rdx),%ecx
xor    %eax,%eax
cmp    $0x4,%edx
sete   %al
or     $0x2,%eax
cmp    $0x4,%edx
cmovl  %ecx,%eax
movslq %esi,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
sub    %esi,%ecx
lea    (%rcx,%rcx,2),%ecx
shl    %cl,%eax
movslq %edx,%rcx
or     %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @set_alt(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp sle i32 %7, 3
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 4
br label %17
12: ; preds = %3
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 4
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 3, i32 2
br label %17
17: ; preds = %12, %9
%18 = phi i32 [ %11, %9 ], [ %16, %12 ]
%19 = load i32, i32* %5
%20 = srem i32 %19, 10
%21 = mul nsw i32 %20, 3
%22 = shl i32 %18, %21
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = sdiv i32 %24, 10
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %23, i64 %26
%28 = load volatile i32, i32* %27
%29 = or i32 %28, %22
store volatile i32 %29, i32* %27
ret void
}

LLVM IR (-O2):
define void @set_alt(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 4
%5 = add nsw i32 %2, 4
%6 = icmp eq i32 %2, 4
%7 = select i1 %6, i32 3, i32 2
%8 = select i1 %4, i32 %5, i32 %7
%9 = srem i32 %1, 10
%10 = mul nsw i32 %9, 3
%11 = shl i32 %8, %10
%12 = sdiv i32 %1, 10
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
%15 = load volatile i32, i32* %14
%16 = or i32 %15, %11
store volatile i32 %16, i32* %14
ret void
}
void DEBUG_PRINT(char *format, ...) { format = format; }


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

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

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

LLVM IR (-O2):
define void @DEBUG_PRINT(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ unif_dist();
double expo_dist(double mean) { return -log(1.0 - unif_dist()) / mean; }


x86 assembly (clang, -O0):
<expo_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <unif_dist@plt>
cvtsi2sd %rax,%xmm1
movsd  0xebf(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expo_dist>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <unif_dist@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0xec3(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
call   1040 <log@plt>
xorpd  0xebd(%rip),%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @expo_dist(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i64 (...) @unif_dist()
%4 = sitofp i64 %3 to double
%5 = fsub double 1.000000e+00, %4
%6 = fptosi double %5 to i64
%7 = call double @log(i64 %6)
%8 = fneg double %7
%9 = load double, double* %2
%10 = fdiv double %8, %9
ret double %10
}

LLVM IR (-O2):
define double @expo_dist(double %0) {
%2 = tail call i64 (...) @unif_dist()
%3 = sitofp i64 %2 to double
%4 = fsub double 1.000000e+00, %3
%5 = fptosi double %4 to i64
%6 = tail call double @log(i64 %5)
%7 = fneg double %6
%8 = fdiv double %7, %0
ret double %8
}
signed long mask_and_sign_extend_word(unsigned long value, unsigned long mask) {
  value &= mask;
  if (value & ((mask + 1) >> 1)) {
    value |= ~mask;
  }
  return (signed long)value;
}


x86 assembly (clang, -O0):
<mask_and_sign_extend_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
shr    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1145 <mask_and_sign_extend_word+0x45>
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_and_sign_extend_word>:
mov    %rsi,%rax
and    %rdi,%rax
lea    0x1(%rsi),%rcx
shr    %rcx
not    %rsi
or     %rdi,%rsi
test   %rax,%rcx
cmovne %rsi,%rax
ret

LLVM IR (-O0):
define i64 @mask_and_sign_extend_word(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = and i64 %6, %5
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = add i64 %9, 1
%11 = lshr i64 %10, 1
%12 = and i64 %8, %11
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i64, i64* %4
%16 = xor i64 %15, -1
%17 = load i64, i64* %3
%18 = or i64 %17, %16
store i64 %18, i64* %3
br label %19
19: ; preds = %14, %2
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @mask_and_sign_extend_word(i64 %0, i64 %1) {
%3 = and i64 %1, %0
%4 = add i64 %1, 1
%5 = lshr i64 %4, 1
%6 = and i64 %5, %3
%7 = icmp eq i64 %6, 0
%8 = xor i64 %1, -1
%9 = or i64 %8, %0
%10 = select i1 %7, i64 %3, i64 %9
ret i64 %10
}
double returnd10() { return (double)10.; }


x86 assembly (clang, -O0):
<returnd10>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<returnd10>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @returnd10() {
ret double 1.000000e+01
}

LLVM IR (-O2):
define double @returnd10() {
ret double 1.000000e+01
}
OP(ed, b4) {}


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

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

LLVM IR (-O0):
define i32 @OP(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
void wifi_evt_sme_ap_mode_started(
    const struct wifi_msg_sme_ap_mode_started_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_ap_mode_started_evt_t = type opaque
define void @wifi_evt_sme_ap_mode_started(%struct.wifi_msg_sme_ap_mode_started_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned int ya_random();
int rand_range(int min, int max) {
  int res;
  unsigned int diff = (max + 1) - min;
  if (diff <= 1)
    return min;
  res = ya_random() % diff;
  return min + res;
}


x86 assembly (clang, -O0):
<rand_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
ja     113f <rand_range+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <rand_range+0x47>
mov    $0x0,%al
call   1030 <ya_random@plt>
xor    %edx,%edx
divl   -0x14(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
sub    %edi,%ebp
add    $0x1,%ebp
cmp    $0x2,%ebp
jb     112e <rand_range+0x1e>
xor    %eax,%eax
call   1030 <ya_random@plt>
xor    %edx,%edx
div    %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rand_range(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = icmp ult i32 %4, 2
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 (...) @ya_random()
%8 = urem i32 %7, %4
%9 = add nsw i32 %8, %0
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ %0, %2 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ is_token(char const);
int __token_len(const char *s) {
  int l;
  for (l = 0; is_token(*s); l++)
    s++;
  return l;
}


x86 assembly (clang, -O0):
<__token_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_token@plt>
cmp    $0x0,%rax
je     1153 <__token_len+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <__token_len+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__token_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <is_token@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1144 <__token_len+0x34>
cs nopw 0x0(%rax,%rax,1)
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <is_token@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <__token_len+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @__token_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @is_token(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8, i8* %8
%11 = tail call i64 @is_token(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void plugin_close_rig(void) { printf("PrintFrequency plugin closed.\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"PrintFrequency plugin closed.\0A\00"
define void @plugin_close_rig() {
%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"PrintFrequency plugin closed.\00"
define void @plugin_close_rig() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *, ...);
int /*<<< orphan*/ stderr;
void parse_error(const char *msg, int arg) {
  fprintf(stderr, msg, arg);
  fprintf(stderr, "\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<parse_error>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rbx
mov    (%rbx),%edi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@EXIT_FAILURE = global i32 0
define void @parse_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* %6, i32 %7)
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@EXIT_FAILURE = global i32 0
define void @parse_error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* %0, i32 %1)
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
int CRYPTO_get_new_dynlockid(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CRYPTO_get_new_dynlockid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int cbm_untalk(int f) { return ioctl(f, _IO(0xcb, 2)); }


x86 assembly (clang, -O0):
<cbm_untalk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xcb,%edi
mov    $0x2,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_untalk>:
push   %rbx
mov    %edi,%ebx
mov    $0xcb,%edi
mov    $0x2,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbm_untalk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 203, i32 2)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @cbm_untalk(i32 %0) {
%2 = tail call i32 @_IO(i32 203, i32 2)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430Usart1P__Usart__disableUart();
void Msp430UartP__0__Usart__disableUart(void) {
  HplMsp430Usart1P__Usart__disableUart();
}


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

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

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

LLVM IR (-O2):
define void @Msp430UartP__0__Usart__disableUart() {
%1 = tail call i32 (...) @HplMsp430Usart1P__Usart__disableUart()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
hsp_subevent_rfcomm_connection_complete_get_status(const uint8_t *event) {
  return event[3];
}


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

x86 assembly (clang, -O2):
<hsp_subevent_rfcomm_connection_complete_get_status>:
mov    0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hsp_subevent_rfcomm_connection_complete_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
struct socket_peer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_jet_peer(struct socket_peer *);
void free_peer_on_error(void *context) {
  struct socket_peer *p = (struct socket_peer *)context;
  free_jet_peer(p);
}


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

x86 assembly (clang, -O2):
<free_peer_on_error>:
jmp    1030 <free_jet_peer@plt>

LLVM IR (-O0):
%struct.socket_peer = type { i32 }
define void @free_peer_on_error(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.socket_peer*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.socket_peer*
store %struct.socket_peer* %5, %struct.socket_peer** %3
%6 = load %struct.socket_peer*, %struct.socket_peer** %3
%7 = call i32 @free_jet_peer(%struct.socket_peer* %6)
ret void
}

LLVM IR (-O2):
%struct.socket_peer = type { i32 }
define void @free_peer_on_error(i8* %0) {
%2 = bitcast i8* %0 to %struct.socket_peer*
%3 = tail call i32 @free_jet_peer(%struct.socket_peer* %2)
ret void
}
/* Variables and functions */
int evalRPN(char **, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", evalRPN(argv + 1, argc - 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1040 <evalRPN@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = call i32 @evalRPN(i8** %7, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @evalRPN(i8** %3, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_LengthVec2_init(void) {
  _hmt_register_covercase("HMM_LengthVec2", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_LengthVec2_init>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"HMM_LengthVec2\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_LengthVec2_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"HMM_LengthVec2\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_LengthVec2_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ euqualstest();
int /*<<< orphan*/ hello_world();
int /*<<< orphan*/ multtest();
int /*<<< orphan*/ shifttest();
int /*<<< orphan*/ testInvers();
int /*<<< orphan*/ testSquaring();
int main(int argc, const char *argv[]) {
  hello_world();
  euqualstest();
  shifttest();
  multtest();
  testSquaring();
  testInvers();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <hello_world@plt>
mov    $0x0,%al
call   1050 <euqualstest@plt>
mov    $0x0,%al
call   1070 <shifttest@plt>
mov    $0x0,%al
call   1030 <multtest@plt>
mov    $0x0,%al
call   1060 <testSquaring@plt>
mov    $0x0,%al
call   1080 <testInvers@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <hello_world@plt>
xor    %eax,%eax
call   1050 <euqualstest@plt>
xor    %eax,%eax
call   1070 <shifttest@plt>
xor    %eax,%eax
call   1030 <multtest@plt>
xor    %eax,%eax
call   1060 <testSquaring@plt>
xor    %eax,%eax
call   1080 <testInvers@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @hello_world()
%6 = call i32 (...) @euqualstest()
%7 = call i32 (...) @shifttest()
%8 = call i32 (...) @multtest()
%9 = call i32 (...) @testSquaring()
%10 = call i32 (...) @testInvers()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @hello_world()
%4 = tail call i32 (...) @euqualstest()
%5 = tail call i32 (...) @shifttest()
%6 = tail call i32 (...) @multtest()
%7 = tail call i32 (...) @testSquaring()
%8 = tail call i32 (...) @testInvers()
ret i32 0
}
/* Type definitions */
struct packetFormat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ insertInQueue(int, struct packetFormat *);
int handleRequestTX(int node, struct packetFormat *aPacket) {
  insertInQueue(node, aPacket);
}


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

x86 assembly (clang, -O2):
<handleRequestTX>:
jmp    1030 <insertInQueue@plt>

LLVM IR (-O0):
%struct.packetFormat = type { i32 }
define i32 @handleRequestTX(i32 %0, %struct.packetFormat* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.packetFormat*
store i32 %0, i32* %4
store %struct.packetFormat* %1, %struct.packetFormat** %5
%6 = load i32, i32* %4
%7 = load %struct.packetFormat*, %struct.packetFormat** %5
%8 = call i32 @insertInQueue(i32 %6, %struct.packetFormat* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
%struct.packetFormat = type { i32 }
define i32 @handleRequestTX(i32 %0, %struct.packetFormat* %1) {
%3 = tail call i32 @insertInQueue(i32 %0, %struct.packetFormat* %1)
ret i32 undef
}
/* Variables and functions */
double exp2(unsigned char);
double t4(unsigned char x) { return exp2(x); }


x86 assembly (clang, -O0):
<t4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
call   1030 <exp2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t4>:
jmp    1030 <exp2@plt>

LLVM IR (-O0):
define double @t4(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call double @exp2(i8 zeroext %3)
ret double %4
}

LLVM IR (-O2):
define double @t4(i8 zeroext %0) {
%2 = tail call double @exp2(i8 zeroext %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ s2_symbolic_widened_Bad(int *);
void FP_call_s2_symbolic_widened_Silenced(int *m) {
  s2_symbolic_widened_Bad(m);
}


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

x86 assembly (clang, -O2):
<FP_call_s2_symbolic_widened_Silenced>:
jmp    1030 <s2_symbolic_widened_Bad@plt>

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

LLVM IR (-O2):
define void @FP_call_s2_symbolic_widened_Silenced(i32* %0) {
%2 = tail call i32 @s2_symbolic_widened_Bad(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void sigquit_handler(int sig) {
  printf("Received SIGQUIT signal, waiting...\n");
  sleep(8);
  printf("Leaving SIGQUIT handler\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Received SIGQUIT signal, waiting...\0A\00"
@.str.1 = [25 x i8] c"Leaving SIGQUIT handler\0A\00"
define void @sigquit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Received SIGQUIT signal, waiting...\00"
@str.2 = [24 x i8] c"Leaving SIGQUIT handler\00"
define void @sigquit_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 8)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0))
ret void
}
double Loss_Tukey(double *x, int n, double c) {
  double loss_Tukey(double, double);
  double s = 0;
  register int i;
  for (i = 0; i < n; i++)
    s += loss_Tukey(x[i], c);
  return (s);
}


x86 assembly (clang, -O0):
<Loss_Tukey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116e <Loss_Tukey+0x5e>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <loss_Tukey@plt>
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1133 <Loss_Tukey+0x23>
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Loss_Tukey>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %esi,%esi
jle    1174 <Loss_Tukey+0x64>
movaps %xmm0,%xmm1
mov    %rdi,%r14
mov    %esi,%r15d
xorps  %xmm0,%xmm0
xor    %ebx,%ebx
movsd  %xmm1,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
movsd  (%r14,%rbx,8),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <loss_Tukey@plt>
movsd  (%rsp),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
movsd  (%rsp),%xmm0
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <Loss_Tukey+0x30>
jmp    1177 <Loss_Tukey+0x67>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @Loss_Tukey(double* %0, i32 %1, double %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store double %2, double* %6
store double 0.000000e+00, double* %7
store i32 0, i32* %8
br label %9
9: ; preds = %23, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load double*, double** %4
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load double, double* %17
%19 = load double, double* %6
%20 = call double @loss_Tukey(double %18, double %19)
%21 = load double, double* %7
%22 = fadd double %21, %20
store double %22, double* %7
br label %23
23: ; preds = %13
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %9
26: ; preds = %9
%27 = load double, double* %7
ret double %27
}

LLVM IR (-O2):
define double @Loss_Tukey(double* nocapture %0, i32 %1, double %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %16
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %14, %7 ]
%9 = phi double [ 0.000000e+00, %5 ], [ %13, %7 ]
%10 = getelementptr inbounds double, double* %0, i64 %8
%11 = load double, double* %10
%12 = tail call double @loss_Tukey(double %11, double %2)
%13 = fadd double %9, %12
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, %6
br i1 %15, label %16, label %7
16: ; preds = %7, %3
%17 = phi double [ 0.000000e+00, %3 ], [ %13, %7 ]
ret double %17
}
/* Variables and functions */
int printf(char *, int);
int foo(int i) { return printf("%d\n", i); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @foo(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ prog_warning(char *);
void sfree(void *ptr) {
  if (!ptr) {
    prog_warning("sfree(): NULL pointer!");
  } else {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<sfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <sfree+0x28>
lea    0xec2(%rip),%rdi
call   1040 <prog_warning@plt>
jmp    1151 <sfree+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfree>:
test   %rdi,%rdi
je     112a <sfree+0xa>
jmp    1030 <free@plt>
lea    0xecf(%rip),%rdi
jmp    1040 <prog_warning@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"sfree(): NULL pointer!\00"
define void @sfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @prog_warning(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"sfree(): NULL pointer!\00"
define void @sfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @prog_warning(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
__attribute__((__unused__)) int isxdigit(int c) {
  return ((('0' <= (c)) && ((c) <= '9')) || (('a' <= (c)) && ((c) <= 'f')) ||
          (('A' <= (c)) && ((c) <= 'F')));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x30,%eax
cmp    -0x4(%rbp),%eax
jg     1124 <isxdigit+0x24>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1164 <isxdigit+0x64>
mov    $0x61,%eax
cmp    -0x4(%rbp),%eax
jg     1141 <isxdigit+0x41>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1164 <isxdigit+0x64>
xor    %eax,%eax
mov    $0x41,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jg     115e <isxdigit+0x5e>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sle i32 97, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sle i32 65, %15
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 70
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int tracepoint_probe_register(char *, void *);
__attribute__((always_)) int register_trace_module_get(
    void (*probe)(struct module *mod, unsigned long ip, int refcnt)) {
  return tracepoint_probe_register("module_get", (void *)probe);
}


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

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

LLVM IR (-O0):
%struct.module = type opaque
@.str = [11 x i8] c"module_get\00"
define i32 @register_trace_module_get(void (%struct.module*, i64, i32)* %0) {
%2 = alloca void (%struct.module*, i64, i32)*
store void (%struct.module*, i64, i32)* %0, void (%struct.module*, i64, i32)** %2
%3 = load void (%struct.module*, i64, i32)*, void (%struct.module*, i64, i32)** %2
%4 = bitcast void (%struct.module*, i64, i32)* %3 to i8*
%5 = call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.module = type opaque
@.str = [11 x i8] c"module_get\00"
define i32 @register_trace_module_get(void (%struct.module*, i64, i32)* %0) {
%2 = bitcast void (%struct.module*, i64, i32)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}