xunge/DecIR huggingface dataset:
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
size_t uint8PackSize(char *);
size_t uint8Unpack(const char *buffer, size_t size, uint8_t *data) {
  size_t req = uint8PackSize(data);
  if (size >= req) {
    *data = buffer[0];
  }
  return req;
}


x86 assembly (clang, -O0):
<uint8Unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <uint8PackSize@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     114b <uint8Unpack+0x3b>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint8Unpack>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rdx,%rdi
call   1030 <uint8PackSize@plt>
cmp    %r15,%rax
ja     1130 <uint8Unpack+0x20>
mov    (%r14),%cl
mov    %cl,(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @uint8Unpack(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i64 @uint8PackSize(i8* %8)
store i64 %9, i64* %7
%10 = load i64, i64* %5
%11 = load i64, i64* %7
%12 = icmp uge i64 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = load i8*, i8** %6
store i8 %16, i8* %17
br label %18
18: ; preds = %13, %3
%19 = load i64, i64* %7
ret i64 %19
}

LLVM IR (-O2):
define i64 @uint8Unpack(i8* nocapture %0, i64 %1, i8* %2) {
%4 = tail call i64 @uint8PackSize(i8* %2)
%5 = icmp ugt i64 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = load i8, i8* %0
store i8 %7, i8* %2
br label %8
8: ; preds = %6, %3
ret i64 %4
}
/* Variables and functions */
scalar_t__ isfinite(double);
double force_finite(double x) { return isfinite(x) ? x : 0; }


x86 assembly (clang, -O0):
<force_finite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <isfinite@plt>
cmp    $0x0,%rax
je     1140 <force_finite+0x30>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114d <force_finite+0x3d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114d <force_finite+0x3d>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<force_finite>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <isfinite@plt>
xorps  %xmm0,%xmm0
test   %rax,%rax
je     1128 <force_finite+0x18>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @force_finite(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @isfinite(double %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi double [ %7, %6 ], [ 0.000000e+00, %8 ]
ret double %10
}

LLVM IR (-O2):
define double @force_finite(double %0) {
%2 = tail call i64 @isfinite(double %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, double 0.000000e+00, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_options(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++)
    printf("%s ", argv[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115a <print_options+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_options+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_options>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1157 <print_options+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_options+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @print_options(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ TimerBaseValid(unsigned long);
void TimerMatchSet64(unsigned long ulBase, unsigned long long ullValue) {
  DEBUG_ASSERT(TimerBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000034))) = ullValue >> 32;
  (*((volatile unsigned long *)(ulBase + 0x00000030))) = ullValue & 0xffffffff;
}


x86 assembly (clang, -O0):
<TimerMatchSet64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <TimerBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
shr    $0x20,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x34(%rax)
movabs $0xffffffff,%rcx
and    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerMatchSet64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <TimerBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    %r14,%rax
shr    $0x20,%rax
mov    %rax,0x34(%rbx)
mov    %r14d,%eax
mov    %rax,0x30(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @TimerMatchSet64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @TimerBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = lshr i64 %8, 32
%10 = load i64, i64* %3
%11 = add i64 %10, 52
%12 = inttoptr i64 %11 to i64*
store volatile i64 %9, i64* %12
%13 = load i64, i64* %4
%14 = and i64 %13, 4294967295
%15 = load i64, i64* %3
%16 = add i64 %15, 48
%17 = inttoptr i64 %16 to i64*
store volatile i64 %14, i64* %17
ret void
}

LLVM IR (-O2):
define void @TimerMatchSet64(i64 %0, i64 %1) {
%3 = tail call i32 @TimerBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = lshr i64 %1, 32
%6 = add i64 %0, 52
%7 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
%8 = and i64 %1, 4294967295
%9 = add i64 %0, 48
%10 = inttoptr i64 %9 to i64*
store volatile i64 %8, i64* %10
ret void
}
void *dlopen(const char *file, int flag) { return (void *)0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dlopen(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
void foo505(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo505(i32 %0) {
ret void
}
int arg_array(int i, int j[20]) {
  (void)j;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @arg_array(i32 returned %0, i32* nocapture readnone %1) {
ret i32 %0
}
int wpa_driver_wired_set_wpa(void *priv, int enabled) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wpa_driver_wired_set_wpa(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int numa_num_task_cpus();
int numa_num_thread_cpus(void) { return numa_num_task_cpus(); }


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

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

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

LLVM IR (-O2):
define i32 @numa_num_thread_cpus() {
%1 = tail call i32 (...) @numa_num_task_cpus()
ret i32 %1
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, unsigned long long);
void *dinfo_malloc(size_t size) {
  void *result;
  result = malloc(size);
  if (result == NULL) {
    printf("Could not allocate %lld bytes of memory", (unsigned long long)size);
  }
  return result;
}


x86 assembly (clang, -O0):
<dinfo_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <dinfo_malloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dinfo_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <dinfo_malloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Could not allocate %lld bytes of memory\00"
define i8* @dinfo_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [40 x i8] c"Could not allocate %lld bytes of memory\00"
define noalias i8* @dinfo_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int compare_tree_desc_y(const void *p1, const void *p2) {
  const double x1 = *((const double *)p1 + 1);
  const double x2 = *((const double *)p2 + 1);
  if (x1 != x2)
    return (x1 > x2) ? -1 : 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_tree_desc_y>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1143 <compare_tree_desc_y+0x43>
jp     1143 <compare_tree_desc_y+0x43>
jmp    1166 <compare_tree_desc_y+0x66>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116d <compare_tree_desc_y+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_tree_desc_y>:
movsd  0x8(%rdi),%xmm0
xor    %eax,%eax
xor    %ecx,%ecx
ucomisd 0x8(%rsi),%xmm0
setbe  %cl
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_tree_desc_y(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
store double %11, double* %6
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to double*
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
store double %15, double* %7
%16 = load double, double* %6
%17 = load double, double* %7
%18 = fcmp une double %16, %17
br i1 %18, label %19, label %25
19: ; preds = %2
%20 = load double, double* %6
%21 = load double, double* %7
%22 = fcmp ogt double %20, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 -1, i32 1
store i32 %24, i32* %3
br label %26
25: ; preds = %2
store i32 0, i32* %3
br label %26
26: ; preds = %25, %19
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @compare_tree_desc_y(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = bitcast i8* %3 to double*
%5 = load double, double* %4
%6 = getelementptr inbounds i8, i8* %1, i64 8
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = fcmp une double %5, %8
%10 = fcmp ogt double %5, %8
%11 = select i1 %10, i32 -1, i32 1
%12 = select i1 %9, i32 %11, i32 0
ret i32 %12
}
/* Variables and functions */
scalar_t__ isalpha(int);
int aanum(int ch) {
  static int aacvs[] = {999, 0,  20, 4, 3, 6,  13, 7,  8,  9,  22, 11, 10, 12,
                        2,   22, 14, 5, 1, 15, 16, 22, 19, 17, 22, 18, 21};
  return (isalpha(ch) ? aacvs[ch & 31] : 22);
}


x86 assembly (clang, -O0):
<aanum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     1148 <aanum+0x38>
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0x2ef3(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <aanum+0x45>
mov    $0x16,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <aanum+0x45>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aanum>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
je     112c <aanum+0x1c>
and    $0x1f,%ebx
lea    0xed9(%rip),%rax
mov    (%rax,%rbx,4),%eax
pop    %rbx
ret
mov    $0x16,%eax
pop    %rbx
ret

LLVM IR (-O0):
@aanum.aacvs = internal global [27 x i32] [i32 999, i32 0, i32 20, i32 4, i32 3, i32 6, i32 13, i32 7, i32 8, i32 9, i32 22, i32 11, i32 10, i32 12, i32 2, i32 22, i32 14, i32 5, i32 1, i32 15, i32 16, i32 22, i32 19, i32 17, i32 22, i32 18, i32 21]
define i32 @aanum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, 31
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [27 x i32], [27 x i32]* @aanum.aacvs, i64 0, i64 %9
%11 = load i32, i32* %10
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %6
%14 = phi i32 [ %11, %6 ], [ 22, %12 ]
ret i32 %14
}

LLVM IR (-O2):
@aanum.aacvs = internal unnamed_addr constant [27 x i32] [i32 999, i32 0, i32 20, i32 4, i32 3, i32 6, i32 13, i32 7, i32 8, i32 9, i32 22, i32 11, i32 10, i32 12, i32 2, i32 22, i32 14, i32 5, i32 1, i32 15, i32 16, i32 22, i32 19, i32 17, i32 22, i32 18, i32 21]
define i32 @aanum(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = and i32 %0, 31
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [27 x i32], [27 x i32]* @aanum.aacvs, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 22, %1 ]
ret i32 %10
}
void EC_POINT_point2hex(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_point2hex() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int feof(int /*<<< orphan*/ *);
int g_feof(void *p) { return feof((FILE *)p); }


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

x86 assembly (clang, -O2):
<g_feof>:
jmp    1030 <feof@plt>

LLVM IR (-O0):
define i32 @g_feof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @feof(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @g_feof(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @feof(i32* %2)
ret i32 %3
}
void *_get_new_pa(long size) {
  long ret;
  if ((long)((*(long *)(0x3FFFFFFF8)) - size) >= (long)(0x300200000)) {
    *(long *)(0x3FFFFFFF8) = *(long *)(0x3FFFFFFF8) - size;
    ret = *(long *)(0x3FFFFFFF8);
  } else
    ret = (long)0;
  return (void *)ret;
}


x86 assembly (clang, -O0):
<_get_new_pa>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x3fffffff8,%rax
mov    (%rax),%rax
sub    -0x8(%rbp),%rax
movabs $0x300200000,%rcx
cmp    %rcx,%rax
jl     1160 <_get_new_pa+0x60>
movabs $0x3fffffff8,%rax
mov    (%rax),%rcx
sub    -0x8(%rbp),%rcx
movabs $0x3fffffff8,%rax
mov    %rcx,(%rax)
movabs $0x3fffffff8,%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1168 <_get_new_pa+0x68>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_new_pa>:
movabs $0x3fffffff8,%rcx
mov    (%rcx),%rax
sub    %rdi,%rax
movabs $0x300200000,%rdx
cmp    %rdx,%rax
jl     1123 <_get_new_pa+0x23>
mov    %rax,(%rcx)
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @_get_new_pa(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* inttoptr (i64 17179869176 to i64*)
%5 = load i64, i64* %2
%6 = sub nsw i64 %4, %5
%7 = icmp sge i64 %6, 12886999040
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i64, i64* inttoptr (i64 17179869176 to i64*)
%10 = load i64, i64* %2
%11 = sub nsw i64 %9, %10
store i64 %11, i64* inttoptr (i64 17179869176 to i64*)
%12 = load i64, i64* inttoptr (i64 17179869176 to i64*)
store i64 %12, i64* %3
br label %14
13: ; preds = %1
store i64 0, i64* %3
br label %14
14: ; preds = %13, %8
%15 = load i64, i64* %3
%16 = inttoptr i64 %15 to i8*
ret i8* %16
}

LLVM IR (-O2):
define i8* @_get_new_pa(i64 %0) {
%2 = load i64, i64* inttoptr (i64 17179869176 to i64*)
%3 = sub nsw i64 %2, %0
%4 = icmp sgt i64 %3, 12886999039
br i1 %4, label %5, label %7
5: ; preds = %1
store i64 %3, i64* inttoptr (i64 17179869176 to i64*)
%6 = inttoptr i64 %3 to i8*
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ null, %1 ]
ret i8* %8
}
int fact(int n) {
  if (n != 1)
    return n * fact(n - 1);
}


x86 assembly (clang, -O0):
<fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1141 <fact+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fact@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fact(i32 %0) {
ret i32 0
}
int test_00(float a, float b) { return a <= b; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @test_00(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ole float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_00(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
__attribute__((always_)) int ffs(int x) {
  int r;
  asm("bsfl %1,%0\n\t"
      "jnz 1f\n\t"
      "movl $-1,%0\n"
      "1:"
      : "=r"(r)
      : "rm"(x));
  return r + 1;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
bsf    -0xc(%rbp),%eax
jne    111c <ffs+0x1c>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
mov    %edi,-0x4(%rsp)
bsf    -0x4(%rsp),%eax
jne    1110 <ffs+0x10>
mov    $0xffffffff,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ffs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "bsfl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = tail call i32 asm "bsfl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
int mfm_shell_len(char *text) {
  int res = 3;
  for (char *c = text; *c; c++) {
    switch (*c) {
    case '\\':
    case '"':
      res += 2;
      break;
    default:
      res++;
      break;
    }
  }
  return res;
}


x86 assembly (clang, -O0):
<mfm_shell_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     117a <mfm_shell_len+0x7a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x22,%eax
je     114d <mfm_shell_len+0x4d>
jmp    113c <mfm_shell_len+0x3c>
mov    -0x1c(%rbp),%eax
sub    $0x5c,%eax
jne    115b <mfm_shell_len+0x5b>
jmp    114d <mfm_shell_len+0x4d>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <mfm_shell_len+0x64>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1169 <mfm_shell_len+0x69>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <mfm_shell_len+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfm_shell_len>:
mov    (%rdi),%cl
test   %cl,%cl
je     1132 <mfm_shell_len+0x32>
add    $0x1,%rdi
mov    $0x3,%eax
nop
cmp    $0x5c,%cl
sete   %dl
cmp    $0x22,%cl
sete   %cl
or     %dl,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x1,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <mfm_shell_len+0x10>
ret
mov    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @mfm_shell_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 3, %1 ], [ %14, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i8 [ %16, %6 ], [ %2, %1 ]
%8 = phi i8* [ %15, %6 ], [ %0, %1 ]
%9 = phi i32 [ %14, %6 ], [ 3, %1 ]
%10 = icmp eq i8 %7, 92
%11 = icmp eq i8 %7, 34
%12 = or i1 %10, %11
%13 = select i1 %12, i32 2, i32 1
%14 = add nuw nsw i32 %9, %13
%15 = getelementptr inbounds i8, i8* %8, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *giveMeAString();
int main(int argc, char *argv[]) {
  char *str = giveMeAString();
  free(str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <giveMeAString@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @giveMeAString()
%4 = tail call i32 @free(i8* %3)
ret i32 0
}
int M_sub(int a, int b) { return a - b; }


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

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

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

LLVM IR (-O2):
define i32 @M_sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free_memory(double *, int);
void num_free(double *p) { free_memory(p, sizeof(double)); }


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

x86 assembly (clang, -O2):
<num_free>:
mov    $0x8,%esi
jmp    1030 <free_memory@plt>

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

LLVM IR (-O2):
define void @num_free(double* %0) {
%2 = tail call i32 @free_memory(double* %0, i32 8)
ret void
}
/* Variables and functions */
int edit1(int *, char);
int visual(void *v) {
  int *msgvec = v;
  return edit1(msgvec, 'v');
}


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

x86 assembly (clang, -O2):
<visual>:
mov    $0x76,%esi
jmp    1030 <edit1@plt>

LLVM IR (-O0):
define i32 @visual(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @edit1(i32* %6, i8 signext 118)
ret i32 %7
}

LLVM IR (-O2):
define i32 @visual(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @edit1(i32* %2, i8 signext 118)
ret i32 %3
}
int main(void) { 5 ? (void)5 : (void)6; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void XListHosts() {}


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

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

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

LLVM IR (-O2):
define void @XListHosts() {
ret void
}
int comp(const void *e1, const void *e2) {
  unsigned a = *((unsigned *)e1);
  unsigned b = *((unsigned *)e2);
  if (a > b) {
    return 1;
  }
  if (b > a) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    1136 <comp+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <comp+0x55>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jbe    114e <comp+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <comp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
sbb    %edx,%edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ugt i32 %4, %6
%8 = icmp ugt i32 %6, %4
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void kill_launcher(int signal) { kill(0, SIGTERM); }


x86 assembly (clang, -O0):
<kill_launcher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_launcher>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
jmp    1030 <kill@plt>

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

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @kill_launcher(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = tail call i32 @kill(i32 0, i32 %2)
ret void
}
void strip(char *s) {
  char *p2 = s;
  while (*s != '\0') {
    if (*s != '\r' && *s != '\n') {
      *p2++ = *s++;
    } else {
      ++s;
    }
  }
  *p2 = '\0';
}


x86 assembly (clang, -O0):
<strip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1178 <strip+0x78>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1167 <strip+0x67>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1167 <strip+0x67>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1173 <strip+0x73>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strip+0x10>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip>:
mov    %rdi,%rax
jmp    1114 <strip+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0xa,%cl
je     1110 <strip+0x10>
cmp    $0xd,%cl
je     1110 <strip+0x10>
test   %cl,%cl
je     112d <strip+0x2d>
mov    %cl,(%rax)
add    $0x1,%rax
jmp    1110 <strip+0x10>
movb   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @strip(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 = %29, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %30
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 13
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 10
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
%23 = load i8, i8* %21
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %3
store i8 %23, i8* %24
br label %29
26: ; preds = %15, %10
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %2
br label %29
29: ; preds = %26, %20
br label %5
30: ; preds = %5
%31 = load i8*, i8** %3
store i8 0, i8* %31
ret void
}

LLVM IR (-O2):
define void @strip(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %11
i8 13, label %8
i8 10, label %8
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %5, i8* %4
br label %8
8: ; preds = %2, %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
store i8 0, i8* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int count;
  count = 3;
  count = 8;
  int x = count;
  count++;
  printf("count is %d and x is %d\n", count, x);
}


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"count is %d and x is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 9, i32 8)
ret i32 0
}
void cpu_init_stack_canary(int cpu, struct task_struct *idle) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @cpu_init_stack_canary(i32 %0, %struct.task_struct* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *me) {
  fprintf(stderr, "%s: usage: %s [-vn] <image or block device>\n", me, me);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
mov    %rcx,%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"%s: usage: %s [-vn] <image or block device>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"%s: usage: %s [-vn] <image or block device>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
unsigned long long ft_read_tsc(void) {
  unsigned long long ret;
  __asm__ __volatile__("rdtsc" : "=A"(ret));
  return ret;
}


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

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

LLVM IR (-O0):
define i64 @ft_read_tsc() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @ft_read_tsc() {
%1 = tail call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ connect_to_server(int, struct sockaddr_in *);
int init_socket();
int /*<<< orphan*/ login(int);
int /*<<< orphan*/ set_socket(struct sockaddr_in *);
void connect_to_irc(int *socket, struct sockaddr_in *socket_conf) {
  *socket = init_socket();
  set_socket(socket_conf);
  connect_to_server(*socket, socket_conf);
  login(*socket);
}


x86 assembly (clang, -O0):
<connect_to_irc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <init_socket@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1050 <set_socket@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <connect_to_server@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <login@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connect_to_irc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <init_socket@plt>
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1050 <set_socket@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
call   1030 <connect_to_server@plt>
mov    (%rbx),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <login@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
define void @connect_to_irc(i32* %0, %struct.sockaddr_in* %1) {
%3 = alloca i32*
%4 = alloca %struct.sockaddr_in*
store i32* %0, i32** %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
%5 = call i32 (...) @init_socket()
%6 = load i32*, i32** %3
store i32 %5, i32* %6
%7 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%8 = call i32 @set_socket(%struct.sockaddr_in* %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%12 = call i32 @connect_to_server(i32 %10, %struct.sockaddr_in* %11)
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = call i32 @login(i32 %14)
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define void @connect_to_irc(i32* nocapture %0, %struct.sockaddr_in* %1) {
%3 = tail call i32 (...) @init_socket()
store i32 %3, i32* %0
%4 = tail call i32 @set_socket(%struct.sockaddr_in* %1)
%5 = load i32, i32* %0
%6 = tail call i32 @connect_to_server(i32 %5, %struct.sockaddr_in* %1)
%7 = load i32, i32* %0
%8 = tail call i32 @login(i32 %7)
ret void
}
int f1(int x, int y) { return (y & 0xfffffff) | (((x << 28) & 0xf0000000)); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffffff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1c,%ecx
and    $0xf0000000,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
and    $0xfffffff,%esi
shl    $0x1c,%edi
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 268435455
%7 = load i32, i32* %3
%8 = shl i32 %7, 28
%9 = and i32 %8, -268435456
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = and i32 %1, 268435455
%4 = shl i32 %0, 28
%5 = or i32 %3, %4
ret i32 %5
}
void exit(int status) {
  _Exit(status);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_Exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
call   1030 <_Exit@plt>

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

LLVM IR (-O2):
define void @exit(i32 %0) {
tail call void @_Exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
gid_t __getgid() {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__getgid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__getgid() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__getgid() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
int t(int a) { return a + 1; }


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

x86 assembly (clang, -O2):
<t>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @t(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void ff_hevc_put_hevc_uni_w_epel_v4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v4_12_sse4() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
uint32_t netb_l(uint32_t value) { return htonl(value); }


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

x86 assembly (clang, -O2):
<netb_l>:
jmp    1030 <htonl@plt>

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

LLVM IR (-O2):
define i32 @netb_l(i32 %0) {
%2 = tail call i32 @htonl(i32 %0)
ret i32 %2
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ xalloc_die();
void *xrealloc(void *ptr, size_t size) {
  void *res = realloc(ptr, size);
  if (!res) {
    xalloc_die();
  }
  return res;
}


x86 assembly (clang, -O0):
<xrealloc>:
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   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xrealloc+0x33>
mov    $0x0,%al
call   1030 <xalloc_die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @xalloc_die()
br label %7
7: ; preds = %5, %2
ret i8* %3
}