int narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers(
    char *seq1, char *seq2, int len1, int len2, int maxerr) {
  int **S;
  int score;
  int row, col;
  int match;
  int left, up, diagonal;
  int from, to;
  int rowlength;
  int leftboundary, rightboundary;
  int previousleftboundary;
  int *Sp, *Spu, *Spl, *Spd;
  if (len1 > len2) {
    return (-1);
  }
  S = (int **)calloc((len1 + 1), sizeof(int *));
  for (row = 0; row <= len1; row++) {
    from = row - maxerr;
    to = row + maxerr;
    leftboundary = 0;
    if (from <= 0)
      from = 0;
    else
      leftboundary = 1;
    rightboundary = 0;
    if (to >= len2)
      to = len2;
    else
      rightboundary = 1;
    rowlength = to - from + 1;
    S[row] =
        (int *)calloc(leftboundary + rowlength + rightboundary, sizeof(int));
  }
  row = 0;
  from = row - maxerr;
  to = row + maxerr;
  leftboundary = 0;
  if (from <= 0)
    from = 0;
  else
    leftboundary = 1;
  rightboundary = 0;
  if (to >= len2)
    to = len2;
  else
    rightboundary = 1;
  rowlength = to - from + 1;
  Sp = S[row];
  if (leftboundary) {
    (*Sp) = 1000;
  }
  Sp += leftboundary;
  for (col = leftboundary; col <= leftboundary + rowlength - 1; col++) {
    (*Sp) = col;
    Sp++;
  }
  if (rightboundary) {
    (*Sp) = 1000;
  }
  previousleftboundary = leftboundary;
  for (row = 1; row <= len1; row++) {
    from = row - maxerr;
    to = row + maxerr;
    leftboundary = 0;
    if (from <= 0)
      from = 0;
    else
      leftboundary = 1;
    rightboundary = 0;
    if (to >= len2)
      to = len2;
    else
      rightboundary = 1;
    rowlength = to - from + 1;
    Sp = S[row];
    Spu = S[row - 1] + previousleftboundary;
    Spl = Sp - 1;
    Spd = Spu - 1;
    if (leftboundary) {
      (*Sp) = 1000;
    }
    Sp += leftboundary;
    Spu += leftboundary;
    Spl += leftboundary;
    Spd += leftboundary;
    for (col = leftboundary; col <= leftboundary + rowlength - 1; col++) {
      if (col == 0)
        (*Sp) = row;
      else {
        match = (seq1[row - 1] == seq2[from + col - leftboundary - 1]) ? 0 : 1;
        up = (*Spu) + 1;
        left = (*Spl) + 1;
        diagonal = (*Spd) + match;
        (*Sp) = ((diagonal <= left) ? ((diagonal <= up) ? diagonal : up)
                                    : ((left <= up) ? left : up));
      }
      Sp++;
      Spu++;
      Spl++;
      Spd++;
    }
    if (rightboundary) {
      (*Sp) = 1000;
    }
    previousleftboundary = leftboundary;
  }
  row = len1;
  from = row - maxerr;
  to = row + maxerr;
  leftboundary = 0;
  if (from <= 0)
    from = 0;
  else
    leftboundary = 1;
  rightboundary = 0;
  if (to >= len2)
    to = len2;
  else
    rightboundary = 1;
  rowlength = to - from + 1;
  Sp = S[row];
  score = (*Sp);
  Sp++;
  for (col = 1; col <= leftboundary + rowlength + rightboundary - 1; col++) {
    if ((*Sp) < score) {
      score = (*Sp);
    }
    Sp++;
  }
  for (row = 0; row <= len1; row++) {
    free(S[row]);
  }
  free(S);
  return (score);
}


