xunge/DecIR huggingface dataset:
int memcmp(const void *pvMem1, const void *pvMem2, unsigned long ulBytes) {
  const volatile unsigned char *pucMem1 = pvMem1, *pucMem2 = pvMem2;
  register unsigned long x;
  for (x = 0; x < ulBytes; x++) {
    if (pucMem1[x] != pucMem2[x]) {
      break;
    }
  }
  return ulBytes - x;
}


x86 assembly (clang, -O0):
<memcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1175 <memcmp+0x75>
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,1),%al
movzbl %al,%eax
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%rdx
mov    (%rcx,%rdx,1),%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     115f <memcmp+0x5f>
jmp    1175 <memcmp+0x75>
jmp    1164 <memcmp+0x64>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1128 <memcmp+0x28>
mov    -0x18(%rbp),%rax
sub    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcmp>:
mov    %rdx,%rax
xor    %ecx,%ecx
test   %rdx,%rdx
je     1125 <memcmp+0x25>
nopw   0x0(%rax,%rax,1)
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1125 <memcmp+0x25>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <memcmp+0x10>
mov    %rax,%rcx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @memcmp(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%10 = load i8*, i8** %4
store i8* %10, i8** %7
%11 = load i8*, i8** %5
store i8* %11, i8** %8
store i64 0, i64* %9
br label %12
12: ; preds = %30, %3
%13 = load i64, i64* %9
%14 = load i64, i64* %6
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %33
16: ; preds = %12
%17 = load i8*, i8** %7
%18 = load i64, i64* %9
%19 = getelementptr inbounds i8, i8* %17, i64 %18
%20 = load volatile i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8*, i8** %8
%23 = load i64, i64* %9
%24 = getelementptr inbounds i8, i8* %22, i64 %23
%25 = load volatile i8, i8* %24
%26 = zext i8 %25 to i32
%27 = icmp ne i32 %21, %26
br i1 %27, label %28, label %29
28: ; preds = %16
br label %33
29: ; preds = %16
br label %30
30: ; preds = %29
%31 = load i64, i64* %9
%32 = add i64 %31, 1
store i64 %32, i64* %9
br label %12
33: ; preds = %28, %12
%34 = load i64, i64* %6
%35 = load i64, i64* %9
%36 = sub i64 %34, %35
%37 = trunc i64 %36 to i32
ret i32 %37
}

