xunge/DecIR huggingface dataset:
char encode(unsigned char u) {
  if (u < 26)
    return 'A' + u;
  if (u < 52)
    return 'a' + (u - 26);
  if (u < 62)
    return '0' + (u - 52);
  if (u == 62)
    return '+';
  return '/';
}


x86 assembly (clang, -O0):
<encode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x1a,%eax
jge    1126 <encode+0x26>
movzbl -0x2(%rbp),%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    117e <encode+0x7e>
movzbl -0x2(%rbp),%eax
cmp    $0x34,%eax
jge    1145 <encode+0x45>
movzbl -0x2(%rbp),%eax
sub    $0x1a,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    117e <encode+0x7e>
movzbl -0x2(%rbp),%eax
cmp    $0x3e,%eax
jge    1164 <encode+0x64>
movzbl -0x2(%rbp),%eax
sub    $0x34,%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    117e <encode+0x7e>
movzbl -0x2(%rbp),%eax
cmp    $0x3e,%eax
jne    117a <encode+0x7a>
movb   $0x2b,-0x1(%rbp)
jmp    117e <encode+0x7e>
movb   $0x2f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode>:
mov    %edi,%eax
cmp    $0x19,%al
ja     1109 <encode+0x9>
add    $0x41,%al
ret
cmp    $0x33,%al
ja     1110 <encode+0x10>
add    $0x47,%al
ret
cmp    $0x3d,%al
ja     1117 <encode+0x17>
add    $0xfc,%al
ret
cmp    $0x3e,%al
setne  %al
shl    $0x2,%al
or     $0x2b,%al
ret

LLVM IR (-O0):
define signext i8 @encode(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 26
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = add nsw i32 65, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %38
12: ; preds = %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp slt i32 %14, 52
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = sub nsw i32 %18, 26
%20 = add nsw i32 97, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %38
22: ; preds = %12
%23 = load i8, i8* %3
%24 = zext i8 %23 to i32
%25 = icmp slt i32 %24, 62
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = load i8, i8* %3
%28 = zext i8 %27 to i32
%29 = sub nsw i32 %28, 52
%30 = add nsw i32 48, %29
%31 = trunc i32 %30 to i8
store i8 %31, i8* %2
br label %38
32: ; preds = %22
%33 = load i8, i8* %3
%34 = zext i8 %33 to i32
%35 = icmp eq i32 %34, 62
br i1 %35, label %36, label %37
36: ; preds = %32
store i8 43, i8* %2
br label %38
37: ; preds = %32
store i8 47, i8* %2
br label %38
38: ; preds = %37, %36, %26, %16, %7
%39 = load i8, i8* %2
ret i8 %39
}

LLVM IR (-O2):
define signext i8 @encode(i8 zeroext %0) {
%2 = icmp ult i8 %0, 26
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nuw nsw i8 %0, 65
br label %16
5: ; preds = %1
%6 = icmp ult i8 %0, 52
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = add nuw nsw i8 %0, 71
br label %16
9: ; preds = %5
%10 = icmp ult i8 %0, 62
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = add nsw i8 %0, -4
br label %16
13: ; preds = %9
%14 = icmp eq i8 %0, 62
%15 = select i1 %14, i8 43, i8 47
br label %16
16: ; preds = %13, %11, %7, %3
%17 = phi i8 [ %4, %3 ], [ %8, %7 ], [ %12, %11 ], [ %15, %13 ]
ret i8 %17
}
/* Variables and functions */
int /*<<< orphan*/ lib_efi_runtime_close(int);
int /*<<< orphan*/ lib_unload_module();
void deinit_driver(int fd) {
  if (fd != -1)
    lib_efi_runtime_close(fd);
  lib_unload_module();
}


x86 assembly (clang, -O0):
<deinit_driver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     113d <deinit_driver+0x1d>
mov    -0x4(%rbp),%edi
call   1040 <lib_efi_runtime_close@plt>
mov    $0x0,%al
call   1030 <lib_unload_module@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deinit_driver>:
cmp    $0xffffffff,%edi
je     112f <deinit_driver+0xf>
push   %rax
call   1040 <lib_efi_runtime_close@plt>
add    $0x8,%rsp
xor    %eax,%eax
jmp    1030 <lib_unload_module@plt>

LLVM IR (-O0):
define void @deinit_driver(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @lib_efi_runtime_close(i32 %6)
br label %8
8: ; preds = %5, %1
%9 = call i32 (...) @lib_unload_module()
ret void
}

