xunge/DecIR huggingface dataset:
int string_hash(const char *s) {
  unsigned int i;
  i = 5381;
  while (*s) {
    i = ((i << 5) + i) + *s;
    s++;
  }
  return i;
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <string_hash+0x42>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <string_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <string_hash+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = sext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}
void aptovec(func, n) void (*func)();
{
  int vec[n];
  func(vec, n);
}


x86 assembly (clang, -O0):
<aptovec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   *%rcx
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aptovec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,%rcx
mov    %esi,%eax
mov    %rsp,%rdi
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
xor    %eax,%eax
call   *%rcx
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
define void @aptovec(void (...)* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = alloca i32, i64 %3
%5 = bitcast void (...)* %0 to void (i32*, i32, ...)*
ret void
}
void PrintJNSimpleCompareFunction3(void *theEnv, const char *logicalName,
                                   void *theValue) {}


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

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

LLVM IR (-O0):
define void @PrintJNSimpleCompareFunction3(i8* %0, i8* %1, i8* %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
ret void
}

LLVM IR (-O2):
define void @PrintJNSimpleCompareFunction3(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
int wr__min(int a, int b) {
  if (a < b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<wr__min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <wr__min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <wr__min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wr__min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @wr__min(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 slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @wr__min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _panic(char *);
void sys_modify_ldt(void) { _panic("sys_modify_ldt"); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"sys_modify_ldt\00"
define void @sys_modify_ldt() {
%1 = tail call i32 @_panic(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
void TimerInternalClkConfigure(unsigned long ulBase) {

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) &= ~0x00000007;
}


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

x86 assembly (clang, -O2):
<TimerInternalClkConfigure>:
andq   $0xfffffffffffffff8,0x8(%rdi)
ret

LLVM IR (-O0):
define void @TimerInternalClkConfigure(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -8
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @TimerInternalClkConfigure(i64 %0) {
%2 = add i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -8
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int UINT_MAX;
unsigned int ratio(unsigned int x, unsigned int y) {
  if (x <= UINT_MAX / 100)
    x *= 100;
  else
    y /= 100;
  if (y == 0)
    y = 1;
  return x / y;
}


x86 assembly (clang, -O0):
<ratio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
ja     113a <ratio+0x3a>
imul   $0x64,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <ratio+0x49>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115a <ratio+0x5a>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ratio>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
movslq (%rcx),%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
cmp    %edi,%ecx
jae    1133 <ratio+0x33>
mov    %esi,%ecx
imul   $0x51eb851f,%rcx,%rsi
shr    $0x25,%rsi
jmp    1136 <ratio+0x36>
imul   $0x64,%eax,%eax
test   %esi,%esi
mov    $0x1,%ecx
cmovne %esi,%ecx
xor    %edx,%edx
div    %ecx
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
define i32 @ratio(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @UINT_MAX
%7 = sdiv i32 %6, 100
%8 = icmp ule i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %3
%11 = mul i32 %10, 100
store i32 %11, i32* %3
br label %15
12: ; preds = %2
%13 = load i32, i32* %4
%14 = udiv i32 %13, 100
store i32 %14, i32* %4
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 1, i32* %4
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = udiv i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
define i32 @ratio(i32 %0, i32 %1) {
%3 = load i32, i32* @UINT_MAX
%4 = sdiv i32 %3, 100
%5 = icmp ult i32 %4, %0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = mul i32 %0, 100
br label %10
8: ; preds = %2
%9 = udiv i32 %1, 100
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %0, %8 ]
%12 = phi i32 [ %1, %6 ], [ %9, %8 ]
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 1, i32 %12
%15 = udiv i32 %11, %14
ret i32 %15
}
/* Variables and functions */
char *getcwd(int /*<<< orphan*/ *, int /*<<< orphan*/);
char *get_current_dir_name(void) {
  ;
  return getcwd(NULL, 0);
}


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

x86 assembly (clang, -O2):
<get_current_dir_name>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <getcwd@plt>

LLVM IR (-O0):
define i8* @get_current_dir_name() {
%1 = call i8* @getcwd(i32* null, i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @get_current_dir_name() {
%1 = tail call i8* @getcwd(i32* null, i32 0)
ret i8* %1
}
double
f4_cb_send_pre_double_double_double_double_double_double_double_double_long(
    double (*cb)(double, double, double, double, double, double, double, double,
                 long)) {
  long r = 33;
  return cb(8.25, 9.25, 10.25, 11.25, 12.25, 13.25, 14.25, 15.25, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_double_double_double_double_double_double_double_double_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x21,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
movsd  0xee4(%rip),%xmm0
movsd  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm2
movsd  0xee4(%rip),%xmm3
movsd  0xee4(%rip),%xmm4
movsd  0xee4(%rip),%xmm5
movsd  0xee4(%rip),%xmm6
movsd  0xee4(%rip),%xmm7
call   *%rax
movsd  0xe9a(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_double_double_double_double_double_double_double_double_long>:
push   %rax
mov    %rdi,%rax
movsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
movsd  0xef4(%rip),%xmm2
movsd  0xef4(%rip),%xmm3
movsd  0xef4(%rip),%xmm4
movsd  0xef4(%rip),%xmm5
movsd  0xef4(%rip),%xmm6
movsd  0xef4(%rip),%xmm7
mov    $0x21,%edi
call   *%rax
addsd  0xeed(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_double_double_double_double_double_double_double_double_long(double (double, double, double, double, double, double, double, double, i64)* %0) {
%2 = alloca double (double, double, double, double, double, double, double, double, i64)*
%3 = alloca i64
store double (double, double, double, double, double, double, double, double, i64)* %0, double (double, double, double, double, double, double, double, double, i64)** %2
store i64 33, i64* %3
%4 = load double (double, double, double, double, double, double, double, double, i64)*, double (double, double, double, double, double, double, double, double, i64)** %2
%5 = load i64, i64* %3
%6 = call double %4(double 8.250000e+00, double 9.250000e+00, double 1.025000e+01, double 1.125000e+01, double 1.225000e+01, double 1.325000e+01, double 1.425000e+01, double 1.525000e+01, i64 %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_double_double_double_double_double_double_double_double_long(double (double, double, double, double, double, double, double, double, i64)* nocapture %0) {
%2 = tail call double %0(double 8.250000e+00, double 9.250000e+00, double 1.025000e+01, double 1.125000e+01, double 1.225000e+01, double 1.325000e+01, double 1.425000e+01, double 1.525000e+01, i64 33)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int crc_ccitt(int *, int);
bool validate_crc(uint8_t *msg, uint16_t len) {
  uint16_t calculated_crc = crc_ccitt(msg, len - 2);
  uint16_t expected_crc = msg[len - 2] | (msg[len - 1] << 8);
  return (calculated_crc == expected_crc ? true : false);
}


x86 assembly (clang, -O0):
<validate_crc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x2,%esi
call   1030 <crc_ccitt@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_crc>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
lea    -0x2(%r14),%esi
call   1030 <crc_ccitt@plt>
movslq %r14d,%rcx
mov    -0x4(%rbx,%rcx,4),%edx
shl    $0x8,%edx
or     -0x8(%rbx,%rcx,4),%edx
xor    %ecx,%ecx
cmp    %edx,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @validate_crc(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 2
%10 = call i32 @crc_ccitt(i32* %7, i32 %9)
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %3
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %17, i64 %20
%22 = load i32, i32* %21
%23 = shl i32 %22, 8
%24 = or i32 %16, %23
store i32 %24, i32* %6
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = icmp eq i32 %25, %26
%28 = zext i1 %27 to i64
%29 = select i1 %27, i32 1, i32 0
ret i32 %29
}

LLVM IR (-O2):
define i32 @validate_crc(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -2
%4 = tail call i32 @crc_ccitt(i32* %0, i32 %3)
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = add nsw i32 %1, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %12, %7
%14 = icmp eq i32 %4, %13
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ handle_EMT(int /*<<< orphan*/);
int gen_EMT(void) {
  handle_EMT(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<gen_EMT>:
push   %rax
xor    %edi,%edi
call   1030 <handle_EMT@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_EMT() {
%1 = call i32 @handle_EMT(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_EMT() {
%1 = tail call i32 @handle_EMT(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int snprintf(char *, int, char *, char const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void print_stdin_error(const char *message) {
  char buf[256];
  int res = snprintf(buf, 256, "tail: cannot read from stdin: %s\n", message);
  write(STDERR_FILENO, buf, res);
}


x86 assembly (clang, -O0):
<print_stdin_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x100,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
mov    %eax,-0x114(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    -0x110(%rbp),%rsi
mov    -0x114(%rbp),%edx
call   1030 <write@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stdin_error>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <snprintf@plt>
mov    0x2e97(%rip),%rcx
mov    (%rcx),%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"tail: cannot read from stdin: %s\0A\00"
@STDERR_FILENO = global i32 0
define void @print_stdin_error(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @snprintf(i8* %5, i32 256, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* @STDERR_FILENO
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"tail: cannot read from stdin: %s\0A\00"
@STDERR_FILENO = global i32 0
define void @print_stdin_error(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @STDERR_FILENO
%6 = call i32 @write(i32 %5, i8* %3, i32 %4)
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *__attribute__((weak)) lwm2m_strdup(const char *str) {
  return strdup(str);
}


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

x86 assembly (clang, -O2):
<lwm2m_strdup>:
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define weak i8* @lwm2m_strdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strdup(i8* %3)
ret i8* %4
}

LLVM IR (-O2):
define weak i8* @lwm2m_strdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetXBinning(char byBoardNum, short wPixelsBinned) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetXBinning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
lea    0xed4(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSetXBinning(i8 signext %0, i16 signext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetXBinning(i8 signext %0, i16 signext %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *, char *, int);
int main(int argc, char **argv) {
  test_init(argc, argv);
  test_msg("SKIP: %s:%d: "
           "Inotify not supported."
           "\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
           "live/static/inotify_system.c",
           388);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_init@plt>
lea    0xeb7(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x184,%edx
call   1040 <test_msg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <test_init@plt>
lea    0xed3(%rip),%rdi
lea    0xef1(%rip),%rsi
mov    $0x184,%edx
call   1040 <test_msg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"SKIP: %s:%d: Inotify not supported.\0A\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/live/static/inotify_system.c\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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @test_init(i32 %6, i8** %7)
%9 = call i32 @test_msg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 388)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"SKIP: %s:%d: Inotify not supported.\0A\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/live/static/inotify_system.c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_init(i32 %0, i8** %1)
%4 = tail call i32 @test_msg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 388)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t vlsi_feed_sdi(uint8_t *data, uint32_t len) {
  uint32_t i = 0;
  return i;
}


x86 assembly (clang, -O0):
<vlsi_feed_sdi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @vlsi_feed_sdi(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
struct rpn_plugin_info *rpn_plugin_info(
    struct rpn_plugin_info *(*info_link)(char *, char *, char *, double)) {
  return info_link("Zeroes Finder", "Ian Duncan",
                   "Provides support for finding the zeroes of a function on a "
                   "given interval.",
                   1.0);
}


x86 assembly (clang, -O0):
<rpn_plugin_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xef5(%rip),%rdi
lea    0xefc(%rip),%rsi
lea    0xf00(%rip),%rdx
movsd  0xed7(%rip),%xmm0
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpn_plugin_info>:
mov    %rdi,%rax
lea    0xefe(%rip),%rdi
lea    0xf05(%rip),%rsi
lea    0xf09(%rip),%rdx
movsd  0xee0(%rip),%xmm0
jmp    *%rax

LLVM IR (-O0):
%struct.rpn_plugin_info = type opaque
@.str = [14 x i8] c"Zeroes Finder\00"
@.str.1 = [11 x i8] c"Ian Duncan\00"
@.str.2 = [75 x i8] c"Provides support for finding the zeroes of a function on a given interval.\00"
define %struct.rpn_plugin_info* @rpn_plugin_info(%struct.rpn_plugin_info* (i8*, i8*, i8*, double)* %0) {
%2 = alloca %struct.rpn_plugin_info* (i8*, i8*, i8*, double)*
store %struct.rpn_plugin_info* (i8*, i8*, i8*, double)* %0, %struct.rpn_plugin_info* (i8*, i8*, i8*, double)** %2
%3 = load %struct.rpn_plugin_info* (i8*, i8*, i8*, double)*, %struct.rpn_plugin_info* (i8*, i8*, i8*, double)** %2
%4 = call %struct.rpn_plugin_info* %3(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0), double 1.000000e+00)
ret %struct.rpn_plugin_info* %4
}

LLVM IR (-O2):
%struct.rpn_plugin_info = type opaque
@.str = [14 x i8] c"Zeroes Finder\00"
@.str.1 = [11 x i8] c"Ian Duncan\00"
@.str.2 = [75 x i8] c"Provides support for finding the zeroes of a function on a given interval.\00"
define %struct.rpn_plugin_info* @rpn_plugin_info(%struct.rpn_plugin_info* (i8*, i8*, i8*, double)* nocapture %0) {
%2 = tail call %struct.rpn_plugin_info* %0(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0), double 1.000000e+00)
ret %struct.rpn_plugin_info* %2
}
__attribute__((always_)) double triad_base(double b, double c, double x) {
  return b + x * c;
}


x86 assembly (clang, -O0):
<triad_base>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<triad_base>:
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @triad_base(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = call double @llvm.fmuladd.f64(double %8, double %9, double %7)
ret double %10
}

LLVM IR (-O2):
define double @triad_base(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %2, double %1, double %0)
ret double %4
}
void INT_Excep_PERIA_INTA230(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA230() {
ret void
}
int msm_watchdog_suspend(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @msm_watchdog_suspend(%struct.device* nocapture readnone %0) {
ret i32 0
}
int MaxHeapify() {}


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

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

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

LLVM IR (-O2):
define i32 @MaxHeapify() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SetOutputEx(unsigned char, int, unsigned char);
void FloatEx(unsigned char Outputs, unsigned char reset) {
  SetOutputEx(Outputs, 0x00, reset);
}


x86 assembly (clang, -O0):
<FloatEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
xor    %esi,%esi
movzbl %al,%edi
movzbl -0x2(%rbp),%edx
call   1030 <SetOutputEx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FloatEx>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <SetOutputEx@plt>

LLVM IR (-O0):
define void @FloatEx(i8 zeroext %0, i8 zeroext %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 @SetOutputEx(i8 zeroext %5, i32 0, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @FloatEx(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @SetOutputEx(i8 zeroext %0, i32 0, i8 zeroext %1)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ game_start();
int main(void) {
  game_start();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <game_start@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <game_start@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @game_start()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @game_start()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
void RTUuidFromStr(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUuidFromStr() {
ret void
}
void LPCCOMxIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000120))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<LPCCOMxIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x120(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x120(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCCOMxIntDisable>:
not    %rsi
and    %rsi,0x120(%rdi)
ret

LLVM IR (-O0):
define void @LPCCOMxIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 288
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @LPCCOMxIntDisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 288
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
void VP8EncDspCostInitMIPS32(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8EncDspCostInitMIPS32() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chr_show(int /*<<< orphan*/);
int /*<<< orphan*/ fnt_get_chr(unsigned char *, unsigned char);
void fnt_show_char(unsigned char *fbuf, unsigned char code) {
  chr_show(fnt_get_chr(fbuf, code));
}


x86 assembly (clang, -O0):
<fnt_show_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
call   1030 <fnt_get_chr@plt>
mov    %eax,%edi
call   1040 <chr_show@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fnt_show_char(i8* %0, i8 zeroext %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 @fnt_get_chr(i8* %5, i8 zeroext %6)
%8 = call i32 @chr_show(i32 %7)
ret void
}

LLVM IR (-O2):
define void @fnt_show_char(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @fnt_get_chr(i8* %0, i8 zeroext %1)
%4 = tail call i32 @chr_show(i32 %3)
ret void
}
/* Variables and functions */
int wycc_type_flags(int);
int wycc_type_is_chain(int id) {
  int flgs = wycc_type_flags(id);
  if (flgs & 4096) {
    return 1;
  };
  return 0;
}


x86 assembly (clang, -O0):
<wycc_type_is_chain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <wycc_type_flags@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1000,%eax
cmp    $0x0,%eax
je     1143 <wycc_type_is_chain+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <wycc_type_is_chain+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wycc_type_is_chain>:
push   %rax
call   1030 <wycc_type_flags@plt>
shr    $0xc,%eax
and    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @wycc_type_is_chain(i32 %0) {
%2 = tail call i32 @wycc_type_flags(i32 %0)
%3 = lshr i32 %2, 12
%4 = and i32 %3, 1
ret i32 %4
}
void InitApp(void) {}


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

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

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

LLVM IR (-O2):
define void @InitApp() {
ret void
}
/* Variables and functions */
int mpd_single_command(char *);
int play_next(void) { return mpd_single_command("next\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"next\0A\00"
define i32 @play_next() {
%1 = call i32 @mpd_single_command(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"next\0A\00"
define i32 @play_next() {
%1 = tail call i32 @mpd_single_command(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex32(int, unsigned int);
void print_crit_hex32(unsigned int value) { __console_tx_hex32(2, value); }


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

x86 assembly (clang, -O2):
<print_crit_hex32>:
mov    %edi,%esi
mov    $0x2,%edi
jmp    1030 <__console_tx_hex32@plt>

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

LLVM IR (-O2):
define void @print_crit_hex32(i32 %0) {
%2 = tail call i32 @__console_tx_hex32(i32 2, i32 %0)
ret void
}
/* Variables and functions */
void bug_after_abduction_bad(int *x) {
  *x = 42;
  int *y = NULL;
  *y = 42;
}


x86 assembly (clang, -O0):
<bug_after_abduction_bad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @bug_after_abduction_bad(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32 42, i32* %4
store i32* null, i32** %3
%5 = load i32*, i32** %3
store i32 42, i32* %5
ret void
}

LLVM IR (-O2):
void time_indicator_show() {}


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

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

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

LLVM IR (-O2):
define void @time_indicator_show() {
ret void
}
int main() { int x = (unsigned short)-1 + 30; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1001d,-0x4(%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
store i32 65565, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
void *talloc_pool(const void *context, size_t size) { return (void *)context; }


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

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

LLVM IR (-O0):
define i8* @talloc_pool(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
ret i8* %5
}

LLVM IR (-O2):
define i8* @talloc_pool(i8* readnone returned %0, i64 %1) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ gmx_nmeig(int, char **);
int main(int argc, char *argv[]) {
  gmx_nmeig(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_nmeig@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_nmeig(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_nmeig(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int swap(char *, char *);
int main(int argc, char **args) {
  if (argc != 3) {
    printf("Should be exactly two arguments \n");
    return 1;
  }
  return swap(args[1], args[2]);
}


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)
cmpl   $0x3,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x50>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <swap@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jne    1134 <main+0x14>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
pop    %rax
jmp    1040 <swap@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Should be exactly two arguments \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 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %18
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @swap(i8* %13, i8* %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %10, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [33 x i8] c"Should be exactly two arguments \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @swap(i8* %8, i8* %10)
br label %12
12: ; preds = %6, %4
%13 = phi i32 [ 1, %4 ], [ %11, %6 ]
ret i32 %13
}
int test_imm_03uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x03 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_03uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 196608
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int test_return_in_body_f();
void test_return_in_body() { assert(test_return_in_body_f() == 1); }


x86 assembly (clang, -O0):
<test_return_in_body>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_return_in_body_f@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_return_in_body>:
push   %rax
xor    %eax,%eax
call   1030 <test_return_in_body_f@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @test_return_in_body() {
%1 = call i32 (...) @test_return_in_body_f()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
ret void
}

LLVM IR (-O2):
define void @test_return_in_body() {
%1 = tail call i32 (...) @test_return_in_body_f()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverse(int *, int, size_t);
void restore_array(int arr[], size_t n, int rot_spot) {
  if (rot_spot != -1) {
    reverse(arr, 0, rot_spot + 1);
    reverse(arr, rot_spot + 1, n);
    reverse(arr, 0, n);
  }
}


x86 assembly (clang, -O0):
<restore_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1163 <restore_array+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdx
xor    %esi,%esi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rdx
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <reverse@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_array>:
cmp    $0xffffffff,%edx
je     1150 <restore_array+0x40>
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%edx
movslq %edx,%r15
xor    %esi,%esi
mov    %r15,%rdx
call   1030 <reverse@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14,%rdx
call   1030 <reverse@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <reverse@plt>
ret

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

LLVM IR (-O2):
define void @restore_array(i32* %0, i64 %1, i32 %2) {
%4 = icmp eq i32 %2, -1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = add nuw nsw i32 %2, 1
%7 = sext i32 %6 to i64
%8 = tail call i32 @reverse(i32* %0, i32 0, i64 %7)
%9 = tail call i32 @reverse(i32* %0, i32 %6, i64 %1)
%10 = tail call i32 @reverse(i32* %0, i32 0, i64 %1)
br label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ printUsage();
int /*<<< orphan*/ stderr;
FILE *openFile(const char *path, const char *mode) {
  FILE *filePtr;
  filePtr = fopen(path, mode);
  if (filePtr == NULL) {
    fprintf(stderr, "ERROR: Could not open file %s\n", path);
    printUsage();
  }
  return filePtr;
}


x86 assembly (clang, -O0):
<openFile>:
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   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117c <openFile+0x4c>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <printUsage@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openFile>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1163 <openFile+0x33>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <printUsage@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"ERROR: Could not open file %s\0A\00"
define i32* @openFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 (...) @printUsage()
br label %16
16: ; preds = %11, %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"ERROR: Could not open file %s\0A\00"
define noalias i32* @openFile(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 (...) @printUsage()
br label %9
9: ; preds = %5, %2
ret i32* %3
}