xunge/DecIR huggingface dataset:
int wobble(int frame, int offset, int len) {
  int x, y;
  x = (frame + offset) % len;
  y = 2 * x / len;
  return y;
}


x86 assembly (clang, -O0):
<wobble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wobble>:
mov    %edx,%ecx
lea    (%rdi,%rsi,1),%eax
cltd
idiv   %ecx
lea    (%rdx,%rdx,1),%eax
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @wobble(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = srem i32 %11, %12
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = mul nsw i32 2, %14
%16 = load i32, i32* %6
%17 = sdiv i32 %15, %16
store i32 %17, i32* %8
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
define i32 @wobble(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = srem i32 %4, %2
%6 = shl nsw i32 %5, 1
%7 = sdiv i32 %6, %2
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigsuspend(int /*<<< orphan*/ *);
void test(void) {
  sigset_t sigmask;
  int result;
  (void)sigemptyset(&sigmask);
  result = sigsuspend(&sigmask);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <sigemptyset@plt>
lea    -0x4(%rbp),%rdi
call   1040 <sigsuspend@plt>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigemptyset@plt>
mov    %rbx,%rdi
call   1040 <sigsuspend@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @sigemptyset(i32* %1)
%4 = call i32 @sigsuspend(i32* %1)
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = call i32 @sigsuspend(i32* %1)
ret void
}
void RTMemEfRealloc(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemEfRealloc() {
ret void
}
/* Variables and functions */
int translate_nodout2(char *, int);
int translate_nodouthf(int handle) {
  return translate_nodout2("/nodouthf", handle);
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"/nodouthf\00"
define i32 @translate_nodouthf(i32 %0) {
%2 = tail call i32 @translate_nodout2(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
/* Variables and functions */
double fabs(double);
int Time_CheckCloseDbl(double a, double b, double eps) {
  return fabs(a - b) < eps;
}


x86 assembly (clang, -O0):
<Time_CheckCloseDbl>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xedc(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Time_CheckCloseDbl>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm2
seta   %al
ret

LLVM IR (-O0):
define i32 @Time_CheckCloseDbl(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = call double @llvm.fabs.f64(double %9)
%11 = load double, double* %6
%12 = fcmp olt double %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @Time_CheckCloseDbl(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp olt double %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
int IPC_peek(int *mess, int *len) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @IPC_peek(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int Libre_pop(size_t *len, unsigned int *arr, unsigned int *l) {
  if (!(*len))
    return 0;
  (*len)--;
  *l = arr[(*arr)];
  return 1;
}


x86 assembly (clang, -O0):
<Libre_pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    112a <Libre_pop+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1152 <Libre_pop+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Libre_pop>:
mov    (%rdi),%rax
test   %rax,%rax
je     111c <Libre_pop+0x1c>
add    $0xffffffffffffffff,%rax
mov    %rax,(%rdi)
mov    (%rsi),%eax
mov    (%rsi,%rax,4),%eax
mov    %eax,(%rdx)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Libre_pop(i64* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i64, i64* %0
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = add i64 %4, -1
store i64 %7, i64* %0
%8 = load i32, i32* %1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %12
12: ; preds = %3, %6
%13 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %13
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
int get_XButtonPressedEvent_type(void *_p) {
  return (int)((XButtonPressedEvent *)_p)->type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XButtonPressedEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XButtonPressedEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void TLV_DEBUG(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @TLV_DEBUG(i8* nocapture %0, ...) {
ret void
}
void mpt_augmentState(float *Xaug, float *X, float *Uprev, float *reference) {
  int i;
  if (0 == 1) {
    for (i = 0; i < 2; i++)
      Xaug[i] = X[i];
    for (i = 0; i < 1; i++)
      Xaug[2 + i] = Uprev[i];
    for (i = 0; i < 0; i++)
      Xaug[2 + 1 + i] = reference[i];
  } else if (0 == 2) {
    for (i = 0; i < 2; i++)
      Xaug[i] = X[i];
    for (i = 0; i < 0; i++)
      Xaug[2 + i] = reference[i];
  } else if (0 == 1) {
    for (i = 0; i < 2; i++)
      Xaug[i] = X[i];
    for (i = 0; i < 1; i++)
      Xaug[2 + i] = Uprev[i];
  } else {
    for (i = 0; i < 2; i++) {
      Xaug[i] = X[i];
    }
  }
}


x86 assembly (clang, -O0):
<mpt_augmentState>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    114d <mpt_augmentState+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111b <mpt_augmentState+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpt_augmentState>:
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @mpt_augmentState(float* nocapture writeonly %0, float* nocapture %1, float* nocapture readnone %2, float* nocapture readnone %3) {
%5 = load float, float* %1
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
ret void
}
/* Variables and functions */
int open_listenfd(int);
int /*<<< orphan*/ unix_error(char *);
int Open_listenfd(int port) {
  int rc;
  if ((rc = open_listenfd(port)) < 0)
    unix_error("Open_listenfd error");
  return rc;
}


x86 assembly (clang, -O0):
<Open_listenfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <open_listenfd@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    114b <Open_listenfd+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Open_listenfd>:
push   %rbx
call   1040 <open_listenfd@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Open_listenfd+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Open_listenfd error\00"
define i32 @Open_listenfd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @open_listenfd(i32 %4)
store i32 %5, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @unix_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"Open_listenfd error\00"
define i32 @Open_listenfd(i32 %0) {
%2 = tail call i32 @open_listenfd(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unix_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
__attribute__((__nothrow__))
realpath(__const char *__restrict __name, char *__restrict __resolved) {}


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

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

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

LLVM IR (-O2):
define i32 @realpath(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1) {
ret i32 undef
}
void mutate_long(long *x) { *x *= 2; }


x86 assembly (clang, -O0):
<mutate_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
shl    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutate_long>:
shlq   (%rdi)
ret

LLVM IR (-O0):
define void @mutate_long(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 2
store i64 %5, i64* %3
ret void
}

LLVM IR (-O2):
define void @mutate_long(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = shl nsw i64 %2, 1
store i64 %3, i64* %0
ret void
}
main() {
  int idx = 0;
  int f = 2;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t get_time(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
  return ((uint64_t)ts.tv_sec * (1000 * 1000 * 1000)) + (uint64_t)ts.tv_nsec;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,%eax,%eax
mov    -0x10(%rbp),%rcx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%eax
3b
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i32 @get_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC_RAW
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i32 @get_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC_RAW
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = add nsw i32 %8, %11
ret i32 %12
}
/* Variables and functions */
void *memzero(void *trg, size_t num) {
  char *dst8 = (char *)trg;
  while (num--) {
    *dst8++ = 0;
  }
  return trg;
}


x86 assembly (clang, -O0):
<memzero>:
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,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1144 <memzero+0x44>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    1114 <memzero+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memzero>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     1126 <memzero+0x16>
mov    %rsi,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @memzero(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
store i8* %6, i8** %5
br label %7
7: ; preds = %11, %2
%8 = load i64, i64* %4
%9 = add i64 %8, -1
store i64 %9, i64* %4
%10 = icmp ne i64 %8, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
store i8 0, i8* %12
br label %7
14: ; preds = %7
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @memzero(i8* returned writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret i8* %0
}
int version_verify(char version) {
  if (version == 0x10)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<version_verify>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x10,%eax
jne    1123 <version_verify+0x23>
movl   $0x1,-0x4(%rbp)
jmp    112a <version_verify+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<version_verify>:
xor    %eax,%eax
cmp    $0x10,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @version_verify(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 16
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @version_verify(i8 signext %0) {
%2 = icmp eq i8 %0, 16
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_1Duint8_reg(unsigned char val) {
  return ((val) & (0x1D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Duint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x1d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_1Duint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 29
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getCommandLine(int *, double *, int, char **);
int /*<<< orphan*/ printHeader(int, double);
int /*<<< orphan*/ printSet(int, double);
int main(int argc, char **argv) {
  int density;
  double maxRadius;
  getCommandLine(&density, &maxRadius, argc, argv);
  printHeader(density, maxRadius);
  printSet(density, maxRadius);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <getCommandLine@plt>
mov    -0x14(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
call   1030 <printHeader@plt>
mov    -0x14(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
call   1050 <printSet@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,%edx
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <getCommandLine@plt>
mov    0xc(%rsp),%edi
movsd  0x10(%rsp),%xmm0
call   1030 <printHeader@plt>
mov    0xc(%rsp),%edi
movsd  0x10(%rsp),%xmm0
call   1050 <printSet@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @getCommandLine(i32* %6, double* %7, i32 %8, i8** %9)
%11 = load i32, i32* %6
%12 = load double, double* %7
%13 = call i32 @printHeader(i32 %11, double %12)
%14 = load i32, i32* %6
%15 = load double, double* %7
%16 = call i32 @printSet(i32 %14, double %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca double
%5 = bitcast i32* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = call i32 @getCommandLine(i32* %3, double* %4, i32 %0, i8** %1)
%8 = load i32, i32* %3
%9 = load double, double* %4
%10 = call i32 @printHeader(i32 %8, double %9)
%11 = load i32, i32* %3
%12 = load double, double* %4
%13 = call i32 @printSet(i32 %11, double %12)
ret i32 0
}
void pmv_(x, y, z) float *x, *y, *z;
{ pmv(*x, *y, *z); }


x86 assembly (clang, -O0):
<pmv_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <pmv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmv_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
movss  (%rdx),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <pmv@plt>

LLVM IR (-O0):
define void @pmv_(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = load float*, float** %5
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = load float*, float** %6
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = call i32 (double, double, double, ...) bitcast (i32 (...)* @pmv to i32 (double, double, double, ...)*)(double %9, double %12, double %15)
ret void
}

LLVM IR (-O2):
define void @pmv_(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %0
%5 = fpext float %4 to double
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @pmv to i32 (double, double, double, ...)*)(double %5, double %7, double %9)
ret void
}
int bye(int argc, char *argv[]) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @bye(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
long double cosh(long double);
long double coshl(long double a1) { return cosh(a1); }


x86 assembly (clang, -O0):
<coshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <cosh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coshl>:
jmp    1030 <cosh@plt>

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

LLVM IR (-O2):
define x86_fp80 @coshl(x86_fp80 %0) {
%2 = tail call x86_fp80 @cosh(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int sched_setaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int osfunctions_movetocpu(int cpu) {
  cpu_set_t mask;
  CPU_ZERO(&mask);
  CPU_SET(cpu, &mask);
  return sched_setaffinity(0, sizeof(cpu_set_t), &mask);
}


x86 assembly (clang, -O0):
<osfunctions_movetocpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <CPU_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setaffinity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osfunctions_movetocpu>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <CPU_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1030 <sched_setaffinity@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @osfunctions_movetocpu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @CPU_ZERO(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @CPU_SET(i32 %5, i32* %3)
%7 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %3)
ret i32 %7
}

LLVM IR (-O2):
define i32 @osfunctions_movetocpu(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @CPU_ZERO(i32* %2)
%5 = call i32 @CPU_SET(i32 %0, i32* %2)
%6 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %2)
ret i32 %6
}
int test_imm_D4int8_reg(signed char val) {
  return ((val) & (-0xD4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D4int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff2c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D4int8_reg>:
test   $0xffffff2c,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D4int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -212
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void eth_set_last_protocol(int protocol) {}


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

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

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

LLVM IR (-O2):
define void @eth_set_last_protocol(i32 %0) {
ret void
}
void WriteShort(unsigned char *p, unsigned short v) {
  p[1] = (unsigned char)(v & 0xFF);
  v >>= 8;
  p[0] = (unsigned char)v;
}


x86 assembly (clang, -O0):
<WriteShort>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%ax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteShort>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @WriteShort(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %8, i8* %10
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = trunc i32 %13 to i16
store i16 %14, i16* %4
%15 = load i16, i16* %4
%16 = trunc i16 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 0
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
define void @WriteShort(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %4
%5 = lshr i16 %1, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %0
ret void
}
int test_imm_C5int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xC5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C5int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12910592
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ le32toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint32_t get_le32(uint8_t **bufferp) {
  uint32_t tmp;
  memcpy(&tmp, *bufferp, sizeof(tmp));
  *bufferp += sizeof(tmp);
  return le32toh(tmp);
}


x86 assembly (clang, -O0):
<get_le32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%edi
call   1030 <le32toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_le32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xc(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
addq   $0x10,(%rbx)
mov    0xc(%rsp),%edi
call   1030 <le32toh@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_le32(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = call i32 @memcpy(i32* %3, i32* %5, i32 4)
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 4
store i32* %9, i32** %7
%10 = load i32, i32* %3
%11 = call i32 @le32toh(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_le32(i32** nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32*, i32** %0
%5 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
%6 = load i32*, i32** %0
%7 = getelementptr inbounds i32, i32* %6, i64 4
store i32* %7, i32** %0
%8 = load i32, i32* %2
%9 = call i32 @le32toh(i32 %8)
ret i32 %9
}
/* Variables and functions */
long f();
long func1() { return f() + f() + f() + f(); }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <f@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <f@plt>
mov    %rax,%rbx
add    %r14,%rbx
xor    %eax,%eax
call   1030 <f@plt>
mov    %rax,%r14
add    %rbx,%r14
xor    %eax,%eax
call   1030 <f@plt>
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @func1() {
%1 = call i64 (...) @f()
%2 = call i64 (...) @f()
%3 = add nsw i64 %1, %2
%4 = call i64 (...) @f()
%5 = add nsw i64 %3, %4
%6 = call i64 (...) @f()
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @func1() {
%1 = tail call i64 (...) @f()
%2 = tail call i64 (...) @f()
%3 = add nsw i64 %2, %1
%4 = tail call i64 (...) @f()
%5 = add nsw i64 %3, %4
%6 = tail call i64 (...) @f()
%7 = add nsw i64 %5, %6
ret i64 %7
}
void __hv_lte_f(float bIn0, float bIn1, float *bOut) {
  *bOut = (bIn0 <= bIn1) ? 1.0f : 0.0f;
}


x86 assembly (clang, -O0):
<__hv_lte_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xedc(%rip),%xmm3
xorps  %xmm2,%xmm2
cmpless %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__hv_lte_f(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp ole float %7, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, float 1.000000e+00, float 0.000000e+00
%12 = load float*, float** %6
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @__hv_lte_f(float %0, float %1, float* nocapture writeonly %2) {
%4 = fcmp ole float %0, %1
%5 = select i1 %4, float 1.000000e+00, float 0.000000e+00
store float %5, float* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void tests_free_nosize(void *ptr) {
  {
    free(ptr);
    return;
  }
}


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

x86 assembly (clang, -O2):
<tests_free_nosize>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @tests_free_nosize(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insertion(int *, int, int);
void linearInsertionSort(int vector[], int size) {
  for (int i = 1; i < size; i++)
    insertion(vector, vector[i], i + 1);
}


x86 assembly (clang, -O0):
<linearInsertionSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <linearInsertionSort+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
call   1030 <insertion@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <linearInsertionSort+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearInsertionSort>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1147 <linearInsertionSort+0x37>
mov    %rdi,%r14
mov    %esi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,4),%esi
add    $0x1,%rbx
mov    %r14,%rdi
mov    %ebx,%edx
call   1030 <insertion@plt>
cmp    %rbx,%r15
jne    1130 <linearInsertionSort+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @linearInsertionSort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = add nuw nsw i64 %8, 1
%12 = trunc i64 %11 to i32
%13 = tail call i32 @insertion(i32* %0, i32 %10, i32 %12)
%14 = icmp eq i64 %11, %5
br i1 %14, label %6, label %7
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ above;
};
struct TYPE_4__ {
  TYPE_1__ xconfigurerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xconfigurerequest_above(void *_p) {
  return (unsigned long)((XEvent *)_p)->xconfigurerequest.above;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xconfigurerequest_above(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xconfigurerequest_above(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int used_func(int);
int main(void) { return used_func(5); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
jmp    1030 <used_func@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @used_func(i32 5)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @used_func(i32 5)
ret i32 %1
}
void av_hmac_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_hmac_alloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *strDup(int *);
int *string();
int /*<<< orphan*/ strprint(int *);
int main() {
  int *x = string();
  int *y = strDup(x);
  strprint(y);
  free(x);
  free(y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <string@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strDup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strprint@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <string@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1050 <strDup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <strprint@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* (...) @string()
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32* @strDup(i32* %4)
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @strprint(i32* %6)
%8 = load i32*, i32** %1
%9 = call i32 @free(i32* %8)
%10 = load i32*, i32** %2
%11 = call i32 @free(i32* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @string()
%2 = tail call i32* @strDup(i32* %1)
%3 = tail call i32 @strprint(i32* %2)
%4 = tail call i32 @free(i32* %1)
%5 = tail call i32 @free(i32* %2)
ret i32 0
}
/* Variables and functions */
int __aeabi_uidivmod(unsigned int, unsigned int);
unsigned __aeabi_uidiv(unsigned numerator, unsigned denominator) {
  return __aeabi_uidivmod(numerator, denominator);
}


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

x86 assembly (clang, -O2):
<__aeabi_uidiv>:
jmp    1030 <__aeabi_uidivmod@plt>

LLVM IR (-O0):
define i32 @__aeabi_uidiv(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 = call i32 @__aeabi_uidivmod(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__aeabi_uidiv(i32 %0, i32 %1) {
%3 = tail call i32 @__aeabi_uidivmod(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
long core___core__NativeString___char_to_byte_index_cached(char *, long, long,
                                                           long);
long core___core__NativeString___char_to_byte_index(char *self, long p0) {
  long var;
  long var_n;
  long var1;
  var_n = p0;
  {
    var1 = core___core__NativeString___char_to_byte_index_cached(self, var_n,
                                                                 0l, 0l);
  }
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<core___core__NativeString___char_to_byte_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <core___core__NativeString___char_to_byte_index_cached@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<core___core__NativeString___char_to_byte_index>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <core___core__NativeString___char_to_byte_index_cached@plt>

LLVM IR (-O0):
define i64 @core___core__NativeString___char_to_byte_index(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%8 = load i64, i64* %4
store i64 %8, i64* %6
%9 = load i8*, i8** %3
%10 = load i64, i64* %6
%11 = call i64 @core___core__NativeString___char_to_byte_index_cached(i8* %9, i64 %10, i64 0, i64 0)
store i64 %11, i64* %7
%12 = load i64, i64* %7
store i64 %12, i64* %5
br label %13
13: ; preds = %2
%14 = load i64, i64* %5
ret i64 %14
}

LLVM IR (-O2):
define i64 @core___core__NativeString___char_to_byte_index(i8* %0, i64 %1) {
%3 = tail call i64 @core___core__NativeString___char_to_byte_index_cached(i8* %0, i64 %1, i64 0, i64 0)
ret i64 %3
}
/* Variables and functions */
scalar_t__ echo(char *, char *);
int op_shl(char *operand, char **filename) {
  return echo("%s", operand) ? 1 : 0;
}


x86 assembly (clang, -O0):
<op_shl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <echo@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_shl>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <echo@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @op_shl(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = call i64 @echo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @op_shl(i8* %0, i8** nocapture readnone %1) {
%3 = tail call i64 @echo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int checkRegister(char *token) {
  return (token != NULL) ? (token[0] == '$') : 0;
}


x86 assembly (clang, -O0):
<checkRegister>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112d <checkRegister+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x24,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <checkRegister+0x37>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <checkRegister+0x37>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkRegister>:
xor    %eax,%eax
test   %rdi,%rdi
je     110d <checkRegister+0xd>
cmpb   $0x24,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @checkRegister(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 36
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}