LLVM IR (-O2):
define i32 @memcmp(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %12
%6 = phi i64 [ %13, %12 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load volatile i8, i8* %7
%9 = getelementptr inbounds i8, i8* %1, i64 %6
%10 = load volatile i8, i8* %9
%11 = icmp eq i8 %8, %10
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = add nuw i64 %6, 1
%14 = icmp eq i64 %13, %2
br i1 %14, label %15, label %5
15: ; preds = %12, %5, %3
%16 = phi i64 [ 0, %3 ], [ %6, %5 ], [ %2, %12 ]
%17 = sub i64 %2, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}
int cmp_data(const void *a, const void *b) {
  const double da = **(double **)a;
  const double db = **(double **)b;
  if (da < db)
    return -1;
  else if (da > db)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmp_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114c <cmp_data+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <cmp_data+0x6f>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1168 <cmp_data+0x68>
movl   $0x1,-0x4(%rbp)
jmp    116f <cmp_data+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_data>:
mov    (%rdi),%rax
movsd  (%rax),%xmm0
mov    (%rsi),%rax
movsd  (%rax),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_data(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double**
%10 = load double*, double** %9
%11 = load double, double* %10
store double %11, double* %6
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to double**
%14 = load double*, double** %13
%15 = load double, double* %14
store double %15, double* %7
%16 = load double, double* %6
%17 = load double, double* %7
%18 = fcmp olt double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 -1, i32* %3
br label %26
20: ; preds = %2
%21 = load double, double* %6
%22 = load double, double* %7
%23 = fcmp ogt double %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %3
br label %26
25: ; preds = %20
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %19
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @cmp_data(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double**
%4 = load double*, double** %3
%5 = load double, double* %4
%6 = bitcast i8* %1 to double**
%7 = load double*, double** %6
%8 = load double, double* %7
%9 = fcmp olt double %5, %8
%10 = fcmp ogt double %5, %8
%11 = zext i1 %10 to i32
%12 = select i1 %9, i32 -1, i32 %11
ret i32 %12
}
void gtk_ruler_get_metric() {}


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

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

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

LLVM IR (-O2):
define void @gtk_ruler_get_metric() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trim_left(char *);
int /*<<< orphan*/ trim_right(char *);
char *trim(char *buffer) {
  (void)trim_left(buffer);
  (void)trim_right(buffer);
  return buffer;
}


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

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
call   1040 <trim_left@plt>
mov    %rbx,%rdi
call   1030 <trim_right@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @trim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @trim_left(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @trim_right(i8* %5)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define i8* @trim(i8* returned %0) {
%2 = tail call i32 @trim_left(i8* %0)
%3 = tail call i32 @trim_right(i8* %0)
ret i8* %0
}
/* Variables and functions */
double __nv_expm1(double);
double expm1(double __a) { return __nv_expm1(__a); }


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

x86 assembly (clang, -O2):
<expm1>:
jmp    1030 <__nv_expm1@plt>

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

LLVM IR (-O2):
define double @expm1(double %0) {
%2 = tail call double @__nv_expm1(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int /*<<< orphan*/ stderr;
void aeron_default_error_handler(void *clientd, int errcode,
                                 const char *message) {
  fprintf(stderr, "ERROR: (%d): %s\n", errcode, message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<aeron_default_error_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<aeron_default_error_handler>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"ERROR: (%d): %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @aeron_default_error_handler(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"ERROR: (%d): %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @aeron_default_error_handler(i8* nocapture readnone %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_nondet_String();
int cstrspn(int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  return cstrspn(__VERIFIER_nondet_String(), __VERIFIER_nondet_String());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_String@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_String@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <cstrspn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_String@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_String@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <cstrspn@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @__VERIFIER_nondet_String()
%3 = call i32 (...) @__VERIFIER_nondet_String()
%4 = call i32 @cstrspn(i32 %2, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_String()
%2 = tail call i32 (...) @__VERIFIER_nondet_String()
%3 = tail call i32 @cstrspn(i32 %1, i32 %2)
ret i32 %3
}
read(j, i, p) { write(j / p + p, i-- - j, i / i); }


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,%edi
add    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %esi,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
sub    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
add    %eax,%ecx
sub    %edi,%esi
mov    %ecx,%edi
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @read(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %7
%10 = sdiv i32 %8, %9
%11 = load i32, i32* %7
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %6
%14 = add nsw i32 %13, -1
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = sub nsw i32 %13, %15
%17 = load i32, i32* %6
%18 = load i32, i32* %6
%19 = sdiv i32 %17, %18
%20 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i32, i32, ...)*)(i32 %12, i32 %16, i32 %19)
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @read(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %0, %2
%5 = add nsw i32 %4, %2
%6 = sub nsw i32 %1, %0
%7 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 1)
ret i32 undef
}
void setICparams(struct domain *theDomain) {}


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

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

LLVM IR (-O0):
%struct.domain = type opaque
define void @setICparams(%struct.domain* %0) {
%2 = alloca %struct.domain*
store %struct.domain* %0, %struct.domain** %2
ret void
}

LLVM IR (-O2):
%struct.domain = type opaque
define void @setICparams(%struct.domain* nocapture %0) {
ret void
}
float AngleMod(float a) {
  return (360.0 / 65536) * ((int)(a * (65536 / 360.0)) & 65535);
}


x86 assembly (clang, -O0):
<AngleMod>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
and    $0xffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AngleMod>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
movzwl %ax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xee6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @AngleMod(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x4066C16C16C16C17
%6 = fptosi double %5 to i32
%7 = and i32 %6, 65535
%8 = sitofp i32 %7 to double
%9 = fmul double 0x3F76800000000000, %8
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @AngleMod(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x4066C16C16C16C17
%4 = fptosi double %3 to i32
%5 = and i32 %4, 65535
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x3F76800000000000
%8 = fptrunc double %7 to float
ret float %8
}
double AUX2bp0a(double x) { return 1.0; }


x86 assembly (clang, -O0):
<AUX2bp0a>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @AUX2bp0a(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @AUX2bp0a(double %0) {
ret double 1.000000e+00
}
unsigned long long int fibonacci(unsigned int n) {
  unsigned long long int results = 1;
  if (n == 0 || n == 1) {
    return n;
  } else {
    results = fibonacci(n - 1) + fibonacci(n - 2);
  }
  return results;
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movq   $0x1,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1137 <fibonacci+0x27>
cmpl   $0x1,-0xc(%rbp)
jne    1143 <fibonacci+0x33>
mov    -0xc(%rbp),%eax
mov    %rax,-0x8(%rbp)
jmp    1173 <fibonacci+0x63>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %r14d,%r14d
cmp    $0x2,%edi
jb     1133 <fibonacci+0x23>
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    $0xfffffffe,%ebx
add    %rax,%r14
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
mov    %ebx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fibonacci(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %3, label %8
3: ; preds = %8, %1
%4 = phi i64 [ 0, %1 ], [ %14, %8 ]
%5 = phi i32 [ %0, %1 ], [ %13, %8 ]
%6 = zext i32 %5 to i64
%7 = add i64 %4, %6
ret i64 %7
8: ; preds = %1, %8
%9 = phi i32 [ %13, %8 ], [ %0, %1 ]
%10 = phi i64 [ %14, %8 ], [ 0, %1 ]
%11 = add i32 %9, -1
%12 = tail call i64 @fibonacci(i32 %11)
%13 = add i32 %9, -2
%14 = add i64 %12, %10
%15 = icmp ult i32 %13, 2
br i1 %15, label %3, label %8
}
void XDefaultColormapOfScreen() {}


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

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

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

LLVM IR (-O2):
define void @XDefaultColormapOfScreen() {
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int is_literal_name(char *fname) {
  return strlen(fname) > 0 && strncmp(fname, "@", 1) == 0;
}


x86 assembly (clang, -O0):
<is_literal_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jle    1166 <is_literal_name+0x46>
mov    -0x8(%rbp),%rdi
lea    0xeae(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_literal_name>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
test   %rax,%rax
jle    114f <is_literal_name+0x2f>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"@\00"
define i32 @is_literal_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"@\00"
define i32 @is_literal_name(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int _chsize_s(int, long long);
int _ftruncate64(int __fd, long long __length) {
  return _chsize_s(__fd, __length);
}


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

x86 assembly (clang, -O2):
<_ftruncate64>:
jmp    1030 <_chsize_s@plt>

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

LLVM IR (-O2):
define i32 @_ftruncate64(i32 %0, i64 %1) {
%3 = tail call i32 @_chsize_s(i32 %0, i64 %1)
ret i32 %3
}
/* Type definitions */
struct eloop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eloop_clear(struct eloop *, int);
int /*<<< orphan*/ free(struct eloop *);
void eloop_free(struct eloop *eloop) {
  eloop_clear(eloop, -1);
  free(eloop);
}


x86 assembly (clang, -O0):
<eloop_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
call   1040 <eloop_clear@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eloop_free>:
push   %rbx
mov    %rdi,%rbx
mov    $0xffffffff,%esi
call   1040 <eloop_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.eloop = type { i32 }
define void @eloop_free(%struct.eloop* %0) {
%2 = alloca %struct.eloop*
store %struct.eloop* %0, %struct.eloop** %2
%3 = load %struct.eloop*, %struct.eloop** %2
%4 = call i32 @eloop_clear(%struct.eloop* %3, i32 -1)
%5 = load %struct.eloop*, %struct.eloop** %2
%6 = call i32 @free(%struct.eloop* %5)
ret void
}

LLVM IR (-O2):
%struct.eloop = type { i32 }
define void @eloop_free(%struct.eloop* %0) {
%2 = tail call i32 @eloop_clear(%struct.eloop* %0, i32 -1)
%3 = tail call i32 @free(%struct.eloop* %0)
ret void
}
void parentHandler(int sig) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ ferror(int /*<<< orphan*/ *);
size_t fread(void *, int, size_t, int /*<<< orphan*/ *);
size_t read_bin(FILE *fp, void *array, size_t arrayBytes) {
  size_t read = fread(array, 1, arrayBytes, fp);
  if (ferror(fp)) {
    exit(12);
  }
  return read;
}


x86 assembly (clang, -O0):
<read_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     117b <read_bin+0x4b>
mov    $0xc,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bin>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0x1,%esi
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <ferror@plt>
test   %rax,%rax
jne    1162 <read_bin+0x32>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0xc,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i64 @read_bin(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i32*, i32** %4
%11 = call i64 @fread(i8* %8, i32 1, i64 %9, i32* %10)
store i64 %11, i64* %7
%12 = load i32*, i32** %4
%13 = call i64 @ferror(i32* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 @exit(i32 12)
unreachable
17: ; preds = %3
%18 = load i64, i64* %7
ret i64 %18
}

LLVM IR (-O2):
define i64 @read_bin(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fread(i8* %1, i32 1, i64 %2, i32* %0)
%5 = tail call i64 @ferror(i32* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @exit(i32 12)
unreachable
9: ; preds = %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int puts(unsigned char *s) {
  while (*s)
    putchar(*s++);
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = zext i8 %5 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 0
}
void pgdat_resize_init(struct pglist_data *pgdat) {}


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

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

LLVM IR (-O0):
%struct.pglist_data = type opaque
define void @pgdat_resize_init(%struct.pglist_data* %0) {
%2 = alloca %struct.pglist_data*
store %struct.pglist_data* %0, %struct.pglist_data** %2
ret void
}

LLVM IR (-O2):
%struct.pglist_data = type opaque
define void @pgdat_resize_init(%struct.pglist_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char const *);
void err_exit(const char *error_string, int exit_num) {
  printf(error_string);
  exit(exit_num);
}


x86 assembly (clang, -O0):
<err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_exit>:
push   %rbx
mov    %esi,%ebx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @err_exit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define void @err_exit(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
void create_drive(int speed, int radius) {}


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

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

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

LLVM IR (-O2):
define void @create_drive(i32 %0, i32 %1) {
ret void
}
void g_array_prepend_vals() {}


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

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

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

LLVM IR (-O2):
define void @g_array_prepend_vals() {
ret void
}
/* Variables and functions */
int StatCovMomentInt(int *, int *, int, int, int, int);
double StatCovnInt(int a[], int b[], int n, int s) {
  return StatCovMomentInt(a, b, n, s, 1, 1) / n;
}


x86 assembly (clang, -O0):
<StatCovnInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <StatCovMomentInt@plt>
cltd
idivl  -0x14(%rbp)
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatCovnInt>:
push   %rbx
mov    %edx,%ebx
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1030 <StatCovMomentInt@plt>
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @StatCovnInt(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @StatCovMomentInt(i32* %9, i32* %10, i32 %11, i32 %12, i32 1, i32 1)
%14 = load i32, i32* %7
%15 = sdiv i32 %13, %14
%16 = sitofp i32 %15 to double
ret double %16
}

LLVM IR (-O2):
define double @StatCovnInt(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @StatCovMomentInt(i32* %0, i32* %1, i32 %2, i32 %3, i32 1, i32 1)
%6 = sdiv i32 %5, %2
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
free_ptr(void *p) { free(*(void **)p); }


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

x86 assembly (clang, -O2):
<free_ptr>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define i32 @free_ptr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = call i32 @free(i8* %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @free_ptr(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int version(const char *name) { exit(2); }


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

x86 assembly (clang, -O2):
<version>:
push   %rax
mov    $0x2,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @version(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 2)
unreachable
}
int FT800_IncCMDOffset(const int Current_Offset,
                       const unsigned char Command_Size) {
  int New_Offset;
  New_Offset = Current_Offset + Command_Size;
  if (New_Offset > 4095) {
    New_Offset = (New_Offset - 4096);
  }
  return New_Offset;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
movzbl -0x5(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xfff,-0xc(%rbp)
jle    1131 <FT800_IncCMDOffset+0x31>
mov    -0xc(%rbp),%eax
sub    $0x1000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    (%rsi,%rdi,1),%ecx
cmp    $0x1000,%ecx
lea    -0x1000(%rsi,%rdi,1),%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @FT800_IncCMDOffset(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i32, i32* %3
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = add nsw i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 4095
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 4096
store i32 %14, i32* %5
br label %15
15: ; preds = %12, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @FT800_IncCMDOffset(i32 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = add nsw i32 %3, %0
%5 = icmp sgt i32 %4, 4095
%6 = add nsw i32 %4, -4096
%7 = select i1 %5, i32 %6, i32 %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main(int argc, char **argv) {
  f(1);
  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    $0x1,%edi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @f(i32 1)
ret i32 0
}
int test_imm_91int32_reg(int val) { return ((val) & (0x91 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_91int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x91,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_91int32_reg(i32 %0) {
%2 = and i32 %0, 145
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int parse_recv_data(int, char *);
int ucast_recv(char *, int);
int ucast_read_data(char *data, int data_len) {
  int len = ucast_recv(data, data_len);
  return parse_recv_data(len, data);
}


x86 assembly (clang, -O0):
<ucast_read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ucast_recv@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <parse_recv_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucast_read_data>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ucast_recv@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <parse_recv_data@plt>

LLVM IR (-O0):
define i32 @ucast_read_data(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @ucast_recv(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i8*, i8** %3
%11 = call i32 @parse_recv_data(i32 %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @ucast_read_data(i8* %0, i32 %1) {
%3 = tail call i32 @ucast_recv(i8* %0, i32 %1)
%4 = tail call i32 @parse_recv_data(i32 %3, i8* %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int readfile(char *);
int main(int argc, char **argv) {
  printf("%d", readfile(argv[1]));
  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
call   1040 <readfile@plt>
mov    %eax,%esi
lea    0xeb4(%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
call   1040 <readfile@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\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 i32 @readfile(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 i32 @readfile(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int test_imm_1Duint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x1D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Duint64_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, 29
%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_1Duint64_highword_reg(i64 %0) {
%2 = and i64 %0, 124554051584
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sig_int(int sig) { printf("Get signal: %d\n", sig); }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Get signal: %d\0A\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void wpas_dbus_signal_eap_status(struct wpa_supplicant *wpa_s,
                                 const char *status, const char *parameter) {}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
define void @wpas_dbus_signal_eap_status(%struct.wpa_supplicant* %0, i8* %1, i8* %2) {
%4 = alloca %struct.wpa_supplicant*
%5 = alloca i8*
%6 = alloca i8*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_dbus_signal_eap_status(%struct.wpa_supplicant* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int scanf(char *, double *, double *);
int /*<<< orphan*/ stderr;
void checkInput(double *x, double *y) {
  if ((scanf("%lf%lf", x, y)) != 2) {
    fprintf(stderr, "Wrong input values!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1180 <checkInput+0x50>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkInput>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    114a <checkInput+0x1a>
pop    %rax
ret
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%lf%lf\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %5, double* %6)
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%lf%lf\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(double* %0, double* %1) {
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %0, double* %1)
%4 = icmp eq i32 %3, 2
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
random(range) { return (rand() % range); }


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @random(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ uptsdiff(int /*<<< orphan*/, int /*<<< orphan*/);
void ptsdec(uint64_t *pts1, uint64_t pts2) { *pts1 = uptsdiff(*pts1, pts2); }


x86 assembly (clang, -O0):
<ptsdec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
call   1030 <uptsdiff@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptsdec>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <uptsdiff@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ptsdec(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 = call i32 @uptsdiff(i32 %6, i32 %7)
%9 = load i32*, i32** %3
store i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @ptsdec(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @uptsdiff(i32 %3, i32 %1)
store i32 %4, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(float *, int, int, int /*<<< orphan*/ *);
void read_float(float *fl, FILE *f) { fread(fl, sizeof(float), 1, f); }


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

x86 assembly (clang, -O2):
<read_float>:
mov    %rsi,%rcx
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define void @read_float(float* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fread(float* %0, i32 4, i32 1, i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int libc_posix_spawnp(int /*<<< orphan*/ *, char *, void *, void *, char **,
                      char **);
int /*<<< orphan*/ watch_log(char *);
int posix_spawnp(pid_t *a, char *b, void *c, void *d, char *e[], char *f[]) {
  watch_log("exec\n");
  return libc_posix_spawnp(a, b, c, d, e, f);
}


x86 assembly (clang, -O0):
<posix_spawnp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xeb9(%rip),%rdi
call   1040 <watch_log@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <libc_posix_spawnp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xebc(%rip),%rdi
call   1040 <watch_log@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <libc_posix_spawnp@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"exec\0A\00"
define i32 @posix_spawnp(i32* %0, i8* %1, i8* %2, i8* %3, i8** %4, i8** %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8**
%12 = alloca i8**
store i32* %0, i32** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8** %4, i8*** %11
store i8** %5, i8*** %12
%13 = call i32 @watch_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%14 = load i32*, i32** %7
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = load i8**, i8*** %11
%19 = load i8**, i8*** %12
%20 = call i32 @libc_posix_spawnp(i32* %14, i8* %15, i8* %16, i8* %17, i8** %18, i8** %19)
ret i32 %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"exec\0A\00"
define i32 @posix_spawnp(i32* %0, i8* %1, i8* %2, i8* %3, i8** %4, i8** %5) {
%7 = tail call i32 @watch_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @libc_posix_spawnp(i32* %0, i8* %1, i8* %2, i8* %3, i8** %4, i8** %5)
ret i32 %8
}
/* Variables and functions */
int rd_lseek_file(int fd, int offset) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rd_lseek_file(i32 %0, i32 %1) {
ret i32 0
}