xunge/DecIR huggingface dataset:
unsigned rcb_fast_circular_shift_left(unsigned val, unsigned count) {
  count %= sizeof(unsigned) * 8;
  return (val << count) | (val >> (sizeof(unsigned) * 8) - count);
}


x86 assembly (clang, -O0):
<rcb_fast_circular_shift_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1f,%rax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    %ecx,%esi
mov    $0x20,%ecx
sub    %rsi,%rcx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcb_fast_circular_shift_left>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rcb_fast_circular_shift_left(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 = zext i32 %5 to i64
%7 = urem i64 %6, 32
%8 = trunc i64 %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = shl i32 %9, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = zext i32 %13 to i64
%15 = sub i64 32, %14
%16 = trunc i64 %15 to i32
%17 = lshr i32 %12, %16
%18 = or i32 %11, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @rcb_fast_circular_shift_left(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 %1)
ret i32 %3
}
unsigned long long subul(unsigned long a, unsigned long b) {
  if (a < b)
    return -1UL - b + a + 1;
  return a - b;
}


x86 assembly (clang, -O0):
<subul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1136 <subul+0x36>
mov    $0xffffffffffffffff,%rax
sub    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1142 <subul+0x42>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @subul(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
ret i64 %3
}
float min(float a, float b) { return a <= b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1130 <min+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <min+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
movaps %xmm0,%xmm2
cmpless %xmm1,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ole float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_creds_get_uid(void *c,
                                                                uid_t *uid) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_creds_get_uid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_creds_get_uid>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_uid(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_uid(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void LogChar(char C) {}


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

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

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

LLVM IR (-O2):
define void @LogChar(i8 signext %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, float *, int);
void modbus_set_float(float f, uint16_t *dest) {
  uint32_t i = 0;
  memcpy(&i, &f, sizeof(uint32_t));
  dest[0] = (uint16_t)i;
  dest[1] = (uint16_t)(i >> 16);
}


x86 assembly (clang, -O0):
<modbus_set_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movslq -0x14(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbus_set_float>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movslq 0x8(%rsp),%rax
mov    %rax,(%rbx)
sar    $0x10,%eax
cltq
mov    %rax,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @modbus_set_float(float %0, i64* %1) {
%3 = alloca float
%4 = alloca i64*
%5 = alloca i32
store float %0, float* %3
store i64* %1, i64** %4
store i32 0, i32* %5
%6 = call i32 @memcpy(i32* %5, float* %3, i32 4)
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = load i64*, i64** %4
%10 = getelementptr inbounds i64, i64* %9, i64 0
store i64 %8, i64* %10
%11 = load i32, i32* %5
%12 = ashr i32 %11, 16
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %4
%15 = getelementptr inbounds i64, i64* %14, i64 1
store i64 %13, i64* %15
ret void
}

LLVM IR (-O2):
define void @modbus_set_float(float %0, i64* nocapture writeonly %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @memcpy(i32* %4, float* %3, i32 4)
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
store i64 %8, i64* %1
%9 = ashr i32 %7, 16
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i64, i64* %1, i64 1
store i64 %10, i64* %11
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int fputc_jmp(int c, FILE *file, jmp_buf *jmp_if_error) {
  int fputc_result = fputc(c, file);
  if (fputc_result == EOF) {
    longjmp(*jmp_if_error, (!0));
  }
  return fputc_result;
}


x86 assembly (clang, -O0):
<fputc_jmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%eax
jne    1164 <fputc_jmp+0x44>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <longjmp@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc_jmp>:
push   %rbx
mov    %rdx,%rbx
call   1030 <fputc@plt>
mov    0x2eb8(%rip),%rcx
cmp    (%rcx),%eax
je     1136 <fputc_jmp+0x16>
pop    %rbx
ret
mov    (%rbx),%edi
mov    $0x1,%esi
call   1040 <longjmp@plt>

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fputc_jmp(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = tail call i32 @fputc(i32 %0, i32* %1)
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = tail call i32 @longjmp(i32 %8, i32 1)
unreachable
10: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ heap_expand(size_t);
void talloc_expand(size_t count) { heap_expand(count); }


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

x86 assembly (clang, -O2):
<talloc_expand>:
jmp    1030 <heap_expand@plt>

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

LLVM IR (-O2):
define void @talloc_expand(i64 %0) {
%2 = tail call i32 @heap_expand(i64 %0)
ret void
}
int crypt_cipher_destroy(struct crypt_cipher *ctx) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.crypt_cipher = type opaque
define i32 @crypt_cipher_destroy(%struct.crypt_cipher* nocapture readnone %0) {
ret i32 0
}
int main(void) {
  *(volatile char *)0xDEADBEEF = 'x';
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0xdeadbeef,%eax
movb   $0x78,(%rax)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store volatile i8 120, i8* inttoptr (i64 3735928559 to i8*)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
store volatile i8 120, i8* inttoptr (i64 3735928559 to i8*)
ret i32 0
}
void gtk_adjustment_get_value() {}


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_h6_12_sse4() {
ret void
}
/* Variables and functions */
double fabs(float);
float my_cosf(float);
float wrap_cosf(float x) {
  if (fabs(x) < 3.4526697709225118160247802734375e-4)
    return 1;
  return my_cosf(x);
}


x86 assembly (clang, -O0):
<wrap_cosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xebe(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    115e <wrap_cosf+0x3e>
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116d <wrap_cosf+0x4d>
movss  -0x8(%rbp),%xmm0
call   1030 <my_cosf@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_cosf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1040 <fabs@plt>
movsd  0xecc(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1144 <wrap_cosf+0x24>
movss  0xec6(%rip),%xmm0
pop    %rax
ret
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <my_cosf@plt>

LLVM IR (-O0):
define float @wrap_cosf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = call double @fabs(float %4)
%6 = fcmp olt double %5, 0x3F36A09E60000000
br i1 %6, label %7, label %8
7: ; preds = %1
store float 1.000000e+00, float* %2
br label %11
8: ; preds = %1
%9 = load float, float* %3
%10 = call float @my_cosf(float %9)
store float %10, float* %2
br label %11
11: ; preds = %8, %7
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @wrap_cosf(float %0) {
%2 = tail call double @fabs(float %0)
%3 = fcmp olt double %2, 0x3F36A09E60000000
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call float @my_cosf(float %0)
br label %6
6: ; preds = %1, %4
%7 = phi float [ %5, %4 ], [ 1.000000e+00, %1 ]
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRB9_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRB9_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRB9_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_and_exit();
double *malloc(int);
double *malloc_double_line(int dim1) {
  double *line;
  line = malloc(sizeof(double) * dim1);
  if (line == NULL)
    error_and_exit();
  return line;
}


x86 assembly (clang, -O0):
<malloc_double_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <malloc_double_line+0x30>
mov    $0x0,%al
call   1030 <error_and_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_double_line>:
push   %rbx
shl    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1138 <malloc_double_line+0x18>
xor    %eax,%eax
call   1030 <error_and_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define double* @malloc_double_line(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 8, %5
%7 = trunc i64 %6 to i32
%8 = call double* @malloc(i32 %7)
store double* %8, double** %3
%9 = load double*, double** %3
%10 = icmp eq double* %9, null
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 (...) @error_and_exit()
br label %13
13: ; preds = %11, %1
%14 = load double*, double** %3
ret double* %14
}

LLVM IR (-O2):
define noalias double* @malloc_double_line(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call double* @malloc(i32 %2)
%4 = icmp eq double* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @error_and_exit()
br label %7
7: ; preds = %5, %1
ret double* %3
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
int tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/, struct termios *);
int tmode(int how) {
  static struct termios original_mode;
  if (how == 0) {
    tcgetattr(0, &original_mode);
  } else {
    return tcsetattr(0, TCSANOW, &original_mode);
  }
}


x86 assembly (clang, -O0):
<tmode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1148 <tmode+0x28>
xor    %edi,%edi
lea    0x2ef6(%rip),%rsi
call   1030 <tcgetattr@plt>
jmp    1162 <tmode+0x42>
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    0x2eda(%rip),%rdx
call   1040 <tcsetattr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmode>:
test   %edi,%edi
je     113b <tmode+0x1b>
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0x2f00(%rip),%rdx
xor    %edi,%edi
jmp    1040 <tcsetattr@plt>
lea    0x2ef2(%rip),%rsi
xor    %edi,%edi
jmp    1030 <tcgetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@tmode.original_mode = internal global %struct.termios zeroinitializer
@TCSANOW = global i32 0
define i32 @tmode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @tcgetattr(i32 0, %struct.termios* @tmode.original_mode)
br label %11
8: ; preds = %1
%9 = load i32, i32* @TCSANOW
%10 = call i32 @tcsetattr(i32 0, i32 %9, %struct.termios* @tmode.original_mode)
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@tmode.original_mode = internal global %struct.termios zeroinitializer
@TCSANOW = global i32 0
define i32 @tmode(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @tcgetattr(i32 0, %struct.termios* @tmode.original_mode)
br label %8
5: ; preds = %1
%6 = load i32, i32* @TCSANOW
%7 = tail call i32 @tcsetattr(i32 0, i32 %6, %struct.termios* @tmode.original_mode)
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ undef, %3 ], [ %7, %5 ]
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg16setBank0(int);
void m230_setParamsContra(uint16_t addr, uint8_t val) {
  (void)addr;
  prg16setBank0((val & 7) << 14);
}


x86 assembly (clang, -O0):
<m230_setParamsContra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xe,%edi
call   1030 <prg16setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m230_setParamsContra>:
mov    %esi,%edi
and    $0x7,%edi
shl    $0xe,%edi
jmp    1030 <prg16setBank0@plt>

LLVM IR (-O0):
define void @m230_setParamsContra(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 = and i32 %6, 7
%8 = shl i32 %7, 14
%9 = call i32 @prg16setBank0(i32 %8)
ret void
}

LLVM IR (-O2):
define void @m230_setParamsContra(i32 %0, i32 %1) {
%3 = shl i32 %1, 14
%4 = and i32 %3, 114688
%5 = tail call i32 @prg16setBank0(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G31_f(char *s) {
  debug("G31_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G31_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G31_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G31_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G31_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G31_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G31_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ current_view();
int /*<<< orphan*/ cursor_up(int /*<<< orphan*/);
void up_action() { cursor_up(current_view()); }


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

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

LLVM IR (-O0):
define void @up_action() {
%1 = call i32 (...) @current_view()
%2 = call i32 @cursor_up(i32 %1)
ret void
}

LLVM IR (-O2):
define void @up_action() {
%1 = tail call i32 (...) @current_view()
%2 = tail call i32 @cursor_up(i32 %1)
ret void
}
__attribute__((no)) void mempool_free(struct module *mod, void *p) {}


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

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

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

LLVM IR (-O2):
%struct.module = type opaque
define void @mempool_free(%struct.module* nocapture %0, i8* nocapture %1) {
ret void
}
int test_imm_92uint16_mem(unsigned short *val) {
  return ((*val) & (0x92 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_92uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 146
%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_92uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 146
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
unsigned int be32put(void *p, uint32_t v) {
  uint8_t *a;
  a = p;
  a[0] = v >> 24;
  a[1] = v >> 16;
  a[2] = v >> 8;
  a[3] = v;
  return 4;
}


x86 assembly (clang, -O0):
<be32put>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32put>:
mov    %esi,%eax
sar    $0x18,%eax
mov    %eax,(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rdi)
mov    %esi,0xc(%rdi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @be32put(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = ashr i32 %8, 24
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 16
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %13, i32* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 8
%18 = load i32*, i32** %5
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 3
store i32 %20, i32* %22
ret i32 4
}

LLVM IR (-O2):
define i32 @be32put(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = ashr i32 %1, 24
store i32 %4, i32* %3
%5 = ashr i32 %1, 16
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
%8 = ashr i32 %1, 8
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
%11 = getelementptr inbounds i8, i8* %0, i64 12
%12 = bitcast i8* %11 to i32*
store i32 %1, i32* %12
ret i32 4
}
/* Type definitions */
struct mdoc_node {
  int dummy;
};
struct mdoc_meta {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ font_push(char);
int /*<<< orphan*/ pre_syn(struct mdoc_node const *);
int pre_fd(const struct mdoc_meta *meta, const struct mdoc_node *n) {
  pre_syn(n);
  font_push('B');
  return (1);
}


x86 assembly (clang, -O0):
<pre_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pre_syn@plt>
mov    $0x42,%edi
call   1030 <font_push@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pre_fd>:
push   %rax
mov    %rsi,%rdi
call   1040 <pre_syn@plt>
mov    $0x42,%edi
call   1030 <font_push@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
define i32 @pre_fd(%struct.mdoc_meta* %0, %struct.mdoc_node* %1) {
%3 = alloca %struct.mdoc_meta*
%4 = alloca %struct.mdoc_node*
store %struct.mdoc_meta* %0, %struct.mdoc_meta** %3
store %struct.mdoc_node* %1, %struct.mdoc_node** %4
%5 = load %struct.mdoc_node*, %struct.mdoc_node** %4
%6 = call i32 @pre_syn(%struct.mdoc_node* %5)
%7 = call i32 @font_push(i8 signext 66)
ret i32 1
}

LLVM IR (-O2):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
define i32 @pre_fd(%struct.mdoc_meta* nocapture readnone %0, %struct.mdoc_node* %1) {
%3 = tail call i32 @pre_syn(%struct.mdoc_node* %1)
%4 = tail call i32 @font_push(i8 signext 66)
ret i32 1
}
void foo_1_1_2_1_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_1_2_1_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fast_clear_page(void *);
scalar_t__ in_interrupt();
int /*<<< orphan*/ slow_zero_page(void *);
void mmx_clear_page(void *page) {
  if (in_interrupt())
    slow_zero_page(page);
  else
    fast_clear_page(page);
}


x86 assembly (clang, -O0):
<mmx_clear_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <in_interrupt@plt>
cmp    $0x0,%rax
je     115b <mmx_clear_page+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <slow_zero_page@plt>
jmp    1164 <mmx_clear_page+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <fast_clear_page@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmx_clear_page>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <in_interrupt@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1149 <mmx_clear_page+0x19>
pop    %rbx
jmp    1040 <slow_zero_page@plt>
pop    %rbx
jmp    1030 <fast_clear_page@plt>

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

LLVM IR (-O2):
define void @mmx_clear_page(i8* %0) {
%2 = tail call i64 (...) @in_interrupt()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @slow_zero_page(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @fast_clear_page(i8* %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ctrl_outl(int /*<<< orphan*/, int);
extern void harp_set_vpp_off(void) { ctrl_outl(0, (0xa7000000 + 0x00000010)); }


x86 assembly (clang, -O0):
<harp_set_vpp_off>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0xa7000010,%esi
call   1030 <ctrl_outl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<harp_set_vpp_off>:
xor    %edi,%edi
mov    $0xa7000010,%esi
jmp    1030 <ctrl_outl@plt>

LLVM IR (-O0):
define void @harp_set_vpp_off() {
%1 = call i32 @ctrl_outl(i32 0, i32 -1493172208)
ret void
}

LLVM IR (-O2):
define void @harp_set_vpp_off() {
%1 = tail call i32 @ctrl_outl(i32 0, i32 -1493172208)
ret void
}
int __syscall5(int call, unsigned long arg0, unsigned long arg1,
               unsigned long arg2, unsigned long arg3, unsigned long arg4) {
  int rc;
  asm volatile(
      "movl %[call], %%eax	\n"
      "movl %[arg0], %%ebx	\n"
      "movl %[arg1], %%ecx	\n"
      "movl %[arg2], %%edx	\n"
      "movl %[arg3], %%edi	\n"
      "movl %[arg4], %%esi	\n"
      "int  %[xnum]		\n"
      "movl %%eax, %[rc]	\n"
      : [rc] "=g"(rc)
      : [call] "g"(call), [arg0] "g"(arg0), [arg1] "g"(arg1), [arg2] "g"(arg2),
        [arg3] "g"(arg3), [arg4] "g"(arg4), [xnum] "i"(0x80)
      : "%eax", "%ebx", "%ecx", "%edx", "%edi", "%esi", "memory");
  return rc;
}


x86 assembly (clang, -O0):
<__syscall5>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0xc(%rbp),%r8d
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %r8d,-0x40(%rbp)
mov    %rdi,-0x48(%rbp)
mov    %rsi,-0x50(%rbp)
mov    %rdx,-0x58(%rbp)
mov    %rcx,-0x60(%rbp)
mov    %rax,-0x68(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x48(%rbp),%ebx
mov    -0x50(%rbp),%ecx
mov    -0x58(%rbp),%edx
mov    -0x60(%rbp),%edi
mov    -0x68(%rbp),%esi
int    $0x80
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @__syscall5(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32
store i32 %0, i32* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%14 = load i32, i32* %7
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = load i64, i64* %10
%18 = load i64, i64* %11
%19 = load i64, i64* %12
%20 = load i32, i32* %13
ret i32 %20
}

LLVM IR (-O2):
void foo_2_2_2_1_2_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_2_2_2_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ contention_test(float);
float get_overhead();
int /*<<< orphan*/ pmcr_init();
int /*<<< orphan*/ printf(char *, float);
int main() {
  pmcr_init();
  float ccnt_overhead;
  ccnt_overhead = get_overhead();
  printf("Reading overhead time is : %f\n", ccnt_overhead);
  contention_test(ccnt_overhead);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <pmcr_init@plt>
mov    $0x0,%al
call   1040 <get_overhead@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
call   1050 <contention_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <pmcr_init@plt>
xor    %eax,%eax
call   1040 <get_overhead@plt>
movss  %xmm0,0x4(%rsp)
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
call   1050 <contention_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Reading overhead time is : %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (...) @pmcr_init()
%4 = call float (...) @get_overhead()
store float %4, float* %2
%5 = load float, float* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %5)
%7 = load float, float* %2
%8 = call i32 @contention_test(float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Reading overhead time is : %f\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @pmcr_init()
%2 = tail call float (...) @get_overhead()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %2)
%4 = tail call i32 @contention_test(float %2)
ret i32 0
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ printf(char *, char const *, char *, int);
char *strerror(int);
void print_errno(const char *prefix) {
  printf("%s: %s [errno=%d]\n", prefix, strerror(errno), errno);
}


x86 assembly (clang, -O0):
<print_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
mov    0x2e90(%rip),%rax
mov    (%rax),%ecx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_errno>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
call   1040 <strerror@plt>
mov    (%r14),%ecx
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s: %s [errno=%d]\0A\00"
@errno = global i32 0
define void @print_errno(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = load i32, i32* @errno
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s: %s [errno=%d]\0A\00"
@errno = global i32 0
define void @print_errno(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = load i32, i32* @errno
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ftrylockfile(FILE *fp) {
  (void)fp;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ftrylockfile(i32* nocapture readnone %0) {
ret i32 0
}
int XInitImage() {}


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

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

LLVM IR (-O0):
define i32 @XInitImage() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XInitImage() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int lenum() {
  int n;
  printf("Entre um numero: ");
  scanf("%d", &n);
  return n;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Entre um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @lenum() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"Entre um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @lenum() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
int ret_same(int v) { return v; }


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

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

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

LLVM IR (-O2):
define i32 @ret_same(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned long fgetc(int /*<<< orphan*/ *);
unsigned long readbe32(FILE *f) {
  unsigned long v;
  v = fgetc(f) << 24;
  v |= fgetc(f) << 16;
  v |= fgetc(f) << 8;
  v |= fgetc(f);
  return v;
}


x86 assembly (clang, -O0):
<readbe32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x18,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x10,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x8,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readbe32>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <fgetc@plt>
mov    %rax,%r15
shl    $0x18,%r15
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %rax,%rbx
shl    $0x10,%rbx
or     %r15,%rbx
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %rax,%r15
shl    $0x8,%r15
mov    %r14,%rdi
call   1030 <fgetc@plt>
or     %r15,%rax
or     %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @readbe32(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @fgetc(i32* %4)
%6 = shl i64 %5, 24
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = call i64 @fgetc(i32* %7)
%9 = shl i64 %8, 16
%10 = load i64, i64* %3
%11 = or i64 %10, %9
store i64 %11, i64* %3
%12 = load i32*, i32** %2
%13 = call i64 @fgetc(i32* %12)
%14 = shl i64 %13, 8
%15 = load i64, i64* %3
%16 = or i64 %15, %14
store i64 %16, i64* %3
%17 = load i32*, i32** %2
%18 = call i64 @fgetc(i32* %17)
%19 = load i64, i64* %3
%20 = or i64 %19, %18
store i64 %20, i64* %3
%21 = load i64, i64* %3
ret i64 %21
}

LLVM IR (-O2):
define i64 @readbe32(i32* nocapture %0) {
%2 = tail call i64 @fgetc(i32* %0)
%3 = shl i64 %2, 24
%4 = tail call i64 @fgetc(i32* %0)
%5 = shl i64 %4, 16
%6 = or i64 %5, %3
%7 = tail call i64 @fgetc(i32* %0)
%8 = shl i64 %7, 8
%9 = or i64 %6, %8
%10 = tail call i64 @fgetc(i32* %0)
%11 = or i64 %9, %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void version() {
  printf("'ga_reads_summit' in genome analysis tools version: %d.%d.%d\n", 1, 0,
         0);
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"'ga_reads_summit' in genome analysis tools version: %d.%d.%d\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [62 x i8] c"'ga_reads_summit' in genome analysis tools version: %d.%d.%d\0A\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct ServerEnv {
  int dummy;
};

/* Variables and functions */
int MonitorProcess(struct ServerEnv *);
int _MonitorProcess(void *pv) { return MonitorProcess((struct ServerEnv *)pv); }


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

x86 assembly (clang, -O2):
<_MonitorProcess>:
jmp    1030 <MonitorProcess@plt>

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

LLVM IR (-O2):
%struct.ServerEnv = type { i32 }
define i32 @_MonitorProcess(i8* %0) {
%2 = bitcast i8* %0 to %struct.ServerEnv*
%3 = tail call i32 @MonitorProcess(%struct.ServerEnv* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int dealloc_map(int **p_p_map, int rows) {
  int r;
  for (r = 0; r < rows; ++r) {
    free((void *)p_p_map[r]);
  }
  free((void *)p_p_map);
  return 0;
}


x86 assembly (clang, -O0):
<dealloc_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <dealloc_map+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dealloc_map+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dealloc_map>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <dealloc_map+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <dealloc_map+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @dealloc_map(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
%11 = tail call i32 @free(i8* %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = bitcast i32** %0 to i8*
%16 = tail call i32 @free(i8* %15)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rol8(uint8_t x, int r) { return (x << r) | (x >> (8 - r)); }


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

x86 assembly (clang, -O2):
<rol8>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    $0x8,%dl
sub    %cl,%dl
mov    %edx,%ecx
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol8(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 8, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol8(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 8, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void d59(char *p, int v) {
  int t = (v * 13) >> 7;
  *(short *)p = (short)(t + ((v - 10 * t) << 8) + 0x3030);
}


x86 assembly (clang, -O0):
<d59>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
imul   $0xd,-0xc(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   $0xa,-0x10(%rbp),%edx
sub    %edx,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
add    $0x3030,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d59>:
lea    (%rsi,%rsi,2),%eax
lea    (%rsi,%rax,4),%eax
sar    $0x7,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%esi
shl    $0x8,%esi
add    %esi,%eax
add    $0x3030,%eax
mov    %ax,(%rdi)
ret

LLVM IR (-O0):
define void @d59(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 13
%8 = ashr i32 %7, 7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = mul nsw i32 10, %11
%13 = sub nsw i32 %10, %12
%14 = shl i32 %13, 8
%15 = add nsw i32 %9, %14
%16 = add nsw i32 %15, 12336
%17 = trunc i32 %16 to i16
%18 = load i8*, i8** %3
%19 = bitcast i8* %18 to i16*
store i16 %17, i16* %19
ret void
}

LLVM IR (-O2):
define void @d59(i8* nocapture writeonly %0, i32 %1) {
%3 = mul nsw i32 %1, 13
%4 = ashr i32 %3, 7
%5 = mul nsw i32 %4, -10
%6 = add i32 %5, %1
%7 = shl i32 %6, 8
%8 = add nsw i32 %7, %4
%9 = trunc i32 %8 to i16
%10 = add i16 %9, 12336
%11 = bitcast i8* %0 to i16*
store i16 %10, i16* %11
ret void
}