xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
scalar_t__ handle_open_failure();
FILE *my_fopen(const char *path, const char *mode) {
  FILE *fp;
  do {
    fp = fopen(path, mode);
  } while (fp == NULL && handle_open_failure());
  return fp;
}


x86 assembly (clang, -O0):
<my_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jne    1162 <my_fopen+0x42>
mov    $0x0,%al
call   1030 <handle_open_failure@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1130 <my_fopen+0x10>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fopen>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114f <my_fopen+0x2f>
xor    %eax,%eax
call   1030 <handle_open_failure@plt>
test   %rax,%rax
jne    1130 <my_fopen+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @my_fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %16, %2
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %7, i8* %8)
store i32* %9, i32** %5
br label %10
10: ; preds = %6
%11 = load i32*, i32** %5
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = call i64 (...) @handle_open_failure()
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ false, %10 ], [ %15, %13 ]
br i1 %17, label %6, label %18
18: ; preds = %16
%19 = load i32*, i32** %5
ret i32* %19
}

LLVM IR (-O2):
define noalias i32* @my_fopen(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %6, %2
%4 = tail call i32* @fopen(i8* %0, i8* %1)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i64 (...) @handle_open_failure()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %6
ret i32* %4
}
/* Type definitions */
struct gb_interface {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct gb_interface *);
struct gb_interface *to_gb_interface(struct device *);
void gb_interface_release(struct device *dev) {
  struct gb_interface *intf = to_gb_interface(dev);
  kfree(intf);
}


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

x86 assembly (clang, -O2):
<gb_interface_release>:
push   %rax
call   1040 <to_gb_interface@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <kfree@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.gb_interface = type { i32 }
define void @gb_interface_release(%struct.device* %0) {
%2 = alloca %struct.device*
%3 = alloca %struct.gb_interface*
store %struct.device* %0, %struct.device** %2
%4 = load %struct.device*, %struct.device** %2
%5 = call %struct.gb_interface* @to_gb_interface(%struct.device* %4)
store %struct.gb_interface* %5, %struct.gb_interface** %3
%6 = load %struct.gb_interface*, %struct.gb_interface** %3
%7 = call i32 @kfree(%struct.gb_interface* %6)
ret void
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.gb_interface = type { i32 }
define void @gb_interface_release(%struct.device* %0) {
%2 = tail call %struct.gb_interface* @to_gb_interface(%struct.device* %0)
%3 = tail call i32 @kfree(%struct.gb_interface* %2)
ret void
}
void n2(int ih) {
  while (ih < 1)
    ++ih;
}


x86 assembly (clang, -O0):
<n2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    111f <n2+0x1f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <n2+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @n2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @n2(i32 %0) {
ret void
}
/* Variables and functions */
int tng_compress_uncompress_vel_gen(char *, int /*<<< orphan*/ *,
                                    int /*<<< orphan*/ *, int *,
                                    unsigned long *, unsigned long *);
int tng_compress_uncompress_vel_int(char *data, int *vel,
                                    unsigned long *prec_hi,
                                    unsigned long *prec_lo) {
  return tng_compress_uncompress_vel_gen(data, NULL, NULL, vel, prec_hi,
                                         prec_lo);
}


x86 assembly (clang, -O0):
<tng_compress_uncompress_vel_int>:
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),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <tng_compress_uncompress_vel_gen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tng_compress_uncompress_vel_int>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <tng_compress_uncompress_vel_gen@plt>

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

LLVM IR (-O2):
define i32 @tng_compress_uncompress_vel_int(i8* %0, i32* %1, i64* %2, i64* %3) {
%5 = tail call i32 @tng_compress_uncompress_vel_gen(i8* %0, i32* null, i32* null, i32* %1, i64* %2, i64* %3)
ret i32 %5
}
/* Variables and functions */
double exp(int const);
int const log(double const);
double rad_root(const double x, const int i) {
  if (x == 0.0)
    return -1.0;
  else
    return exp(log(x) / i);
}


