xunge/DecIR huggingface dataset:
int to_upper(char *s) {
  int i = 0;
  while (*s != '\0') {
    if (*s > 'a' && *s < 'z') {
      *s -= 32;
      i++;
    }
    s++;
  }
  return i;
}


x86 assembly (clang, -O0):
<to_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <to_upper+0x65>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jle    1154 <to_upper+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jge    1154 <to_upper+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <to_upper+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_upper>:
mov    (%rdi),%cl
test   %cl,%cl
je     112f <to_upper+0x2f>
add    $0x1,%rdi
xor    %eax,%eax
jmp    111b <to_upper+0x1b>
xchg   %ax,%ax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     112e <to_upper+0x2e>
lea    -0x62(%rcx),%edx
cmp    $0x17,%dl
ja     1110 <to_upper+0x10>
add    $0xe0,%cl
mov    %cl,-0x1(%rdi)
add    $0x1,%eax
jmp    1110 <to_upper+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @to_upper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %16, %13 ], [ %2, %1 ]
%6 = phi i32 [ %14, %13 ], [ 0, %1 ]
%7 = phi i8* [ %15, %13 ], [ %0, %1 ]
%8 = add i8 %5, -98
%9 = icmp ult i8 %8, 24
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = add nsw i8 %5, -32
store i8 %11, i8* %7
%12 = add nsw i32 %6, 1
br label %13
13: ; preds = %10, %4
%14 = phi i32 [ %12, %10 ], [ %6, %4 ]
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %4
18: ; preds = %13, %1
%19 = phi i32 [ 0, %1 ], [ %14, %13 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(int error) {
  fputs("Usage: nodice [options]\n\n"
        "Options:\n"
        "  -c, --color\t\thighlight natural floors and ceilings\n"
        "  -h, --help\t\tprint this help and exit\n"
        "  -n, --number\t\tset number of dice to roll\n"
        "  -s, --sides\t\tset number of sides per die\n",
        (error ? stderr : stdout));
  exit(error);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <usage+0x26>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <usage+0x32>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1130 <usage+0x10>
mov    0x2eaa(%rip),%rax
jmp    1137 <usage+0x17>
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdi
call   1030 <fputs@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [213 x i8] c"Usage: nodice [options]\0A\0AOptions:\0A -c, --color\09\09highlight natural floors and ceilings\0A -h, --help\09\09print this help and exit\0A -n, --number\09\09set number of dice to roll\0A -s, --sides\09\09set number of sides per die\0A\00"
@stderr = global i32 0
@stdout = global i32 0
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @stderr
br label %9
7: ; preds = %1
%8 = load i32, i32* @stdout
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = call i32 @fputs(i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@.str = [213 x i8] c"Usage: nodice [options]\0A\0AOptions:\0A -c, --color\09\09highlight natural floors and ceilings\0A -h, --help\09\09print this help and exit\0A -n, --number\09\09set number of dice to roll\0A -s, --sides\09\09set number of sides per die\0A\00"
@stderr = global i32 0
@stdout = global i32 0
define void @usage(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stderr
%4 = load i32, i32* @stdout
%5 = select i1 %2, i32 %4, i32 %3
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void ntkresolv_exit(int i) { exit(i); }


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

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

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

LLVM IR (-O2):
define void @ntkresolv_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void system_clear() { system("clear"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @system_clear() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int init_sdl_audio(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @init_sdl_audio() {
ret i32 1
}

LLVM IR (-O2):
define i32 @init_sdl_audio() {
ret i32 1
}
/* Variables and functions */
int MS_INVALIDATE;
int MS_SYNC;
int msync(void *, size_t, int);
int vhost_user_sync_shm(void *ptr, size_t size) {
  return msync(ptr, size, MS_SYNC | MS_INVALIDATE);
}


x86 assembly (clang, -O0):
<vhost_user_sync_shm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    0x2eb0(%rip),%rax
or     (%rax),%edx
call   1030 <msync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vhost_user_sync_shm>:
mov    0x2ec1(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
jmp    1030 <msync@plt>

LLVM IR (-O0):
@MS_SYNC = global i32 0
@MS_INVALIDATE = global i32 0
define i32 @vhost_user_sync_shm(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @MS_SYNC
%8 = load i32, i32* @MS_INVALIDATE
%9 = or i32 %7, %8
%10 = call i32 @msync(i8* %5, i64 %6, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@MS_SYNC = global i32 0
@MS_INVALIDATE = global i32 0
define i32 @vhost_user_sync_shm(i8* %0, i64 %1) {
%3 = load i32, i32* @MS_SYNC
%4 = load i32, i32* @MS_INVALIDATE
%5 = or i32 %4, %3
%6 = tail call i32 @msync(i8* %0, i64 %1, i32 %5)
ret i32 %6
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int num_threads = 0;
  int thread_id = 0;
#pragma omp parallel private(num_threads, thread_id)
  {
    thread_id = omp_get_thread_num();
    printf("Hello World from Thread %d\n", thread_id);
#pragma omp master
    {
      num_threads = omp_get_num_threads();
      printf("Number of Threads = %d\n", num_threads);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Hello World from Thread %d\0A\00"
@.str.1 = [24 x i8] c"Number of Threads = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = call i32 (...) @omp_get_thread_num()
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @omp_get_num_threads()
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Hello World from Thread %d\0A\00"
@.str.1 = [24 x i8] c"Number of Threads = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @omp_get_num_threads()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
OP(fd, b2) {
  illegal_1();
  op_b2();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_b2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_b2@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_b2()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_b2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char const *, char const *, char *);
int main(int argc, char **argv) {
  const char *prog = "inf-exec2";
  execlp(prog, prog, (char *)0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execlp@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"inf-exec2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @execlp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* null)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int loff_t;

/* Variables and functions */
int /*<<< orphan*/ __libc_lseek(int, int /*<<< orphan*/, int);
loff_t __libc_lseek64(int fd, loff_t offset, int whence) {
  return (loff_t)(__libc_lseek(fd, (off_t)(offset & 0xffffffff), whence));
}


x86 assembly (clang, -O0):
<__libc_lseek64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
and    $0xffffffff,%esi
mov    -0xc(%rbp),%edx
call   1030 <__libc_lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_lseek64>:
jmp    1030 <__libc_lseek@plt>

LLVM IR (-O0):
define i32 @__libc_lseek64(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %8, -1
%10 = load i32, i32* %6
%11 = call i32 @__libc_lseek(i32 %7, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @__libc_lseek64(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__libc_lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
void foo091(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo091(i32 %0) {
ret void
}
float bary_blend(float v0, float v1, float v2, float w0, float w1, float w2) {
  float result;
  result = (v0 * w0) + (v1 * w1) + (v2 * w2);
  return result;
}


x86 assembly (clang, -O0):
<bary_blend>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0x8(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bary_blend>:
mulss  %xmm4,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm5,%xmm2
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @bary_blend(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%14 = load float, float* %7
%15 = load float, float* %10
%16 = load float, float* %8
%17 = load float, float* %11
%18 = fmul float %16, %17
%19 = call float @llvm.fmuladd.f32(float %14, float %15, float %18)
%20 = load float, float* %9
%21 = load float, float* %12
%22 = call float @llvm.fmuladd.f32(float %20, float %21, float %19)
store float %22, float* %13
%23 = load float, float* %13
ret float %23
}

LLVM IR (-O2):
define float @bary_blend(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fmul float %1, %4
%8 = tail call float @llvm.fmuladd.f32(float %0, float %3, float %7)
%9 = tail call float @llvm.fmuladd.f32(float %2, float %5, float %8)
ret float %9
}
/* Type definitions */
typedef int /*<<< orphan*/ useconds_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int /*<<< orphan*/);
void os_usleep(unsigned long int usec) { usleep((useconds_t)usec); }


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

x86 assembly (clang, -O2):
<os_usleep>:
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @os_usleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @os_usleep(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toupper(int /*<<< orphan*/);
char *str2upper(char *src, char *dest) {
  char *p = dest;
  while (*src) {
    *dest++ = toupper(*src++);
  }
  *dest = '\0';
  return p;
}


x86 assembly (clang, -O0):
<str2upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <str2upper+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1128 <str2upper+0x18>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2upper>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    (%rdi),%al
mov    %rsi,%rbx
test   %al,%al
je     114a <str2upper+0x3a>
mov    %rdi,%r15
add    $0x1,%r15
mov    %r14,%rbx
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
movzbl (%r15),%eax
add    $0x1,%r15
test   %al,%al
jne    1130 <str2upper+0x20>
movb   $0x0,(%rbx)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @str2upper(i8* nocapture %0, i8* returned writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i8* [ %13, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %6 to i32
%11 = tail call i32 @toupper(i32 %10)
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %12, i8* %8
%14 = load i8, i8* %9
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i8* [ %1, %2 ], [ %13, %5 ]
store i8 0, i8* %17
ret i8* %1
}
/* Variables and functions */
int sync_mem_dev(char *);
int smrlog_sync_master(char *basedir) { return sync_mem_dev(basedir); }


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

x86 assembly (clang, -O2):
<smrlog_sync_master>:
jmp    1030 <sync_mem_dev@plt>

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

LLVM IR (-O2):
define i32 @smrlog_sync_master(i8* %0) {
%2 = tail call i32 @sync_mem_dev(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "USAGE: %s %s\n", prog,
          "[-s nodeshape] [-i initialshape]\n"
          "\t[-a acceptingshape] [-o path] [-h|-v] FILE");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
lea    0xec7(%rip),%rcx
call   1030 <fprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xed3(%rip),%rcx
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"USAGE: %s %s\0A\00"
@.str.1 = [77 x i8] c"[-s nodeshape] [-i initialshape]\0A\09[-a acceptingshape] [-o path] [-h|-v] FILE\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"USAGE: %s %s\0A\00"
@.str.1 = [77 x i8] c"[-s nodeshape] [-i initialshape]\0A\09[-a acceptingshape] [-o path] [-h|-v] FILE\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void ClassInitialize(void) {}


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

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

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

LLVM IR (-O2):
define void @ClassInitialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PPCMMU(int, void *, void *, int /*<<< orphan*/);
void MmuRevokeVsid(int vsid, int mask) {
  PPCMMU(0x10b, (void *)vsid, (void *)mask, 0);
}


x86 assembly (clang, -O0):
<MmuRevokeVsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rsi
movslq -0x8(%rbp),%rdx
mov    $0x10b,%edi
xor    %ecx,%ecx
call   1030 <PPCMMU@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MmuRevokeVsid>:
movslq %edi,%rax
movslq %esi,%rdx
mov    $0x10b,%edi
mov    %rax,%rsi
xor    %ecx,%ecx
jmp    1030 <PPCMMU@plt>

LLVM IR (-O0):
define void @MmuRevokeVsid(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 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @PPCMMU(i32 267, i8* %7, i8* %10, i32 0)
ret void
}

LLVM IR (-O2):
define void @MmuRevokeVsid(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
%5 = sext i32 %1 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @PPCMMU(i32 267, i8* %4, i8* %6, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ funct_one();
int /*<<< orphan*/ funct_two();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wrapper1();
int /*<<< orphan*/ wrapper2();
int main(int argc, char *argv[]) {
  printf("Unwrapped:  \n");
  funct_one();
  funct_two();
  printf("\nWrappers:\n");
  wrapper1();
  wrapper2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <funct_one@plt>
mov    $0x0,%al
call   1060 <funct_two@plt>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <wrapper1@plt>
mov    $0x0,%al
call   1050 <wrapper2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <funct_one@plt>
xor    %eax,%eax
call   1060 <funct_two@plt>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <wrapper1@plt>
xor    %eax,%eax
call   1050 <wrapper2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Unwrapped: \0A\00"
@.str.1 = [12 x i8] c"\0AWrappers:\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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @funct_one()
%8 = call i32 (...) @funct_two()
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @wrapper1()
%11 = call i32 (...) @wrapper2()
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Unwrapped: \00"
@str.2 = [11 x i8] c"\0AWrappers:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @funct_one()
%5 = tail call i32 (...) @funct_two()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
%7 = tail call i32 (...) @wrapper1()
%8 = tail call i32 (...) @wrapper2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void output_label(const char *label) {
  printf(".globl %s\n", label);
  printf("\tALGN\n");
  printf("%s:\n", label);
}


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

x86 assembly (clang, -O2):
<output_label>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c".globl %s\0A\00"
@.str.2 = [5 x i8] c"%s:\0A\00"
@str = [6 x i8] c"\09ALGN\00"
define void @output_label(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_gcd() {
  printf("NOT IMPLEMENTED:"
         "pa_gcd"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"NOT IMPLEMENTED:pa_gcd\0A\00"
define i32 @pa_gcd() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [23 x i8] c"NOT IMPLEMENTED:pa_gcd\00"
define i32 @pa_gcd() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void seq_open(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<seq_open>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_open>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.seq_open = [9 x i8] c"seq_open\00"
define void @seq_open() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.seq_open, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.seq_open = [9 x i8] c"seq_open\00"
define void @seq_open() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.seq_open, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void writel(uint32_t value, const void *address) {
  *((volatile uint32_t *)(address)) = value;
}


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @writel(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dprintf(int, char *);
int del_reqstates(int reqstates_printed) {
  int i;
  for (i = 0; i < reqstates_printed; i++) {
    dprintf(2, "\033[A");
    dprintf(2, "\033[2K");
  }
}


x86 assembly (clang, -O0):
<del_reqstates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115e <del_reqstates+0x4e>
mov    $0x2,%edi
lea    0xec6(%rip),%rsi
call   1030 <dprintf@plt>
mov    $0x2,%edi
lea    0xeb9(%rip),%rsi
call   1030 <dprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <del_reqstates+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_reqstates>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    114f <del_reqstates+0x3f>
mov    %edi,%ebx
lea    0xede(%rip),%r14
lea    0xedb(%rip),%r15
nopl   0x0(%rax)
mov    $0x2,%edi
mov    %r14,%rsi
call   1030 <dprintf@plt>
mov    $0x2,%edi
mov    %r15,%rsi
call   1030 <dprintf@plt>
add    $0xffffffff,%ebx
jne    1130 <del_reqstates+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[A\00"
@.str.1 = [5 x i8] c"\1B[2K\00"
define i32 @del_reqstates(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = tail call i32 @dprintf(i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @dprintf(i32 2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret i32 undef
}
float CG_OpFuncCompareSmallerOrEqual(const float a, const float b) {
  return (a <= b);
}


x86 assembly (clang, -O0):
<CG_OpFuncCompareSmallerOrEqual>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_OpFuncCompareSmallerOrEqual>:
cmpless %xmm1,%xmm0
movss  0xef3(%rip),%xmm1
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @CG_OpFuncCompareSmallerOrEqual(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ole float %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @CG_OpFuncCompareSmallerOrEqual(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = uitofp i1 %3 to float
ret float %4
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_snanmeanpn(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 0.0 / 0.0, 3.0, 0.0 / 0.0, 4.0,
               5.0, 6.0, 0.0 / 0.0, 7.0, 8.0,       0.0 / 0.0};
  int64_t N = 6;
  int64_t stride = 2;
  float v = stdlib_strided_snanmeanpn(N, x, stride);
  printf("mean: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
movl   $0x6,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1050 <stdlib_strided_snanmeanpn@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x6,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_snanmeanpn@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [12 x float] [float 1.000000e+00, float 2.000000e+00, float 0x7FF8000000000000, float 3.000000e+00, float 0x7FF8000000000000, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 0x7FF8000000000000, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [12 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [12 x float]* %1 to i8*
store i32 6, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [12 x float], [12 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_snanmeanpn(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [12 x float] [float 1.000000e+00, float 2.000000e+00, float 0x7FF8000000000000, float 3.000000e+00, float 0x7FF8000000000000, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 0x7FF8000000000000, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [12 x float]
%2 = bitcast [12 x float]* %1 to i8*
%3 = getelementptr inbounds [12 x float], [12 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_snanmeanpn(i32 6, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int y(int);
int x(int a, int b) { return y(a + b); }


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

x86 assembly (clang, -O2):
<x>:
add    %esi,%edi
jmp    1030 <y@plt>

LLVM IR (-O0):
define i32 @x(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = call i32 @y(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @x(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @y(i32 %3)
ret i32 %4
}
/* Type definitions */
struct user {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void user_delete(const struct user *u) { free((void *)u); }


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

x86 assembly (clang, -O2):
<user_delete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.user = type { i32 }
define void @user_delete(%struct.user* %0) {
%2 = alloca %struct.user*
store %struct.user* %0, %struct.user** %2
%3 = load %struct.user*, %struct.user** %2
%4 = bitcast %struct.user* %3 to i8*
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
%struct.user = type { i32 }
define void @user_delete(%struct.user* nocapture %0) {
%2 = bitcast %struct.user* %0 to i8*
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_msg(char *);
int /*<<< orphan*/ errno_msg(char *, int);
int setenv(char *, char *, int);
void set(char *name, char *val) {
  debug_msg("Setting Environment Variable");
  if (setenv(name, val, 1) == -1) {
    errno_msg("Setting Environment Variable", 1);
  }
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <debug_msg@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
cmp    $0xffffffff,%eax
jne    1178 <set+0x48>
lea    0xe92(%rip),%rdi
mov    $0x1,%esi
call   1050 <errno_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
call   1030 <debug_msg@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
cmp    $0xffffffff,%eax
je     1163 <set+0x33>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe96(%rip),%rdi
mov    $0x1,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <errno_msg@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Setting Environment Variable\00"
define void @set(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @debug_msg(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @setenv(i8* %6, i8* %7, i32 1)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @errno_msg(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1)
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Setting Environment Variable\00"
define void @set(i8* %0, i8* %1) {
%3 = tail call i32 @debug_msg(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @setenv(i8* %0, i8* %1, i32 1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @errno_msg(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1)
br label %8
8: ; preds = %6, %2
ret void
}
int test_imm_3Eint8_reg(signed char val) {
  return ((val) & (-0x3E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Eint8_reg>:
test   $0xc2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Eint8_reg(i8 signext %0) {
%2 = and i8 %0, -62
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sin(double);
int main() {
  printf("%f\n", sin(0.5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
call   1040 <sin@plt>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @sin(double 5.000000e-01)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x3FDEAEE8744B05F0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage:...\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"Usage:...\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AccelSensorHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void AccelSensorLogging() { UAVObjLogging(AccelSensorHandle()); }


x86 assembly (clang, -O0):
<AccelSensorLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <AccelSensorHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AccelSensorLogging>:
push   %rax
xor    %eax,%eax
call   1040 <AccelSensorHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @AccelSensorLogging() {
%1 = call i32 (...) @AccelSensorHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AccelSensorLogging() {
%1 = tail call i32 (...) @AccelSensorHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memcpy(void **, void const **, int);
void lt_const_free(const void *ptr) {
  void *tmp;
  memcpy(&tmp, &ptr, sizeof(tmp));
  free(tmp);
}


x86 assembly (clang, -O0):
<lt_const_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_const_free>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @lt_const_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i32 @memcpy(i8** %3, i8** %2, i32 8)
%5 = load i8*, i8** %3
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @lt_const_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = bitcast i8** %3 to i8*
%5 = call i32 @memcpy(i8** %3, i8** %2, i32 8)
%6 = load i8*, i8** %3
%7 = call i32 @free(i8* %6)
ret void
}
imm0adrx1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if (22 <= (((double *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0adrx1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x20(%rbp),%rcx
mov    $0xa98ac7,%eax
movsd  (%rax,%rcx,8),%xmm0
movsd  0xece(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1148 <imm0adrx1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <imm0adrx1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0adrx1>:
movslq %esi,%rax
movsd  0xa98ac7(,%rax,8),%xmm0
xor    %eax,%eax
ucomisd 0xeea(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @imm0adrx1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load i32, i32* %11
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %15
%17 = load double, double* %16
%18 = fcmp ole double 2.200000e+01, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @imm0adrx1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %7
%9 = load double, double* %8
%10 = fcmp oge double %9, 2.200000e+01
%11 = zext i1 %10 to i32
ret i32 %11
}