xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ kernel_write(unsigned long, unsigned int *, int);
void kernel_write_uint(unsigned long kaddr, unsigned int data) {
  kernel_write(kaddr, &data, sizeof(data));
}


x86 assembly (clang, -O0):
<kernel_write_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <kernel_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_write_uint>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <kernel_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @kernel_write_uint(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 = call i32 @kernel_write(i64 %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @kernel_write_uint(i64 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @kernel_write(i64 %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void handle_connection_error(void) {
  {
    printf("QEMU_ERROR: ");
    printf("unable to connect to shm %d\n", 154519);
    exit(-1);
  };
  exit(-1);
}


x86 assembly (clang, -O0):
<handle_connection_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x25b97,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_connection_error>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x25b97,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"QEMU_ERROR: \00"
@.str.1 = [29 x i8] c"unable to connect to shm %d\0A\00"
define void @handle_connection_error() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 154519)
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"QEMU_ERROR: \00"
@.str.1 = [29 x i8] c"unable to connect to shm %d\0A\00"
define void @handle_connection_error() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 154519)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t min_16(int16_t a, int16_t b) { return b + ((a - b) & ((a - b) >> 15)); }


x86 assembly (clang, -O0):
<min_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
sub    -0x8(%rbp),%edx
sar    $0xf,%edx
and    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_16>:
sub    %esi,%edi
mov    %edi,%eax
sar    $0xf,%eax
and    %edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @min_16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = ashr i32 %11, 15
%13 = and i32 %8, %12
%14 = add nsw i32 %5, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @min_16(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = ashr i32 %3, 15
%5 = and i32 %4, %3
%6 = add nsw i32 %5, %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ tty_putc(int, char);
void tty_puts(int chan, char *s) {
  char c;
  while ((c = *s++) != '\0') {
    if (c == '\n') {
      tty_putc(chan, '\r');
    }
    tty_putc(chan, c);
  }
}


x86 assembly (clang, -O0):
<tty_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     116a <tty_puts+0x5a>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    1159 <tty_puts+0x49>
mov    -0x4(%rbp),%edi
mov    $0xd,%esi
call   1030 <tty_putc@plt>
mov    -0x4(%rbp),%edi
movsbl -0x11(%rbp),%esi
call   1030 <tty_putc@plt>
jmp    111f <tty_puts+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_puts>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbp
mov    %edi,%r14d
jmp    113c <tty_puts+0x2c>
nopl   0x0(%rax)
mov    %r14d,%edi
mov    $0xd,%esi
call   1030 <tty_putc@plt>
add    $0x1,%rbp
movsbl %bl,%esi
mov    %r14d,%edi
call   1030 <tty_putc@plt>
movzbl 0x0(%rbp),%ebx
cmp    $0xa,%bl
je     1120 <tty_puts+0x10>
test   %bl,%bl
jne    112d <tty_puts+0x1d>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @tty_puts(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %1, %2 ], [ %5, %9 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
switch i8 %6, label %9 [
i8 0, label %11
i8 10, label %7
]
7: ; preds = %3
%8 = tail call i32 @tty_putc(i32 %0, i8 signext 13)
br label %9
9: ; preds = %3, %7
%10 = tail call i32 @tty_putc(i32 %0, i8 signext %6)
br label %3
11: ; preds = %3
ret void
}
int main() {
  long int a = 4L;
  return a;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 4, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, int);
void serial_configure_fifo_queue(unsigned short com) { outb((com + 2), 0xC7); }


x86 assembly (clang, -O0):
<serial_configure_fifo_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x2,%eax
mov    $0xc7,%esi
movzwl %ax,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_configure_fifo_queue>:
add    $0x2,%edi
movzwl %di,%edi
mov    $0xc7,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_configure_fifo_queue(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = add nsw i32 %4, 2
%6 = trunc i32 %5 to i16
%7 = call i32 @outb(i16 zeroext %6, i32 199)
ret void
}

LLVM IR (-O2):
define void @serial_configure_fifo_queue(i16 zeroext %0) {
%2 = add i16 %0, 2
%3 = tail call i32 @outb(i16 zeroext %2, i32 199)
ret void
}
void pwmInit() {}


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

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

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

LLVM IR (-O2):
define void @pwmInit() {
ret void
}
double _n_0(void) { return 0.0; }


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

x86 assembly (clang, -O2):
<_n_0>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @_n_0() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @_n_0() {
ret double 0.000000e+00
}
void genswc1() {}


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

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

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

LLVM IR (-O2):
define void @genswc1() {
ret void
}
unsigned int get_uint_decimal_length(unsigned int num) {
  register unsigned int beta = 1;
  while ((num /= 10) != 0)
    beta++;
  return beta;
}


x86 assembly (clang, -O0):
<get_uint_decimal_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1134 <get_uint_decimal_length+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <get_uint_decimal_length+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint_decimal_length>:
mov    $0x1,%eax
cmp    $0xa,%edi
jb     1134 <get_uint_decimal_length+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x63,%edi
mov    %edx,%edi
ja     1120 <get_uint_decimal_length+0x20>
ret

LLVM IR (-O0):
define i32 @get_uint_decimal_length(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = udiv i32 %5, 10
store i32 %6, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_uint_decimal_length(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add i32 %4, 1
%8 = icmp ult i32 %5, 100
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createPowExpression(struct memorycontainer *expression1,
                    struct memorycontainer *expression2) {
  return createExpression(0x0020, expression1, expression2);
}


x86 assembly (clang, -O0):
<createPowExpression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x20,%edi
call   1030 <createExpression@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createPowExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x20,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createPowExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 32, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createPowExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 32, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ run_server();
int main(int argc, char *argv[]) { exit(run_server()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <run_server@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <run_server@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
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 (...) @run_server()
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @run_server()
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int f_blg_rm2(float a1, float *a2) {
  return !(__builtin_islessgreater(a1, *a2));
}


x86 assembly (clang, -O0):
<f_blg_rm2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_blg_rm2>:
xor    %eax,%eax
ucomiss (%rdi),%xmm0
sete   %al
ret

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

LLVM IR (-O2):
define i32 @f_blg_rm2(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp ueq float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int dldump(const char *str1, const char *str2, int x) {}


x86 assembly (clang, -O0):
<dldump>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dldump(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @dldump(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void __refmem_oom(void) {
  fprintf(stderr, "ERROR: out of memory; aborting\n");
  abort();
}


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

x86 assembly (clang, -O2):
<__refmem_oom>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"ERROR: out of memory; aborting\0A\00"
define void @__refmem_oom() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"ERROR: out of memory; aborting\0A\00"
define void @__refmem_oom() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void printSquare(int num) {
  printf("\"%d\" squared is \"%d\".\n", num, num * num);
}


x86 assembly (clang, -O0):
<printSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSquare>:
mov    %edi,%edx
imul   %edi,%edx
lea    0xee4(%rip),%rax
mov    %edi,%esi
mov    %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\22%d\22 squared is \22%d\22.\0A\00"
define void @printSquare(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\22%d\22 squared is \22%d\22.\0A\00"
define void @printSquare(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
unsigned int getTag(unsigned int address, const int indexSize,
                    const int offsetSize) {
  return (address >> (indexSize + offsetSize) & ~1);
}


x86 assembly (clang, -O0):
<getTag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
shr    %cl,%eax
and    $0xfffffffe,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTag>:
mov    %edi,%eax
lea    (%rsi,%rdx,1),%ecx
shr    %cl,%eax
and    $0xfffffffe,%eax
ret

LLVM IR (-O0):
define i32 @getTag(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 = add nsw i32 %8, %9
%11 = lshr i32 %7, %10
%12 = and i32 %11, -2
ret i32 %12
}

LLVM IR (-O2):
define i32 @getTag(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = lshr i32 %0, %4
%6 = and i32 %5, -2
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ utfbuf;

/* Variables and functions */
char *dstrinsn(char *, size_t, char *);
scalar_t__ utf8_encode(char *, int, unsigned long);
char *dstrins(char *str, size_t pos, unsigned long codepoint) {
  char utfbuf[8] = {0};
  if (utf8_encode(utfbuf, sizeof(utfbuf), codepoint) < 0)
    return str;
  return dstrinsn(str, pos, utfbuf);
}


x86 assembly (clang, -O0):
<dstrins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x8,%esi
call   1030 <utf8_encode@plt>
cmp    $0x0,%rax
jge    117d <dstrins+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1192 <dstrins+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1040 <dstrinsn@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dstrins>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <utf8_encode@plt>
test   %rax,%rax
js     1155 <dstrins+0x35>
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <dstrinsn@plt>
mov    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dstrins(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca [8 x i8]
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%9 = bitcast [8 x i8]* %8 to i8*
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%11 = load i64, i64* %7
%12 = call i64 @utf8_encode(i8* %10, i32 8, i64 %11)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = load i8*, i8** %5
store i8* %15, i8** %4
br label %21
16: ; preds = %3
%17 = load i8*, i8** %5
%18 = load i64, i64* %6
%19 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%20 = call i8* @dstrinsn(i8* %17, i64 %18, i8* %19)
store i8* %20, i8** %4
br label %21
21: ; preds = %16, %14
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @dstrins(i8* %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%6 = call i64 @utf8_encode(i8* %5, i32 8, i64 %2)
%7 = icmp slt i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = call i8* @dstrinsn(i8* %0, i64 %1, i8* %5)
br label %10
10: ; preds = %3, %8
%11 = phi i8* [ %9, %8 ], [ %0, %3 ]
ret i8* %11
}
/* Variables and functions */
size_t _lower_multiple(size_t v, size_t m) {
  register size_t mod = v % m;
  return v - ((0) ^ (((mod) ^ (0)) & -(mod != 0)));
}


x86 assembly (clang, -O0):
<_lower_multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
xor    $0x0,%rcx
cmpq   $0x0,-0x18(%rbp)
setne  %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
movslq %edx,%rdx
and    %rdx,%rcx
xor    $0x0,%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lower_multiple>:
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1116 <_lower_multiple+0x16>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    111c <_lower_multiple+0x1c>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @_lower_multiple(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %3
%10 = load i64, i64* %5
%11 = xor i64 %10, 0
%12 = load i64, i64* %5
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i32
%15 = sub nsw i32 0, %14
%16 = sext i32 %15 to i64
%17 = and i64 %11, %16
%18 = xor i64 0, %17
%19 = sub i64 %9, %18
ret i64 %19
}

LLVM IR (-O2):
define i64 @_lower_multiple(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = sub i64 %0, %3
ret i64 %4
}
unsigned short int f22(unsigned short int x, long int y) {
  return (x >> (8 * 2 - y)) ^ (x << y);
}


x86 assembly (clang, -O0):
<f22>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f22>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f22(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = sub nsw i64 16, %7
%9 = trunc i64 %8 to i32
%10 = ashr i32 %6, %9
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = shl i32 %12, %14
%16 = xor i32 %10, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f22(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 16, %4
%6 = lshr i32 %3, %5
%7 = shl i32 %3, %4
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}
void turn_off_buzzer(void) {
  (*(volatile unsigned int *)(0x7F0080A4)) &= ~(1 << 15);
  return;
}


x86 assembly (clang, -O0):
<turn_off_buzzer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f0080a4,%eax
mov    (%rax),%ecx
and    $0xffff7fff,%ecx
mov    $0x7f0080a4,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_off_buzzer>:
andl   $0xffff7fff,0x7f0080a4
ff 7f ff ff
ret

LLVM IR (-O0):
define void @turn_off_buzzer() {
%1 = load volatile i32, i32* inttoptr (i64 2130739364 to i32*)
%2 = and i32 %1, -32769
store volatile i32 %2, i32* inttoptr (i64 2130739364 to i32*)
ret void
}

LLVM IR (-O2):
define void @turn_off_buzzer() {
%1 = load volatile i32, i32* inttoptr (i64 2130739364 to i32*)
%2 = and i32 %1, -32769
store volatile i32 %2, i32* inttoptr (i64 2130739364 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wprintw(int /*<<< orphan*/ *, char const *, float);
int r_wprintw(WINDOW *win, const char *fmt, float r) {
  return (wprintw(win, fmt, r));
}


x86 assembly (clang, -O0):
<r_wprintw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
call   1030 <wprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_wprintw>:
jmp    1030 <wprintw@plt>

LLVM IR (-O0):
define i32 @r_wprintw(i32* %0, i8* %1, float %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca float
store i32* %0, i32** %4
store i8* %1, i8** %5
store float %2, float* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load float, float* %6
%10 = call i32 @wprintw(i32* %7, i8* %8, float %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @r_wprintw(i32* %0, i8* %1, float %2) {
%4 = tail call i32 @wprintw(i32* %0, i8* %1, float %2)
ret i32 %4
}
int test_69_4(int *mem) { return __atomic_fetch_xor(mem + 0, -1, 4); }


x86 assembly (clang, -O0):
<test_69_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
xor    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test_69_4+0x4b>
jmp    1122 <test_69_4+0x22>
mov    -0x24(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_69_4>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <test_69_4+0x10>
ret

LLVM IR (-O0):
define i32 @test_69_4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 -1, i32* %3
%7 = load i32, i32* %3
%8 = atomicrmw xor i32* %6, i32 %7 acq_rel
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_69_4(i32* nocapture %0) {
%2 = atomicrmw xor i32* %0, i32 -1 acq_rel
ret i32 %2
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_40(int Salt, int Parameter) {
  unsigned b = Salt * 0x511537CB + 0x7135;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_40>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x511537cb,-0x4(%rbp),%eax
add    $0x7135,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_40>:
imul   $0x511537cb,%edi,%edi
add    $0x7135,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_40(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 = mul nsw i32 %6, 1360345035
%8 = add nsw i32 %7, 28981
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @yahoo_M1Common(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @yahoo_f01_40(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 1360345035
%4 = add nsw i32 %3, 28981
%5 = tail call i32 @yahoo_M1Common(i32 %4, i32 %1)
ret i32 %5
}
__attribute__((always_)) void prefetch(const void *x) {
  asm volatile("661:\n\t"
               "prefetcht0 (%1)"
               "\n662:\n"
               ".section .altinstructions,\"a\"\n"
               " "
               ".balign 8"
               " "
               "\n"
               " "
               ".quad"
               " "
               "661b\n"
               " "
               ".quad"
               " "
               "663f\n"
               "	 .byte "
               "(0*32+25)"
               "\n"
               "	 .byte 662b-661b\n"
               "	 .byte 664f-663f\n"
               ".previous\n"
               ".section .altinstr_replacement, \"ax\"\n"
               "663:\n\t"
               "prefetchnta (%1)"
               "\n664:\n"
               ".previous"
               :
               : "i"(0), "r"(x));
}


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

x86 assembly (clang, -O2):
<prefetch>:
prefetcht0 (%rdi)
ret

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

LLVM IR (-O2):
define void @prefetch(i8* %0) {
tail call void asm sideeffect "661:\0A\09prefetcht0 ($1)\0A662:\0A.section .altinstructions,\22a\22\0A .balign 8 \0A .quad 661b\0A .quad 663f\0A\09 .byte (0*32+25)\0A\09 .byte 662b-661b\0A\09 .byte 664f-663f\0A.previous\0A.section .altinstr_replacement, \22ax\22\0A663:\0A\09prefetchnta ($1)\0A664:\0A.previous", "i,r,~{dirflag},~{fpsr},~{flags}"(i32 0, i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ calloc(unsigned int, int);
int /*<<< orphan*/ sprintf(char *, char *, long, long);
double **new_double2DFss(int n) {
  static char s[170];
  double **p = (double **)calloc((unsigned)n, sizeof(double *));
  if (p == NULL) {
    sprintf(s, "new_double2D(): calloc(%ld,%ld) failed", (long)n,
            (long)sizeof(double *));
  }
  return p;
}


x86 assembly (clang, -O0):
<new_double2DFss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1163 <new_double2DFss+0x43>
movslq -0x4(%rbp),%rdx
lea    0x2eee(%rip),%rdi
lea    0xea7(%rip),%rsi
mov    $0x8,%ecx
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_double2DFss>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1152 <new_double2DFss+0x32>
movslq %ebp,%rdx
lea    0x2eff(%rip),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x8,%ecx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@new_double2DFss.s = internal global [170 x i8] zeroinitializer
@.str = [39 x i8] c"new_double2D(): calloc(%ld,%ld) failed\00"
define double** @new_double2DFss(i32 %0) {
%2 = alloca i32
%3 = alloca double**
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 8)
%6 = inttoptr i64 %5 to double**
store double** %6, double*** %3
%7 = load double**, double*** %3
%8 = icmp eq double** %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = call i32 @sprintf(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @new_double2DFss.s, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %11, i64 8)
br label %13
13: ; preds = %9, %1
%14 = load double**, double*** %3
ret double** %14
}

LLVM IR (-O2):
@new_double2DFss.s = internal global [170 x i8] zeroinitializer
@.str = [39 x i8] c"new_double2D(): calloc(%ld,%ld) failed\00"
define double** @new_double2DFss(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 8)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = sext i32 %0 to i64
%6 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([170 x i8], [170 x i8]* @new_double2DFss.s, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %5, i64 8)
br label %7
7: ; preds = %4, %1
%8 = inttoptr i64 %2 to double**
ret double** %8
}
/* Variables and functions */
int /*<<< orphan*/ r4030_delay();
void r4030_write_reg16(unsigned addr, unsigned val) {
  *((volatile unsigned short *)addr) = val;
  r4030_delay();
}


x86 assembly (clang, -O0):
<r4030_write_reg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %ax,%cx
mov    -0x4(%rbp),%eax
mov    %cx,(%rax)
mov    $0x0,%al
call   1030 <r4030_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r4030_write_reg16>:
mov    %edi,%eax
mov    %si,(%rax)
xor    %eax,%eax
jmp    1030 <r4030_delay@plt>

LLVM IR (-O0):
define void @r4030_write_reg16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i16
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i16*
store volatile i16 %6, i16* %9
%10 = call i32 (...) @r4030_delay()
ret void
}

LLVM IR (-O2):
define void @r4030_write_reg16(i32 %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = zext i32 %0 to i64
%5 = inttoptr i64 %4 to i16*
store volatile i16 %3, i16* %5
%6 = tail call i32 (...) @r4030_delay()
ret void
}
/* Variables and functions */
int PAPI_query_event(int);
void papif_query_event_(int *EventCode, int *check) {
  *check = PAPI_query_event(*EventCode);
}


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

x86 assembly (clang, -O2):
<papif_query_event_>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_query_event@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_query_event_(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_query_event(i32 %3)
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void exit_if_null(const void *const p) {
  if (p == NULL) {
    perror("Error");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<exit_if_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1151 <exit_if_null+0x31>
lea    0xec2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_if_null>:
test   %rdi,%rdi
je     1126 <exit_if_null+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Error\00"
@EXIT_FAILURE = global i32 0
define void @exit_if_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Error\00"
@EXIT_FAILURE = global i32 0
define void @exit_if_null(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
long long rotateL_fun_llong(long long x, int i) {
  if ((i %= 64) == 0)
    return x;
  return (x << i) | ((0x7fffffffffffffffll >> (63 - i)) & (x >> (64 - i)));
}


x86 assembly (clang, -O0):
<rotateL_fun_llong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmp    $0x0,%edx
jne    112f <rotateL_fun_llong+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <rotateL_fun_llong+0x73>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    %cl,%rax
mov    $0x3f,%ecx
sub    -0x14(%rbp),%ecx
mov    %ecx,%ecx
movabs $0x7fffffffffffffff,%rdx
ff ff 7f
sar    %cl,%rdx
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x40,%ecx
sub    -0x14(%rbp),%ecx
mov    %ecx,%ecx
sar    %cl,%rdx
mov    -0x20(%rbp),%rcx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateL_fun_llong>:
mov    %rdi,%rax
lea    0x3f(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%esi
je     113a <rotateL_fun_llong+0x3a>
mov    %rax,%rdx
mov    %esi,%ecx
shl    %cl,%rdx
mov    $0x3f,%cl
sub    %sil,%cl
movabs $0x7fffffffffffffff,%rdi
ff ff 7f
shr    %cl,%rdi
neg    %sil
mov    %esi,%ecx
sar    %cl,%rax
and    %rdi,%rax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rotateL_fun_llong(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 64
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %4
store i64 %10, i64* %3
br label %27
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = shl i64 %12, %14
%16 = load i32, i32* %5
%17 = sub nsw i32 63, %16
%18 = zext i32 %17 to i64
%19 = ashr i64 9223372036854775807, %18
%20 = load i64, i64* %4
%21 = load i32, i32* %5
%22 = sub nsw i32 64, %21
%23 = zext i32 %22 to i64
%24 = ashr i64 %20, %23
%25 = and i64 %19, %24
%26 = or i64 %15, %25
store i64 %26, i64* %3
br label %27
27: ; preds = %11, %9
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @rotateL_fun_llong(i64 %0, i32 %1) {
%3 = srem i32 %1, 64
%4 = icmp eq i32 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = zext i32 %3 to i64
%7 = shl i64 %0, %6
%8 = sub nsw i32 63, %3
%9 = zext i32 %8 to i64
%10 = lshr i64 9223372036854775807, %9
%11 = sub nsw i32 64, %3
%12 = zext i32 %11 to i64
%13 = ashr i64 %0, %12
%14 = and i64 %10, %13
%15 = or i64 %14, %7
br label %16
16: ; preds = %2, %5
%17 = phi i64 [ %15, %5 ], [ %0, %2 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ checkFcnSanity();
int /*<<< orphan*/ fixupFcnCalls();
void postProcess(void) {
  checkFcnSanity();
  fixupFcnCalls();
}


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

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

LLVM IR (-O0):
define void @postProcess() {
%1 = call i32 (...) @checkFcnSanity()
%2 = call i32 (...) @fixupFcnCalls()
ret void
}

LLVM IR (-O2):
define void @postProcess() {
%1 = tail call i32 (...) @checkFcnSanity()
%2 = tail call i32 (...) @fixupFcnCalls()
ret void
}
/* Variables and functions */
int add1(int);
int add2(int n, int m) {
  if (n < 1)
    return 1;
  return 2 + m + add1(n - 1);
}


x86 assembly (clang, -O0):
<add2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1134 <add2+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1152 <add2+0x42>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <add1@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2>:
test   %edi,%edi
jle    1126 <add2+0x16>
push   %rbx
mov    %esi,%ebx
add    $0xffffffff,%edi
call   1030 <add1@plt>
add    %ebx,%eax
add    $0x2,%eax
pop    %rbx
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @add2(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 = icmp slt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %16
9: ; preds = %2
%10 = load i32, i32* %5
%11 = add nsw i32 2, %10
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = call i32 @add1(i32 %13)
%15 = add nsw i32 %11, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %9, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @add2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = add nsw i32 %1, 2
%6 = add nsw i32 %0, -1
%7 = tail call i32 @add1(i32 %6)
%8 = add nsw i32 %5, %7
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 1, %2 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wattron(int /*<<< orphan*/ *, int);
int ncurses_wattron(WINDOW *win, int attr) { return wattron(win, attr); }


x86 assembly (clang, -O0):
<ncurses_wattron>:
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 <wattron@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncurses_wattron>:
jmp    1030 <wattron@plt>

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

LLVM IR (-O2):
define i32 @ncurses_wattron(i32* %0, i32 %1) {
%3 = tail call i32 @wattron(i32* %0, i32 %1)
ret i32 %3
}
void init_kips(int *argc, char ***argv) {
  (void)argc;
  (void)argv;
}


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

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

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

LLVM IR (-O2):
define void @init_kips(i32* nocapture %0, i8*** nocapture %1) {
ret void
}
void ff_hevc_put_hevc_uni_w_pel_pixels12_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_pel_pixels12_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int number;
  scanf("%d", &number);
  printf("%d\n", number);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int temper(unsigned int);
int rand_r(unsigned *seed) {
  return temper(*seed = *seed * 1103515245 + 12345) / 2;
}


x86 assembly (clang, -O0):
<rand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x41c64e6d,(%rax),%edi
add    $0x3039,%edi
mov    -0x8(%rbp),%rax
mov    %edi,(%rax)
call   1030 <temper@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_r>:
push   %rax
imul   $0x41c64e6d,(%rdi),%eax
add    $0x3039,%eax
mov    %eax,(%rdi)
mov    %eax,%edi
call   1030 <temper@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_r(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul i32 %4, 1103515245
%6 = add i32 %5, 12345
%7 = load i32*, i32** %2
store i32 %6, i32* %7
%8 = call i32 @temper(i32 %6)
%9 = sdiv i32 %8, 2
ret i32 %9
}

LLVM IR (-O2):
define i32 @rand_r(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 1103515245
%4 = add i32 %3, 12345
store i32 %4, i32* %0
%5 = tail call i32 @temper(i32 %4)
%6 = sdiv i32 %5, 2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void variable_destroy(void *v) { free(v); }


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

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

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

LLVM IR (-O2):
define void @variable_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_19uint32_mem(unsigned int *val) {
  return ((*val) & (0x19 << 0)) ? -20 : -40;
}


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

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

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

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


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

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

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

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