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

/* Variables and functions */
void add_table_entry(u_int32_t origin, u_int32_t mcastgrp) {}


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

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

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

LLVM IR (-O2):
define void @add_table_entry(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
off_t sync_and_drop_write_cache(int fd, off_t pos) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sync_and_drop_write_cache(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_patch_pie();
int /*<<< orphan*/ test_functions();
int main(int argc, char **argv) {
  do_patch_pie();
  test_functions();
  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)
mov    $0x0,%al
call   1040 <do_patch_pie@plt>
mov    $0x0,%al
call   1030 <test_functions@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @do_patch_pie()
%7 = call i32 (...) @test_functions()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_patch_pie()
%4 = tail call i32 (...) @test_functions()
ret i32 0
}
void load_kernel_module(void) {}


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

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

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

LLVM IR (-O2):
define void @load_kernel_module() {
ret void
}
void putsym(int c) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @increment_cpu_stall_ticks() {
ret void
}
/* Variables and functions */
float modf(float param, float *intpart) {
  *intpart = (int)param;
  return (param - *intpart);
}


x86 assembly (clang, -O0):
<modf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<modf>:
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
movss  %xmm1,(%rdi)
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @modf(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = fptosi float %5 to i32
%7 = sitofp i32 %6 to float
%8 = load float*, float** %4
store float %7, float* %8
%9 = load float, float* %3
%10 = load float*, float** %4
%11 = load float, float* %10
%12 = fsub float %9, %11
ret float %12
}

LLVM IR (-O2):
define float @modf(float %0, float* nocapture writeonly %1) {
%3 = fptosi float %0 to i32
%4 = sitofp i32 %3 to float
store float %4, float* %1
%5 = fsub float %0, %4
ret float %5
}
/* Variables and functions */
int __get_array_size(char const *);
void perror(const char *s) {
  int size = __get_array_size(s);
  size = 0;
}


x86 assembly (clang, -O0):
<perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__get_array_size@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror>:
jmp    1030 <__get_array_size@plt>

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

LLVM IR (-O2):
define void @perror(i8* %0) {
%2 = tail call i32 @__get_array_size(i8* %0)
ret void
}
void genbltzal_idle() {}


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

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

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

LLVM IR (-O2):
define void @genbltzal_idle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
void syslog(int a, const char *b, ...) {
  (void)a;
  (void)b;
  StubBug("STUB:"
          "syslog");
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"STUB:syslog\00"
define void @syslog(i32 %0, i8* nocapture readnone %1, ...) {
%3 = tail call i32 @StubBug(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_RFM_CTL0_PIN() { set_io_bit(0x43, 7); }


x86 assembly (clang, -O0):
<TOSH_SET_RFM_CTL0_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x7,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_RFM_CTL0_PIN>:
mov    $0x43,%edi
mov    $0x7,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_RFM_CTL0_PIN() {
%1 = call i32 @set_io_bit(i32 67, i32 7)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_RFM_CTL0_PIN() {
%1 = tail call i32 @set_io_bit(i32 67, i32 7)
ret void
}
/* Variables and functions */
unsigned char inreg(int, int);
int /*<<< orphan*/ outreg(int, int, unsigned char);
void serial_set(int channel, unsigned long baud) {
  unsigned char sav_lcr;
  sav_lcr = inreg(channel, 0x03);
  outreg(channel, 0x03, 0x83);
  outreg(channel, 0x01, 0x00);
  outreg(channel, 0x00, 0x02);
  outreg(channel, 0x03, 0x03);
  outreg(channel, 0x03, sav_lcr);
}


x86 assembly (clang, -O0):
<serial_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1040 <inreg@plt>
mov    %al,-0x11(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
mov    $0x83,%edx
call   1030 <outreg@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <outreg@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <outreg@plt>
mov    -0x4(%rbp),%edi
mov    $0x3,%edx
mov    %edx,%esi
call   1030 <outreg@plt>
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
movzbl -0x11(%rbp),%edx
call   1030 <outreg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_set>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x3,%esi
call   1040 <inreg@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x3,%esi
mov    $0x83,%edx
call   1030 <outreg@plt>
mov    %ebx,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <outreg@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <outreg@plt>
mov    %ebx,%edi
mov    $0x3,%esi
mov    $0x3,%edx
call   1030 <outreg@plt>
movzbl %bpl,%edx
mov    %ebx,%edi
mov    $0x3,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outreg@plt>

LLVM IR (-O0):
define void @serial_set(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = call zeroext i8 @inreg(i32 %6, i32 3)
store i8 %7, i8* %5
%8 = load i32, i32* %3
%9 = call i32 @outreg(i32 %8, i32 3, i8 zeroext -125)
%10 = load i32, i32* %3
%11 = call i32 @outreg(i32 %10, i32 1, i8 zeroext 0)
%12 = load i32, i32* %3
%13 = call i32 @outreg(i32 %12, i32 0, i8 zeroext 2)
%14 = load i32, i32* %3
%15 = call i32 @outreg(i32 %14, i32 3, i8 zeroext 3)
%16 = load i32, i32* %3
%17 = load i8, i8* %5
%18 = call i32 @outreg(i32 %16, i32 3, i8 zeroext %17)
ret void
}

LLVM IR (-O2):
define void @serial_set(i32 %0, i64 %1) {
%3 = tail call zeroext i8 @inreg(i32 %0, i32 3)
%4 = tail call i32 @outreg(i32 %0, i32 3, i8 zeroext -125)
%5 = tail call i32 @outreg(i32 %0, i32 1, i8 zeroext 0)
%6 = tail call i32 @outreg(i32 %0, i32 0, i8 zeroext 2)
%7 = tail call i32 @outreg(i32 %0, i32 3, i8 zeroext 3)
%8 = tail call i32 @outreg(i32 %0, i32 3, i8 zeroext %3)
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
long long tst_timespec_to_us(struct timespec t) {
  return t.tv_sec * 1000000 + (t.tv_nsec + 500) / 1000;
}


x86 assembly (clang, -O0):
<tst_timespec_to_us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0xf4240,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f4,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_timespec_to_us>:
imul   $0xf4240,%edi,%eax
shr    $0x20,%rdi
add    $0x1f4,%edi
movslq %edi,%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
add    %eax,%ecx
movslq %ecx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @tst_timespec_to_us(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i64*
store i64 %0, i64* %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 500
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %6, %10
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @tst_timespec_to_us(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i64 %0, 32
%4 = trunc i64 %3 to i32
%5 = mul nsw i32 %2, 1000000
%6 = add nsw i32 %4, 500
%7 = sdiv i32 %6, 1000
%8 = add nsw i32 %7, %5
%9 = sext i32 %8 to i64
ret i64 %9
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 && *s1 == *s2)
    s1++, s2++;
  return (*s1 - *s2);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movsbl %al,%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = sext i8 %18 to i32
%20 = load i8, i8* %17
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *joblistdump_headers() {
  char *line;
  line = malloc(600);
  snprintf(line, 600,
           "#!/bin/sh\n# - task spooler (ts) job dump\n"
           "# This file has been created because a SIGTERM killed\n"
           "# your queue server.\n"
           "# The finished commands are listed first.\n"
           "# The commands running or to be run are stored as you would\n"
           "# probably run them. Take care - some quotes may have got"
           " broken\n\n");
  return line;
}


x86 assembly (clang, -O0):
<joblistdump_headers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x258,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x258,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<joblistdump_headers>:
push   %rbx
mov    $0x258,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x258,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [285 x i8] c"#!/bin/sh\0A# - task spooler (ts) job dump\0A# This file has been created because a SIGTERM killed\0A# your queue server.\0A# The finished commands are listed first.\0A# The commands running or to be run are stored as you would\0A# probably run them. Take care - some quotes may have got broken\0A\0A\00"
define i8* @joblistdump_headers() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 600)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @snprintf(i8* %3, i32 600, i8* getelementptr inbounds ([285 x i8], [285 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@.str = [285 x i8] c"#!/bin/sh\0A# - task spooler (ts) job dump\0A# This file has been created because a SIGTERM killed\0A# your queue server.\0A# The finished commands are listed first.\0A# The commands running or to be run are stored as you would\0A# probably run them. Take care - some quotes may have got broken\0A\0A\00"
define i8* @joblistdump_headers() {
%1 = tail call dereferenceable_or_null(600) i8* @malloc(i32 600)
%2 = tail call i32 @snprintf(i8* %1, i32 600, i8* getelementptr inbounds ([285 x i8], [285 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ RB_Close_The_Shop();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void RB_Panic(char *cause, char *add_info) {
  printf("Robodoc: Error, %s\n", cause);
  printf("         %s\n", add_info);
  printf("Robodoc: Panic Fatal error, closing down...\n");
  RB_Close_The_Shop();
  exit(100);
}


x86 assembly (clang, -O0):
<RB_Panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <RB_Close_The_Shop@plt>
mov    $0x64,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<RB_Panic>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <RB_Close_The_Shop@plt>
mov    $0x64,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Robodoc: Error, %s\0A\00"
@.str.1 = [13 x i8] c" %s\0A\00"
@.str.2 = [45 x i8] c"Robodoc: Panic Fatal error, closing down...\0A\00"
define void @RB_Panic(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 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (...) @RB_Close_The_Shop()
%11 = call i32 @exit(i32 100)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"Robodoc: Error, %s\0A\00"
@.str.1 = [13 x i8] c" %s\0A\00"
@str = [44 x i8] c"Robodoc: Panic Fatal error, closing down...\00"
define void @RB_Panic(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (...) @RB_Close_The_Shop()
%7 = tail call i32 @exit(i32 100)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_packs_pu16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_packs_pu16(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_packs_pu16@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_packs_pu16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
void *sbrk(intptr_t);
void *__sbrk(intptr_t delta) { return sbrk(delta); }


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

x86 assembly (clang, -O2):
<__sbrk>:
jmp    1030 <sbrk@plt>

LLVM IR (-O0):
define i8* @__sbrk(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @sbrk(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @__sbrk(i64 %0) {
%2 = tail call i8* @sbrk(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
int replace_string(char **str, const char with[]) {
  if (*str != with) {
    char *new = strdup(with);
    if (new == NULL) {
      return 1;
    }
    free(*str);
    *str = new;
  }
  return 0;
}


x86 assembly (clang, -O0):
<replace_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
je     117c <replace_string+0x5c>
mov    -0x18(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1165 <replace_string+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1183 <replace_string+0x63>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_string>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rbp
xor    %r14d,%r14d
cmp    %rsi,%rbp
je     1158 <replace_string+0x38>
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strdup@plt>
test   %rax,%rax
je     1152 <replace_string+0x32>
mov    %rax,%r15
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r15,(%rbx)
jmp    1158 <replace_string+0x38>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @replace_string(i8** %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = icmp ne i8* %8, %9
br i1 %10, label %11, label %23
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = call i8* @strdup(i8* %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 1, i32* %3
br label %24
17: ; preds = %11
%18 = load i8**, i8*** %4
%19 = load i8*, i8** %18
%20 = call i32 @free(i8* %19)
%21 = load i8*, i8** %6
%22 = load i8**, i8*** %4
store i8* %21, i8** %22
br label %23
23: ; preds = %17, %2
store i32 0, i32* %3
br label %24
24: ; preds = %23, %16
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @replace_string(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, %1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i8* @strdup(i8* %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @free(i8* %3)
store i8* %6, i8** %0
br label %10
10: ; preds = %2, %8, %5
%11 = phi i32 [ 1, %5 ], [ 0, %8 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ BannerMsg(char *, int);
int /*<<< orphan*/ ms_sleep(int);
int main() {
  int i;
  int j;
  j = 0;
  i = 0;
  BannerMsg("balle", 10);
  ms_sleep(1000);
  BannerMsg("Hi This is Test Message", 10);
  ms_sleep(1000);
  BannerMsg("elepahnant fballe", 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xee0(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xea1(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xe9e(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefc(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xebd(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xeba(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"balle\00"
@.str.1 = [24 x i8] c"Hi This is Test Message\00"
@.str.2 = [18 x i8] c"elepahnant fballe\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
%4 = call i32 @BannerMsg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = call i32 @ms_sleep(i32 1000)
%6 = call i32 @BannerMsg(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 10)
%7 = call i32 @ms_sleep(i32 1000)
%8 = call i32 @BannerMsg(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"balle\00"
@.str.1 = [24 x i8] c"Hi This is Test Message\00"
@.str.2 = [18 x i8] c"elepahnant fballe\00"
define i32 @main() {
%1 = tail call i32 @BannerMsg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @ms_sleep(i32 1000)
%3 = tail call i32 @BannerMsg(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 10)
%4 = tail call i32 @ms_sleep(i32 1000)
%5 = tail call i32 @BannerMsg(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void libererSimple(void **lieu) {
  free(*lieu);
  (*lieu) = NULL;
}


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

x86 assembly (clang, -O2):
<libererSimple>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @libererSimple(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
void TextTicker(void) {}


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

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

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

LLVM IR (-O2):
define void @TextTicker() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ number;

/* Variables and functions */
int /*<<< orphan*/ print_binary_digits(int /*<<< orphan*/, int);
void print_binary(uint8_t number) {
  print_binary_digits(number, sizeof(number) * 8);
}


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

x86 assembly (clang, -O2):
<print_binary>:
mov    $0x20,%esi
jmp    1030 <print_binary_digits@plt>

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

LLVM IR (-O2):
define void @print_binary(i32 %0) {
%2 = tail call i32 @print_binary_digits(i32 %0, i32 32)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int android_atomic_cas(int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/ volatile *);
int android_atomic_acquire_cas(int32_t old_value, int32_t new_value,
                               volatile int32_t *ptr) {
  return android_atomic_cas(old_value, new_value, ptr);
}


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

x86 assembly (clang, -O2):
<android_atomic_acquire_cas>:
jmp    1030 <android_atomic_cas@plt>

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

LLVM IR (-O2):
define i32 @android_atomic_acquire_cas(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @android_atomic_cas(i32 %0, i32 %1, i32* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ prng_bytes(int /*<<< orphan*/ *, unsigned int);
void gf256v_rand(uint8_t *a, unsigned _num_byte) { prng_bytes(a, _num_byte); }


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

x86 assembly (clang, -O2):
<gf256v_rand>:
jmp    1030 <prng_bytes@plt>

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

LLVM IR (-O2):
define void @gf256v_rand(i32* %0, i32 %1) {
%3 = tail call i32 @prng_bytes(i32* %0, i32 %1)
ret void
}
char *strcpy(char *ret, register const char *s2) {
  register char *s1 = ret;
  while (*s1++ = *s2++)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ __syscall_exit(int);
void __attribute((noreturn)) exit(int status) { __syscall_exit(status); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__syscall_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
call   1030 <__syscall_exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__syscall_exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @__syscall_exit(i32 %0)
unreachable
}
void swap(int list[], int i, int j) {
  int hold = list[i];
  list[i] = list[j];
  list[j] = hold;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xgraphicsexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xgraphicsexpose_display(void *_p) {
  return (void *)((XEvent *)_p)->xgraphicsexpose.display;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XEvent_xgraphicsexpose_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef void *uint8_t;
typedef int uint32_t;

/* Variables and functions */
void co_write24p(void const *ptr24, uint32_t value) {
  uint8_t *ptr = (uint8_t *)ptr24;
  *ptr++ = (uint8_t)(value & 0xff);
  *ptr++ = (uint8_t)((value & 0xff00) >> 8);
  *ptr++ = (uint8_t)((value & 0xff0000) >> 16);
}


x86 assembly (clang, -O0):
<co_write24p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_write24p>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %rcx,(%rdi)
movzbl %ah,%ecx
mov    %rcx,0x8(%rdi)
shr    $0x10,%eax
movzbl %al,%eax
mov    %rax,0x10(%rdi)
ret

LLVM IR (-O0):
define void @co_write24p(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8**
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i8**
store i8** %7, i8*** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %5
store i8* %11, i8** %12
%14 = load i32, i32* %4
%15 = and i32 %14, 65280
%16 = ashr i32 %15, 8
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i32 1
store i8** %20, i8*** %5
store i8* %18, i8** %19
%21 = load i32, i32* %4
%22 = and i32 %21, 16711680
%23 = ashr i32 %22, 16
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i8*
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i32 1
store i8** %27, i8*** %5
store i8* %25, i8** %26
ret void
}

LLVM IR (-O2):
define void @co_write24p(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i8**
%4 = and i32 %1, 255
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = getelementptr inbounds i8, i8* %0, i64 8
%8 = bitcast i8* %7 to i8**
store i8* %6, i8** %3
%9 = lshr i32 %1, 8
%10 = and i32 %9, 255
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = getelementptr inbounds i8, i8* %0, i64 16
%14 = bitcast i8* %13 to i8**
store i8* %12, i8** %8
%15 = lshr i32 %1, 16
%16 = and i32 %15, 255
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %14
ret void
}
/* Variables and functions */
int _putch(int);
int putch(int c) { return _putch(c); }


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

x86 assembly (clang, -O2):
<putch>:
jmp    1030 <_putch@plt>

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

LLVM IR (-O2):
define i32 @putch(i32 %0) {
%2 = tail call i32 @_putch(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ timer_tick();
void SysTick_Handler() { timer_tick(); }


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

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

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

LLVM IR (-O2):
define void @SysTick_Handler() {
%1 = tail call i32 (...) @timer_tick()
ret void
}
int d_blt_mm2(double *a1, double *a2) { return !(__builtin_isless(*a1, *a2)); }


x86 assembly (clang, -O0):
<d_blt_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blt_mm2>:
movsd  (%rsi),%xmm0
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @d_blt_mm2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp uge double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int primeCheckS(int);
int increment(int num) {
  for (int i = 1; i < num; i++) {
    if (primeCheckS(num + i) == 1) {
      return (i);
    }
  }
}


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1160 <increment+0x50>
mov    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
call   1030 <primeCheckS@plt>
cmp    $0x1,%eax
jne    114d <increment+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <increment+0x50>
jmp    1152 <increment+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <increment+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x2,%edi
jl     1149 <increment+0x39>
mov    %edi,%r14d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    (%r14,%rbx,1),%edi
call   1030 <primeCheckS@plt>
cmp    $0x1,%eax
je     1149 <increment+0x39>
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1130 <increment+0x20>
mov    %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @increment(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1, %8
%4 = phi i32 [ %9, %8 ], [ 1, %1 ]
%5 = add nsw i32 %4, %0
%6 = tail call i32 @primeCheckS(i32 %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %8, %3, %1
%12 = phi i32 [ 1, %1 ], [ %4, %3 ], [ %0, %8 ]
ret i32 %12
}
int f(int (**p)(void)) { return p[1](); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
call   *0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
jmp    *0x8(%rdi)

LLVM IR (-O0):
define i32 @f(i32 ()** %0) {
%2 = alloca i32 ()**
store i32 ()** %0, i32 ()*** %2
%3 = load i32 ()**, i32 ()*** %2
%4 = getelementptr inbounds i32 ()*, i32 ()** %3, i64 1
%5 = load i32 ()*, i32 ()** %4
%6 = call i32 %5()
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(i32 ()** nocapture %0) {
%2 = getelementptr inbounds i32 ()*, i32 ()** %0, i64 1
%3 = load i32 ()*, i32 ()** %2
%4 = tail call i32 %3()
ret i32 %4
}
/* Variables and functions */
int get_cmos_register(int);
void wait_tm_ready(void) {
  while (get_cmos_register(0x0A) & 0x80)
    ;
}


x86 assembly (clang, -O0):
<wait_tm_ready>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <wait_tm_ready+0x9>
mov    $0xa,%edi
call   1030 <get_cmos_register@plt>
and    $0x80,%eax
cmp    $0x0,%eax
je     1136 <wait_tm_ready+0x26>
jmp    1119 <wait_tm_ready+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_tm_ready>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <get_cmos_register@plt>
test   $0x80,%al
jne    1120 <wait_tm_ready+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @wait_tm_ready() {
br label %1
1: ; preds = %5, %0
%2 = call i32 @get_cmos_register(i32 10)
%3 = and i32 %2, 128
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @wait_tm_ready() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @get_cmos_register(i32 10)
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void setGreaterOrEqual() {
  emitln("setge\t%%al");
  emitln("neg\t%%al\t#change 1 to -1");
  emitln("movsx\t%%al,%%eax\t#extend al to eax");
}


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

x86 assembly (clang, -O2):
<setGreaterOrEqual>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <emitln@plt>
lea    0xee7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xef4(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"setge\09%%al\00"
@.str.1 = [25 x i8] c"neg\09%%al\09#change 1 to -1\00"
@.str.2 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @setGreaterOrEqual() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitln(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"setge\09%%al\00"
@.str.1 = [25 x i8] c"neg\09%%al\09#change 1 to -1\00"
@.str.2 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @setGreaterOrEqual() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}