xunge/DecIR huggingface dataset:
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c;
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  c = 0;
  while ((x > 0) || (y > 0)) {
    if (x > 0) {
      x = x - 1;
    } else {
      if (y > 0) {
        y = y - 1;
      } else {
      }
    }
    c = c + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jg     1153 <main+0x43>
cmpl   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1163 <main+0x53>
jmp    11ab <main+0x9b>
cmpl   $0x0,-0xc(%rbp)
jle    117b <main+0x6b>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119d <main+0x8d>
cmpl   $0x0,-0x10(%rbp)
jle    1193 <main+0x83>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1198 <main+0x88>
jmp    1198 <main+0x88>
jmp    119d <main+0x8d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <main+0x2a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %4
store i32 0, i32* %2
br label %7
7: ; preds = %29, %0
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 0
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ true, %7 ], [ %12, %10 ]
br i1 %14, label %15, label %32
15: ; preds = %13
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %3
br label %29
21: ; preds = %15
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %4
%26 = sub nsw i32 %25, 1
store i32 %26, i32* %4
br label %28
27: ; preds = %21
br label %28
28: ; preds = %27, %24
br label %29
29: ; preds = %28, %18
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %7
32: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void __attribute__((weak)) usb_lp_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<usb_lp_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_lp_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.usb_lp_isr = [11 x i8] c"usb_lp_isr\00"
define weak void @usb_lp_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.usb_lp_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.usb_lp_isr = [11 x i8] c"usb_lp_isr\00"
define weak void @usb_lp_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.usb_lp_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int read_pci_drives();
int readPCIDrives() { return read_pci_drives(); }


x86 assembly (clang, -O0):
<readPCIDrives>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <read_pci_drives@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @readPCIDrives() {
%1 = call i32 (...) @read_pci_drives()
ret i32 %1
}

LLVM IR (-O2):
define i32 @readPCIDrives() {
%1 = tail call i32 (...) @read_pci_drives()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ ret;

/* Variables and functions */
int /*<<< orphan*/ read_kmem(unsigned long *, int, unsigned long);
unsigned long read_long(unsigned long addr) {
  unsigned long ret;
  read_kmem(&ret, sizeof(ret), addr);
  return ret;
}


x86 assembly (clang, -O0):
<read_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1030 <read_kmem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_long>:
push   %rax
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <read_kmem@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @read_long(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @read_kmem(i64* %3, i32 8, i64 %4)
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @read_long(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @read_kmem(i64* %2, i32 8, i64 %0)
%5 = load i64, i64* %2
ret i64 %5
}
unsigned long unsignedlong_ignoring_longint(unsigned long x, long int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @unsignedlong_ignoring_longint(i64 returned %0, i64 %1) {
ret i64 %0
}
void NV12ToI420() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToI420() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EPIConfigHB16TimingSet(uint32_t ui32Base, uint32_t ui32CS,
                            uint32_t ui32Config) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + (0x00000310 + (ui32CS << 2))))) =
      ui32Config;
}


x86 assembly (clang, -O0):
<EPIConfigHB16TimingSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x2,%edx
add    $0x310,%edx
add    %edx,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIConfigHB16TimingSet>:
lea    (%rdi,%rsi,4),%eax
add    $0x310,%eax
cltq
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @EPIConfigHB16TimingSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = shl i32 %9, 2
%11 = add nsw i32 784, %10
%12 = add nsw i32 %8, %11
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %7, i32* %14
ret void
}

LLVM IR (-O2):
define void @EPIConfigHB16TimingSet(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 2
%5 = add i32 %0, 784
%6 = add i32 %5, %4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %2, i32* %8
ret void
}
/* Variables and functions */
int isinf(double const);
int gsl_isinf(const double x) { return isinf(x); }


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

x86 assembly (clang, -O2):
<gsl_isinf>:
jmp    1030 <isinf@plt>

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

