xunge/DecIR huggingface dataset:
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  int prev;
  prev = EOF;
  while ((c = getchar()) != EOF) {
    if (prev != ' ') {
      putchar(c);
    }
    prev = c;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%eax
je     1171 <main+0x51>
cmpl   $0x20,-0xc(%rbp)
je     1166 <main+0x46>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113b <main+0x1b>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    (%r14),%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
je     114e <main+0x2e>
mov    %ebx,%ecx
mov    %eax,%ebx
cmp    $0x20,%ecx
je     1130 <main+0x10>
mov    %ebx,%edi
call   1030 <putchar@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %15, label %5
5: ; preds = %0, %11
%6 = phi i32 [ %12, %11 ], [ %2, %0 ]
%7 = phi i32 [ %6, %11 ], [ %1, %0 ]
%8 = icmp eq i32 %7, 32
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @putchar(i32 %6)
br label %11
11: ; preds = %9, %5
%12 = tail call i32 (...) @getchar()
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %5
15: ; preds = %11, %0
ret i32 0
}
void delay(void) {
  volatile int i = 0x1000000;
  while (--i)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1000000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1122 <delay+0x22>
jmp    110b <delay+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x1000000,-0x4(%rsp)
01
nopl   0x0(%rax,%rax,1)
addl   $0xffffffff,-0x4(%rsp)
jne    1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay() {
%1 = alloca i32
store volatile i32 16777216, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* %1
%4 = add nsw i32 %3, -1
store volatile i32 %4, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 16777216, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* %1
%5 = add nsw i32 %4, -1
store volatile i32 %5, i32* %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
void stop_ftrace_syscalls(void) {}


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

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

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

LLVM IR (-O2):
define void @stop_ftrace_syscalls() {
ret void
}
void foo788() {}


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

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

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

LLVM IR (-O2):
define void @foo788() {
ret void
}
int original_fibo(int n) {
  return n < 2 ? n : original_fibo(n - 2) + original_fibo(n - 1);
}


x86 assembly (clang, -O0):
<original_fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1130 <original_fibo+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <original_fibo+0x43>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <original_fibo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <original_fibo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<original_fibo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1147 <original_fibo+0x37>
add    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%edi
call   1030 <original_fibo@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     1130 <original_fibo+0x20>
mov    $0x1,%ebx
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @original_fibo(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -2
%7 = tail call i32 @original_fibo(i32 %6)
%8 = add nsw i32 %4, -1
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 3
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ 1, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1(int);
int main(void) {
  int i;
  int n = 256;
  check_vect();
  main1(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x100,-0xc(%rbp)
mov    $0x0,%al
call   1030 <check_vect@plt>
mov    -0xc(%rbp),%edi
call   1040 <main1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    $0x100,%edi
call   1040 <main1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 256, i32* %3
%4 = call i32 (...) @check_vect()
%5 = load i32, i32* %3
%6 = call i32 @main1(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 @main1(i32 256)
ret i32 0
}
int next_word(const char *s) {
  const char *base;
  while (*s == ' ')
    s++;
  base = s;
  while (*s && *s != ' ')
    s++;
  return (int)(s - base);
}


x86 assembly (clang, -O0):
<next_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1129 <next_word+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <next_word+0x8>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1156 <next_word+0x56>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1166 <next_word+0x66>
jmp    1177 <next_word+0x77>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1131 <next_word+0x31>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_word>:
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x20,%cl
je     1100 <next_word>
xor    %eax,%eax
test   $0xdf,%cl
je     112d <next_word+0x2d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rdi,%rax,1),%ecx
add    $0x1,%rax
test   $0xdf,%cl
jne    1120 <next_word+0x20>
ret

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

LLVM IR (-O2):
define i32 @next_word(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2, %10
%8 = phi i8 [ %12, %10 ], [ %4, %2 ]
%9 = phi i8* [ %11, %10 ], [ %3, %2 ]
switch i8 %8, label %10 [
i8 0, label %13
i8 32, label %13
]
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
br label %7
13: ; preds = %7, %7
%14 = ptrtoint i8* %9 to i64
%15 = ptrtoint i8* %3 to i64
%16 = sub i64 %14, %15
%17 = trunc i64 %16 to i32
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ key_swap(char *, int, int);
int rand();
void key_perturb(char *key, int n) {
  for (int i = 0; i < n; i++)
    key_swap(key, rand() % 26, rand() % 26);
}


x86 assembly (clang, -O0):
<key_perturb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1185 <key_perturb+0x65>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x1a,%ecx
cltd
idiv   %ecx
call   1030 <key_swap@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <key_perturb+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_perturb>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    118f <key_perturb+0x6f>
mov    %esi,%ebp
mov    %rdi,%r14
nopl   (%rax)
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rbx
imul   $0x4ec4ec4f,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rdx
imul   $0x4ec4ec4f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <key_swap@plt>
add    $0xffffffff,%ebp
jne    1130 <key_perturb+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @key_perturb(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = call i32 (...) @rand()
%13 = srem i32 %12, 26
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 26
%16 = call i32 @key_swap(i8* %11, i32 %13, i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @key_perturb(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %12, %5 ], [ 0, %2 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 26
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 26
%11 = tail call i32 @key_swap(i8* %0, i32 %8, i32 %10)
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %4, label %5
}
int rotateRight(int x, int n) {
  return (x >> n) ^ ((x ^ (x >> 31)) << (31 ^ n) << 1);
}


x86 assembly (clang, -O0):
<rotateRight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%edx
mov    -0x8(%rbp),%ecx
xor    $0x1f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
shl    $0x1,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateRight>:
mov    %esi,%ecx
mov    %edi,%eax
sar    $0x1f,%eax
xor    %edi,%eax
sar    %cl,%edi
xor    $0x1f,%cl
shl    %cl,%eax
add    %eax,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotateRight(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = ashr i32 %9, 31
%11 = xor i32 %8, %10
%12 = load i32, i32* %4
%13 = xor i32 31, %12
%14 = shl i32 %11, %13
%15 = shl i32 %14, 1
%16 = xor i32 %7, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @rotateRight(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = ashr i32 %0, 31
%5 = xor i32 %4, %0
%6 = xor i32 %1, 31
%7 = shl i32 %5, %6
%8 = shl i32 %7, 1
%9 = xor i32 %8, %3
ret i32 %9
}
/* Type definitions */
struct i8x_object {
  int dummy;
};
struct i8x_funcref {
  int dummy;
};
struct i8x_ctx {
  int dummy;
};

/* Variables and functions */
struct i8x_ctx *i8x_ob_get_ctx(struct i8x_object *);
struct i8x_ctx *__attribute__((always_))
i8x_funcref_get_ctx(struct i8x_funcref *x) {
  return i8x_ob_get_ctx((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_funcref_get_ctx>:
jmp    1030 <i8x_ob_get_ctx@plt>

LLVM IR (-O0):
%struct.i8x_ctx = type { i32 }
%struct.i8x_funcref = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_funcref_get_ctx(%struct.i8x_funcref* %0) {
%2 = alloca %struct.i8x_funcref*
store %struct.i8x_funcref* %0, %struct.i8x_funcref** %2
%3 = load %struct.i8x_funcref*, %struct.i8x_funcref** %2
%4 = bitcast %struct.i8x_funcref* %3 to %struct.i8x_object*
%5 = call %struct.i8x_ctx* @i8x_ob_get_ctx(%struct.i8x_object* %4)
ret %struct.i8x_ctx* %5
}

LLVM IR (-O2):
%struct.i8x_ctx = type { i32 }
%struct.i8x_funcref = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_funcref_get_ctx(%struct.i8x_funcref* %0) {
%2 = bitcast %struct.i8x_funcref* %0 to %struct.i8x_object*
%3 = tail call %struct.i8x_ctx* @i8x_ob_get_ctx(%struct.i8x_object* %2)
ret %struct.i8x_ctx* %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char packet[25];
  char *name = packet;
  char *version = &packet[8];
  strcpy(name, "programa");
  strcpy(version, "1.2.3");
  puts(name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x30(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0x8(%rsp),%r14
lea    0xecd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec4(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"programa\00"
@.str.1 = [6 x i8] c"1.2.3\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
store i8* %4, i8** %2
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 8
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8*, i8** %2
%11 = call i32 @puts(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"programa\00"
@.str.1 = [6 x i8] c"1.2.3\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 8
%4 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ expf(float);
int /*<<< orphan*/ link_failure_expf();
void test_expf(float f) {
  if (expf(f) != expf(f))
    link_failure_expf();
}


x86 assembly (clang, -O0):
<test_expf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_expf+0x3c>
mov    $0x0,%al
call   1040 <link_failure_expf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_expf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <expf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <expf@plt>
cmp    %rax,%rbx
jne    1149 <test_expf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_expf@plt>

LLVM IR (-O0):
define void @test_expf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @expf(float %3)
%5 = load float, float* %2
%6 = call i64 @expf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_expf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_expf(float %0) {
%2 = tail call i64 @expf(float %0)
%3 = tail call i64 @expf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_expf()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int __u64;

/* Variables and functions */
int _BITULL(int);
int gpiotools_test_bit(__u64 b, int n) { return !!(b & _BITULL(n)); }


x86 assembly (clang, -O0):
<gpiotools_test_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_BITULL@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpiotools_test_bit>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <_BITULL@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gpiotools_test_bit(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 = call i32 @_BITULL(i32 %6)
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @gpiotools_test_bit(i32 %0, i32 %1) {
%3 = tail call i32 @_BITULL(i32 %1)
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
const char *ssh_sigstr(int i) { return "UNKNOWN"; }


x86 assembly (clang, -O0):
<ssh_sigstr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssh_sigstr>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"UNKNOWN\00"
define i8* @ssh_sigstr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"UNKNOWN\00"
define i8* @ssh_sigstr(i32 %0) {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
float i2f(int i) { return *(float *)(&i); }


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

x86 assembly (clang, -O2):
<i2f>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
define float @i2f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to float*
%4 = load float, float* %3
ret float %4
}

LLVM IR (-O2):
define float @i2f(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
int fun822() { return 822; }


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

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

LLVM IR (-O0):
define i32 @fun822() {
ret i32 822
}

LLVM IR (-O2):
define i32 @fun822() {
ret i32 822
}
int md_seq_release(struct inode *inode, struct file *file) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @md_seq_release(%struct.inode* %0, %struct.file* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.file*
%5 = alloca i32
store %struct.inode* %0, %struct.inode** %3
store %struct.file* %1, %struct.file** %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @md_seq_release(%struct.inode* nocapture readnone %0, %struct.file* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printplayer(int player) {
  switch (player) {
  case 0:
    (void)printf("I ");
    break;
  case 1:
    (void)printf("You ");
    break;
  }
}


x86 assembly (clang, -O0):
<printplayer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     113f <printplayer+0x2f>
jmp    112e <printplayer+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1150 <printplayer+0x40>
jmp    115c <printplayer+0x4c>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    115c <printplayer+0x4c>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printplayer>:
test   %edi,%edi
je     1125 <printplayer+0x15>
cmp    $0x1,%edi
jne    1131 <printplayer+0x21>
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xed4(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"I \00"
@.str.1 = [5 x i8] c"You \00"
define void @printplayer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 0, label %4
i32 1, label %6
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %1, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"I \00"
@.str.1 = [5 x i8] c"You \00"
define void @printplayer(i32 %0) {
switch i32 %0, label %6 [
i32 0, label %3
i32 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
br label %6
6: ; preds = %3, %1
ret void
}
void testClosureFDrV(void (*closure)(float, double), float a1, double a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureFDrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFDrV>:
jmp    *%rdi

LLVM IR (-O0):
define void @testClosureFDrV(void (float, double)* %0, float %1, double %2) {
%4 = alloca void (float, double)*
%5 = alloca float
%6 = alloca double
store void (float, double)* %0, void (float, double)** %4
store float %1, float* %5
store double %2, double* %6
%7 = load void (float, double)*, void (float, double)** %4
%8 = load float, float* %5
%9 = load double, double* %6
ret void
}

LLVM IR (-O2):
define void @testClosureFDrV(void (float, double)* nocapture %0, float %1, double %2) {
tail call void %0(float %1, double %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void writeInt32(FILE *f, int d) {
  fputc(d & 255, f);
  fputc((d >> 8) & 255, f);
  fputc((d >> 16) & 255, f);
  fputc((d >> 24) & 255, f);
}


x86 assembly (clang, -O0):
<writeInt32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeInt32>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @writeInt32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = load i32*, i32** %3
%8 = call i32 @fputc(i32 %6, i32* %7)
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = call i32 @fputc(i32 %11, i32* %12)
%14 = load i32, i32* %4
%15 = ashr i32 %14, 16
%16 = and i32 %15, 255
%17 = load i32*, i32** %3
%18 = call i32 @fputc(i32 %16, i32* %17)
%19 = load i32, i32* %4
%20 = ashr i32 %19, 24
%21 = and i32 %20, 255
%22 = load i32*, i32** %3
%23 = call i32 @fputc(i32 %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @writeInt32(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @fputc(i32 %3, i32* %0)
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = tail call i32 @fputc(i32 %6, i32* %0)
%8 = lshr i32 %1, 16
%9 = and i32 %8, 255
%10 = tail call i32 @fputc(i32 %9, i32* %0)
%11 = lshr i32 %1, 24
%12 = tail call i32 @fputc(i32 %11, i32* %0)
ret void
}
/* Variables and functions */
char *skip_to_separator(char *, char *);
char *skip_to_null(char *chp) { return skip_to_separator(chp, ""); }


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

x86 assembly (clang, -O2):
<skip_to_null>:
lea    0xee9(%rip),%rsi
jmp    1030 <skip_to_separator@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @skip_to_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @skip_to_separator(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @skip_to_null(i8* %0) {
%2 = tail call i8* @skip_to_separator(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int pow(int, int);
int /*<<< orphan*/ printf(char *, int);
int numsize(int num) {
  int i;
  for (i = 1; i <= 100; ++i)
    printf("%d\n", pow(10, i));
  return 0;
}


x86 assembly (clang, -O0):
<numsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1165 <numsize+0x45>
mov    -0x8(%rbp),%esi
mov    $0xa,%edi
call   1040 <pow@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <numsize+0x12>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numsize>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
mov    $0xa,%edi
mov    %ebx,%esi
call   1040 <pow@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    1130 <numsize+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @numsize(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = tail call i32 @pow(i32 10, i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 101
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 0
}
int ld_ne_cr1(long double a1) { return (((100) != (a1))); }


x86 assembly (clang, -O0):
<ld_ne_cr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ne_cr1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ld_ne_cr1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp une x86_fp80 0xK4005C800000000000000, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_ne_cr1(x86_fp80 %0) {
%2 = fcmp une x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgtext(void) { gen(".text"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c".text\00"
define void @cgtext() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo142() {}


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

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

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

LLVM IR (-O2):
define void @foo142() {
ret void
}
unsigned long long dr_rdtsc() {
  unsigned long long u;
  asm volatile("rdtsc;shlq $32,%%rdx;orq %%rdx,%%rax" : "=a"(u)::"%rdx");
  return u;
}


x86 assembly (clang, -O0):
<dr_rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dr_rdtsc>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @dr_rdtsc() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @dr_rdtsc() {
%1 = tail call i64 asm sideeffect "rdtsc;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
int test_imm_56uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x56 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_56uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 86
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void writeback_long(void) {
  FILE *file;
  file = fopen("/proc/sys/vm/dirty_writeback_centisecs", "w");
  if (!file)
    return;
  fprintf(file, "1500");
  fclose(file);
}


x86 assembly (clang, -O0):
<writeback_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115f <writeback_long+0x2f>
jmp    1178 <writeback_long+0x48>
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeback_long>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     116e <writeback_long+0x3e>
mov    %rax,%rbx
lea    0xed6(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"/proc/sys/vm/dirty_writeback_centisecs\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [5 x i8] c"1500\00"
define void @writeback_long() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %6, label %5
5: ; preds = %0
br label %11
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %1
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"/proc/sys/vm/dirty_writeback_centisecs\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [5 x i8] c"1500\00"
define void @writeback_long() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 4, i64 1, i32* %1)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %0, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void a2close(int fd) {
  char closepkt;
  closepkt = 0xFF;
  write(fd, &closepkt, 1);
  shutdown(fd, SHUT_RDWR);
  close(fd);
}


x86 assembly (clang, -O0):
<a2close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0xff,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
call   1040 <shutdown@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a2close>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movb   $0xff,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <shutdown@plt>
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <close@plt>

LLVM IR (-O0):
@SHUT_RDWR = global i32 0
define void @a2close(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 -1, i8* %3
%4 = load i32, i32* %2
%5 = call i32 @write(i32 %4, i8* %3, i32 1)
%6 = load i32, i32* %2
%7 = load i32, i32* @SHUT_RDWR
%8 = call i32 @shutdown(i32 %6, i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @close(i32 %9)
ret void
}

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
define void @a2close(i32 %0) {
%2 = alloca i8
store i8 -1, i8* %2
%3 = call i32 @write(i32 %0, i8* %2, i32 1)
%4 = load i32, i32* @SHUT_RDWR
%5 = tail call i32 @shutdown(i32 %0, i32 %4)
%6 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AllocateImageRGB24(char const *, int, int, int,
                                      unsigned char *);
void rt_define_image(const char *name, int xs, int ys, int zs,
                     unsigned char *rgb) {
  AllocateImageRGB24(name, xs, ys, zs, rgb);
}


x86 assembly (clang, -O0):
<rt_define_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <AllocateImageRGB24@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_define_image>:
jmp    1030 <AllocateImageRGB24@plt>

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

LLVM IR (-O2):
define void @rt_define_image(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 @AllocateImageRGB24(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(int, char *, char *);
int shipxap(char **argv) {
  error(2, "xap not implemented yet", (char *)0);
  return (1);
}


x86 assembly (clang, -O0):
<shipxap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <error@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shipxap>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x2,%edi
xor    %edx,%edx
call   1030 <error@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"xap not implemented yet\00"
define i32 @shipxap(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @error(i32 2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* null)
ret i32 1
}

LLVM IR (-O2):
@.str = [24 x i8] c"xap not implemented yet\00"
define i32 @shipxap(i8** nocapture readnone %0) {
%2 = tail call i32 @error(i32 2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* null)
ret i32 1
}
void Clock_Init() {
  (*((volatile unsigned long *)0xE0100200)) = 0x0;
  (*((volatile unsigned long *)0xE0100000)) = 0x0000FFFF;
  (*((volatile unsigned long *)0xE0100008)) = 0x0000FFFF;
  (*((volatile unsigned long *)0xE0100300)) = 0x14131440;
  (*((volatile unsigned long *)0xE0100100)) =
      (1 << 31 | 0x7d << 16 | 0x3 << 8 | 0x1);
  (*((volatile unsigned long *)0xE0100108)) =
      (1 << 31 | 0x29b << 16 | 0xc << 8 | 0x1);
  (*((volatile unsigned long *)0xE0100200)) = 0x10001111;
}


x86 assembly (clang, -O0):
<Clock_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0100200,%eax
movq   $0x0,(%rax)
mov    $0xe0100000,%eax
movq   $0xffff,(%rax)
mov    $0xe0100008,%eax
movq   $0xffff,(%rax)
mov    $0xe0100300,%eax
movq   $0x14131440,(%rax)
mov    $0xe0100100,%eax
movq   $0xffffffff807d0301,(%rax)
mov    $0xe0100108,%eax
movq   $0xffffffff829b0c01,(%rax)
mov    $0xe0100200,%eax
movq   $0x10001111,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clock_Init>:
mov    $0xe0100200,%eax
movq   $0x0,(%rax)
movq   $0xffff,-0x200(%rax)
movq   $0xffff,-0x1f8(%rax)
movq   $0x14131440,0x100(%rax)
40 14 13 14
movq   $0xffffffff807d0301,-0x100(%rax)
01 03 7d 80
movq   $0xffffffff829b0c01,-0xf8(%rax)
01 0c 9b 82
movq   $0x10001111,(%rax)
ret

LLVM IR (-O0):
define void @Clock_Init() {
store volatile i64 0, i64* inttoptr (i64 3759145472 to i64*)
store volatile i64 65535, i64* inttoptr (i64 3759144960 to i64*)
store volatile i64 65535, i64* inttoptr (i64 3759144968 to i64*)
store volatile i64 336794688, i64* inttoptr (i64 3759145728 to i64*)
store volatile i64 -2139290879, i64* inttoptr (i64 3759145216 to i64*)
store volatile i64 -2103768063, i64* inttoptr (i64 3759145224 to i64*)
store volatile i64 268439825, i64* inttoptr (i64 3759145472 to i64*)
ret void
}

LLVM IR (-O2):
define void @Clock_Init() {
store volatile i64 0, i64* inttoptr (i64 3759145472 to i64*)
store volatile i64 65535, i64* inttoptr (i64 3759144960 to i64*)
store volatile i64 65535, i64* inttoptr (i64 3759144968 to i64*)
store volatile i64 336794688, i64* inttoptr (i64 3759145728 to i64*)
store volatile i64 -2139290879, i64* inttoptr (i64 3759145216 to i64*)
store volatile i64 -2103768063, i64* inttoptr (i64 3759145224 to i64*)
store volatile i64 268439825, i64* inttoptr (i64 3759145472 to i64*)
ret void
}
/* Variables and functions */
scalar_t__ log10(int);
int int_length(int i) { return 1 + (int)log10(i); }


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

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

LLVM IR (-O0):
define i32 @int_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @log10(i32 %3)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 1, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @int_length(i32 %0) {
%2 = tail call i64 @log10(i32 %0)
%3 = trunc i64 %2 to i32
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
void putchar(int c) {
  if (c == '\n') {
    putchar('\r');
  }
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    112f <putchar+0x1f>
mov    $0xd,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @putchar(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void *, int);
void brmove(void *dst, void *src, int n) {
  memmove((void *)((char *)dst - n), (void *)((char *)src - n), n);
}


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

x86 assembly (clang, -O2):
<brmove>:
movslq %edx,%rdx
sub    %rdx,%rdi
sub    %rdx,%rsi
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @brmove(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = sub i64 0, %9
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = sub i64 0, %14
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i32, i32* %6
%18 = call i32 @memmove(i8* %11, i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @brmove(i8* %0, i8* %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = sub nsw i64 0, %4
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %1, i64 %5
%8 = tail call i32 @memmove(i8* %6, i8* %7, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int CsharedFunction() {
  printf("TEST_C_FLAGS failed\n");
  return 0;
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"TEST_C_FLAGS failed\00"
define i32 @CsharedFunction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_keyboard_controller_status(int);
int /*<<< orphan*/ validate_world_window();
void resume_game(void) {
  validate_world_window();
  set_keyboard_controller_status(1);
  return;
}


x86 assembly (clang, -O0):
<resume_game>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <validate_world_window@plt>
mov    $0x1,%edi
call   1040 <set_keyboard_controller_status@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resume_game>:
push   %rax
xor    %eax,%eax
call   1030 <validate_world_window@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <set_keyboard_controller_status@plt>

LLVM IR (-O0):
define void @resume_game() {
%1 = call i32 (...) @validate_world_window()
%2 = call i32 @set_keyboard_controller_status(i32 1)
ret void
}

LLVM IR (-O2):
define void @resume_game() {
%1 = tail call i32 (...) @validate_world_window()
%2 = tail call i32 @set_keyboard_controller_status(i32 1)
ret void
}