x86 assembly (clang, -O0):
<narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1155 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    16e4 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x5c4>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1219 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0xf9>
mov    -0x38(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x5c(%rbp)
cmpl   $0x0,-0x50(%rbp)
jg     11ae <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x8e>
movl   $0x0,-0x50(%rbp)
jmp    11b5 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x95>
movl   $0x1,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     11d3 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0xb3>
mov    -0x20(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    11da <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0xba>
movl   $0x1,-0x60(%rbp)
mov    -0x54(%rbp),%eax
sub    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x5c(%rbp),%eax
add    -0x58(%rbp),%eax
add    -0x60(%rbp),%eax
movslq %eax,%rdi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rdx
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1173 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x53>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x5c(%rbp)
cmpl   $0x0,-0x50(%rbp)
jg     124f <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x12f>
movl   $0x0,-0x50(%rbp)
jmp    1256 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x136>
movl   $0x1,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     1274 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x154>
mov    -0x20(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    127b <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x15b>
movl   $0x1,-0x60(%rbp)
mov    -0x54(%rbp),%eax
sub    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x70(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     12ab <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x18b>
mov    -0x70(%rbp),%rax
movl   $0x3e8,(%rax)
mov    -0x5c(%rbp),%ecx
mov    -0x70(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x5c(%rbp),%ecx
add    -0x58(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     12fd <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x1dd>
mov    -0x3c(%rbp),%ecx
mov    -0x70(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x70(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x70(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12c6 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x1a6>
cmpl   $0x0,-0x60(%rbp)
je     1311 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x1f1>
mov    -0x70(%rbp),%rax
movl   $0x3e8,(%rax)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x64(%rbp)
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     15c1 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x4a1>
mov    -0x38(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x5c(%rbp)
cmpl   $0x0,-0x50(%rbp)
jg     1359 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x239>
movl   $0x0,-0x50(%rbp)
jmp    1360 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x240>
movl   $0x1,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     137e <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x25e>
mov    -0x20(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    1385 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x265>
movl   $0x1,-0x60(%rbp)
mov    -0x54(%rbp),%eax
sub    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x70(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x80(%rbp)
mov    -0x78(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x88(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     13f0 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x2d0>
mov    -0x70(%rbp),%rax
movl   $0x3e8,(%rax)
mov    -0x5c(%rbp),%ecx
mov    -0x70(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x5c(%rbp),%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x5c(%rbp),%ecx
mov    -0x80(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
mov    -0x5c(%rbp),%ecx
mov    -0x88(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x5c(%rbp),%ecx
add    -0x58(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1599 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x479>
cmpl   $0x0,-0x3c(%rbp)
jne    147c <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x35c>
mov    -0x38(%rbp),%ecx
mov    -0x70(%rbp),%rax
mov    %ecx,(%rax)
jmp    1555 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x435>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    -0x3c(%rbp),%ecx
sub    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x78(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    -0x80(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x88(%rbp),%rax
mov    (%rax),%eax
add    -0x40(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x44(%rbp),%eax
jg     151a <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x3fa>
mov    -0x4c(%rbp),%eax
cmp    -0x48(%rbp),%eax
jg     1500 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x3e0>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
jmp    1509 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x3e9>
mov    -0x48(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    %eax,-0x90(%rbp)
jmp    1549 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x429>
mov    -0x44(%rbp),%eax
cmp    -0x48(%rbp),%eax
jg     1534 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x414>
mov    -0x44(%rbp),%eax
mov    %eax,-0x94(%rbp)
jmp    153d <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x41d>
mov    -0x48(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    -0x94(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    -0x90(%rbp),%ecx
mov    -0x70(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x70(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x70(%rbp)
mov    -0x78(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x78(%rbp)
mov    -0x80(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x80(%rbp)
mov    -0x88(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x88(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1450 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x330>
cmpl   $0x0,-0x60(%rbp)
je     15ad <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x48d>
mov    -0x70(%rbp),%rax
movl   $0x3e8,(%rax)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    131e <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x1fe>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x5c(%rbp)
cmpl   $0x0,-0x50(%rbp)
jg     15f6 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x4d6>
movl   $0x0,-0x50(%rbp)
jmp    15fd <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x4dd>
movl   $0x1,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     161b <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x4fb>
mov    -0x20(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    1622 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x502>
movl   $0x1,-0x60(%rbp)
mov    -0x54(%rbp),%eax
sub    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x70(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x70(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x5c(%rbp),%ecx
add    -0x58(%rbp),%ecx
add    -0x60(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     16a3 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x583>
mov    -0x70(%rbp),%rax
mov    (%rax),%eax
cmp    -0x34(%rbp),%eax
jge    1689 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x569>
mov    -0x70(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x70(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x70(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    165a <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x53a>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     16d5 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x5b5>
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    16aa <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x58a>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,0x40(%rsp)
mov    %rdi,0x38(%rsp)
mov    $0xffffffff,%r14d
cmp    %ecx,%edx
jg     179a <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x67a>
mov    %r8d,%r15d
mov    %edx,%r12d
lea    0x1(%r12),%eax
movslq %eax,%rbx
mov    $0x8,%esi
mov    %ecx,0x4(%rsp)
mov    %rbx,%rdi
call   1040 <calloc@plt>
mov    0x4(%rsp),%edi
mov    %rax,%r10
xor    %eax,%eax
movslq %r15d,%rbp
movslq %edi,%r14
mov    %ebx,%r13d
test   %r12d,%r12d
mov    %r12,0x10(%rsp)
mov    %r15,0x20(%rsp)
mov    %rbp,0x18(%rsp)
mov    %r13,0x8(%rsp)
js     1223 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x103>
lea    0x1(%r15),%ebx
mov    %r15d,%r13d
neg    %r13d
mov    %r15d,%r12d
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%r15,%r13,1),%eax
lea    (%r15,%rbp,1),%rcx
lea    (%r12,%r15,1),%edx
xor    %esi,%esi
cmp    %r14,%rcx
setl   %sil
cmovge %edi,%edx
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
mov    %ebx,%eax
mov    $0x1,%edi
cmovle %edi,%eax
add    %edx,%eax
add    %ecx,%eax
add    %esi,%eax
movslq %eax,%rdi
mov    $0x4,%esi
mov    %r10,%rbp
call   1040 <calloc@plt>
mov    %rbp,%r10
mov    0x18(%rsp),%rbp
mov    0x4(%rsp),%edi
mov    %rax,(%r10,%r15,8)
add    $0x1,%r15
add    $0xffffffff,%ebx
cmp    %r15,0x8(%rsp)
jne    11b0 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x90>
mov    (%r10),%rsi
mov    0x10(%rsp),%r12
mov    0x8(%rsp),%r13
mov    0x20(%rsp),%r15
xor    %eax,%eax
jmp    1225 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x105>
xor    %esi,%esi
test   %r15d,%r15d
cmovs  %r15d,%eax
mov    %r15d,%r9d
shr    $0x1f,%r9d
cmp    %edi,%r15d
mov    %edi,%r8d
cmovl  %r15d,%r8d
add    %eax,%r8d
test   %r15d,%r15d
jns    124b <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x12b>
movl   $0x3e8,(%rsi)
mov    %r9d,%eax
lea    (%rsi,%rax,4),%rdx
lea    (%r8,%r9,1),%r11d
cmp    %r9d,%r11d
mov    %r10,0x28(%rsp)
jl     1419 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x2f9>
cmp    $0x7,%r8d
jae    1272 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x152>
mov    %r9d,%edi
jmp    13f7 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x2d7>
add    $0x1,%r8
mov    %r8,%rdi
and    $0xfffffffffffffff8,%rdi
movd   %r9d,%xmm0
pshufd $0x0,%xmm0,%xmm0
paddd  0xd71(%rip),%xmm0
lea    -0x8(%rdi),%rbx
mov    %rbx,%rcx
shr    $0x3,%rcx
add    $0x1,%rcx
mov    %ecx,%r10d
and    $0x3,%r10d
cmp    $0x18,%rbx
jae    12b2 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x192>
xor    %ebx,%ebx
jmp    1389 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x269>
and    $0xfffffffffffffffc,%rcx
lea    (%rsi,%rax,4),%rbp
add    $0x70,%rbp
xor    %ebx,%ebx
movdqa 0xd47(%rip),%xmm8
movdqa 0xd4e(%rip),%xmm9
movdqa 0xd55(%rip),%xmm10
movdqa 0xd5d(%rip),%xmm4
movdqa 0xd65(%rip),%xmm5
movdqa 0xd6d(%rip),%xmm6
movdqa 0xd75(%rip),%xmm7
movdqa 0xd7d(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movdqa %xmm0,%xmm2
paddd  %xmm8,%xmm2
movdqu %xmm0,-0x70(%rbp,%rbx,4)
movdqu %xmm2,-0x60(%rbp,%rbx,4)
movdqa %xmm0,%xmm2
paddd  %xmm9,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm10,%xmm3
movdqu %xmm2,-0x50(%rbp,%rbx,4)
movdqu %xmm3,-0x40(%rbp,%rbx,4)
movdqa %xmm0,%xmm2
paddd  %xmm4,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm5,%xmm3
movdqu %xmm2,-0x30(%rbp,%rbx,4)
movdqu %xmm3,-0x20(%rbp,%rbx,4)
movdqa %xmm0,%xmm2
paddd  %xmm6,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm7,%xmm3
movdqu %xmm2,-0x10(%rbp,%rbx,4)
movdqu %xmm3,0x0(%rbp,%rbx,4)
add    $0x20,%rbx
paddd  %xmm1,%xmm0
add    $0xfffffffffffffffc,%rcx
jne    1310 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x1f0>
test   %r10,%r10
je     13d0 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x2b0>
add    %rax,%rbx
lea    (%rsi,%rbx,4),%rax
add    $0x10,%rax
shl    $0x5,%r10
xor    %ecx,%ecx
movdqa 0xc69(%rip),%xmm1
movdqa 0xc71(%rip),%xmm2
nop
movdqa %xmm0,%xmm3
paddd  %xmm1,%xmm3
movdqu %xmm0,-0x10(%rax,%rcx,1)
movdqu %xmm3,(%rax,%rcx,1)
paddd  %xmm2,%xmm0
add    $0x20,%rcx
cmp    %rcx,%r10
jne    13b0 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x290>
lea    (%rdx,%rdi,4),%rdx
cmp    %rdi,%r8
mov    0x8(%rsp),%r13
jne    13ea <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x2ca>
mov    0x10(%rsp),%r12
mov    0x18(%rsp),%rbp
jmp    1419 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x2f9>
or     %r9d,%edi
mov    0x10(%rsp),%r12
mov    0x18(%rsp),%rbp
neg    %r11d
nopw   0x0(%rax,%rax,1)
mov    %edi,(%rdx)
add    $0x4,%rdx
lea    (%r11,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%ecx
add    $0x1,%ecx
mov    %ecx,%edi
cmp    $0x1,%eax
jne    1400 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x2e0>
mov    0x4(%rsp),%edi
cmp    %edi,%r15d
jge    1428 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x308>
movl   $0x3e8,(%rdx)
test   %r12d,%r12d
jle    1575 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x455>
mov    %r14,%rcx
mov    $0x1,%r12d
mov    %r14,0x30(%rsp)
jmp    1468 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x348>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
mov    %r10,%rsi
mov    %r14d,%r9d
cmp    %r13,%r12
mov    0x18(%rsp),%rbp
je     1575 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x455>
mov    %r12,%rax
sub    %rbp,%rax
lea    (%r12,%rbp,1),%r8
test   %rax,%rax
mov    %eax,%r15d
mov    $0x0,%edx
cmovle %edx,%r15d
cmp    %rcx,%r8
mov    %edi,%ecx
cmovl  %r8d,%ecx
sub    %r15d,%ecx
xor    %r14d,%r14d
mov    0x28(%rsp),%rdx
mov    (%rdx,%r12,8),%r10
test   %rax,%rax
setg   %al
jle    14a8 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x388>
movl   $0x3e8,(%r10)
mov    %al,%r14b
mov    %r14d,%r11d
lea    (%r10,%r11,4),%rbx
add    %r14d,%ecx
cmp    %r14d,%ecx
jl     155c <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x43c>
mov    %r9d,%eax
lea    (%rsi,%rax,4),%rax
lea    (%rax,%r11,4),%rax
movslq %ecx,%r9
add    $0xffffffff,%r15d
xor    %esi,%esi
xor    %ecx,%ecx
jmp    14fc <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x3dc>
cs nopw 0x0(%rax,%rax,1)
mov    %edi,(%rbx,%rcx,4)
lea    (%r11,%rcx,1),%rdx
add    $0x1,%rdx
add    $0x1,%rcx
add    $0xffffffffffffffff,%rdx
add    $0xfffffffffffffffc,%rsi
cmp    %r9,%rdx
jge    1550 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x430>
mov    %r11,%rbp
mov    %r12d,%edi
add    %rcx,%rbp
je     14e0 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x3c0>
mov    0x38(%rsp),%rdx
movzbl -0x1(%rdx,%r12,1),%edx
lea    (%r15,%rcx,1),%edi
movslq %edi,%rdi
xor    %ebp,%ebp
mov    0x40(%rsp),%r13
cmp    0x0(%r13,%rdi,1),%dl
setne  %bpl
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    -0x4(%rbx,%rcx,4),%edi
add    -0x4(%rax,%rcx,4),%ebp
add    $0x1,%edi
cmp    %edx,%edi
cmovg  %edx,%edi
cmp    %ebp,%edi
cmovge %ebp,%edi
jmp    14e0 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x3c0>
cs nopw 0x0(%rax,%rax,1)
sub    %rsi,%rbx
mov    0x8(%rsp),%r13
mov    0x4(%rsp),%edi
mov    0x30(%rsp),%rcx
cmp    %rcx,%r8
jge    1450 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x330>
movl   $0x3e8,(%rbx)
jmp    1450 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x330>
mov    0x10(%rsp),%rbx
mov    %ebx,%ecx
mov    0x20(%rsp),%rbp
sub    %ebp,%ecx
add    %ebx,%ebp
xor    %esi,%esi
cmp    %edi,%ebp
cmovge %edi,%ebp
setl   %sil
mov    $0x1,%edi
mov    $0x1,%eax
sub    %ecx,%eax
xor    %edx,%edx
test   %ecx,%ecx
setg   %dl
movslq %ebx,%rcx
mov    0x28(%rsp),%r15
mov    (%r15,%rcx,8),%rcx
mov    (%rcx),%r14d
cmovle %edi,%eax
add    %ebp,%eax
lea    (%rax,%rdx,1),%ebp
add    %esi,%ebp
cmp    $0x2,%ebp
jl     15d8 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x4b8>
add    %esi,%eax
lea    (%rdx,%rax,1),%esi
add    $0xfffffffe,%esi
cmp    $0x7,%esi
jae    15e2 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x4c2>
mov    0x8(%rsp),%rbp
jmp    174d <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x62d>
mov    0x8(%rsp),%rbp
jmp    1773 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x653>
add    $0x1,%rsi
mov    %rsi,%r8
and    $0xfffffffffffffff8,%r8
movd   %r14d,%xmm0
pshufd $0x0,%xmm0,%xmm0
lea    -0x8(%r8),%rdi
mov    %rdi,%rbp
shr    $0x3,%rbp
add    $0x1,%rbp
test   %rdi,%rdi
je     17ac <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x68c>
movabs $0x3ffffffffffffffc,%rdi
ff ff 3f
or     $0x2,%rdi
and    %rbp,%rdi
xor    %ebx,%ebx
movdqa %xmm0,%xmm1
cs nopw 0x0(%rax,%rax,1)
movdqu 0x4(%rcx,%rbx,4),%xmm2
movdqu 0x14(%rcx,%rbx,4),%xmm3
movdqu 0x24(%rcx,%rbx,4),%xmm4
movdqu 0x34(%rcx,%rbx,4),%xmm5
movdqa %xmm0,%xmm6
pcmpgtd %xmm2,%xmm6
pand   %xmm6,%xmm2
pandn  %xmm0,%xmm6
por    %xmm2,%xmm6
movdqa %xmm1,%xmm2
pcmpgtd %xmm3,%xmm2
pand   %xmm2,%xmm3
pandn  %xmm1,%xmm2
por    %xmm3,%xmm2
movdqa %xmm6,%xmm0
pcmpgtd %xmm4,%xmm0
pand   %xmm0,%xmm4
pandn  %xmm6,%xmm0
por    %xmm4,%xmm0
movdqa %xmm2,%xmm1
pcmpgtd %xmm5,%xmm1
pand   %xmm1,%xmm5
pandn  %xmm2,%xmm1
por    %xmm5,%xmm1
add    $0x10,%rbx
add    $0xfffffffffffffffe,%rdi
jne    1630 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x510>
test   $0x1,%bpl
je     16e4 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x5c4>
movdqu 0x4(%rcx,%rbx,4),%xmm2
movdqu 0x14(%rcx,%rbx,4),%xmm3
movdqa %xmm0,%xmm4
pcmpgtd %xmm2,%xmm4
pand   %xmm4,%xmm2
pandn  %xmm0,%xmm4
por    %xmm2,%xmm4
movdqa %xmm1,%xmm2
pcmpgtd %xmm3,%xmm2
pand   %xmm2,%xmm3
pandn  %xmm1,%xmm2
por    %xmm3,%xmm2
movdqa %xmm4,%xmm0
movdqa %xmm2,%xmm1
movdqa %xmm1,%xmm2
pcmpgtd %xmm0,%xmm2
pand   %xmm2,%xmm0
pandn  %xmm1,%xmm2
por    %xmm0,%xmm2
pshufd $0xee,%xmm2,%xmm0
movdqa %xmm0,%xmm1
pcmpgtd %xmm2,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm0,%xmm1
por    %xmm2,%xmm1
pshufd $0x55,%xmm1,%xmm0
movdqa %xmm0,%xmm2
pcmpgtd %xmm1,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm0,%xmm2
por    %xmm1,%xmm2
movd   %xmm2,%r14d
cmp    %r8,%rsi
mov    0x8(%rsp),%rbp
jne    1740 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x620>
mov    0x10(%rsp),%rbx
jmp    1773 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x653>
lea    (%rcx,%r8,4),%rcx
lea    0x1(%r8),%edi
mov    0x10(%rsp),%rbx
add    %edx,%eax
sub    %edi,%eax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x4(%rcx,%rdx,4),%esi
cmp    %r14d,%esi
cmovl  %esi,%r14d
add    $0x1,%rdx
cmp    %edx,%eax
jne    1760 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x640>
test   %ebx,%ebx
js     1792 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x672>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1780 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x660>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14d,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebx,%ebx
movdqa %xmm0,%xmm1
test   $0x1,%bpl
jne    16a8 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x588>
jmp    16e4 <narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers+0x5c4>

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

LLVM IR (-O2):
define i32 @narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %2, %3
br i1 %6, label %349, label %7
7: ; preds = %5
%8 = add i32 %2, 1
%9 = sext i32 %8 to i64
%10 = tail call i8* @calloc(i64 %9, i64 8)
%11 = bitcast i8* %10 to i32**
%12 = icmp slt i32 %2, 0
br i1 %12, label %42, label %13
13: ; preds = %7
%14 = sext i32 %4 to i64
%15 = sext i32 %3 to i64
%16 = zext i32 %8 to i64
br label %17
17: ; preds = %13, %17
%18 = phi i64 [ 0, %13 ], [ %38, %17 ]
%19 = trunc i64 %18 to i32
%20 = sub nsw i32 %19, %4
%21 = add nsw i64 %18, %14
%22 = icmp slt i32 %20, 1
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
%25 = icmp slt i64 %21, %15
%26 = trunc i64 %21 to i32
%27 = select i1 %25, i32 %26, i32 %3
%28 = zext i1 %25 to i32
%29 = sub i32 1, %20
%30 = select i1 %22, i32 1, i32 %29
%31 = add i32 %30, %27
%32 = add i32 %31, %24
%33 = add i32 %32, %28
%34 = sext i32 %33 to i64
%35 = tail call i8* @calloc(i64 %34, i64 4)
%36 = getelementptr inbounds i32*, i32** %11, i64 %18
%37 = bitcast i32** %36 to i8**
store i8* %35, i8** %37
%38 = add nuw nsw i64 %18, 1
%39 = icmp eq i64 %38, %16
br i1 %39, label %40, label %17
40: ; preds = %17
%41 = load i32*, i32** %11
br label %42
42: ; preds = %40, %7
%43 = phi i32* [ %41, %40 ], [ null, %7 ]
%44 = icmp sgt i32 %4, -1
%45 = select i1 %44, i32 0, i32 %4
%46 = xor i1 %44, true
%47 = zext i1 %46 to i32
%48 = icmp slt i32 %4, %3
%49 = select i1 %48, i32 %4, i32 %3
%50 = add i32 %45, %49
br i1 %44, label %52, label %51
51: ; preds = %42
store i32 1000, i32* %43
br label %52
52: ; preds = %51, %42
%53 = zext i1 %46 to i64
%54 = getelementptr inbounds i32, i32* %43, i64 %53
%55 = add i32 %50, %47
%56 = icmp slt i32 %55, %47
br i1 %56, label %139, label %57
57: ; preds = %52
%58 = add i32 %45, %49
%59 = zext i32 %58 to i64
%60 = add nuw nsw i64 %59, 1
%61 = icmp ult i32 %58, 7
br i1 %61, label %130, label %62
62: ; preds = %57
%63 = and i64 %60, 8589934584
%64 = getelementptr i32, i32* %54, i64 %63
%65 = trunc i64 %63 to i32
%66 = or i32 %47, %65
%67 = insertelement <4 x i32> poison, i32 %47, i64 0
%68 = shufflevector <4 x i32> %67, <4 x i32> poison, <4 x i32> zeroinitializer
%69 = add nuw nsw <4 x i32> %68, <i32 0, i32 1, i32 2, i32 3>
%70 = add nsw i64 %63, -8
%71 = lshr exact i64 %70, 3
%72 = add nuw nsw i64 %71, 1
%73 = and i64 %72, 3
%74 = icmp ult i64 %70, 24
br i1 %74, label %111, label %75
75: ; preds = %62
%76 = and i64 %72, 4611686018427387900
br label %77
77: ; preds = %77, %75
%78 = phi i64 [ 0, %75 ], [ %107, %77 ]
%79 = phi <4 x i32> [ %69, %75 ], [ %108, %77 ]
%80 = phi i64 [ 0, %75 ], [ %109, %77 ]
%81 = getelementptr i32, i32* %54, i64 %78
%82 = add <4 x i32> %79, <i32 4, i32 4, i32 4, i32 4>
%83 = bitcast i32* %81 to <4 x i32>*
store <4 x i32> %79, <4 x i32>* %83
%84 = getelementptr i32, i32* %81, i64 4
%85 = bitcast i32* %84 to <4 x i32>*
store <4 x i32> %82, <4 x i32>* %85
%86 = or i64 %78, 8
%87 = add <4 x i32> %79, <i32 8, i32 8, i32 8, i32 8>
%88 = getelementptr i32, i32* %54, i64 %86
%89 = add <4 x i32> %79, <i32 12, i32 12, i32 12, i32 12>
%90 = bitcast i32* %88 to <4 x i32>*
store <4 x i32> %87, <4 x i32>* %90
%91 = getelementptr i32, i32* %88, i64 4
%92 = bitcast i32* %91 to <4 x i32>*
store <4 x i32> %89, <4 x i32>* %92
%93 = or i64 %78, 16
%94 = add <4 x i32> %79, <i32 16, i32 16, i32 16, i32 16>
%95 = getelementptr i32, i32* %54, i64 %93
%96 = add <4 x i32> %79, <i32 20, i32 20, i32 20, i32 20>
%97 = bitcast i32* %95 to <4 x i32>*
store <4 x i32> %94, <4 x i32>* %97
%98 = getelementptr i32, i32* %95, i64 4
%99 = bitcast i32* %98 to <4 x i32>*
store <4 x i32> %96, <4 x i32>* %99
%100 = or i64 %78, 24
%101 = add <4 x i32> %79, <i32 24, i32 24, i32 24, i32 24>
%102 = getelementptr i32, i32* %54, i64 %100
%103 = add <4 x i32> %79, <i32 28, i32 28, i32 28, i32 28>
%104 = bitcast i32* %102 to <4 x i32>*
store <4 x i32> %101, <4 x i32>* %104
%105 = getelementptr i32, i32* %102, i64 4
%106 = bitcast i32* %105 to <4 x i32>*
store <4 x i32> %103, <4 x i32>* %106
%107 = add nuw i64 %78, 32
%108 = add <4 x i32> %79, <i32 32, i32 32, i32 32, i32 32>
%109 = add i64 %80, 4
%110 = icmp eq i64 %109, %76
br i1 %110, label %111, label %77
111: ; preds = %77, %62
%112 = phi i64 [ 0, %62 ], [ %107, %77 ]
%113 = phi <4 x i32> [ %69, %62 ], [ %108, %77 ]
%114 = icmp eq i64 %73, 0
br i1 %114, label %128, label %115
115: ; preds = %111, %115
%116 = phi i64 [ %124, %115 ], [ %112, %111 ]
%117 = phi <4 x i32> [ %125, %115 ], [ %113, %111 ]
%118 = phi i64 [ %126, %115 ], [ 0, %111 ]
%119 = getelementptr i32, i32* %54, i64 %116
%120 = add <4 x i32> %117, <i32 4, i32 4, i32 4, i32 4>
%121 = bitcast i32* %119 to <4 x i32>*
store <4 x i32> %117, <4 x i32>* %121
%122 = getelementptr i32, i32* %119, i64 4
%123 = bitcast i32* %122 to <4 x i32>*
store <4 x i32> %120, <4 x i32>* %123
%124 = add nuw i64 %116, 8
%125 = add <4 x i32> %117, <i32 8, i32 8, i32 8, i32 8>
%126 = add i64 %118, 1
%127 = icmp eq i64 %126, %73
br i1 %127, label %128, label %115
128: ; preds = %115, %111
%129 = icmp eq i64 %60, %63
br i1 %129, label %139, label %130
130: ; preds = %57, %128
%131 = phi i32* [ %54, %57 ], [ %64, %128 ]
%132 = phi i32 [ %47, %57 ], [ %66, %128 ]
br label %133
133: ; preds = %130, %133
%134 = phi i32* [ %136, %133 ], [ %131, %130 ]
%135 = phi i32 [ %137, %133 ], [ %132, %130 ]
store i32 %135, i32* %134
%136 = getelementptr inbounds i32, i32* %134, i64 1
%137 = add nuw i32 %135, 1
%138 = icmp eq i32 %135, %55
br i1 %138, label %139, label %133
139: ; preds = %133, %128, %52
%140 = phi i32* [ %54, %52 ], [ %64, %128 ], [ %136, %133 ]
br i1 %48, label %141, label %142
141: ; preds = %139
store i32 1000, i32* %140
br label %142
142: ; preds = %141, %139
%143 = icmp slt i32 %2, 1
br i1 %143, label %225, label %144
144: ; preds = %142
%145 = sext i32 %4 to i64
%146 = sext i32 %3 to i64
%147 = zext i32 %8 to i64
br label %148
148: ; preds = %144, %222
%149 = phi i32* [ %43, %144 ], [ %164, %222 ]
%150 = phi i64 [ 1, %144 ], [ %223, %222 ]
%151 = phi i32 [ %47, %144 ], [ %158, %222 ]
%152 = sub nsw i64 %150, %145
%153 = add nsw i64 %150, %145
%154 = icmp slt i64 %152, 1
%155 = trunc i64 %152 to i32
%156 = select i1 %154, i32 0, i32 %155
%157 = xor i1 %154, true
%158 = zext i1 %157 to i32
%159 = icmp slt i64 %153, %146
%160 = trunc i64 %153 to i32
%161 = select i1 %159, i32 %160, i32 %3
%162 = sub i32 %161, %156
%163 = getelementptr inbounds i32*, i32** %11, i64 %150
%164 = load i32*, i32** %163
%165 = add nsw i64 %150, -1
%166 = zext i32 %151 to i64
%167 = getelementptr inbounds i32, i32* %149, i64 %166
%168 = getelementptr inbounds i32, i32* %164, i64 -1
%169 = getelementptr inbounds i32, i32* %167, i64 -1
br i1 %154, label %171, label %170
170: ; preds = %148
store i32 1000, i32* %164
br label %171
171: ; preds = %170, %148
%172 = zext i1 %157 to i64
%173 = getelementptr inbounds i32, i32* %164, i64 %172
%174 = add i32 %162, %158
%175 = icmp slt i32 %174, %158
br i1 %175, label %219, label %176
176: ; preds = %171
%177 = getelementptr inbounds i32, i32* %169, i64 %172
%178 = getelementptr inbounds i32, i32* %168, i64 %172
%179 = getelementptr inbounds i32, i32* %167, i64 %172
%180 = getelementptr inbounds i8, i8* %0, i64 %165
%181 = xor i32 %158, -1
%182 = add i32 %156, %181
%183 = sext i32 %174 to i64
%184 = trunc i64 %150 to i32
br label %185
185: ; preds = %176, %211
%186 = phi i64 [ %172, %176 ], [ %217, %211 ]
%187 = phi i32* [ %177, %176 ], [ %216, %211 ]
%188 = phi i32* [ %178, %176 ], [ %215, %211 ]
%189 = phi i32* [ %179, %176 ], [ %214, %211 ]
%190 = phi i32* [ %173, %176 ], [ %213, %211 ]
%191 = icmp eq i64 %186, 0
br i1 %191, label %211, label %192
192: ; preds = %185
%193 = load i8, i8* %180
%194 = trunc i64 %186 to i32
%195 = add i32 %182, %194
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds i8, i8* %1, i64 %196
%198 = load i8, i8* %197
%199 = icmp ne i8 %193, %198
%200 = zext i1 %199 to i32
%201 = load i32, i32* %189
%202 = add nsw i32 %201, 1
%203 = load i32, i32* %188
%204 = add nsw i32 %203, 1
%205 = load i32, i32* %187
%206 = add nsw i32 %205, %200
%207 = icmp sgt i32 %204, %202
%208 = select i1 %207, i32 %202, i32 %204
%209 = icmp slt i32 %208, %206
%210 = select i1 %209, i32 %208, i32 %206
br label %211
211: ; preds = %185, %192
%212 = phi i32 [ %210, %192 ], [ %184, %185 ]
store i32 %212, i32* %190
%213 = getelementptr inbounds i32, i32* %190, i64 1
%214 = getelementptr inbounds i32, i32* %189, i64 1
%215 = getelementptr inbounds i32, i32* %188, i64 1
%216 = getelementptr inbounds i32, i32* %187, i64 1
%217 = add nuw nsw i64 %186, 1
%218 = icmp slt i64 %186, %183
br i1 %218, label %185, label %219
219: ; preds = %211, %171
%220 = phi i32* [ %173, %171 ], [ %213, %211 ]
br i1 %159, label %221, label %222
221: ; preds = %219
store i32 1000, i32* %220
br label %222
222: ; preds = %221, %219
%223 = add nuw nsw i64 %150, 1
%224 = icmp eq i64 %223, %147
br i1 %224, label %225, label %148
225: ; preds = %222, %142
%226 = sub nsw i32 %2, %4
%227 = add nsw i32 %4, %2
%228 = icmp slt i32 %226, 1
%229 = xor i1 %228, true
%230 = zext i1 %229 to i32
%231 = icmp slt i32 %227, %3
%232 = select i1 %231, i32 %227, i32 %3
%233 = zext i1 %231 to i32
%234 = sext i32 %2 to i64
%235 = getelementptr inbounds i32*, i32** %11, i64 %234
%236 = load i32*, i32** %235
%237 = load i32, i32* %236
%238 = sub i32 1, %226
%239 = select i1 %228, i32 1, i32 %238
%240 = add i32 %239, %232
%241 = add i32 %240, %230
%242 = add i32 %241, %233
%243 = icmp sgt i32 %242, 1
br i1 %243, label %244, label %327
244: ; preds = %225
%245 = add i32 %239, %232
%246 = add i32 %245, %233
%247 = add i32 %246, %230
%248 = add i32 %247, -2
%249 = zext i32 %248 to i64
%250 = add nuw nsw i64 %249, 1
%251 = icmp ult i32 %248, 7
br i1 %251, label %323, label %252
252: ; preds = %244
%253 = and i64 %250, 8589934584
%254 = getelementptr i32, i32* %236, i64 %253
%255 = trunc i64 %253 to i32
%256 = or i32 %255, 1
%257 = insertelement <4 x i32> poison, i32 %237, i64 0
%258 = shufflevector <4 x i32> %257, <4 x i32> poison, <4 x i32> zeroinitializer
%259 = add nsw i64 %253, -8
%260 = lshr exact i64 %259, 3
%261 = add nuw nsw i64 %260, 1
%262 = and i64 %261, 1
%263 = icmp eq i64 %259, 0
br i1 %263, label %297, label %264
264: ; preds = %252
%265 = and i64 %261, 4611686018427387902
%266 = getelementptr i32, i32* %236, i64 1
%267 = getelementptr i32, i32* %236, i64 1
br label %268
268: ; preds = %268, %264
%269 = phi i64 [ 0, %264 ], [ %294, %268 ]
%270 = phi <4 x i32> [ %258, %264 ], [ %292, %268 ]
%271 = phi <4 x i32> [ %258, %264 ], [ %293, %268 ]
%272 = phi i64 [ 0, %264 ], [ %295, %268 ]
%273 = getelementptr inbounds i32, i32* %266, i64 %269
%274 = bitcast i32* %273 to <4 x i32>*
%275 = load <4 x i32>, <4 x i32>* %274
%276 = getelementptr inbounds i32, i32* %273, i64 4
%277 = bitcast i32* %276 to <4 x i32>*
%278 = load <4 x i32>, <4 x i32>* %277
%279 = icmp slt <4 x i32> %275, %270
%280 = icmp slt <4 x i32> %278, %271
%281 = select <4 x i1> %279, <4 x i32> %275, <4 x i32> %270
%282 = select <4 x i1> %280, <4 x i32> %278, <4 x i32> %271
%283 = or i64 %269, 8
%284 = getelementptr inbounds i32, i32* %267, i64 %283
%285 = bitcast i32* %284 to <4 x i32>*
%286 = load <4 x i32>, <4 x i32>* %285
%287 = getelementptr inbounds i32, i32* %284, i64 4
%288 = bitcast i32* %287 to <4 x i32>*
%289 = load <4 x i32>, <4 x i32>* %288
%290 = icmp slt <4 x i32> %286, %281
%291 = icmp slt <4 x i32> %289, %282
%292 = select <4 x i1> %290, <4 x i32> %286, <4 x i32> %281
%293 = select <4 x i1> %291, <4 x i32> %289, <4 x i32> %282
%294 = add nuw i64 %269, 16
%295 = add i64 %272, 2
%296 = icmp eq i64 %295, %265
br i1 %296, label %297, label %268
297: ; preds = %268, %252
%298 = phi <4 x i32> [ undef, %252 ], [ %292, %268 ]
%299 = phi <4 x i32> [ undef, %252 ], [ %293, %268 ]
%300 = phi i64 [ 0, %252 ], [ %294, %268 ]
%301 = phi <4 x i32> [ %258, %252 ], [ %292, %268 ]
%302 = phi <4 x i32> [ %258, %252 ], [ %293, %268 ]
%303 = icmp eq i64 %262, 0
br i1 %303, label %316, label %304
304: ; preds = %297
%305 = getelementptr i32, i32* %236, i64 1
%306 = getelementptr inbounds i32, i32* %305, i64 %300
%307 = bitcast i32* %306 to <4 x i32>*
%308 = load <4 x i32>, <4 x i32>* %307
%309 = getelementptr inbounds i32, i32* %306, i64 4
%310 = bitcast i32* %309 to <4 x i32>*
%311 = load <4 x i32>, <4 x i32>* %310
%312 = icmp slt <4 x i32> %308, %301
%313 = icmp slt <4 x i32> %311, %302
%314 = select <4 x i1> %312, <4 x i32> %308, <4 x i32> %301
%315 = select <4 x i1> %313, <4 x i32> %311, <4 x i32> %302
br label %316
316: ; preds = %297, %304
%317 = phi <4 x i32> [ %298, %297 ], [ %314, %304 ]
%318 = phi <4 x i32> [ %299, %297 ], [ %315, %304 ]
%319 = icmp slt <4 x i32> %317, %318
%320 = select <4 x i1> %319, <4 x i32> %317, <4 x i32> %318
%321 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %320)
%322 = icmp eq i64 %250, %253
br i1 %322, label %327, label %323
323: ; preds = %244, %316
%324 = phi i32* [ %236, %244 ], [ %254, %316 ]
%325 = phi i32 [ %237, %244 ], [ %321, %316 ]
%326 = phi i32 [ 1, %244 ], [ %256, %316 ]
br label %331
327: ; preds = %331, %316, %225
%328 = phi i32 [ %237, %225 ], [ %321, %316 ], [ %338, %331 ]
br i1 %12, label %348, label %329
329: ; preds = %327
%330 = zext i32 %8 to i64
br label %341
331: ; preds = %323, %331
%332 = phi i32* [ %335, %331 ], [ %324, %323 ]
%333 = phi i32 [ %338, %331 ], [ %325, %323 ]
%334 = phi i32 [ %339, %331 ], [ %326, %323 ]
%335 = getelementptr inbounds i32, i32* %332, i64 1
%336 = load i32, i32* %335
%337 = icmp slt i32 %336, %333
%338 = select i1 %337, i32 %336, i32 %333
%339 = add nuw nsw i32 %334, 1
%340 = icmp eq i32 %339, %242
br i1 %340, label %327, label %331
341: ; preds = %329, %341
%342 = phi i64 [ 0, %329 ], [ %346, %341 ]
%343 = getelementptr inbounds i32*, i32** %11, i64 %342
%344 = bitcast i32** %343 to i8**
%345 = load i8*, i8** %344
tail call void @free(i8* %345)
%346 = add nuw nsw i64 %342, 1
%347 = icmp eq i64 %346, %330
br i1 %347, label %348, label %341
348: ; preds = %341, %327
tail call void @free(i8* %10)
br label %349
349: ; preds = %5, %348
%350 = phi i32 [ %328, %348 ], [ -1, %5 ]
ret i32 %350
}