LLVM IR (-O2):
define void @deinit_driver(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @lib_efi_runtime_close(i32 %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 (...) @lib_unload_module()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __asm_utils_out8(int, int);
void pic_send_EOI_spurious(unsigned char irq) {
  if (irq == 15) {
    __asm_utils_out8(0x20, 0x20);
  }
}


x86 assembly (clang, -O0):
<pic_send_EOI_spurious>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xf,%eax
jne    1137 <pic_send_EOI_spurious+0x27>
mov    $0x20,%esi
mov    %esi,%edi
call   1030 <__asm_utils_out8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_send_EOI_spurious>:
cmp    $0xf,%dil
jne    1125 <pic_send_EOI_spurious+0x15>
mov    $0x20,%edi
mov    $0x20,%esi
jmp    1030 <__asm_utils_out8@plt>
ret

LLVM IR (-O0):
define void @pic_send_EOI_spurious(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 15
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @__asm_utils_out8(i32 32, i32 32)
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @pic_send_EOI_spurious(i8 zeroext %0) {
%2 = icmp eq i8 %0, 15
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @__asm_utils_out8(i32 32, i32 32)
br label %5
5: ; preds = %3, %1
ret void
}
int emac2_aframestransmittedok_set(unsigned int dev_id,
                                   union emac2_aframestransmittedok_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac2_aframestransmittedok_u = type opaque
define i32 @emac2_aframestransmittedok_set(i32 %0, %union.emac2_aframestransmittedok_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_aframestransmittedok_u*
store i32 %0, i32* %3
store %union.emac2_aframestransmittedok_u* %1, %union.emac2_aframestransmittedok_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_aframestransmittedok_u = type opaque
define i32 @emac2_aframestransmittedok_set(i32 %0, %union.emac2_aframestransmittedok_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
long reverse(long);
bool palindrome(long n) { return n == reverse(n); }


x86 assembly (clang, -O0):
<palindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<palindrome>:
push   %rbx
mov    %rdi,%rbx
call   1030 <reverse@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @palindrome(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @reverse(i64 %4)
%6 = icmp eq i64 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @palindrome(i64 %0) {
%2 = tail call i64 @reverse(i64 %0)
%3 = icmp eq i64 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_3Aint16_reg(short val) {
  return ((val) & (-0x3A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Aint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffc6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Aint16_reg>:
test   $0xffc6,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Aint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -58
%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_3Aint16_reg(i16 signext %0) {
%2 = and i16 %0, -58
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo305(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo305(i32 %0) {
ret void
}
int test_imm_05int64_midword_reg(long long val) {
  return ((val >> 16) & (0x05 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_05int64_midword_reg>:
test   $0x50000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_05int64_midword_reg(i64 %0) {
%2 = and i64 %0, 327680
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_86uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x86 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_86uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 134
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int rx(int r, int y, int x) {
  int n;
  n = (r % 2 ? y : x);
  if (r / 2)
    n = 2 - n;
  if (n < 0)
    n = 3;
  return n;
}


x86 assembly (clang, -O0):
<rx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     112c <rx+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <rx+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     1157 <rx+0x57>
mov    $0x2,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1168 <rx+0x68>
movl   $0x3,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rx>:
test   $0x1,%dil
cmove  %edx,%esi
add    $0x1,%edi
mov    $0x2,%ecx
sub    %esi,%ecx
cmp    $0x3,%edi
cmovb  %esi,%ecx
test   %ecx,%ecx
mov    $0x3,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @rx(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 = srem i32 %8, 2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %5
br label %15
13: ; preds = %3
%14 = load i32, i32* %6
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
store i32 %16, i32* %7
%17 = load i32, i32* %4
%18 = sdiv i32 %17, 2
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32, i32* %7
%22 = sub nsw i32 2, %21
store i32 %22, i32* %7
br label %23
23: ; preds = %20, %15
%24 = load i32, i32* %7
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 3, i32* %7
br label %27
27: ; preds = %26, %23
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @rx(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 %2, i32 %1
%7 = add i32 %0, 1
%8 = icmp ult i32 %7, 3
%9 = sub nsw i32 2, %6
%10 = select i1 %8, i32 %6, i32 %9
%11 = icmp slt i32 %10, 0
%12 = select i1 %11, i32 3, i32 %10
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ distance_squared_s(float const, float const, float const,
                                      float const);
float sqrtf(int /*<<< orphan*/);
float __attribute__((__always___, __gnu___, __flatten__, __const__,
                     __artificial__))
distance_s(const float vx, const float vy, const float wx, const float wy) {
  return sqrtf(distance_squared_s(vx, vy, wx, wy));
}


x86 assembly (clang, -O0):
<distance_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <distance_squared_s@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_s>:
push   %rax
call   1030 <distance_squared_s@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrtf@plt>

LLVM IR (-O0):
define float @distance_s(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
%13 = call i32 @distance_squared_s(float %9, float %10, float %11, float %12)
%14 = call float @sqrtf(i32 %13)
ret float %14
}

LLVM IR (-O2):
define float @distance_s(float %0, float %1, float %2, float %3) {
%5 = tail call i32 @distance_squared_s(float %0, float %1, float %2, float %3)
%6 = tail call float @sqrtf(i32 %5)
ret float %6
}
/* Variables and functions */
double nan(char *);
__attribute__((visibility("default"))) double trio_nan(void) {
  static double nan_value = 0.0;
  if (nan_value == 0.0) {
    nan_value = nan("");
  }
  return nan_value;
}


x86 assembly (clang, -O0):
<trio_nan>:
push   %rbp
mov    %rsp,%rbp
movsd  0x2f14(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1143 <trio_nan+0x33>
jp     1143 <trio_nan+0x33>
lea    0xeca(%rip),%rdi
call   1030 <nan@plt>
movsd  %xmm0,0x2eed(%rip)
movsd  0x2ee5(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_nan>:
push   %rax
movsd  0x2f17(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1139 <trio_nan+0x29>
jp     1139 <trio_nan+0x29>
lea    0xed4(%rip),%rdi
call   1030 <nan@plt>
movsd  %xmm0,0x2ef7(%rip)
pop    %rax
ret

LLVM IR (-O0):
@trio_nan.nan_value = internal global double 0.000000e+00
@.str = [1 x i8] zeroinitializer
define double @trio_nan() {
%1 = load double, double* @trio_nan.nan_value
%2 = fcmp oeq double %1, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call double @nan(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store double %4, double* @trio_nan.nan_value
br label %5
5: ; preds = %3, %0
%6 = load double, double* @trio_nan.nan_value
ret double %6
}

LLVM IR (-O2):
@trio_nan.nan_value = internal unnamed_addr global double 0.000000e+00
@.str = [1 x i8] zeroinitializer
define double @trio_nan() {
%1 = load double, double* @trio_nan.nan_value
%2 = fcmp oeq double %1, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call double @nan(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store double %4, double* @trio_nan.nan_value
br label %5
5: ; preds = %3, %0
%6 = phi double [ %4, %3 ], [ %1, %0 ]
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ get_clock_ext(unsigned char *);
unsigned long long get_clock_xt(void) {
  unsigned char clk[16];
  get_clock_ext(clk);
  return *((unsigned long long *)&clk[1]);
}


x86 assembly (clang, -O0):
<get_clock_xt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <get_clock_ext@plt>
mov    -0xf(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_clock_xt>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <get_clock_ext@plt>
mov    0x1(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @get_clock_xt() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_clock_ext(i8* %2)
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 1
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_clock_xt() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_clock_ext(i8* %2)
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 1
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}
/* Variables and functions */
unsigned int shortHash(unsigned int);
unsigned int functionHashInt(unsigned int x) {
  x = ((x >> 16) ^ x) * 0x3335b369;
  x = ((x >> 16) ^ x) * 0x3335b369;
  x = ((x >> 16) ^ x);
  return shortHash(x);
}


x86 assembly (clang, -O0):
<functionHashInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
imul   $0x3335b369,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
imul   $0x3335b369,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <shortHash@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<functionHashInt>:
mov    %edi,%eax
shr    $0x10,%eax
xor    %edi,%eax
imul   $0x3335b369,%eax,%eax
mov    %eax,%ecx
shr    $0x10,%ecx
xor    %eax,%ecx
imul   $0x3335b369,%ecx,%eax
mov    %eax,%edi
shr    $0x10,%edi
xor    %eax,%edi
jmp    1030 <shortHash@plt>

LLVM IR (-O0):
define i32 @functionHashInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %4, %5
%7 = mul i32 %6, 859157353
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = lshr i32 %8, 16
%10 = load i32, i32* %2
%11 = xor i32 %9, %10
%12 = mul i32 %11, 859157353
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 16
%15 = load i32, i32* %2
%16 = xor i32 %14, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = call i32 @shortHash(i32 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @functionHashInt(i32 %0) {
%2 = lshr i32 %0, 16
%3 = xor i32 %2, %0
%4 = mul i32 %3, 859157353
%5 = lshr i32 %4, 16
%6 = xor i32 %5, %4
%7 = mul i32 %6, 859157353
%8 = lshr i32 %7, 16
%9 = xor i32 %8, %7
%10 = tail call i32 @shortHash(i32 %9)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Error(char *prog_name) {
  fprintf(stderr, "##### input violation. #######\n");
  fprintf(stderr, "Run: ./getinput <#threads> <#elements> [g] [o]\n");
}


x86 assembly (clang, -O0):
<Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Error>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef1(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"##### input violation. #######\0A\00"
@.str.1 = [48 x i8] c"Run: ./getinput <#threads> <#elements> [g] [o]\0A\00"
define void @Error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"##### input violation. #######\0A\00"
@.str.1 = [48 x i8] c"Run: ./getinput <#threads> <#elements> [g] [o]\0A\00"
define void @Error(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void TransformAlarmC__2__Counter__overflow(void) {}


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

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

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

LLVM IR (-O2):
define void @TransformAlarmC__2__Counter__overflow() {
ret void
}
void pcp_def_pwr_in_metrics(struct activity *a) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_def_pwr_in_metrics(%struct.activity* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matNd_identity(double *, int);
void mat4d_identity(double m[16]) { matNd_identity(m, 4); }


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

x86 assembly (clang, -O2):
<mat4d_identity>:
mov    $0x4,%esi
jmp    1030 <matNd_identity@plt>

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

LLVM IR (-O2):
define void @mat4d_identity(double* %0) {
%2 = tail call i32 @matNd_identity(double* %0, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matrix_get_scale(float *, float const, float const,
                                    float const);
int /*<<< orphan*/ matrix_multiply(float *, float *);
float *matrix_scale(float matrix[4 * 4], const float x, const float y,
                    const float z) {
  float matrix_tmp[4 * 4];
  matrix_get_scale(matrix_tmp, x, y, z);
  matrix_multiply(matrix, matrix_tmp);
  return matrix;
}


x86 assembly (clang, -O0):
<matrix_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <matrix_get_scale@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <matrix_multiply@plt>
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_scale>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <matrix_get_scale@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <matrix_multiply@plt>
mov    %rbx,%rax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float* @matrix_scale(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca [16 x float]
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%11 = load float, float* %6
%12 = load float, float* %7
%13 = load float, float* %8
%14 = call i32 @matrix_get_scale(float* %10, float %11, float %12, float %13)
%15 = load float*, float** %5
%16 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%17 = call i32 @matrix_multiply(float* %15, float* %16)
%18 = load float*, float** %5
ret float* %18
}

LLVM IR (-O2):
define float* @matrix_scale(float* returned %0, float %1, float %2, float %3) {
%5 = alloca [16 x float]
%6 = bitcast [16 x float]* %5 to i8*
%7 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%8 = call i32 @matrix_get_scale(float* %7, float %1, float %2, float %3)
%9 = call i32 @matrix_multiply(float* %0, float* %7)
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
extern void quit_handler(int signum) {
  printf("Received signal %d .. waiting\n", signum);
  sleep(3);
  printf("Leaving quit_handler\n");
}


x86 assembly (clang, -O0):
<quit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quit_handler>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Received signal %d .. waiting\0A\00"
@.str.1 = [22 x i8] c"Leaving quit_handler\0A\00"
define void @quit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 3)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Received signal %d .. waiting\0A\00"
@str = [21 x i8] c"Leaving quit_handler\00"
define void @quit_handler(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 3)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ alloca(int);
void *test6a(char *);
void __attribute__((no)) __attribute__((noclone)) * test6(void) {
  char *save = (char *)alloca(4);
  return test6a(save);
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <test6a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6>:
push   %rax
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <test6a@plt>

LLVM IR (-O0):
define i8* @test6() {
%1 = alloca i8*
%2 = call i64 @alloca(i32 4)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @test6a(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @test6() {
%1 = tail call i64 @alloca(i32 4)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i8* @test6a(i8* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("In C, lowercase letters are significant.\n");
  printf("main is where program execution begins.\n");
  printf(
      "Opening and closing braces enclose program statements in a rooutine\n");
  printf("All program statements must be terminated by a semcilon.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"In C, lowercase letters are significant.\0A\00"
@.str.1 = [41 x i8] c"main is where program execution begins.\0A\00"
@.str.2 = [69 x i8] c"Opening and closing braces enclose program statements in a rooutine\0A\00"
@.str.3 = [58 x i8] c"All program statements must be terminated by a semcilon.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [41 x i8] c"In C, lowercase letters are significant.\00"
@str.4 = [40 x i8] c"main is where program execution begins.\00"
@str.5 = [68 x i8] c"Opening and closing braces enclose program statements in a rooutine\00"
@str.6 = [57 x i8] c"All program statements must be terminated by a semcilon.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
extern int _close(int file_UNUSED __attribute__((__unused__))) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ parser();
int /*<<< orphan*/ printf(char *);
void main() {
  printf("\nWelcome to MINIREL\n\n");
  parser();
  printf("\nGoodBye from MINIREL\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <parser@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <parser@plt>
lea    0xeda(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\0AWelcome to MINIREL\0A\0A\00"
@.str.1 = [24 x i8] c"\0AGoodBye from MINIREL\0A\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @parser()
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"\0AWelcome to MINIREL\0A\00"
@str.2 = [23 x i8] c"\0AGoodBye from MINIREL\0A\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @parser()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
uintptr_t LOG2_DOWN(uintptr_t);
uintptr_t LOG2_UP(uintptr_t value) {
  uintptr_t _v = LOG2_DOWN(value);
  if (value ^ (1 << _v))
    return _v + 1;
  else
    return _v;
}


x86 assembly (clang, -O0):
<LOG2_UP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <LOG2_DOWN@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
xor    %rcx,%rax
cmp    $0x0,%rax
je     115b <LOG2_UP+0x4b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <LOG2_UP+0x53>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOG2_UP>:
push   %rbx
mov    %rdi,%rbx
call   1030 <LOG2_DOWN@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
movslq %edx,%rcx
xor    %edx,%edx
cmp    %rbx,%rcx
setne  %dl
add    %rdx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @LOG2_UP(i64 %0) {
%2 = tail call i64 @LOG2_DOWN(i64 %0)
%3 = trunc i64 %2 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = icmp ne i64 %5, %0
%7 = zext i1 %6 to i64
%8 = add i64 %2, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ after_sleep();
int /*<<< orphan*/ sleep(int);
int main(void) {
  sleep(3);
  after_sleep();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
call   1030 <after_sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 3)
%2 = tail call i32 (...) @after_sleep()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void grt_stack_error_memory_access(void) { abort(); }


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

x86 assembly (clang, -O2):
<grt_stack_error_memory_access>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @grt_stack_error_memory_access() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @grt_stack_error_memory_access() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
void to_string_buf(unsigned int value, char *tmp) { sprintf(tmp, "%d", value); }


x86 assembly (clang, -O0):
<to_string_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_string_buf>:
mov    %rsi,%rax
mov    %edi,%edx
lea    0xee4(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @to_string_buf(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int main() {
  unsigned int x;
  signed int y;
  unsigned char q;
  char m;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int djb2(char *);
int /*<<< orphan*/ free(char *);
int getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ stdin;
int main() {
  char s[] = "a14bceg";
  char *temp = NULL;
  int read;
  size_t len;
  read = getline(&temp, &len, stdin);
  free(temp);
  printf("hash(%s) = %u\n", s, djb2(s));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1060 <getline@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <djb2@plt>
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x67656362343161,%rax
mov    %rax,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1060 <getline@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <djb2@plt>
lea    0xe6d(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [8 x i8] c"a14bceg\00"
@stdin = global i32 0
@.str = [15 x i8] c"hash(%s) = %u\0A\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
%5 = bitcast [8 x i8]* %1 to i8*
store i8* null, i8** %2
%6 = load i32, i32* @stdin
%7 = call i32 @getline(i8** %2, i64* %4, i32 %6)
store i32 %7, i32* %3
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%12 = call i32 @djb2(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [15 x i8] c"hash(%s) = %u\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i8*
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
store i64 29103400124952929, i64* %1
%5 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%6 = bitcast i64* %3 to i8*
%7 = load i32, i32* @stdin
%8 = call i32 @getline(i8** %2, i64* %3, i32 %7)
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
%11 = call i32 @djb2(i8* %4)
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %11)
ret i32 0
}
/* Variables and functions */
int sem_create(int);
int /*<<< orphan*/ sem_d(int);
int /*<<< orphan*/ sleep(int);
int main(void) {
  int semid;
  semid = sem_create(1234);
  sleep(5);
  sem_d(semid);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4d2,%edi
call   1030 <sem_create@plt>
mov    %eax,-0x8(%rbp)
mov    $0x5,%edi
call   1050 <sleep@plt>
mov    -0x8(%rbp),%edi
call   1040 <sem_d@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4d2,%edi
call   1030 <sem_create@plt>
mov    %eax,%ebx
mov    $0x5,%edi
call   1050 <sleep@plt>
mov    %ebx,%edi
call   1040 <sem_d@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sem_create(i32 1234)
store i32 %3, i32* %2
%4 = call i32 @sleep(i32 5)
%5 = load i32, i32* %2
%6 = call i32 @sem_d(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sem_create(i32 1234)
%2 = tail call i32 @sleep(i32 5)
%3 = tail call i32 @sem_d(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ core6_print(char *, char const *);
void U_EMRPOLYBEZIERTO16_print(const char *contents) {
  core6_print("U_EMRPOLYBEZIERTO16", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYBEZIERTO16_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <core6_print@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"U_EMRPOLYBEZIERTO16\00"
define void @U_EMRPOLYBEZIERTO16_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core6_print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"U_EMRPOLYBEZIERTO16\00"
define void @U_EMRPOLYBEZIERTO16_print(i8* %0) {
%2 = tail call i32 @core6_print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a_loop(int *, int);
void a_function_call() {
  int arr[3];
  a_loop(arr, 3);
}


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

x86 assembly (clang, -O2):
<a_function_call>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rdi
mov    $0x3,%esi
call   1030 <a_loop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @a_function_call() {
%1 = alloca [3 x i32]
%2 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%3 = call i32 @a_loop(i32* %2, i32 3)
ret void
}

LLVM IR (-O2):
define void @a_function_call() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @a_loop(i32* %3, i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t elf_segbase(int32_t segment) { return segment; }


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

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

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

LLVM IR (-O2):
define i32 @elf_segbase(i32 returned %0) {
ret i32 %0
}
void dump_queues() {}


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

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

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

LLVM IR (-O2):
define void @dump_queues() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_help(void) {
  puts("Usage: seqc [-dhvp] [-o output] file1 ...\n"
       "Arguments:\n"
       "-d \tDiff DNA sequences.\n"
       "-h \tShow this message\n"
       "-v \tPrint version info.\n"
       "-p \tConvert to protein.\n"
       "-s \tGet DNA statistics.\n");
}


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

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

LLVM IR (-O0):
@.str = [172 x i8] c"Usage: seqc [-dhvp] [-o output] file1 ...\0AArguments:\0A-d \09Diff DNA sequences.\0A-h \09Show this message\0A-v \09Print version info.\0A-p \09Convert to protein.\0A-s \09Get DNA statistics.\0A\00"
define void @print_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [172 x i8] c"Usage: seqc [-dhvp] [-o output] file1 ...\0AArguments:\0A-d \09Diff DNA sequences.\0A-h \09Show this message\0A-v \09Print version info.\0A-p \09Convert to protein.\0A-s \09Get DNA statistics.\0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UpdateGameControlValues();
void UpdateGameDoorValues() { UpdateGameControlValues(); }


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

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

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

LLVM IR (-O2):
define void @UpdateGameDoorValues() {
%1 = tail call i32 (...) @UpdateGameControlValues()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void afree(void *data, void *unused) { free(data); }


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

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

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

LLVM IR (-O2):
define void @afree(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
long long fll(long long a, long long b) {
  a = (a & ~(0xffffffffull << 32)) | ((b << 32) & (0xffffffffull << 32));
  return a;
}


x86 assembly (clang, -O0):
<fll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0xffffffff,%rax
and    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x20,%rcx
movabs $0xffffffff00000000,%rdx
ff ff ff
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fll>:
mov    %edi,%eax
shl    $0x20,%rsi
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @fll(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = and i64 %5, 4294967295
%7 = load i64, i64* %4
%8 = shl i64 %7, 32
%9 = and i64 %8, -4294967296
%10 = or i64 %6, %9
store i64 %10, i64* %3
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
define i64 @fll(i64 %0, i64 %1) {
%3 = and i64 %0, 4294967295
%4 = shl i64 %1, 32
%5 = or i64 %4, %3
ret i64 %5
}