// File: /workspace/github_c_makefile_star2_O2/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 0xb3b26
cmpl $0x5, %r9d
je 0xb3af2
cmpl $0x4, %r9d
jne 0xb3b95
movq 0x28(%rbx), %rdx
testq %rdx, %rdx
je 0xb3b8c
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbdb07
testb %r12b, %r12b
je 0xb3aeb
leaq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0xbdb07
movl $0xff, %ecx
jmp 0xb3b54
movq 0x28(%rbx), %rdx
testq %rdx, %rdx
je 0xb3b8c
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbdbfc
testb %r12b, %r12b
je 0xb3b1f
leaq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0xbdbfc
movl $0xffff, %ecx           # imm = 0xFFFF
jmp 0xb3b54
movq 0x28(%rbx), %rdx
testq %rdx, %rdx
je 0xb3b8c
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbdedb
testb %r12b, %r12b
je 0xb3b4f
leaq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0xbdedb
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r15, %rax
xorl %edx, %edx
divq %rcx
leaq 0x1(%rax), %rdx
leaq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xbdcf1
testb %bpl, %bpl
je 0xb3b8c
movq 0x28(%rbx), %rdx
addq $0x18, %rbx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xbdcf1
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x7a41c(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3b46c(%rip), %rsi     # 0xef012
movl %r9d, %edx
xorl %eax, %eax
callq 0xb8c0
pushq $0x2
popq %rdi
callq 0xb7b0