LLVM IR (-O2):
define i32 @gsl_isinf(double %0) {
%2 = tail call i32 @isinf(double %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char **manu_char2(char **pchar) {
  *pchar = (char *)malloc(sizeof(char) * 16);
  memcpy(*pchar, "manu_char2", 6);
  return pchar;
}


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

x86 assembly (clang, -O2):
<manu_char2>:
push   %rbx
mov    %rdi,%rbx
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
lea    0xec8(%rip),%rsi
mov    %rax,%rdi
mov    $0x6,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"manu_char2\00"
define i8** @manu_char2(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i64 @malloc(i32 16)
%4 = inttoptr i64 %3 to i8*
%5 = load i8**, i8*** %2
store i8* %4, i8** %5
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i32 @memcpy(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 6)
%9 = load i8**, i8*** %2
ret i8** %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"manu_char2\00"
define i8** @manu_char2(i8** returned writeonly %0) {
%2 = tail call i64 @malloc(i32 16)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %0
%4 = tail call i32 @memcpy(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 6)
ret i8** %0
}
int f5() { return 5; }


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

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

LLVM IR (-O0):
define i32 @f5() {
ret i32 5
}

LLVM IR (-O2):
define i32 @f5() {
ret i32 5
}
/* Variables and functions */
unsigned int sad_mx_n_c(unsigned char *, int, unsigned char *, int, int, int);
unsigned int vp8_sad8x16_c(unsigned char *src_ptr, int src_stride,
                           unsigned char *ref_ptr, int ref_stride,
                           int max_sad) {
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 8, 16);
}


x86 assembly (clang, -O0):
<vp8_sad8x16_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x8,%r8d
mov    $0x10,%r9d
call   1030 <sad_mx_n_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sad8x16_c>:
mov    $0x8,%r8d
mov    $0x10,%r9d
jmp    1030 <sad_mx_n_c@plt>

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

LLVM IR (-O2):
define i32 @vp8_sad8x16_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 8, i32 16)
ret i32 %6
}
int test_imm_C6int8_reg(signed char val) {
  return ((val) & (-0xC6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C6int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -198
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
alpha(char c) {
  if (c > 127)
    return 0;
  return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) ||
          (c == '_'));
}


x86 assembly (clang, -O0):
<alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7f,%eax
jle    1123 <alpha+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1179 <alpha+0x79>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1142 <alpha+0x42>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x6(%rbp)
jle    116e <alpha+0x6e>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1161 <alpha+0x61>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x6(%rbp)
jle    116e <alpha+0x6e>
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
cmp    $0x5f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @alpha(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 127
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %31
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 97
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 122
br i1 %15, label %28, label %16
16: ; preds = %12, %8
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 90
br i1 %23, label %28, label %24
24: ; preds = %20, %16
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 95
br label %28
28: ; preds = %24, %20, %12
%29 = phi i1 [ true, %20 ], [ true, %12 ], [ %27, %24 ]
%30 = zext i1 %29 to i32
store i32 %30, i32* %2
br label %31
31: ; preds = %28, %7
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = icmp eq i8 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
void fd90(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  p01C:
    goto p01C;
    goto a;
  a:;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd90>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd90+0x7>

x86 assembly (clang, -O2):
<fd90>:
jmp    1100 <fd90>

LLVM IR (-O0):
define void @fd90(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd90(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
bool IsDigital(char ch) { return ch >= '0' && ch <= '9'; }


x86 assembly (clang, -O0):
<IsDigital>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <IsDigital+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDigital>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsDigital(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsDigital(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int sp_release(int efd) {
  close(efd);
  return -1;
}


x86 assembly (clang, -O0):
<sp_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_release>:
push   %rax
call   1030 <close@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @sp_release(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func1(int con1, int con2) {
  int x = 1;
  if (con1 == 0) {
    x = x + 1;
  }
  if (con2 > 1) {
    x = x * 2;
  }
  printf("x = %d\n", x);
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1138 <func1+0x28>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114b <func1+0x3b>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
cmp    $0x1,%edi
mov    $0x1,%eax
adc    $0x0,%eax
cmp    $0x2,%esi
setge  %cl
shl    %cl,%eax
lea    0xed6(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"x = %d\0A\00"
define void @func1(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 2, i32 1
%5 = icmp sgt i32 %1, 1
%6 = zext i1 %5 to i32
%7 = shl nuw nsw i32 %4, %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  ((void)argc);
  ((void)argv);
  printf("POLARSSL_MD5_C not defined.\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
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 = [29 x i8] c"POLARSSL_MD5_C not defined.\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 = load i8**, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"POLARSSL_MD5_C not defined.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_F6uint16_reg(unsigned short val) {
  return ((val) & (-0xF6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F6uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff0a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_F6uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -246
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ daemon(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  daemon(0, 0);
  while (1) {
    sleep(1);
  }
  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)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <daemon@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    113f <main+0x1f>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <daemon@plt>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

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 = call i32 @daemon(i32 0, i32 0)
br label %7
7: ; preds = %2, %7
%8 = call i32 @sleep(i32 1)
br label %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @daemon(i32 0, i32 0)
br label %4
4: ; preds = %2, %4
%5 = tail call i32 @sleep(i32 1)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float pi = 3.1415;
  float r, toplam;
  printf("yaricapi giriniz:\n");
  scanf("%f", &r);
  toplam = pi * r * r;
  printf("alan: %f\n", toplam);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  0xea4(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe95(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"yaricapi giriniz:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"alan: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store float 0x400921CAC0000000, float* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fmul float %7, %8
%10 = load float, float* %3
%11 = fmul float %9, %10
store float %11, float* %4
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %13)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"alan: %f\0A\00"
@str = [18 x i8] c"yaricapi giriniz:\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, 0x400921CAC0000000
%7 = fmul float %5, %6
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}
unsigned char UART0ReadChar(void) {
  return (*((volatile unsigned char *)0xE000C000));
}


x86 assembly (clang, -O0):
<UART0ReadChar>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000c000,%eax
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART0ReadChar>:
mov    $0xe000c000,%eax
mov    (%rax),%al
ret

LLVM IR (-O0):
define zeroext i8 @UART0ReadChar() {
%1 = load volatile i8, i8* inttoptr (i64 3758145536 to i8*)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @UART0ReadChar() {
%1 = load volatile i8, i8* inttoptr (i64 3758145536 to i8*)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ F_SETLKW;
int _create_locked_cmd(char *, int /*<<< orphan*/);
int pmix_create_locked_wait(char *path) {
  return _create_locked_cmd(path, F_SETLKW);
}


x86 assembly (clang, -O0):
<pmix_create_locked_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <_create_locked_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmix_create_locked_wait>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <_create_locked_cmd@plt>

LLVM IR (-O0):
@F_SETLKW = global i32 0
define i32 @pmix_create_locked_wait(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_SETLKW
%5 = call i32 @_create_locked_cmd(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@F_SETLKW = global i32 0
define i32 @pmix_create_locked_wait(i8* %0) {
%2 = load i32, i32* @F_SETLKW
%3 = tail call i32 @_create_locked_cmd(i8* %0, i32 %2)
ret i32 %3
}
void uIntToBytes(unsigned int num, unsigned char *bytes) {
  bytes[0] = (unsigned char)(num & 0xFF);
  bytes[1] = (unsigned char)((num >> 8) & 0xFF);
  bytes[2] = (unsigned char)((num >> 16) & 0xFF);
  bytes[3] = (unsigned char)((num >> 24) & 0xFF);
}


x86 assembly (clang, -O0):
<uIntToBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uIntToBytes>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @uIntToBytes(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %3
%17 = lshr i32 %16, 16
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %3
%23 = lshr i32 %22, 24
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

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


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

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

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

LLVM IR (-O2):
define i32 @get_main_addr() {
ret i32 0
}
void Cycle_Inference(long currentTime) {}


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

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

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

LLVM IR (-O2):
define void @Cycle_Inference(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void signal_handler(int signum) { printf("signum = %d\n", signum); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"signum = %d\0A\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free_memory();
int /*<<< orphan*/ printf(char *, int);
void memory_error(int place) {
  printf("out of memory at %d\n", place);
  free_memory();
  exit(1);
}


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

x86 assembly (clang, -O2):
<memory_error>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <free_memory@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"out of memory at %d\0A\00"
define void @memory_error(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @free_memory()
%4 = tail call i32 @exit(i32 1)
unreachable
}
int __attribute__((unused))
compare_and_swap(long int *p, long int oldval, long int newval) {
  if (*p != oldval)
    return 0;
  *p = newval;
  return 1;
}


x86 assembly (clang, -O0):
<compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
je     112d <compare_and_swap+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    113f <compare_and_swap+0x3f>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_and_swap>:
xor    %eax,%eax
cmp    %rsi,(%rdi)
jne    110f <compare_and_swap+0xf>
mov    %rdx,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_and_swap(i64* nocapture %0, i64 %1, i64 %2) {
%4 = load i64, i64* %0
%5 = icmp eq i64 %4, %1
br i1 %5, label %6, label %7
6: ; preds = %3
store i64 %2, i64* %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %8
}
save_original_data() {}


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

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

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

LLVM IR (-O2):
define i32 @save_original_data() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  int i;
  for (i = 0; i < 5; i++) {
    printf("hello");
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1164 <main+0x44>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @sleep(i32 1)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 1)
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @sleep(i32 1)
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @sleep(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR77_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR77_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR77_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int a, b = 2, c;
  int *pointer;
  c = 3;
  pointer = &c;
  a = c;
  printf("a = %d; b = %d", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"a = %d; b = %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 3, i32 2)
ret i32 0
}
/* Variables and functions */
int colliding_name();
int stupid_average(int x, int y) { return colliding_name() * (x + y) / 2; }


x86 assembly (clang, -O0):
<stupid_average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <colliding_name@plt>
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stupid_average>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <colliding_name@plt>
add    %ebx,%ebp
imul   %ebp,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @stupid_average(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @colliding_name()
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = mul nsw i32 %5, %8
%10 = sdiv i32 %9, 2
ret i32 %10
}

LLVM IR (-O2):
define i32 @stupid_average(i32 %0, i32 %1) {
%3 = tail call i32 (...) @colliding_name()
%4 = add nsw i32 %1, %0
%5 = mul nsw i32 %3, %4
%6 = sdiv i32 %5, 2
ret i32 %6
}
/* Variables and functions */
int EthernetPHYRead(unsigned long, int);
int /*<<< orphan*/ EthernetPHYWrite(unsigned long, int, int);
void EthernetPHYPowerOn(unsigned long ulBase) {
  EthernetPHYWrite(ulBase, 0x00000000,
                   (EthernetPHYRead(ulBase, 0x00000000) & ~0x00000800) |
                       0x00001000);
}


x86 assembly (clang, -O0):
<EthernetPHYPowerOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <EthernetPHYRead@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
and    $0xfffff7ff,%edx
or     $0x1000,%edx
xor    %esi,%esi
call   1040 <EthernetPHYWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EthernetPHYPowerOn>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <EthernetPHYRead@plt>
and    $0xffffe7ff,%eax
lea    0x1000(%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <EthernetPHYWrite@plt>

LLVM IR (-O0):
define void @EthernetPHYPowerOn(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @EthernetPHYRead(i64 %4, i32 0)
%6 = and i32 %5, -2049
%7 = or i32 %6, 4096
%8 = call i32 @EthernetPHYWrite(i64 %3, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @EthernetPHYPowerOn(i64 %0) {
%2 = tail call i32 @EthernetPHYRead(i64 %0, i32 0)
%3 = and i32 %2, -6145
%4 = or i32 %3, 4096
%5 = tail call i32 @EthernetPHYWrite(i64 %0, i32 0, i32 %4)
ret void
}
void TimerTickConfigure(void (*pfnHandler)(void)) {}


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

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

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

LLVM IR (-O2):
define void @TimerTickConfigure(void ()* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "stat", message); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [5 x i8] c"stat\00"
define void @g_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [5 x i8] c"stat\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int puts(char const *);
int hooked_puts(char const *s) {
  puts(s);
  return puts("HOOKED!");
}


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

x86 assembly (clang, -O2):
<hooked_puts>:
push   %rax
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"HOOKED!\00"
define i32 @hooked_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %5
}

LLVM IR (-O2):
@.str = [8 x i8] c"HOOKED!\00"
define i32 @hooked_puts(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
void bootLoaderExit() {}


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

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

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

LLVM IR (-O2):
define void @bootLoaderExit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void sleepMs(int ms) { usleep((unsigned int)(ms * 1000)); }


x86 assembly (clang, -O0):
<sleepMs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleepMs>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @sleepMs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @sleepMs(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int umount2(char const *, int /*<<< orphan*/);
int __umount(const char *name) { return umount2(name, 0); }


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

x86 assembly (clang, -O2):
<__umount>:
xor    %esi,%esi
jmp    1030 <umount2@plt>

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

LLVM IR (-O2):
define i32 @__umount(i8* %0) {
%2 = tail call i32 @umount2(i8* %0, i32 0)
ret i32 %2
}