xunge/DecIR huggingface dataset:
/* Variables and functions */
int PRCMHIBRegRead(int);
unsigned long PRCMHibernateWakeupCauseGet() {
  if (((*((volatile unsigned long *)(0x00000400))) & 0xFFFF) >= 2) {
    return ((PRCMHIBRegRead((0x4402E000 + 0x00000188)) >> 2) & 0x7);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<PRCMHibernateWakeupCauseGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%eax
mov    (%rax),%rax
and    $0xffff,%rax
cmp    $0x2,%rax
jb     114b <PRCMHibernateWakeupCauseGet+0x3b>
mov    $0x4402e188,%edi
call   1030 <PRCMHIBRegRead@plt>
sar    $0x2,%eax
and    $0x7,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    1153 <PRCMHibernateWakeupCauseGet+0x43>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMHibernateWakeupCauseGet>:
push   %rax
testq  $0xfffe,0x400
je     1131 <PRCMHibernateWakeupCauseGet+0x21>
mov    $0x4402e188,%edi
call   1030 <PRCMHIBRegRead@plt>
shr    $0x2,%eax
and    $0x7,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @PRCMHibernateWakeupCauseGet() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 1024 to i64*)
%3 = and i64 %2, 65535
%4 = icmp uge i64 %3, 2
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = call i32 @PRCMHIBRegRead(i32 1141039496)
%7 = ashr i32 %6, 2
%8 = and i32 %7, 7
%9 = sext i32 %8 to i64
store i64 %9, i64* %1
br label %11
10: ; preds = %0
store i64 0, i64* %1
br label %11
11: ; preds = %10, %5
%12 = load i64, i64* %1
ret i64 %12
}

LLVM IR (-O2):
define i64 @PRCMHibernateWakeupCauseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1024 to i64*)
%2 = and i64 %1, 65534
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = tail call i32 @PRCMHIBRegRead(i32 1141039496)
%6 = lshr i32 %5, 2
%7 = and i32 %6, 7
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %0, %4
%10 = phi i64 [ %8, %4 ], [ 0, %0 ]
ret i64 %10
}
char *pwskip(p)
char *p;
{
  while (*p && *p != ':' && *p != '\n')
    ++p;
  if (*p)
    *p++ = 0;
  return (p);
}


x86 assembly (clang, -O0):
<pwskip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1142 <pwskip+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x3a,%ecx
mov    %al,-0x9(%rbp)
je     1142 <pwskip+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <pwskip+0x52>
jmp    1163 <pwskip+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <pwskip+0x8>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1182 <pwskip+0x82>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwskip>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     112e <pwskip+0x2e>
cmp    $0xa,%cl
je     1127 <pwskip+0x27>
cmp    $0x3a,%cl
je     1127 <pwskip+0x27>
add    $0x1,%rax
jmp    1110 <pwskip+0x10>
movb   $0x0,(%rax)
add    $0x1,%rax
ret

LLVM IR (-O0):
define i8* @pwskip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %20, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 58
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 10
br label %18
18: ; preds = %13, %8, %3
%19 = phi i1 [ false, %8 ], [ false, %3 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
br label %3
23: ; preds = %18
%24 = load i8*, i8** %2
%25 = load i8, i8* %24
%26 = icmp ne i8 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %2
store i8 0, i8* %28
br label %30
30: ; preds = %27, %23
%31 = load i8*, i8** %2
ret i8* %31
}

LLVM IR (-O2):
define i8* @pwskip(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %9
i8 10, label %7
i8 58, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
%8 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %3
br label %9
9: ; preds = %2, %7
%10 = phi i8* [ %8, %7 ], [ %3, %2 ]
ret i8* %10
}
/* Variables and functions */
int genrand_int32(unsigned long *, unsigned long *);
long genrand_int31(unsigned long mt[], unsigned long *mtiPtr) {
  return (long)(genrand_int32(mt, mtiPtr) >> 1);
}


