// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/region_mapping.c
// Function: update_seq_col_if_necessary
static int update_seq_col_if_necessary(GtRegionMapping *rm, GtStr *seqid,
                                       GtError *err)
{
  int had_err = 0;
  gt_error_check(err);
  gt_assert(rm && seqid);
  /* for mappings, we need to load the changed sequence, if needed... */
  if (rm->mapping) {
    if (!rm->sequence_file || (gt_str_cmp(rm->sequence_name, seqid))) {
      gt_str_delete(rm->sequence_file);
      /* ignore MD5 hashes when using region mappings */
      if (gt_md5_seqid_has_prefix(gt_str_get(seqid))) {
        rm->sequence_file = region_mapping_map(rm,
                                               gt_str_get(seqid)
                                                 +GT_MD5_SEQID_TOTAL_LEN,
                                               err);
      } else
        rm->sequence_file = region_mapping_map(rm, gt_str_get(seqid), err);
      if (!rm->sequence_file)
        had_err = -1;
      else {
        /* load new seqcol */
        if (!rm->sequence_filenames)
          rm->sequence_filenames = gt_str_array_new();
        else
          gt_str_array_reset(rm->sequence_filenames);
        gt_str_array_add(rm->sequence_filenames, rm->sequence_file);
        if (!rm->sequence_name)
          rm->sequence_name = gt_str_new();
        else
          gt_str_reset(rm->sequence_name);
        gt_str_append_str(rm->sequence_name, seqid);
        gt_seq_col_delete(rm->seq_col);
        rm->seq_col = gt_bioseq_col_new(rm->sequence_filenames, err);
        if (!rm->seq_col)
          had_err = -1;
      }
    }
  } else {
    /* ...otherwise, just make sure the seqcol is loaded */
    if (!rm->seq_col) {
      if (rm->encseq) {
        if (!(rm->seq_col = gt_encseq_col_new(rm->encseq, err)))
          had_err = -1;
      } else {
        gt_assert(rm->sequence_filenames);
        if (!(rm->seq_col = gt_bioseq_col_new(rm->sequence_filenames, err)))
          had_err = -1;
      }
      /* handle -matchdescstart, i.e. load seqids into cache */
      if (!had_err && rm->seq_col && rm->matchdescstart)
          gt_seq_col_enable_match_desc_start(rm->seq_col);
    }
    if (!had_err && rm->usedesc) {
      if (rm->seqid2seqnum_mapping)
        gt_seqid2seqnum_mapping_delete(rm->seqid2seqnum_mapping);
      rm->seqid2seqnum_mapping =
                           gt_seqid2seqnum_mapping_new_seqcol(rm->seq_col, err);
      if (!rm->seqid2seqnum_mapping) {
        had_err = -1;
      }
    }

  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
testq %rdx, %rdx
je 0x8979e
movq %r14, %rdi
callq 0xc103
testb %al, %al
jne 0x89906
cmpq $0x0, 0x20(%rbx)
je 0x8981f
xorl %r12d, %r12d
cmpq $0x0, 0x8(%rbx)
je 0x897c7
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x14573
testl %eax, %eax
je 0x898fa
movq 0x8(%rbx), %r12
movq %r12, %rdi
callq 0x152db
movq %r15, %rdi
callq 0x143d2
movq %rax, %rdi
callq 0x59a50
movl %eax, %ebp
movq %r15, %rdi
callq 0x143d2
testb %bpl, %bpl
je 0x897f2
addq $0x25, %rax
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x8a457
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x898f6
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x89866
callq 0x157b1
movq (%rbx), %rdi
jmp 0x89871
cmpq $0x0, 0x38(%rbx)
je 0x89853
xorl %r12d, %r12d
cmpb $0x1, 0x19(%rbx)
jne 0x898fa
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x89841
callq 0x8aa95
movq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0x8aad9
movq %rax, 0x40(%rbx)
jmp 0x898ba
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x898c6
movq %r14, %rsi
callq 0xbab07
jmp 0x898d6
callq 0x1532c
movq %rax, %rdi
movq %rax, (%rbx)
movq 0x8(%rbx), %rsi
callq 0x154f5
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x8988e
callq 0x1452f
movq 0x10(%rbx), %rdi
jmp 0x8989a
callq 0x13d5c
movq %rax, %rdi
movq %rax, 0x10(%rbx)
movq %r15, %rsi
callq 0x13eeb
movq 0x38(%rbx), %rdi
callq 0xbfa80
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x9f2e7
movq %rax, 0x38(%rbx)
xorl %r12d, %r12d
cmpq $0x1, %rax
sbbl %r12d, %r12d
jmp 0x898fa
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x8993e
movq %r14, %rsi
callq 0x9f2e7
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x898f6
cmpb $0x1, 0x1a(%rbx)
jne 0x89826
movq %rax, %rdi
callq 0xbfb34
jmp 0x89826
pushq $-0x1
popq %r12
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xa46ab(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x4074f(%rip), %rsi     # 0xca066
leaq 0x40d3b(%rip), %rdx     # 0xca659
leaq 0x5b7f6(%rip), %rcx     # 0xe511b
leaq 0x5b282(%rip), %r8      # 0xe4bae
movl $0x99, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
movq 0xa4673(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x40717(%rip), %rsi     # 0xca066
leaq 0x5b7e1(%rip), %rdx     # 0xe5137
leaq 0x5b7be(%rip), %rcx     # 0xe511b
leaq 0x5b24a(%rip), %r8      # 0xe4bae
movl $0xc2, %r9d
jmp 0x89932