xunge/DecIR huggingface dataset:
/* Variables and functions */
int port_byte_in(int);
int /*<<< orphan*/ port_byte_out(int, int);
int get_cursor_position() {
  int offset;
  port_byte_out(0x3d4, 14);
  offset = port_byte_in(0x3d5) << 8;
  port_byte_out(0x3d4, 15);
  offset += port_byte_in(0x3d5);
  return offset * 2;
}


x86 assembly (clang, -O0):
<get_cursor_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cursor_position>:
push   %rbx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
add    %ebx,%eax
add    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_cursor_position() {
%1 = alloca i32
%2 = call i32 @port_byte_out(i32 980, i32 14)
%3 = call i32 @port_byte_in(i32 981)
%4 = shl i32 %3, 8
store i32 %4, i32* %1
%5 = call i32 @port_byte_out(i32 980, i32 15)
%6 = call i32 @port_byte_in(i32 981)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, %6
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = mul nsw i32 %9, 2
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_cursor_position() {
%1 = tail call i32 @port_byte_out(i32 980, i32 14)
%2 = tail call i32 @port_byte_in(i32 981)
%3 = shl i32 %2, 8
%4 = tail call i32 @port_byte_out(i32 980, i32 15)
%5 = tail call i32 @port_byte_in(i32 981)
%6 = add nsw i32 %5, %3
%7 = shl nsw i32 %6, 1
ret i32 %7
}
/* Variables and functions */
unsigned char inb(int);
unsigned char get_nmi_reason(void) { return inb(0x61); }


x86 assembly (clang, -O0):
<get_nmi_reason>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1030 <inb@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nmi_reason>:
mov    $0x61,%edi
jmp    1030 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @get_nmi_reason() {
%1 = call zeroext i8 @inb(i32 97)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @get_nmi_reason() {
%1 = tail call zeroext i8 @inb(i32 97)
ret i8 %1
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_25(int Salt, int Parameter) {
  unsigned b = Salt ^ 0x71422261;
  return yahoo_M1Common(b, Parameter);
}


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

x86 assembly (clang, -O2):
<yahoo_f01_25>:
xor    $0x71422261,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_25(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = xor i32 %6, 1900159585
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @yahoo_M1Common(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yahoo_f01_25(i32 %0, i32 %1) {
%3 = xor i32 %0, 1900159585
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ dset_find(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ dset_link(int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/);
__attribute__((visibility("hidden"))) void
dset_makeunion(int32_t *S, int32_t r1, int32_t r2) {
  int32_t a, b;
  a = dset_find(r1, S);
  b = dset_find(r2, S);
  dset_link(S, a, b);
}


x86 assembly (clang, -O0):
<dset_makeunion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <dset_find@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <dset_find@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <dset_link@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dset_makeunion>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbx
mov    %esi,%edi
mov    %rbx,%rsi
call   1040 <dset_find@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
call   1040 <dset_find@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <dset_link@plt>

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

LLVM IR (-O2):
define hidden void @dset_makeunion(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @dset_find(i32 %1, i32* %0)
%5 = tail call i32 @dset_find(i32 %2, i32* %0)
%6 = tail call i32 @dset_link(i32* %0, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
size_t strlen(char *);
scalar_t__ write(int, char *, size_t);
void write_log(int fd, char *str) {
  if (fd < 1)
    return;
  size_t x = strlen(str);
  if (write(fd, str, x))
    return;
}


x86 assembly (clang, -O0):
<write_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    113e <write_log+0x1e>
jmp    116a <write_log+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
cmp    $0x0,%rax
je     116a <write_log+0x4a>
jmp    116a <write_log+0x4a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_log>:
test   %edi,%edi
jle    1147 <write_log+0x27>
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
define void @write_log(i32 %0, i8* nocapture %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = tail call i64 @write(i32 %0, i8* %1, i64 %5)
br label %7
7: ; preds = %2, %4
ret void
}
int multiply(int x, int y) { return x * y; }


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @multiply(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
int main() {
  int i;
  int j;
  int k;
  i = 0;
  k = 9;
  j = -100;
  while (i <= 100) {
    i = i + 1;
    while (j < 20)
      j = i + j;
    k = 4;
    while (k <= 3)
      k = k + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x9,-0x10(%rbp)
movl   $0xffffff9c,-0xc(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     116f <main+0x6f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    114b <main+0x4b>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x33>
movl   $0x4,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jg     116a <main+0x6a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <main+0x52>
jmp    1120 <main+0x20>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int fcompare(float a, float b) {
  float d = a - b;
  if (d != d)
    return a == b ? 0 : 0xAABBCCDD;
  return d == 0.f ? 0 : (d > 0.f ? 1 : -1);
}


x86 assembly (clang, -O0):
<fcompare>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    1137 <fcompare+0x37>
jp     1137 <fcompare+0x37>
jmp    1160 <fcompare+0x60>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mov    $0xaabbccdd,%eax
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    11a2 <fcompare+0xa2>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1181 <fcompare+0x81>
jp     1181 <fcompare+0x81>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    119c <fcompare+0x9c>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcompare>:
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
ucomiss %xmm2,%xmm2
jp     1124 <fcompare+0x24>
xor    %eax,%eax
xorps  %xmm0,%xmm0
xor    %ecx,%ecx
ucomiss %xmm0,%xmm2
seta   %cl
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret
ucomiss %xmm1,%xmm0
setnp  %al
sete   %cl
xor    %edx,%edx
test   %al,%cl
mov    $0xaabbccdd,%eax
cmovne %edx,%eax
ret

LLVM IR (-O0):
define i32 @fcompare(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fsub float %7, %8
store float %9, float* %6
%10 = load float, float* %6
%11 = load float, float* %6
%12 = fcmp une float %10, %11
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load float, float* %4
%15 = load float, float* %5
%16 = fcmp oeq float %14, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 -1430532899
store i32 %18, i32* %3
br label %30
19: ; preds = %2
%20 = load float, float* %6
%21 = fcmp oeq float %20, 0.000000e+00
br i1 %21, label %22, label %23
22: ; preds = %19
br label %28
23: ; preds = %19
%24 = load float, float* %6
%25 = fcmp ogt float %24, 0.000000e+00
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 1, i32 -1
br label %28
28: ; preds = %23, %22
%29 = phi i32 [ 0, %22 ], [ %27, %23 ]
store i32 %29, i32* %3
br label %30
30: ; preds = %28, %13
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @fcompare(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fcmp uno float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = fcmp oeq float %0, %1
%7 = select i1 %6, i32 0, i32 -1430532899
br label %13
8: ; preds = %2
%9 = fcmp oeq float %3, 0.000000e+00
%10 = fcmp ogt float %3, 0.000000e+00
%11 = select i1 %10, i32 1, i32 -1
%12 = select i1 %9, i32 0, i32 %11
br label %13
13: ; preds = %8, %5
%14 = phi i32 [ %7, %5 ], [ %12, %8 ]
ret i32 %14
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vseqx_set_chroma(uint8_t *p_mp2vseqx, uint8_t i_chroma) {
  p_mp2vseqx[5] &= 0xf9;
  p_mp2vseqx[5] |= (i_chroma & 0x3) << 1;
}


x86 assembly (clang, -O0):
<mp2vseqx_set_chroma>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
and    $0xf9,%ecx
mov    %ecx,0x14(%rax)
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
or     0x14(%rax),%ecx
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_set_chroma>:
mov    $0xf9,%eax
and    0x14(%rdi),%eax
and    $0x3,%esi
lea    (%rax,%rsi,2),%eax
mov    %eax,0x14(%rdi)
ret

LLVM IR (-O0):
define void @mp2vseqx_set_chroma(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 5
%7 = load i32, i32* %6
%8 = and i32 %7, 249
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 3
%11 = shl i32 %10, 1
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 5
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @mp2vseqx_set_chroma(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 5
%4 = load i32, i32* %3
%5 = and i32 %4, 249
%6 = shl i32 %1, 1
%7 = and i32 %6, 6
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
char *calloc(size_t, int);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *memalloc_copy_length(const char *src, size_t n) {
  char *dest;
  dest = calloc(n + 1, sizeof(char));
  if (dest)
    memcpy(dest, src, n);
  return dest;
}


x86 assembly (clang, -O0):
<memalloc_copy_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1162 <memalloc_copy_length+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memalloc_copy_length>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114f <memalloc_copy_length+0x2f>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @memalloc_copy_length(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @calloc(i64 %3, i32 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_le();
uint32_t le_u32(const uint32_t v) {
  if (!cpu_le())
    return ((v & 0xFF000000) >> 24) | ((v & 0x00FF0000) >> 8) |
           ((v & 0x0000FF00) << 8) | ((v & 0x000000FF) << 24);
  return v;
}


x86 assembly (clang, -O0):
<le_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <cpu_le@plt>
cmp    $0x0,%eax
jne    1168 <le_u32+0x58>
mov    -0x8(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x8(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <le_u32+0x5e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_u32>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <cpu_le@plt>
test   %eax,%eax
mov    %ebx,%eax
bswap  %eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @le_u32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @cpu_le()
%5 = icmp ne i32 %4, 0
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = and i32 %7, -16777216
%9 = lshr i32 %8, 24
%10 = load i32, i32* %3
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %3
%15 = and i32 %14, 65280
%16 = shl i32 %15, 8
%17 = or i32 %13, %16
%18 = load i32, i32* %3
%19 = and i32 %18, 255
%20 = shl i32 %19, 24
%21 = or i32 %17, %20
store i32 %21, i32* %2
br label %24
22: ; preds = %1
%23 = load i32, i32* %3
store i32 %23, i32* %2
br label %24
24: ; preds = %22, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @le_u32(i32 %0) {
%2 = tail call i32 (...) @cpu_le()
%3 = icmp eq i32 %2, 0
%4 = tail call i32 @llvm.bswap.i32(i32 %0)
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void _OS_EnterWaitMode(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _thread_is_static_one(struct AMCThread const *);
int _thread_is_dynamic_one(const struct AMCThread *thread) {
  return !_thread_is_static_one(thread);
}


x86 assembly (clang, -O0):
<_thread_is_dynamic_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_thread_is_static_one@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_thread_is_dynamic_one>:
push   %rax
call   1030 <_thread_is_static_one@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.AMCThread = type { i32 }
define i32 @_thread_is_dynamic_one(%struct.AMCThread* %0) {
%2 = alloca %struct.AMCThread*
store %struct.AMCThread* %0, %struct.AMCThread** %2
%3 = load %struct.AMCThread*, %struct.AMCThread** %2
%4 = call i32 @_thread_is_static_one(%struct.AMCThread* %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.AMCThread = type { i32 }
define i32 @_thread_is_dynamic_one(%struct.AMCThread* %0) {
%2 = tail call i32 @_thread_is_static_one(%struct.AMCThread* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int ft_isascii(int c) {
  if (0 <= c && c <= 127)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jg     1128 <ft_isascii+0x28>
cmpl   $0x7f,-0x8(%rbp)
jg     1128 <ft_isascii+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <ft_isascii+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isascii(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 127
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
float sq(float x) { return x * x; }


x86 assembly (clang, -O0):
<sq>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sq>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @sq(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t r16be(const uint8_t *buf) {
  return (((uint16_t)buf[0]) << 8) | ((uint16_t)buf[1]);
}


x86 assembly (clang, -O0):
<r16be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r16be>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @r16be(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @r16be(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
void freeCMatrix(int nsam, char **list) {
  int i;
  for (i = 0; i < nsam; i++)
    free(list[i]);
  free(list);
  return;
}


x86 assembly (clang, -O0):
<freeCMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <freeCMatrix+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <freeCMatrix+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeCMatrix>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <freeCMatrix+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeCMatrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeCMatrix(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int abs(int);
int Manhattan(int x[], int y[], int i, int j) {
  return (abs(x[i] - x[j]) + abs(y[i] - y[j]));
}


x86 assembly (clang, -O0):
<Manhattan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
sub    (%rax,%rcx,4),%edi
call   1030 <abs@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
sub    (%rax,%rcx,4),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Manhattan>:
movslq %edx,%rax
mov    (%rdi,%rax,4),%edx
movslq %ecx,%rcx
sub    (%rdi,%rcx,4),%edx
mov    %edx,%edi
neg    %edi
cmovs  %edx,%edi
mov    (%rsi,%rax,4),%edx
sub    (%rsi,%rcx,4),%edx
mov    %edx,%eax
neg    %eax
cmovs  %edx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @Manhattan(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = load i32*, i32** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = sub nsw i32 %13, %18
%20 = call i32 @abs(i32 %19)
%21 = load i32*, i32** %6
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = load i32*, i32** %6
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
%30 = load i32, i32* %29
%31 = sub nsw i32 %25, %30
%32 = call i32 @abs(i32 %31)
%33 = add nsw i32 %20, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @Manhattan(i32* nocapture %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = tail call i32 @llvm.abs.i32(i32 %11, i1 true)
%13 = getelementptr inbounds i32, i32* %1, i64 %5
%14 = load i32, i32* %13
%15 = getelementptr inbounds i32, i32* %1, i64 %8
%16 = load i32, i32* %15
%17 = sub nsw i32 %14, %16
%18 = tail call i32 @llvm.abs.i32(i32 %17, i1 true)
%19 = add nuw nsw i32 %18, %12
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_substr(char *string, int start_index, int length) {
  for (int i = 0; i < length; i++) {
    printf("%c", string[start_index + i]);
  }
}


x86 assembly (clang, -O0):
<print_substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1160 <print_substr+0x50>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
lea    0xeb7(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <print_substr+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_substr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1156 <print_substr+0x46>
mov    %rdi,%r15
movslq %esi,%rax
mov    %edx,%r12d
add    %rax,%r15
xor    %ebx,%ebx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_substr+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print_substr(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = zext i32 %2 to i64
br label %9
8: ; preds = %9, %3
ret void
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %15, %9 ]
%11 = add nsw i64 %10, %6
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %13)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %7
br i1 %16, label %8, label %9
}
int DRV_I2C_SELFCHECK(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_I2C_SELFCHECK() {
ret i32 0
}
void gtk_text_view_set_accepts_tab() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_set_accepts_tab() {
ret void
}
unsigned long ptr_hash(void *ptr) { return (unsigned long)ptr >> 3; }


x86 assembly (clang, -O0):
<ptr_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_hash>:
mov    %rdi,%rax
shr    $0x3,%rax
ret

LLVM IR (-O0):
define i64 @ptr_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = lshr i64 %4, 3
ret i64 %5
}

LLVM IR (-O2):
define i64 @ptr_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 3
ret i64 %3
}
long labs(long a) { return a >= 0 ? a : -a; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     1120 <labs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int isalpha(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", isalpha(-128));
  printf("%d\n", isalpha(255));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffff80,%edi
call   1040 <isalpha@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xff,%edi
call   1040 <isalpha@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @isalpha(i32 -128)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @isalpha(i32 255)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @isalpha(i32 -128)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isalpha(i32 255)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
unsigned long long LOOP2(int /*<<< orphan*/);
unsigned long long LOOP() { return LOOP2(0); }


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

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

LLVM IR (-O0):
define i64 @LOOP() {
%1 = call i64 @LOOP2(i32 0)
ret i64 %1
}

LLVM IR (-O2):
define i64 @LOOP() {
%1 = tail call i64 @LOOP2(i32 0)
ret i64 %1
}
unsigned int soma(unsigned int x, unsigned int y) { return x + y; }


x86 assembly (clang, -O0):
<soma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soma>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @soma(i32 %0, i32 %1) {
%3 = add i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct struct_one {
  int dummy;
};

/* Variables and functions */
struct struct_one *bad_function(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  struct struct_one *p;
  p = bad_function(0, 0);
  if (p != (struct struct_one *)5) {
    printf("cil bug is still present\n");
    return 2;
  } else {
    printf("bug has been fixed!\n");
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <bad_function@plt>
mov    %rax,-0x10(%rbp)
mov    $0x5,%eax
cmp    %rax,-0x10(%rbp)
je     1163 <main+0x43>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1176 <main+0x56>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <bad_function@plt>
xor    %ebx,%ebx
cmp    $0x5,%rax
setne  %bl
lea    0xec6(%rip),%rax
lea    0xed3(%rip),%rdi
cmove  %rax,%rdi
add    %ebx,%ebx
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.struct_one = type { i32 }
@.str = [26 x i8] c"cil bug is still present\0A\00"
@.str.1 = [21 x i8] c"bug has been fixed!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.struct_one*
store i32 0, i32* %1
%3 = call %struct.struct_one* @bad_function(i32 0, i32 0)
store %struct.struct_one* %3, %struct.struct_one** %2
%4 = load %struct.struct_one*, %struct.struct_one** %2
%5 = icmp ne %struct.struct_one* %4, inttoptr (i64 5 to %struct.struct_one*)
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %1
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
%struct.struct_one = type { i32 }
@str = [20 x i8] c"bug has been fixed!\00"
@str.2 = [25 x i8] c"cil bug is still present\00"
define i32 @main() {
%1 = tail call %struct.struct_one* @bad_function(i32 0, i32 0)
%2 = icmp eq %struct.struct_one* %1, inttoptr (i64 5 to %struct.struct_one*)
%3 = select i1 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0)
%4 = select i1 %2, i32 0, i32 2
%5 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 %4
}
long long fll5(long long j, int *b, long long i) { return j + b[i]; }


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

x86 assembly (clang, -O2):
<fll5>:
movslq (%rsi,%rdx,4),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @fll5(i64 %0, i32* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i64
store i64 %0, i64* %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i32*, i32** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @fll5(i64 %0, i32* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 %2
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = add nsw i64 %6, %0
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
char toupper(char);
int HpmGetUserInput(char *str) {
  char userInput[2];
  printf("%s", str);
  scanf("%s", userInput);
  if (toupper(userInput[0]) == 'Y') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<HpmGetUserInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    -0x12(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1050 <scanf@plt>
movsbl -0x12(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
cmp    $0x59,%eax
jne    117d <HpmGetUserInput+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1184 <HpmGetUserInput+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HpmGetUserInput>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsbl 0xe(%rsp),%edi
call   1030 <toupper@plt>
xor    %ecx,%ecx
cmp    $0x59,%al
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @HpmGetUserInput(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [2 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%10 = load i8, i8* %9
%11 = call signext i8 @toupper(i8 signext %10)
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 89
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 1, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @HpmGetUserInput(i8* %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = load i8, i8* %3
%7 = call signext i8 @toupper(i8 signext %6)
%8 = icmp eq i8 %7, 89
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int getYNanswer();
int /*<<< orphan*/ printf(char *);
int doYouWantToPlayAgain(void) {
  printf("Do you want to play again? ");
  return getYNanswer();
}


x86 assembly (clang, -O0):
<doYouWantToPlayAgain>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getYNanswer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doYouWantToPlayAgain>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getYNanswer@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Do you want to play again? \00"
define i32 @doYouWantToPlayAgain() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getYNanswer()
ret i32 %2
}

LLVM IR (-O2):
@.str = [28 x i8] c"Do you want to play again? \00"
define i32 @doYouWantToPlayAgain() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getYNanswer()
ret i32 %2
}
int init_recordsuite(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_recordsuite() {
ret i32 0
}
int NULL_PRINTF(const char *__restrict __format, ...) { return -1; }


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

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

LLVM IR (-O0):
define i32 @NULL_PRINTF(i8* noalias %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 -1
}

LLVM IR (-O2):
define i32 @NULL_PRINTF(i8* noalias nocapture readnone %0, ...) {
ret i32 -1
}
void _exit(int i) {
  extern void abort(void);
  abort();
}


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

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

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

LLVM IR (-O2):
define void @_exit(i32 %0) {
tail call void @abort()
unreachable
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  double x = atof(argv[1]);
  double fx = (x - 0.123) * (x - 0.123);
  sleep(5);
  printf("%g\n", fx);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe8a(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x5,%edi
call   1050 <sleep@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
addsd  0xebe(%rip),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xeac(%rip),%rdi
movsd  (%rsp),%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call double @atof(i8* %10)
store double %11, double* %6
%12 = load double, double* %6
%13 = fsub double %12, 1.230000e-01
%14 = load double, double* %6
%15 = fsub double %14, 1.230000e-01
%16 = fmul double %13, %15
store double %16, double* %7
%17 = call i32 @sleep(i32 5)
%18 = load double, double* %7
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call double @atof(i8* %4)
%6 = fadd double %5, -1.230000e-01
%7 = fmul double %6, %6
%8 = tail call i32 @sleep(i32 5)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}
extern int __get_rf_mode(void) { return 0; }


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

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

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

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

/* Variables and functions */
void CRYPTO_mem_leaks(BIO *b) { return; }


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

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

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

LLVM IR (-O2):
define void @CRYPTO_mem_leaks(i32* nocapture %0) {
ret void
}
void __getsec_wakeup(void) {
  __asm__ __volatile__(".byte 0x0f,0x37"
                       "\n"
                       :
                       : "a"(8));
}


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

x86 assembly (clang, -O2):
<__getsec_wakeup>:
mov    $0x8,%eax
getsec
ret

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

LLVM IR (-O2):
define void @__getsec_wakeup() {
tail call void asm sideeffect ".byte 0x0f,0x37\0A", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enable();
void phantom_enable() { enable(); }


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

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

LLVM IR (-O0):
define void @phantom_enable() {
%1 = call i32 (...) @enable()
ret void
}

LLVM IR (-O2):
define void @phantom_enable() {
%1 = tail call i32 (...) @enable()
ret void
}