x86 assembly (clang, -O0):
<genrand_int31>:
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 <genrand_int32@plt>
sar    $0x1,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_int31>:
push   %rax
call   1030 <genrand_int32@plt>
sar    %eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @genrand_int31(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64*, i64** %4
%7 = call i32 @genrand_int32(i64* %5, i64* %6)
%8 = ashr i32 %7, 1
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @genrand_int31(i64* %0, i64* %1) {
%3 = tail call i32 @genrand_int32(i64* %0, i64* %1)
%4 = ashr i32 %3, 1
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
__attribute__((constructor)) void _disable_io_buffering(void) {
  setvbuf(stdout, (char *)((void *)0), _IONBF, 0);
}


x86 assembly (clang, -O0):
<_disable_io_buffering>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_disable_io_buffering>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_disable_io_buffering, i8* null }]
define void @_disable_io_buffering() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = call i32 @setvbuf(i32 %1, i8* null, i32 %2, i32 0)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_disable_io_buffering, i8* null }]
define void @_disable_io_buffering() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = tail call i32 @setvbuf(i32 %1, i8* null, i32 %2, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_input(char const *, long);
int /*<<< orphan*/ fuzz_func(char const *, long);
int LLVMFuzzerTestOneInput(const char *data, long size) {
  dump_input(data, size);
  fuzz_func(data, size);
  return 0;
}


x86 assembly (clang, -O0):
<LLVMFuzzerTestOneInput>:
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   1040 <dump_input@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fuzz_func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LLVMFuzzerTestOneInput>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <dump_input@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fuzz_func@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @LLVMFuzzerTestOneInput(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @dump_input(i8* %5, i64 %6)
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @fuzz_func(i8* %8, i64 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @LLVMFuzzerTestOneInput(i8* %0, i64 %1) {
%3 = tail call i32 @dump_input(i8* %0, i64 %1)
%4 = tail call i32 @fuzz_func(i8* %0, i64 %1)
ret i32 0
}
main() {
  struct A {
    int a;
  };
  {
    struct B {
      struct A;
      int b;
    } b;
  }
}


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

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

LLVM IR (-O0):
%struct.B = type { i32 }
define i32 @main() {
%1 = alloca %struct.B
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ LCDPort_ClearCE();
int /*<<< orphan*/ LCDPort_ClearRS();
int LCDPort_In4();
int /*<<< orphan*/ LCDPort_SetCE();
int /*<<< orphan*/ LCDPort_SetRW();
int32_t readInstruction_4BitIntf(void) {
  int rs;
  LCDPort_ClearRS();
  LCDPort_SetRW();
  LCDPort_SetCE();
  rs = (LCDPort_In4() & 0x0F) << 4;
  LCDPort_ClearCE();
  LCDPort_SetCE();
  rs |= (LCDPort_In4() & 0x0F);
  LCDPort_ClearCE();
  return rs;
}


x86 assembly (clang, -O0):
<readInstruction_4BitIntf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <LCDPort_ClearRS@plt>
mov    $0x0,%al
call   1070 <LCDPort_SetRW@plt>
mov    $0x0,%al
call   1060 <LCDPort_SetCE@plt>
mov    $0x0,%al
call   1050 <LCDPort_In4@plt>
and    $0xf,%eax
shl    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <LCDPort_ClearCE@plt>
mov    $0x0,%al
call   1060 <LCDPort_SetCE@plt>
mov    $0x0,%al
call   1050 <LCDPort_In4@plt>
and    $0xf,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <LCDPort_ClearCE@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInstruction_4BitIntf>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <LCDPort_ClearRS@plt>
xor    %eax,%eax
call   1070 <LCDPort_SetRW@plt>
xor    %eax,%eax
call   1060 <LCDPort_SetCE@plt>
xor    %eax,%eax
call   1050 <LCDPort_In4@plt>
shl    $0x4,%eax
movzbl %al,%ebp
xor    %eax,%eax
call   1030 <LCDPort_ClearCE@plt>
xor    %eax,%eax
call   1060 <LCDPort_SetCE@plt>
xor    %eax,%eax
call   1050 <LCDPort_In4@plt>
mov    %eax,%ebx
and    $0xf,%ebx
or     %ebp,%ebx
xor    %eax,%eax
call   1030 <LCDPort_ClearCE@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readInstruction_4BitIntf() {
%1 = alloca i32
%2 = call i32 (...) @LCDPort_ClearRS()
%3 = call i32 (...) @LCDPort_SetRW()
%4 = call i32 (...) @LCDPort_SetCE()
%5 = call i32 (...) @LCDPort_In4()
%6 = and i32 %5, 15
%7 = shl i32 %6, 4
store i32 %7, i32* %1
%8 = call i32 (...) @LCDPort_ClearCE()
%9 = call i32 (...) @LCDPort_SetCE()
%10 = call i32 (...) @LCDPort_In4()
%11 = and i32 %10, 15
%12 = load i32, i32* %1
%13 = or i32 %12, %11
store i32 %13, i32* %1
%14 = call i32 (...) @LCDPort_ClearCE()
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @readInstruction_4BitIntf() {
%1 = tail call i32 (...) @LCDPort_ClearRS()
%2 = tail call i32 (...) @LCDPort_SetRW()
%3 = tail call i32 (...) @LCDPort_SetCE()
%4 = tail call i32 (...) @LCDPort_In4()
%5 = shl i32 %4, 4
%6 = and i32 %5, 240
%7 = tail call i32 (...) @LCDPort_ClearCE()
%8 = tail call i32 (...) @LCDPort_SetCE()
%9 = tail call i32 (...) @LCDPort_In4()
%10 = and i32 %9, 15
%11 = or i32 %10, %6
%12 = tail call i32 (...) @LCDPort_ClearCE()
ret i32 %11
}
void ZeroArray2(float *a, int len) {
  int i = 0;
  while (i < len) {
    a[i] = 0.0;
    a[i + 1] = 0.0;
    i += 2;
  }
}


x86 assembly (clang, -O0):
<ZeroArray2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <ZeroArray2+0x51>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <ZeroArray2+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZeroArray2>:
test   %esi,%esi
jle    112d <ZeroArray2+0x1d>
push   %rax
add    $0xffffffff,%esi
shr    %esi
lea    0x8(,%rsi,8),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @ZeroArray2(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = add nsw i32 %1, -1
%7 = lshr i32 %6, 1
%8 = zext i32 %7 to i64
%9 = shl nuw nsw i64 %8, 3
%10 = add nuw nsw i64 %9, 8
br label %11
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
char const *weak_n1();
const char *call_weak_n1(void) { return weak_n1() + 1; }


x86 assembly (clang, -O0):
<call_weak_n1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <weak_n1@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_weak_n1>:
push   %rax
xor    %eax,%eax
call   1030 <weak_n1@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_weak_n1() {
%1 = call i8* (...) @weak_n1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_weak_n1() {
%1 = tail call i8* (...) @weak_n1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("Hello World"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
void prom_cpus_done(void) {}


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

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

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

LLVM IR (-O2):
define void @prom_cpus_done() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ intcomma(int);
void test_intcomma() { intcomma(42949672); }


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

x86 assembly (clang, -O2):
<test_intcomma>:
mov    $0x28f5c28,%edi
jmp    1030 <intcomma@plt>

LLVM IR (-O0):
define void @test_intcomma() {
%1 = call i32 @intcomma(i32 42949672)
ret void
}

LLVM IR (-O2):
define void @test_intcomma() {
%1 = tail call i32 @intcomma(i32 42949672)
ret void
}
unsigned char get_bits(unsigned long long value, unsigned bit,
                       unsigned nr_bits) {
  return (value >> bit) & ((unsigned char)((1 << nr_bits) - 1));
}


x86 assembly (clang, -O0):
<get_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    %cl,%rax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
movzbl %cl,%ecx
and    %rcx,%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bits>:
mov    %esi,%ecx
shr    %cl,%rdi
mov    $0xffffffff,%eax
mov    %edx,%ecx
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @get_bits(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i32, i32* %5
%9 = zext i32 %8 to i64
%10 = lshr i64 %7, %9
%11 = load i32, i32* %6
%12 = shl i32 1, %11
%13 = sub nsw i32 %12, 1
%14 = trunc i32 %13 to i8
%15 = zext i8 %14 to i64
%16 = and i64 %10, %15
%17 = trunc i64 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @get_bits(i64 %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = lshr i64 %0, %4
%6 = shl nsw i32 -1, %2
%7 = xor i32 %6, -1
%8 = zext i32 %7 to i64
%9 = and i64 %5, %8
%10 = trunc i64 %9 to i8
ret i8 %10
}
/* Variables and functions */
int at_io(unsigned int);
unsigned char at_read_memory(unsigned int addr) {
  unsigned int cmd = (addr & 1) ? 0x28 : 0x20;
  unsigned int offset = (addr >> 1) & 0xFFFF;
  unsigned int byte = at_io((cmd << 24) | (offset << 8)) & 0xFF;
  return byte;
}


x86 assembly (clang, -O0):
<at_read_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x1,%edx
mov    $0x20,%eax
mov    $0x28,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
shl    $0x18,%edi
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
or     %eax,%edi
call   1030 <at_io@plt>
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_read_memory>:
push   %rax
mov    %edi,%eax
and    $0x1,%eax
shl    $0x1b,%eax
shl    $0x7,%edi
and    $0xffff00,%edi
add    %eax,%edi
add    $0x20000000,%edi
call   1030 <at_io@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @at_read_memory(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 40, i32 32
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = lshr i32 %11, 1
%13 = and i32 %12, 65535
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = shl i32 %14, 24
%16 = load i32, i32* %4
%17 = shl i32 %16, 8
%18 = or i32 %15, %17
%19 = call i32 @at_io(i32 %18)
%20 = and i32 %19, 255
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = trunc i32 %21 to i8
ret i8 %22
}

LLVM IR (-O2):
define zeroext i8 @at_read_memory(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 536870912, i32 671088640
%5 = shl i32 %0, 7
%6 = and i32 %5, 16776960
%7 = or i32 %4, %6
%8 = tail call i32 @at_io(i32 %7)
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ convert_ps_si16(short *, float *, float, int);
void convert_float_short(short *out, float *in, float scale, int len) {
  convert_ps_si16(out, in, scale, len);
}


x86 assembly (clang, -O0):
<convert_float_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
mov    -0x18(%rbp),%edx
call   1030 <convert_ps_si16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_float_short>:
jmp    1030 <convert_ps_si16@plt>

LLVM IR (-O0):
define void @convert_float_short(i16* %0, float* %1, float %2, i32 %3) {
%5 = alloca i16*
%6 = alloca float*
%7 = alloca float
%8 = alloca i32
store i16* %0, i16** %5
store float* %1, float** %6
store float %2, float* %7
store i32 %3, i32* %8
%9 = load i16*, i16** %5
%10 = load float*, float** %6
%11 = load float, float* %7
%12 = load i32, i32* %8
%13 = call i32 @convert_ps_si16(i16* %9, float* %10, float %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @convert_float_short(i16* %0, float* %1, float %2, i32 %3) {
%5 = tail call i32 @convert_ps_si16(i16* %0, float* %1, float %2, i32 %3)
ret void
}
void debugf(char *Format, ...) {}


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

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

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

LLVM IR (-O2):
define void @debugf(i8* nocapture %0, ...) {
ret void
}
void urb_print(struct admhcd *ahcd, struct urb *urb, char *str, int small,
               int status) {}


x86 assembly (clang, -O0):
<urb_print>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.admhcd = type opaque
%struct.urb = type opaque
define void @urb_print(%struct.admhcd* %0, %struct.urb* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca %struct.admhcd*
%7 = alloca %struct.urb*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store %struct.admhcd* %0, %struct.admhcd** %6
store %struct.urb* %1, %struct.urb** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.admhcd = type opaque
%struct.urb = type opaque
define void @urb_print(%struct.admhcd* nocapture %0, %struct.urb* nocapture %1, i8* nocapture %2, i32 %3, i32 %4) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ inet_addr(char const *);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
u_int32_t pack_ipv4_address(const char *ipv4) {
  u_int32_t address;
  address = inet_addr(ipv4);
  return ntohl(address);
}


x86 assembly (clang, -O0):
<pack_ipv4_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pack_ipv4_address(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @inet_addr(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @ntohl(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pack_ipv4_address(i8* %0) {
%2 = tail call i32 @inet_addr(i8* %0)
%3 = tail call i32 @ntohl(i32 %2)
ret i32 %3
}
void foo341(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo341(i32 %0) {
ret void
}
int main() {
  int b = 0;
  int l = 1;
  while (b == 0) {
    l = 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112f <main+0x2f>
movl   $0x0,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
store i32 0, i32* %3
br label %4
8: ; preds = %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
void exit(i) int i;
{
  untty();
  _exit(i);
}


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

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <untty@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 (...) @untty()
tail call void @_exit(i32 %0)
unreachable
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_degree_of_standard_polynomial(int k, int *d) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(119, &k, d, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_degree_of_standard_polynomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x77,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_degree_of_standard_polynomial>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x77,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_degree_of_standard_polynomial(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 119, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_degree_of_standard_polynomial(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 119, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
int check_century(int y) {
  int first_two_numbers = y / 100;
  if (first_two_numbers % 4 == 0)
    return 6;
  if (first_two_numbers % 4 == 1)
    return 4;
  if (first_two_numbers % 4 == 2)
    return 2;
  if (first_two_numbers % 4 == 3)
    return 0;
  return 0;
}


x86 assembly (clang, -O0):
<check_century>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1135 <check_century+0x35>
movl   $0x6,-0x4(%rbp)
jmp    119c <check_century+0x9c>
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1155 <check_century+0x55>
movl   $0x4,-0x4(%rbp)
jmp    119c <check_century+0x9c>
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
jne    1175 <check_century+0x75>
movl   $0x2,-0x4(%rbp)
jmp    119c <check_century+0x9c>
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x3,%edx
jne    1195 <check_century+0x95>
movl   $0x0,-0x4(%rbp)
jmp    119c <check_century+0x9c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_century>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
lea    (%rax,%rcx,1),%edx
add    $0x3,%edx
mov    %eax,%esi
add    %ecx,%esi
cmovns %esi,%edx
and    $0xfffffffc,%edx
sub    %edx,%esi
mov    $0x6,%ecx
sub    %esi,%ecx
sub    %esi,%ecx
xor    %eax,%eax
cmp    $0x4,%esi
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @check_century(i32 %0) {
%2 = sdiv i32 %0, 100
%3 = srem i32 %2, 4
%4 = icmp ult i32 %3, 4
%5 = mul nsw i32 %3, -2
%6 = add nsw i32 %5, 6
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint32_t __int64_t_clone_array(const int64_t *p, int64_t *q,
                               uint32_t elements) {
  uint32_t n = elements * sizeof(int64_t);
  memcpy(q, p, n);
  return n;
}


x86 assembly (clang, -O0):
<__int64_t_clone_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int64_t_clone_array>:
push   %rbx
mov    %rdi,%rax
lea    0x0(,%rdx,4),%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__int64_t_clone_array(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 4
%11 = trunc i64 %10 to i32
store i32 %11, i32* %7
%12 = load i32*, i32** %5
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = call i32 @memcpy(i32* %12, i32* %13, i32 %14)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @__int64_t_clone_array(i32* %0, i32* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(i32* %1, i32* %0, i32 %4)
ret i32 %4
}
/* Variables and functions */
double pow(double, double);
double my_pow(double x, double e) { return pow(x, e); }


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

x86 assembly (clang, -O2):
<my_pow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @my_pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @my_pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
void Wsupcase(char *p1) {
  while (*p1 = (((*p1) > 96 && (*p1) < 123) ? (*p1) & 0xDF : (*p1)))
    p1++;
}


x86 assembly (clang, -O0):
<Wsupcase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x60,%eax
jle    113c <Wsupcase+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7b,%eax
jge    113c <Wsupcase+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xdf,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <Wsupcase+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1168 <Wsupcase+0x68>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <Wsupcase+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wsupcase>:
movzbl (%rdi),%eax
lea    -0x61(%rax),%ecx
mov    %eax,%edx
and    $0xdf,%dl
cmp    $0x1a,%cl
movzbl %dl,%ecx
cmovae %eax,%ecx
mov    %cl,(%rdi)
add    $0x1,%rdi
test   %cl,%cl
jne    1100 <Wsupcase>
ret

LLVM IR (-O0):
define void @Wsupcase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %27, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sgt i32 %6, 96
br i1 %7, label %8, label %18
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp slt i32 %11, 123
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = and i32 %16, 223
br label %22
18: ; preds = %8, %3
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
br label %22
22: ; preds = %18, %13
%23 = phi i32 [ %17, %13 ], [ %21, %18 ]
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %2
store i8 %24, i8* %25
%26 = icmp ne i8 %24, 0
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %2
br label %3
30: ; preds = %22
ret void
}

LLVM IR (-O2):
define void @Wsupcase(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %10, %2 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -97
%6 = icmp ult i8 %5, 26
%7 = and i8 %4, -33
%8 = select i1 %6, i8 %7, i8 %4
store i8 %8, i8* %3
%9 = icmp eq i8 %8, 0
%10 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %9, label %11, label %2
11: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ crc16_ccitt_update(int, unsigned char const *, size_t);
uint16_t crc16_ccitt_calc(const unsigned char *buf, size_t len) {
  return crc16_ccitt_update(0x1D0F, buf, len);
}


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

x86 assembly (clang, -O2):
<crc16_ccitt_calc>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1d0f,%edi
jmp    1030 <crc16_ccitt_update@plt>

LLVM IR (-O0):
define i32 @crc16_ccitt_calc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @crc16_ccitt_update(i32 7439, i8* %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @crc16_ccitt_calc(i8* %0, i64 %1) {
%3 = tail call i32 @crc16_ccitt_update(i32 7439, i8* %0, i64 %1)
ret i32 %3
}
int test_fun(int x, int y) {
  int c = 0;
  while (x > y) {
    x = x - 1;
    c = c + 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1134 <test_fun+0x34>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_fun+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
xor    %eax,%eax
sub    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = sub i32 %0, %1
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
void XauGetBestAuthByAddr() {}


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

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

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

LLVM IR (-O2):
define void @XauGetBestAuthByAddr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __dealloc(void *cc, void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<__dealloc>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @__dealloc(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello, world.\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ slow_down_io();
unsigned char inb_p(int port) {
  unsigned char value = inb(port);
  slow_down_io();
  return value;
}


x86 assembly (clang, -O0):
<inb_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <inb@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1040 <slow_down_io@plt>
movzbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb_p>:
push   %rbx
call   1030 <inb@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <slow_down_io@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @inb_p(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call zeroext i8 @inb(i32 %4)
store i8 %5, i8* %3
%6 = call i32 (...) @slow_down_io()
%7 = load i8, i8* %3
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @inb_p(i32 %0) {
%2 = tail call zeroext i8 @inb(i32 %0)
%3 = tail call i32 (...) @slow_down_io()
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void reach_error() { assert(0); }


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

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

LLVM IR (-O0):
define void @reach_error() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @reach_error() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char const *, char const *, int);
void setenv_sysCx(const char *key, const char *val) { setenv(key, val, 1); }


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

x86 assembly (clang, -O2):
<setenv_sysCx>:
mov    $0x1,%edx
jmp    1030 <setenv@plt>

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

LLVM IR (-O2):
define void @setenv_sysCx(i8* %0, i8* %1) {
%3 = tail call i32 @setenv(i8* %0, i8* %1, i32 1)
ret void
}
int ft_fibonacci(int index) {
  if (index < 0)
    return (-1);
  if (index < 1)
    return (0);
  if (index < 3)
    return (1);
  return (ft_fibonacci(index - 1) + ft_fibonacci(index - 2));
}


x86 assembly (clang, -O0):
<ft_fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <ft_fibonacci+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
cmpl   $0x1,-0x8(%rbp)
jge    1147 <ft_fibonacci+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
cmpl   $0x3,-0x8(%rbp)
jge    115d <ft_fibonacci+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <ft_fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <ft_fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_fibonacci>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1138 <ft_fibonacci+0x28>
je     113f <ft_fibonacci+0x2f>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   (%rax)
cmp    $0x3,%ebx
jb     1143 <ft_fibonacci+0x33>
lea    -0x1(%rbx),%edi
call   1030 <ft_fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
jne    1120 <ft_fibonacci+0x10>
xor    %eax,%eax
jmp    1148 <ft_fibonacci+0x38>
mov    $0xffffffff,%ebp
jmp    114a <ft_fibonacci+0x3a>
xor    %ebp,%ebp
jmp    114a <ft_fibonacci+0x3a>
mov    $0x1,%eax
add    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ft_fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 0
br i1 %4, label %19, label %5
5: ; preds = %3, %9
%6 = phi i32 [ %13, %9 ], [ 0, %3 ]
%7 = phi i32 [ %12, %9 ], [ %0, %3 ]
%8 = icmp ult i32 %7, 3
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = add nsw i32 %7, -1
%11 = tail call i32 @ft_fibonacci(i32 %10)
%12 = add nsw i32 %7, -2
%13 = add nsw i32 %11, %6
%14 = icmp eq i32 %12, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %9
%16 = phi i32 [ %13, %9 ], [ %6, %5 ]
%17 = phi i32 [ 0, %9 ], [ 1, %5 ]
%18 = add nsw i32 %17, %16
br label %19
19: ; preds = %3, %15, %1
%20 = phi i32 [ -1, %1 ], [ %18, %15 ], [ 0, %3 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ getchar();
char *malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ syscall(int);
int main(void) {
  char *p;
  syscall(223);
  getchar();
  printf("IGNORE ");
  p = malloc((1024 * 1024 * 64));
  memset(p, 0, (1024 * 1024 * 64));
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xdf,%edi
call   1070 <syscall@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4000000,%edi
call   1080 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4000000,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xdf,%edi
call   1070 <syscall@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4000000,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x4000000,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"IGNORE \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 @syscall(i32 223)
%4 = call i32 (...) @getchar()
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = call i8* @malloc(i32 67108864)
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @memset(i8* %7, i32 0, i32 67108864)
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"IGNORE \00"
define i32 @main() {
%1 = tail call i32 @syscall(i32 223)
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call dereferenceable_or_null(67108864) i8* @malloc(i32 67108864)
%5 = tail call i32 @memset(i8* %4, i32 0, i32 67108864)
%6 = tail call i32 @free(i8* %4)
ret i32 0
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CDE_end_rmdir(struct tcb *, int);
void CDE_end_unlinkat_rmdir(struct tcb *tcp) { CDE_end_rmdir(tcp, 1); }


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

x86 assembly (clang, -O2):
<CDE_end_unlinkat_rmdir>:
mov    $0x1,%esi
jmp    1030 <CDE_end_rmdir@plt>

LLVM IR (-O0):
%struct.tcb = type { i32 }
define void @CDE_end_unlinkat_rmdir(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @CDE_end_rmdir(%struct.tcb* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define void @CDE_end_unlinkat_rmdir(%struct.tcb* %0) {
%2 = tail call i32 @CDE_end_rmdir(%struct.tcb* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void oldtable(short **mp, short length) { free((char *)(char *)mp); }


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

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

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

LLVM IR (-O2):
define void @oldtable(i16** nocapture %0, i16 signext %1) {
%3 = bitcast i16** %0 to i8*
%4 = tail call i32 @free(i8* %3)
ret void
}