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

/* Variables and functions */
void store4(uint8_t *buf, int value) {
  buf[0] = value;
  buf[1] = value >> 8;
  buf[2] = value >> 16;
  buf[3] = value >> 24;
}


x86 assembly (clang, -O0):
<store4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store4>:
mov    %esi,(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x8(%rdi)
sar    $0x18,%esi
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @store4(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
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 %5, i32* %7
%8 = load i32, i32* %4
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 16
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 2
store i32 %13, i32* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 24
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 3
store i32 %17, i32* %19
ret void
}

LLVM IR (-O2):
define void @store4(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
%5 = ashr i32 %1, 16
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %6
%7 = ashr i32 %1, 24
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %8
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
void set_XReparentEvent_send_event(void *_p, int _v) {
  ((XReparentEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XReparentEvent_send_event>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XReparentEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int ffsl(unsigned long i) {
  int j = 0;
  if (i) {
    for (j = 1; (i & 1) == 0; j++)
      i >>= 1;
  }
  return j;
}


x86 assembly (clang, -O0):
<ffsl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1152 <ffsl+0x52>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    114d <ffsl+0x4d>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <ffsl+0x21>
jmp    1152 <ffsl+0x52>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffsl>:
test   %rdi,%rdi
je     1130 <ffsl+0x30>
mov    $0x1,%eax
test   $0x1,%dil
jne    112f <ffsl+0x2f>
mov    $0x1,%eax
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%eax
test   $0x2,%dil
mov    %rcx,%rdi
je     1120 <ffsl+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ffsl(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i64 %0, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i64 [ %9, %6 ], [ %0, %3 ]
%9 = lshr i64 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i64 %8, 2
%12 = icmp eq i64 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char);
int /*<<< orphan*/ stderr;
int main() {
  signed char c, c1;
  signed short i2a;
  signed int lsthdr[3];
  int iopt, ierr;
  unsigned int i, j;
  signed int ii;
  for (ii = -128; ii < 129; ii++) {
    c = (signed char)ii;
    fprintf(stderr, "ii = %3d c = %3d\n", ii, c);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffff80,-0x28(%rbp)
cmpl   $0x81,-0x28(%rbp)
jge    1163 <main+0x53>
mov    -0x28(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%edx
lea    0xeb4(%rip),%rsi
movsbl -0x5(%rbp),%ecx
call   1030 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0xffffff80,%ebx
mov    0x2ebf(%rip),%r15
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15),%edi
movsbl %bl,%ecx
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
add    $0x1,%ebx
cmp    $0x81,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"ii = %3d c = %3d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i16
%5 = alloca [3 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i32 -128, i32* %10
br label %11
11: ; preds = %21, %0
%12 = load i32, i32* %10
%13 = icmp slt i32 %12, 129
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32, i32* %10
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
%17 = load i32, i32* @stderr
%18 = load i32, i32* %10
%19 = load i8, i8* %2
%20 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %18, i8 signext %19)
br label %21
21: ; preds = %14
%22 = load i32, i32* %10
%23 = add nsw i32 %22, 1
store i32 %23, i32* %10
br label %11
24: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"ii = %3d c = %3d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -128, %0 ], [ %6, %1 ]
%3 = trunc i32 %2 to i8
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2, i8 signext %3)
%6 = add nsw i32 %2, 1
%7 = icmp eq i32 %6, 129
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
size_t jt_Fread(void *buffer, size_t size, size_t count, FILE *stream) {
  return fread(buffer, size, count, stream);
}


x86 assembly (clang, -O0):
<jt_Fread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jt_Fread>:
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i64 @jt_Fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i64 @fread(i8* %9, i64 %10, i64 %11, i32* %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @jt_Fread(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %5
}
void console_title(const char *title) {}


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

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

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

LLVM IR (-O2):
define void @console_title(i8* nocapture %0) {
ret void
}
int xls_is_bigendian() {
  static int n = 1;
  return (*(char *)&n == 0);
}


x86 assembly (clang, -O0):
<xls_is_bigendian>:
push   %rbp
mov    %rsp,%rbp
movsbl 0x2f15(%rip),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@xls_is_bigendian.n = internal global i32 1
define i32 @xls_is_bigendian() {
%1 = load i8, i8* bitcast (i32* @xls_is_bigendian.n to i8*)
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @xls_is_bigendian() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_key_t;

/* Variables and functions */
int pthread_key_create(int /*<<< orphan*/ *, void (*)(void *));
int bglpth_pthread_key_create(pthread_key_t *key, void *fun) {
  return pthread_key_create(key, (void (*)(void *))fun);
}


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

x86 assembly (clang, -O2):
<bglpth_pthread_key_create>:
jmp    1030 <pthread_key_create@plt>

LLVM IR (-O0):
define i32 @bglpth_pthread_key_create(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to void (i8*)*
%8 = call i32 @pthread_key_create(i32* %5, void (i8*)* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @bglpth_pthread_key_create(i32* %0, i8* %1) {
%3 = bitcast i8* %1 to void (i8*)*
%4 = tail call i32 @pthread_key_create(i32* %0, void (i8*)* %3)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash_tw1(uint32_t a) {
  a += ~(a << 15);
  a ^= (a >> 10);
  a += (a << 3);
  a ^= (a >> 6);
  a += ~(a << 11);
  a ^= (a >> 16);
  return a;
}


x86 assembly (clang, -O0):
<hash_tw1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xf,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xa,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x6,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xb,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_tw1>:
mov    %edi,%eax
shl    $0xf,%eax
not    %eax
add    %edi,%eax
mov    %eax,%ecx
sar    $0xa,%ecx
xor    %eax,%ecx
lea    (%rcx,%rcx,8),%eax
mov    %eax,%ecx
sar    $0x6,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
shl    $0xb,%edx
not    %edx
add    %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash_tw1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 15
%5 = xor i32 %4, -1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = ashr i32 %8, 10
%10 = load i32, i32* %2
%11 = xor i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = shl i32 %12, 3
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %13
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = ashr i32 %16, 6
%18 = load i32, i32* %2
%19 = xor i32 %18, %17
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = shl i32 %20, 11
%22 = xor i32 %21, -1
%23 = load i32, i32* %2
%24 = add nsw i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = ashr i32 %25, 16
%27 = load i32, i32* %2
%28 = xor i32 %27, %26
store i32 %28, i32* %2
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @hash_tw1(i32 %0) {
%2 = shl i32 %0, 15
%3 = xor i32 %2, -1
%4 = add nsw i32 %3, %0
%5 = ashr i32 %4, 10
%6 = xor i32 %5, %4
%7 = mul i32 %6, 9
%8 = ashr i32 %7, 6
%9 = xor i32 %8, %7
%10 = shl i32 %9, 11
%11 = xor i32 %10, -1
%12 = add nsw i32 %9, %11
%13 = ashr i32 %12, 16
%14 = xor i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int sysfs(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int sysfs1(int i) { return sysfs(i, 0, NULL); }


x86 assembly (clang, -O0):
<sysfs1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sysfs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs1>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <sysfs@plt>

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

LLVM IR (-O2):
define i32 @sysfs1(i32 %0) {
%2 = tail call i32 @sysfs(i32 %0, i32 0, i32* null)
ret i32 %2
}
int sign(double num) {
  int res = 0;
  if (num < 0)
    res = -1;
  else if (num > 0)
    res = 1;
  return res;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112a <sign+0x2a>
movl   $0xffffffff,-0xc(%rbp)
jmp    1148 <sign+0x48>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1143 <sign+0x43>
movl   $0x1,-0xc(%rbp)
jmp    1148 <sign+0x48>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    $0xffffffff,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     111c <sign+0x1c>
xor    %eax,%eax
ucomisd %xmm1,%xmm0
jbe    111c <sign+0x1c>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %3
br label %6
6: ; preds = %1, %3, %5
%7 = phi i32 [ 1, %5 ], [ 0, %3 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i, j;
  int p = 0, q = 2;
  for (i = 0, j = 0; i < p, j < q; i++, j++) {
    printf("Learn Programming\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116a <main+0x5a>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [18 x i8] c"Learn Programming\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int heap_maximum(int *a) { return a[0]; }


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

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

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

LLVM IR (-O2):
define i32 @heap_maximum(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void swap(unsigned char *a, unsigned char *b) {
  int tmp = *a;
  *a = *b;
  *b = tmp;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = load i8*, i8** %3
store i8 %10, i8* %11
%12 = load i32, i32* %5
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
store i8 %13, i8* %14
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
void ulz_ulysses(struct ulz *u) { return; }


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

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

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

LLVM IR (-O2):
%struct.ulz = type opaque
define void @ulz_ulysses(%struct.ulz* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void uninit_putchar(void) {
  char c;
  putchar(c);
}


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

x86 assembly (clang, -O2):
<uninit_putchar>:
xor    %edi,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @uninit_putchar() {
%1 = alloca i8
%2 = load i8, i8* %1
%3 = call i32 @putchar(i8 signext %2)
ret void
}

LLVM IR (-O2):
define void @uninit_putchar() {
%1 = tail call i32 @putchar(i8 signext undef)
ret void
}
int solve() {
  int sum = 0, _i = 1, goal = 4e6, prev;
  for (int i = 1; i <= goal; i += prev) {
    if (i % 2 == 0)
      sum += i;
    prev = _i;
    _i = i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x3d0900,-0xc(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1163 <solve+0x63>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1149 <solve+0x49>
mov    -0x14(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <solve+0x20>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
xor    %eax,%eax
mov    $0x1,%edx
mov    $0x1,%ecx
nopl   0x0(%rax)
mov    %edx,%esi
test   $0x1,%sil
mov    $0x0,%edx
cmove  %esi,%edx
add    %edx,%eax
add    %esi,%ecx
mov    %ecx,%edx
cmp    $0x3d0901,%ecx
mov    %esi,%ecx
jl     1110 <solve+0x10>
ret

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

LLVM IR (-O2):
define i32 @solve() {
br label %2
1: ; preds = %2
ret i32 %9
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %10, %2 ]
%4 = phi i32 [ 0, %0 ], [ %9, %2 ]
%5 = phi i32 [ 1, %0 ], [ %3, %2 ]
%6 = and i32 %3, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 %3, i32 0
%9 = add nsw i32 %8, %4
%10 = add nsw i32 %3, %5
%11 = icmp slt i32 %10, 4000001
br i1 %11, label %2, label %1
}
int preinc_arg_ptr(int *p) {
  int *q;
  q = p + 1;
  __builtin_prefetch(++p, 0, 0);
  return p == q;
}


x86 assembly (clang, -O0):
<preinc_arg_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
prefetchnta (%rax)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<preinc_arg_ptr>:
prefetchnta 0x4(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @preinc_arg_ptr(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %2
%8 = bitcast i32* %7 to i8*
%9 = load i32*, i32** %2
%10 = load i32*, i32** %3
%11 = icmp eq i32* %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @preinc_arg_ptr(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = bitcast i32* %2 to i8*
tail call void @llvm.prefetch.p0i8(i8* %3, i32 0, i32 0, i32 1)
ret i32 1
}
void _infix_operator_plus_i32_i32(signed long lhs, signed long rhs,
                                  signed long *__rval_1) {
  *__rval_1 = lhs + rhs;
}


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

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

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

LLVM IR (-O2):
define void @_infix_operator_plus_i32_i32(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = add nsw i64 %1, %0
store i64 %4, i64* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  float det = 625.f;
  if (det < 1) {
    printf("erm, what ?\n");
  }
  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)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xec5(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    1151 <main+0x41>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"erm, what ?\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 6.250000e+02, float* %6
%7 = load float, float* %6
%8 = fcmp olt float %7, 1.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void dfft_teardown_local_fft() {}


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

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

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

LLVM IR (-O2):
define void @dfft_teardown_local_fft() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void m_begin(void) {
  printf("#\n"
         "# File generated by 'config'\n"
         "#\n"
         "# *** DO NOT EDIT THIS FILE DIRECTLY ***\n"
         "# ***     IT WILL BE OVERWRITTEN     ***\n"
         "#\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [119 x i8] c"#\0A# File generated by 'config'\0A#\0A# *** DO NOT EDIT THIS FILE DIRECTLY ***\0A# *** IT WILL BE OVERWRITTEN ***\0A#\0A\0A\00"
define void @m_begin() {
%1 = call i32 @printf(i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [118 x i8] c"#\0A# File generated by 'config'\0A#\0A# *** DO NOT EDIT THIS FILE DIRECTLY ***\0A# *** IT WILL BE OVERWRITTEN ***\0A#\0A\00"
define void @m_begin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([118 x i8], [118 x i8]* @str, i64 0, i64 0))
ret void
}
void create_passive() {}


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

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

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

LLVM IR (-O2):
define void @create_passive() {
ret void
}
int left(int x) {
  const int z = 0;
  const int o = 1;
  const int m = -1;
  int r = 0;
  r += z << x;
  r += o << x;
  r += m << x;
  r += 0 << x;
  r += 1 << x;
  r += -1 << x;
  r += -1U << x;
  return r;
}


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
shl    %cl,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
shl    %cl,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @left(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
store i32 -1, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %2
%8 = shl i32 0, %7
%9 = load i32, i32* %6
%10 = add nsw i32 %9, %8
store i32 %10, i32* %6
%11 = load i32, i32* %2
%12 = shl i32 1, %11
%13 = load i32, i32* %6
%14 = add nsw i32 %13, %12
store i32 %14, i32* %6
%15 = load i32, i32* %2
%16 = shl i32 -1, %15
%17 = load i32, i32* %6
%18 = add nsw i32 %17, %16
store i32 %18, i32* %6
%19 = load i32, i32* %2
%20 = shl i32 0, %19
%21 = load i32, i32* %6
%22 = add nsw i32 %21, %20
store i32 %22, i32* %6
%23 = load i32, i32* %2
%24 = shl i32 1, %23
%25 = load i32, i32* %6
%26 = add nsw i32 %25, %24
store i32 %26, i32* %6
%27 = load i32, i32* %2
%28 = shl i32 -1, %27
%29 = load i32, i32* %6
%30 = add nsw i32 %29, %28
store i32 %30, i32* %6
%31 = load i32, i32* %2
%32 = shl i32 -1, %31
%33 = load i32, i32* %6
%34 = add i32 %33, %32
store i32 %34, i32* %6
%35 = load i32, i32* %6
ret i32 %35
}

LLVM IR (-O2):
define i32 @left(i32 %0) {
%2 = shl nsw i32 -1, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bpf_error(char *);
void syntax() { bpf_error("syntax error in filter expression"); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"syntax error in filter expression\00"
define void @syntax() {
%1 = call i32 @bpf_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"syntax error in filter expression\00"
define void @syntax() {
%1 = tail call i32 @bpf_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float cos(float x) {
  float n;
  n = cos(x);
  return n;
}


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

x86 assembly (clang, -O2):
<cos>:
ucomiss 0xef9(%rip),%xmm0
jae    1120 <cos+0x20>
movss  0xef3(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1120 <cos+0x20>
ret
nopw   0x0(%rax,%rax,1)
jmp    1120 <cos+0x20>

LLVM IR (-O0):
define float @cos(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @cos(float %4)
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @cos(float %0) {
%2 = fcmp oeq float %0, 0xFFF0000000000000
%3 = fcmp oeq float %0, 0x7FF0000000000000
%4 = or i1 %3, %2
br i1 %4, label %5, label %6
5: ; preds = %1, %5
br label %5
6: ; preds = %1
ret float undef
}
/* Variables and functions */
double M_PI_2;
double _fasin(double const, char const *, char const *, unsigned int const);
double _facos(const double y, const char *parent_func, const char *parent_file,
              const unsigned int parent_line) {
  return _fasin(-y, parent_func, parent_file, parent_line) + M_PI_2;
}


x86 assembly (clang, -O0):
<_facos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <_fasin@plt>
mov    0x2e8d(%rip),%rax
addsd  (%rax),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_facos>:
push   %rax
xorpd  0xee7(%rip),%xmm0
call   1030 <_fasin@plt>
mov    0x2ec3(%rip),%rax
addsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI_2 = global double 0.000000e+00
define double @_facos(double %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca double
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store double %0, double* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load double, double* %5
%10 = fneg double %9
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call double @_fasin(double %10, i8* %11, i8* %12, i32 %13)
%15 = load double, double* @M_PI_2
%16 = fadd double %14, %15
ret double %16
}

LLVM IR (-O2):
@M_PI_2 = global double 0.000000e+00
define double @_facos(double %0, i8* %1, i8* %2, i32 %3) {
%5 = fneg double %0
%6 = tail call double @_fasin(double %5, i8* %1, i8* %2, i32 %3)
%7 = load double, double* @M_PI_2
%8 = fadd double %6, %7
ret double %8
}
/* Variables and functions */
float M_LN10;
float logf(float);
float log10f(float x) { return logf(x) / M_LN10; }


x86 assembly (clang, -O0):
<log10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
mov    0x2eb2(%rip),%rax
divss  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10f>:
push   %rax
call   1030 <logf@plt>
mov    0x2ec3(%rip),%rax
divss  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_LN10 = global float 0.000000e+00
define float @log10f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @logf(float %3)
%5 = load float, float* @M_LN10
%6 = fdiv float %4, %5
ret float %6
}

LLVM IR (-O2):
@M_LN10 = global float 0.000000e+00
define float @log10f(float %0) {
%2 = tail call float @logf(float %0)
%3 = load float, float* @M_LN10
%4 = fdiv float %2, %3
ret float %4
}
void av_bsf_iterate() {}


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

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

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

LLVM IR (-O2):
define void @av_bsf_iterate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFD;
int fcntl(int, int /*<<< orphan*/, ...);
int lbs_posix_add_fd(int fd, int fdflags) {
  int orgfd = fcntl(fd, F_GETFD);
  if (orgfd < 0) {
    return -1;
  }
  return fcntl(fd, F_SETFD, orgfd | fdflags);
}


x86 assembly (clang, -O0):
<lbs_posix_add_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    114a <lbs_posix_add_fd+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <lbs_posix_add_fd+0x56>
mov    -0x8(%rbp),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%edx
or     -0xc(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lbs_posix_add_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %eax,%eax
js     1147 <lbs_posix_add_fd+0x37>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
or     %ebp,%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@F_GETFD = global i32 0
@F_SETFD = global i32 0
define i32 @lbs_posix_add_fd(i32 %0, i32 %1) {
%3 = load i32, i32* @F_GETFD
%4 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @F_SETFD
%8 = or i32 %4, %1
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %7, i32 %8)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ -1, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t lerp(uint8_t a, uint8_t b, uint8_t t) {
  float T = (float)t / 255.0f;
  return (b - a) * t + b;
}


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  0xee6(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
mov    %esi,%eax
sub    %edi,%eax
imul   %edx,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @lerp(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sitofp i32 %8 to float
%10 = fdiv float %9, 2.550000e+02
store float %10, float* %7
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
%14 = load i32, i32* %6
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %5
%17 = add nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @lerp(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %0
%5 = mul nsw i32 %4, %2
%6 = add nsw i32 %5, %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ reverseString(char *, size_t, size_t);
void rotateString(char *buffer, size_t length, size_t increments) {
  increments %= length;
  reverseString(buffer, 0, increments);
  reverseString(buffer, increments, length);
  reverseString(buffer, 0, length);
  return;
}


x86 assembly (clang, -O0):
<rotateString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <reverseString@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <reverseString@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <reverseString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateString>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rdx,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1134 <rotateString+0x24>
xor    %edx,%edx
div    %rbx
mov    %rdx,%r15
jmp    113b <rotateString+0x2b>
xor    %edx,%edx
div    %ebx
mov    %edx,%r15d
mov    %r14,%rdi
xor    %esi,%esi
mov    %r15,%rdx
call   1030 <reverseString@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <reverseString@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <reverseString@plt>

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

LLVM IR (-O2):
define void @rotateString(i8* %0, i64 %1, i64 %2) {
%4 = urem i64 %2, %1
%5 = tail call i32 @reverseString(i8* %0, i64 0, i64 %4)
%6 = tail call i32 @reverseString(i8* %0, i64 %4, i64 %1)
%7 = tail call i32 @reverseString(i8* %0, i64 0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void PrintHelp(const char *argn) {
  printf("Usage: %s --username <username> --password <password> [options...]\n"
         " -f, --iface <ifname>\n"
         " -n, --dns <dns>\n"
         " -t, --hostname <hostname>\n"
         " -s, --udp-server <server>\n"
         " -c, --cli-version <client version>\n"
         " -h, --hash <hash>\n"
         " -D, --debug\n"
         " -o, --logoff\n",
         argn);
}


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

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

LLVM IR (-O0):
@.str = [243 x i8] c"Usage: %s --username <username> --password <password> [options...]\0A -f, --iface <ifname>\0A -n, --dns <dns>\0A -t, --hostname <hostname>\0A -s, --udp-server <server>\0A -c, --cli-version <client version>\0A -h, --hash <hash>\0A -D, --debug\0A -o, --logoff\0A\00"
define void @PrintHelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [243 x i8] c"Usage: %s --username <username> --password <password> [options...]\0A -f, --iface <ifname>\0A -n, --dns <dns>\0A -t, --hostname <hostname>\0A -s, --udp-server <server>\0A -c, --cli-version <client version>\0A -h, --hash <hash>\0A -D, --debug\0A -o, --logoff\0A\00"
define void @PrintHelp(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void foo_2_1_1_1_1_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_1_1_1_2_2() {
ret void
}
int is_in_bound(int *arr, int size, int *ptr) {
  if (ptr < arr + size) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1137 <is_in_bound+0x37>
movl   $0x1,-0x4(%rbp)
jmp    113e <is_in_bound+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rcx
xor    %eax,%eax
cmp    %rdx,%rcx
seta   %al
ret

LLVM IR (-O0):
define i32 @is_in_bound(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32*, i32** %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = icmp ult i32* %8, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 1, i32* %4
br label %16
15: ; preds = %3
store i32 0, i32* %4
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = icmp ugt i32* %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
double Determinant22(double a[2][2]) {
  return (a[0][0] * a[1][1] - a[0][1] * a[1][0]);
}


x86 assembly (clang, -O0):
<Determinant22>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Determinant22>:
movsd  0x10(%rdi),%xmm1
mulsd  0x8(%rdi),%xmm1
movsd  (%rdi),%xmm0
mulsd  0x18(%rdi),%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Determinant22([2 x double]* %0) {
%2 = alloca [2 x double]*
store [2 x double]* %0, [2 x double]** %2
%3 = load [2 x double]*, [2 x double]** %2
%4 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0
%5 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%6 = load double, double* %5
%7 = load [2 x double]*, [2 x double]** %2
%8 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 1
%9 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%10 = load double, double* %9
%11 = load [2 x double]*, [2 x double]** %2
%12 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0
%13 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 1
%14 = load double, double* %13
%15 = load [2 x double]*, [2 x double]** %2
%16 = getelementptr inbounds [2 x double], [2 x double]* %15, i64 1
%17 = getelementptr inbounds [2 x double], [2 x double]* %16, i64 0, i64 0
%18 = load double, double* %17
%19 = fmul double %14, %18
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %6, double %10, double %20)
ret double %21
}

LLVM IR (-O2):
define double @Determinant22([2 x double]* nocapture %0) {
%2 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 0
%3 = load double, double* %2
%4 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 1, i64 0
%9 = load double, double* %8
%10 = fneg double %7
%11 = fmul double %9, %10
%12 = tail call double @llvm.fmuladd.f64(double %3, double %5, double %11)
ret double %12
}