xunge/DecIR huggingface dataset:
int icerp(int a, int b, int c, int d, int x) {
  int p = (d - c) - (a - b);
  int q = (a - b) - p;
  int r = c - a;
  return ((x * (x * (x * p + (q << 7)) + (r << 14)) + (b << 21)) >> 21);
}


x86 assembly (clang, -O0):
<icerp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x14(%rbp),%edx
imul   -0x18(%rbp),%edx
mov    -0x1c(%rbp),%esi
shl    $0x7,%esi
add    %esi,%edx
imul   %edx,%ecx
mov    -0x20(%rbp),%edx
shl    $0xe,%edx
add    %edx,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x15,%ecx
add    %ecx,%eax
sar    $0x15,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icerp>:
mov    %edi,%eax
sub    %esi,%eax
sub    %eax,%ecx
sub    %edx,%ecx
sub    %ecx,%eax
sub    %edi,%edx
imul   %r8d,%ecx
shl    $0x7,%eax
add    %ecx,%eax
imul   %r8d,%eax
shl    $0xe,%edx
add    %edx,%eax
imul   %r8d,%eax
shl    $0x15,%esi
add    %esi,%eax
sar    $0x15,%eax
ret

LLVM IR (-O0):
define i32 @icerp(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%14 = load i32, i32* %9
%15 = load i32, i32* %8
%16 = sub nsw i32 %14, %15
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = sub nsw i32 %17, %18
%20 = sub nsw i32 %16, %19
store i32 %20, i32* %11
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = sub nsw i32 %21, %22
%24 = load i32, i32* %11
%25 = sub nsw i32 %23, %24
store i32 %25, i32* %12
%26 = load i32, i32* %8
%27 = load i32, i32* %6
%28 = sub nsw i32 %26, %27
store i32 %28, i32* %13
%29 = load i32, i32* %10
%30 = load i32, i32* %10
%31 = load i32, i32* %10
%32 = load i32, i32* %11
%33 = mul nsw i32 %31, %32
%34 = load i32, i32* %12
%35 = shl i32 %34, 7
%36 = add nsw i32 %33, %35
%37 = mul nsw i32 %30, %36
%38 = load i32, i32* %13
%39 = shl i32 %38, 14
%40 = add nsw i32 %37, %39
%41 = mul nsw i32 %29, %40
%42 = load i32, i32* %7
%43 = shl i32 %42, 21
%44 = add nsw i32 %41, %43
%45 = ashr i32 %44, 21
ret i32 %45
}

