// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/alignment.c
// Function: gt_alignment_show_generic
void gt_alignment_show_generic(GtUchar *buffer,
                               bool downcase,
                               const GtAlignment *alignment,
                               FILE *fp,
                               unsigned int width,
                               const GtUchar *characters,
                               GtUchar wildcardshow)
{
  GtMultieop meop;
  GtUword idx_eop, idx_u = 0, idx_v = 0, meoplen;
  unsigned int pos = 0;
  GtUchar *topbuf = buffer, *midbuf = NULL, *lowbuf = NULL;

  gt_assert(alignment != NULL && (characters == NULL || !downcase));
  topbuf[width] = '\n';
  midbuf = topbuf + width + 1;
  midbuf[width] = '\n';
  lowbuf = midbuf + width + 1;
  lowbuf[width] = '\n';
  meoplen = gt_multieoplist_get_num_entries(alignment->eops);
  gt_assert(meoplen > 0);
  idx_eop = meoplen - 1;
  while (true)
  {
    meop = gt_multieoplist_get_entry(alignment->eops, idx_eop);
    switch (meop.type)
    {
      GtUword j;

      case Mismatch:
      case Match:
      case Replacement:
        for (j = 0; j < meop.steps && idx_u < alignment->ulen &&
                                      idx_v < alignment->vlen; j++)
        {
          GtUchar a = alignment->u[idx_u];
          GtUchar b = alignment->v[idx_v];
          bool is_match;

          if (characters != NULL)
          {
            topbuf[pos] = GT_ISSPECIAL(a) ? wildcardshow : characters[a];
            is_match = (a == b && !GT_ISSPECIAL(a)) ? true : false;
            lowbuf[pos] = GT_ISSPECIAL(b) ? wildcardshow : characters[b];
          } else
          {
            topbuf[pos] = a;
            is_match = ((downcase && tolower((int) a) == tolower((int) b)) ||
                        (!downcase && a == b)) ? true : false;
            lowbuf[pos] = b;
          }
          if (is_match)
          {
            midbuf[pos] = (GtUchar) MATCHSYMBOL;
          } else
          {
            midbuf[pos] = (GtUchar) MISMATCHSYMBOL;
          }
          pos = gt_alignment_show_advance(pos,width,topbuf,fp);
          idx_u++;
          idx_v++;
        }
        break;
      case Deletion:
        for (j = 0; j < meop.steps && idx_u < alignment->ulen; j++)
        {
          GtUchar a = alignment->u[idx_u++];

          if (characters != NULL)
          {
            topbuf[pos] = GT_ISSPECIAL(a) ? wildcardshow : characters[a];
          } else
          {
            topbuf[pos] = a;
          }
          midbuf[pos] = (GtUchar) MISMATCHSYMBOL;
          lowbuf[pos] = (GtUchar) GAPSYMBOL;
          pos = gt_alignment_show_advance(pos,width,topbuf,fp);
        }
        break;
      case Insertion:
        for (j = 0; j < meop.steps && idx_v < alignment->vlen; j++)
        {
          GtUchar b = alignment->v[idx_v++];

          topbuf[pos] = (GtUchar) GAPSYMBOL;
          midbuf[pos] = (GtUchar) MISMATCHSYMBOL;
          if (characters != NULL)
          {
            lowbuf[pos] = GT_ISSPECIAL(b) ? wildcardshow : characters[b];
          } else
          {
            lowbuf[pos] = b;
          }
          pos = gt_alignment_show_advance(pos,width,topbuf,fp);
        }
        break;
    }
    if (idx_eop > 0 && (idx_u < alignment->ulen || idx_v < alignment->vlen))
    {
      idx_eop--;
    } else
    {
      break;
    }
  }
  if (pos > 0)
  {
    topbuf[pos] = '\n';
    fwrite(topbuf,sizeof *topbuf,pos+1,fp);
    midbuf[pos] = '\n';
    fwrite(midbuf,sizeof *midbuf,pos+1,fp);
    lowbuf[pos] = '\n';
    fwrite(lowbuf,sizeof *lowbuf,pos+1,fp);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
testq %rdx, %rdx
je 0xb5f54
movq %rcx, %r12
testq %r9, %r9
sete %al
movl %esi, %ecx
xorb $0x1, %cl
orb %al, %cl
je 0xb5f54
movq %rdx, %r15
movq %rdi, %rbp
movl %esi, 0x4c(%rsp)
movq %r9, 0x40(%rsp)
movb 0xa0(%rsp), %al
movb %al, 0xf(%rsp)
movl %r8d, 0x34(%rsp)
movl %r8d, %ebx
leaq (%rdi,%rbx), %r14
movb $0xa, %al
movb %al, (%rdi,%rbx)
leaq 0x1(%rbx,%r14), %rcx
movb %al, 0x1(%rbx,%r14)
movb %al, 0x1(%rbx,%rcx)
movq 0x30(%rdx), %rdi
callq 0x101b46
testq %rax, %rax
je 0xb5f82
movq %rax, %rsi
leaq (%rbx,%rbp), %rax
incq %rax
movq %rax, 0x38(%rsp)
leaq (%rbx,%r14), %rax
addq $0x2, %rax
movq %rax, 0x18(%rsp)
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %ebx, %ebx
movl 0x34(%rsp), %r14d
movq %r15, 0x60(%rsp)
movq %r9, 0x28(%rsp)
movq %rbx, 0x10(%rsp)
movq %r8, %rbx
decq %rsi
movq 0x30(%r15), %rdi
movq %rsi, 0x58(%rsp)
callq 0x101b4b
movq %rdx, %r13
cmpl $0x3, %eax
jae 0xb5d97
movq %r13, %rax
movq 0x28(%rsp), %r9
addq %r9, %rax
movq %rax, 0x50(%rsp)
movq %rbx, %r8
movq 0x10(%rsp), %rbx
subq $0x1, %r13
jb 0xb5e2a
cmpq 0x38(%r15), %rbx
movq 0x40(%rsp), %rsi
jae 0xb5ec2
cmpq 0x40(%r15), %r9
jae 0xb5ec2
movq %r15, %rcx
movq %rbp, %r15
movq %r12, %r14
movq 0x20(%rcx), %rax
movq 0x28(%rcx), %rcx
movq %rbx, 0x10(%rsp)
movb (%rax,%rbx), %al
movzbl %al, %edi
movb (%rcx,%r9), %r12b
movzbl %r12b, %ebx
movl %r8d, %ebp
testq %rsi, %rsi
movq %r9, 0x28(%rsp)
je 0xb5d45
movb 0xf(%rsp), %cl
cmpb $-0x3, %al
ja 0xb5cd8
movb (%rsi,%rdi), %cl
cmpb $-0x2, %al
setb %dl
movb %cl, (%r15,%rbp)
cmpb %r12b, %al
sete %al
movb 0xf(%rsp), %cl
cmpb $-0x3, %r12b
ja 0xb5cf4
movb (%rsi,%rbx), %cl
movq 0x18(%rsp), %rsi
movb %cl, (%rsi,%rbp)
movb $0x7c, %cl
andb %al, %dl
movq %r14, %r12
jne 0xb5d07
movb $0x20, %cl
movq 0x38(%rsp), %rax
movb %cl, (%rax,%rbp)
movl %r8d, %edi
movl 0x34(%rsp), %r14d
movl %r14d, %esi
movq %r15, %rbp
movq %r15, %rdx
movq %r12, %rcx
callq 0xb5fba
movl %eax, %r8d
movq 0x10(%rsp), %rbx
incq %rbx
movq 0x28(%rsp), %r9
incq %r9
movq 0x60(%rsp), %r15
jmp 0xb5c79
movb %al, (%r15,%rbp)
cmpb $0x0, 0x4c(%rsp)
je 0xb5d7b
movq %r8, 0x20(%rsp)
callq 0x17a80
movl %eax, 0x48(%rsp)
movl %ebx, %edi
callq 0x17a80
movq 0x20(%rsp), %r8
movq 0x18(%rsp), %rcx
movb %r12b, (%rcx,%rbp)
movb $0x7c, %cl
cmpl %eax, 0x48(%rsp)
jmp 0xb5d89
movq 0x18(%rsp), %rcx
movb %r12b, (%rcx,%rbp)
movb $0x7c, %cl
cmpb %r12b, %al
movq %r14, %r12
jne 0xb5d05
jmp 0xb5d07
movq 0x28(%rsp), %r9
je 0xb5e34
cmpl $0x4, %eax
movq %rbx, %r8
jne 0xb5ebd
movq %r13, %rax
addq %r9, %rax
movq %rax, 0x20(%rsp)
subq $0x1, %r13
jb 0xb5eb8
cmpq 0x40(%r15), %r9
movq 0x40(%rsp), %rsi
jae 0xb5ebd
movq 0x28(%r15), %rax
movb (%rax,%r9), %cl
movl %r8d, %eax
movb $0x2d, (%rbp,%rax)
movq 0x38(%rsp), %rdx
movb $0x20, (%rdx,%rax)
movq %r9, %rbx
testq %rsi, %rsi
je 0xb5e04
movb 0xf(%rsp), %dl
cmpb $-0x3, %cl
ja 0xb5e06
movzbl %cl, %ecx
movb (%rsi,%rcx), %dl
jmp 0xb5e06
movl %ecx, %edx
movq 0x18(%rsp), %rcx
movb %dl, (%rcx,%rax)
movl %r8d, %edi
movl %r14d, %esi
movq %rbp, %rdx
movq %r12, %rcx
callq 0xb5fba
movl %eax, %r8d
movq %rbx, %r9
incq %r9
jmp 0xb5db9
movq 0x50(%rsp), %r9
jmp 0xb5ec2
movq %r13, %rcx
movq 0x10(%rsp), %rax
addq %rax, %rcx
movq %rcx, 0x20(%rsp)
movq %rbx, %r8
movq %rax, %rbx
subq $0x1, %r13
jb 0xb5eb1
cmpq 0x38(%r15), %rbx
movq 0x40(%rsp), %rdx
jae 0xb5ec2
movq 0x20(%r15), %rax
movb (%rax,%rbx), %cl
testq %rdx, %rdx
je 0xb5e78
movb 0xf(%rsp), %al
cmpb $-0x3, %cl
ja 0xb5e7a
movzbl %cl, %eax
movb (%rdx,%rax), %al
jmp 0xb5e7a
movl %ecx, %eax
movl %r8d, %ecx
movb %al, (%rbp,%rcx)
movq 0x38(%rsp), %rax
movb $0x20, (%rax,%rcx)
movq 0x18(%rsp), %rax
movb $0x2d, (%rax,%rcx)
movl %r8d, %edi
movl %r14d, %esi
movq %rbp, %rdx
movq %r12, %rcx
callq 0xb5fba
movl %eax, %r8d
incq %rbx
movq 0x28(%rsp), %r9
jmp 0xb5e4a
movq 0x20(%rsp), %rbx
jmp 0xb5ec2
movq 0x20(%rsp), %r9
movq 0x10(%rsp), %rbx
movq 0x58(%rsp), %rsi
testq %rsi, %rsi
je 0xb5ee0
cmpq 0x38(%r15), %rbx
jb 0xb5c37
cmpq 0x40(%r15), %r9
jb 0xb5c37
testl %r8d, %r8d
je 0xb5f45
movl %r8d, %r14d
movq %rbp, %rdi
movb $0xa, %bpl
movb %bpl, (%rdi,%r14)
incl %r8d
pushq $0x1
popq %rbx
movq %rbx, %rsi
movq %r8, %rdx
movq %r12, %rcx
movq %r8, %r15
callq 0x17f00
movq 0x38(%rsp), %rdi
movb %bpl, (%rdi,%r14)
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x17f00
movq 0x18(%rsp), %rdi
movb %bpl, (%rdi,%r14)
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17f00
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x38200d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x22f0ae(%rip), %rsi    # 0x2e5013
leaq 0x25f246(%rip), %rdx    # 0x3151b2
leaq 0x25f276(%rip), %rcx    # 0x3151e9
leaq 0x25ef96(%rip), %r8     # 0x314f10
movl $0x21d, %r9d            # imm = 0x21D
jmp 0xb5fae
movq 0x381fdf(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x22f080(%rip), %rsi    # 0x2e5013
leaq 0x25f269(%rip), %rdx    # 0x315203
leaq 0x25f248(%rip), %rcx    # 0x3151e9
leaq 0x25ef68(%rip), %r8     # 0x314f10
movl $0x224, %r9d            # imm = 0x224
xorl %eax, %eax
callq 0x17a50
callq 0x17390