xunge/DecIR huggingface dataset:
int test_imm_2Buint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x2B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_2Buint64_highword_reg>:
movabs $0x2b00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Buint64_highword_reg(i64 %0) {
%2 = and i64 %0, 184683593728
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float filterSmooth(float currentData, float previousData, float smoothFactor) {
  return (previousData * (1.0 - smoothFactor) + (currentData * smoothFactor));
}


x86 assembly (clang, -O0):
<filterSmooth>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xed3(%rip),%xmm2
subsd  %xmm1,%xmm2
movss  -0x4(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<filterSmooth>:
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm3
movsd  0xef0(%rip),%xmm4
subsd  %xmm3,%xmm4
mulsd  %xmm1,%xmm4
mulss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm4,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @filterSmooth(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = fpext float %7 to double
%9 = load float, float* %6
%10 = fpext float %9 to double
%11 = fsub double 1.000000e+00, %10
%12 = load float, float* %4
%13 = load float, float* %6
%14 = fmul float %12, %13
%15 = fpext float %14 to double
%16 = call double @llvm.fmuladd.f64(double %8, double %11, double %15)
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @filterSmooth(float %0, float %1, float %2) {
%4 = fpext float %1 to double
%5 = fpext float %2 to double
%6 = fsub double 1.000000e+00, %5
%7 = fmul float %0, %2
%8 = fpext float %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %4, double %6, double %8)
%10 = fptrunc double %9 to float
ret float %10
}
/* Variables and functions */
int uart0_rx(char *);
void uart0_rxb(char *c) {
  while (uart0_rx(c) == -1)
    ;
}


x86 assembly (clang, -O0):
<uart0_rxb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <uart0_rx@plt>
cmp    $0xffffffff,%eax
jne    1133 <uart0_rxb+0x23>
jmp    111c <uart0_rxb+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart0_rxb>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <uart0_rx@plt>
cmp    $0xffffffff,%eax
je     1120 <uart0_rxb+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart0_rxb(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @uart0_rx(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
/* Type definitions */
struct array {
  int dummy;
};

/* Variables and functions */
void *array_get(struct array const *, int);
int stack_size(struct array const *);
void *stack_peek(const struct array *st) {
  int last_index = stack_size(st) - 1;
  void *return_value = array_get(st, last_index);
  return return_value;
}


x86 assembly (clang, -O0):
<stack_peek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <stack_size@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <array_get@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_peek>:
push   %rbx
mov    %rdi,%rbx
call   1040 <stack_size@plt>
lea    -0x1(%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <array_get@plt>

LLVM IR (-O0):
%struct.array = type { i32 }
define i8* @stack_peek(%struct.array* %0) {
%2 = alloca %struct.array*
%3 = alloca i32
%4 = alloca i8*
store %struct.array* %0, %struct.array** %2
%5 = load %struct.array*, %struct.array** %2
%6 = call i32 @stack_size(%struct.array* %5)
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load %struct.array*, %struct.array** %2
%9 = load i32, i32* %3
%10 = call i8* @array_get(%struct.array* %8, i32 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
%struct.array = type { i32 }
define i8* @stack_peek(%struct.array* %0) {
%2 = tail call i32 @stack_size(%struct.array* %0)
%3 = add nsw i32 %2, -1
%4 = tail call i8* @array_get(%struct.array* %0, i32 %3)
ret i8* %4
}
void result(int num, int *result_add, int *result_mul) {
  int i, j, k;
  i = num / 100;
  j = num / 10 % 10;
  k = num % 10;
  *result_add += i + j + k;
  *result_mul *= i * j * k;
}


x86 assembly (clang, -O0):
<result>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x1c(%rbp),%ecx
add    -0x20(%rbp),%ecx
add    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
imul   -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
imul   (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<result>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%r8
mov    %r8,%rdi
shr    $0x3f,%rdi
sar    $0x25,%r8
add    %edi,%r8d
imul   $0x66666667,%rax,%rdi
mov    %rdi,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rdi
add    %ecx,%edi
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%r9
shr    $0x3f,%r9
sar    $0x22,%rdi
add    %r9d,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%r9d
mov    %ecx,%edi
sub    %r9d,%edi
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
lea    (%rax,%r8,1),%ecx
add    %edi,%ecx
add    %ecx,(%rsi)
imul   %r8d,%eax
imul   %edi,%eax
imul   (%rdx),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @result(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 100
store i32 %11, i32* %7
%12 = load i32, i32* %4
%13 = sdiv i32 %12, 10
%14 = srem i32 %13, 10
store i32 %14, i32* %8
%15 = load i32, i32* %4
%16 = srem i32 %15, 10
store i32 %16, i32* %9
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
%20 = load i32, i32* %9
%21 = add nsw i32 %19, %20
%22 = load i32*, i32** %5
%23 = load i32, i32* %22
%24 = add nsw i32 %23, %21
store i32 %24, i32* %22
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = mul nsw i32 %25, %26
%28 = load i32, i32* %9
%29 = mul nsw i32 %27, %28
%30 = load i32*, i32** %6
%31 = load i32, i32* %30
%32 = mul nsw i32 %31, %29
store i32 %32, i32* %30
ret void
}

LLVM IR (-O2):
define void @result(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = sdiv i32 %0, 100
%5 = sdiv i32 %0, 10
%6 = srem i32 %5, 10
%7 = srem i32 %0, 10
%8 = load i32, i32* %1
%9 = add nsw i32 %7, %4
%10 = add nsw i32 %9, %6
%11 = add i32 %10, %8
store i32 %11, i32* %1
%12 = load i32, i32* %2
%13 = mul nsw i32 %7, %4
%14 = mul nsw i32 %13, %6
%15 = mul i32 %14, %12
store i32 %15, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void hit(void) { say("You smell, therefore you die!!!", 1); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"You smell, therefore you die!!!\00"
define void @hit() {
%1 = call i32 @say(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"You smell, therefore you die!!!\00"
define void @hit() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
double get_ms_time();
void benchmark_end(double *bc) {
  double now = get_ms_time();
  *bc = now - *bc;
}


x86 assembly (clang, -O0):
<benchmark_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_ms_time@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark_end>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_ms_time@plt>
subsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @benchmark_end(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = call double (...) @get_ms_time()
store double %4, double* %3
%5 = load double, double* %3
%6 = load double*, double** %2
%7 = load double, double* %6
%8 = fsub double %5, %7
%9 = load double*, double** %2
store double %8, double* %9
ret void
}

LLVM IR (-O2):
define void @benchmark_end(double* nocapture %0) {
%2 = tail call double (...) @get_ms_time()
%3 = load double, double* %0
%4 = fsub double %2, %3
store double %4, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pick(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int p;
  scanf("%d", &p);
  pick(p, p, 0, 0, 0);
  printf("%d peppers cannot be packed.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1040 <pick@plt>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    %edi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <pick@plt>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [30 x i8] c"%d peppers cannot be packed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @pick(i32 %3, i32 %4, i32 0, i32 0, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [30 x i8] c"%d peppers cannot be packed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @pick(i32 %4, i32 %4, i32 0, i32 0, i32 0)
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *comdMalloc(size_t iSize) { return malloc(iSize); }


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

x86 assembly (clang, -O2):
<comdMalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @comdMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
double f4_sum_pre_double_double_double(double v0, double v1, double v) {
  return v0 + v1 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_double_double_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_double_double_double>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_double_double_double(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fadd double %7, %8
%10 = load double, double* %6
%11 = fadd double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @f4_sum_pre_double_double_double(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fadd double %4, %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ bcm2835_i2c_setSlaveAddress(unsigned char);
int /*<<< orphan*/ bcm2835_i2c_write(char *, int);
void I2C_WriteByte(unsigned char address, char bdata) {
  bcm2835_i2c_setSlaveAddress(address);
  char data = bdata;
  bcm2835_i2c_write(&data, 1);
}


x86 assembly (clang, -O0):
<I2C_WriteByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <bcm2835_i2c_setSlaveAddress@plt>
mov    -0x2(%rbp),%al
mov    %al,-0x3(%rbp)
lea    -0x3(%rbp),%rdi
mov    $0x1,%esi
call   1030 <bcm2835_i2c_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_WriteByte>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
call   1040 <bcm2835_i2c_setSlaveAddress@plt>
mov    %bl,0xf(%rsp)
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
call   1030 <bcm2835_i2c_write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @I2C_WriteByte(i8 zeroext %0, i8 signext %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
%7 = call i32 @bcm2835_i2c_setSlaveAddress(i8 zeroext %6)
%8 = load i8, i8* %4
store i8 %8, i8* %5
%9 = call i32 @bcm2835_i2c_write(i8* %5, i32 1)
ret void
}

LLVM IR (-O2):
define void @I2C_WriteByte(i8 zeroext %0, i8 signext %1) {
%3 = alloca i8
%4 = tail call i32 @bcm2835_i2c_setSlaveAddress(i8 zeroext %0)
store i8 %1, i8* %3
%5 = call i32 @bcm2835_i2c_write(i8* %3, i32 1)
ret void
}
/* Variables and functions */
void *memcpy(void *dest __attribute__((unused)),
             const void *src __attribute__((unused)),
             unsigned int n __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @memcpy(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i8* null
}
int dive(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<dive>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @dive(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
float bit_crusher_limiter(const float val) {
  if (val > 1.0f)
    return 1.0f;
  else if (val < -1.0f)
    return -1.0f;
  else
    return val;
}


x86 assembly (clang, -O0):
<bit_crusher_limiter>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1131 <bit_crusher_limiter+0x31>
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115f <bit_crusher_limiter+0x5f>
movss  0xecb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1155 <bit_crusher_limiter+0x55>
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115f <bit_crusher_limiter+0x5f>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_crusher_limiter>:
movss  0xef8(%rip),%xmm2
maxss  %xmm0,%xmm2
movss  0xef0(%rip),%xmm3
movaps %xmm3,%xmm1
cmpltss %xmm0,%xmm1
movaps %xmm1,%xmm0
andnps %xmm2,%xmm0
andps  %xmm3,%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @bit_crusher_limiter(float %0) {
%2 = fcmp ogt float %0, 1.000000e+00
%3 = fcmp olt float %0, -1.000000e+00
%4 = select i1 %3, float -1.000000e+00, float %0
%5 = select i1 %2, float 1.000000e+00, float %4
ret float %5
}
unsigned long b_input_string(unsigned char *str, unsigned long nbr) {
  unsigned long len;
  asm volatile("call 0x00100040" : "=c"(len) : "c"(nbr), "D"(str));
  return len;
}


x86 assembly (clang, -O0):
<b_input_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdi
call   100040 <completed.0+0xfc020>
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_input_string>:
mov    %rsi,%rcx
call   100040 <completed.0+0xfc020>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b_input_string(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i8*, i8** %3
%8 = call i64 asm sideeffect "call 0x00100040", "={cx},{cx},{di},~{dirflag},~{fpsr},~{flags}"(i64 %6, i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @b_input_string(i8* %0, i64 %1) {
%3 = tail call i64 asm sideeffect "call 0x00100040", "={cx},{cx},{di},~{dirflag},~{fpsr},~{flags}"(i64 %1, i8* %0)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sommeTableau(int *, int);
int main() {
  int Tableau[9] = {12, 78, 1000, 101, 100, 1, 2, 90, 1}, resultat = 0;
  resultat = sommeTableau(Tableau, 9);
  printf("%d\n", resultat);
  printf("%d\n", Tableau[6]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1040 <sommeTableau@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <sommeTableau@plt>
lea    0xeca(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.Tableau = [9 x i32] [i32 12, i32 78, i32 1000, i32 101, i32 100, i32 1, i32 2, i32 90, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [9 x i32]* %2 to i8*
store i32 0, i32* %3
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%6 = call i32 @sommeTableau(i32* %5, i32 9)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 6
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.Tableau = [9 x i32] [i32 12, i32 78, i32 1000, i32 101, i32 100, i32 1, i32 2, i32 90, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @sommeTableau(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
scalar_t__ getchar();
scalar_t__ ispunct(char);
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char c = NULL;
  c = (char)getchar();
  if (ispunct(c)) {
    printf("%02x is Punctuation Character!\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <ispunct@plt>
cmp    $0x0,%rax
je     1170 <main+0x40>
lea    0xe99(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %rax,%rbx
movsbl %bl,%edi
call   1040 <ispunct@plt>
test   %rax,%rax
je     1157 <main+0x27>
movsbl %bl,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"%02x is Punctuation Character!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
%3 = call i64 (...) @getchar()
%4 = trunc i64 %3 to i8
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = call i64 @ispunct(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i8, i8* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8 signext %9)
br label %11
11: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"%02x is Punctuation Character!\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = trunc i64 %1 to i8
%3 = tail call i64 @ispunct(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8 signext %2)
br label %7
7: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
unsigned int __gnu_f2h_internal(unsigned int, int);
unsigned int __gnu_f2h_ieee(unsigned int a) { return __gnu_f2h_internal(a, 1); }


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

x86 assembly (clang, -O2):
<__gnu_f2h_ieee>:
mov    $0x1,%esi
jmp    1030 <__gnu_f2h_internal@plt>

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

LLVM IR (-O2):
define i32 @__gnu_f2h_ieee(i32 %0) {
%2 = tail call i32 @__gnu_f2h_internal(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ e_eor();
int /*<<< orphan*/ e_izpy();
void e_eor_izpy() {
  e_izpy();
  e_eor();
}


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

x86 assembly (clang, -O2):
<e_eor_izpy>:
push   %rax
xor    %eax,%eax
call   1030 <e_izpy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_eor@plt>

LLVM IR (-O0):
define void @e_eor_izpy() {
%1 = call i32 (...) @e_izpy()
%2 = call i32 (...) @e_eor()
ret void
}

LLVM IR (-O2):
define void @e_eor_izpy() {
%1 = tail call i32 (...) @e_izpy()
%2 = tail call i32 (...) @e_eor()
ret void
}
float f_pi() { return 3.1415926535f; }


x86 assembly (clang, -O0):
<f_pi>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_pi>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @f_pi() {
ret float 0x400921FB60000000
}

LLVM IR (-O2):
define float @f_pi() {
ret float 0x400921FB60000000
}
long long bit22() { return 0x0000000000400000LL; }


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

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

LLVM IR (-O0):
define i64 @bit22() {
ret i64 4194304
}

LLVM IR (-O2):
define i64 @bit22() {
ret i64 4194304
}
/* Variables and functions */
int /*<<< orphan*/ CTP();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sendAndRecv(int, int /*<<< orphan*/, char *);
scalar_t__ strcmp(char *, char *);
int sendCTP(int socketDescriptor, char *response) {
  sendAndRecv(socketDescriptor, CTP(), response);
  if (strcmp(response, "200 OK: Closing Connection\n") != 0) {
    printf("CTP failed");
    exit(0);
  }
  return 1;
}


x86 assembly (clang, -O0):
<sendCTP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <CTP@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1070 <sendAndRecv@plt>
mov    -0x10(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11a7 <sendCTP+0x57>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendCTP>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1060 <CTP@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1070 <sendAndRecv@plt>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    118b <sendCTP+0x3b>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"200 OK: Closing Connection\0A\00"
@.str.1 = [11 x i8] c"CTP failed\00"
define i32 @sendCTP(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 = call i32 (...) @CTP()
%7 = load i8*, i8** %4
%8 = call i32 @sendAndRecv(i32 %5, i32 %6, i8* %7)
%9 = load i8*, i8** %4
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %2
ret i32 1
}

LLVM IR (-O2):
@.str = [28 x i8] c"200 OK: Closing Connection\0A\00"
@.str.1 = [11 x i8] c"CTP failed\00"
define i32 @sendCTP(i32 %0, i8* %1) {
%3 = tail call i32 (...) @CTP()
%4 = tail call i32 @sendAndRecv(i32 %0, i32 %3, i8* %1)
%5 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %2
ret i32 1
}
void dummyaudio_VolumeUp(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dummyaudio_VolumeUp() {
ret void
}
/* Variables and functions */
double Double_0_toDouble_2_Boolean(bool value) { return value ? 1.0 : 0.0; }


x86 assembly (clang, -O0):
<Double_0_toDouble_2_Boolean>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsd  0xeee(%rip),%xmm0
xorps  %xmm1,%xmm1
movsd  %xmm1,-0x18(%rbp)
cmp    $0x0,%eax
movsd  %xmm0,-0x10(%rbp)
jne    1132 <Double_0_toDouble_2_Boolean+0x32>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Double_0_toDouble_2_Boolean>:
xorps  %xmm0,%xmm0
test   %edi,%edi
je     110f <Double_0_toDouble_2_Boolean+0xf>
movsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Double_0_toDouble_2_Boolean(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, double 1.000000e+00, double 0.000000e+00
ret double %6
}

LLVM IR (-O2):
define double @Double_0_toDouble_2_Boolean(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, double 0.000000e+00, double 1.000000e+00
ret double %3
}
void gfx_outb(unsigned short port, unsigned char data) {}


x86 assembly (clang, -O0):
<gfx_outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @gfx_outb(i16 zeroext %0, i8 zeroext %1) {
ret void
}
int ITreePointCmp(const int *_One, const int _Two) { return *_One - _Two; }


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

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

LLVM IR (-O0):
define i32 @ITreePointCmp(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* %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ITreePointCmp(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = sub nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mvaddstr(int, int, char *);
int fromwho() {
  mvaddstr(21, 13, "Mark Hessling - (M.Hessling@qut.edu.au)");
  return (0);
}


x86 assembly (clang, -O0):
<fromwho>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15,%edi
mov    $0xd,%esi
lea    0xedb(%rip),%rdx
call   1030 <mvaddstr@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromwho>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x15,%edi
mov    $0xd,%esi
call   1030 <mvaddstr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Mark Hessling - (M.Hessling@qut.edu.au)\00"
define i32 @fromwho() {
%1 = call i32 @mvaddstr(i32 21, i32 13, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Mark Hessling - (M.Hessling@qut.edu.au)\00"
define i32 @fromwho() {
%1 = tail call i32 @mvaddstr(i32 21, i32 13, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PipeRead(int *, int);
int /*<<< orphan*/ printf(char *);
void ReadProcess(int fd[2]) {
  printf("Read Process :  Time 1\n");
  PipeRead(fd, 50);
  printf("Read Process :  Time 2\n");
  PipeRead(fd, 50);
  printf("Read Process :  Time 3\n");
  PipeRead(fd, 50 + 20);
}


x86 assembly (clang, -O0):
<ReadProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x32,%esi
call   1040 <PipeRead@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x32,%esi
call   1040 <PipeRead@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x46,%esi
call   1040 <PipeRead@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadProcess>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x32,%esi
call   1040 <PipeRead@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x32,%esi
call   1040 <PipeRead@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x46,%esi
pop    %rbx
jmp    1040 <PipeRead@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Read Process : Time 1\0A\00"
@.str.1 = [24 x i8] c"Read Process : Time 2\0A\00"
@.str.2 = [24 x i8] c"Read Process : Time 3\0A\00"
define void @ReadProcess(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @PipeRead(i32* %4, i32 50)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @PipeRead(i32* %7, i32 50)
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32*, i32** %2
%11 = call i32 @PipeRead(i32* %10, i32 70)
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Read Process : Time 1\00"
@str.3 = [23 x i8] c"Read Process : Time 2\00"
@str.4 = [23 x i8] c"Read Process : Time 3\00"
define void @ReadProcess(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @PipeRead(i32* %0, i32 50)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @PipeRead(i32* %0, i32 50)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0))
%7 = tail call i32 @PipeRead(i32* %0, i32 70)
ret void
}
unsigned int f(unsigned int x, unsigned int y) { return x + y; }


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

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = add i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct packet {
  int dummy;
};

/* Variables and functions */
struct packet *packet_copy_with_headroom(struct packet *, int /*<<< orphan*/);
struct packet *packet_copy(struct packet *old_packet) {
  return packet_copy_with_headroom(old_packet, 0);
}


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

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

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

LLVM IR (-O2):
%struct.packet = type { i32 }
define %struct.packet* @packet_copy(%struct.packet* %0) {
%2 = tail call %struct.packet* @packet_copy_with_headroom(%struct.packet* %0, i32 0)
ret %struct.packet* %2
}
/* Variables and functions */
double *malloc(int);
extern double *ReturnDouble() {
  double *i = malloc(sizeof(double));
  *i = 99.9;
  return i;
}


x86 assembly (clang, -O0):
<ReturnDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xece(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReturnDouble>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
movabs $0x4058f9999999999a,%rcx
f9 58 40
mov    %rcx,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define double* @ReturnDouble() {
%1 = alloca double*
%2 = call double* @malloc(i32 8)
store double* %2, double** %1
%3 = load double*, double** %1
store double 9.990000e+01, double* %3
%4 = load double*, double** %1
ret double* %4
}

LLVM IR (-O2):
define noalias double* @ReturnDouble() {
%1 = tail call double* @malloc(i32 8)
store double 9.990000e+01, double* %1
ret double* %1
}
/* Variables and functions */
double fmod(double, double);
double sawr(double x) {
  return fmod(x + 3.14159265358979323846, 6.28318530717958647693) /
             3.14159265358979323846 -
         1.0;
}


x86 assembly (clang, -O0):
<sawr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <fmod@plt>
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb5(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sawr>:
push   %rax
addsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
divsd  0xed2(%rip),%xmm0
addsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sawr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 0x400921FB54442D18
%5 = call double @fmod(double %4, double 0x401921FB54442D18)
%6 = fdiv double %5, 0x400921FB54442D18
%7 = fsub double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @sawr(double %0) {
%2 = fadd double %0, 0x400921FB54442D18
%3 = tail call double @fmod(double %2, double 0x401921FB54442D18)
%4 = fdiv double %3, 0x400921FB54442D18
%5 = fadd double %4, -1.000000e+00
ret double %5
}
/* Variables and functions */
size_t L(size_t i) { return (i * 2 + 1); }


x86 assembly (clang, -O0):
<L>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<L>:
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @L(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 2
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @L(i64 %0) {
%2 = shl i64 %0, 1
%3 = or i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ gluiPostRedisplay();
int /*<<< orphan*/ glutTimerFunc(int, void (*)(), int /*<<< orphan*/);
void idle() {
  gluiPostRedisplay();
  glutTimerFunc(30, idle, 0);
}


x86 assembly (clang, -O0):
<idle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gluiPostRedisplay@plt>
mov    $0x1e,%edi
mov    0x2ea9(%rip),%rsi
xor    %edx,%edx
call   1040 <glutTimerFunc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<idle>:
push   %rax
xor    %eax,%eax
call   1030 <gluiPostRedisplay@plt>
mov    0x2eb1(%rip),%rsi
mov    $0x1e,%edi
xor    %edx,%edx
pop    %rax
jmp    1040 <glutTimerFunc@plt>

LLVM IR (-O0):
define void @idle() {
%1 = call i32 (...) @gluiPostRedisplay()
%2 = call i32 @glutTimerFunc(i32 30, void (...)* bitcast (void ()* @idle to void (...)*), i32 0)
ret void
}

LLVM IR (-O2):
define void @idle() {
%1 = tail call i32 (...) @gluiPostRedisplay()
%2 = tail call i32 @glutTimerFunc(i32 30, void (...)* bitcast (void ()* @idle to void (...)*), i32 0)
ret void
}
void *test_anti_range_131(signed char n) {
  extern void *alloc_anti_range_131(signed char) __attribute__((alloc_size(1)));
  if ((-0x7f - 1) + 2 <= n && n <= 2)
    n = (-0x7f - 1) + 2 - 1;
  return alloc_anti_range_131(n);
}


x86 assembly (clang, -O0):
<test_anti_range_131>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0xffffff82,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_131+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jg     1140 <test_anti_range_131+0x30>
movb   $0x81,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_131@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_131>:
lea    0x7e(%rdi),%eax
cmp    $0x81,%al
mov    $0x81,%eax
cmovae %edi,%eax
movsbl %al,%edi
jmp    1030 <alloc_anti_range_131@plt>

LLVM IR (-O0):
define i8* @test_anti_range_131(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 -126, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 -127, i8* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i8, i8* %2
%13 = call i8* @alloc_anti_range_131(i8 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_131(i8 signext %0) {
%2 = add i8 %0, 126
%3 = icmp ult i8 %2, -127
%4 = select i1 %3, i8 -127, i8 %0
%5 = tail call i8* @alloc_anti_range_131(i8 signext %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _head_error(char const *message, int ret) {
  fputs("head"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_head_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_head_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"head: \00"
@stderr = global i32 0
define i32 @_head_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"head: \00"
@stderr = global i32 0
define i32 @_head_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
float ANTweenTimingFunctionBounceOut(float, int /*<<< orphan*/, int, float);
float ANTweenProgressTimingFunctionBounceOut(float time, float duration) {
  return ANTweenTimingFunctionBounceOut(time, 0, 1, duration);
}


x86 assembly (clang, -O0):
<ANTweenProgressTimingFunctionBounceOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <ANTweenTimingFunctionBounceOut@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenProgressTimingFunctionBounceOut>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <ANTweenTimingFunctionBounceOut@plt>

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

LLVM IR (-O2):
define float @ANTweenProgressTimingFunctionBounceOut(float %0, float %1) {
%3 = tail call float @ANTweenTimingFunctionBounceOut(float %0, i32 0, i32 1, float %1)
ret float %3
}
/* Variables and functions */
int controller_main(int, char **);
int main(int argc, char **argv) { return controller_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <controller_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <controller_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @controller_main(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ xvEncodingInfo;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int sz_xvEncodingInfo;
int main(void) {
  printf("sizeof(xvEncodingInfo) %u\n", sizeof(xvEncodingInfo));
  printf("sz_xvEncodingInfo %u\n", sz_xvEncodingInfo);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%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
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"sizeof(xvEncodingInfo) %u\0A\00"
@.str.1 = [22 x i8] c"sz_xvEncodingInfo %u\0A\00"
@sz_xvEncodingInfo = global i32 0
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 4)
%3 = load i32, i32* @sz_xvEncodingInfo
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"sizeof(xvEncodingInfo) %u\0A\00"
@.str.1 = [22 x i8] c"sz_xvEncodingInfo %u\0A\00"
@sz_xvEncodingInfo = global i32 0
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 4)
%2 = load i32, i32* @sz_xvEncodingInfo
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @putchar(i32 10)
ret i32 0
}