xunge/DecIR huggingface dataset:
int parent(int index) { return index / 2; }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = sdiv i32 %0, 2
ret i32 %2
}
void sti(void) { asm volatile("sti" : : : "cc"); }


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

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

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

LLVM IR (-O2):
define void @sti() {
tail call void asm sideeffect "sti", "~{cc},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int unlink(char *);
void undaemonize() {
  int ret;
  ret = unlink("/var/run/infond.pid");
  if (ret == -1) {
    perror("Could not delete "
           "/var/run/infond.pid");
  }
}


x86 assembly (clang, -O0):
<undaemonize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee2(%rip),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    114d <undaemonize+0x2d>
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<undaemonize>:
push   %rax
lea    0xee9(%rip),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
je     1134 <undaemonize+0x14>
pop    %rax
ret
lea    0xec5(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"/var/run/infond.pid\00"
@.str.1 = [37 x i8] c"Could not delete /var/run/infond.pid\00"
define void @undaemonize() {
%1 = alloca i32
%2 = call i32 @unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"/var/run/infond.pid\00"
@.str.1 = [37 x i8] c"Could not delete /var/run/infond.pid\00"
define void @undaemonize() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f6();
int /*<<< orphan*/ fralloc_fn();
int /*<<< orphan*/ nofralloc_fn();
int /*<<< orphan*/ normal_fn();
main() {
  normal_fn();
  nofralloc_fn();
  fralloc_fn();
  if (f6() != 1234)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <normal_fn@plt>
mov    $0x0,%al
call   1060 <nofralloc_fn@plt>
mov    $0x0,%al
call   1050 <fralloc_fn@plt>
mov    $0x0,%al
call   1030 <f6@plt>
cmp    $0x4d2,%eax
je     118d <main+0x3d>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <normal_fn@plt>
xor    %eax,%eax
call   1060 <nofralloc_fn@plt>
xor    %eax,%eax
call   1050 <fralloc_fn@plt>
xor    %eax,%eax
call   1030 <f6@plt>
cmp    $0x4d2,%eax
jne    1178 <main+0x28>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @normal_fn()
%3 = call i32 (...) @nofralloc_fn()
%4 = call i32 (...) @fralloc_fn()
%5 = call i32 (...) @f6()
%6 = icmp ne i32 %5, 1234
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @normal_fn()
%2 = tail call i32 (...) @nofralloc_fn()
%3 = tail call i32 (...) @fralloc_fn()
%4 = tail call i32 (...) @f6()
%5 = icmp eq i32 %4, 1234
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}
/* Variables and functions */
int sck_sendf(int, char *, char const *, char const *);
int irc_topic(int s, const char *channel, const char *data) {
  return sck_sendf(s, "TOPIC %s :%s\r\n", channel, data);
}


x86 assembly (clang, -O0):
<irc_topic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <sck_sendf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_topic>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <sck_sendf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"TOPIC %s :%s\0D\0A\00"
define i32 @irc_topic(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @sck_sendf(i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
__m128d __attribute__((__always___, __nodebug__)) _mm_castps_pd(__m128 in) {
  return (__m128d)in;
}


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

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

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

LLVM IR (-O2):
define i32 @_mm_castps_pd(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int y;
  if (!(x < 100 && y < 100))
    return 0;
  while (x < 100 && y < 100) {
    x = x + 1;
    y = y + 1;
  }
  assert(x == 100 || y == 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1133 <main+0x23>
cmpl   $0x64,-0xc(%rbp)
jl     113f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    11b1 <main+0xa1>
jmp    1144 <main+0x34>
xor    %eax,%eax
cmpl   $0x64,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jge    115d <main+0x4d>
cmpl   $0x64,-0xc(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116d <main+0x5d>
jmp    1184 <main+0x74>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x34>
mov    $0x1,%al
cmpl   $0x64,-0x8(%rbp)
mov    %al,-0xe(%rbp)
je     119d <main+0x8d>
cmpl   $0x64,-0xc(%rbp)
sete   %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 100
br i1 %8, label %10, label %9
9: ; preds = %6, %0
store i32 0, i32* %1
br label %34
10: ; preds = %6
br label %11
11: ; preds = %19, %10
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 100
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 100
br label %17
17: ; preds = %14, %11
%18 = phi i1 [ false, %11 ], [ %16, %14 ]
br i1 %18, label %19, label %24
19: ; preds = %17
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %11
24: ; preds = %17
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 100
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 100
br label %30
30: ; preds = %27, %24
%31 = phi i1 [ true, %24 ], [ %29, %27 ]
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
store i32 0, i32* %1
br label %34
34: ; preds = %30, %9
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double py_identity(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @py_identity(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ xyz_to_rgb_floats(float *, float *);
int xyz2rgb(float *y, float *x, int n) {
  assert(n == 3);
  xyz_to_rgb_floats(y, x);
  return 3;
}


x86 assembly (clang, -O0):
<xyz2rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <xyz_to_rgb_floats@plt>
mov    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyz2rgb>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x3,%edx
sete   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <xyz_to_rgb_floats@plt>
mov    $0x3,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @xyz2rgb(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 3
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load float*, float** %4
%12 = load float*, float** %5
%13 = call i32 @xyz_to_rgb_floats(float* %11, float* %12)
ret i32 3
}

LLVM IR (-O2):
define i32 @xyz2rgb(float* %0, float* %1, i32 %2) {
%4 = icmp eq i32 %2, 3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @xyz_to_rgb_floats(float* %0, float* %1)
ret i32 3
}
/* Type definitions */
struct snck_ctxt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ snck_heap_realloc(struct snck_ctxt const *const, char *const,
                                     unsigned int);
void snck_history_put_line(struct snck_ctxt const *const p_ctxt,
                           char *const a_line) {
  snck_heap_realloc(p_ctxt, a_line, 0u);
}


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

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

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

LLVM IR (-O2):
%struct.snck_ctxt = type { i32 }
define void @snck_history_put_line(%struct.snck_ctxt* %0, i8* %1) {
%3 = tail call i32 @snck_heap_realloc(%struct.snck_ctxt* %0, i8* %1, i32 0)
ret void
}
/* Variables and functions */
int sub_lib_method();
int main() { return 1337 - sub_lib_method(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sub_lib_method@plt>
mov    $0x539,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sub_lib_method()
%2 = sub nsw i32 1337, %1
ret i32 %2
}
/* Variables and functions */
int __get_array_length(char const *);
int /*<<< orphan*/ __require_allocated_array(char const *);
char *strcat(char *s1, const char *s2) {
  int size1;
  int size2;
  __require_allocated_array(s1);
  size1 = __get_array_length(s1);
  __require_allocated_array(s2);
  size2 = __get_array_length(s2);
  if (size2 > size1)
    while (1)
      ;
  return s1;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__require_allocated_array@plt>
mov    -0x8(%rbp),%rdi
call   1040 <__get_array_length@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__require_allocated_array@plt>
mov    -0x10(%rbp),%rdi
call   1040 <__get_array_length@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1170 <strcat+0x50>
jmp    116b <strcat+0x4b>
jmp    116b <strcat+0x4b>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <__require_allocated_array@plt>
mov    %r14,%rdi
call   1040 <__get_array_length@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <__require_allocated_array@plt>
mov    %rbx,%rdi
call   1040 <__get_array_length@plt>
cmp    %ebp,%eax
jle    1152 <strcat+0x32>
nopl   (%rax)
jmp    1150 <strcat+0x30>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strcat(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 = call i32 @__require_allocated_array(i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @__get_array_length(i8* %9)
store i32 %10, i32* %5
%11 = load i8*, i8** %4
%12 = call i32 @__require_allocated_array(i8* %11)
%13 = load i8*, i8** %4
%14 = call i32 @__get_array_length(i8* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %2
br label %19
19: ; preds = %18, %19
br label %19
20: ; preds = %2
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @__require_allocated_array(i8* %0)
%4 = tail call i32 @__get_array_length(i8* %0)
%5 = tail call i32 @__require_allocated_array(i8* %1)
%6 = tail call i32 @__get_array_length(i8* %1)
%7 = icmp sgt i32 %6, %4
br i1 %7, label %8, label %9
8: ; preds = %2, %8
br label %8
9: ; preds = %2
ret i8* %0
}
void insb(unsigned short port, void *addr, unsigned long count) {
  __asm__ __volatile__("rep ; ins"
                       "b"
                       : "=D"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<insb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
rep insb (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insb>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
rep insb (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "rep ; insb", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep ; insb", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
void tegra_dvfs_rail_disable(struct dvfs_rail *rail) {}


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

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

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

LLVM IR (-O2):
%struct.dvfs_rail = type opaque
define void @tegra_dvfs_rail_disable(%struct.dvfs_rail* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello world!"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wrtsac0(char const *, float, int, float, float,
                           float const *, int /*<<< orphan*/);
void wrtsac0_(const char *name, float dt, int ns, float b0, float dist,
              const float *ar) {
  wrtsac0(name, dt, ns, b0, dist, ar, 0);
}


x86 assembly (clang, -O0):
<wrtsac0_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movss  %xmm2,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
mov    -0x10(%rbp),%esi
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <wrtsac0@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrtsac0_>:
xor    %ecx,%ecx
jmp    1030 <wrtsac0@plt>

LLVM IR (-O0):
define void @wrtsac0_(i8* %0, float %1, i32 %2, float %3, float %4, float* %5) {
%7 = alloca i8*
%8 = alloca float
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca float*
store i8* %0, i8** %7
store float %1, float* %8
store i32 %2, i32* %9
store float %3, float* %10
store float %4, float* %11
store float* %5, float** %12
%13 = load i8*, i8** %7
%14 = load float, float* %8
%15 = load i32, i32* %9
%16 = load float, float* %10
%17 = load float, float* %11
%18 = load float*, float** %12
%19 = call i32 @wrtsac0(i8* %13, float %14, i32 %15, float %16, float %17, float* %18, i32 0)
ret void
}

LLVM IR (-O2):
define void @wrtsac0_(i8* %0, float %1, i32 %2, float %3, float %4, float* %5) {
%7 = tail call i32 @wrtsac0(i8* %0, float %1, i32 %2, float %3, float %4, float* %5, i32 0)
ret void
}
/* Variables and functions */
double exp(double);
double efunc2(double x) { return exp(-x); }


x86 assembly (clang, -O0):
<efunc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efunc2>:
xorps  0xee9(%rip),%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @efunc2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @exp(double %4)
ret double %5
}

LLVM IR (-O2):
define double @efunc2(double %0) {
%2 = fneg double %0
%3 = tail call double @exp(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ __mriPlatform_WasProgramCounterModifiedByUser();
scalar_t__ isCurrentInstructionHardcodedBreakpoint();
int shouldSkipHardcodedBreakpoint(void) {
  return !__mriPlatform_WasProgramCounterModifiedByUser() &&
         isCurrentInstructionHardcodedBreakpoint();
}


x86 assembly (clang, -O0):
<shouldSkipHardcodedBreakpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__mriPlatform_WasProgramCounterModifiedByUser@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1(%rbp)
jne    1150 <shouldSkipHardcodedBreakpoint+0x30>
mov    $0x0,%al
call   1040 <isCurrentInstructionHardcodedBreakpoint@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shouldSkipHardcodedBreakpoint>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <__mriPlatform_WasProgramCounterModifiedByUser@plt>
test   %eax,%eax
jne    113d <shouldSkipHardcodedBreakpoint+0x1d>
xor    %eax,%eax
call   1040 <isCurrentInstructionHardcodedBreakpoint@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @shouldSkipHardcodedBreakpoint() {
%1 = call i32 (...) @__mriPlatform_WasProgramCounterModifiedByUser()
%2 = icmp ne i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 (...) @isCurrentInstructionHardcodedBreakpoint()
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @shouldSkipHardcodedBreakpoint() {
%1 = tail call i32 (...) @__mriPlatform_WasProgramCounterModifiedByUser()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @isCurrentInstructionHardcodedBreakpoint()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
int compare(const void *a, const void *b) {
  const int *p = (const int *)a;
  const int *q = (const int *)b;
  return ((*p) & 0x0000FFFF) - ((*q) & 0x0000FFFF);
}


x86 assembly (clang, -O0):
<compare>:
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    (%rax),%eax
and    $0xffff,%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xffff,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movzwl (%rdi),%eax
movzwl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(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 = load i32, i32* %11
%13 = and i32 %12, 65535
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = and i32 %15, 65535
%17 = sub nsw i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = and i32 %5, 65535
%7 = load i32, i32* %4
%8 = and i32 %7, 65535
%9 = sub nsw i32 %6, %8
ret i32 %9
}
int _rl_disable_tty_signals() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_rl_disable_tty_signals() {
ret i32 0
}
/* Variables and functions */
int vprintf(char *, char *, int, int, int *, int /*<<< orphan*/);
void sprint(char *buf, char *form, int a, int b, int c) {
  int n;
  n = vprintf(buf, form, a, b, &c, 0);
  buf[n] = 0;
}


x86 assembly (clang, -O0):
<sprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    -0x1c(%rbp),%r8
xor    %r9d,%r9d
call   1030 <vprintf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %r8d,0xc(%rsp)
lea    0xc(%rsp),%r8
xor    %r9d,%r9d
call   1030 <vprintf@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @sprint(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = call i32 @vprintf(i8* %12, i8* %13, i32 %14, i32 %15, i32* %10, i32 0)
store i32 %16, i32* %11
%17 = load i8*, i8** %6
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 0, i8* %20
ret void
}

LLVM IR (-O2):
define void @sprint(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
store i32 %4, i32* %6
%7 = call i32 @vprintf(i8* %0, i8* %1, i32 %2, i32 %3, i32* %6, i32 0)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
ret void
}
void rop3_239_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D | stk3;
  stk1 = S | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_239_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_239_0_1>:
mov    %esi,%eax
not    %eax
and    %edx,%eax
not    %edx
movzbl (%rdi),%r8d
mov    %edx,%ecx
or     %esi,%ecx
or     %r8d,%ecx
and    %edx,%ecx
and    %r8d,%eax
or     %esi,%eax
or     %ecx,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_239_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = and i32 %28, %30
%32 = load i8, i8* %7
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = or i32 %31, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = xor i32 %42, -1
%44 = and i32 %40, %43
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = and i32 %44, %47
%49 = or i32 %38, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_239_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = xor i32 %4, -1
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = trunc i32 %5 to i8
%9 = zext i8 %1 to i32
%10 = or i8 %8, %1
%11 = or i8 %10, %6
%12 = zext i8 %11 to i32
%13 = and i32 %12, %5
%14 = xor i32 %9, -1
%15 = and i32 %4, %14
%16 = and i32 %15, %7
%17 = or i32 %16, %9
%18 = or i32 %17, %13
%19 = trunc i32 %18 to i8
store i8 %19, i8* %0
ret void
}
/* Variables and functions */
double exp(double);
double sqrt(double);
double gaussian(double x, double y, void *data) {
  return exp(-(x * x + y * y) / 20) / sqrt((3.141592653589793) * 20);
}


x86 assembly (clang, -O0):
<gaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe79(%rip),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussian>:
push   %rax
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
divsd  0xedb(%rip),%xmm0
call   1030 <exp@plt>
divsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gaussian(double %0, double %1, i8* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i8*
store double %0, double* %4
store double %1, double* %5
store i8* %2, i8** %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = fneg double %12
%14 = fdiv double %13, 2.000000e+01
%15 = call double @exp(double %14)
%16 = call double @sqrt(double 0x404F6A7A2955385E)
%17 = fdiv double %15, %16
ret double %17
}

LLVM IR (-O2):
define double @gaussian(double %0, double %1, i8* nocapture readnone %2) {
%4 = fmul double %1, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = fdiv double %5, -2.000000e+01
%7 = tail call double @exp(double %6)
%8 = fdiv double %7, 0x401FB4E4F1347EB9
ret double %8
}
char *helper(void *v) { return (char *)v; }


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

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

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

LLVM IR (-O2):
define i8* @helper(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ check_force(char const *, char *);
int /*<<< orphan*/ pcap_list_delete_at_cursor();
bool cmd_delete(const char *arg) {
  if (!check_force(arg, "Are you sure you want to delete this frame"))
    goto EXIT;
  pcap_list_delete_at_cursor();
EXIT:
  return true;
}


x86 assembly (clang, -O0):
<cmd_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <check_force@plt>
cmp    $0x0,%eax
jne    114a <cmd_delete+0x2a>
jmp    1151 <cmd_delete+0x31>
mov    $0x0,%al
call   1040 <pcap_list_delete_at_cursor@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_delete>:
push   %rax
lea    0xed8(%rip),%rsi
call   1030 <check_force@plt>
test   %eax,%eax
je     1138 <cmd_delete+0x18>
xor    %eax,%eax
call   1040 <pcap_list_delete_at_cursor@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Are you sure you want to delete this frame\00"
define i32 @cmd_delete(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @check_force(i8* %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = call i32 (...) @pcap_list_delete_at_cursor()
br label %9
9: ; preds = %7, %6
ret i32 1
}

LLVM IR (-O2):
@.str = [43 x i8] c"Are you sure you want to delete this frame\00"
define i32 @cmd_delete(i8* %0) {
%2 = tail call i32 @check_force(i8* %0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @pcap_list_delete_at_cursor()
br label %6
6: ; preds = %1, %4
ret i32 1
}
/* Type definitions */
struct timer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_timer(struct timer *);
int /*<<< orphan*/ start_timer(struct timer *);
void clear_timer_start(struct timer *t) {
  clear_timer(t);
  start_timer(t);
}


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

x86 assembly (clang, -O2):
<clear_timer_start>:
push   %rbx
mov    %rdi,%rbx
call   1030 <clear_timer@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <start_timer@plt>

LLVM IR (-O0):
%struct.timer = type { i32 }
define void @clear_timer_start(%struct.timer* %0) {
%2 = alloca %struct.timer*
store %struct.timer* %0, %struct.timer** %2
%3 = load %struct.timer*, %struct.timer** %2
%4 = call i32 @clear_timer(%struct.timer* %3)
%5 = load %struct.timer*, %struct.timer** %2
%6 = call i32 @start_timer(%struct.timer* %5)
ret void
}

LLVM IR (-O2):
%struct.timer = type { i32 }
define void @clear_timer_start(%struct.timer* %0) {
%2 = tail call i32 @clear_timer(%struct.timer* %0)
%3 = tail call i32 @start_timer(%struct.timer* %0)
ret void
}
void setrestart(int *appendold) { *appendold = 0; }


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

x86 assembly (clang, -O2):
<setrestart>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @setrestart(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
__attribute__((no, noclone)) unsigned short foo16(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1L << (sizeof(char) * 8 - 1)) : 0) ||
      arg + 1 > ((!1) ? ((1L << (sizeof(char) * 8 - 1)) - 1)
                      : ((1L << (sizeof(char) * 8)) - 1)))
    return ret;
  arg = arg + 1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0x0,%rax
jl     1139 <foo16+0x39>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0xff,%rax
jle    1146 <foo16+0x46>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1164 <foo16+0x64>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo16>:
lea    0x1(%rdi),%ecx
cmp    $0xff,%edi
mov    $0x1,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @foo16(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = icmp slt i64 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %1
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = icmp sgt i64 %14, 255
br i1 %15, label %16, label %18
16: ; preds = %10, %1
%17 = load i16, i16* %4
store i16 %17, i16* %2
br label %27
18: ; preds = %10
%19 = load i16, i16* %3
%20 = zext i16 %19 to i32
%21 = add nsw i32 %20, 1
%22 = trunc i32 %21 to i16
store i16 %22, i16* %3
%23 = load i16, i16* %3
%24 = trunc i16 %23 to i8
%25 = sext i8 %24 to i16
store i16 %25, i16* %4
%26 = load i16, i16* %3
store i16 %26, i16* %2
br label %27
27: ; preds = %18, %16
%28 = load i16, i16* %2
ret i16 %28
}

LLVM IR (-O2):
define zeroext i16 @foo16(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp ugt i16 %0, 254
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
char findletter(int n) {
  if (n > 89)
    return 'A';
  if (n > 79)
    return 'B';
  if (n > 69)
    return 'C';
  if (n > 59)
    return 'D';
  if (n > 00)
    return 'F';
  return 'Z';
}


x86 assembly (clang, -O0):
<findletter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x59,-0x8(%rbp)
jle    111a <findletter+0x1a>
movb   $0x41,-0x1(%rbp)
jmp    116a <findletter+0x6a>
cmpl   $0x4f,-0x8(%rbp)
jle    112d <findletter+0x2d>
movb   $0x42,-0x1(%rbp)
jmp    116a <findletter+0x6a>
cmpl   $0x45,-0x8(%rbp)
jle    1140 <findletter+0x40>
movb   $0x43,-0x1(%rbp)
jmp    116a <findletter+0x6a>
cmpl   $0x3b,-0x8(%rbp)
jle    1153 <findletter+0x53>
movb   $0x44,-0x1(%rbp)
jmp    116a <findletter+0x6a>
cmpl   $0x0,-0x8(%rbp)
jle    1166 <findletter+0x66>
movb   $0x46,-0x1(%rbp)
jmp    116a <findletter+0x6a>
movb   $0x5a,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findletter>:
mov    $0x41,%al
cmp    $0x59,%edi
jg     112b <findletter+0x2b>
mov    $0x42,%al
cmp    $0x4f,%edi
jg     112b <findletter+0x2b>
mov    $0x43,%al
cmp    $0x45,%edi
jg     112b <findletter+0x2b>
mov    $0x44,%al
cmp    $0x3b,%edi
jg     112b <findletter+0x2b>
test   %edi,%edi
mov    $0x46,%ecx
mov    $0x5a,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @findletter(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 89
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 65, i8* %2
br label %24
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 79
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 66, i8* %2
br label %24
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 69
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 67, i8* %2
br label %24
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 59
br i1 %17, label %18, label %19
18: ; preds = %15
store i8 68, i8* %2
br label %24
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %19
store i8 70, i8* %2
br label %24
23: ; preds = %19
store i8 90, i8* %2
br label %24
24: ; preds = %23, %22, %18, %14, %10, %6
%25 = load i8, i8* %2
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @findletter(i32 %0) {
%2 = icmp sgt i32 %0, 89
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 79
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp sgt i32 %0, 69
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp sgt i32 %0, 59
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp sgt i32 %0, 0
%11 = select i1 %10, i8 70, i8 90
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi i8 [ 65, %1 ], [ 66, %3 ], [ 67, %5 ], [ 68, %7 ], [ %11, %9 ]
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int set_debug(char *optarg) {
  printf("Debugging is not enabled.  -D has been ignored\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Debugging is not enabled. -D has been ignored\0A\00"
define i32 @set_debug(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [47 x i8] c"Debugging is not enabled. -D has been ignored\00"
define i32 @set_debug(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_8Dint64_lowword_reg(long long val) {
  return ((val) & (0x8D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Dint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x8d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_8Dint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 141
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned int f7(int xxx, unsigned yyy, signed char uuu) {
  return xxx ? uuu : yyy;
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1125 <f7+0x25>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112b <f7+0x2b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %esi,%eax
test   %edi,%edi
cmovne %edx,%eax
ret

LLVM IR (-O0):
define i32 @f7(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8, i8* %6
%11 = sext i8 %10 to i32
br label %14
12: ; preds = %3
%13 = load i32, i32* %5
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ %11, %9 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @f7(i32 %0, i32 %1, i8 signext %2) {
%4 = icmp eq i32 %0, 0
%5 = sext i8 %2 to i32
%6 = select i1 %4, i32 %1, i32 %5
ret i32 %6
}
/* Variables and functions */
double abs(double n) {
  if (n < 0)
    return -n;
  else
    return n;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <abs+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <abs+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int str_numchars(char *s, char c) {
  int n = 0;
  while (*s)
    if (*s++ == c)
      n++;
  return n;
}


x86 assembly (clang, -O0):
<str_numchars>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <str_numchars+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <str_numchars+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <str_numchars+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_numchars>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <str_numchars+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_numchars+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_numchars(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = icmp eq i8 %6, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %16
}
int lib2t21(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @lib2t21() {
ret i32 1
}