LLVM IR (-O2):
define i32 @icerp(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sub nsw i32 %0, %1
%7 = add i32 %6, %2
%8 = sub i32 %3, %7
%9 = sub nsw i32 %6, %8
%10 = sub nsw i32 %2, %0
%11 = mul nsw i32 %8, %4
%12 = shl i32 %9, 7
%13 = add nsw i32 %12, %11
%14 = mul nsw i32 %13, %4
%15 = shl i32 %10, 14
%16 = add nsw i32 %14, %15
%17 = mul nsw i32 %16, %4
%18 = shl i32 %1, 21
%19 = add nsw i32 %17, %18
%20 = ashr i32 %19, 21
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  printf("Introduce dos enteros: ");
  scanf("%d %d", &a, &b);
  printf("valores leidos: %d y %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [24 x i8] c"Introduce dos enteros: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [25 x i8] c"valores leidos: %d y %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dbg_channel_init();
int _fstat(int fd, struct stat *st) {
  dbg_channel_init();
  return 0;
}


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <dbg_channel_init@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fstat>:
push   %rax
xor    %eax,%eax
call   1030 <dbg_channel_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = call i32 (...) @dbg_channel_init()
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_fstat(i32 %0, %struct.stat* nocapture readnone %1) {
%3 = tail call i32 (...) @dbg_channel_init()
ret i32 0
}
void __DELETE_java_nio_charset_CharsetDecoder(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_nio_charset_CharsetDecoder(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
long timer_ns(struct timeval *start, struct timeval *end) {
  long delta = ((end->tv_sec - start->tv_sec) * 1000000) +
               (end->tv_usec - start->tv_usec);
  return delta;
}


x86 assembly (clang, -O0):
<timer_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
imul   $0xf4240,%eax,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x8(%rbp),%rdx
sub    0x4(%rdx),%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_ns>:
mov    (%rsi),%eax
mov    0x4(%rsi),%ecx
sub    (%rdi),%eax
imul   $0xf4240,%eax,%eax
sub    0x4(%rdi),%ecx
add    %eax,%ecx
movslq %ecx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @timer_ns(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
%5 = alloca i64
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%6 = load %struct.timeval*, %struct.timeval** %4
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.timeval*, %struct.timeval** %3
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = sub nsw i32 %8, %11
%13 = mul nsw i32 %12, 1000000
%14 = load %struct.timeval*, %struct.timeval** %4
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load i32, i32* %15
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = sub nsw i32 %16, %19
%21 = add nsw i32 %13, %20
%22 = sext i32 %21 to i64
store i64 %22, i64* %5
%23 = load i64, i64* %5
ret i64 %23
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @timer_ns(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%12 = load i32, i32* %11
%13 = sub i32 %10, %12
%14 = add nsw i32 %13, %8
%15 = sext i32 %14 to i64
ret i64 %15
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rpi2_delay_loop(unsigned int);
int /*<<< orphan*/ rpi2_led_off();
int /*<<< orphan*/ rpi2_led_on();
void rpi2_led_blink(unsigned int on_ms, unsigned int off_ms,
                    unsigned int count) {
  uint32_t i;
  for (i = 0; i < count; i++) {
    rpi2_led_on();
    rpi2_delay_loop(on_ms);
    rpi2_led_off();
    rpi2_delay_loop(off_ms);
  }
}


x86 assembly (clang, -O0):
<rpi2_led_blink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1180 <rpi2_led_blink+0x50>
mov    $0x0,%al
call   1040 <rpi2_led_on@plt>
mov    -0x4(%rbp),%edi
call   1030 <rpi2_delay_loop@plt>
mov    $0x0,%al
call   1050 <rpi2_led_off@plt>
mov    -0x8(%rbp),%edi
call   1030 <rpi2_delay_loop@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <rpi2_led_blink+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpi2_led_blink>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
je     1162 <rpi2_led_blink+0x32>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
nop
xor    %eax,%eax
call   1040 <rpi2_led_on@plt>
mov    %ebp,%edi
call   1030 <rpi2_delay_loop@plt>
xor    %eax,%eax
call   1050 <rpi2_led_off@plt>
mov    %r14d,%edi
call   1030 <rpi2_delay_loop@plt>
add    $0xffffffff,%ebx
jne    1140 <rpi2_led_blink+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @rpi2_led_blink(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
store i32 0, i32* %7
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = call i32 (...) @rpi2_led_on()
%14 = load i32, i32* %4
%15 = call i32 @rpi2_delay_loop(i32 %14)
%16 = call i32 (...) @rpi2_led_off()
%17 = load i32, i32* %5
%18 = call i32 @rpi2_delay_loop(i32 %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %7
%21 = add i32 %20, 1
store i32 %21, i32* %7
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @rpi2_led_blink(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ 0, %3 ]
%7 = tail call i32 (...) @rpi2_led_on()
%8 = tail call i32 @rpi2_delay_loop(i32 %0)
%9 = tail call i32 (...) @rpi2_led_off()
%10 = tail call i32 @rpi2_delay_loop(i32 %1)
%11 = add nuw i32 %6, 1
%12 = icmp eq i32 %11, %2
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
/* Variables and functions */
int GenerateFastRandom();
float PRANDFloatPos(void) {
  float x = (float)(GenerateFastRandom() & 0xffff);
  return (x / 65535.0f);
}


x86 assembly (clang, -O0):
<PRANDFloatPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <GenerateFastRandom@plt>
and    $0xffff,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xec6(%rip),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRANDFloatPos>:
push   %rax
xor    %eax,%eax
call   1030 <GenerateFastRandom@plt>
movzwl %ax,%eax
cvtsi2ss %eax,%xmm0
divss  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @PRANDFloatPos() {
%1 = alloca float
%2 = call i32 (...) @GenerateFastRandom()
%3 = and i32 %2, 65535
%4 = sitofp i32 %3 to float
store float %4, float* %1
%5 = load float, float* %1
%6 = fdiv float %5, 6.553500e+04
ret float %6
}

LLVM IR (-O2):
define float @PRANDFloatPos() {
%1 = tail call i32 (...) @GenerateFastRandom()
%2 = and i32 %1, 65535
%3 = sitofp i32 %2 to float
%4 = fdiv float %3, 6.553500e+04
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ flat_dev_seek(int /*<<< orphan*/, int);
off_t flat_seek(off_t offset, int whence) {
  return flat_dev_seek(offset, whence);
}


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

x86 assembly (clang, -O2):
<flat_seek>:
jmp    1030 <flat_dev_seek@plt>

LLVM IR (-O0):
define i32 @flat_seek(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 @flat_dev_seek(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @flat_seek(i32 %0, i32 %1) {
%3 = tail call i32 @flat_dev_seek(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__36__IO__set();
void WaterPumpC__WaterPumpPower__set(void) {
  HplAtm128GeneralIOPinP__36__IO__set();
}


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

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

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

LLVM IR (-O2):
define void @WaterPumpC__WaterPumpPower__set() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__36__IO__set()
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort_helper(int *arr, int first, int last) {
  int part;
  if (first < last) {
    part = partition(arr, first, last);
    quick_sort_helper(arr, first, part - 1);
    quick_sort_helper(arr, part + 1, last);
  }
}


x86 assembly (clang, -O0):
<quick_sort_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort_helper+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort_helper@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort_helper@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort_helper>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort_helper+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort_helper@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort_helper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort_helper(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* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @quick_sort_helper(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort_helper(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EVIOCGVERSION;
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int evf_input_get_version(int fd, int *version) {
  if (ioctl(fd, EVIOCGVERSION, version))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<evf_input_get_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     114a <evf_input_get_version+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <evf_input_get_version+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evf_input_get_version>:
push   %rax
mov    %rsi,%rdx
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EVIOCGVERSION = global i32 0
define i32 @evf_input_get_version(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = load i32, i32* @EVIOCGVERSION
%8 = load i32*, i32** %5
%9 = call i64 @ioctl(i32 %6, i32 %7, i32* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@EVIOCGVERSION = global i32 0
define i32 @evf_input_get_version(i32 %0, i32* %1) {
%3 = load i32, i32* @EVIOCGVERSION
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i32* %1)
%5 = icmp ne i64 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ mdfour(unsigned char *, unsigned char *, int);
void Com_BlockFullChecksum(const void *buffer, int len, unsigned char *outbuf) {
  mdfour(outbuf, (unsigned char *)buffer, len);
}


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

x86 assembly (clang, -O2):
<Com_BlockFullChecksum>:
mov    %rdx,%rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rax,%rdi
jmp    1030 <mdfour@plt>

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

LLVM IR (-O2):
define void @Com_BlockFullChecksum(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @mdfour(i8* %2, i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
void fwritei(FILE *fOut, int i) { fwrite(&i, sizeof(int), 1, fOut); }


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

x86 assembly (clang, -O2):
<fwritei>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @fwritei(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ xls_is_bigendian();
unsigned short xlsShortVal(short s) {
  unsigned char c1, c2;
  if (xls_is_bigendian()) {
    c1 = s & 255;
    c2 = (s >> 8) & 255;
    return (c1 << 8) + c2;
  } else {
    return s & 0xFFFF;
  }
}


x86 assembly (clang, -O0):
<xlsShortVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <xls_is_bigendian@plt>
cmp    $0x0,%rax
je     1161 <xlsShortVal+0x51>
movswl -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
movswl -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
shl    $0x8,%eax
movzbl -0x6(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
jmp    116e <xlsShortVal+0x5e>
movswl -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlsShortVal>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <xls_is_bigendian@plt>
mov    %ebx,%ecx
rol    $0x8,%cx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @xlsShortVal(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i8
%5 = alloca i8
store i16 %0, i16* %3
%6 = call i64 (...) @xls_is_bigendian()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %25
8: ; preds = %1
%9 = load i16, i16* %3
%10 = sext i16 %9 to i32
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
store i8 %12, i8* %4
%13 = load i16, i16* %3
%14 = sext i16 %13 to i32
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
store i8 %17, i8* %5
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = add nsw i32 %20, %22
%24 = trunc i32 %23 to i16
store i16 %24, i16* %2
br label %30
25: ; preds = %1
%26 = load i16, i16* %3
%27 = sext i16 %26 to i32
%28 = and i32 %27, 65535
%29 = trunc i32 %28 to i16
store i16 %29, i16* %2
br label %30
30: ; preds = %25, %8
%31 = load i16, i16* %2
ret i16 %31
}

LLVM IR (-O2):
define zeroext i16 @xlsShortVal(i16 signext %0) {
%2 = tail call i64 (...) @xls_is_bigendian()
%3 = icmp eq i64 %2, 0
%4 = tail call i16 @llvm.bswap.i16(i16 %0)
%5 = select i1 %3, i16 %0, i16 %4
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int usage(const char *program) {
  fprintf(stderr, "Copyright (C) 2006 The Android Open Source Project\n\n");
  fprintf(stderr, "usage: %s trace-file-name\n", program);
  return 2;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeee(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xefc(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Copyright (C) 2006 The Android Open Source Project\0A\0A\00"
@.str.1 = [27 x i8] c"usage: %s trace-file-name\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 2
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Copyright (C) 2006 The Android Open Source Project\0A\0A\00"
@.str.1 = [27 x i8] c"usage: %s trace-file-name\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 2
}
unsigned int f33(unsigned int x, int y) {
  return (x >> y) | (x << (8 * 4 - y));
}


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

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

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

LLVM IR (-O2):
define i32 @f33(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vprintf(char const *, int /*<<< orphan*/);
void vprintf_flush(const char *fmt, va_list ap) {
  vprintf(fmt, ap);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<vprintf_flush>:
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   1040 <vprintf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf_flush>:
push   %rax
call   1040 <vprintf@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @vprintf_flush(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 @vprintf(i8* %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @vprintf_flush(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int full_mapcode_decode(long *, long *, char const *, char const *, int *,
                        int /*<<< orphan*/ *);
int mapcode_decode(long *y, long *x, const char *iso3, const char *orginput,
                   int *ccode_found) {
  return full_mapcode_decode(y, x, iso3, orginput, ccode_found, NULL);
}


x86 assembly (clang, -O0):
<mapcode_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <full_mapcode_decode@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapcode_decode>:
xor    %r9d,%r9d
jmp    1030 <full_mapcode_decode@plt>

LLVM IR (-O0):
define i32 @mapcode_decode(i64* %0, i64* %1, i8* %2, i8* %3, i32* %4) {
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32*
store i64* %0, i64** %6
store i64* %1, i64** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%11 = load i64*, i64** %6
%12 = load i64*, i64** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i32*, i32** %10
%16 = call i32 @full_mapcode_decode(i64* %11, i64* %12, i8* %13, i8* %14, i32* %15, i32* null)
ret i32 %16
}

LLVM IR (-O2):
define i32 @mapcode_decode(i64* %0, i64* %1, i8* %2, i8* %3, i32* %4) {
%6 = tail call i32 @full_mapcode_decode(i64* %0, i64* %1, i8* %2, i8* %3, i32* %4, i32* null)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sigwinch(int /*<<< orphan*/);
void UI_manual_resize() { sigwinch(0); }


x86 assembly (clang, -O0):
<UI_manual_resize>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <sigwinch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_manual_resize>:
xor    %edi,%edi
jmp    1030 <sigwinch@plt>

LLVM IR (-O0):
define void @UI_manual_resize() {
%1 = call i32 @sigwinch(i32 0)
ret void
}

LLVM IR (-O2):
define void @UI_manual_resize() {
%1 = tail call i32 @sigwinch(i32 0)
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ ts_normalize(struct timespec *const);
void ts_add(struct timespec *const t, struct timespec const *const s) {
  t->tv_sec += s->tv_sec;
  t->tv_nsec += s->tv_nsec;
  ts_normalize(t);
}


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

x86 assembly (clang, -O2):
<ts_add>:
movdqu (%rsi),%xmm0
movdqu (%rdi),%xmm1
paddq  %xmm0,%xmm1
movdqu %xmm1,(%rdi)
jmp    1030 <ts_normalize@plt>

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @ts_add(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%7 = load i64, i64* %6
%8 = load %struct.timespec*, %struct.timespec** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %10, %7
store i64 %11, i64* %9
%12 = load %struct.timespec*, %struct.timespec** %4
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 0
%14 = load i64, i64* %13
%15 = load %struct.timespec*, %struct.timespec** %3
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %15, i32 0, i32 0
%17 = load i64, i64* %16
%18 = add nsw i64 %17, %14
store i64 %18, i64* %16
%19 = load %struct.timespec*, %struct.timespec** %3
%20 = call i32 @ts_normalize(%struct.timespec* %19)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @ts_add(%struct.timespec* %0, %struct.timespec* nocapture %1) {
%3 = bitcast %struct.timespec* %1 to <2 x i64>*
%4 = load <2 x i64>, <2 x i64>* %3
%5 = bitcast %struct.timespec* %0 to <2 x i64>*
%6 = load <2 x i64>, <2 x i64>* %5
%7 = add nsw <2 x i64> %6, %4
%8 = bitcast %struct.timespec* %0 to <2 x i64>*
store <2 x i64> %7, <2 x i64>* %8
%9 = tail call i32 @ts_normalize(%struct.timespec* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __startrek_entry_pt_Writer();
void cil_keeperWriter(void) {
  {
    __startrek_entry_pt_Writer();
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @cil_keeperWriter() {
%1 = tail call i32 (...) @__startrek_entry_pt_Writer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double);
void fltostr(char *str, double fl) { sprintf(str, "%.15f", fl); }


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

x86 assembly (clang, -O2):
<fltostr>:
lea    0xee9(%rip),%rsi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.15f\00"
define void @fltostr(i8* nocapture writeonly %0, double %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}
/* Variables and functions */
int copysign(int, double);
int isMinusZero(double x) { return x == 0 && copysign(1, x) == -1; }


x86 assembly (clang, -O0):
<isMinusZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jne    1152 <isMinusZero+0x42>
jp     1152 <isMinusZero+0x42>
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <copysign@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isMinusZero>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1136 <isMinusZero+0x26>
jp     1136 <isMinusZero+0x26>
push   %rax
mov    $0x1,%edi
call   1030 <copysign@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isMinusZero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = call i32 @copysign(i32 1, double %6)
%8 = icmp eq i32 %7, -1
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isMinusZero(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @copysign(i32 1, double %0)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int strcmp(char const *, char const *);
int _str_cmp(const char **ia, const char **ib) { return strcmp(*ia, *ib); }


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

x86 assembly (clang, -O2):
<_str_cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @_str_cmp(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 = load i8*, i8** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 @strcmp(i8* %6, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_str_cmp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ kfork();
pid_t __fork(void) { return kfork(); }


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

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

LLVM IR (-O0):
define i32 @__fork() {
%1 = call i32 (...) @kfork()
ret i32 %1
}

LLVM IR (-O2):
define i32 @__fork() {
%1 = tail call i32 (...) @kfork()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void c(int x) {
  static int c;
  if (c) {
    abort();
  }
  c = 1;
  ;
  if (x != sizeof(int))
    abort();
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,0x2f0a(%rip)
je     112f <c+0x1f>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x1,0x2ef3(%rip)
movslq -0x4(%rbp),%rax
cmp    $0x4,%rax
je     114e <c+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rax
cmpb   $0x1,0x2f14(%rip)
je     1128 <c+0x18>
movb   $0x1,0x2f0b(%rip)
cmp    $0x4,%edi
jne    1128 <c+0x18>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@c.c = internal global i32 0
define void @c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @c.c
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
store i32 1, i32* @c.c
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = icmp ne i64 %9, 4
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %7
ret void
}

LLVM IR (-O2):
@c.c = internal unnamed_addr global i1 false
define void @c(i32 %0) {
%2 = load i1, i1* @c.c
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
store i1 true, i1* @c.c
%6 = icmp eq i32 %0, 4
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %5
ret void
}
/* Variables and functions */
long f(char *);
long main() {
  char *g;
  long h;
  g = "dog";
  h = f(g);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <f@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"dog\00"
define i64 @main() {
%1 = alloca i64
%2 = alloca i8*
%3 = alloca i64
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @f(i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %1
ret i64 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"dog\00"
define i64 @main() {
%1 = tail call i64 @f(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i64 undef
}
char *ez_int_to_stringaddr(char *_addr, int _iaddr) {
  if (!_addr)
    return ((void *)0);
  unsigned char *iptr = (unsigned char *)&_iaddr;
  return ((void *)0);
}


x86 assembly (clang, -O0):
<ez_int_to_stringaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <ez_int_to_stringaddr+0x23>
movq   $0x0,-0x8(%rbp)
jmp    1133 <ez_int_to_stringaddr+0x33>
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @ez_int_to_stringaddr(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  const int max = 100;
  uint64_t sum = (max + 1) * max / 2, sum_squares = 0;
  for (int i = 1; i <= max; ++i) {
    sum_squares += (i * i);
  }
  printf("sum_squares: %lu, square_sums: %lu, difference: %lu\n", sum_squares,
         sum * sum, (sum * sum) - sum_squares);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x13ba,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     1160 <main+0x50>
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <main+0x2b>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
imul   -0xc(%rbp),%edx
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x529ae,%esi
mov    $0x1852324,%edx
mov    $0x17ff976,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"sum_squares: %lu, square_sums: %lu, difference: %lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
store i32 5050, i32* %3
store i32 0, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %5
%8 = icmp sle i32 %7, 100
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %5
%11 = load i32, i32* %5
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %4
%14 = add nsw i32 %13, %12
store i32 %14, i32* %4
br label %15
15: ; preds = %9
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
%19 = load i32, i32* %4
%20 = load i32, i32* %3
%21 = load i32, i32* %3
%22 = mul nsw i32 %20, %21
%23 = load i32, i32* %3
%24 = load i32, i32* %3
%25 = mul nsw i32 %23, %24
%26 = load i32, i32* %4
%27 = sub nsw i32 %25, %26
%28 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %22, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"sum_squares: %lu, square_sums: %lu, difference: %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 338350, i32 25502500, i32 25164150)
ret i32 0
}
void hello() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
struct timespec getTime() {
  struct timespec t;
  clock_gettime(CLOCK_MONOTONIC, &t);
  return t;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @getTime() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @getTime() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_trip_reverse();
void roadmap_start_trip_reverse(void) { roadmap_trip_reverse(); }


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

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

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

LLVM IR (-O2):
define void @roadmap_start_trip_reverse() {
%1 = tail call i32 (...) @roadmap_trip_reverse()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init(char *);
int ok();
int /*<<< orphan*/ test();
int main() {
  init("compound assignment operators");
  test();
  return ok();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <init@plt>
mov    $0x0,%al
call   1050 <test@plt>
mov    $0x0,%al
call   1030 <ok@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ok@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"compound assignment operators\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @init(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test()
%4 = call i32 (...) @ok()
ret i32 %4
}

LLVM IR (-O2):
@.str = [30 x i8] c"compound assignment operators\00"
define i32 @main() {
%1 = tail call i32 @init(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test()
%3 = tail call i32 (...) @ok()
ret i32 %3
}