#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef double uint64_t;
struct TYPE_2__ {
  double tv_usec;
  scalar_t__ tv_sec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
int /*<<< orphan*/ printf(char *, int);
int random();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ time();
int main(void) {
  int i, x = 0;
  int vs[4000];
  uint64_t start_time, end_time, delay;
  srandom(time());
  for (i = 0; i < 4000; i++)
    vs[i] = random() & (4000 - 1);
  {
    struct rusage buf;
    getrusage(RUSAGE_SELF, &buf);
    start_time =
        (uint64_t)buf.ru_utime.tv_sec * 1000000.00 + buf.ru_utime.tv_usec;
  }
  for (i = 0; i < 10000000; i++) {
    int v = vs[i & (4000 - 1)];
    if ((v & 0x1) || ((v + 2) > 4000))
      x++;
  }
  {
    struct rusage buf;
    getrusage(RUSAGE_SELF, &buf);
    end_time =
        (uint64_t)buf.ru_utime.tv_sec * 1000000.00 + buf.ru_utime.tv_usec;
    delay = end_time - start_time;
    fprintf(stderr, "condition condition time = %f ms\n",
            (double)delay / 1000.00);
  }
  {
    struct rusage buf;
    getrusage(RUSAGE_SELF, &buf);
    start_time =
        (uint64_t)buf.ru_utime.tv_sec * 1000000.00 + buf.ru_utime.tv_usec;
  }
  for (i = 0; i < 10000000; i++) {
    int v = vs[i & (4000 - 1)];
    if ((v & 0x1) | ((v + 2) > 4000))
      x++;
  }
  {
    struct rusage buf;
    getrusage(RUSAGE_SELF, &buf);
    end_time =
        (uint64_t)buf.ru_utime.tv_sec * 1000000.00 + buf.ru_utime.tv_usec;
    delay = end_time - start_time;
    fprintf(stderr, "condition time = %f ms\n", (double)delay / 1000.00);
  }
  {
    struct rusage buf;
    getrusage(RUSAGE_SELF, &buf);
    start_time =
        (uint64_t)buf.ru_utime.tv_sec * 1000000.00 + buf.ru_utime.tv_usec;
  }
  for (i = 0; i < 10000000; i++) {
    int v = vs[i & (4000 - 1)];
    if ((v & 0x1) | ((v + 2) & 4000))
      x++;
  }
  {
    struct rusage buf;
    getrusage(RUSAGE_SELF, &buf);
    end_time =
        (uint64_t)buf.ru_utime.tv_sec * 1000000.00 + buf.ru_utime.tv_usec;
    delay = end_time - start_time;
    fprintf(stderr, "mask time = %f ms\n", (double)delay / 1000.00);
  }
  printf("count = %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1060 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xfa0,-0x8(%rbp)
jge    11c3 <main+0x63>
mov    $0x0,%al
call   1070 <random@plt>
mov    %eax,%ecx
and    $0xf9f,%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x3e90(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118e <main+0x2e>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
lea    -0x3eb8(%rbp),%rsi
call   1080 <getrusage@plt>
cvtsi2sdq -0x3eb0(%rbp),%xmm0
ff ff
movsd  -0x3eb8(%rbp),%xmm1
ff
movsd  0xe0f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3e98(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    126e <main+0x10e>
mov    -0x8(%rbp),%eax
and    $0xf9f,%eax
cltq
mov    -0x3e90(%rbp,%rax,4),%eax
mov    %eax,-0x3ebc(%rbp)
mov    -0x3ebc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1252 <main+0xf2>
mov    -0x3ebc(%rbp),%eax
add    $0x2,%eax
cmp    $0xfa0,%eax
jle    125b <main+0xfb>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1260 <main+0x100>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1208 <main+0xa8>
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
lea    -0x3ed0(%rbp),%rsi
call   1080 <getrusage@plt>
cvtsi2sdq -0x3ec8(%rbp),%xmm0
ff ff
movsd  -0x3ed0(%rbp),%xmm1
ff
movsd  0xd64(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3ea0(%rbp)
ff
movsd  -0x3ea0(%rbp),%xmm0
ff
subsd  -0x3e98(%rbp),%xmm0
ff
movsd  %xmm0,-0x3ea8(%rbp)
ff
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
movsd  -0x3ea8(%rbp),%xmm0
ff
movsd  0xd2b(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xd28(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2ce4(%rip),%rax
mov    (%rax),%edi
lea    -0x3ee0(%rbp),%rsi
call   1080 <getrusage@plt>
cvtsi2sdq -0x3ed8(%rbp),%xmm0
ff ff
movsd  -0x3ee0(%rbp),%xmm1
ff
movsd  0xce5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3e98(%rbp)
ff
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    139e <main+0x23e>
mov    -0x8(%rbp),%eax
and    $0xf9f,%eax
cltq
mov    -0x3e90(%rbp,%rax,4),%eax
mov    %eax,-0x3ee4(%rbp)
mov    -0x3ee4(%rbp),%eax
and    $0x1,%eax
mov    -0x3ee4(%rbp),%ecx
add    $0x2,%ecx
cmp    $0xfa0,%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     138b <main+0x22b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1390 <main+0x230>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1332 <main+0x1d2>
mov    0x2c33(%rip),%rax
mov    (%rax),%edi
lea    -0x3ef8(%rbp),%rsi
call   1080 <getrusage@plt>
cvtsi2sdq -0x3ef0(%rbp),%xmm0
ff ff
movsd  -0x3ef8(%rbp),%xmm1
ff
movsd  0xc34(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3ea0(%rbp)
ff
movsd  -0x3ea0(%rbp),%xmm0
ff
subsd  -0x3e98(%rbp),%xmm0
ff
movsd  %xmm0,-0x3ea8(%rbp)
ff
mov    0x2be5(%rip),%rax
mov    (%rax),%edi
movsd  -0x3ea8(%rbp),%xmm0
ff
movsd  0xbfb(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xc02(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2bb4(%rip),%rax
mov    (%rax),%edi
lea    -0x3f08(%rbp),%rsi
call   1080 <getrusage@plt>
cvtsi2sdq -0x3f00(%rbp),%xmm0
ff ff
movsd  -0x3f08(%rbp),%xmm1
ff
movsd  0xbb5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3e98(%rbp)
ff
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    14c5 <main+0x365>
mov    -0x8(%rbp),%eax
and    $0xf9f,%eax
cltq
mov    -0x3e90(%rbp,%rax,4),%eax
mov    %eax,-0x3f0c(%rbp)
mov    -0x3f0c(%rbp),%eax
and    $0x1,%eax
mov    -0x3f0c(%rbp),%ecx
add    $0x2,%ecx
and    $0xfa0,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     14b2 <main+0x352>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    14b7 <main+0x357>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1462 <main+0x302>
mov    0x2b0c(%rip),%rax
mov    (%rax),%edi
lea    -0x3f20(%rbp),%rsi
call   1080 <getrusage@plt>
cvtsi2sdq -0x3f18(%rbp),%xmm0
ff ff
movsd  -0x3f20(%rbp),%xmm1
ff
movsd  0xb0d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3ea0(%rbp)
ff
movsd  -0x3ea0(%rbp),%xmm0
ff
subsd  -0x3e98(%rbp),%xmm0
ff
movsd  %xmm0,-0x3ea8(%rbp)
ff
mov    0x2abe(%rip),%rax
mov    (%rax),%edi
movsd  -0x3ea8(%rbp),%xmm0
ff
movsd  0xad4(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xaf3(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0xc(%rbp),%esi
lea    0xaf7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x3ea0,%rsp
xor    %eax,%eax
call   1060 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <random@plt>
and    $0xf9f,%eax
mov    %eax,0x20(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0xfa0,%rbx
jne    1180 <main+0x20>
mov    0x2e34(%rip),%r14
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
call   1080 <getrusage@plt>
mov    0x10(%rsp),%rdi
movsd  0x8(%rsp),%xmm0
xor    %ecx,%ecx
xor    %ebx,%ebx
mov    %ecx,%edx
and    $0xf9e,%edx
mov    0x20(%rsp,%rdx,4),%esi
cmp    $0xf9f,%esi
setge  %al
or     %sil,%al
movzbl %al,%eax
and    $0x1,%eax
add    %ebx,%eax
or     $0x1,%edx
mov    0x20(%rsp,%rdx,4),%edx
cmp    $0xf9f,%edx
setge  %bl
or     %dl,%bl
movzbl %bl,%ebx
and    $0x1,%ebx
add    %eax,%ebx
add    $0x2,%ecx
cmp    $0x989680,%ecx
jne    11c0 <main+0x60>
cvtsi2sd %rdi,%xmm1
mulsd  0xdee(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
call   1080 <getrusage@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x10(%rsp),%xmm0
mulsd  0xdc5(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
mov    0x2d92(%rip),%r15
mov    (%r15),%edi
divsd  0xdaf(%rip),%xmm0
lea    0xdb0(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
call   1080 <getrusage@plt>
mov    0x10(%rsp),%r8
movsd  0x8(%rsp),%xmm0
xor    %ecx,%ecx
nop
mov    %ecx,%edx
and    $0xf9e,%edx
mov    0x20(%rsp,%rdx,4),%esi
mov    %esi,%edi
and    $0x1,%edi
xor    %eax,%eax
cmp    $0xf9f,%esi
setge  %al
or     %edi,%eax
add    %ebx,%eax
or     $0x1,%edx
mov    0x20(%rsp,%rdx,4),%edx
mov    %edx,%esi
and    $0x1,%esi
xor    %ebx,%ebx
cmp    $0xf9f,%edx
setge  %bl
or     %esi,%ebx
add    %eax,%ebx
add    $0x2,%ecx
cmp    $0x989680,%ecx
jne    1280 <main+0x120>
cvtsi2sd %r8,%xmm2
movsd  0xd2d(%rip),%xmm1
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
call   1080 <getrusage@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x10(%rsp),%xmm0
mulsd  0xd00(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
mov    (%r15),%edi
divsd  0xcf1(%rip),%xmm0
lea    0xcfc(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
call   1080 <getrusage@plt>
mov    0x10(%rsp),%r8
movsd  0x8(%rsp),%xmm0
xor    %ecx,%ecx
nopl   (%rax)
mov    %ecx,%edx
and    $0xf9e,%edx
mov    0x20(%rsp,%rdx,4),%esi
mov    %esi,%edi
and    $0x1,%edi
add    $0x2,%esi
and    $0xfa0,%esi
xor    %eax,%eax
or     %edi,%esi
setne  %al
add    %ebx,%eax
or     $0x1,%edx
mov    0x20(%rsp,%rdx,4),%edx
mov    %edx,%esi
and    $0x1,%esi
add    $0x2,%edx
and    $0xfa0,%edx
xor    %ebx,%ebx
or     %esi,%edx
setne  %bl
add    %eax,%ebx
add    $0x2,%ecx
cmp    $0x989680,%ecx
jne    1340 <main+0x1e0>
xorps  %xmm2,%xmm2
cvtsi2sd %r8,%xmm2
movsd  0xc64(%rip),%xmm1
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
call   1080 <getrusage@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x10(%rsp),%xmm0
mulsd  0xc37(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
mov    (%r15),%edi
divsd  0xc28(%rip),%xmm0
lea    0xc4b(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xc52(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3ea0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { double, i64 }
@RUSAGE_SELF = global i32 0
@stderr = global i32 0
@.str = [34 x i8] c"condition condition time = %f ms\0A\00"
@.str.1 = [24 x i8] c"condition time = %f ms\0A\00"
@.str.2 = [19 x i8] c"mask time = %f ms\0A\00"
@.str.3 = [12 x i8] c"count = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [4000 x i32]
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca %struct.rusage
%9 = alloca i32
%10 = alloca %struct.rusage
%11 = alloca %struct.rusage
%12 = alloca i32
%13 = alloca %struct.rusage
%14 = alloca %struct.rusage
%15 = alloca i32
%16 = alloca %struct.rusage
store i32 0, i32* %1
store i32 0, i32* %3
%17 = call i32 (...) @time()
%18 = call i32 @srandom(i32 %17)
store i32 0, i32* %2
br label %19
19: ; preds = %28, %0
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 4000
br i1 %21, label %22, label %31
22: ; preds = %19
%23 = call i32 (...) @random()
%24 = and i32 %23, 3999
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [4000 x i32], [4000 x i32]* %4, i64 0, i64 %26
store i32 %24, i32* %27
br label %28
28: ; preds = %22
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %19
31: ; preds = %19
%32 = load i32, i32* @RUSAGE_SELF
%33 = call i32 @getrusage(i32 %32, %struct.rusage* %8)
%34 = getelementptr inbounds %struct.rusage, %struct.rusage* %8, i32 0, i32 0
%35 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %34, i32 0, i32 1
%36 = load i64, i64* %35
%37 = sitofp i64 %36 to double
%38 = getelementptr inbounds %struct.rusage, %struct.rusage* %8, i32 0, i32 0
%39 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %38, i32 0, i32 0
%40 = load double, double* %39
%41 = call double @llvm.fmuladd.f64(double %37, double 1.000000e+06, double %40)
store double %41, double* %5
store i32 0, i32* %2
br label %42
42: ; preds = %62, %31
%43 = load i32, i32* %2
%44 = icmp slt i32 %43, 10000000
br i1 %44, label %45, label %65
45: ; preds = %42
%46 = load i32, i32* %2
%47 = and i32 %46, 3999
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [4000 x i32], [4000 x i32]* %4, i64 0, i64 %48
%50 = load i32, i32* %49
store i32 %50, i32* %9
%51 = load i32, i32* %9
%52 = and i32 %51, 1
%53 = icmp ne i32 %52, 0
br i1 %53, label %58, label %54
54: ; preds = %45
%55 = load i32, i32* %9
%56 = add nsw i32 %55, 2
%57 = icmp sgt i32 %56, 4000
br i1 %57, label %58, label %61
58: ; preds = %54, %45
%59 = load i32, i32* %3
%60 = add nsw i32 %59, 1
store i32 %60, i32* %3
br label %61
61: ; preds = %58, %54
br label %62
62: ; preds = %61
%63 = load i32, i32* %2
%64 = add nsw i32 %63, 1
store i32 %64, i32* %2
br label %42
65: ; preds = %42
%66 = load i32, i32* @RUSAGE_SELF
%67 = call i32 @getrusage(i32 %66, %struct.rusage* %10)
%68 = getelementptr inbounds %struct.rusage, %struct.rusage* %10, i32 0, i32 0
%69 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %68, i32 0, i32 1
%70 = load i64, i64* %69
%71 = sitofp i64 %70 to double
%72 = getelementptr inbounds %struct.rusage, %struct.rusage* %10, i32 0, i32 0
%73 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %72, i32 0, i32 0
%74 = load double, double* %73
%75 = call double @llvm.fmuladd.f64(double %71, double 1.000000e+06, double %74)
store double %75, double* %6
%76 = load double, double* %6
%77 = load double, double* %5
%78 = fsub double %76, %77
store double %78, double* %7
%79 = load i32, i32* @stderr
%80 = load double, double* %7
%81 = fdiv double %80, 1.000000e+03
%82 = call i32 @fprintf(i32 %79, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double %81)
%83 = load i32, i32* @RUSAGE_SELF
%84 = call i32 @getrusage(i32 %83, %struct.rusage* %11)
%85 = getelementptr inbounds %struct.rusage, %struct.rusage* %11, i32 0, i32 0
%86 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %85, i32 0, i32 1
%87 = load i64, i64* %86
%88 = sitofp i64 %87 to double
%89 = getelementptr inbounds %struct.rusage, %struct.rusage* %11, i32 0, i32 0
%90 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %89, i32 0, i32 0
%91 = load double, double* %90
%92 = call double @llvm.fmuladd.f64(double %88, double 1.000000e+06, double %91)
store double %92, double* %5
store i32 0, i32* %2
br label %93
93: ; preds = %114, %65
%94 = load i32, i32* %2
%95 = icmp slt i32 %94, 10000000
br i1 %95, label %96, label %117
96: ; preds = %93
%97 = load i32, i32* %2
%98 = and i32 %97, 3999
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [4000 x i32], [4000 x i32]* %4, i64 0, i64 %99
%101 = load i32, i32* %100
store i32 %101, i32* %12
%102 = load i32, i32* %12
%103 = and i32 %102, 1
%104 = load i32, i32* %12
%105 = add nsw i32 %104, 2
%106 = icmp sgt i32 %105, 4000
%107 = zext i1 %106 to i32
%108 = or i32 %103, %107
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %113
110: ; preds = %96
%111 = load i32, i32* %3
%112 = add nsw i32 %111, 1
store i32 %112, i32* %3
br label %113
113: ; preds = %110, %96
br label %114
114: ; preds = %113
%115 = load i32, i32* %2
%116 = add nsw i32 %115, 1
store i32 %116, i32* %2
br label %93
117: ; preds = %93
%118 = load i32, i32* @RUSAGE_SELF
%119 = call i32 @getrusage(i32 %118, %struct.rusage* %13)
%120 = getelementptr inbounds %struct.rusage, %struct.rusage* %13, i32 0, i32 0
%121 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %120, i32 0, i32 1
%122 = load i64, i64* %121
%123 = sitofp i64 %122 to double
%124 = getelementptr inbounds %struct.rusage, %struct.rusage* %13, i32 0, i32 0
%125 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %124, i32 0, i32 0
%126 = load double, double* %125
%127 = call double @llvm.fmuladd.f64(double %123, double 1.000000e+06, double %126)
store double %127, double* %6
%128 = load double, double* %6
%129 = load double, double* %5
%130 = fsub double %128, %129
store double %130, double* %7
%131 = load i32, i32* @stderr
%132 = load double, double* %7
%133 = fdiv double %132, 1.000000e+03
%134 = call i32 @fprintf(i32 %131, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %133)
%135 = load i32, i32* @RUSAGE_SELF
%136 = call i32 @getrusage(i32 %135, %struct.rusage* %14)
%137 = getelementptr inbounds %struct.rusage, %struct.rusage* %14, i32 0, i32 0
%138 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %137, i32 0, i32 1
%139 = load i64, i64* %138
%140 = sitofp i64 %139 to double
%141 = getelementptr inbounds %struct.rusage, %struct.rusage* %14, i32 0, i32 0
%142 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %141, i32 0, i32 0
%143 = load double, double* %142
%144 = call double @llvm.fmuladd.f64(double %140, double 1.000000e+06, double %143)
store double %144, double* %5
store i32 0, i32* %2
br label %145
145: ; preds = %165, %117
%146 = load i32, i32* %2
%147 = icmp slt i32 %146, 10000000
br i1 %147, label %148, label %168
148: ; preds = %145
%149 = load i32, i32* %2
%150 = and i32 %149, 3999
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [4000 x i32], [4000 x i32]* %4, i64 0, i64 %151
%153 = load i32, i32* %152
store i32 %153, i32* %15
%154 = load i32, i32* %15
%155 = and i32 %154, 1
%156 = load i32, i32* %15
%157 = add nsw i32 %156, 2
%158 = and i32 %157, 4000
%159 = or i32 %155, %158
%160 = icmp ne i32 %159, 0
br i1 %160, label %161, label %164
161: ; preds = %148
%162 = load i32, i32* %3
%163 = add nsw i32 %162, 1
store i32 %163, i32* %3
br label %164
164: ; preds = %161, %148
br label %165
165: ; preds = %164
%166 = load i32, i32* %2
%167 = add nsw i32 %166, 1
store i32 %167, i32* %2
br label %145
168: ; preds = %145
%169 = load i32, i32* @RUSAGE_SELF
%170 = call i32 @getrusage(i32 %169, %struct.rusage* %16)
%171 = getelementptr inbounds %struct.rusage, %struct.rusage* %16, i32 0, i32 0
%172 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %171, i32 0, i32 1
%173 = load i64, i64* %172
%174 = sitofp i64 %173 to double
%175 = getelementptr inbounds %struct.rusage, %struct.rusage* %16, i32 0, i32 0
%176 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %175, i32 0, i32 0
%177 = load double, double* %176
%178 = call double @llvm.fmuladd.f64(double %174, double 1.000000e+06, double %177)
store double %178, double* %6
%179 = load double, double* %6
%180 = load double, double* %5
%181 = fsub double %179, %180
store double %181, double* %7
%182 = load i32, i32* @stderr
%183 = load double, double* %7
%184 = fdiv double %183, 1.000000e+03
%185 = call i32 @fprintf(i32 %182, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %184)
%186 = load i32, i32* %3
%187 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %186)
ret i32 0
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { double, i64 }
@RUSAGE_SELF = global i32 0
@stderr = global i32 0
@.str = [34 x i8] c"condition condition time = %f ms\0A\00"
@.str.1 = [24 x i8] c"condition time = %f ms\0A\00"
@.str.2 = [19 x i8] c"mask time = %f ms\0A\00"
@.str.3 = [12 x i8] c"count = %d\0A\00"
define i32 @main() {
%1 = alloca [4000 x i32]
%2 = alloca %struct.rusage
%3 = alloca %struct.rusage
%4 = alloca %struct.rusage
%5 = alloca %struct.rusage
%6 = alloca %struct.rusage
%7 = alloca %struct.rusage
%8 = bitcast [4000 x i32]* %1 to i8*
%9 = tail call i32 (...) @time()
%10 = tail call i32 @srandom(i32 %9)
br label %11
11: ; preds = %0, %11
%12 = phi i64 [ 0, %0 ], [ %16, %11 ]
%13 = tail call i32 (...) @random()
%14 = and i32 %13, 3999
%15 = getelementptr inbounds [4000 x i32], [4000 x i32]* %1, i64 0, i64 %12
store i32 %14, i32* %15
%16 = add nuw nsw i64 %12, 1
%17 = icmp eq i64 %16, 4000
br i1 %17, label %18, label %11
18: ; preds = %11
%19 = bitcast %struct.rusage* %2 to i8*
%20 = load i32, i32* @RUSAGE_SELF
%21 = call i32 @getrusage(i32 %20, %struct.rusage* %2)
%22 = getelementptr inbounds %struct.rusage, %struct.rusage* %2, i64 0, i32 0, i32 1
%23 = load i64, i64* %22
%24 = getelementptr inbounds %struct.rusage, %struct.rusage* %2, i64 0, i32 0, i32 0
%25 = load double, double* %24
br label %26
26: ; preds = %26, %18
%27 = phi i32 [ 0, %18 ], [ %50, %26 ]
%28 = phi i32 [ 0, %18 ], [ %49, %26 ]
%29 = and i32 %27, 3998
%30 = zext i32 %29 to i64
%31 = getelementptr inbounds [4000 x i32], [4000 x i32]* %1, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = and i32 %32, 1
%34 = icmp ne i32 %33, 0
%35 = icmp sgt i32 %32, 3998
%36 = or i1 %35, %34
%37 = zext i1 %36 to i32
%38 = add nuw nsw i32 %28, %37
%39 = and i32 %27, 3998
%40 = or i32 %39, 1
%41 = zext i32 %40 to i64
%42 = getelementptr inbounds [4000 x i32], [4000 x i32]* %1, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = and i32 %43, 1
%45 = icmp ne i32 %44, 0
%46 = icmp sgt i32 %43, 3998
%47 = or i1 %46, %45
%48 = zext i1 %47 to i32
%49 = add nuw nsw i32 %38, %48
%50 = add nuw nsw i32 %27, 2
%51 = icmp eq i32 %50, 10000000
br i1 %51, label %52, label %26
52: ; preds = %26
%53 = sitofp i64 %23 to double
%54 = call double @llvm.fmuladd.f64(double %53, double 1.000000e+06, double %25)
%55 = bitcast %struct.rusage* %3 to i8*
%56 = load i32, i32* @RUSAGE_SELF
%57 = call i32 @getrusage(i32 %56, %struct.rusage* %3)
%58 = getelementptr inbounds %struct.rusage, %struct.rusage* %3, i64 0, i32 0, i32 1
%59 = load i64, i64* %58
%60 = sitofp i64 %59 to double
%61 = getelementptr inbounds %struct.rusage, %struct.rusage* %3, i64 0, i32 0, i32 0
%62 = load double, double* %61
%63 = call double @llvm.fmuladd.f64(double %60, double 1.000000e+06, double %62)
%64 = fsub double %63, %54
%65 = load i32, i32* @stderr
%66 = fdiv double %64, 1.000000e+03
%67 = call i32 @fprintf(i32 %65, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double %66)
%68 = bitcast %struct.rusage* %4 to i8*
%69 = load i32, i32* @RUSAGE_SELF
%70 = call i32 @getrusage(i32 %69, %struct.rusage* %4)
%71 = getelementptr inbounds %struct.rusage, %struct.rusage* %4, i64 0, i32 0, i32 1
%72 = load i64, i64* %71
%73 = getelementptr inbounds %struct.rusage, %struct.rusage* %4, i64 0, i32 0, i32 0
%74 = load double, double* %73
br label %75
75: ; preds = %75, %52
%76 = phi i32 [ 0, %52 ], [ %97, %75 ]
%77 = phi i32 [ %49, %52 ], [ %96, %75 ]
%78 = and i32 %76, 3998
%79 = zext i32 %78 to i64
%80 = getelementptr inbounds [4000 x i32], [4000 x i32]* %1, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = and i32 %81, 1
%83 = icmp sgt i32 %81, 3998
%84 = zext i1 %83 to i32
%85 = or i32 %82, %84
%86 = add nuw nsw i32 %85, %77
%87 = and i32 %76, 3998
%88 = or i32 %87, 1
%89 = zext i32 %88 to i64
%90 = getelementptr inbounds [4000 x i32], [4000 x i32]* %1, i64 0, i64 %89
%91 = load i32, i32* %90
%92 = and i32 %91, 1
%93 = icmp sgt i32 %91, 3998
%94 = zext i1 %93 to i32
%95 = or i32 %92, %94
%96 = add nuw nsw i32 %95, %86
%97 = add nuw nsw i32 %76, 2
%98 = icmp eq i32 %97, 10000000
br i1 %98, label %99, label %75
99: ; preds = %75
%100 = sitofp i64 %72 to double
%101 = call double @llvm.fmuladd.f64(double %100, double 1.000000e+06, double %74)
%102 = bitcast %struct.rusage* %5 to i8*
%103 = load i32, i32* @RUSAGE_SELF
%104 = call i32 @getrusage(i32 %103, %struct.rusage* %5)
%105 = getelementptr inbounds %struct.rusage, %struct.rusage* %5, i64 0, i32 0, i32 1
%106 = load i64, i64* %105
%107 = sitofp i64 %106 to double
%108 = getelementptr inbounds %struct.rusage, %struct.rusage* %5, i64 0, i32 0, i32 0
%109 = load double, double* %108
%110 = call double @llvm.fmuladd.f64(double %107, double 1.000000e+06, double %109)
%111 = fsub double %110, %101
%112 = load i32, i32* @stderr
%113 = fdiv double %111, 1.000000e+03
%114 = call i32 @fprintf(i32 %112, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %113)
%115 = bitcast %struct.rusage* %6 to i8*
%116 = load i32, i32* @RUSAGE_SELF
%117 = call i32 @getrusage(i32 %116, %struct.rusage* %6)
%118 = getelementptr inbounds %struct.rusage, %struct.rusage* %6, i64 0, i32 0, i32 1
%119 = load i64, i64* %118
%120 = getelementptr inbounds %struct.rusage, %struct.rusage* %6, i64 0, i32 0, i32 0
%121 = load double, double* %120
br label %122
122: ; preds = %122, %99
%123 = phi i32 [ 0, %99 ], [ %148, %122 ]
%124 = phi i32 [ %96, %99 ], [ %147, %122 ]
%125 = and i32 %123, 3998
%126 = zext i32 %125 to i64
%127 = getelementptr inbounds [4000 x i32], [4000 x i32]* %1, i64 0, i64 %126
%128 = load i32, i32* %127
%129 = and i32 %128, 1
%130 = add nsw i32 %128, 2
%131 = and i32 %130, 4000
%132 = or i32 %131, %129
%133 = icmp ne i32 %132, 0
%134 = zext i1 %133 to i32
%135 = add nuw nsw i32 %124, %134
%136 = and i32 %123, 3998
%137 = or i32 %136, 1
%138 = zext i32 %137 to i64
%139 = getelementptr inbounds [4000 x i32], [4000 x i32]* %1, i64 0, i64 %138
%140 = load i32, i32* %139
%141 = and i32 %140, 1
%142 = add nsw i32 %140, 2
%143 = and i32 %142, 4000
%144 = or i32 %143, %141
%145 = icmp ne i32 %144, 0
%146 = zext i1 %145 to i32
%147 = add nuw nsw i32 %135, %146
%148 = add nuw nsw i32 %123, 2
%149 = icmp eq i32 %148, 10000000
br i1 %149, label %150, label %122
150: ; preds = %122
%151 = sitofp i64 %119 to double
%152 = call double @llvm.fmuladd.f64(double %151, double 1.000000e+06, double %121)
%153 = bitcast %struct.rusage* %7 to i8*
%154 = load i32, i32* @RUSAGE_SELF
%155 = call i32 @getrusage(i32 %154, %struct.rusage* %7)
%156 = getelementptr inbounds %struct.rusage, %struct.rusage* %7, i64 0, i32 0, i32 1
%157 = load i64, i64* %156
%158 = sitofp i64 %157 to double
%159 = getelementptr inbounds %struct.rusage, %struct.rusage* %7, i64 0, i32 0, i32 0
%160 = load double, double* %159
%161 = call double @llvm.fmuladd.f64(double %158, double 1.000000e+06, double %160)
%162 = fsub double %161, %152
%163 = load i32, i32* @stderr
%164 = fdiv double %162, 1.000000e+03
%165 = call i32 @fprintf(i32 %163, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %164)
%166 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %147)
ret i32 0
}