// File: /workspace/github_c_makefile_star2_O3/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 0xcebc6
cmpl $0x5, %r9d
je 0xceb83
cmpl $0x4, %r9d
jne 0xcec3b
movq 0x28(%rbx), %rdx
testq %rdx, %rdx
je 0xcec32
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd6a2a
testb %r12b, %r12b
je 0xceb6a
leaq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0xd6a2a
movabsq $-0x7f7f7f7f7f7f7f7f, %rcx # imm = 0x8080808080808081
movq %r15, %rax
mulq %rcx
shrq $0x7, %rdx
jmp 0xcec03
movq 0x28(%rbx), %rdx
testq %rdx, %rdx
je 0xcec32
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd6acf
testb %r12b, %r12b
je 0xcebb0
leaq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0xd6acf
movabsq $-0x7fff7fff7fff7fff, %rcx # imm = 0x8000800080008001
movq %r15, %rax
mulq %rcx
shrq $0xf, %rdx
jmp 0xcec03
movq 0x28(%rbx), %rdx
testq %rdx, %rdx
je 0xcec32
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd6cbe
testb %r12b, %r12b
je 0xcebef
leaq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0xd6cbe
movabsq $-0x7fffffff7fffffff, %rcx # imm = 0x8000000080000001
movq %r15, %rax
mulq %rcx
shrq $0x1f, %rdx
incq %rdx
leaq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xd6b74
testb %bpl, %bpl
je 0xcec32
movq 0x28(%rbx), %rdx
addq $0x18, %rbx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xd6b74
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %r9d, %edi
callq 0x2e4ff