xunge/DecIR huggingface dataset:
int test_imm_7Eint16_mem(short *val) {
  return ((*val) & (-0x7E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Eint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -126
%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_7Eint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -126
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void vx_info_exit_sched(struct _vx_sched *sched) { return; }


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

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

LLVM IR (-O0):
%struct._vx_sched = type opaque
define void @vx_info_exit_sched(%struct._vx_sched* %0) {
%2 = alloca %struct._vx_sched*
store %struct._vx_sched* %0, %struct._vx_sched** %2
ret void
}

LLVM IR (-O2):
%struct._vx_sched = type opaque
define void @vx_info_exit_sched(%struct._vx_sched* nocapture %0) {
ret void
}
void gdk_window_remove_filter() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_remove_filter() {
ret void
}
void RTTestIFailedRcV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestIFailedRcV() {
ret void
}
void gdk_visual_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_visual_get_type() {
ret void
}
/* Variables and functions */
int get16(scalar_t__);
scalar_t__ get_fcb();
int get_fcb_handle(void) { return get16(0x18 + get_fcb()); }


x86 assembly (clang, -O0):
<get_fcb_handle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_fcb@plt>
mov    %rax,%rdi
add    $0x18,%rdi
call   1040 <get16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fcb_handle>:
push   %rax
xor    %eax,%eax
call   1030 <get_fcb@plt>
lea    0x18(%rax),%rdi
pop    %rax
jmp    1040 <get16@plt>

LLVM IR (-O0):
define i32 @get_fcb_handle() {
%1 = call i64 (...) @get_fcb()
%2 = add nsw i64 24, %1
%3 = call i32 @get16(i64 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_fcb_handle() {
%1 = tail call i64 (...) @get_fcb()
%2 = add nsw i64 %1, 24
%3 = tail call i32 @get16(i64 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_add();
int /*<<< orphan*/ test_init();
int main() {
  test_init();
  test_add();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_init@plt>
xor    %eax,%eax
call   1040 <test_add@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_init()
%3 = call i32 (...) @test_add()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_init()
%2 = tail call i32 (...) @test_add()
ret i32 0
}
int fib(int n) {
  if ((n == 1) || (n == 2)) {
    return 1;
  } else {
    return (fib(n - 1) + fib(n - 2));
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     112f <fib+0x1f>
cmpl   $0x2,-0x8(%rbp)
jne    113b <fib+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    115e <fib+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
cmp    $0x2,%ebp
jb     1144 <fib+0x34>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <fib@plt>
add    %eax,%ebx
add    $0xfffffffe,%ebp
cmp    $0x1,%ebp
ja     1130 <fib+0x20>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i32 @fib(i32 %5)
%9 = add nsw i32 %6, -2
%10 = add nsw i32 %8, %7
%11 = add i32 %6, -3
%12 = icmp ult i32 %11, 2
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i32 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 1, %1 ], [ %14, %13 ]
ret i32 %16
}
int test_imm_C3uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xC3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C3uint64_highword_reg>:
movabs $0xc300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C3uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 837518622720
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ grow(int);
void grow1(int frame) { grow(++frame); }


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

x86 assembly (clang, -O2):
<grow1>:
add    $0x1,%edi
jmp    1030 <grow@plt>

LLVM IR (-O0):
define void @grow1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = call i32 @grow(i32 %4)
ret void
}

LLVM IR (-O2):
define void @grow1(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @grow(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void print_code_header(FILE *fp) {
  fprintf(fp,
          "#include <stdio.h>\n"
          "#include <stdlib.h>\n\n"
          "#define MEMORY_SIZE %d\n\n"
          "int main(void)\n"
          "{\n"
          "  "
          "static char memory[MEMORY_SIZE] = {0};\n"
          "  "
          "char *ptr = memory;\n\n",
          65536);
}


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

x86 assembly (clang, -O2):
<print_code_header>:
lea    0xee9(%rip),%rsi
mov    $0x10000,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [146 x i8] c"#include <stdio.h>\0A#include <stdlib.h>\0A\0A#define MEMORY_SIZE %d\0A\0Aint main(void)\0A{\0A static char memory[MEMORY_SIZE] = {0};\0A char *ptr = memory;\0A\0A\00"
define void @print_code_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 65536)
ret void
}

LLVM IR (-O2):
@.str = [146 x i8] c"#include <stdio.h>\0A#include <stdlib.h>\0A\0A#define MEMORY_SIZE %d\0A\0Aint main(void)\0A{\0A static char memory[MEMORY_SIZE] = {0};\0A char *ptr = memory;\0A\0A\00"
define void @print_code_header(i32* nocapture %0) {
%2 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 65536)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bug(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  bug(5, 10);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0xa,%esi
call   1030 <bug@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0xa,%esi
call   1030 <bug@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bug(i32 5, i32 10)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bug(i32 5, i32 10)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ multitable_crc32c(int /*<<< orphan*/, unsigned char const *,
                                     unsigned int);
int /*<<< orphan*/ singletable_crc32c(int /*<<< orphan*/, unsigned char const *,
                                      unsigned int);
uint32_t calculate_crc32c(uint32_t crc32c, const unsigned char *buffer,
                          unsigned int length) {
  if (length < 4)
    return (singletable_crc32c(crc32c, buffer, length));
  else
    return (multitable_crc32c(crc32c, buffer, length));
}


x86 assembly (clang, -O0):
<calculate_crc32c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jae    1153 <calculate_crc32c+0x33>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <singletable_crc32c@plt>
mov    %eax,-0x4(%rbp)
jmp    1165 <calculate_crc32c+0x45>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <multitable_crc32c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_crc32c>:
cmp    $0x3,%edx
ja     112a <calculate_crc32c+0xa>
jmp    1030 <singletable_crc32c@plt>
jmp    1040 <multitable_crc32c@plt>

LLVM IR (-O0):
define i32 @calculate_crc32c(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ult i32 %8, 4
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 @singletable_crc32c(i32 %11, i8* %12, i32 %13)
store i32 %14, i32* %4
br label %20
15: ; preds = %3
%16 = load i32, i32* %5
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = call i32 @multitable_crc32c(i32 %16, i8* %17, i32 %18)
store i32 %19, i32* %4
br label %20
20: ; preds = %15, %10
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @calculate_crc32c(i32 %0, i8* %1, i32 %2) {
%4 = icmp ult i32 %2, 4
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @singletable_crc32c(i32 %0, i8* %1, i32 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @multitable_crc32c(i32 %0, i8* %1, i32 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Delay1Ms_Counting();
void Delay1Ms(void) { Delay1Ms_Counting(); }


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

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

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

LLVM IR (-O2):
define void @Delay1Ms() {
%1 = tail call i32 (...) @Delay1Ms_Counting()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: split [-n] [file [name]].\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: split [-n] [file [name]].\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: split [-n] [file [name]].\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void reach_error() {}


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

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

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

LLVM IR (-O2):
define void @reach_error() {
ret void
}
int main() {
  int **pp;
  **pp = 0;
  return **pp;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32**
store i32 0, i32* %1
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
store i32 0, i32* %4
%5 = load i32**, i32*** %2
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
int device_is_not_partition(struct device *dev) { return 1; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @device_is_not_partition(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 1
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @device_is_not_partition(%struct.device* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
unsigned int x86_family(unsigned int sig) {
  unsigned int x86;
  x86 = (sig >> 8) & 0xf;
  if (x86 == 0xf)
    x86 += (sig >> 20) & 0xff;
  return x86;
}


x86 assembly (clang, -O0):
<x86_family>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jne    112e <x86_family+0x2e>
mov    -0x4(%rbp),%eax
shr    $0x14,%eax
and    $0xff,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_family>:
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xf,%ecx
shr    $0x14,%edi
movzbl %dil,%eax
add    $0xf,%eax
cmp    $0xf,%ecx
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @x86_family(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 8
%6 = and i32 %5, 15
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 15
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i32, i32* %2
%11 = lshr i32 %10, 20
%12 = and i32 %11, 255
%13 = load i32, i32* %3
%14 = add i32 %13, %12
store i32 %14, i32* %3
br label %15
15: ; preds = %9, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @x86_family(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 15
%4 = icmp eq i32 %3, 15
%5 = lshr i32 %0, 20
%6 = and i32 %5, 255
%7 = add nuw nsw i32 %6, 15
%8 = select i1 %4, i32 %7, i32 %3
ret i32 %8
}
void t1(void) {
  char *g;
  g[100] = 'f';
  {
    g++;
    g[0] = '1';
    g[67] = g[70];
    g[98] = g[99];
    g[90] = g[3];
  }
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
movb   $0x66,0x64(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x31,(%rax)
mov    -0x8(%rbp),%rax
mov    0x46(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x43(%rax)
mov    -0x8(%rbp),%rax
mov    0x63(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x62(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x5a(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @t1() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = getelementptr inbounds i8, i8* %2, i64 100
store i8 102, i8* %3
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 49, i8* %7
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i64 70
%10 = load i8, i8* %9
%11 = load i8*, i8** %1
%12 = getelementptr inbounds i8, i8* %11, i64 67
store i8 %10, i8* %12
%13 = load i8*, i8** %1
%14 = getelementptr inbounds i8, i8* %13, i64 99
%15 = load i8, i8* %14
%16 = load i8*, i8** %1
%17 = getelementptr inbounds i8, i8* %16, i64 98
store i8 %15, i8* %17
%18 = load i8*, i8** %1
%19 = getelementptr inbounds i8, i8* %18, i64 3
%20 = load i8, i8* %19
%21 = load i8*, i8** %1
%22 = getelementptr inbounds i8, i8* %21, i64 90
store i8 %20, i8* %22
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *);
void mod_exit(void) { pr_info("Module exit\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Module exit\0A\00"
define void @mod_exit() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Module exit\0A\00"
define void @mod_exit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
long long shifts1(long long x, int i) { return ((x << i) + (x >> i)); }


x86 assembly (clang, -O0):
<shifts1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    %cl,%rax
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
sar    %cl,%rdx
mov    %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shifts1>:
mov    %esi,%ecx
mov    %rdi,%rax
shl    %cl,%rax
sar    %cl,%rdi
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @shifts1(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = shl i64 %5, %7
%9 = load i64, i64* %3
%10 = load i32, i32* %4
%11 = zext i32 %10 to i64
%12 = ashr i64 %9, %11
%13 = add nsw i64 %8, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @shifts1(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = shl i64 %0, %3
%5 = ashr i64 %0, %3
%6 = add nsw i64 %4, %5
ret i64 %6
}
/* Variables and functions */
int read_data_cmd();
int /*<<< orphan*/ send_ctrl_cmd(int);
unsigned int lcm_compare_id(void) {
  unsigned int id = 0;
  send_ctrl_cmd(0x1180);
  id = read_data_cmd();
  send_ctrl_cmd(0x1080);
  id |= (read_data_cmd() << 8);
  return ((0x5510) == id) ? 1 : 0;
}


x86 assembly (clang, -O0):
<lcm_compare_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1180,%edi
call   1040 <send_ctrl_cmd@plt>
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1080,%edi
call   1040 <send_ctrl_cmd@plt>
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
shl    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x5510,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_compare_id>:
push   %rbx
mov    $0x1180,%edi
call   1040 <send_ctrl_cmd@plt>
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
mov    %eax,%ebx
mov    $0x1080,%edi
call   1040 <send_ctrl_cmd@plt>
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
shl    $0x8,%eax
or     %ebx,%eax
xor    %ecx,%ecx
cmp    $0x5510,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm_compare_id() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @send_ctrl_cmd(i32 4480)
%3 = call i32 (...) @read_data_cmd()
store i32 %3, i32* %1
%4 = call i32 @send_ctrl_cmd(i32 4224)
%5 = call i32 (...) @read_data_cmd()
%6 = shl i32 %5, 8
%7 = load i32, i32* %1
%8 = or i32 %7, %6
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = icmp eq i32 21776, %9
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @lcm_compare_id() {
%1 = tail call i32 @send_ctrl_cmd(i32 4480)
%2 = tail call i32 (...) @read_data_cmd()
%3 = tail call i32 @send_ctrl_cmd(i32 4224)
%4 = tail call i32 (...) @read_data_cmd()
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = icmp eq i32 %6, 21776
%8 = zext i1 %7 to i32
ret i32 %8
}
void f18(a19_4, a19_5) const int a19_4;
struct file *a19_5;
{
}


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define void @f18(i32 %0, %struct.file* nocapture %1) {
ret void
}
short __ocl_convert_short_char(char src) { return (short)src; }


x86 assembly (clang, -O0):
<__ocl_convert_short_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @__ocl_convert_short_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @__ocl_convert_short_char(i8 signext %0) {
%2 = sext i8 %0 to i16
ret i16 %2
}
void foo106() {}


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

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

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

LLVM IR (-O2):
define void @foo106() {
ret void
}
/* Variables and functions */
scalar_t__ nrfx_usbd_errata_type_52840();
bool nrfx_usbd_errata_171(void) { return (1 && nrfx_usbd_errata_type_52840()); }


x86 assembly (clang, -O0):
<nrfx_usbd_errata_171>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nrfx_usbd_errata_type_52840@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nrfx_usbd_errata_171() {
%1 = call i64 (...) @nrfx_usbd_errata_type_52840()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @nrfx_usbd_errata_171() {
%1 = tail call i64 (...) @nrfx_usbd_errata_type_52840()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int strlen(char *);
int /*<<< orphan*/ uCharToHex(unsigned char *, unsigned char *, int);
int get_rtx_data(int num, unsigned char *hex_len) {
  unsigned char char_len[4] = {'\0'};
  sprintf((char *)char_len, "%08x", num);
  uCharToHex(char_len, hex_len, 8);
  return (strlen((char *)(hex_len)));
}


x86 assembly (clang, -O0):
<get_rtx_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x14(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe93(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1050 <uCharToHex@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rtx_data>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%edx
movl   $0x0,0x4(%rsp)
lea    0xeb8(%rip),%rsi
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1040 <uCharToHex@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%08x\00"
define i32 @get_rtx_data(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = bitcast [4 x i8]* %5 to i8*
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @uCharToHex(i8* %10, i8* %11, i32 8)
%13 = load i8*, i8** %4
%14 = call i32 @strlen(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"%08x\00"
define i32 @get_rtx_data(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = call i32 @uCharToHex(i8* %4, i8* %1, i32 8)
%7 = call i32 @strlen(i8* %1)
ret i32 %7
}
/* Variables and functions */
int O_RSYNC;
int unix_fcntl_o_rsync() { return O_RSYNC; }


x86 assembly (clang, -O0):
<unix_fcntl_o_rsync>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eed(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unix_fcntl_o_rsync>:
mov    0x2ef1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@O_RSYNC = global i32 0
define i32 @unix_fcntl_o_rsync() {
%1 = load i32, i32* @O_RSYNC
ret i32 %1
}

LLVM IR (-O2):
@O_RSYNC = global i32 0
define i32 @unix_fcntl_o_rsync() {
%1 = load i32, i32* @O_RSYNC
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sendToWebserver();
int main() { sendToWebserver(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sendToWebserver@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @sendToWebserver()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sendToWebserver()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[], char *envp[]) {
  int cnt = 0;
  printf("%d. Lorde\n", ++cnt);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"%d. Lorde\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
scalar_t__ FlipEndian(void *, int);
unsigned short FLIP_USHORT(unsigned short pVar) {
  return *(unsigned short *)FlipEndian((void *)&pVar, sizeof(unsigned short));
}


x86 assembly (clang, -O0):
<FLIP_USHORT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <FlipEndian@plt>
movzwl (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLIP_USHORT>:
push   %rax
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <FlipEndian@plt>
movzwl (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @FLIP_USHORT(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = bitcast i16* %2 to i8*
%4 = call i64 @FlipEndian(i8* %3, i32 2)
%5 = inttoptr i64 %4 to i16*
%6 = load i16, i16* %5
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @FLIP_USHORT(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = bitcast i16* %2 to i8*
%4 = call i64 @FlipEndian(i8* %3, i32 2)
%5 = inttoptr i64 %4 to i16*
%6 = load i16, i16* %5
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void err_quit(const char *x) {
  fflush(stderr);
  fputs(x, stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<err_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<err_quit>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea2(%rip),%r14
mov    (%r14),%edi
call   1040 <fflush@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @err_quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
%5 = load i8*, i8** %2
%6 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* %5, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @err_quit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* %0, i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long long int read_tsc(void) {
  unsigned long long int retval;
  __asm __volatile("rdtsc" : "=A"(retval)::"memory");
  return retval;
}


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

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

LLVM IR (-O0):
define i64 @read_tsc() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc", "=A,~{memory},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @read_tsc() {
%1 = tail call i64 asm sideeffect "rdtsc", "=A,~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
void copy_file(FILE *fout, char *tar) {
  int ch;
  rewind(fout);
  while ((ch = fgetc(fout)) != EOF) {
    fputc(ch, stdout);
  }
}


x86 assembly (clang, -O0):
<copy_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%eax
je     117a <copy_file+0x4a>
mov    -0x14(%rbp),%edi
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
call   1050 <fputc@plt>
jmp    1149 <copy_file+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_file>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <rewind@plt>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
mov    0x2e9c(%rip),%r14
cmp    (%r14),%eax
je     1177 <copy_file+0x47>
mov    0x2e80(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r15),%esi
mov    %eax,%edi
call   1050 <fputc@plt>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    (%r14),%eax
jne    1160 <copy_file+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
@stdout = global i32 0
define void @copy_file(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = call i32 @rewind(i32* %6)
br label %8
8: ; preds = %13, %2
%9 = load i32*, i32** %3
%10 = call i32 @fgetc(i32* %9)
store i32 %10, i32* %5
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i32, i32* %5
%15 = load i32, i32* @stdout
%16 = call i32 @fputc(i32 %14, i32 %15)
br label %8
17: ; preds = %8
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@stdout = global i32 0
define void @copy_file(i32* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @rewind(i32* %0)
%4 = tail call i32 @fgetc(i32* %0)
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %14, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %11, %7 ], [ %4, %2 ]
%9 = load i32, i32* @stdout
%10 = tail call i32 @fputc(i32 %8, i32 %9)
%11 = tail call i32 @fgetc(i32* %0)
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
void wr_scrn_center(int16_t r, const char *fmt, ...) { return; }


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

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

LLVM IR (-O0):
define void @wr_scrn_center(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @wr_scrn_center(i32 %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World from C\n");
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Hello World from C\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int b_twist_f2_on_edgeperm(eperm)
int eperm;
{
  int temp_arr[8];
  b_edgeperm_unpack(eperm, temp_arr);
  two_cycle(temp_arr, 0, 4);
  return b_edgeperm_pack(temp_arr);
}


x86 assembly (clang, -O0):
<b_twist_f2_on_edgeperm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <b_edgeperm_unpack@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1050 <two_cycle@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1030 <b_edgeperm_pack@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_twist_f2_on_edgeperm>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <b_edgeperm_unpack@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1050 <two_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <b_edgeperm_pack@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @b_twist_f2_on_edgeperm(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_edgeperm_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @two_cycle to i32 (i32*, i32, i32, ...)*)(i32* %7, i32 0, i32 4)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @b_edgeperm_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @b_twist_f2_on_edgeperm(i32 %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_edgeperm_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @two_cycle to i32 (i32*, i32, i32, ...)*)(i32* %4, i32 0, i32 4)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @b_edgeperm_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
int frobulate(int a1) { return a1 * a1 / 1337; }


x86 assembly (clang, -O0):
<frobulate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    $0x539,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<frobulate>:
imul   %edi,%edi
mov    $0x88233b2b,%eax
imul   %rdi,%rax
shr    $0x20,%rax
sub    %eax,%edi
shr    %edi
add    %edi,%eax
shr    $0xa,%eax
ret

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

LLVM IR (-O2):
define i32 @frobulate(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = udiv i32 %2, 1337
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ property;
};
struct TYPE_4__ {
  TYPE_1__ xselection;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xselection_property(void *_p) {
  return (unsigned long)((XEvent *)_p)->xselection.property;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xselection_property(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xselection_property(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int strncmp(char *, char *, int);
int descending(const void *a1, const void *a2) {
  return strncmp((char *)a2, (char *)a1, 26);
}


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

x86 assembly (clang, -O2):
<descending>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x1a,%edx
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @descending(i8* %0, i8* %1) {
%3 = tail call i32 @strncmp(i8* %1, i8* %0, i32 26)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int prv_isWhiteSpace(uint8_t sign) {
  if (sign == 0x20 || sign == 0x09 || sign == 0x0A || sign == 0x0D) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<prv_isWhiteSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     112f <prv_isWhiteSpace+0x2f>
cmpl   $0x9,-0x8(%rbp)
je     112f <prv_isWhiteSpace+0x2f>
cmpl   $0xa,-0x8(%rbp)
je     112f <prv_isWhiteSpace+0x2f>
cmpl   $0xd,-0x8(%rbp)
jne    113b <prv_isWhiteSpace+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <prv_isWhiteSpace+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_isWhiteSpace>:
cmp    $0x20,%edi
ja     111d <prv_isWhiteSpace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111d <prv_isWhiteSpace+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @prv_isWhiteSpace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 13, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ atomic(int);
void atomic_up() { atomic(1); }


x86 assembly (clang, -O0):
<atomic_up>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <atomic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_up>:
mov    $0x1,%edi
jmp    1030 <atomic@plt>

LLVM IR (-O0):
define void @atomic_up() {
%1 = call i32 @atomic(i32 1)
ret void
}

LLVM IR (-O2):
define void @atomic_up() {
%1 = tail call i32 @atomic(i32 1)
ret void
}
void gtk_widget_get_default_visual() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_default_visual() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ChooseYourCat_chooseForPlayer(int);
void p2_confirm() { ChooseYourCat_chooseForPlayer(true); }


x86 assembly (clang, -O0):
<p2_confirm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <ChooseYourCat_chooseForPlayer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<p2_confirm>:
mov    $0x1,%edi
jmp    1030 <ChooseYourCat_chooseForPlayer@plt>

LLVM IR (-O0):
define void @p2_confirm() {
%1 = call i32 @ChooseYourCat_chooseForPlayer(i32 1)
ret void
}

LLVM IR (-O2):
define void @p2_confirm() {
%1 = tail call i32 @ChooseYourCat_chooseForPlayer(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *string_copy(char *, char *);
int main(void) {
  char s1[98];
  char *p;
  p = string_copy(s1, "First, solve the problem. Then, write the code\n");
  printf("%s", s1);
  printf("%s", p);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1040 <string_copy@plt>
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x78(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xed0(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <string_copy@plt>
mov    %rax,%rbx
lea    0xeeb(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [48 x i8] c"First, solve the problem. Then, write the code\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [98 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = getelementptr inbounds [98 x i8], [98 x i8]* %2, i64 0, i64 0
%5 = call i8* @string_copy(i8* %4, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = getelementptr inbounds [98 x i8], [98 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"First, solve the problem. Then, write the code\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [98 x i8]
%2 = getelementptr inbounds [98 x i8], [98 x i8]* %1, i64 0, i64 0
%3 = call i8* @string_copy(i8* %2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}