xunge/DecIR huggingface dataset:
int test_imm_C3uint32_reg(unsigned int val) {
  return ((val) & (0xC3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C3uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xc3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_C3uint32_reg(i32 %0) {
%2 = and i32 %0, 195
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int fcntl(int, int, int const);
int fcntl_flag(int fd, int get_op, int set_op, int val) {
  const int flags = fcntl(fd, get_op, 0);
  if (flags < 0)
    return -1;
  return fcntl(fd, set_op, flags | val);
}


x86 assembly (clang, -O0):
<fcntl_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    114a <fcntl_flag+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <fcntl_flag+0x4e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%edx
or     -0x14(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcntl_flag>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebp
mov    %edx,%r14d
mov    %edi,%ebx
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     1138 <fcntl_flag+0x28>
or     %ebp,%eax
mov    %ebx,%edi
mov    %r14d,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fcntl_flag(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @fcntl(i32 %0, i32 %1, i32 0)
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = or i32 %5, %3
%9 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %8)
br label %10
10: ; preds = %4, %7
%11 = phi i32 [ %9, %7 ], [ -1, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ SetColorRamp(int /*<<< orphan*/ *);
void SetOldRamp() { SetColorRamp(NULL); }


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

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

LLVM IR (-O0):
define void @SetOldRamp() {
%1 = call i32 @SetColorRamp(i32* null)
ret void
}

LLVM IR (-O2):
define void @SetOldRamp() {
%1 = tail call i32 @SetColorRamp(i32* null)
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ read(int, char *, int);
int stream_FDStream_FDStream_native_read_char_1(void *s, int fd) {
  int result;
  char buf;
  ssize_t r = read(fd, &buf, 1);
  if (r == 0)
    result = -1;
  else
    result = buf;
  return result;
}


x86 assembly (clang, -O0):
<stream_FDStream_FDStream_native_read_char_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114b <stream_FDStream_FDStream_native_read_char_1+0x3b>
movl   $0xffffffff,-0x10(%rbp)
jmp    1152 <stream_FDStream_FDStream_native_read_char_1+0x42>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stream_FDStream_FDStream_native_read_char_1>:
push   %rax
mov    %esi,%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl 0x7(%rsp),%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @stream_FDStream_FDStream_native_read_char_1(i8* nocapture readnone %0, i32 %1) {
%3 = alloca i8
%4 = call i64 @read(i32 %1, i8* %3, i32 1)
%5 = icmp eq i64 %4, 0
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ getAlgorithmicTypeFromName(char *);
int main(void) {
  if (!getAlgorithmicTypeFromName("utf8"))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <getAlgorithmicTypeFromName@plt>
cmp    $0x0,%eax
jne    114b <main+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <getAlgorithmicTypeFromName@plt>
test   %eax,%eax
je     1135 <main+0x15>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"utf8\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @getAlgorithmicTypeFromName(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"utf8\00"
define i32 @main() {
%1 = tail call i32 @getAlgorithmicTypeFromName(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ S_IRWXU;
int mkdir(char *, int /*<<< orphan*/);
int make_dir_c(char *path) { return mkdir(path, S_IRWXU); }


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

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

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

LLVM IR (-O2):
@S_IRWXU = global i32 0
define i32 @make_dir_c(i8* nocapture %0) {
%2 = load i32, i32* @S_IRWXU
%3 = tail call i32 @mkdir(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int);
void detailPrint(int threadNum, int processNum, int arrivalTime,
                 int serviceTime, int ioTime, int turnaroundTime,
                 int finishTime) {
  printf(
      "Thread %d of Process %d:\n\narrival time: %d\nservice time: %d\nunits "
      "I/O time: %d\nunits turnaround time: %d\nunits finish time: %d\n",
      threadNum, processNum, arrivalTime, serviceTime, ioTime, turnaroundTime,
      finishTime);
}


x86 assembly (clang, -O0):
<detailPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%r10d
mov    0x10(%rbp),%eax
lea    0xeb2(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detailPrint>:
push   %rax
mov    %r9d,%eax
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x10(%rsp),%r10d
lea    0xed4(%rip),%rdi
push   %r10
push   %rax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [128 x i8] c"Thread %d of Process %d:\0A\0Aarrival time: %d\0Aservice time: %d\0Aunits I/O time: %d\0Aunits turnaround time: %d\0Aunits finish time: %d\0A\00"
define void @detailPrint(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = load i32, i32* %14
%22 = call i32 @printf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [128 x i8] c"Thread %d of Process %d:\0A\0Aarrival time: %d\0Aservice time: %d\0Aunits I/O time: %d\0Aunits turnaround time: %d\0Aunits finish time: %d\0A\00"
define void @detailPrint(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @printf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage(void) {
  fputs("bitgen [-h] [-b bits]\n"
        "where:\t-h\tis this help\n"
        "\t-b bits\tgenerates at least the specified bits (rounded up to 64).\n"
        "Normal case is to produce bits until EOF.\n",
        stderr);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [155 x i8] c"bitgen [-h] [-b bits]\0Awhere:\09-h\09is this help\0A\09-b bits\09generates at least the specified bits (rounded up to 64).\0ANormal case is to produce bits until EOF.\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [155 x i8] c"bitgen [-h] [-b bits]\0Awhere:\09-h\09is this help\0A\09-b bits\09generates at least the specified bits (rounded up to 64).\0ANormal case is to produce bits until EOF.\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int munmap(void *, int);
int file_release(void *addr, int size) { return munmap(addr, size); }


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

x86 assembly (clang, -O2):
<file_release>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define i32 @file_release(i8* %0, i32 %1) {
%3 = tail call i32 @munmap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int rand();
int random_int(int a, int b) {
  assert(a < b);
  int result = a + rand() % (b - a + 1);
  assert(result >= a);
  assert(result <= b);
  return result;
}


x86 assembly (clang, -O0):
<random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_int>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
xor    %edi,%edi
mov    %esi,%ebp
sub    %ebx,%ebp
setg   %dil
call   1030 <assert@plt>
xor    %eax,%eax
call   1040 <rand@plt>
add    $0x1,%ebp
cltd
idiv   %ebp
mov    %edx,%edi
add    %edx,%ebx
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmp    %r14d,%ebx
setle  %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %3
%12 = call i32 (...) @rand()
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
%16 = add nsw i32 %15, 1
%17 = srem i32 %12, %16
%18 = add nsw i32 %11, %17
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = load i32, i32* %3
%21 = icmp sge i32 %19, %20
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = icmp sle i32 %24, %25
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @random_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 (...) @rand()
%7 = sub i32 1, %0
%8 = add i32 %7, %1
%9 = srem i32 %6, %8
%10 = add nsw i32 %9, %0
%11 = xor i32 %9, -1
%12 = lshr i32 %11, 31
%13 = tail call i32 @assert(i32 %12)
%14 = icmp sle i32 %10, %1
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ MCUSendCmdGPSCtrl(int /*<<< orphan*/);
void MCUSendCmdGPSCtrlENABLE() { MCUSendCmdGPSCtrl(0); }


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

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

LLVM IR (-O0):
define void @MCUSendCmdGPSCtrlENABLE() {
%1 = call i32 @MCUSendCmdGPSCtrl(i32 0)
ret void
}

LLVM IR (-O2):
define void @MCUSendCmdGPSCtrlENABLE() {
%1 = tail call i32 @MCUSendCmdGPSCtrl(i32 0)
ret void
}
/* Type definitions */
struct RC {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rc_shift(struct RC *);
void rc_flush(struct RC *rc) {
  int i;
  for (i = 0; i < 5; i++)
    rc_shift(rc);
  return;
}


x86 assembly (clang, -O0):
<rc_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1144 <rc_flush+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <rc_shift@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <rc_flush+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_flush>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rc_shift@plt>
mov    %rbx,%rdi
call   1030 <rc_shift@plt>
mov    %rbx,%rdi
call   1030 <rc_shift@plt>
mov    %rbx,%rdi
call   1030 <rc_shift@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <rc_shift@plt>

LLVM IR (-O0):
%struct.RC = type { i32 }
define void @rc_flush(%struct.RC* %0) {
%2 = alloca %struct.RC*
%3 = alloca i32
store %struct.RC* %0, %struct.RC** %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load %struct.RC*, %struct.RC** %2
%9 = call i32 @rc_shift(%struct.RC* %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.RC = type { i32 }
define void @rc_flush(%struct.RC* %0) {
%2 = tail call i32 @rc_shift(%struct.RC* %0)
%3 = tail call i32 @rc_shift(%struct.RC* %0)
%4 = tail call i32 @rc_shift(%struct.RC* %0)
%5 = tail call i32 @rc_shift(%struct.RC* %0)
%6 = tail call i32 @rc_shift(%struct.RC* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int system(char *);
int main(int argc, char *argv[]) {
  printf("\n Status of <echo> command is %d \n", system("echo it worked !!!"));
  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    0xee6(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"\0A Status of <echo> command is %d \0A\00"
@.str.1 = [19 x i8] c"echo it worked !!!\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 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"\0A Status of <echo> command is %d \0A\00"
@.str.1 = [19 x i8] c"echo it worked !!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
double internal_pow(double a, double b) {
  int i;
  double acc = 1;
  for (i = 0; i < b; i++) {
    acc = acc * a;
  }
  return acc;
}


x86 assembly (clang, -O0):
<internal_pow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1153 <internal_pow+0x53>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1122 <internal_pow+0x22>
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_pow>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jbe    1139 <internal_pow+0x39>
movsd  0xeee(%rip),%xmm2
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
xorps  %xmm3,%xmm3
cvtsi2sd %eax,%xmm3
mulsd  %xmm0,%xmm2
add    $0x1,%eax
ucomisd %xmm3,%xmm1
ja     1120 <internal_pow+0x20>
movapd %xmm2,%xmm0
ret
movsd  0xebf(%rip),%xmm0
ret

LLVM IR (-O0):
define double @internal_pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 1.000000e+00, double* %6
store i32 0, i32* %5
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %5
%9 = sitofp i32 %8 to double
%10 = load double, double* %4
%11 = fcmp olt double %9, %10
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load double, double* %6
%14 = load double, double* %3
%15 = fmul double %13, %14
store double %15, double* %6
br label %16
16: ; preds = %12
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %7
19: ; preds = %7
%20 = load double, double* %6
ret double %20
}

LLVM IR (-O2):
define double @internal_pow(double %0, double %1) {
%3 = fcmp ogt double %1, 0.000000e+00
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi double [ %7, %4 ], [ 1.000000e+00, %2 ]
%6 = phi i32 [ %8, %4 ], [ 0, %2 ]
%7 = fmul double %5, %0
%8 = add nuw nsw i32 %6, 1
%9 = sitofp i32 %8 to double
%10 = fcmp olt double %9, %1
br i1 %10, label %4, label %11
11: ; preds = %4, %2
%12 = phi double [ 1.000000e+00, %2 ], [ %7, %4 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ deepInspect(int, int);
int primitiveObject_InspectToLevel_(int receiver, int *arguments) {
  deepInspect(receiver,
              ((arguments[0] & 0x80000000) ? (((-1 << 31) | arguments[0]) >> 1)
                                           : (arguments[0] >> 1)));
}


x86 assembly (clang, -O0):
<primitiveObject_InspectToLevel_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     114f <primitiveObject_InspectToLevel_+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
or     $0x80000000,%eax
sar    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115b <primitiveObject_InspectToLevel_+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <deepInspect@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitiveObject_InspectToLevel_>:
mov    (%rsi),%esi
sar    %esi
jmp    1030 <deepInspect@plt>

LLVM IR (-O0):
define i32 @primitiveObject_InspectToLevel_(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = load i32*, i32** %5
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = and i32 %9, -2147483648
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = or i32 -2147483648, %15
%17 = ashr i32 %16, 1
br label %23
18: ; preds = %2
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = ashr i32 %21, 1
br label %23
23: ; preds = %18, %12
%24 = phi i32 [ %17, %12 ], [ %22, %18 ]
%25 = call i32 @deepInspect(i32 %6, i32 %24)
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @primitiveObject_InspectToLevel_(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = ashr i32 %3, 1
%5 = tail call i32 @deepInspect(i32 %0, i32 %4)
ret i32 undef
}
int test_imm_2Dint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x2D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Dint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2949120
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gdk_gc_new_with_values() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gc_new_with_values() {
ret void
}
/* Variables and functions */
int rom_present(char *);
int sb_awe32_available() { return rom_present(L"roms/sound/awe32.raw"); }


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

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

LLVM IR (-O0):
@.str = [21 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 115, i32 111, i32 117, i32 110, i32 100, i32 47, i32 97, i32 119, i32 101, i32 51, i32 50, i32 46, i32 114, i32 97, i32 119, i32 0]
define i32 @sb_awe32_available() {
%1 = call i32 @rom_present(i8* bitcast ([21 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [21 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 115, i32 111, i32 117, i32 110, i32 100, i32 47, i32 97, i32 119, i32 101, i32 51, i32 50, i32 46, i32 114, i32 97, i32 119, i32 0]
define i32 @sb_awe32_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([21 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int addition_func(int, int, int, int, int /*<<< orphan*/);
int add_func(int src, int dest, int is_word) {
  return addition_func(src, dest, is_word, 1, 0);
}


x86 assembly (clang, -O0):
<add_func>:
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
mov    -0xc(%rbp),%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1030 <addition_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_func>:
mov    $0x1,%ecx
xor    %r8d,%r8d
jmp    1030 <addition_func@plt>

LLVM IR (-O0):
define i32 @add_func(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 = load i32, i32* %6
%10 = call i32 @addition_func(i32 %7, i32 %8, i32 %9, i32 1, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @add_func(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @addition_func(i32 %0, i32 %1, i32 %2, i32 1, i32 0)
ret i32 %4
}
int execute_capget() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_capget() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DecodeDEa_xxxxdddxssmmmrrr();
int /*<<< orphan*/ DoBinOpSub(int /*<<< orphan*/);
void DoCodeSubREa(void) { DoBinOpSub(DecodeDEa_xxxxdddxssmmmrrr()); }


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

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

LLVM IR (-O0):
define void @DoCodeSubREa() {
%1 = call i32 (...) @DecodeDEa_xxxxdddxssmmmrrr()
%2 = call i32 @DoBinOpSub(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeSubREa() {
%1 = tail call i32 (...) @DecodeDEa_xxxxdddxssmmmrrr()
%2 = tail call i32 @DoBinOpSub(i32 %1)
ret void
}
/* Variables and functions */
int libc_write(int, char *, size_t);
void writeCard(unsigned int c) {
  char ch;
  int i;
  if (c > 9) {
    writeCard(c / 10);
    writeCard(c % 10);
  } else {
    ch = ((char)(((unsigned int)('0')) + c));
    i = libc_write(1, &ch, (size_t)1);
  }
}


x86 assembly (clang, -O0):
<writeCard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jbe    1160 <writeCard+0x40>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1040 <writeCard@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%edi
call   1040 <writeCard@plt>
jmp    117f <writeCard+0x5f>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
mov    $0x1,%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <libc_write@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeCard>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
cmp    $0xa,%edi
jb     1154 <writeCard+0x34>
mov    %ebp,%eax
mov    $0xcccccccd,%ebx
imul   %rax,%rbx
shr    $0x23,%rbx
mov    %ebx,%edi
call   1040 <writeCard@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <writeCard@plt>
add    $0x30,%bpl
mov    %bpl,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
mov    $0x1,%edi
call   1030 <libc_write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @writeCard(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp ugt i32 %5, 9
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = udiv i32 %8, 10
%10 = load i32, i32* %2
%11 = urem i32 %10, 10
br label %17
12: ; preds = %1
%13 = load i32, i32* %2
%14 = add i32 48, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
%16 = call i32 @libc_write(i32 1, i8* %3, i64 1)
store i32 %16, i32* %4
br label %17
17: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
define void @writeCard(i32 %0) {
%2 = alloca i8
%3 = icmp ugt i32 %0, 9
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = udiv i32 %0, 10
tail call void @writeCard(i32 %5)
%6 = urem i32 %0, 10
tail call void @writeCard(i32 %6)
br label %11
7: ; preds = %1
%8 = trunc i32 %0 to i8
%9 = add nuw nsw i8 %8, 48
store i8 %9, i8* %2
%10 = call i32 @libc_write(i32 1, i8* %2, i64 1)
br label %11
11: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *);
void resize_callback(int width, int height) {
  printf("Configure Notify\n");
  glViewport(0, 0, width, height);
}


x86 assembly (clang, -O0):
<resize_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <glViewport@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize_callback>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <glViewport@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Configure Notify\0A\00"
define void @resize_callback(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @glViewport(i32 0, i32 0, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Configure Notify\00"
define void @resize_callback(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
ret void
}
void PGMPhysReadGCPtr(void) {}


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

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

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

LLVM IR (-O2):
define void @PGMPhysReadGCPtr() {
ret void
}
int run_privileged(const char *c, const char *p, int *ret) {
  (void)c;
  (void)p;
  (void)ret;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @run_privileged(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 i8*, i8** %5
%9 = load i32*, i32** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @run_privileged(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __merge(int *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ dump(int *, int);
void merge_verify() {
  int test[10] = {5, 8, 9, 23, 67, 1, 3, 7, 31, 56};
  __merge(test, 0, 4, 9);
  dump(test, 10);
}


x86 assembly (clang, -O0):
<merge_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x9,%ecx
call   1050 <__merge@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <dump@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_verify>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x9,%ecx
call   1040 <__merge@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <dump@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.merge_verify.test = [10 x i32] [i32 5, i32 8, i32 9, i32 23, i32 67, i32 1, i32 3, i32 7, i32 31, i32 56]
define void @merge_verify() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @__merge(i32* %3, i32 0, i32 4, i32 9)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @dump(i32* %5, i32 10)
ret void
}

LLVM IR (-O2):
@__const.merge_verify.test = [10 x i32] [i32 5, i32 8, i32 9, i32 23, i32 67, i32 1, i32 3, i32 7, i32 31, i32 56]
define void @merge_verify() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @__merge(i32* %3, i32 0, i32 4, i32 9)
%5 = call i32 @dump(i32* %3, i32 10)
ret void
}
void RTSemRWGetWriteRecursion(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemRWGetWriteRecursion() {
ret void
}
_Noreturn void f5(void) { return; }


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

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

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

LLVM IR (-O2):
define void @f5() {
ret void
}
/* Variables and functions */
size_t roundup_size(size_t len) {
  size_t size;
  for (size = 1; len >= size; size *= 2)
    ;
  return size;
}


x86 assembly (clang, -O0):
<roundup_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1134 <roundup_size+0x34>
jmp    1123 <roundup_size+0x23>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <roundup_size+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup_size>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jbe    1110 <roundup_size+0x10>
ret

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

LLVM IR (-O2):
define i64 @roundup_size(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ugt i64 %3, %0
%5 = shl i64 %3, 1
br i1 %4, label %6, label %2
6: ; preds = %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int timer_ad() {
  FILE *pFile;
  int a;
  pFile = fopen("temp_timer_ad.txt", "r");
  fscanf(pFile, "%x", &a);
  fclose(pFile);
  return (a - 0x40000000);
}


x86 assembly (clang, -O0):
<timer_ad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xc(%rbp),%eax
sub    $0x40000000,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_ad>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xecf(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xec2(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    $0xc0000000,%eax
add    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"temp_timer_ad.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%x\00"
define i32 @timer_ad() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%6 = load i32*, i32** %1
%7 = call i32 @fclose(i32* %6)
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1073741824
ret i32 %9
}

LLVM IR (-O2):
@.str = [18 x i8] c"temp_timer_ad.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%x\00"
define i32 @timer_ad() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = call i32 @fclose(i32* %3)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, -1073741824
ret i32 %7
}
void ntp_notify_cmos_timer(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ buf_strnappend(struct buf *, char const *,
                                  int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void buf_strappend(struct buf *ctx, const char *ch) {
  buf_strnappend(ctx, ch, strlen(ch));
}


x86 assembly (clang, -O0):
<buf_strappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <buf_strnappend@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_strappend>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <buf_strnappend@plt>

LLVM IR (-O0):
%struct.buf = type { i32 }
define void @buf_strappend(%struct.buf* %0, i8* %1) {
%3 = alloca %struct.buf*
%4 = alloca i8*
store %struct.buf* %0, %struct.buf** %3
store i8* %1, i8** %4
%5 = load %struct.buf*, %struct.buf** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @buf_strnappend(%struct.buf* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.buf = type { i32 }
define void @buf_strappend(%struct.buf* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @buf_strnappend(%struct.buf* %0, i8* %1, i32 %3)
ret void
}
int test_imm_6Euint16_mem(unsigned short *val) {
  return ((*val) & (-0x6E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Euint16_mem>:
movzwl (%rdi),%eax
test   $0xff92,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -110
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void *null(void) { return 0; }


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

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

LLVM IR (-O0):
define i8* @null() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @null() {
ret i8* null
}
int fun3(int n) {
  int s = 1;
  while (n) {
    s = s * (n % 10);
    n = n / 10;
  }
  return s;
}


x86 assembly (clang, -O0):
<fun3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1145 <fun3+0x45>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
imul   %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <fun3+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun3>:
mov    $0x1,%eax
test   %edi,%edi
je     113c <fun3+0x3c>
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
imul   %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <fun3+0x10>
ret

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

LLVM IR (-O2):
define i32 @fun3(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = mul nsw i32 %4, %6
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %12
}
int test_imm_5Euint16_mem(unsigned short *val) {
  return ((*val) & (0x5E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 94
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int eq_pointer(p1, p2) const void *p1;
const void *p2;
{ return p1 == p2; }


x86 assembly (clang, -O0):
<eq_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq_pointer>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @eq_pointer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @eq_pointer(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stub_print_ktables_stats(struct activity *, int, int,
                                            unsigned long long, int);
void print_avg_ktables_stats(struct activity *a, int prev, int curr,
                             unsigned long long itv) {
  stub_print_ktables_stats(a, prev, curr, itv, 1);
}


x86 assembly (clang, -O0):
<print_avg_ktables_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <stub_print_ktables_stats@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_avg_ktables_stats>:
mov    $0x1,%r8d
jmp    1030 <stub_print_ktables_stats@plt>

LLVM IR (-O0):
%struct.activity = type { i32 }
define void @print_avg_ktables_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca %struct.activity*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store %struct.activity* %0, %struct.activity** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load %struct.activity*, %struct.activity** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i64, i64* %8
%13 = call i32 @stub_print_ktables_stats(%struct.activity* %9, i32 %10, i32 %11, i64 %12, i32 1)
ret void
}

LLVM IR (-O2):
%struct.activity = type { i32 }
define void @print_avg_ktables_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i32 @stub_print_ktables_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3, i32 1)
ret void
}