// File: /workspace/github_c_makefile_star2_O3/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 0xa856d
movq %r14, %rdi
callq 0x34fea
testb %al, %al
jne 0xa86d7
cmpq $0x0, 0x20(%rbx)
je 0xa85ee
xorl %r12d, %r12d
cmpq $0x0, 0x8(%rbx)
je 0xa8596
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x3bc02
testl %eax, %eax
je 0xa86cb
movq 0x8(%rbx), %r12
movq %r12, %rdi
callq 0x3c87b
movq %r15, %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0x7aa64
movl %eax, %ebp
movq %r15, %rdi
callq 0x3bb5d
testb %bpl, %bpl
je 0xa85c1
addq $0x25, %rax
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xa8e9b
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xa86c5
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xa8635
callq 0x3cbdb
movq (%rbx), %rdi
jmp 0xa8640
cmpq $0x0, 0x38(%rbx)
je 0xa8622
xorl %r12d, %r12d
cmpb $0x1, 0x19(%rbx)
jne 0xa86cb
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0xa8610
callq 0xa936d
movq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0xa93b1
movq %rax, 0x40(%rbx)
jmp 0xa8689
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0xa8695
movq %r14, %rsi
callq 0xd4960
jmp 0xa86a5
callq 0x3c8cc
movq %rax, %rdi
movq %rax, (%rbx)
movq 0x8(%rbx), %rsi
callq 0x3ca35
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xa865d
callq 0x3bbee
movq 0x10(%rbx), %rdi
jmp 0xa8669
callq 0x3b728
movq %rax, %rdi
movq %rax, 0x10(%rbx)
movq %r15, %rsi
callq 0x3b87d
movq 0x38(%rbx), %rdi
callq 0xd815b
movq (%rbx), %rdi
movq %r14, %rsi
callq 0xbd379
movq %rax, 0x38(%rbx)
xorl %r12d, %r12d
cmpq $0x1, %rax
sbbl %r12d, %r12d
jmp 0xa86cb
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xa86dc
movq %r14, %rsi
callq 0xbd379
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0xa86c5
cmpb $0x1, 0x1a(%rbx)
jne 0xa85f5
movq %rax, %rdi
callq 0xd81af
jmp 0xa85f5
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x23eba
callq 0x23ef3