void evolve1D(double *Pops, double *OutsidePop, double *AF, int npop, int nSNP,
              double m1, double minf, int Ne, int Loss) {
  int l, p, ret;
  double af, r_af;
  for (l = 0; l < nSNP; l++) {
    for (p = 0; p < npop; p++) {
      if (Loss && (Pops[p * nSNP + l] == .0 || Pops[p * nSNP + l] == 1.0)) {
        ret = 0;
        if (AF[p] == 0) {
          if (rand_double(0, 1) > minf * OutsidePop[l])
            ret++;
          if (p > 0)
            if (rand_double(0, 1) > m1 * Pops[p - 1])
              ret++;
          if (p < npop)
            if (rand_double(0, 1) > m1 * Pops[p + 1])
              ret++;
          AF[p] = ret / Ne;
        } else {
          if (rand_double(0, 1) > minf * (1 - OutsidePop[l]))
            ret++;
          if (p > 0)
            if (rand_double(0, 1) > m1 * (1 - Pops[p - 1]))
              ret++;
          if (p < npop)
            if (rand_double(0, 1) > m1 * (1 - Pops[p + 1]))
              ret++;
          AF[p] = (Ne - ret) / Ne;
        }
      } else {
        if (p == 0) {
          AF[p] = (1 - m1 - minf) * Pops[p * nSNP + l] +
                  m1 * (Pops[(p + 1) * nSNP + l]) + minf * OutsidePop[l];
        } else if (p == (npop - 1)) {
          AF[p] = (1 - m1 - minf) * Pops[p * nSNP + l] +
                  m1 * (Pops[(p - 1) * nSNP + l]) + minf * OutsidePop[l];
        } else {
          AF[p] =
              (1 - m1 - minf) * Pops[p * nSNP + l] +
              m1 * .5 * (Pops[(p - 1) * nSNP + l] + Pops[(p + 1) * nSNP + l]) +
              minf * OutsidePop[l];
        }
      }
    }
    for (p = 0; p < npop; p++) {
      if (!Loss || ((AF[p] > .0) && (AF[p] < 1.0))) {
        af = AF[p];
        r_af = (double)rand_normal(af, af * (1 - af) / (2 * Ne));
        if (r_af > 1)
          r_af = 1;
        if (r_af < 0)
          r_af = 0;
        Pops[p * nSNP + l] = r_af;
      }
    }
  }
}


