xunge/DecIR huggingface dataset:
void mod_follow_is_dlclose_safe() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ide_control(struct ide_drive *, int /*<<< orphan*/);
void ide_enable_interrupt(struct ide_drive *drive) { ide_control(drive, 0); }


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

x86 assembly (clang, -O2):
<ide_enable_interrupt>:
xor    %esi,%esi
jmp    1030 <ide_control@plt>

LLVM IR (-O0):
%struct.ide_drive = type { i32 }
define void @ide_enable_interrupt(%struct.ide_drive* %0) {
%2 = alloca %struct.ide_drive*
store %struct.ide_drive* %0, %struct.ide_drive** %2
%3 = load %struct.ide_drive*, %struct.ide_drive** %2
%4 = call i32 @ide_control(%struct.ide_drive* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ide_drive = type { i32 }
define void @ide_enable_interrupt(%struct.ide_drive* %0) {
%2 = tail call i32 @ide_control(%struct.ide_drive* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_cmd_pref_file_hack(int);
void visuals_pref_load(void *unused, const char *title) {
  do_cmd_pref_file_hack(15);
}


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

x86 assembly (clang, -O2):
<visuals_pref_load>:
mov    $0xf,%edi
jmp    1030 <do_cmd_pref_file_hack@plt>

LLVM IR (-O0):
define void @visuals_pref_load(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @do_cmd_pref_file_hack(i32 15)
ret void
}

LLVM IR (-O2):
define void @visuals_pref_load(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @do_cmd_pref_file_hack(i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_UNPACK_ALIGNMENT;
int /*<<< orphan*/ glPixelStorei(int /*<<< orphan*/, int);
void init(void) { glPixelStorei(GL_UNPACK_ALIGNMENT, 1); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <glPixelStorei@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
jmp    1030 <glPixelStorei@plt>

LLVM IR (-O0):
@GL_UNPACK_ALIGNMENT = global i32 0
define void @init() {
%1 = load i32, i32* @GL_UNPACK_ALIGNMENT
%2 = call i32 @glPixelStorei(i32 %1, i32 1)
ret void
}

LLVM IR (-O2):
@GL_UNPACK_ALIGNMENT = global i32 0
define void @init() {
%1 = load i32, i32* @GL_UNPACK_ALIGNMENT
%2 = tail call i32 @glPixelStorei(i32 %1, i32 1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
scalar_t__ memcmp(int *, char *, int);
uint8_t realtec_detect(uint8_t *rom, uint32_t rom_size) {
  if (rom_size != 512 * 1024) {
    return 0;
  }
  return memcmp(rom + 0x7E100, "SEGA", 4) == 0;
}


x86 assembly (clang, -O0):
<realtec_detect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x80000,-0x14(%rbp)
je     1138 <realtec_detect+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1163 <realtec_detect+0x53>
mov    -0x10(%rbp),%rdi
add    $0x1f8400,%rdi
lea    0xeb6(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realtec_detect>:
xor    %eax,%eax
cmp    $0x80000,%esi
jne    1142 <realtec_detect+0x32>
push   %rax
add    $0x1f8400,%rdi
lea    0xed7(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"SEGA\00"
define i32 @realtec_detect(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 524288
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %15
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 516352
%12 = call i64 @memcmp(i32* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
store i32 %14, i32* %3
br label %15
15: ; preds = %9, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"SEGA\00"
define i32 @realtec_detect(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 524288
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i32, i32* %0, i64 516352
%6 = tail call i64 @memcmp(i32* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 0, %2 ]
ret i32 %10
}
float cubicEaseOutf(float p) {
  float f = (p - 1);
  return f * f * f + 1;
}


x86 assembly (clang, -O0):
<cubicEaseOutf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xec6(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubicEaseOutf>:
addss  0xef8(%rip),%xmm0
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
addss  0xee9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @cubicEaseOutf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fsub float %4, 1.000000e+00
store float %5, float* %3
%6 = load float, float* %3
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = load float, float* %3
%10 = call float @llvm.fmuladd.f32(float %8, float %9, float 1.000000e+00)
ret float %10
}

LLVM IR (-O2):
define float @cubicEaseOutf(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fmul float %2, %2
%4 = tail call float @llvm.fmuladd.f32(float %3, float %2, float 1.000000e+00)
ret float %4
}
void SysCtlBackupAccessEnable(void) {
  (*((volatile unsigned long *)(0x40007000))) |= 0x00000100;
}


x86 assembly (clang, -O0):
<SysCtlBackupAccessEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40007000,%eax
mov    (%rax),%rcx
or     $0x100,%rcx
mov    $0x40007000,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlBackupAccessEnable>:
orq    $0x100,0x40007000
ret

LLVM IR (-O0):
define void @SysCtlBackupAccessEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1073770496 to i64*)
%2 = or i64 %1, 256
store volatile i64 %2, i64* inttoptr (i64 1073770496 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlBackupAccessEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1073770496 to i64*)
%2 = or i64 %1, 256
store volatile i64 %2, i64* inttoptr (i64 1073770496 to i64*)
ret void
}
int readBss(int i) {
  static int bss[1 << 20];
  return bss[i];
}


x86 assembly (clang, -O0):
<readBss>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f1e(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@readBss.bss = internal global [1048576 x i32] zeroinitializer
define i32 @readBss(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [1048576 x i32], [1048576 x i32]* @readBss.bss, i64 0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @readBss(i32 %0) {
ret i32 0
}
void testDeviceDriver() {}


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

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

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

LLVM IR (-O2):
define void @testDeviceDriver() {
ret void
}
/* Variables and functions */
int mseconds();
int seconds(void) { return (mseconds() / 1000); }


x86 assembly (clang, -O0):
<seconds>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mseconds@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds>:
push   %rax
xor    %eax,%eax
call   1030 <mseconds@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @seconds() {
%1 = call i32 (...) @mseconds()
%2 = sdiv i32 %1, 1000
ret i32 %2
}

LLVM IR (-O2):
define i32 @seconds() {
%1 = tail call i32 (...) @mseconds()
%2 = sdiv i32 %1, 1000
ret i32 %2
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
main(void) {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @putchar(i32 %8)
br label %3
10: ; preds = %3
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int memcmp(void const *, void const *, size_t);
int bcmp(const void *m1, const void *m2, size_t n) { return memcmp(m1, m2, n); }


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

x86 assembly (clang, -O2):
<bcmp>:
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @bcmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void printlnUInt(unsigned int data) { printf("%u\n", data); }


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

x86 assembly (clang, -O2):
<printlnUInt>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define void @printlnUInt(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_addc_direct(char *str, uint8_t direct) {
  sprintf(str,
          "ADDC  A, "
          "0x%02X"
          "                   ",
          direct);
}


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

x86 assembly (clang, -O2):
<sprint_addc_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ADDC A, 0x%02X \00"
define void @sprint_addc_direct(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 @sprintf(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ADDC A, 0x%02X \00"
define void @sprint_addc_direct(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void __ipipe_report_setaffinity(struct task_struct *p, int dest_cpu) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @__ipipe_report_setaffinity(%struct.task_struct* nocapture %0, i32 %1) {
ret void
}
unsigned int pow2ceil(unsigned int x) {
  x -= 1;
  x = x | (x >> 1);
  x = x | (x >> 2);
  x = x | (x >> 4);
  x = x | (x >> 8);
  x = x | (x >> 16);
  return x + 1;
}


x86 assembly (clang, -O0):
<pow2ceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2ceil>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @pow2ceil(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = or i32 %5, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = or i32 %9, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = load i32, i32* %2
%15 = lshr i32 %14, 4
%16 = or i32 %13, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = load i32, i32* %2
%19 = lshr i32 %18, 8
%20 = or i32 %17, %19
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = load i32, i32* %2
%23 = lshr i32 %22, 16
%24 = or i32 %21, %23
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
ret i32 %26
}

LLVM IR (-O2):
define i32 @pow2ceil(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ _PAXICO_check_leaks();
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main() {
  char *str;
  str = (char *)malloc(20);
  free(str);
  return !(_PAXICO_check_leaks());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1050 <_PAXICO_check_leaks@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1050 <_PAXICO_check_leaks@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 20)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
%7 = call i32 (...) @_PAXICO_check_leaks()
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 20)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @free(i8* %2)
%4 = tail call i32 (...) @_PAXICO_check_leaks()
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int select(int x, int y) {
  int r = x < y ? 3 : 7;
  return r;
}


x86 assembly (clang, -O0):
<select>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
mov    $0x7,%eax
mov    $0x3,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<select>:
xor    %eax,%eax
cmp    %esi,%edi
setge  %al
lea    0x3(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @select(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 3, i32 7
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @select(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 3, i32 7
ret i32 %4
}
int test_imm_D6int64_midword_reg(long long val) {
  return ((val >> 16) & (0xD6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D6int64_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, 214
%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_D6int64_midword_reg(i64 %0) {
%2 = and i64 %0, 14024704
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned getval_155() { return 3385115273U; }


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

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

LLVM IR (-O0):
define i32 @getval_155() {
ret i32 -909852023
}

LLVM IR (-O2):
define i32 @getval_155() {
ret i32 -909852023
}
/* Variables and functions */
double tan(double);
double Dtan(double x) { return tan(x); }


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

x86 assembly (clang, -O2):
<Dtan>:
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define double @Dtan(double %0) {
%2 = tail call double @tan(double %0)
ret double %2
}
void jmp_m64abs(unsigned long long *m64) {
  if ((long)m64 & 0xFFFFFFFF80000000LL) {
    printf("Error: destination %lx not in lower 2GB for jmp_m64abs()\n",
           (long)m64);
    asm(" int $3; ");
  }
  put8(0xFF);
  put8(0x24);
  put8(0x25);
  put32((int)(unsigned long)m64);
}


x86 assembly (clang, -O0):
<jmp_m64abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffffff80000000,%rax
cmp    $0x0,%rax
je     1163 <jmp_m64abs+0x33>
mov    -0x8(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
int3
mov    $0xff,%edi
mov    $0x0,%al
call   1030 <put8@plt>
mov    $0x24,%edi
mov    $0x0,%al
call   1030 <put8@plt>
mov    $0x25,%edi
mov    $0x0,%al
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    $0x0,%al
call   1050 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jmp_m64abs>:
push   %rbx
mov    %rdi,%rbx
test   $0xffffffff80000000,%rdi
je     114f <jmp_m64abs+0x1f>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
int3
mov    $0xff,%edi
xor    %eax,%eax
call   1030 <put8@plt>
mov    $0x24,%edi
xor    %eax,%eax
call   1030 <put8@plt>
mov    $0x25,%edi
xor    %eax,%eax
call   1030 <put8@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1050 <put32@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"Error: destination %lx not in lower 2GB for jmp_m64abs()\0A\00"
define void @jmp_m64abs(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = ptrtoint i64* %3 to i64
%5 = and i64 %4, -2147483648
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64*, i64** %2
%9 = ptrtoint i64* %8 to i64
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %7, %1
%12 = call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 255)
%13 = call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 36)
%14 = call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 37)
%15 = load i64*, i64** %2
%16 = ptrtoint i64* %15 to i64
%17 = trunc i64 %16 to i32
%18 = call i32 (i32, ...) bitcast (i32 (...)* @put32 to i32 (i32, ...)*)(i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"Error: destination %lx not in lower 2GB for jmp_m64abs()\0A\00"
define void @jmp_m64abs(i64* %0) {
%2 = ptrtoint i64* %0 to i64
%3 = icmp ult i64* %0, inttoptr (i64 2147483648 to i64*)
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i64 %2)
tail call void asm sideeffect " int $$3; ", "~{dirflag},~{fpsr},~{flags}"()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 255)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 36)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 37)
%10 = trunc i64 %2 to i32
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @put32 to i32 (i32, ...)*)(i32 %10)
ret void
}
int av_mute(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @av_mute() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void function2(void) { printf("libtest1: I am function2!\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"libtest1: I am function2!\0A\00"
define void @function2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"libtest1: I am function2!\00"
define void @function2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myclock();
int /*<<< orphan*/ usleep(int);
int main(int argc, char **argv __attribute__((unused))) {
  if (argc > 1)
    return 1;
  while (1) {
    myclock();
    usleep(1000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114b <main+0x2b>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1150 <main+0x30>
mov    $0x0,%al
call   1030 <myclock@plt>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
jmp    1150 <main+0x30>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1130 <main+0x10>
mov    $0x1,%eax
pop    %rcx
ret
nopl   (%rax)
xor    %eax,%eax
call   1030 <myclock@plt>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
ret i32 1
9: ; preds = %2
br label %10
10: ; preds = %9, %10
%11 = call i32 (...) @myclock()
%12 = call i32 @usleep(i32 1000)
br label %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %5
4: ; preds = %2
ret i32 1
5: ; preds = %2, %5
%6 = tail call i32 (...) @myclock()
%7 = tail call i32 @usleep(i32 1000)
br label %5
}
int sq(int a) {
  int i;
  for (i = 1; i * i < a; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<sq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1131 <sq+0x31>
jmp    1123 <sq+0x23>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <sq+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sq>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%eax
mov    %eax,%ecx
imul   %eax,%ecx
cmp    %edi,%ecx
jl     1110 <sq+0x10>
ret

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

LLVM IR (-O2):
define i32 @sq(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = mul nsw i32 %3, %3
%5 = icmp slt i32 %4, %0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
/* Type definitions */
struct nlmsg {
  int dummy;
};

/* Variables and functions */
int nla_put(struct nlmsg *, int, unsigned short *, int);
extern int nla_put_u16(struct nlmsg *nlmsg, int attr, unsigned short value) {
  return nla_put(nlmsg, attr, &value, 2);
}


x86 assembly (clang, -O0):
<nla_put_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0xe(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <nla_put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_put_u16>:
push   %rax
mov    %dx,0x6(%rsp)
lea    0x6(%rsp),%rdx
mov    $0x2,%ecx
call   1030 <nla_put@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlmsg = type { i32 }
define i32 @nla_put_u16(%struct.nlmsg* %0, i32 %1, i16 zeroext %2) {
%4 = alloca %struct.nlmsg*
%5 = alloca i32
%6 = alloca i16
store %struct.nlmsg* %0, %struct.nlmsg** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load %struct.nlmsg*, %struct.nlmsg** %4
%8 = load i32, i32* %5
%9 = call i32 @nla_put(%struct.nlmsg* %7, i32 %8, i16* %6, i32 2)
ret i32 %9
}

LLVM IR (-O2):
%struct.nlmsg = type { i32 }
define i32 @nla_put_u16(%struct.nlmsg* %0, i32 %1, i16 zeroext %2) {
%4 = alloca i16
store i16 %2, i16* %4
%5 = call i32 @nla_put(%struct.nlmsg* %0, i32 %1, i16* %4, i32 2)
ret i32 %5
}
/* Variables and functions */
int _pb_print_bits(char *, int);
int _pb_print_bits_c(char value) {
  return _pb_print_bits(&value, sizeof(char));
  ;
}


x86 assembly (clang, -O0):
<_pb_print_bits_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <_pb_print_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pb_print_bits_c>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <_pb_print_bits@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_pb_print_bits_c(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @_pb_print_bits(i8* %2, i32 1)
ret i32 %3
}

LLVM IR (-O2):
define i32 @_pb_print_bits_c(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @_pb_print_bits(i8* %2, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void HTMemory_outofmem(const char *name, const char *file, unsigned long line) {

  ;
  abort();
}


x86 assembly (clang, -O0):
<HTMemory_outofmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define void @HTMemory_outofmem(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @HTMemory_outofmem(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 (...) @abort()
unreachable
}
int compear_scores_desc(const void *score_a, const void *score_b) {
  int a = *(int *)score_a;
  int b = *(int *)score_b;
  return b - a;
}


x86 assembly (clang, -O0):
<compear_scores_desc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compear_scores_desc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void intro() {
  printf("\nAcey Duecy\n"
         "----------\n"
         "Acey Ducey is played by having the computer deal out two cards. The\n"
         "player then decides on whether the next card chosen will be between "
         "the\n"
         "first two dealt, Aces high.\n\n"
         "You gain %d points every time you guess correctly and lose %d points "
         "for\n"
         "every incorrect guess.\n\n"
         "The deck is shuffeled after every hand, so no card counting.\n",
         10, 25);
  srand(time(NULL));
}


x86 assembly (clang, -O0):
<intro>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
mov    $0xa,%esi
mov    $0x19,%edx
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intro>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0xa,%esi
mov    $0x19,%edx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <srand@plt>

LLVM IR (-O0):
@.str = [351 x i8] c"\0AAcey Duecy\0A----------\0AAcey Ducey is played by having the computer deal out two cards. The\0Aplayer then decides on whether the next card chosen will be between the\0Afirst two dealt, Aces high.\0A\0AYou gain %d points every time you guess correctly and lose %d points for\0Aevery incorrect guess.\0A\0AThe deck is shuffeled after every hand, so no card counting.\0A\00"
define void @intro() {
%1 = call i32 @printf(i8* getelementptr inbounds ([351 x i8], [351 x i8]* @.str, i64 0, i64 0), i32 10, i32 25)
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [351 x i8] c"\0AAcey Duecy\0A----------\0AAcey Ducey is played by having the computer deal out two cards. The\0Aplayer then decides on whether the next card chosen will be between the\0Afirst two dealt, Aces high.\0A\0AYou gain %d points every time you guess correctly and lose %d points for\0Aevery incorrect guess.\0A\0AThe deck is shuffeled after every hand, so no card counting.\0A\00"
define void @intro() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([351 x i8], [351 x i8]* @.str, i64 0, i64 0), i32 10, i32 25)
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLUquadric;

/* Variables and functions */
int /*<<< orphan*/ gluDeleteQuadric(int /*<<< orphan*/ *);
int /*<<< orphan*/ *gluNewQuadric();
int /*<<< orphan*/ gluSphere(int /*<<< orphan*/ *, double, int, int);
void renderMarker() {
  GLUquadric *quad = gluNewQuadric();
  if (quad != NULL) {
    gluSphere(quad, 0.1, 5, 5);
    gluDeleteQuadric(quad);
  }
}


x86 assembly (clang, -O0):
<renderMarker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gluNewQuadric@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116f <renderMarker+0x3f>
mov    -0x8(%rbp),%rdi
movsd  0xea6(%rip),%xmm0
mov    $0x5,%edx
mov    %edx,%esi
call   1040 <gluSphere@plt>
mov    -0x8(%rbp),%rdi
call   1050 <gluDeleteQuadric@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderMarker>:
push   %rbx
xor    %eax,%eax
call   1030 <gluNewQuadric@plt>
test   %rax,%rax
je     1163 <renderMarker+0x33>
mov    %rax,%rbx
movsd  0xeb8(%rip),%xmm0
mov    %rax,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1040 <gluSphere@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <gluDeleteQuadric@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @renderMarker() {
%1 = alloca i32*
%2 = call i32* (...) @gluNewQuadric()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = call i32 @gluSphere(i32* %6, double 1.000000e-01, i32 5, i32 5)
%8 = load i32*, i32** %1
%9 = call i32 @gluDeleteQuadric(i32* %8)
br label %10
10: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @renderMarker() {
%1 = tail call i32* (...) @gluNewQuadric()
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @gluSphere(i32* %1, double 1.000000e-01, i32 5, i32 5)
%5 = tail call i32 @gluDeleteQuadric(i32* %1)
br label %6
6: ; preds = %3, %0
ret void
}
void test_K() {
  asm volatile("" ::"K"(31));
  asm volatile("" ::"K"(0));
}


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

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

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

LLVM IR (-O2):
define void @test_K() {
tail call void asm sideeffect "", "K,~{dirflag},~{fpsr},~{flags}"(i32 31)
tail call void asm sideeffect "", "K,~{dirflag},~{fpsr},~{flags}"(i32 0)
ret void
}
__attribute__((visibility("default"))) __attribute__((used)) void
the_visible_function() {}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @the_visible_function to i8*)], section "llvm.metadata"
define void @the_visible_function() {
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @the_visible_function to i8*)], section "llvm.metadata"
define void @the_visible_function() {
ret void
}
/* Type definitions */
typedef void EVP_MD_CTX;

/* Variables and functions */
int EVP_DigestInit_ex(void *, int /*<<< orphan*/, int /*<<< orphan*/ *);
void *EVP_MD_CTX_create();
int /*<<< orphan*/ EVP_sha1();
void *SHA1_init() {
  EVP_MD_CTX *pctx;
  pctx = EVP_MD_CTX_create();
  if (EVP_DigestInit_ex(pctx, EVP_sha1(), NULL) != 1)
    return pctx;
  return pctx;
}


x86 assembly (clang, -O0):
<SHA1_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <EVP_MD_CTX_create@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <EVP_sha1@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <EVP_DigestInit_ex@plt>
cmp    $0x1,%eax
je     1177 <SHA1_init+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <SHA1_init+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA1_init>:
push   %rbx
xor    %eax,%eax
call   1050 <EVP_MD_CTX_create@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <EVP_sha1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <EVP_DigestInit_ex@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @SHA1_init() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @EVP_MD_CTX_create()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (...) @EVP_sha1()
%6 = call i32 @EVP_DigestInit_ex(i8* %4, i32 %5, i32* null)
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i8*, i8** %2
store i8* %9, i8** %1
br label %12
10: ; preds = %0
%11 = load i8*, i8** %2
store i8* %11, i8** %1
br label %12
12: ; preds = %10, %8
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
define i8* @SHA1_init() {
%1 = tail call i8* (...) @EVP_MD_CTX_create()
%2 = tail call i32 (...) @EVP_sha1()
%3 = tail call i32 @EVP_DigestInit_ex(i8* %1, i32 %2, i32* null)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int V1 = 4;
  int V2 = 3;
  int V3;
  if (V1 == 3) {
    V3 = 2;
  } else {
    V3 = 1;
  }
  printf("%d\n", V3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    113c <main+0x2c>
movl   $0x2,-0xc(%rbp)
jmp    1143 <main+0x33>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XCirculateEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XCirculateEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XCirculateEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XCirculateEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XCirculateEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XCirculateEvent>:
test   %rdi,%rdi
je     112a <free_XCirculateEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XCirculateEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XCirculateEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void make_http_body() {
  system("curl -X POST https://pastebin.com/api/api_post.php --data "
         "'api_option=paste&api_paste_name=dotslashhacker&api_paste_expire_"
         "date=10M&api_paste_format=c&api_paste_private=0&api_dev_key="
         "8fc2bb602e03acd0c45830805b878497&api_paste_code=i%20randomly%20run%"
         "20PoC%20exploits%20without%20checking%20them%20first%20'");
  printf("\n\n:)\n\n");
}


x86 assembly (clang, -O0):
<make_http_body>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xffc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_http_body>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <system@plt>
lea    0xfff(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [307 x i8] c"curl -X POST https://pastebin.com/api/api_post.php --data 'api_option=paste&api_paste_name=dotslashhacker&api_paste_expire_date=10M&api_paste_format=c&api_paste_private=0&api_dev_key=8fc2bb602e03acd0c45830805b878497&api_paste_code=i%20randomly%20run%20PoC%20exploits%20without%20checking%20them%20first%20'\00"
@.str.1 = [7 x i8] c"\0A\0A:)\0A\0A\00"
define void @make_http_body() {
%1 = call i32 @system(i8* getelementptr inbounds ([307 x i8], [307 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [307 x i8] c"curl -X POST https://pastebin.com/api/api_post.php --data 'api_option=paste&api_paste_name=dotslashhacker&api_paste_expire_date=10M&api_paste_format=c&api_paste_private=0&api_dev_key=8fc2bb602e03acd0c45830805b878497&api_paste_code=i%20randomly%20run%20PoC%20exploits%20without%20checking%20them%20first%20'\00"
@str = [6 x i8] c"\0A\0A:)\0A\00"
define void @make_http_body() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([307 x i8], [307 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *crypt(char *, char const *);
int strcmp(char *, char *);
int main(int argc, char *argv[]) {
  const char salt[] = "$1$saltstring";
  char *cp;
  int result = 0;
  cp = crypt("Hello world!", salt);
  result |= strcmp("$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1", cp);
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x12(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    -0x1e(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <crypt@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1040 <strcmp@plt>
or     -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x676e6972747374,%rax
mov    %rax,0xe(%rsp)
movabs $0x73746c6173243124,%rax
6c 74 73
mov    %rax,0x8(%rsp)
lea    0xec5(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <crypt@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.salt = [14 x i8] c"$1$saltstring\00"
@.str = [13 x i8] c"Hello world!\00"
@.str.1 = [35 x i8] c"$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [14 x i8]
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [14 x i8]* %6 to i8*
store i32 0, i32* %8
%10 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%11 = call i8* @crypt(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = call i32 @strcmp(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i32, i32* %8
%15 = or i32 %14, %13
store i32 %15, i32* %8
%16 = load i32, i32* %8
ret i32 %16
}

LLVM IR (-O2):
@__const.main.salt = [14 x i8] c"$1$saltstring\00"
@.str = [13 x i8] c"Hello world!\00"
@.str.1 = [35 x i8] c"$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [14 x i8]
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%5 = call i8* @crypt(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @strcmp(i8* dereferenceable(35) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* dereferenceable(1) %5)
ret i32 %6
}
long long int longlongint_ignoring_signedshortint(long long int x,
                                                  signed short int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @longlongint_ignoring_signedshortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlongint_ignoring_signedshortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}