// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
andb $0x1, %cl
movb %cl, 0x27(%rsp)
andb $0x1, %al
movb %al, 0x26(%rsp)
movq %r8, 0x18(%rsp)
movl %r9d, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x4(%rsp)
subl $0x4, %eax
je 0x12dbb9
jmp 0x12db98
movl 0x4(%rsp), %eax
subl $0x5, %eax
je 0x12dc5e
jmp 0x12dba7
movl 0x4(%rsp), %eax
subl $0x6, %eax
je 0x12dd03
jmp 0x12dda5
movq 0x28(%rsp), %rax
cmpq $0x0, 0x28(%rax)
jbe 0x12dc59
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x1465c0
testb $0x1, 0x27(%rsp)
je 0x12dc04
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x8, %rsi
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x1465c0
movq 0x18(%rsp), %rax
movl $0xff, %ecx
xorl %edx, %edx
divq %rcx
addq $0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x10, %rsi
movq 0x8(%rsp), %rdx
callq 0x146940
testb $0x1, 0x26(%rsp)
je 0x12dc57
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x18, %rsi
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x146940
jmp 0x12dc59
jmp 0x12ddcb
movq 0x28(%rsp), %rax
cmpq $0x0, 0x28(%rax)
jbe 0x12dcfe
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x146780
testb $0x1, 0x27(%rsp)
je 0x12dca9
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x8, %rsi
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x146780
movq 0x18(%rsp), %rax
movl $0xffff, %ecx           # imm = 0xFFFF
xorl %edx, %edx
divq %rcx
addq $0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x10, %rsi
movq 0x8(%rsp), %rdx
callq 0x146940
testb $0x1, 0x26(%rsp)
je 0x12dcfc
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x18, %rsi
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x146940
jmp 0x12dcfe
jmp 0x12ddcb
movq 0x28(%rsp), %rax
cmpq $0x0, 0x28(%rax)
jbe 0x12dda3
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x146cc0
testb $0x1, 0x27(%rsp)
je 0x12dd4e
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x8, %rsi
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x146cc0
movq 0x18(%rsp), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %edx, %edx
divq %rcx
addq $0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x10, %rsi
movq 0x8(%rsp), %rdx
callq 0x146940
testb $0x1, 0x26(%rsp)
je 0x12dda1
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x18, %rsi
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x146940
jmp 0x12dda3
jmp 0x12ddcb
movq 0x8622c(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
movl 0x14(%rsp), %edx
leaq 0x5adad(%rip), %rsi     # 0x188b67
movb $0x0, %al
callq 0xb890
movl $0x2, %edi
callq 0xb780
addq $0x38, %rsp
retq