// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/extract_feature_sequence.c
// Function: extract_join_feature
static int extract_join_feature(GtGenomeNode *gn, const char *type,
                                GtRegionMapping *region_mapping,
                                GtStr *sequence, bool *reverse_strand,
                                bool *first_child_of_type_seen, GtPhase *phase,
                                GtError *err)
{
  char *outsequence;
  GtFeatureNode *fn;
  GtRange range;
  int had_err = 0;

  gt_error_check(err);
  fn = gt_feature_node_cast(gn);
  gt_assert(fn);

  if (gt_feature_node_has_type(fn, type)) {
    if (gt_feature_node_get_strand(fn) == GT_STRAND_REVERSE) {
      *reverse_strand = true;
      *phase = gt_feature_node_get_phase(fn);
    } else {
      if (!(*first_child_of_type_seen)) {
        *first_child_of_type_seen = true;
        *phase = gt_feature_node_get_phase(fn);
      } else *phase = GT_PHASE_UNDEFINED;
    }
    range = gt_genome_node_get_range(gn);
    had_err = gt_region_mapping_get_sequence(region_mapping, &outsequence,
                                             gt_genome_node_get_seqid(gn),
                                             range.start, range.end, err);
    if (!had_err) {
      gt_str_append_cstr_nt(sequence, outsequence, gt_range_length(&range));
      gt_free(outsequence);
    }
  }
  return had_err;
}

// Assembly:
subq $0x88, %rsp
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rax
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movq %r9, 0x58(%rsp)
movl $0x0, 0x34(%rsp)
cmpq $0x0, 0x98(%rsp)
je 0xe7b26
movq 0x98(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0xe7aee
jmp 0xe7b26
movq 0xcc4e3(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x76567(%rip), %rsi     # 0x15e066
leaq 0x76b42(%rip), %rdx     # 0x15e648
leaq 0x92072(%rip), %rcx     # 0x179b7f
leaq 0x91ff0(%rip), %r8      # 0x179b04
movl $0x2a, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe7b28
movq 0x80(%rsp), %rdi
callq 0x20750
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0xe7b7a
movq 0xcc48f(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x76513(%rip), %rsi     # 0x15e066
leaq 0x8aa27(%rip), %rdx     # 0x172581
leaq 0x9201e(%rip), %rcx     # 0x179b7f
leaq 0x91f9c(%rip), %r8      # 0x179b04
movl $0x2c, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe7b7c
movq 0x48(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x21700
testb $0x1, %al
jne 0xe7b94
jmp 0xe7cb6
movq 0x48(%rsp), %rdi
callq 0x20a10
cmpl $0x1, %eax
jne 0xe7bc3
movq 0x60(%rsp), %rax
movb $0x1, (%rax)
movq 0x48(%rsp), %rdi
callq 0x21f60
movl %eax, %ecx
movq 0x90(%rsp), %rax
movl %ecx, (%rax)
jmp 0xe7bfd
movq 0x58(%rsp), %rax
testb $0x1, (%rax)
jne 0xe7bed
movq 0x58(%rsp), %rax
movb $0x1, (%rax)
movq 0x48(%rsp), %rdi
callq 0x21f60
movl %eax, %ecx
movq 0x90(%rsp), %rax
movl %ecx, (%rax)
jmp 0xe7bfb
movq 0x90(%rsp), %rax
movl $0x3, (%rax)
jmp 0xe7bfd
movq 0x80(%rsp), %rdi
callq 0x259f0
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x80(%rsp), %rdi
callq 0x258a0
movq 0x18(%rsp), %rdi
movq %rax, %rdx
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %r8
movq 0x98(%rsp), %r9
leaq 0x50(%rsp), %rsi
callq 0xe8c60
movl %eax, 0x34(%rsp)
cmpl $0x0, 0x34(%rsp)
jne 0xe7cb4
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x93bd0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
callq 0x19290
movq 0x50(%rsp), %rdi
leaq 0x91e5a(%rip), %rsi     # 0x179b04
movl $0x3e, %edx
callq 0xdab0
jmp 0xe7cb6
movl 0x34(%rsp), %eax
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)