x86 assembly (clang, -O0):
<rad_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115a <rad_root+0x3a>
jp     115a <rad_root+0x3a>
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1174 <rad_root+0x54>
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
cltd
idivl  -0x14(%rbp)
mov    %eax,%edi
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad_root>:
push   %rbx
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1137 <rad_root+0x17>
jp     1137 <rad_root+0x17>
movsd  0xecb(%rip),%xmm0
pop    %rbx
ret
mov    %edi,%ebx
call   1040 <log@plt>
cltd
idiv   %ebx
mov    %eax,%edi
pop    %rbx
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @rad_root(double %0, i32 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%6 = load double, double* %4
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store double -1.000000e+00, double* %3
br label %15
9: ; preds = %2
%10 = load double, double* %4
%11 = call i32 @log(double %10)
%12 = load i32, i32* %5
%13 = sdiv i32 %11, %12
%14 = call double @exp(i32 %13)
store double %14, double* %3
br label %15
15: ; preds = %9, %8
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @rad_root(double %0, i32 %1) {
%3 = fcmp oeq double %0, 0.000000e+00
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @log(double %0)
%6 = sdiv i32 %5, %1
%7 = tail call double @exp(i32 %6)
br label %8
8: ; preds = %2, %4
%9 = phi double [ %7, %4 ], [ -1.000000e+00, %2 ]
ret double %9
}
/* Variables and functions */
scalar_t__ bind_if_index(int, int);
int get_if_index(int, char const *);
int bind_if_name(int fd, const char *device) {
  int ifindex;
  if ((ifindex = get_if_index(fd, device)) == -1) {
    return 1;
  }
  if (bind_if_index(fd, ifindex)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bind_if_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <get_if_index@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1153 <bind_if_name+0x33>
movl   $0x1,-0x4(%rbp)
jmp    117b <bind_if_name+0x5b>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <bind_if_index@plt>
cmp    $0x0,%rax
je     1174 <bind_if_name+0x54>
movl   $0x1,-0x4(%rbp)
jmp    117b <bind_if_name+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_if_name>:
push   %rbx
mov    %edi,%ebx
call   1040 <get_if_index@plt>
cmp    $0xffffffff,%eax
je     1143 <bind_if_name+0x23>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <bind_if_index@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bind_if_name(i32 %0, i8* %1) {
%3 = tail call i32 @get_if_index(i32 %0, i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @bind_if_index(i32 %0, i32 %3)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ buffer_overflow();
void buffer_overflow_test(void **state) {
  (void)state;
  buffer_overflow();
}


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

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

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

LLVM IR (-O2):
define void @buffer_overflow_test(i8** nocapture readnone %0) {
%2 = tail call i32 (...) @buffer_overflow()
ret void
}
int checkmp3header(head) {
  if (((head & 0xffe00000) == 0xffe00000) && ((head >> 17) & 3) &&
      (((head >> 12) & 0xf) != 0xf) && (((head >> 10) & 0x3) != 0x3) &&
      ((4 - ((head >> 17) & 3)) == 3))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<checkmp3header>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffe00000,%eax
cmp    $0xffe00000,%eax
jne    1175 <checkmp3header+0x75>
mov    -0x8(%rbp),%eax
sar    $0x11,%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1175 <checkmp3header+0x75>
mov    -0x8(%rbp),%eax
sar    $0xc,%eax
and    $0xf,%eax
cmp    $0xf,%eax
je     1175 <checkmp3header+0x75>
mov    -0x8(%rbp),%eax
sar    $0xa,%eax
and    $0x3,%eax
cmp    $0x3,%eax
je     1175 <checkmp3header+0x75>
mov    -0x8(%rbp),%ecx
sar    $0x11,%ecx
and    $0x3,%ecx
mov    $0x4,%eax
sub    %ecx,%eax
cmp    $0x3,%eax
jne    1175 <checkmp3header+0x75>
movl   $0x1,-0x4(%rbp)
jmp    117c <checkmp3header+0x7c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkmp3header>:
cmp    $0xffe00000,%edi
jb     113b <checkmp3header+0x3b>
mov    %edi,%ecx
shr    $0x11,%ecx
and    $0x3,%ecx
cmp    $0x1,%ecx
jne    113b <checkmp3header+0x3b>
mov    %edi,%eax
and    $0xc00,%eax
cmp    $0xc00,%eax
je     113b <checkmp3header+0x3b>
and    $0xf000,%edi
cmp    $0xf000,%edi
je     113b <checkmp3header+0x3b>
mov    $0x1,%eax
test   %ecx,%ecx
je     113b <checkmp3header+0x3b>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @checkmp3header(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, -2097152
%6 = icmp eq i32 %5, -2097152
br i1 %6, label %7, label %29
7: ; preds = %1
%8 = load i32, i32* %3
%9 = ashr i32 %8, 17
%10 = and i32 %9, 3
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %29
12: ; preds = %7
%13 = load i32, i32* %3
%14 = ashr i32 %13, 12
%15 = and i32 %14, 15
%16 = icmp ne i32 %15, 15
br i1 %16, label %17, label %29
17: ; preds = %12
%18 = load i32, i32* %3
%19 = ashr i32 %18, 10
%20 = and i32 %19, 3
%21 = icmp ne i32 %20, 3
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = load i32, i32* %3
%24 = ashr i32 %23, 17
%25 = and i32 %24, 3
%26 = sub nsw i32 4, %25
%27 = icmp eq i32 %26, 3
br i1 %27, label %28, label %29
28: ; preds = %22
store i32 1, i32* %2
br label %30
29: ; preds = %22, %17, %12, %7, %1
store i32 0, i32* %2
br label %30
30: ; preds = %29, %28
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @checkmp3header(i32 %0) {
%2 = icmp ugt i32 %0, -2097153
br i1 %2, label %3, label %15
3: ; preds = %1
%4 = lshr i32 %0, 17
%5 = and i32 %4, 3
%6 = icmp eq i32 %5, 0
%7 = and i32 %0, 61440
%8 = icmp eq i32 %7, 61440
%9 = or i1 %8, %6
%10 = and i32 %0, 3072
%11 = icmp eq i32 %10, 3072
%12 = or i1 %11, %9
%13 = icmp ne i32 %5, 1
%14 = or i1 %13, %12
br i1 %14, label %15, label %16
15: ; preds = %3, %1
br label %16
16: ; preds = %3, %15
%17 = phi i32 [ 0, %15 ], [ 1, %3 ]
ret i32 %17
}
void __install_signal_handler(int arg, void *handler) {
  long __res, dummy;
  __asm__ __volatile__("int $0x80"
                       : "=a"(__res), "=&b"(dummy)
                       : "0"(48), "1"((long)(arg)), "c"((long)(handler)));
  return (void)__res;
}


x86 assembly (clang, -O0):
<__install_signal_handler>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movslq -0xc(%rbp),%rbx
mov    -0x18(%rbp),%rcx
mov    $0x30,%eax
int    $0x80
mov    %rax,-0x20(%rbp)
mov    %rbx,-0x28(%rbp)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__install_signal_handler>:
push   %rbx
mov    %rsi,%rcx
movslq %edi,%rbx
mov    $0x30,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define void @__install_signal_handler(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,{cx},~{dirflag},~{fpsr},~{flags}"(i64 48, i64 %8, i64 %10)
%12 = extractvalue { i64, i64 } %11, 0
%13 = extractvalue { i64, i64 } %11, 1
store i64 %12, i64* %5
store i64 %13, i64* %6
%14 = load i64, i64* %5
ret void
}

LLVM IR (-O2):
define void @__install_signal_handler(i32 %0, i8* %1) {
%3 = sext i32 %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = tail call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,{cx},~{dirflag},~{fpsr},~{flags}"(i64 48, i64 %3, i64 %4)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vseq_set_aspect(uint8_t *p_mp2vseq, uint8_t i_aspect) {
  p_mp2vseq[7] &= 0xf;
  p_mp2vseq[7] |= (i_aspect << 4) & 0xf0;
}


x86 assembly (clang, -O0):
<mp2vseq_set_aspect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
and    $0xf,%ecx
mov    %ecx,0x1c(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x4,%ecx
and    $0xf0,%ecx
mov    -0x8(%rbp),%rax
or     0x1c(%rax),%ecx
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseq_set_aspect>:
mov    0x1c(%rdi),%eax
and    $0xf,%eax
shl    $0x4,%esi
movzbl %sil,%ecx
or     %eax,%ecx
mov    %ecx,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @mp2vseq_set_aspect(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 = getelementptr inbounds i32, i32* %5, i64 7
%7 = load i32, i32* %6
%8 = and i32 %7, 15
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = shl i32 %9, 4
%11 = and i32 %10, 240
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 7
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @mp2vseq_set_aspect(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 7
%4 = load i32, i32* %3
%5 = and i32 %4, 15
%6 = shl i32 %1, 4
%7 = and i32 %6, 240
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char);
void controller(char a, char b, char c) {
  printf("controller %d %d %d\n", a, b, c);
}


x86 assembly (clang, -O0):
<controller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
lea    0xeca(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x3(%rbp),%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"controller %d %d %d\0A\00"
define void @controller(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = load i8, i8* %5
%9 = load i8, i8* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext %7, i8 signext %8, i8 signext %9)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"controller %d %d %d\0A\00"
define void @controller(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1, i8 signext %2)
ret void
}
void foo340(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo340(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void store64(unsigned char *x, uint64_t u) {
  unsigned int i;
  for (i = 0; i < 8; ++i)
    x[i] = u >> 8 * i;
}


x86 assembly (clang, -O0):
<store64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jae    1141 <store64+0x41>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <store64+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @store64(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
int __ev_ra_changed() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__ev_ra_changed() {
ret i32 0
}
void kasan_poison_vmalloc(const void *start, unsigned long size) {}


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

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

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

LLVM IR (-O2):
define void @kasan_poison_vmalloc(i8* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned long long);
void uyvy2yuyv(unsigned char *src, unsigned char *dest,
               unsigned long long int NumPixels) {
  memcpy(dest, src, NumPixels << 1);
}


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

x86 assembly (clang, -O2):
<uyvy2yuyv>:
mov    %rdi,%rax
add    %rdx,%rdx
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @uyvy2yuyv(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i64, i64* %6
%10 = shl i64 %9, 1
%11 = call i32 @memcpy(i8* %7, i8* %8, i64 %10)
ret void
}

LLVM IR (-O2):
define void @uyvy2yuyv(i8* %0, i8* %1, i64 %2) {
%4 = shl i64 %2, 1
%5 = tail call i32 @memcpy(i8* %1, i8* %0, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void putstr(const char *s) {
  while (*s)
    putchar(*s++);
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <putstr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <putstr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @putchar(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
struct entrypoint {
  int dummy;
};

/* Variables and functions */
struct entrypoint *__alloc_entrypoint(int /*<<< orphan*/);
struct entrypoint *alloc_entrypoint(void) {
  return __alloc_entrypoint(0);
}


x86 assembly (clang, -O0):
<alloc_entrypoint>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <__alloc_entrypoint@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.entrypoint = type { i32 }
define %struct.entrypoint* @alloc_entrypoint() {
%1 = call %struct.entrypoint* @__alloc_entrypoint(i32 0)
ret %struct.entrypoint* %1
}

LLVM IR (-O2):
%struct.entrypoint = type { i32 }
define %struct.entrypoint* @alloc_entrypoint() {
%1 = tail call %struct.entrypoint* @__alloc_entrypoint(i32 0)
ret %struct.entrypoint* %1
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(unsigned long long);
void ft_recput(unsigned long long n) {
  if (n >= 10)
    ft_recput(n / 10);
  ft_putchar(n % 10 + '0');
}


x86 assembly (clang, -O0):
<ft_recput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0xa,-0x8(%rbp)
jb     114d <ft_recput+0x2d>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
call   1030 <ft_recput@plt>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rdi
add    $0x30,%rdi
call   1040 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_recput>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movabs $0xcccccccccccccccd,%r14
cc cc cc
cmp    $0xa,%rdi
jb     1149 <ft_recput+0x29>
mov    %rbx,%rax
mul    %r14
mov    %rdx,%rdi
shr    $0x3,%rdi
call   1030 <ft_recput@plt>
mov    %rbx,%rax
mul    %r14
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%rbx
or     $0x30,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_recput(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp uge i64 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = udiv i64 %6, 10
br label %8
8: ; preds = %5, %1
%9 = load i64, i64* %2
%10 = urem i64 %9, 10
%11 = add i64 %10, 48
%12 = call i32 @ft_putchar(i64 %11)
ret void
}

LLVM IR (-O2):
define void @ft_recput(i64 %0) {
%2 = icmp ugt i64 %0, 9
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = udiv i64 %0, 10
tail call void @ft_recput(i64 %4)
br label %5
5: ; preds = %3, %1
%6 = urem i64 %0, 10
%7 = or i64 %6, 48
%8 = tail call i32 @ft_putchar(i64 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void d_free(double *pA) { free(pA); }


x86 assembly (clang, -O0):
<d_free>:
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):
<d_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @d_free(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
void skipline(FILE *fd) {
  int ch;
  do {
    ch = getc(fd);
  } while (ch != '\n' && ch != EOF);
}


x86 assembly (clang, -O0):
<skipline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1149 <skipline+0x39>
mov    -0xc(%rbp),%eax
mov    0x2ea7(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    111c <skipline+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%eax
je     1132 <skipline+0x22>
cmp    (%r14),%eax
jne    1120 <skipline+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @skipline(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* @EOF
%13 = icmp ne i32 %11, %12
br label %14
14: ; preds = %10, %7
%15 = phi i1 [ false, %7 ], [ %13, %10 ]
br i1 %15, label %4, label %16
16: ; preds = %14
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skipline(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @getc(i32* %0)
%4 = icmp ne i32 %3, 10
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %2, label %8
8: ; preds = %2
ret void
}
int test_imm_7Bint32_mem(int *val) {
  return ((*val) & (0x7B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Bint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 123
%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_7Bint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 123
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void _exit(int exitcode) { exit(exitcode); }


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

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

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

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int _unlink(char *name) {
  (void)name;
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unlink>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @ENOENT
store i32 %4, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
ret i32 -1
}
void RGB565ToARGBRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RGB565ToARGBRow_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
void open_standard_streams(void) {
  int fd;
  do {
    fd = open("/dev/null", O_RDWR);
    if (fd > 2) {
      close(fd);
    }
  } while (fd >= 0 && fd <= 2);
}


x86 assembly (clang, -O0):
<open_standard_streams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jle    1152 <open_standard_streams+0x32>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
jmp    1157 <open_standard_streams+0x37>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1170 <open_standard_streams+0x50>
cmpl   $0x2,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1128 <open_standard_streams+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_standard_streams>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
lea    0xece(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%esi
mov    %rbx,%rdi
call   1040 <open@plt>
cmp    $0x3,%eax
jge    115a <open_standard_streams+0x3a>
jb     1140 <open_standard_streams+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <close@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
define void @open_standard_streams() {
%1 = alloca i32
br label %2
2: ; preds = %17, %0
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = call i32 @close(i32 %8)
br label %10
10: ; preds = %7, %2
br label %11
11: ; preds = %10
%12 = load i32, i32* %1
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %1
%16 = icmp sle i32 %15, 2
br label %17
17: ; preds = %14, %11
%18 = phi i1 [ false, %11 ], [ %16, %14 ]
br i1 %18, label %2, label %19
19: ; preds = %17
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
define void @open_standard_streams() {
br label %1
1: ; preds = %7, %0
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp sgt i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @close(i32 %3)
br label %9
7: ; preds = %1
%8 = icmp ult i32 %3, 3
br i1 %8, label %1, label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atanf(float);
float sinf(int /*<<< orphan*/);
float __attribute__((no, optimize("Ofast"))) sinatanf(float x) {
  return sinf(atanf(x));
}


x86 assembly (clang, -O0):
<sinatanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <atanf@plt>
mov    %eax,%edi
call   1030 <sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinatanf>:
push   %rax
call   1040 <atanf@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define float @sinatanf(float %0) {
%2 = tail call i32 @atanf(float %0)
%3 = tail call float @sinf(i32 %2)
ret float %3
}
void output_to_data(int fd, void *vdata) {}


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

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

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

LLVM IR (-O2):
define void @output_to_data(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
char *clean_line(char *);
scalar_t__ strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int check_line(char *l) {
  char *ln;
  ln = clean_line(l);
  if (strncmp(ln, "#", 1) == 0)
    return 1;
  if (strlen(ln) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <clean_line@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeac(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1174 <check_line+0x44>
movl   $0x1,-0x4(%rbp)
jmp    119a <check_line+0x6a>
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jne    1193 <check_line+0x63>
movl   $0x1,-0x4(%rbp)
jmp    119a <check_line+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_line>:
push   %r14
push   %rbx
push   %rax
call   1040 <clean_line@plt>
mov    %rax,%r14
lea    0xecd(%rip),%rsi
mov    $0x1,%ebx
mov    %rax,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1153 <check_line+0x33>
xor    %ebx,%ebx
cmpb   $0x0,(%r14)
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"#\00"
define i32 @check_line(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @clean_line(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %17
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i64 @strlen(i8* %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
define i32 @check_line(i8* %0) {
%2 = tail call i8* @clean_line(i8* %0)
%3 = tail call i64 @strncmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 1, %1 ], [ %8, %5 ]
ret i32 %10
}
int path_check_dir(int s_dir, int t_dir) {
  if (s_dir == t_dir || s_dir == ((t_dir - 1) & 0x07) ||
      s_dir == ((t_dir + 1) & 0x07))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<path_check_dir>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     113e <path_check_dir+0x3e>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    $0x7,%ecx
cmp    %ecx,%eax
je     113e <path_check_dir+0x3e>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
and    $0x7,%ecx
cmp    %ecx,%eax
jne    114a <path_check_dir+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <path_check_dir+0x51>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_check_dir>:
xor    %eax,%eax
cmp    %esi,%edi
je     111d <path_check_dir+0x1d>
lea    -0x1(%rsi),%ecx
and    $0x7,%ecx
cmp    %edi,%ecx
je     111d <path_check_dir+0x1d>
add    $0x1,%esi
and    $0x7,%esi
xor    %eax,%eax
cmp    %edi,%esi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @path_check_dir(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = add i32 %1, 7
%6 = and i32 %5, 7
%7 = icmp eq i32 %6, %0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = add nsw i32 %1, 1
%10 = and i32 %9, 7
%11 = icmp ne i32 %10, %0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %2, %4
%14 = phi i32 [ 0, %4 ], [ 0, %2 ], [ %12, %8 ]
ret i32 %14
}
/* Variables and functions */
int localBufferOverflow();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *const argv[]) {
  printf("Value[0] = %c\n", localBufferOverflow());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Value[0] = %c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @localBufferOverflow()
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Value[0] = %c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @localBufferOverflow()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ irq(int);
void timer_poll() { irq(17); }


x86 assembly (clang, -O0):
<timer_poll>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
call   1030 <irq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_poll>:
mov    $0x11,%edi
jmp    1030 <irq@plt>

LLVM IR (-O0):
define void @timer_poll() {
%1 = call i32 @irq(i32 17)
ret void
}

LLVM IR (-O2):
define void @timer_poll() {
%1 = tail call i32 @irq(i32 17)
ret void
}
void endWindows(void) {}


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

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

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

LLVM IR (-O2):
define void @endWindows() {
ret void
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ evtag_marshal(struct evbuffer *, unsigned long, char const *,
                                 unsigned long);
scalar_t__ strlen(char const *);
void evtag_marshal_string(struct evbuffer *buf, unsigned long tag,
                          const char *string) {
  evtag_marshal(buf, tag, string, (unsigned long)strlen(string));
}


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

x86 assembly (clang, -O2):
<evtag_marshal_string>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <evtag_marshal@plt>

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define void @evtag_marshal_string(%struct.evbuffer* %0, i64 %1, i8* %2) {
%4 = alloca %struct.evbuffer*
%5 = alloca i64
%6 = alloca i8*
store %struct.evbuffer* %0, %struct.evbuffer** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load %struct.evbuffer*, %struct.evbuffer** %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i64 @strlen(i8* %10)
%12 = call i32 @evtag_marshal(%struct.evbuffer* %7, i64 %8, i8* %9, i64 %11)
ret void
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define void @evtag_marshal_string(%struct.evbuffer* %0, i64 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = tail call i32 @evtag_marshal(%struct.evbuffer* %0, i64 %1, i8* %2, i64 %4)
ret void
}
/* Variables and functions */
int system(char *);
int main(void) { return system("xplus4.exe -sounddev dummy"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"xplus4.exe -sounddev dummy\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [27 x i8] c"xplus4.exe -sounddev dummy\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int main() {
  int i, j, k;
  j = 6;
  k = j + 4;
  k = i + 8;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x10(%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
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 4
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 8
store i32 %8, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void termination_handler(int signum) {
  printf("signum %d\n", signum);
  exit(1);
}


x86 assembly (clang, -O0):
<termination_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<termination_handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"signum %d\0A\00"
define void @termination_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}