// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/core/encseq.c
// Function: addswtabletomapspectable
static void addswtabletomapspectable(GtMapspec *mapspec,
                                     GtSWtable *swtable,
                                     bool withrangelengths,
                                     bool withmappositions,
                                     GtUword totallength,
                                     GtEncseqAccessType sat)
{
  GtUword numofunits;

  switch (sat) {
    case GT_ACCESS_TYPE_UCHARTABLES:
      if (swtable->st_uchar.numofpositionstostore > 0) {
        gt_mapspec_add_uchar(mapspec,
                             swtable->st_uchar.positions,
                             swtable->st_uchar.numofpositionstostore);
        if (withrangelengths) {
          gt_mapspec_add_uchar(mapspec,
                               swtable->st_uchar.rangelengths,
                               swtable->st_uchar.numofpositionstostore);
        }
        numofunits = totallength/UCHAR_MAX+1;
        gt_mapspec_add_ulong(mapspec, swtable->st_uchar.endidxinpage,
                             numofunits);
        if (withmappositions) {
          gt_mapspec_add_ulong(mapspec, swtable->st_uchar.mappositions,
                               swtable->st_uchar.numofpositionstostore);
        }
      }
      break;
    case GT_ACCESS_TYPE_USHORTTABLES:
      if (swtable->st_uint16.numofpositionstostore > 0) {
        gt_mapspec_add_uint16(mapspec,
                              swtable->st_uint16.positions,
                              swtable->st_uint16.numofpositionstostore);
        if (withrangelengths) {
          gt_mapspec_add_uint16(mapspec,
                                swtable->st_uint16.rangelengths,
                                swtable->st_uint16.numofpositionstostore);
        }
        numofunits = totallength/USHRT_MAX+1;
        gt_mapspec_add_ulong(mapspec, swtable->st_uint16.endidxinpage,
                             numofunits);
        if (withmappositions) {
          gt_mapspec_add_ulong(mapspec, swtable->st_uint16.mappositions,
                               swtable->st_uchar.numofpositionstostore);
        }
      }
      break;
    case GT_ACCESS_TYPE_UINT32TABLES:
      if (swtable->st_uint32.numofpositionstostore > 0) {
        gt_mapspec_add_uint32(mapspec, swtable->st_uint32.positions,
                              swtable->st_uint32.numofpositionstostore);
        if (withrangelengths) {
          gt_mapspec_add_uint32(mapspec, swtable->st_uint32.rangelengths,
                                swtable->st_uint32.numofpositionstostore);
        }
        numofunits = totallength/UINT32_MAX+1;
        gt_mapspec_add_ulong(mapspec, swtable->st_uint32.endidxinpage,
                             numofunits);
        if (withmappositions) {
          gt_mapspec_add_ulong(mapspec, swtable->st_uint32.mappositions,
                               swtable->st_uchar.numofpositionstostore);
        }
      }
      break;
    default:
      fprintf(stderr, "addswtabletomapspectable(%d) undefined\n", (int) sat);
      exit(GT_EXIT_PROGRAMMING_ERROR);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %r15
movl %ecx, %ebp
movl %edx, %r12d
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x6, %r9d
je 0xcdc9d
cmpl $0x5, %r9d
je 0xcdc5a
cmpl $0x4, %r9d
jne 0xcdd12
movq 0x28(%rbx), %rdx
testq %rdx, %rdx
je 0xcdd09
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd634b
testb %r12b, %r12b
je 0xcdc41
leaq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0xd634b
movabsq $-0x7f7f7f7f7f7f7f7f, %rcx # imm = 0x8080808080808081
movq %r15, %rax
mulq %rcx
shrq $0x7, %rdx
jmp 0xcdcda
movq 0x28(%rbx), %rdx
testq %rdx, %rdx
je 0xcdd09
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd63ea
testb %r12b, %r12b
je 0xcdc87
leaq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0xd63ea
movabsq $-0x7fff7fff7fff7fff, %rcx # imm = 0x8000800080008001
movq %r15, %rax
mulq %rcx
shrq $0xf, %rdx
jmp 0xcdcda
movq 0x28(%rbx), %rdx
testq %rdx, %rdx
je 0xcdd09
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd65c7
testb %r12b, %r12b
je 0xcdcc6
leaq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0xd65c7
movabsq $-0x7fffffff7fffffff, %rcx # imm = 0x8000000080000001
movq %r15, %rax
mulq %rcx
shrq $0x1f, %rdx
incq %rdx
leaq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xd6489
testb %bpl, %bpl
je 0xcdd09
movq 0x28(%rbx), %rdx
addq $0x18, %rbx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xd6489
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %r9d, %edi
callq 0x2e9a6