// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/squarededist.c
// Function: gt_squarededistunit2
static GtUword gt_squarededistunit2 (const GtUchar *u, GtUword m,
                                        const GtUchar *v, GtUword n)
{
  GtUword val, we, nw, *ecol, *ecolptr;
  const GtUchar *uptr, *vptr;

  ecol = gt_malloc(sizeof *ecol * (m+1));
  for (*ecol = 0, ecolptr = ecol+1, uptr = u; uptr < u + m; ecolptr++, uptr++)
  {
    *ecolptr = *(ecolptr-1) + 1;
  }
  for (vptr = v; vptr < v + n; vptr++)
  {
    nw = *ecol;
    *ecol = nw + 1;
    for (ecolptr = ecol+1, uptr = u; uptr < u + m; ecolptr++, uptr++)
    {
      we = *ecolptr;
      *ecolptr = *(ecolptr-1) + 1;
      if (*uptr == *vptr)
      {
        val = nw;
      } else
      {
        val = nw + 1;
      }
      if (val < *ecolptr)
      {
        *ecolptr = val;
      }
      if ((val = we + 1) < *ecolptr)
      {
        *ecolptr = val;
      }
      nw = we;
    }
  }
  val = *(ecolptr-1);
  gt_free(ecol);
  return val;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq 0x48(%rsp), %rdi
addq $0x1, %rdi
shlq $0x3, %rdi
leaq 0xd3aec(%rip), %rsi     # 0x5bb5b8
movl $0x1c, %edx
callq 0xe80f0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq $0x0, (%rax)
movq 0x18(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x50(%rsp), %rcx
addq 0x48(%rsp), %rcx
cmpq %rcx, %rax
jae 0x4e7b46
movq 0x10(%rsp), %rax
movq -0x8(%rax), %rcx
addq $0x1, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x4e7aff
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x40(%rsp), %rcx
addq 0x38(%rsp), %rcx
cmpq %rcx, %rax
jae 0x4e7c82
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
addq $0x1, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x50(%rsp), %rcx
addq 0x48(%rsp), %rcx
cmpq %rcx, %rax
jae 0x4e7c6f
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x10(%rsp), %rax
movq -0x8(%rax), %rcx
addq $0x1, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movzbl (%rax), %eax
movq (%rsp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x4e7bf5
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x4e7c03
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x4e7c1f
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x10(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x4e7c44
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x4e7b9c
jmp 0x4e7c71
movq (%rsp), %rax
addq $0x1, %rax
movq %rax, (%rsp)
jmp 0x4e7b4f
movq 0x10(%rsp), %rax
movq -0x8(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x18(%rsp), %rdi
leaq 0xd391c(%rip), %rsi     # 0x5bb5b8
movl $0x3c, %edx
callq 0xe88c0
movq 0x30(%rsp), %rax
addq $0x58, %rsp
retq