x86 assembly (clang, -O0):
<evolve1D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    16dc <evolve1D+0x5bc>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    15c4 <evolve1D+0x4a4>
cmpl   $0x0,0x10(%rbp)
je     13fe <evolve1D+0x2de>
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11aa <evolve1D+0x8a>
jp     11aa <evolve1D+0x8a>
jmp    11d8 <evolve1D+0xb8>
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xe38(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    13fe <evolve1D+0x2de>
jp     13fe <evolve1D+0x2de>
movl   $0x0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12eb <evolve1D+0x1cb>
jp     12eb <evolve1D+0x1cb>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <rand_double@plt>
cvtsi2sd %eax,%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
ucomisd %xmm1,%xmm0
jbe    1236 <evolve1D+0x116>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jle    1281 <evolve1D+0x161>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <rand_double@plt>
cvtsi2sd %eax,%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
ucomisd %xmm1,%xmm0
jbe    127c <evolve1D+0x15c>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1281 <evolve1D+0x161>
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12ce <evolve1D+0x1ae>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <rand_double@plt>
cvtsi2sd %eax,%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
ucomisd %xmm1,%xmm0
jbe    12c9 <evolve1D+0x1a9>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    12ce <evolve1D+0x1ae>
mov    -0x40(%rbp),%eax
cltd
idivl  -0x34(%rbp)
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    13f9 <evolve1D+0x2d9>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <rand_double@plt>
cvtsi2sd %eax,%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  0xcee(%rip),%xmm2
subsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    132e <evolve1D+0x20e>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jle    1385 <evolve1D+0x265>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <rand_double@plt>
cvtsi2sd %eax,%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xc9c(%rip),%xmm2
subsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1380 <evolve1D+0x260>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1385 <evolve1D+0x265>
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13de <evolve1D+0x2be>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <rand_double@plt>
cvtsi2sd %eax,%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xc43(%rip),%xmm2
subsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    13d9 <evolve1D+0x2b9>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    13de <evolve1D+0x2be>
mov    -0x34(%rbp),%eax
sub    -0x40(%rbp),%eax
cltd
idivl  -0x34(%rbp)
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15b1 <evolve1D+0x491>
cmpl   $0x0,-0x3c(%rbp)
jne    1482 <evolve1D+0x362>
movsd  0xbf0(%rip),%xmm1
subsd  -0x28(%rbp),%xmm1
subsd  -0x30(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
imul   -0x20(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15ac <evolve1D+0x48c>
mov    -0x3c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    150d <evolve1D+0x3ed>
movsd  0xb65(%rip),%xmm1
subsd  -0x28(%rbp),%xmm1
subsd  -0x30(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x20(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15a7 <evolve1D+0x487>
movsd  0xaeb(%rip),%xmm1
subsd  -0x28(%rbp),%xmm1
subsd  -0x30(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  0xacb(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x20(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
imul   -0x20(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15ac <evolve1D+0x48c>
jmp    15b1 <evolve1D+0x491>
jmp    15b6 <evolve1D+0x496>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1166 <evolve1D+0x46>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    16c9 <evolve1D+0x5a9>
cmpl   $0x0,0x10(%rbp)
je     1616 <evolve1D+0x4f6>
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    16b6 <evolve1D+0x596>
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0x9f5(%rip),%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    16b6 <evolve1D+0x596>
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0x9c6(%rip),%xmm2
subsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm1
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
mov    $0x2,%al
call   1040 <rand_normal@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0x992(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1685 <evolve1D+0x565>
movsd  0x980(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    169b <evolve1D+0x57b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    16bb <evolve1D+0x59b>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    15cb <evolve1D+0x4ab>
jmp    16ce <evolve1D+0x5ae>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1153 <evolve1D+0x33>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evolve1D>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %r9,0x58(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %rcx,0x60(%rsp)
mov    %rsi,0x40(%rsp)
mov    %rdi,0x8(%rsp)
test   %r8d,%r8d
jle    1649 <evolve1D+0x529>
mov    %rdx,%r15
mov    0xf0(%rsp),%edx
mov    0x60(%rsp),%rcx
lea    -0x1(%rcx),%r14d
movsd  0xe8b(%rip),%xmm2
movapd %xmm2,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm0,%xmm1
subsd  0x20(%rsp),%xmm1
movsd  %xmm1,0x48(%rsp)
movsd  0xe71(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x88(%rsp)
mov    0x58(%rsp),%rax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0xb0(%rsp)
mov    %r8d,%r13d
mov    %ecx,%esi
mov    %r14,%rax
imul   %r13,%rax
mov    %rax,0x70(%rsp)
lea    -0x1(%r14),%rax
imul   %r13,%rax
mov    %rax,0x68(%rsp)
lea    0x0(,%r13,8),%r12
mov    %r12,%rax
neg    %rax
mov    %rax,0x80(%rsp)
mov    0x8(%rsp),%rax
mov    %rax,0x30(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
mov    %rsi,0x50(%rsp)
mov    %r14,0xa8(%rsp)
mov    %r13,0x78(%rsp)
jmp    1240 <evolve1D+0x120>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x18(%rsp),%rcx
add    $0x1,%rcx
addq   $0x8,0x30(%rsp)
mov    %rcx,%rax
mov    %rcx,0x18(%rsp)
cmp    %r13,%rcx
je     1649 <evolve1D+0x529>
cmpl   $0x0,0x60(%rsp)
jle    1220 <evolve1D+0x100>
mov    0x18(%rsp),%rcx
lea    (%rcx,%r13,1),%rax
mov    %rax,0xa0(%rsp)
mov    0x70(%rsp),%rax
add    %rcx,%rax
mov    %rax,0x98(%rsp)
mov    0x68(%rsp),%rax
add    %rcx,%rax
mov    %rax,0x90(%rsp)
mov    0x30(%rsp),%r13
xor    %r14d,%r14d
mov    0x58(%rsp),%rbx
mov    0x40(%rsp),%rbp
jmp    12e1 <evolve1D+0x1c1>
nopl   0x0(%rax)
mov    0x8(%rsp),%rax
mov    0xa0(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  0x10(%rsp),%xmm0
mov    0x18(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  0x48(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  0x0(%rbp,%rcx,8),%xmm0
mulsd  0x20(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15)
add    $0x1,%r14
add    %r12,%r13
cmp    %r14,%rsi
je     15c0 <evolve1D+0x4a0>
test   %edx,%edx
je     12ff <evolve1D+0x1df>
movsd  0x0(%r13),%xmm0
ucomisd 0xd1d(%rip),%xmm0
jne    12f7 <evolve1D+0x1d7>
jnp    1370 <evolve1D+0x250>
ucomisd %xmm2,%xmm0
jne    12ff <evolve1D+0x1df>
jnp    1370 <evolve1D+0x250>
test   %r14,%r14
je     1290 <evolve1D+0x170>
mov    0xa8(%rsp),%rcx
cmp    %r14,%rcx
jne    1480 <evolve1D+0x360>
mov    0x8(%rsp),%rax
mov    0x90(%rsp),%rdi
movsd  (%rax,%rdi,8),%xmm0
mulsd  0x10(%rsp),%xmm0
mov    0x98(%rsp),%rdi
movsd  (%rax,%rdi,8),%xmm1
mulsd  0x48(%rsp),%xmm1
addsd  %xmm0,%xmm1
mov    0x18(%rsp),%rax
movsd  0x0(%rbp,%rax,8),%xmm0
mulsd  0x20(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15,%rcx,8)
jmp    12d1 <evolve1D+0x1b1>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%r15,%r14,8),%xmm0
movsd  %xmm0,0x28(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <rand_double@plt>
movsd  0x28(%rsp),%xmm0
ucomisd 0xc78(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mov    0x18(%rsp),%rax
movsd  0x0(%rbp,%rax,8),%xmm2
jne    14cf <evolve1D+0x3af>
jp     14cf <evolve1D+0x3af>
mulsd  0x20(%rsp),%xmm2
xor    %ebp,%ebp
ucomisd %xmm2,%xmm1
seta   %bpl
test   %r14,%r14
je     141f <evolve1D+0x2ff>
movsd  %xmm2,0x38(%rsp)
movsd  %xmm1,0x28(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <rand_double@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0xffffffff,%eax
add    %r14d,%eax
mov    0x8(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm1
mulsd  0x10(%rsp),%xmm1
ucomisd %xmm1,%xmm0
jbe    141f <evolve1D+0x2ff>
xor    %ebp,%ebp
movsd  0x28(%rsp),%xmm0
ucomisd 0x38(%rsp),%xmm0
seta   %bpl
add    $0x1,%ebp
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <rand_double@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x8(%rsp),%rax
movsd  0x8(%rax,%r14,8),%xmm1
mulsd  0x10(%rsp),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
add    %ebp,%eax
xor    %edx,%edx
idiv   %ebx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r15,%r14,8)
mov    0x40(%rsp),%rbp
mov    0xf0(%rsp),%edx
movsd  0xb8a(%rip),%xmm2
mov    0x50(%rsp),%rsi
jmp    12d1 <evolve1D+0x1b1>
mov    0x80(%rsp),%rax
movsd  0x0(%r13,%rax,1),%xmm0
addsd  0x0(%r13,%r12,1),%xmm0
mulsd  0x88(%rsp),%xmm0
movsd  0x0(%r13),%xmm1
mulsd  0x48(%rsp),%xmm1
addsd  %xmm0,%xmm1
mov    0x18(%rsp),%rax
movsd  0x0(%rbp,%rax,8),%xmm0
mulsd  0x20(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15,%r14,8)
jmp    12d1 <evolve1D+0x1b1>
movsd  0xb29(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  0x20(%rsp),%xmm3
xor    %ebp,%ebp
ucomisd %xmm3,%xmm1
seta   %bpl
neg    %ebp
test   %r14,%r14
je     154d <evolve1D+0x42d>
movsd  %xmm3,0x38(%rsp)
movsd  %xmm1,0x28(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <rand_double@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0xffffffff,%eax
add    %r14d,%eax
movsd  0xadd(%rip),%xmm1
mov    0x8(%rsp),%rcx
subsd  (%rcx,%rax,8),%xmm1
mulsd  0x10(%rsp),%xmm1
ucomisd %xmm1,%xmm0
jbe    154d <evolve1D+0x42d>
xor    %ebp,%ebp
movsd  0x28(%rsp),%xmm0
ucomisd 0x38(%rsp),%xmm0
seta   %bpl
not    %ebp
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <rand_double@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xa96(%rip),%xmm2
movapd %xmm2,%xmm1
mov    0x8(%rsp),%rax
subsd  0x8(%rax,%r14,8),%xmm1
mulsd  0x10(%rsp),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
add    %ebx,%ebp
sub    %eax,%ebp
mov    %ebp,%eax
cltd
idiv   %ebx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r15,%r14,8)
mov    0x40(%rsp),%rbp
mov    0xf0(%rsp),%edx
mov    0x50(%rsp),%rsi
jmp    12d1 <evolve1D+0x1b1>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x30(%rsp),%rbp
xor    %ebx,%ebx
mov    0x78(%rsp),%r13
jmp    1608 <evolve1D+0x4e8>
xchg   %ax,%ax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorpd  %xmm1,%xmm1
maxsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%rbp)
mov    0xf0(%rsp),%edx
movsd  0xa0d(%rip),%xmm2
mov    0x50(%rsp),%rsi
add    $0x1,%rbx
add    %r12,%rbp
cmp    %rbx,%rsi
je     1220 <evolve1D+0x100>
movsd  (%r15,%rbx,8),%xmm0
test   %edx,%edx
je     1622 <evolve1D+0x502>
ucomisd 0x9f6(%rip),%xmm0
jbe    15f8 <evolve1D+0x4d8>
ucomisd %xmm0,%xmm2
jbe    15f8 <evolve1D+0x4d8>
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
divsd  0xb0(%rsp),%xmm1
mov    $0x2,%al
call   1040 <rand_normal@plt>
test   %eax,%eax
jle    15d0 <evolve1D+0x4b0>
mov    $0x1,%eax
jmp    15d0 <evolve1D+0x4b0>
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @evolve1D(double* %0, double* %1, double* %2, i32 %3, i32 %4, double %5, double %6, i32 %7, i32 %8) {
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca double
%23 = alloca double
store double* %0, double** %10
store double* %1, double** %11
store double* %2, double** %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store double %5, double* %15
store double %6, double* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
store i32 0, i32* %19
br label %24
24: ; preds = %396, %9
%25 = load i32, i32* %19
%26 = load i32, i32* %14
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %399
28: ; preds = %24
store i32 0, i32* %20
br label %29
29: ; preds = %332, %28
%30 = load i32, i32* %20
%31 = load i32, i32* %13
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %335
33: ; preds = %29
%34 = load i32, i32* %18
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %195
36: ; preds = %33
%37 = load double*, double** %10
%38 = load i32, i32* %20
%39 = load i32, i32* %14
%40 = mul nsw i32 %38, %39
%41 = load i32, i32* %19
%42 = add nsw i32 %40, %41
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %37, i64 %43
%45 = load double, double* %44
%46 = fcmp oeq double %45, 0.000000e+00
br i1 %46, label %58, label %47
47: ; preds = %36
%48 = load double*, double** %10
%49 = load i32, i32* %20
%50 = load i32, i32* %14
%51 = mul nsw i32 %49, %50
%52 = load i32, i32* %19
%53 = add nsw i32 %51, %52
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %48, i64 %54
%56 = load double, double* %55
%57 = fcmp oeq double %56, 1.000000e+00
br i1 %57, label %58, label %195
58: ; preds = %47, %36
store i32 0, i32* %21
%59 = load double*, double** %12
%60 = load i32, i32* %20
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
%63 = load double, double* %62
%64 = fcmp oeq double %63, 0.000000e+00
br i1 %64, label %65, label %127
65: ; preds = %58
%66 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rand_double to i32 (i32, i32, ...)*)(i32 0, i32 1)
%67 = sitofp i32 %66 to double
%68 = load double, double* %16
%69 = load double*, double** %11
%70 = load i32, i32* %19
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
%73 = load double, double* %72
%74 = fmul double %68, %73
%75 = fcmp ogt double %67, %74
br i1 %75, label %76, label %79
76: ; preds = %65
%77 = load i32, i32* %21
%78 = add nsw i32 %77, 1
store i32 %78, i32* %21
br label %79
79: ; preds = %76, %65
%80 = load i32, i32* %20
%81 = icmp sgt i32 %80, 0
br i1 %81, label %82, label %98
82: ; preds = %79
%83 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rand_double to i32 (i32, i32, ...)*)(i32 0, i32 1)
%84 = sitofp i32 %83 to double
%85 = load double, double* %15
%86 = load double*, double** %10
%87 = load i32, i32* %20
%88 = sub nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %86, i64 %89
%91 = load double, double* %90
%92 = fmul double %85, %91
%93 = fcmp ogt double %84, %92
br i1 %93, label %94, label %97
94: ; preds = %82
%95 = load i32, i32* %21
%96 = add nsw i32 %95, 1
store i32 %96, i32* %21
br label %97
97: ; preds = %94, %82
br label %98
98: ; preds = %97, %79
%99 = load i32, i32* %20
%100 = load i32, i32* %13
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %118
102: ; preds = %98
%103 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rand_double to i32 (i32, i32, ...)*)(i32 0, i32 1)
%104 = sitofp i32 %103 to double
%105 = load double, double* %15
%106 = load double*, double** %10
%107 = load i32, i32* %20
%108 = add nsw i32 %107, 1
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %106, i64 %109
%111 = load double, double* %110
%112 = fmul double %105, %111
%113 = fcmp ogt double %104, %112
br i1 %113, label %114, label %117
114: ; preds = %102
%115 = load i32, i32* %21
%116 = add nsw i32 %115, 1
store i32 %116, i32* %21
br label %117
117: ; preds = %114, %102
br label %118
118: ; preds = %117, %98
%119 = load i32, i32* %21
%120 = load i32, i32* %17
%121 = sdiv i32 %119, %120
%122 = sitofp i32 %121 to double
%123 = load double*, double** %12
%124 = load i32, i32* %20
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %123, i64 %125
store double %122, double* %126
br label %194
127: ; preds = %58
%128 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rand_double to i32 (i32, i32, ...)*)(i32 0, i32 1)
%129 = sitofp i32 %128 to double
%130 = load double, double* %16
%131 = load double*, double** %11
%132 = load i32, i32* %19
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %131, i64 %133
%135 = load double, double* %134
%136 = fsub double 1.000000e+00, %135
%137 = fmul double %130, %136
%138 = fcmp ogt double %129, %137
br i1 %138, label %139, label %142
139: ; preds = %127
%140 = load i32, i32* %21
%141 = add nsw i32 %140, 1
store i32 %141, i32* %21
br label %142
142: ; preds = %139, %127
%143 = load i32, i32* %20
%144 = icmp sgt i32 %143, 0
br i1 %144, label %145, label %162
145: ; preds = %142
%146 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rand_double to i32 (i32, i32, ...)*)(i32 0, i32 1)
%147 = sitofp i32 %146 to double
%148 = load double, double* %15
%149 = load double*, double** %10
%150 = load i32, i32* %20
%151 = sub nsw i32 %150, 1
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double, double* %149, i64 %152
%154 = load double, double* %153
%155 = fsub double 1.000000e+00, %154
%156 = fmul double %148, %155
%157 = fcmp ogt double %147, %156
br i1 %157, label %158, label %161
158: ; preds = %145
%159 = load i32, i32* %21
%160 = add nsw i32 %159, 1
store i32 %160, i32* %21
br label %161
161: ; preds = %158, %145
br label %162
162: ; preds = %161, %142
%163 = load i32, i32* %20
%164 = load i32, i32* %13
%165 = icmp slt i32 %163, %164
br i1 %165, label %166, label %183
166: ; preds = %162
%167 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rand_double to i32 (i32, i32, ...)*)(i32 0, i32 1)
%168 = sitofp i32 %167 to double
%169 = load double, double* %15
%170 = load double*, double** %10
%171 = load i32, i32* %20
%172 = add nsw i32 %171, 1
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds double, double* %170, i64 %173
%175 = load double, double* %174
%176 = fsub double 1.000000e+00, %175
%177 = fmul double %169, %176
%178 = fcmp ogt double %168, %177
br i1 %178, label %179, label %182
179: ; preds = %166
%180 = load i32, i32* %21
%181 = add nsw i32 %180, 1
store i32 %181, i32* %21
br label %182
182: ; preds = %179, %166
br label %183
183: ; preds = %182, %162
%184 = load i32, i32* %17
%185 = load i32, i32* %21
%186 = sub nsw i32 %184, %185
%187 = load i32, i32* %17
%188 = sdiv i32 %186, %187
%189 = sitofp i32 %188 to double
%190 = load double*, double** %12
%191 = load i32, i32* %20
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds double, double* %190, i64 %192
store double %189, double* %193
br label %194
194: ; preds = %183, %118
br label %331
195: ; preds = %47, %33
%196 = load i32, i32* %20
%197 = icmp eq i32 %196, 0
br i1 %197, label %198, label %236
198: ; preds = %195
%199 = load double, double* %15
%200 = fsub double 1.000000e+00, %199
%201 = load double, double* %16
%202 = fsub double %200, %201
%203 = load double*, double** %10
%204 = load i32, i32* %20
%205 = load i32, i32* %14
%206 = mul nsw i32 %204, %205
%207 = load i32, i32* %19
%208 = add nsw i32 %206, %207
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds double, double* %203, i64 %209
%211 = load double, double* %210
%212 = load double, double* %15
%213 = load double*, double** %10
%214 = load i32, i32* %20
%215 = add nsw i32 %214, 1
%216 = load i32, i32* %14
%217 = mul nsw i32 %215, %216
%218 = load i32, i32* %19
%219 = add nsw i32 %217, %218
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds double, double* %213, i64 %220
%222 = load double, double* %221
%223 = fmul double %212, %222
%224 = call double @llvm.fmuladd.f64(double %202, double %211, double %223)
%225 = load double, double* %16
%226 = load double*, double** %11
%227 = load i32, i32* %19
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds double, double* %226, i64 %228
%230 = load double, double* %229
%231 = call double @llvm.fmuladd.f64(double %225, double %230, double %224)
%232 = load double*, double** %12
%233 = load i32, i32* %20
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds double, double* %232, i64 %234
store double %231, double* %235
br label %330
236: ; preds = %195
%237 = load i32, i32* %20
%238 = load i32, i32* %13
%239 = sub nsw i32 %238, 1
%240 = icmp eq i32 %237, %239
br i1 %240, label %241, label %279
241: ; preds = %236
%242 = load double, double* %15
%243 = fsub double 1.000000e+00, %242
%244 = load double, double* %16
%245 = fsub double %243, %244
%246 = load double*, double** %10
%247 = load i32, i32* %20
%248 = load i32, i32* %14
%249 = mul nsw i32 %247, %248
%250 = load i32, i32* %19
%251 = add nsw i32 %249, %250
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds double, double* %246, i64 %252
%254 = load double, double* %253
%255 = load double, double* %15
%256 = load double*, double** %10
%257 = load i32, i32* %20
%258 = sub nsw i32 %257, 1
%259 = load i32, i32* %14
%260 = mul nsw i32 %258, %259
%261 = load i32, i32* %19
%262 = add nsw i32 %260, %261
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds double, double* %256, i64 %263
%265 = load double, double* %264
%266 = fmul double %255, %265
%267 = call double @llvm.fmuladd.f64(double %245, double %254, double %266)
%268 = load double, double* %16
%269 = load double*, double** %11
%270 = load i32, i32* %19
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds double, double* %269, i64 %271
%273 = load double, double* %272
%274 = call double @llvm.fmuladd.f64(double %268, double %273, double %267)
%275 = load double*, double** %12
%276 = load i32, i32* %20
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds double, double* %275, i64 %277
store double %274, double* %278
br label %329
279: ; preds = %236
%280 = load double, double* %15
%281 = fsub double 1.000000e+00, %280
%282 = load double, double* %16
%283 = fsub double %281, %282
%284 = load double*, double** %10
%285 = load i32, i32* %20
%286 = load i32, i32* %14
%287 = mul nsw i32 %285, %286
%288 = load i32, i32* %19
%289 = add nsw i32 %287, %288
%290 = sext i32 %289 to i64
%291 = getelementptr inbounds double, double* %284, i64 %290
%292 = load double, double* %291
%293 = load double, double* %15
%294 = fmul double %293, 5.000000e-01
%295 = load double*, double** %10
%296 = load i32, i32* %20
%297 = sub nsw i32 %296, 1
%298 = load i32, i32* %14
%299 = mul nsw i32 %297, %298
%300 = load i32, i32* %19
%301 = add nsw i32 %299, %300
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds double, double* %295, i64 %302
%304 = load double, double* %303
%305 = load double*, double** %10
%306 = load i32, i32* %20
%307 = add nsw i32 %306, 1
%308 = load i32, i32* %14
%309 = mul nsw i32 %307, %308
%310 = load i32, i32* %19
%311 = add nsw i32 %309, %310
%312 = sext i32 %311 to i64
%313 = getelementptr inbounds double, double* %305, i64 %312
%314 = load double, double* %313
%315 = fadd double %304, %314
%316 = fmul double %294, %315
%317 = call double @llvm.fmuladd.f64(double %283, double %292, double %316)
%318 = load double, double* %16
%319 = load double*, double** %11
%320 = load i32, i32* %19
%321 = sext i32 %320 to i64
%322 = getelementptr inbounds double, double* %319, i64 %321
%323 = load double, double* %322
%324 = call double @llvm.fmuladd.f64(double %318, double %323, double %317)
%325 = load double*, double** %12
%326 = load i32, i32* %20
%327 = sext i32 %326 to i64
%328 = getelementptr inbounds double, double* %325, i64 %327
store double %324, double* %328
br label %329
329: ; preds = %279, %241
br label %330
330: ; preds = %329, %198
br label %331
331: ; preds = %330, %194
br label %332
332: ; preds = %331
%333 = load i32, i32* %20
%334 = add nsw i32 %333, 1
store i32 %334, i32* %20
br label %29
335: ; preds = %29
store i32 0, i32* %20
br label %336
336: ; preds = %392, %335
%337 = load i32, i32* %20
%338 = load i32, i32* %13
%339 = icmp slt i32 %337, %338
br i1 %339, label %340, label %395
340: ; preds = %336
%341 = load i32, i32* %18
%342 = icmp ne i32 %341, 0
br i1 %342, label %343, label %357
343: ; preds = %340
%344 = load double*, double** %12
%345 = load i32, i32* %20
%346 = sext i32 %345 to i64
%347 = getelementptr inbounds double, double* %344, i64 %346
%348 = load double, double* %347
%349 = fcmp ogt double %348, 0.000000e+00
br i1 %349, label %350, label %391
350: ; preds = %343
%351 = load double*, double** %12
%352 = load i32, i32* %20
%353 = sext i32 %352 to i64
%354 = getelementptr inbounds double, double* %351, i64 %353
%355 = load double, double* %354
%356 = fcmp olt double %355, 1.000000e+00
br i1 %356, label %357, label %391
357: ; preds = %350, %340
%358 = load double*, double** %12
%359 = load i32, i32* %20
%360 = sext i32 %359 to i64
%361 = getelementptr inbounds double, double* %358, i64 %360
%362 = load double, double* %361
store double %362, double* %22
%363 = load double, double* %22
%364 = load double, double* %22
%365 = load double, double* %22
%366 = fsub double 1.000000e+00, %365
%367 = fmul double %364, %366
%368 = load i32, i32* %17
%369 = mul nsw i32 2, %368
%370 = sitofp i32 %369 to double
%371 = fdiv double %367, %370
%372 = call i32 (double, double, ...) bitcast (i32 (...)* @rand_normal to i32 (double, double, ...)*)(double %363, double %371)
%373 = sitofp i32 %372 to double
store double %373, double* %23
%374 = load double, double* %23
%375 = fcmp ogt double %374, 1.000000e+00
br i1 %375, label %376, label %377
376: ; preds = %357
store double 1.000000e+00, double* %23
br label %377
377: ; preds = %376, %357
%378 = load double, double* %23
%379 = fcmp olt double %378, 0.000000e+00
br i1 %379, label %380, label %381
380: ; preds = %377
store double 0.000000e+00, double* %23
br label %381
381: ; preds = %380, %377
%382 = load double, double* %23
%383 = load double*, double** %10
%384 = load i32, i32* %20
%385 = load i32, i32* %14
%386 = mul nsw i32 %384, %385
%387 = load i32, i32* %19
%388 = add nsw i32 %386, %387
%389 = sext i32 %388 to i64
%390 = getelementptr inbounds double, double* %383, i64 %389
store double %382, double* %390
br label %391
391: ; preds = %381, %350, %343
br label %392
392: ; preds = %391
%393 = load i32, i32* %20
%394 = add nsw i32 %393, 1
store i32 %394, i32* %20
br label %336
395: ; preds = %336
br label %396
396: ; preds = %395
%397 = load i32, i32* %19
%398 = add nsw i32 %397, 1
store i32 %398, i32* %19
br label %24
399: ; preds = %24
ret void
}

LLVM IR (-O2):
define void @evolve1D(double* nocapture %0, double* nocapture %1, double* nocapture %2, i32 %3, i32 %4, double %5, double %6, i32 %7, i32 %8) {
%10 = icmp sgt i32 %4, 0
br i1 %10, label %11, label %186
11: ; preds = %9
%12 = icmp sgt i32 %3, 0
%13 = icmp eq i32 %8, 0
%14 = add nsw i32 %3, -1
%15 = fsub double 1.000000e+00, %5
%16 = fsub double %15, %6
%17 = fmul double %5, 5.000000e-01
%18 = shl nsw i32 %7, 1
%19 = sitofp i32 %18 to double
%20 = zext i32 %4 to i64
%21 = zext i32 %14 to i64
%22 = zext i32 %3 to i64
%23 = mul nuw nsw i64 %21, %20
%24 = add nsw i64 %21, -1
%25 = mul nsw i64 %24, %20
%26 = getelementptr inbounds double, double* %2, i64 %21
br label %27
27: ; preds = %11, %183
%28 = phi i64 [ 0, %11 ], [ %184, %183 ]
br i1 %12, label %29, label %183
29: ; preds = %27
%30 = getelementptr inbounds double, double* %1, i64 %28
%31 = getelementptr inbounds double, double* %0, i64 %28
%32 = add nuw nsw i64 %28, %20
%33 = getelementptr inbounds double, double* %0, i64 %32
%34 = add nuw nsw i64 %28, %23
%35 = getelementptr inbounds double, double* %0, i64 %34
%36 = add nsw i64 %28, %25
%37 = getelementptr inbounds double, double* %0, i64 %36
br label %38
38: ; preds = %29, %156
%39 = phi i64 [ 0, %29 ], [ %157, %156 ]
br i1 %13, label %117, label %40
40: ; preds = %38
%41 = mul nuw nsw i64 %39, %20
%42 = add nuw nsw i64 %41, %28
%43 = getelementptr inbounds double, double* %0, i64 %42
%44 = load double, double* %43
%45 = fcmp oeq double %44, 0.000000e+00
%46 = fcmp oeq double %44, 1.000000e+00
%47 = or i1 %45, %46
br i1 %47, label %48, label %117
48: ; preds = %40
%49 = getelementptr inbounds double, double* %2, i64 %39
%50 = load double, double* %49
%51 = fcmp oeq double %50, 0.000000e+00
%52 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rand_double to i32 (i32, i32, ...)*)(i32 0, i32 1)
%53 = sitofp i32 %52 to double
%54 = load double, double* %30
br i1 %51, label %55, label %84
55: ; preds = %48
%56 = fmul double %54, %6
%57 = fcmp olt double %56, %53
%58 = zext i1 %57 to i32
%59 = icmp eq i64 %39, 0
br i1 %59, label %71, label %60
60: ; preds = %55
%61 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rand_double to i32 (i32, i32, ...)*)(i32 0, i32 1)
%62 = sitofp i32 %61 to double
%63 = add nuw nsw i64 %39, 4294967295
%64 = and i64 %63, 4294967295
%65 = getelementptr inbounds double, double* %0, i64 %64
%66 = load double, double* %65
%67 = fmul double %66, %5
%68 = fcmp olt double %67, %62
br i1 %68, label %69, label %71
69: ; preds = %60
%70 = select i1 %57, i32 2, i32 1
br label %71
71: ; preds = %55, %69, %60
%72 = phi i32 [ %70, %69 ], [ %58, %60 ], [ %58, %55 ]
%73 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rand_double to i32 (i32, i32, ...)*)(i32 0, i32 1)
%74 = sitofp i32 %73 to double
%75 = add nuw nsw i64 %39, 1
%76 = getelementptr inbounds double, double* %0, i64 %75
%77 = load double, double* %76
%78 = fmul double %77, %5
%79 = fcmp olt double %78, %74
%80 = zext i1 %79 to i32
%81 = add nuw nsw i32 %72, %80
%82 = sdiv i32 %81, %7
%83 = sitofp i32 %82 to double
store double %83, double* %49
br label %156
84: ; preds = %48
%85 = fsub double 1.000000e+00, %54
%86 = fmul double %85, %6
%87 = fcmp olt double %86, %53
%88 = sext i1 %87 to i32
%89 = icmp eq i64 %39, 0
br i1 %89, label %102, label %90
90: ; preds = %84
%91 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rand_double to i32 (i32, i32, ...)*)(i32 0, i32 1)
%92 = sitofp i32 %91 to double
%93 = add nuw nsw i64 %39, 4294967295
%94 = and i64 %93, 4294967295
%95 = getelementptr inbounds double, double* %0, i64 %94
%96 = load double, double* %95
%97 = fsub double 1.000000e+00, %96
%98 = fmul double %97, %5
%99 = fcmp olt double %98, %92
br i1 %99, label %100, label %102
100: ; preds = %90
%101 = select i1 %87, i32 -2, i32 -1
br label %102
102: ; preds = %84, %100, %90
%103 = phi i32 [ %101, %100 ], [ %88, %90 ], [ %88, %84 ]
%104 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rand_double to i32 (i32, i32, ...)*)(i32 0, i32 1)
%105 = sitofp i32 %104 to double
%106 = add nuw nsw i64 %39, 1
%107 = getelementptr inbounds double, double* %0, i64 %106
%108 = load double, double* %107
%109 = fsub double 1.000000e+00, %108
%110 = fmul double %109, %5
%111 = fcmp olt double %110, %105
%112 = sext i1 %111 to i32
%113 = add i32 %103, %7
%114 = add i32 %113, %112
%115 = sdiv i32 %114, %7
%116 = sitofp i32 %115 to double
store double %116, double* %49
br label %156
117: ; preds = %40, %38
%118 = icmp eq i64 %39, 0
br i1 %118, label %119, label %126
119: ; preds = %117
%120 = load double, double* %31
%121 = load double, double* %33
%122 = fmul double %121, %5
%123 = tail call double @llvm.fmuladd.f64(double %16, double %120, double %122)
%124 = load double, double* %30
%125 = tail call double @llvm.fmuladd.f64(double %6, double %124, double %123)
store double %125, double* %2
br label %156
126: ; preds = %117
%127 = icmp eq i64 %39, %21
br i1 %127, label %128, label %135
128: ; preds = %126
%129 = load double, double* %35
%130 = load double, double* %37
%131 = fmul double %130, %5
%132 = tail call double @llvm.fmuladd.f64(double %16, double %129, double %131)
%133 = load double, double* %30
%134 = tail call double @llvm.fmuladd.f64(double %6, double %133, double %132)
store double %134, double* %26
br label %156
135: ; preds = %126
%136 = mul nuw nsw i64 %39, %20
%137 = add nuw nsw i64 %136, %28
%138 = getelementptr inbounds double, double* %0, i64 %137
%139 = load double, double* %138
%140 = add nsw i64 %39, -1
%141 = mul nsw i64 %140, %20
%142 = add nsw i64 %141, %28
%143 = getelementptr inbounds double, double* %0, i64 %142
%144 = load double, double* %143
%145 = add nuw nsw i64 %39, 1
%146 = mul nuw nsw i64 %145, %20
%147 = add nuw nsw i64 %146, %28
%148 = getelementptr inbounds double, double* %0, i64 %147
%149 = load double, double* %148
%150 = fadd double %144, %149
%151 = fmul double %17, %150
%152 = tail call double @llvm.fmuladd.f64(double %16, double %139, double %151)
%153 = load double, double* %30
%154 = tail call double @llvm.fmuladd.f64(double %6, double %153, double %152)
%155 = getelementptr inbounds double, double* %2, i64 %39
store double %154, double* %155
br label %156
156: ; preds = %102, %71, %128, %135, %119
%157 = add nuw nsw i64 %39, 1
%158 = icmp eq i64 %157, %22
br i1 %158, label %159, label %38
159: ; preds = %156, %180
%160 = phi i64 [ %181, %180 ], [ 0, %156 ]
%161 = getelementptr inbounds double, double* %2, i64 %160
%162 = load double, double* %161
br i1 %13, label %167, label %163
163: ; preds = %159
%164 = fcmp ogt double %162, 0.000000e+00
%165 = fcmp olt double %162, 1.000000e+00
%166 = and i1 %164, %165
br i1 %166, label %167, label %180
167: ; preds = %159, %163
%168 = fsub double 1.000000e+00, %162
%169 = fmul double %162, %168
%170 = fdiv double %169, %19
%171 = tail call i32 (double, double, ...) bitcast (i32 (...)* @rand_normal to i32 (double, double, ...)*)(double %162, double %170)
%172 = icmp slt i32 %171, 1
%173 = select i1 %172, i32 %171, i32 1
%174 = sitofp i32 %173 to double
%175 = fcmp olt double %174, 0.000000e+00
%176 = select i1 %175, double 0.000000e+00, double %174
%177 = mul nuw nsw i64 %160, %20
%178 = add nuw nsw i64 %177, %28
%179 = getelementptr inbounds double, double* %0, i64 %178
store double %176, double* %179
br label %180
180: ; preds = %163, %167
%181 = add nuw nsw i64 %160, 1
%182 = icmp eq i64 %181, %22
br i1 %182, label %183, label %159
183: ; preds = %180, %27
%184 = add nuw nsw i64 %28, 1
%185 = icmp eq i64 %184, %20
br i1 %185, label %186, label %27
186: ; preds = %183, %9
ret void
}