// File: /workspace/github_c_makefile_star2_O1/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 %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
testq %rdx, %rdx
je 0xa8fe0
movq %r14, %rdi
callq 0x3566a
testb %al, %al
jne 0xa914a
cmpq $0x0, 0x20(%rbx)
je 0xa9058
cmpq $0x0, 0x8(%rbx)
je 0xa9002
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x3c4b0
testl %eax, %eax
je 0xa9088
movq 0x8(%rbx), %rdi
callq 0x3d1eb
movq %r15, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0x7a678
movl %eax, %ebp
movq %r15, %rdi
callq 0x3c40b
testb %bpl, %bpl
je 0xa902e
addq $0x25, %rax
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xa995b
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xa913a
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xa90a2
callq 0x3d54e
jmp 0xa90aa
cmpq $0x0, 0x38(%rbx)
je 0xa908f
cmpb $0x1, 0x19(%rbx)
jne 0xa9088
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0xa9073
callq 0xa9e28
movq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0xa9e6c
movq %rax, %rcx
movq %rax, 0x40(%rbx)
jmp 0xa90f6
xorl %eax, %eax
jmp 0xa913f
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0xa9100
movq %r14, %rsi
callq 0xd3b98
jmp 0xa9110
callq 0x3d23c
movq %rax, (%rbx)
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0x3d3a8
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xa90c6
callq 0x3c49c
jmp 0xa90cf
callq 0x3bfe0
movq %rax, 0x10(%rbx)
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x3c12b
movq 0x38(%rbx), %rdi
callq 0xd7a53
movq (%rbx), %rdi
movq %r14, %rsi
callq 0xbc2f8
movq %rax, %rcx
movq %rax, 0x38(%rbx)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
jmp 0xa913f
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xa914f
movq %r14, %rsi
callq 0xbc2f8
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0xa913a
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0xa905f
cmpb $0x1, 0x1a(%rbx)
jne 0xa905f
callq 0xd7aa7
jmp 0xa905f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x23f92
callq 0x23fcb