xunge/DecIR huggingface dataset:
void fun(int k, int *iptr) {
  k++;
  (*iptr)++;
}


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

x86 assembly (clang, -O2):
<fun>:
addl   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @fun(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 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @fun(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
ret void
}
void xy_to_upvp(double xc, double yc, double *up, double *vp) {
  *up = 4 * xc / (-2 * xc + 12 * yc + 3);
  *vp = 9 * yc / (-2 * xc + 12 * yc + 3);
}


x86 assembly (clang, -O0):
<xy_to_upvp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  0xefa(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xed8(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
addsd  %xmm2,%xmm2
subsd  %xmm2,%xmm1
movsd  0xebb(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xeb3(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xe99(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
addsd  %xmm2,%xmm2
subsd  %xmm2,%xmm1
movsd  0xe7c(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xy_to_upvp>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xef4(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm3
addsd  0xee8(%rip),%xmm3
divsd  %xmm3,%xmm2
movsd  %xmm2,(%rdi)
mulsd  0xee0(%rip),%xmm1
divsd  %xmm3,%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @xy_to_upvp(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = fmul double 4.000000e+00, %9
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fmul double 1.200000e+01, %12
%14 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %11, double %13)
%15 = fadd double %14, 3.000000e+00
%16 = fdiv double %10, %15
%17 = load double*, double** %7
store double %16, double* %17
%18 = load double, double* %6
%19 = fmul double 9.000000e+00, %18
%20 = load double, double* %5
%21 = load double, double* %6
%22 = fmul double 1.200000e+01, %21
%23 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %20, double %22)
%24 = fadd double %23, 3.000000e+00
%25 = fdiv double %19, %24
%26 = load double*, double** %8
store double %25, double* %26
ret void
}

LLVM IR (-O2):
define void @xy_to_upvp(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fmul double %0, 4.000000e+00
%6 = fmul double %1, 1.200000e+01
%7 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double %6)
%8 = fadd double %7, 3.000000e+00
%9 = fdiv double %5, %8
store double %9, double* %2
%10 = fmul double %1, 9.000000e+00
%11 = fdiv double %10, %8
store double %11, double* %3
ret void
}
int swap_flags(int flags, int f1, int f2) {
  int t = 0;
  if (f1 & flags)
    t |= f2;
  if (f2 & flags)
    t |= f1;
  t |= (flags & ~(f1 | f2));
  return t;
}


x86 assembly (clang, -O0):
<swap_flags>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     112c <swap_flags+0x2c>
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1144 <swap_flags+0x44>
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
or     -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_flags>:
mov    %esi,%eax
and    %edi,%eax
cmovne %edx,%eax
mov    %edx,%ecx
and    %edi,%ecx
cmovne %esi,%ecx
or     %esi,%edx
not    %edx
and    %edi,%edx
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @swap_flags(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
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %8, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = or i32 %14, %13
store i32 %15, i32* %7
br label %16
16: ; preds = %12, %3
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = and i32 %17, %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %16
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = or i32 %23, %22
store i32 %24, i32* %7
br label %25
25: ; preds = %21, %16
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = or i32 %27, %28
%30 = xor i32 %29, -1
%31 = and i32 %26, %30
%32 = load i32, i32* %7
%33 = or i32 %32, %31
store i32 %33, i32* %7
%34 = load i32, i32* %7
ret i32 %34
}

LLVM IR (-O2):
define i32 @swap_flags(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 0, i32 %2
%7 = and i32 %2, %0
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 0, i32 %1
%10 = or i32 %2, %1
%11 = xor i32 %10, -1
%12 = and i32 %11, %0
%13 = or i32 %12, %6
%14 = or i32 %13, %9
ret i32 %14
}
/* Variables and functions */
char *SafeInitialiseString_m(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *IntToString_m(int input) {
  int size = 10;
  char *output = SafeInitialiseString_m(size);
  snprintf(output, size, "%d", input);
  return output;
}


x86 assembly (clang, -O0):
<IntToString_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <SafeInitialiseString_m@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%ecx
lea    0xeb1(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntToString_m>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xa,%edi
call   1040 <SafeInitialiseString_m@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rdx
mov    %rax,%rdi
mov    $0xa,%esi
mov    %ebp,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @IntToString_m(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
store i32 10, i32* %3
%5 = load i32, i32* %3
%6 = call i8* @SafeInitialiseString_m(i32 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @IntToString_m(i32 %0) {
%2 = tail call i8* @SafeInitialiseString_m(i32 10)
%3 = tail call i32 @snprintf(i8* %2, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
void random_adc_init() {}


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

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

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

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

/* Variables and functions */
scalar_t__ getSizeBinaryTree(struct binaryTree *);
scalar_t__ getSumBinaryTree(struct binaryTree *);
double getArithmeticMeanBinaryTree(struct binaryTree *tree) {
  return (double)getSumBinaryTree(tree) / (double)getSizeBinaryTree(tree);
}


x86 assembly (clang, -O0):
<getArithmeticMeanBinaryTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getSumBinaryTree@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getSizeBinaryTree@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getArithmeticMeanBinaryTree>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <getSumBinaryTree@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <getSizeBinaryTree@plt>
cvtsi2sd %rax,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.binaryTree = type { i32 }
define double @getArithmeticMeanBinaryTree(%struct.binaryTree* %0) {
%2 = alloca %struct.binaryTree*
store %struct.binaryTree* %0, %struct.binaryTree** %2
%3 = load %struct.binaryTree*, %struct.binaryTree** %2
%4 = call i64 @getSumBinaryTree(%struct.binaryTree* %3)
%5 = sitofp i64 %4 to double
%6 = load %struct.binaryTree*, %struct.binaryTree** %2
%7 = call i64 @getSizeBinaryTree(%struct.binaryTree* %6)
%8 = sitofp i64 %7 to double
%9 = fdiv double %5, %8
ret double %9
}

LLVM IR (-O2):
%struct.binaryTree = type { i32 }
define double @getArithmeticMeanBinaryTree(%struct.binaryTree* %0) {
%2 = tail call i64 @getSumBinaryTree(%struct.binaryTree* %0)
%3 = sitofp i64 %2 to double
%4 = tail call i64 @getSizeBinaryTree(%struct.binaryTree* %0)
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
ret double %6
}
void scalar_butterfly(float a[restrict 1], float b[restrict 1]) {
  const float new_a = *a + *b;
  const float new_b = *a - *b;
  *a = new_a;
  *b = new_b;
}


x86 assembly (clang, -O0):
<scalar_butterfly>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalar_butterfly>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
subss  %xmm1,%xmm0
movss  %xmm2,(%rdi)
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @scalar_butterfly(float* noalias %0, float* noalias %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
%6 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%7 = load float*, float** %3
%8 = load float, float* %7
%9 = load float*, float** %4
%10 = load float, float* %9
%11 = fadd float %8, %10
store float %11, float* %5
%12 = load float*, float** %3
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = load float, float* %14
%16 = fsub float %13, %15
store float %16, float* %6
%17 = load float, float* %5
%18 = load float*, float** %3
store float %17, float* %18
%19 = load float, float* %6
%20 = load float*, float** %4
store float %19, float* %20
ret void
}

LLVM IR (-O2):
define void @scalar_butterfly(float* noalias nocapture %0, float* noalias nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fadd float %3, %4
%6 = fsub float %3, %4
store float %5, float* %0
store float %6, float* %1
ret void
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
int errno;
int /*<<< orphan*/ printf(char *, int);
size_t recv(int, void *, size_t, int);
int recv_data(int socket, void *buffer, size_t size, int flags) {
  ssize_t rc = recv(socket, buffer, size, flags);
  if (rc < 0) {
    printf("recv failed: %d\n", errno);
    return -1;
  }
  if (rc != size)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<recv_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <recv@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jae    1179 <recv_data+0x59>
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    119a <recv_data+0x7a>
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1193 <recv_data+0x73>
movl   $0x1,-0x4(%rbp)
jmp    119a <recv_data+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_data>:
push   %rbx
mov    %rdx,%rbx
call   1030 <recv@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"recv failed: %d\0A\00"
@errno = global i32 0
define i32 @recv_data(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i64
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32 %3, i32* %9
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i32, i32* %9
%15 = call i64 @recv(i32 %11, i8* %12, i64 %13, i32 %14)
store i64 %15, i64* %10
%16 = load i64, i64* %10
%17 = icmp ult i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %4
%19 = load i32, i32* @errno
%20 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %19)
store i32 -1, i32* %5
br label %27
21: ; preds = %4
%22 = load i64, i64* %10
%23 = load i64, i64* %8
%24 = icmp ne i64 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 1, i32* %5
br label %27
26: ; preds = %21
store i32 0, i32* %5
br label %27
27: ; preds = %26, %25, %18
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @recv_data(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i64 @recv(i32 %0, i8* %1, i64 %2, i32 %3)
%6 = icmp ne i64 %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
double log(double);
double loga(double x) { return log(x); }


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

x86 assembly (clang, -O2):
<loga>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define double @loga(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
int gettimeofday(struct timeval *p, void *z) {}


x86 assembly (clang, -O0):
<gettimeofday>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeval = type opaque
define i32 @gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.timeval*
%5 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %4
store i8* %1, i8** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.timeval = type opaque
define i32 @gettimeofday(%struct.timeval* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int rand();
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void random_key(char *s) {
  int i;
  for (i = 0; i < 76; ++i)
    snprintf(s + i, sizeof(s), "%x", rand() % 16);
}


x86 assembly (clang, -O0):
<random_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4c,-0xc(%rbp)
jge    1180 <random_key+0x60>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x18(%rbp),%rdi
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x8,%esi
lea    0xe93(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <random_key+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_key>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
lea    0xece(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%r15,%rbx,1),%r12
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xf(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff0,%ecx
sub    %ecx,%eax
mov    %r12,%rdi
mov    $0x8,%esi
mov    %r14,%rdx
mov    %eax,%ecx
call   1030 <snprintf@plt>
add    $0x1,%rbx
cmp    $0x4c,%rbx
jne    1140 <random_key+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define void @random_key(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 76
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = call i32 (...) @rand()
%13 = srem i32 %12, 16
%14 = call i32 @snprintf(i8* %11, i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define void @random_key(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %8, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 16
%7 = tail call i32 @snprintf(i8* %4, i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i64 %3, 1
%9 = icmp eq i64 %8, 76
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t macho_segbase(int32_t section) { return section; }


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

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

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

LLVM IR (-O2):
define i32 @macho_segbase(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *srealloc(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if (p == NULL) {
    fprintf(stderr, "There was not enough space on the heap. Aborting.\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<srealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <srealloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <srealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"There was not enough space on the heap. Aborting.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @srealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"There was not enough space on the heap. Aborting.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @srealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
__attribute__((weak)) bool bar1() { return false; }


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

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

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

LLVM IR (-O2):
define weak i32 @bar1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ i2c_EnableStandardHSM(int);
void i2c1_EnableStandardHSM(void) { i2c_EnableStandardHSM(1); }


x86 assembly (clang, -O0):
<i2c1_EnableStandardHSM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <i2c_EnableStandardHSM@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c1_EnableStandardHSM>:
mov    $0x1,%edi
jmp    1030 <i2c_EnableStandardHSM@plt>

LLVM IR (-O0):
define void @i2c1_EnableStandardHSM() {
%1 = call i32 @i2c_EnableStandardHSM(i32 1)
ret void
}

LLVM IR (-O2):
define void @i2c1_EnableStandardHSM() {
%1 = tail call i32 @i2c_EnableStandardHSM(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void vgDestroyOffScreenSH(void *oscontext) {
  printf("shOffscreenRender not implemented!\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"shOffscreenRender not implemented!\0A\00"
define void @vgDestroyOffScreenSH(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"shOffscreenRender not implemented!\00"
define void @vgDestroyOffScreenSH(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *find(char *haystack, char needle) {
  char *c = NULL;
  while (*haystack) {
    if (*haystack == needle) {
      c = haystack;
      break;
    }
    haystack++;
  }
  return c;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1154 <find+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1143 <find+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1154 <find+0x54>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <find+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <find+0x21>
mov    %rdi,%rax
nopl   0x0(%rax)
cmp    %sil,%cl
je     1123 <find+0x23>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <find+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @find(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8 [ %11, %9 ], [ %3, %2 ]
%7 = phi i8* [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i8 %6, %1
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %9, %5, %2
%14 = phi i8* [ null, %2 ], [ %7, %5 ], [ null, %9 ]
ret i8* %14
}
/* Variables and functions */
void *malloc(int);
int main(void) {
  void *buf = malloc(128 << 20);
  return buf == NULL;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8000000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 134217728)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int futex_wake(int *futex) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @futex_wake(i32* nocapture readnone %0) {
ret i32 -1
}
void foo_2_2_1_2_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_2_2_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void handler(int sig) {
  printf("rev sig=%d\n", sig);
  sleep(5);
}


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

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
pop    %rax
jmp    1040 <sleep@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"rev sig=%d\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 5)
ret void
}
void foo() {
  double x = 4, y;
  __asm__ volatile("" : "=r,r"(x), "=r,r"(y) : "%0,0"(x), "m,r"(8));
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  0xefc(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movq   %rcx,%xmm0
movq   %rax,%xmm1
movsd  %xmm1,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movabs $0x4010000000000000,%rax
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca double
%2 = alloca double
store double 4.000000e+00, double* %1
%3 = load double, double* %1
%4 = call { double, double } asm sideeffect "", "=r|r,=r|r,%0|0,m|r,~{dirflag},~{fpsr},~{flags}"(double %3, i32 8)
%5 = extractvalue { double, double } %4, 0
%6 = extractvalue { double, double } %4, 1
store double %5, double* %1
store double %6, double* %2
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call { double, double } asm sideeffect "", "=r|r,=r|r,%0|0,m|r,~{dirflag},~{fpsr},~{flags}"(double 4.000000e+00, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ erreurUsage(int);
int /*<<< orphan*/ exit(int);
void validNbEvaluations(int evaluations) {
  if (evaluations > 5 || evaluations < 1) {
    erreurUsage(4);
    exit(4);
  }
}


x86 assembly (clang, -O0):
<validNbEvaluations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jg     113f <validNbEvaluations+0x1f>
cmpl   $0x1,-0x4(%rbp)
jge    1153 <validNbEvaluations+0x33>
mov    $0x4,%edi
call   1030 <erreurUsage@plt>
mov    $0x4,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validNbEvaluations>:
add    $0xfffffffa,%edi
cmp    $0xfffffffa,%edi
jbe    1129 <validNbEvaluations+0x9>
ret
push   %rax
mov    $0x4,%edi
call   1030 <erreurUsage@plt>
mov    $0x4,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @validNbEvaluations(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 5
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %5, %1
%9 = call i32 @erreurUsage(i32 4)
%10 = call i32 @exit(i32 4)
unreachable
11: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @validNbEvaluations(i32 %0) {
%2 = add i32 %0, -6
%3 = icmp ult i32 %2, -5
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @erreurUsage(i32 4)
%6 = tail call i32 @exit(i32 4)
unreachable
7: ; preds = %1
ret void
}
unsigned long long ms_mem_bus_to_MIU(unsigned long long x) {
  return ((x)-0x40000000);
}


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

x86 assembly (clang, -O2):
<ms_mem_bus_to_MIU>:
lea    -0x40000000(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @ms_mem_bus_to_MIU(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1073741824
ret i64 %4
}

LLVM IR (-O2):
define i64 @ms_mem_bus_to_MIU(i64 %0) {
%2 = add i64 %0, -1073741824
ret i64 %2
}
double kgToCM(double kg) { return ((60 * 60 * 24 * kg) / 10.0); }


x86 assembly (clang, -O0):
<kgToCM>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kgToCM>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @kgToCM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 8.640000e+04, %3
%5 = fdiv double %4, 1.000000e+01
ret double %5
}

LLVM IR (-O2):
define double @kgToCM(double %0) {
%2 = fmul double %0, 8.640000e+04
%3 = fdiv double %2, 1.000000e+01
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int /*<<< orphan*/ iswspace(int /*<<< orphan*/);
void uninitvar_iswspace(void) {
  wint_t i;
  (void)iswspace(i);
}


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

x86 assembly (clang, -O2):
<uninitvar_iswspace>:
jmp    1030 <iswspace@plt>

LLVM IR (-O0):
define void @uninitvar_iswspace() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @iswspace(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_iswspace() {
%1 = tail call i32 @iswspace(i32 undef)
ret void
}
/* Variables and functions */
scalar_t__ chown(char *, int, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (chown(argv[1], 1021, 1011) < 0)
    printf("error\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x3fd,%esi
mov    $0x3f3,%edx
call   1040 <chown@plt>
cmp    $0x0,%rax
jge    1163 <main+0x43>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    $0x3fd,%esi
mov    $0x3f3,%edx
call   1040 <chown@plt>
test   %rax,%rax
jns    1145 <main+0x25>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"error\0A\00"
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i64 @chown(i8* %8, i32 1021, i32 1011)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"error\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @chown(i8* %4, i32 1021, i32 1011)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i32 0
}
int test_imm_E4uint8_reg(unsigned char val) {
  return ((val) & (0xE4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E4uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xe4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E4uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -28
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int get_brightness();
int get_max_brightness();
int /*<<< orphan*/ set_brightness(int);
void inc_brightness() {
  int brightness, max_brightness;
  brightness = get_brightness();
  max_brightness = get_max_brightness();
  if (brightness < max_brightness) {
    set_brightness(brightness + 1);
  }
}


x86 assembly (clang, -O0):
<inc_brightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <get_brightness@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_max_brightness@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1163 <inc_brightness+0x33>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <set_brightness@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_brightness>:
push   %rbx
xor    %eax,%eax
call   1050 <get_brightness@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <get_max_brightness@plt>
cmp    %eax,%ebx
jge    1150 <inc_brightness+0x20>
add    $0x1,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <set_brightness@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @inc_brightness() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @get_brightness()
store i32 %3, i32* %1
%4 = call i32 (...) @get_max_brightness()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
%11 = call i32 @set_brightness(i32 %10)
br label %12
12: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
define void @inc_brightness() {
%1 = tail call i32 (...) @get_brightness()
%2 = tail call i32 (...) @get_max_brightness()
%3 = icmp slt i32 %1, %2
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = add nsw i32 %1, 1
%6 = tail call i32 @set_brightness(i32 %5)
br label %7
7: ; preds = %4, %0
ret void
}
void buffer_clean(char *buffer, int size, char c) {
  int i;
  i = 0;
  while (i < size)
    buffer[i++] = c;
}


x86 assembly (clang, -O0):
<buffer_clean>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1140 <buffer_clean+0x40>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1117 <buffer_clean+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_clean>:
test   %esi,%esi
jle    1126 <buffer_clean+0x16>
push   %rax
mov    %esi,%eax
movzbl %dl,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @buffer_clean(i8* %0, i32 %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
store i32 0, i32* %7
br label %8
8: ; preds = %12, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i8, i8* %6
%14 = load i8*, i8** %4
%15 = load i32, i32* %7
%16 = add nsw i32 %15, 1
store i32 %16, i32* %7
%17 = sext i32 %15 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
store i8 %13, i8* %18
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @buffer_clean(i8* nocapture writeonly %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void html_write(FILE *filename, char *content) {
  fprintf(filename, "%s", content);
}


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

x86 assembly (clang, -O2):
<html_write>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
define void @html_write(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @fputs(i8* %1, i32* %0)
ret void
}
int test_imm_06int32_mem(int *val) {
  return ((*val) & (0x06 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_06int32_mem>:
testb  $0x6,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_06int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 6
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ThrowRpcError(char const *);
void ThrowXmlRpcError(const char *s) { ThrowRpcError(s); }


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

x86 assembly (clang, -O2):
<ThrowXmlRpcError>:
jmp    1030 <ThrowRpcError@plt>

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

LLVM IR (-O2):
define void @ThrowXmlRpcError(i8* %0) {
%2 = tail call i32 @ThrowRpcError(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int setWanName(char *str, int applicationtype) { strcpy(str, "Internet_"); }


x86 assembly (clang, -O0):
<setWanName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Internet_\00"
define i32 @setWanName(i8* %0, i32 %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(struct timeval *, int /*<<< orphan*/, int);
void timeout_start(struct timeval *start) {
  memset(start, 0, sizeof(*start));
  gettimeofday(start, NULL);
  return;
}


x86 assembly (clang, -O0):
<timeout_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeout_start>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @timeout_start(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @memset(%struct.timeval* %3, i32 0, i32 4)
%5 = load %struct.timeval*, %struct.timeval** %2
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @timeout_start(%struct.timeval* %0) {
%2 = tail call i32 @memset(%struct.timeval* %0, i32 0, i32 4)
%3 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
int comparisonFunction(int *aPtr, int *bPtr) {
  int a = *aPtr;
  int b = *bPtr;
  if (a < b) {
    return -1;
  } else if (a == b) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<comparisonFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <comparisonFunction+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <comparisonFunction+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <comparisonFunction+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <comparisonFunction+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparisonFunction>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comparisonFunction(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
%6 = icmp ne i32 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ printf(char *);
FILE *createFile(const char *nameFile, char *format) {
  FILE *file = fopen(nameFile, format);
  if (file != NULL) {
    return file;
  } else {
    printf("Error al crear/abrir archivo.\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<createFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1166 <createFile+0x36>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<createFile>:
push   %rax
call   1040 <fopen@plt>
test   %rax,%rax
je     113d <createFile+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error al crear/abrir archivo.\0A\00"
define i32* @createFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32*, i32** %5
ret i32* %12
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [30 x i8] c"Error al crear/abrir archivo.\00"
define noalias i32* @createFile(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
ret i32* %3
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ExceptionGroup1(int);
void IllIns(void) { ExceptionGroup1(4); }


x86 assembly (clang, -O0):
<IllIns>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <ExceptionGroup1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IllIns>:
mov    $0x4,%edi
jmp    1030 <ExceptionGroup1@plt>

LLVM IR (-O0):
define void @IllIns() {
%1 = call i32 @ExceptionGroup1(i32 4)
ret void
}

LLVM IR (-O2):
define void @IllIns() {
%1 = tail call i32 @ExceptionGroup1(i32 4)
ret void
}