// File: /workspace/github_c_makefile_star2_O1/thegenemyers[P]DASCRUBBER/align.c
// Function: Gap_Improver
void Gap_Improver(Alignment *aln, Work_Data *ework)
{ _Work_Data *work = (_Work_Data *) ework;
  int        *F, *H;
  int        *f, *h;

  char  *A, *B;
  int    x;
  int    p, q;
  int    d, m;
  int   *t, T;
  int    Fpos, Lpos, Fdag, Hamm, Gaps, Diag;
  int    passes;
 
  A = aln->aseq-1;
  B = aln->bseq-1;
  t = (int *) aln->path->trace;
  T = aln->path->tlen;
  F = (int *) work->vector;

  d = aln->path->abpos - aln->path->bbpos;
  q = t[0];
  x = 0;
  while (x < T)
    { p = q;
      m = x;
      Fdag = d;
      Fpos = p;
      Hamm = 0;
      Gaps = 1;
      while (1)
        { x += 1;
          q = 0;
          if (x >= T || (q = t[x]) != p)
            { m = x-m;
              if (p < 0)
                { d -= m;
                  if (q >= 0)
                    break;
                  if (p-q >= LONG_SNAKE)
                    break;
                  Hamm += hamming(A-p,B-(d+p),p-q);
                }
              else
                { d += m;
                  if (q <= 0)
                    break;
                  if (q-p >= LONG_SNAKE)
                    break;
                  Hamm += hamming(A+(p+d),B+p,q-p);
                }
              Gaps += 1;
              p = q;
              m = x;
            }
        }
      if (Gaps == 1)
        continue;
      Lpos = p;
      Diag = abs(Fdag-d)+1;

      // Process box

      p = Diag*(Gaps+Hamm+1)*sizeof(int);
      if (p > work->vecmax)
        { if (enlarge_vector(work,p))
            EXIT (1);
          F = (int *) work->vector;
        }
      H = F + Diag;

#ifdef BOX_STATS
      { int hgt  = Gaps+Hamm+1;
        int area = Diag*hgt;
        if (area > MaxBxArea)
          MaxBxArea = area;
        if (Diag > MaxBxWidth)
          MaxBxWidth = Diag;
        if (hgt > MaxBxHeight)
          MaxBxHeight = hgt;
        NumBx += 1;
        SumBx += area;
        if (area >= 10000)
          BxHist[100] += 1;
        else
          BxHist[area/100] += 1;
      }
#endif
#ifdef DEBUG_BOX
      printf("Box:  %5d :: %4d x %3d (%2d+%2d)  :: %5d .. %5d  %6d .. %6d\n",
             (Gaps+Hamm+1)*Diag,abs(Fpos-Lpos),Diag,Hamm,Gaps,Fpos,Lpos,Fdag,d);
      fflush(stdout);
#endif

      if (Fpos < 0)
        { Fpos = -Fpos;
          Lpos = -Lpos;

          while (A[Fpos-1] != B[(Fpos-Fdag)-1] && A[Fpos-1] != 4 && B[(Fpos-Fdag)-1] != 4)
            { Fpos -= 1;
#ifdef BOX_STATS
              BxExtend += 1;
#endif
            }
          while (A[Lpos] != B[Lpos-d] && A[Lpos] != 4 && B[Lpos-d] != 4)
            { Lpos += 1;
#ifdef BOX_STATS
              BxExtend += 1;
#endif
            }

          f = F;
          *f++ = p = Fpos + snake(A+Fpos,B+(Fpos-Fdag));
          for (m = Fdag-1; m >= d; m--)
            *f++ = Fpos-1;
          passes = 0;

#ifdef DEBUG_DP
          printf(" %2d:",passes);
          for (m = Fdag; m >= d; m--)
            printf(" %d",F[Fdag-m]);
          printf("\n");
          fflush(stdout);
#endif

          h = H;
          p = Fpos;
          while (p < Lpos)
            { int b, c;

              b = Fpos;
              c = 0;
              f = F;
              for (m = Fdag; m >= d; m--)
                { p = b;
                  if (*f >= b)
                    { b = *f;
                      c = 0;
                      p = b+1;
                    }
                  else
                    c += 1;
                  *h++ = c;
                  *f++ = p += snake(A+p,B+(p-m));
                }
              passes += 1;

#ifdef DEBUG_DP
              printf(" %2d:",passes);
              for (m = Fdag; m >= d; m--)
                printf(" %d(%2d)",F[Fdag-m],h[(d-m)-1]);
              printf("\n");
              fflush(stdout);
#endif
            }

          if (passes < Gaps+Hamm)
            { int y, k;

              p = Lpos;
              m = d;
              y = x;
#ifdef DEBUG_BACK
              printf("Short cut %d\n",(Gaps+Hamm)-passes);
              printf("Path (%d,%d)",p,m);
#endif
#ifdef BOX_STATS
              BxGaps += (Gaps+Hamm)-passes;
#endif
              while (h > H)
                { p -= rsnake(A+p,B+(p-m));
                  if (p < Fpos)
                    p = Fpos;
                  h -= Diag;
                  k = h[Fdag-m];
                  if (k == 0)
                    p -= 1;
                  else
                    { m += k;
                      for (; k > 0; k--)
                        t[--y] = -p;
                    }
#ifdef DEBUG_BACK
                  printf(" (%d,%d)",p,m);
#endif
                }
#ifdef DEBUG_BACK
              printf("\n");
#endif
            }
        }
      else
        { while (B[Fpos-1] != A[(Fpos+Fdag)-1] && B[Fpos-1] != 4 && A[(Fpos+Fdag)-1] != 4)
            { Fpos -= 1;
#ifdef BOX_STATS
              BxExtend += 1;
#endif
            }
          while (B[Lpos] != A[Lpos+d] && B[Lpos] != 4 && A[Lpos+d] != 4)
            { Lpos += 1;
#ifdef BOX_STATS
              BxExtend += 1;
#endif
            }

          f = F;
          *f++ = p = Fpos + snake(A+(Fpos+Fdag),B+Fpos);
          for (m = Fdag+1; m <= d; m++)
            *f++ = Fpos-1;
          passes = 0;

#ifdef DEBUG_DP
          printf(" %2d:",passes);
          for (m = Fdag; m <= d; m++) 
            printf(" %d",F[m-Fdag]);
          printf("\n");
          fflush(stdout);
#endif

          h = H;
          p = Fpos;
          while (p < Lpos)
            { int b, c;

              b = Fpos;
              c = 0;
              f = F;
              for (m = Fdag; m <= d; m++) 
                { p = b;
                  if (*f >= b)
                    { b = *f;
                      c = 0;
                      p = b+1;
                    }
                  else
                    c += 1;
                  *h++ = c; 
                  *f++ = p += snake(A+(m+p),B+p);
                }
              passes += 1;

#ifdef DEBUG_DP
              printf(" %2d:",passes);
              for (m = Fdag; m <= d; m++) 
                printf(" %d(%2d)",F[m-Fdag],h[(m-d)-1]);
              printf("\n");
              fflush(stdout);
#endif
            }

          if (passes < Gaps+Hamm)
            { int y, k;

              p = Lpos;
              m = d;
              y = x;
#ifdef DEBUG_BACK
              printf("Short cut %d\n",(Gaps+Hamm)-passes);
              printf("Path (%d,%d)",p,m);
#endif
#ifdef BOX_STATS
              BxGaps += (Gaps+Hamm)-passes;
#endif
              while (h > H)
                { p -= rsnake(A+(p+m),B+p);
                  if (p < Fpos)
                    p = Fpos;
                  h -= Diag;
                  k = h[m-Fdag];
                  if (k == 0)
                    p -= 1;
                  else
                    { m -= k;
                      for (; k > 0; k--)
                        t[--y] = p;
                    }
#ifdef DEBUG_BACK
                  printf(" (%d,%d)",p,m);
#endif
                }
#ifdef DEBUG_BACK
              printf("\n");
#endif
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq (%rdi), %rax
movq 0x10(%rdi), %rcx
leaq -0x1(%rcx), %rdx
movq %rdx, 0x40(%rsp)
movq 0x18(%rdi), %rdx
leaq -0x1(%rdx), %rdi
movq %rdi, 0x38(%rsp)
movq (%rax), %rdi
movslq 0x8(%rax), %rbx
movq %rsi, 0x88(%rsp)
movq 0x8(%rsi), %rsi
movq %rsi, 0x30(%rsp)
movl 0x10(%rax), %r15d
subl 0x14(%rax), %r15d
movl (%rdi), %r14d
leaq 0x4(%rdi), %rax
movq %rax, 0xa0(%rsp)
movq %rdx, 0x50(%rsp)
leaq -0x2(%rdx), %rax
movq %rax, 0x60(%rsp)
leaq 0x1(%rcx), %rax
movq %rax, 0x90(%rsp)
leaq -0x3(%rcx), %rax
movq %rax, 0x70(%rsp)
addq $-0x4, %rdi
movq %rdi, 0x78(%rsp)
movq %rcx, 0x80(%rsp)
leaq -0x2(%rcx), %rax
movq %rax, 0x98(%rsp)
xorl %edi, %edi
cmpl %ebx, %edi
jge 0x12456
movslq %edi, %rsi
movl $0x1, %ecx
movq %rcx, 0x18(%rsp)
movl $0x0, 0xc(%rsp)
movl %r14d, 0x20(%rsp)
movl %r15d, 0x8(%rsp)
movl %r14d, %r13d
movq %rsi, %rbp
movq 0xa0(%rsp), %rax
leaq (%rax,%rsi,4), %r9
movq %r15, %rcx
leal (%r15,%r13), %eax
leal (%rax,%rsi), %r10d
subl %edi, %r10d
incl %r10d
movq %rdi, %rdx
addl %edi, %eax
movl %ebp, %r11d
notl %r11d
addl %eax, %r11d
xorl %r15d, %r15d
movq %rsi, %r8
movq %r15, %r12
movl %r10d, %eax
movl %r11d, %edi
incq %r8
leaq (%r15,%rbp), %rsi
incq %rsi
cmpq %rbx, %rsi
jge 0x11d44
movl (%r9,%r12,4), %r14d
leaq 0x1(%r12), %r15
leal 0x1(%rax), %r10d
leal -0x1(%rdi), %r11d
cmpl %r13d, %r14d
je 0x11d14
jmp 0x11d47
xorl %r14d, %r14d
subl %edx, %r8d
testl %r13d, %r13d
js 0x11dc9
testl %r14d, %r14d
movq %rcx, %r15
jle 0x11e5e
movl %r14d, %r9d
subl %r13d, %r9d
cmpl $0x31, %r9d
jg 0x11e6c
addl %ebp, %r15d
subl %edx, %r15d
incl %r15d
addq %r12, %r15
testl %r9d, %r9d
jle 0x11e3d
movl %r13d, %edi
addq 0x38(%rsp), %rdi
cltq
addq 0x40(%rsp), %rax
movl %r9d, %r8d
xorl %r9d, %r9d
xorl %ecx, %ecx
movq 0x18(%rsp), %rdx
movb (%rax,%r9), %r10b
cmpb $0x4, %r10b
je 0x11e48
movb (%rdi,%r9), %r11b
cmpb %r11b, %r10b
je 0x11dbf
cmpb $0x4, %r11b
je 0x11e48
incl %ecx
incq %r9
cmpl %r9d, %r8d
jne 0x11d9c
jmp 0x11e48
testl %r14d, %r14d
movq %rcx, %r15
jns 0x11e74
addl %edx, %r15d
movl %r13d, %ecx
subl %r14d, %ecx
cmpl $0x32, %ecx
jge 0x11e79
movl %ebp, %eax
notl %eax
addl %eax, %r15d
subq %r12, %r15
testl %ecx, %ecx
movq 0x18(%rsp), %rdx
jle 0x11e46
movslq %r13d, %r8
movq 0x40(%rsp), %rax
subq %r8, %rax
movslq %edi, %r8
movq 0x38(%rsp), %rdi
subq %r8, %rdi
movl %ecx, %r8d
xorl %r9d, %r9d
xorl %ecx, %ecx
movb (%rax,%r9), %r10b
cmpb $0x4, %r10b
je 0x11e48
movb (%rdi,%r9), %r11b
cmpb %r11b, %r10b
je 0x11e33
cmpb $0x4, %r11b
je 0x11e48
incl %ecx
incq %r9
cmpl %r9d, %r8d
jne 0x11e18
jmp 0x11e48
xorl %ecx, %ecx
movq 0x18(%rsp), %rdx
jmp 0x11e48
xorl %ecx, %ecx
addl %ecx, 0xc(%rsp)
incl %edx
movq %rdx, 0x18(%rsp)
leal (%r12,%rbp), %edi
incl %edi
jmp 0x11cdd
addl %ebp, %r15d
subl %edx, %r15d
addl %r12d, %r15d
incl %r15d
jmp 0x11e86
addl %r15d, %r8d
movl %r8d, %r15d
jmp 0x11e86
subl %r8d, %r15d
jmp 0x11e86
movl %ebp, %eax
notl %eax
addl %r15d, %eax
subl %r12d, %eax
movl %eax, %r15d
movq 0x18(%rsp), %rcx
leal (%r12,%rbp), %edi
incl %edi
cmpl $0x1, %ecx
je 0x11cb6
movl 0x8(%rsp), %eax
subl %r15d, %eax
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
incl %edx
addl 0xc(%rsp), %ecx
movq %rcx, 0x18(%rsp)
leal 0x4(,%rcx,4), %esi
imull %edx, %esi
movq 0x88(%rsp), %rax
cmpl (%rax), %esi
movq %r15, 0x10(%rsp)
jle 0x11ef4
movq 0x88(%rsp), %r15
movq %r15, %rdi
movl %edx, 0xc(%rsp)
callq 0x4252
movl 0xc(%rsp), %edx
movq 0x8(%r15), %rax
movq 0x10(%rsp), %r15
movq %rax, 0x30(%rsp)
leaq (%r12,%rbp), %rax
incq %rax
movq %rax, 0x58(%rsp)
movl %edx, %ecx
movq 0x30(%rsp), %rax
movq %rcx, 0x48(%rsp)
leaq (%rax,%rcx,4), %rax
movq %rax, 0x28(%rsp)
movslq 0x8(%rsp), %r9
movslq %r15d, %r11
movl 0x20(%rsp), %ebp
testl %ebp, %ebp
js 0x1218f
movl %ebp, %r10d
addq %r10, %r9
movq 0x80(%rsp), %r12
leaq (%r12,%r9), %rax
movq 0x60(%rsp), %rdx
addq %r10, %rdx
incl %ebp
xorl %esi, %esi
movb -0x2(%rax,%rsi), %dil
leaq -0x1(%rsi), %r15
decl %ebp
cmpb $0x4, %dil
je 0x11f6a
movb (%rdx,%rsi), %r8b
cmpb $0x4, %r8b
je 0x11f6a
movq %r15, %rsi
cmpb %dil, %r8b
jne 0x11f47
leaq (%r10,%r15), %rcx
incq %rcx
movq %rcx, 0x20(%rsp)
movslq %r13d, %rdx
decq %rdx
addq %r12, %r11
movq 0x50(%rsp), %r13
movb (%r11,%rdx), %sil
leaq 0x1(%rdx), %r8
cmpb $0x4, %sil
je 0x11fa5
movb (%r13,%rdx), %dil
cmpb $0x4, %dil
je 0x11fa5
movq %r8, %rdx
cmpb %sil, %dil
jne 0x11f84
movb (%rax,%r15), %dl
xorl %eax, %eax
cmpb $0x4, %dl
movq 0x30(%rsp), %rdi
movl 0x8(%rsp), %ecx
je 0x11fdf
addq 0x90(%rsp), %r9
addq %r15, %r9
movslq %ebp, %rsi
addq 0x38(%rsp), %rsi
xorl %eax, %eax
cmpb (%rsi,%rax), %dl
jne 0x11fdf
movb (%r9,%rax), %dl
incq %rax
cmpb $0x4, %dl
jne 0x11fce
addl %r10d, %eax
addl %r15d, %eax
incl %eax
movl %eax, (%rdi)
cmpl 0x10(%rsp), %ecx
jge 0x12007
addq %r15, %r10
movq 0x10(%rsp), %rax
subl %ecx, %eax
xorl %edx, %edx
movl %r10d, 0x4(%rdi,%rdx,4)
incq %rdx
cmpl %edx, %eax
jne 0x11ffb
xorl %eax, %eax
movq 0x28(%rsp), %r9
cmpq %r8, 0x20(%rsp)
jge 0x120cc
xorl %eax, %eax
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %rsi
movl %eax, 0xc(%rsp)
movl 0x8(%rsp), %ecx
cmpl 0x10(%rsp), %ecx
jg 0x120bd
xorl %ebp, %ebp
movq 0x20(%rsp), %rax
movq 0x30(%rsp), %r15
movl %ecx, %edx
xorl %ecx, %ecx
movl (%r15), %esi
leal 0x1(%rsi), %r13d
incl %ebp
cmpl %eax, %esi
cmovll %eax, %r13d
cmovgl %esi, %eax
cmovgel %ecx, %ebp
movl %ebp, (%r9)
leal (%r13,%rdx), %esi
movslq %esi, %rsi
movq 0x40(%rsp), %rdi
movb (%rdi,%rsi), %dil
movl $0x0, %esi
cmpb $0x4, %dil
je 0x120a4
movslq %edx, %r10
movslq %r13d, %rsi
movq 0x38(%rsp), %r11
addq %rsi, %r11
addq %r12, %r10
addq %rsi, %r10
xorl %esi, %esi
cmpb (%r11,%rsi), %dil
jne 0x120a4
movb (%r10,%rsi), %dil
incq %rsi
cmpb $0x4, %dil
jne 0x12091
addq $0x4, %r9
addl %r13d, %esi
movl %esi, (%r15)
addq $0x4, %r15
leal 0x1(%rdx), %edi
cmpl 0x10(%rsp), %edx
movl %edi, %edx
jne 0x12047
movl 0xc(%rsp), %eax
incl %eax
cmpl %r8d, %esi
jl 0x12025
cmpl 0x18(%rsp), %eax
movq 0x78(%rsp), %r15
movq 0x60(%rsp), %r13
movq 0x70(%rsp), %rbp
jge 0x12447
cmpq 0x28(%rsp), %r9
jbe 0x12447
negq 0x48(%rsp)
movq 0x58(%rsp), %r10
movq 0x10(%rsp), %r11
leal (%r11,%r8), %eax
cltq
movb -0x2(%r12,%rax), %dl
xorl %eax, %eax
cmpb $0x4, %dl
je 0x12130
movslq %r8d, %rsi
movslq %r11d, %rdi
addq %rbp, %rdi
xorl %eax, %eax
cmpb (%r13,%rsi), %dl
jne 0x12130
incl %eax
movb (%rdi,%rsi), %dl
decq %rsi
cmpb $0x4, %dl
jne 0x1211c
subl %eax, %r8d
movq 0x20(%rsp), %rax
cmpl %eax, %r8d
cmovlel %eax, %r8d
movq 0x48(%rsp), %rax
leaq (%r9,%rax,4), %r9
movl %r11d, %eax
subl 0x8(%rsp), %eax
cltq
movl (%r9,%rax,4), %eax
testl %eax, %eax
je 0x1217c
subl %eax, %r11d
testl %eax, %eax
jle 0x1217f
movslq %r10d, %r10
leaq (%r15,%r10,4), %rdx
subl %eax, %r10d
incl %eax
movl %r8d, (%rdx)
addq $-0x4, %rdx
decl %eax
cmpl $0x1, %eax
jg 0x1216c
jmp 0x1217f
decl %r8d
cmpq 0x28(%rsp), %r9
ja 0x120ff
jmp 0x12447
movl $0x1, %eax
subl %ebp, %eax
negl %ebp
movl %ebp, 0x20(%rsp)
movslq %ebp, %rsi
movq %rsi, %rdx
shlq $0x20, %rdx
movabsq $0x100000000, %rdi      # imm = 0x100000000
addq %rdi, %rdx
movq %rsi, %r15
subq %r9, %r15
addq 0x50(%rsp), %r15
movq 0x98(%rsp), %rdi
addq %rsi, %rdi
xorl %r8d, %r8d
movabsq $-0x100000000, %r10     # imm = 0xFFFFFFFF00000000
addq %r10, %rdx
movb -0x2(%r15,%r8), %bpl
leaq -0x1(%r8), %r10
decl %eax
cmpb $0x4, %bpl
je 0x121fc
movb (%rdi,%r8), %r12b
cmpb $0x4, %r12b
je 0x121fc
movq %r10, %r8
cmpb %bpl, %r12b
jne 0x121cc
negl %r13d
movl %esi, %ebp
leaq (%r10,%rbp), %rdi
incq %rdi
movq %rdi, 0x68(%rsp)
movslq %r13d, %rdi
leaq (%rsi,%r10), %r13
incq %r13
decq %rdi
movq 0x50(%rsp), %rsi
subq %r11, %rsi
movq 0x80(%rsp), %r12
movb (%rsi,%rdi), %r8b
leaq 0x1(%rdi), %rcx
cmpb $0x4, %r8b
je 0x1224a
movb (%r12,%rdi), %r11b
cmpb $0x4, %r11b
je 0x1224a
movq %rcx, %rdi
cmpb %r8b, %r11b
jne 0x1222a
sarq $0x20, %rdx
movq 0x40(%rsp), %rsi
movb (%rsi,%rdx), %sil
xorl %edx, %edx
cmpb $0x4, %sil
je 0x1227c
cltq
addq %r12, %rax
addq %r10, %r15
xorl %edx, %edx
cmpb (%r15,%rdx), %sil
jne 0x1227c
movb (%rax,%rdx), %sil
incq %rdx
cmpb $0x4, %sil
jne 0x12269
addl 0x20(%rsp), %edx
leal (%r10,%rdx), %eax
incl %eax
movq 0x30(%rsp), %rdx
movl %eax, (%rdx)
movq 0x10(%rsp), %rsi
cmpl %esi, 0x8(%rsp)
jle 0x122b4
addq %r10, %rbp
movq 0x30(%rsp), %rax
addq $0x4, %rax
movl 0x8(%rsp), %edx
decl %edx
movl %ebp, (%rax)
addq $0x4, %rax
cmpl %esi, %edx
jg 0x122a8
xorl %eax, %eax
movq 0x28(%rsp), %r10
movq %rcx, %rbp
cmpq %rcx, %r13
jge 0x12387
movq 0x38(%rsp), %rax
subq %r9, %rax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
movq 0x28(%rsp), %r10
movq 0x68(%rsp), %rdi
movl %eax, 0xc(%rsp)
movl 0x8(%rsp), %eax
cmpl 0x10(%rsp), %eax
jl 0x12376
movq 0x20(%rsp), %r9
xorl %ebp, %ebp
movq 0x68(%rsp), %rdx
movl %edx, %r13d
movq 0x30(%rsp), %rdx
movl %eax, %r15d
movl (%rdx), %eax
leal 0x1(%rax), %esi
incl %ebp
cmpl %r13d, %eax
cmovll %r13d, %esi
cmovgl %eax, %r13d
movl $0x0, %eax
cmovgel %eax, %ebp
movl %ebp, (%r10)
movslq %esi, %r11
movq 0x40(%rsp), %rax
movb (%rax,%r11), %r8b
movl $0x0, %edi
cmpb $0x4, %r8b
je 0x12359
leaq (%r12,%r11), %rax
addq %r9, %r11
xorl %edi, %edi
cmpb (%r11,%rdi), %r8b
jne 0x12359
movb (%rax,%rdi), %r8b
incq %rdi
cmpb $0x4, %r8b
jne 0x12346
addq $0x4, %r10
addl %esi, %edi
movl %edi, (%rdx)
addq $0x4, %rdx
leal -0x1(%r15), %eax
incq %r9
cmpl 0x10(%rsp), %r15d
movl %eax, %r15d
jg 0x12309
movl 0xc(%rsp), %eax
incl %eax
movq %rcx, %rbp
cmpl %ebp, %edi
jl 0x122e0
cmpl 0x18(%rsp), %eax
movq 0x78(%rsp), %r8
movq 0x60(%rsp), %r15
movq 0x70(%rsp), %r13
movq 0x68(%rsp), %rcx
jge 0x12447
cmpq 0x28(%rsp), %r10
jbe 0x12447
negq 0x48(%rsp)
movq 0x58(%rsp), %r9
movq 0x10(%rsp), %rax
movl %eax, %r11d
movslq %ebp, %rax
movb -0x2(%r12,%rax), %sil
xorl %edx, %edx
cmpb $0x4, %sil
je 0x123f3
movslq %r11d, %rdx
movq %r15, %rdi
subq %rdx, %rdi
xorl %edx, %edx
cmpb (%rdi,%rax), %sil
jne 0x123f3
incl %edx
movb (%r13,%rax), %sil
decq %rax
cmpb $0x4, %sil
jne 0x123dd
subl %edx, %ebp
cmpl %ecx, %ebp
cmovlel %ecx, %ebp
movq 0x48(%rsp), %rax
leaq (%r10,%rax,4), %r10
movl 0x8(%rsp), %eax
subl %r11d, %eax
cltq
movl (%r10,%rax,4), %eax
testl %eax, %eax
je 0x1243a
addl %eax, %r11d
testl %eax, %eax
jle 0x1243c
movl %ebp, %edx
negl %edx
movslq %r9d, %r9
leaq (%r8,%r9,4), %rsi
subl %eax, %r9d
incl %eax
movl %edx, (%rsi)
addq $-0x4, %rsi
decl %eax
cmpl $0x1, %eax
jg 0x1242b
jmp 0x1243c
decl %ebp
cmpq 0x28(%rsp), %r10
ja 0x123c2
movq 0x10(%rsp), %r15
movq 0x58(%rsp), %rdi
jmp 0x11cb6
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq