xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkU() {
  int c = 0;
  while (c != 2) {
    blinkdot();
    c++;
  }
  blinkdash();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     115e <blinkU+0x2e>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <blinkU+0xf>
mov    $0x0,%al
call   1040 <blinkdash@plt>
movsd  0xe93(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkU>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
movsd  0xeb2(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkU() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 2
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = call i32 (...) @blinkdot()
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = call i32 (...) @blinkdash()
%11 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkU() {
%1 = tail call i32 (...) @blinkdot()
%2 = tail call i32 (...) @blinkdot()
%3 = tail call i32 (...) @blinkdash()
%4 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
void wtypePtr_delete(void **wtypePtr) { (void)wtypePtr; }


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

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

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

LLVM IR (-O2):
define void @wtypePtr_delete(i8** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ book_close();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ tt_free();
void uci_exit() {
  book_close();
  tt_free();
  exit(0);
}


x86 assembly (clang, -O0):
<uci_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <book_close@plt>
mov    $0x0,%al
call   1040 <tt_free@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<uci_exit>:
push   %rax
xor    %eax,%eax
call   1050 <book_close@plt>
xor    %eax,%eax
call   1040 <tt_free@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @uci_exit() {
%1 = call i32 (...) @book_close()
%2 = call i32 (...) @tt_free()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @uci_exit() {
%1 = tail call i32 (...) @book_close()
%2 = tail call i32 (...) @tt_free()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *readstat_realloc(void *ptr, size_t len) {
  if (len > 0xFFF000 || len == 0) {
    if (ptr)
      free(ptr);
    return NULL;
  }
  return realloc(ptr, len);
}


x86 assembly (clang, -O0):
<readstat_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0xfff000,-0x18(%rbp)
ja     1149 <readstat_realloc+0x29>
cmpq   $0x0,-0x18(%rbp)
jne    116a <readstat_realloc+0x4a>
cmpq   $0x0,-0x10(%rbp)
je     115d <readstat_realloc+0x3d>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    117b <readstat_realloc+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readstat_realloc>:
lea    -0xfff001(%rsi),%rax
cmp    $0xffffffffff000fff,%rax
ja     1141 <readstat_realloc+0x21>
test   %rdi,%rdi
je     113e <readstat_realloc+0x1e>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret
jmp    1040 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @readstat_realloc(i8* %0, i64 %1) {
%3 = add i64 %1, -16773121
%4 = icmp ult i64 %3, -16773120
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = icmp eq i8* %0, null
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = tail call i32 @free(i8* %0)
br label %11
9: ; preds = %2
%10 = tail call i8* @realloc(i8* %0, i64 %1)
br label %11
11: ; preds = %5, %7, %9
%12 = phi i8* [ %10, %9 ], [ null, %7 ], [ null, %5 ]
ret i8* %12
}
int squashfs_xattr_lookup(struct super_block *sb, unsigned int index,
                          int *count, unsigned int *size,
                          unsigned long long *xattr) {
  return 0;
}


x86 assembly (clang, -O0):
<squashfs_xattr_lookup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @squashfs_xattr_lookup(%struct.super_block* nocapture readnone %0, i32 %1, i32* nocapture readnone %2, i32* nocapture readnone %3, i64* nocapture readnone %4) {
ret i32 0
}
/* Type definitions */
typedef int u_int16_t;

/* Variables and functions */
u_int16_t u16REV(u_int16_t x) { return (x << 8) | (x >> 8); }


x86 assembly (clang, -O0):
<u16REV>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @u16REV(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @u16REV(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t st103_get_tx_count(uint8_t ep_num) {
  uint16_t *reg_p = (uint16_t *)((0x40006000UL) + (ep_num * 8 + 2) * 2);
  return *reg_p & 0x03ff;
}


x86 assembly (clang, -O0):
<st103_get_tx_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0x2,%eax
shl    $0x1,%eax
cltq
add    $0x40006000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x3ff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st103_get_tx_count>:
shl    $0x4,%edi
movslq %edi,%rcx
mov    $0x3ff,%eax
and    0x40006004(%rcx),%eax
ret

LLVM IR (-O0):
define i32 @st103_get_tx_count(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 8
%6 = add nsw i32 %5, 2
%7 = mul nsw i32 %6, 2
%8 = sext i32 %7 to i64
%9 = add i64 1073766400, %8
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %3
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = and i32 %12, 1023
ret i32 %13
}

LLVM IR (-O2):
define i32 @st103_get_tx_count(i32 %0) {
%2 = shl i32 %0, 4
%3 = or i32 %2, 4
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, 1073766400
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* %6
%8 = and i32 %7, 1023
ret i32 %8
}
void mj_delete(int *pais, int len, int id) {
  int i;
  if (!pais || len <= 2)
    return;
  for (i = 0; i < len; ++i) {
    if ((*pais) == id) {
      (*pais) = 0;
      return;
    }
    pais++;
  }
}


x86 assembly (clang, -O0):
<mj_delete>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <mj_delete+0x23>
cmpl   $0x2,-0xc(%rbp)
jg     1128 <mj_delete+0x28>
jmp    1173 <mj_delete+0x73>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1173 <mj_delete+0x73>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0x10(%rbp),%eax
jne    1159 <mj_delete+0x59>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    1173 <mj_delete+0x73>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <mj_delete+0x2f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mj_delete>:
test   %rdi,%rdi
je     111d <mj_delete+0x1d>
cmp    $0x3,%esi
jl     111d <mj_delete+0x1d>
mov    %esi,%eax
xor    %ecx,%ecx
xchg   %ax,%ax
cmp    %edx,(%rdi,%rcx,4)
je     111e <mj_delete+0x1e>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <mj_delete+0x10>
ret
movl   $0x0,(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define void @mj_delete(i32* %0, i32 %1, i32 %2) {
%4 = icmp ne i32* %0, null
%5 = icmp sgt i32 %1, 2
%6 = and i1 %4, %5
br i1 %6, label %7, label %17
7: ; preds = %3, %13
%8 = phi i32 [ %15, %13 ], [ 0, %3 ]
%9 = phi i32* [ %14, %13 ], [ %0, %3 ]
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %12, label %13
12: ; preds = %7
store i32 0, i32* %9
br label %17
13: ; preds = %7
%14 = getelementptr inbounds i32, i32* %9, i64 1
%15 = add nuw nsw i32 %8, 1
%16 = icmp eq i32 %15, %1
br i1 %16, label %17, label %7
17: ; preds = %13, %3, %12
ret void
}
/* Variables and functions */
scalar_t__ strlen(char const *);
int is_blank_line(const char *s) {
  int i;
  for (i = 0; i < (int)strlen(s); i++) {
    if (s[i] != ' ')
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_blank_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1174 <is_blank_line+0x64>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     1161 <is_blank_line+0x51>
movl   $0x0,-0x4(%rbp)
jmp    117b <is_blank_line+0x6b>
jmp    1166 <is_blank_line+0x56>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <is_blank_line+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank_line>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %ecx,%ecx
jle    113f <is_blank_line+0x2f>
mov    %ecx,%ecx
xor    %edx,%edx
nopl   0x0(%rax)
cmpb   $0x20,(%rbx,%rdx,1)
jne    1141 <is_blank_line+0x31>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1130 <is_blank_line+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_blank_line(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = and i64 %2, 4294967295
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 32
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %7, label %15
15: ; preds = %9, %7, %1
%16 = phi i32 [ 1, %1 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %16
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int getWinner(int);
int play(int, int);
int /*<<< orphan*/ printBoard(int);
int /*<<< orphan*/ printWinner(int);
int32_t main() {
  int32_t tab = 0;
  int32_t player = 1;
  while (getWinner(tab) == -1) {
    printBoard(tab);
    tab = play(player, tab);
    player = 3 - player;
  }
  printWinner(3 - player);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <getWinner@plt>
cmp    $0xffffffff,%eax
jne    1194 <main+0x54>
mov    -0x8(%rbp),%edi
call   1030 <printBoard@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <play@plt>
mov    %eax,-0x8(%rbp)
mov    $0x3,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    115d <main+0x1d>
mov    $0x3,%edi
sub    -0xc(%rbp),%edi
call   1040 <printWinner@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1060 <getWinner@plt>
mov    $0x2,%r14d
cmp    $0xffffffff,%eax
jne    1189 <main+0x49>
mov    $0x1,%ebp
nopl   (%rax)
mov    %ebp,%r14d
mov    %ebx,%edi
call   1030 <printBoard@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <play@plt>
mov    %eax,%ebx
mov    $0x3,%ebp
sub    %r14d,%ebp
mov    %eax,%edi
call   1060 <getWinner@plt>
cmp    $0xffffffff,%eax
je     1160 <main+0x20>
mov    %r14d,%edi
call   1040 <printWinner@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = call i32 @getWinner(i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @printBoard(i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = call i32 @play(i32 %11, i32 %12)
store i32 %13, i32* %2
%14 = load i32, i32* %3
%15 = sub nsw i32 3, %14
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
%18 = sub nsw i32 3, %17
%19 = call i32 @printWinner(i32 %18)
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @getWinner(i32 0)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %11
3: ; preds = %0, %3
%4 = phi i32 [ %8, %3 ], [ 1, %0 ]
%5 = phi i32 [ %7, %3 ], [ 0, %0 ]
%6 = tail call i32 @printBoard(i32 %5)
%7 = tail call i32 @play(i32 %4, i32 %5)
%8 = sub nsw i32 3, %4
%9 = tail call i32 @getWinner(i32 %7)
%10 = icmp eq i32 %9, -1
br i1 %10, label %3, label %11
11: ; preds = %3, %0
%12 = phi i32 [ 2, %0 ], [ %4, %3 ]
%13 = tail call i32 @printWinner(i32 %12)
ret i32 0
}
void uncompute_index(int index, int *real_index, int *channel, int *sign) {
  *real_index = index % (64 * 64);
  *channel = (index / (64 * 64)) % 3;
  *sign = (index / (3 * 64 * 64)) ? 1 : -1;
}


x86 assembly (clang, -O0):
<uncompute_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1000,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x1000,%ecx
cltd
idiv   %ecx
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x3000,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    $0xffffffff,%ecx
mov    $0x1,%eax
cmp    $0x0,%edx
cmovne %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncompute_index>:
lea    0xfff(%rdi),%r9d
test   %edi,%edi
cmovns %edi,%r9d
mov    %r9d,%r8d
and    $0xfffff000,%r8d
mov    %edi,%eax
sub    %r8d,%eax
mov    %eax,(%rsi)
sar    $0xc,%r9d
movslq %r9d,%r8
imul   $0x55555556,%r8,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
shr    $0x20,%rsi
add    %eax,%esi
lea    (%rsi,%rsi,2),%eax
sub    %eax,%r8d
mov    %r8d,(%rdx)
add    $0x2fff,%edi
xor    %eax,%eax
cmp    $0x5fff,%edi
setae  %al
add    %eax,%eax
add    $0xffffffff,%eax
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @uncompute_index(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 = srem i32 %9, 4096
%11 = load i32*, i32** %6
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = sdiv i32 %12, 4096
%14 = srem i32 %13, 3
%15 = load i32*, i32** %7
store i32 %14, i32* %15
%16 = load i32, i32* %5
%17 = sdiv i32 %16, 12288
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 1, i32 -1
%21 = load i32*, i32** %8
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @uncompute_index(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = srem i32 %0, 4096
store i32 %5, i32* %1
%6 = sdiv i32 %0, 4096
%7 = srem i32 %6, 3
store i32 %7, i32* %2
%8 = add i32 %0, 12287
%9 = icmp ult i32 %8, 24575
%10 = select i1 %9, i32 -1, i32 1
store i32 %10, i32* %3
ret void
}
void start_vet(char vet[], int size) {
  int i;
  for (i = 0; i < (size - 1); ++i)
    vet[i] = ' ';
  vet[i] = '\0';
}


x86 assembly (clang, -O0):
<start_vet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    113d <start_vet+0x3d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <start_vet+0x12>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_vet>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmp    $0x2,%esi
jl     1133 <start_vet+0x23>
mov    %esi,%ebx
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
jmp    1135 <start_vet+0x25>
xor    %ebx,%ebx
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @start_vet(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 32, i8* %15
br label %16
16: ; preds = %11
%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** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 0, i8* %23
ret void
}

LLVM IR (-O2):
define void @start_vet(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = zext i32 %5 to i64
%7 = add nsw i32 %1, -1
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %4, %2
%10 = phi i64 [ 0, %2 ], [ %8, %4 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 0, i8* %11
ret void
}
void gdk_selection_owner_set_for_display() {}


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

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

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

LLVM IR (-O2):
define void @gdk_selection_owner_set_for_display() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void write_html_tail() { printf("</table>\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"</table>\0A\00"
define void @write_html_tail() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"</table>\00"
define void @write_html_tail() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int);
int huix_rand(int num) {
  static int i = 0;
  i += 30;
  srand(num + i);
  return rand();
}


x86 assembly (clang, -O0):
<huix_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f03(%rip),%eax
add    $0x1e,%eax
mov    %eax,0x2efa(%rip)
mov    -0x4(%rbp),%edi
add    0x2ef1(%rip),%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1040 <rand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<huix_rand>:
push   %rax
mov    0x2f0d(%rip),%eax
lea    0x1e(%rax),%ecx
mov    %ecx,0x2f04(%rip)
add    %eax,%edi
add    $0x1e,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <rand@plt>

LLVM IR (-O0):
@huix_rand.i = internal global i32 0
define i32 @huix_rand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @huix_rand.i
%4 = add nsw i32 %3, 30
store i32 %4, i32* @huix_rand.i
%5 = load i32, i32* %2
%6 = load i32, i32* @huix_rand.i
%7 = add nsw i32 %5, %6
%8 = call i32 @srand(i32 %7)
%9 = call i32 (...) @rand()
ret i32 %9
}

LLVM IR (-O2):
@huix_rand.i = internal unnamed_addr global i32 0
define i32 @huix_rand(i32 %0) {
%2 = load i32, i32* @huix_rand.i
%3 = add nsw i32 %2, 30
store i32 %3, i32* @huix_rand.i
%4 = add nsw i32 %3, %0
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 (...) @rand()
ret i32 %6
}
/* Variables and functions */
long DIV_ROUND_CLOSEST(long, int);
long millicelsius_to_milli_kelvin(long);
long millicelsius_to_kelvin(long t) {
  t = millicelsius_to_milli_kelvin(t);
  return DIV_ROUND_CLOSEST(t, 1000);
}


x86 assembly (clang, -O0):
<millicelsius_to_kelvin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <millicelsius_to_milli_kelvin@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <DIV_ROUND_CLOSEST@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millicelsius_to_kelvin>:
push   %rax
call   1030 <millicelsius_to_milli_kelvin@plt>
mov    %rax,%rdi
mov    $0x3e8,%esi
pop    %rax
jmp    1040 <DIV_ROUND_CLOSEST@plt>

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

LLVM IR (-O2):
define i64 @millicelsius_to_kelvin(i64 %0) {
%2 = tail call i64 @millicelsius_to_milli_kelvin(i64 %0)
%3 = tail call i64 @DIV_ROUND_CLOSEST(i64 %2, i32 1000)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ WARN_ON_ONCE(int);
void validate_pt_entry(unsigned long *entry) {
  WARN_ON_ONCE((*entry & 0x400) == 0x000);
  *entry &= ~0x400;
  *entry |= 0x000;
}


x86 assembly (clang, -O0):
<validate_pt_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x400,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <WARN_ON_ONCE@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffffbff,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x0,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_pt_entry>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
testl  $0x400,(%rbx)
sete   %dil
call   1030 <WARN_ON_ONCE@plt>
andb   $0xfb,0x1(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @validate_pt_entry(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 1024
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @WARN_ON_ONCE(i32 %7)
%9 = load i64*, i64** %2
%10 = load i64, i64* %9
%11 = and i64 %10, -1025
store i64 %11, i64* %9
%12 = load i64*, i64** %2
%13 = load i64, i64* %12
%14 = or i64 %13, 0
store i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @validate_pt_entry(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = lshr i32 %3, 10
%5 = and i32 %4, 1
%6 = xor i32 %5, 1
%7 = tail call i32 @WARN_ON_ONCE(i32 %6)
%8 = load i64, i64* %0
%9 = and i64 %8, -1025
store i64 %9, i64* %0
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ gen_char_to_nt();
int /*<<< orphan*/ gen_codon();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("/* this file was generated by gen_codon_tables.c */\n\n");
  gen_char_to_nt();
  gen_codon();
  printf("\n"
         "#define CODON_IS_STOP(c) (codon_is_stop[(c)])\n"
         "#define CODON_COMPLEMENT(c) ((uproc_codon)codon_complement[(c)])\n"
         "#define CODON_TO_CHAR(c) (codon_to_char[(c)])\n"
         "#define CHAR_TO_NT(c) (char_to_nt[(unsigned char) (c)])\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <gen_char_to_nt@plt>
mov    $0x0,%al
call   1050 <gen_codon@plt>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <gen_char_to_nt@plt>
xor    %eax,%eax
call   1050 <gen_codon@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"/* this file was generated by gen_codon_tables.c */\0A\0A\00"
@.str.1 = [215 x i8] c"\0A#define CODON_IS_STOP(c) (codon_is_stop[(c)])\0A#define CODON_COMPLEMENT(c) ((uproc_codon)codon_complement[(c)])\0A#define CODON_TO_CHAR(c) (codon_to_char[(c)])\0A#define CHAR_TO_NT(c) (char_to_nt[(unsigned char) (c)])\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @gen_char_to_nt()
%4 = call i32 (...) @gen_codon()
%5 = call i32 @printf(i8* getelementptr inbounds ([215 x i8], [215 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [53 x i8] c"/* this file was generated by gen_codon_tables.c */\0A\00"
@str.2 = [214 x i8] c"\0A#define CODON_IS_STOP(c) (codon_is_stop[(c)])\0A#define CODON_COMPLEMENT(c) ((uproc_codon)codon_complement[(c)])\0A#define CODON_TO_CHAR(c) (codon_to_char[(c)])\0A#define CHAR_TO_NT(c) (char_to_nt[(unsigned char) (c)])\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @gen_char_to_nt()
%3 = tail call i32 (...) @gen_codon()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([214 x i8], [214 x i8]* @str.2, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
void x1(void) {}


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

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

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

LLVM IR (-O2):
define void @x1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World!!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int gzip_init(struct connection *conn) {
  puts("Sorry, no GZIP support.");
  return 1;
}


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

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

LLVM IR (-O0):
%struct.connection = type { i32 }
@.str = [24 x i8] c"Sorry, no GZIP support.\00"
define i32 @gzip_init(%struct.connection* %0) {
%2 = alloca %struct.connection*
store %struct.connection* %0, %struct.connection** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.connection = type { i32 }
@.str = [24 x i8] c"Sorry, no GZIP support.\00"
define i32 @gzip_init(%struct.connection* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
int main() {
  int a = 100, b = 10;
  int *pointer1, *pointer2;
  pointer1 = &a;
  pointer2 = &b;
  printf("a=%d,b=%d\n", a, b);
  printf("*pointer1=%d,*pointer2=%d\n", *pointer1, *pointer2);
  printf("pointer1=%d,pointer2=%d\n", pointer1, pointer2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x64,0x4(%rsp)
movl   $0xa,(%rsp)
lea    0xed9(%rip),%rdi
mov    $0x64,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x64,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"a=%d,b=%d\0A\00"
@.str.1 = [27 x i8] c"*pointer1=%d,*pointer2=%d\0A\00"
@.str.2 = [25 x i8] c"pointer1=%d,pointer2=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
store i32 100, i32* %2
store i32 10, i32* %3
store i32* %2, i32** %4
store i32* %3, i32** %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %12)
%14 = load i32*, i32** %4
%15 = load i32*, i32** %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32* %14, i32* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"a=%d,b=%d\0A\00"
@.str.1 = [27 x i8] c"*pointer1=%d,*pointer2=%d\0A\00"
@.str.2 = [25 x i8] c"pointer1=%d,pointer2=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 100, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 100, i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 100, i32 10)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
ret i32 0
}
float read_buffer(float *buffer, unsigned long buflen, unsigned long pos,
                  unsigned long n) {
  if (n > (buflen - 1)) {
    n = buflen - 1;
  }
  while (n + pos >= buflen)
    n -= buflen;
  return buffer[n + pos];
}


x86 assembly (clang, -O0):
<read_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jbe    1135 <read_buffer+0x35>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113a <read_buffer+0x3a>
mov    -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1160 <read_buffer+0x60>
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    113a <read_buffer+0x3a>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
add    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_buffer>:
lea    -0x1(%rsi),%rax
cmp    %rcx,%rax
cmovb  %rax,%rcx
add    %rsi,%rdx
add    %rcx,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
sub    %rsi,%rdx
cmp    %rsi,%rdx
jae    1120 <read_buffer+0x20>
movss  (%rdi,%rdx,4),%xmm0
ret

LLVM IR (-O0):
define float @read_buffer(float* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca float*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store float* %0, float** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %6
%11 = sub i64 %10, 1
%12 = icmp ugt i64 %9, %11
br i1 %12, label %13, label %16
13: ; preds = %4
%14 = load i64, i64* %6
%15 = sub i64 %14, 1
store i64 %15, i64* %8
br label %16
16: ; preds = %13, %4
br label %17
17: ; preds = %23, %16
%18 = load i64, i64* %8
%19 = load i64, i64* %7
%20 = add i64 %18, %19
%21 = load i64, i64* %6
%22 = icmp uge i64 %20, %21
br i1 %22, label %23, label %27
23: ; preds = %17
%24 = load i64, i64* %6
%25 = load i64, i64* %8
%26 = sub i64 %25, %24
store i64 %26, i64* %8
br label %17
27: ; preds = %17
%28 = load float*, float** %5
%29 = load i64, i64* %8
%30 = load i64, i64* %7
%31 = add i64 %29, %30
%32 = getelementptr inbounds float, float* %28, i64 %31
%33 = load float, float* %32
ret float %33
}

LLVM IR (-O2):
define float @read_buffer(float* nocapture %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %1, -1
%6 = icmp ult i64 %5, %3
%7 = select i1 %6, i64 %5, i64 %3
br label %8
8: ; preds = %8, %4
%9 = phi i64 [ %7, %4 ], [ %12, %8 ]
%10 = add i64 %9, %2
%11 = icmp ult i64 %10, %1
%12 = sub i64 %9, %1
br i1 %11, label %13, label %8
13: ; preds = %8
%14 = getelementptr inbounds float, float* %0, i64 %10
%15 = load float, float* %14
ret float %15
}
int is_white_space(char c) { return (c == ' ' || c == '\n' || c == '\t'); }


x86 assembly (clang, -O0):
<is_white_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_white_space+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_white_space+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_white_space>:
mov    $0x1,%eax
cmp    $0xa,%dil
je     1111 <is_white_space+0x11>
cmp    $0x20,%dil
jne    1112 <is_white_space+0x12>
ret
xor    %eax,%eax
cmp    $0x9,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_white_space(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 9
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_white_space(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
void c_closedir_(DIR **dirp) { closedir(*dirp); }


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

x86 assembly (clang, -O2):
<c_closedir_>:
mov    (%rdi),%rdi
jmp    1030 <closedir@plt>

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

LLVM IR (-O2):
define void @c_closedir_(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = tail call i32 @closedir(i32* %2)
ret void
}
int print(int i) { return 2 * i; }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @print(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @print(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", add(2, 3));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 2, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int /*<<< orphan*/);
int creat(const char *file, mode_t mode) {
  return open(file, O_CREAT | O_WRONLY | O_TRUNC, mode);
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
mov    0x2e95(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    0x2ee1(%rip),%rcx
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(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* @O_CREAT
%7 = load i32, i32* @O_WRONLY
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @open(i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
/* Variables and functions */
int nl_cmp_addr(char *, char *, int /*<<< orphan*/ *);
int nl_cmp_lnet(char *, char *);
int nl_cmp(const void *p1, const void *p2) {
  int res;
  res = nl_cmp_lnet(*(char **)p1, *(char **)p2);
  if (res == 0)
    res = nl_cmp_addr(*(char **)p1, *(char **)p2, NULL);
  return res;
}


x86 assembly (clang, -O0):
<nl_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1040 <nl_cmp_lnet@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    116a <nl_cmp+0x4a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <nl_cmp_addr@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl_cmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1040 <nl_cmp_lnet@plt>
test   %eax,%eax
je     1141 <nl_cmp+0x21>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    (%rbx),%rdi
mov    (%r14),%rsi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <nl_cmp_addr@plt>

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

LLVM IR (-O2):
define i32 @nl_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @nl_cmp_lnet(i8* %4, i8* %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %5
%12 = tail call i32 @nl_cmp_addr(i8* %10, i8* %11, i32* null)
br label %13
13: ; preds = %9, %2
%14 = phi i32 [ %12, %9 ], [ %7, %2 ]
ret i32 %14
}
int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset,
                         int len) {
  return 0;
}


x86 assembly (clang, -O0):
<ubi_dbg_check_all_ff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ubi_device = type opaque
define i32 @ubi_dbg_check_all_ff(%struct.ubi_device* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.ubi_device*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.ubi_device* %0, %struct.ubi_device** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.ubi_device = type opaque
define i32 @ubi_dbg_check_all_ff(%struct.ubi_device* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ ibag_header(int /*<<< orphan*/ *);
int /*<<< orphan*/ safe_free(int /*<<< orphan*/);
void ibag_delete(int32_t *v) {
  if (v != NULL) {
    safe_free(ibag_header(v));
  }
}


x86 assembly (clang, -O0):
<ibag_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1147 <ibag_delete+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <ibag_header@plt>
mov    %eax,%edi
call   1040 <safe_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibag_delete>:
test   %rdi,%rdi
je     1133 <ibag_delete+0x13>
push   %rax
call   1030 <ibag_header@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <safe_free@plt>
ret

LLVM IR (-O0):
define void @ibag_delete(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @ibag_header(i32* %6)
%8 = call i32 @safe_free(i32 %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ibag_delete(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ibag_header(i32* %0)
%5 = tail call i32 @safe_free(i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
unsigned ls0(unsigned n) { return __builtin_ctz(~n); }


x86 assembly (clang, -O0):
<ls0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
bsf    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls0>:
not    %edi
bsf    %edi,%eax
ret

LLVM IR (-O0):
define i32 @ls0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = call i32 @llvm.cttz.i32(i32 %4, i1 true)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ls0(i32 %0) {
%2 = xor i32 %0, -1
%3 = tail call i32 @llvm.cttz.i32(i32 %2, i1 true)
ret i32 %3
}