// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltr_refseq_match_stream.c
// Function: gt_ltr_refseq_match_stream_add_match_to_fn
static void gt_ltr_refseq_match_stream_add_match_to_fn(
                                                    GtLTRRefseqMatchStream *rms,
                                                    GtMatch *match,
                                                    GT_UNUSED GtError *err)
{
  GtStr *seq;
  GtFeatureNode *fn;
  GtGenomeNode *new_node;
  GtMatchDirection dir;
  GtStrand str;
  GtRange fn_range, match_range1, match_range2;
  char target[BUFSIZ], *tmp, *tmp2, buf[BUFSIZ];
  const char *seqid1, *seqid2;
  GtUword ali_length,
                fn_length,
                min_ali_length;
  double similarity;

  gt_assert(rms && match);
  gt_error_check(err);

  seqid1 = gt_match_get_seqid1(match);
  seqid2 = gt_match_get_seqid2(match);
  fn = (GtFeatureNode*) gt_hashmap_get(rms->header_to_fn, (void*) seqid1);
  fn_length = gt_genome_node_get_length((GtGenomeNode*) fn);
  fn_range = gt_genome_node_get_range((GtGenomeNode*) fn);
  min_ali_length = (GtUword) ((rms->min_ali_len_perc / 100.0) * fn_length);
  ali_length = gt_match_blast_get_align_length((GtMatchBlast*) match);
  if (ali_length < min_ali_length) {
    gt_match_delete(match);
    return;
  }
  gt_match_get_range_seq1(match, &match_range1);
  gt_match_get_range_seq2(match, &match_range2);
  seq = gt_genome_node_get_seqid((GtGenomeNode*) fn);
  dir = gt_match_get_direction(match);
  str = gt_ltr_refseq_match_stream_determine_strand(dir, fn);
  similarity = gt_match_blast_get_similarity((GtMatchBlast*) match);
  new_node = gt_feature_node_new(seq, NEW_FN_TYPE,
                                 fn_range.start + match_range1.start,
                                 fn_range.start + match_range1.end, str);
  (void) snprintf(buf, BUFSIZ, "%.2f", similarity);
  gt_feature_node_set_attribute((GtFeatureNode*) new_node, "identity", buf);
  gt_feature_node_set_source((GtFeatureNode*) new_node,
                             gt_str_new_cstr(rms->source));
  if (rms->params_id != GT_UNDEF_UWORD) {
    char params_id[BUFSIZ];

    (void) snprintf(params_id, BUFSIZ, ""GT_WU"", rms->params_id);
    gt_feature_node_set_attribute((GtFeatureNode*) new_node, ATTR_PARAMS,
                                  params_id);
  }

  tmp = gt_cstr_dup(seqid2);
  tmp2 = strtok(tmp, " ");
  if (tmp2 != NULL) {
    GtStr *tmpstr = NULL;
    tmpstr = gt_str_new_cstr(gt_cstr_dup(tmp2));
    gt_free(tmp2);
    while ((tmp2 = strtok(NULL, " ")) != NULL) {
      gt_str_append_cstr(tmpstr, "%20");
      gt_str_append_cstr(tmpstr, gt_cstr_dup(tmp2));
      gt_free(tmp2);
    }
    (void) snprintf(target, BUFSIZ, "%s "GT_WU" "GT_WU"", gt_str_get(tmpstr),
                    match_range2.start, match_range2.end);
    gt_str_delete(tmpstr);
  } else
    (void) snprintf(target, BUFSIZ, "%s " GT_WU " " GT_WU,
                    seqid2, match_range2.start, match_range2.end);
  gt_feature_node_set_attribute((GtFeatureNode*) new_node, ATTR_TARGET,
                                target);
  gt_feature_node_add_child(fn, (GtFeatureNode*) new_node);

  gt_match_delete(match);
}

// Assembly:
subq $0x60d8, %rsp           # imm = 0x60D8
movq %rdi, 0x60d0(%rsp)
movq %rsi, 0x60c8(%rsp)
movq %rdx, 0x60c0(%rsp)
cmpq $0x0, 0x60d0(%rsp)
je 0x302225
cmpq $0x0, 0x60c8(%rsp)
jne 0x30225d
movq 0x339d74(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x213ddd(%rip), %rsi    # 0x516013
leaq 0x290811(%rip), %rdx    # 0x592a4e
leaq 0x290817(%rip), %rcx    # 0x592a5b
leaq 0x290710(%rip), %r8     # 0x59295b
movl $0xd0, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x30225f
jmp 0x302261
cmpq $0x0, 0x60c0(%rsp)
je 0x3022b7
movq 0x60c0(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x30227f
jmp 0x3022b7
movq 0x339d1a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x213d83(%rip), %rsi    # 0x516013
leaq 0x213f28(%rip), %rdx    # 0x5161bf
leaq 0x2907bd(%rip), %rcx    # 0x592a5b
leaq 0x2906b6(%rip), %r8     # 0x59295b
movl $0xd1, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x3022b9
movq 0x60c8(%rsp), %rdi
callq 0x1a6c20
movq %rax, 0x2058(%rsp)
movq 0x60c8(%rsp), %rdi
callq 0x1a6c80
movq %rax, 0x2050(%rsp)
movq 0x60d0(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x2058(%rsp), %rsi
callq 0xe0f20
movq %rax, 0x60b0(%rsp)
movq 0x60b0(%rsp), %rdi
callq 0x171d80
movq %rax, 0x2040(%rsp)
movq 0x60b0(%rsp), %rdi
callq 0x171cc0
movq %rax, 0x2020(%rsp)
movq %rdx, 0x2028(%rsp)
movups 0x2020(%rsp), %xmm0
movaps %xmm0, 0x6090(%rsp)
movq 0x60d0(%rsp), %rax
movsd 0x98(%rax), %xmm0
movsd 0x2184da(%rip), %xmm1   # 0x51a838
divsd %xmm1, %xmm0
movaps 0x2165c7(%rip), %xmm2   # 0x518930
movq 0x2040(%rsp), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x2165c2(%rip), %xmm2   # 0x518940
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x2169c8(%rip), %xmm1   # 0x518d70
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, 0x2038(%rsp)
movq 0x60c8(%rsp), %rdi
callq 0x1a7710
movq %rax, 0x2048(%rsp)
movq 0x2048(%rsp), %rax
cmpq 0x2038(%rsp), %rax
jae 0x3023f8
movq 0x60c8(%rsp), %rdi
callq 0x1a6fb0
jmp 0x30271e
movq 0x60c8(%rsp), %rdi
leaq 0x6080(%rsp), %rsi
callq 0x1a6ce0
movq 0x60c8(%rsp), %rdi
leaq 0x6070(%rsp), %rsi
callq 0x1a6d60
movq 0x60b0(%rsp), %rdi
callq 0x171b70
movq %rax, 0x60b8(%rsp)
movq 0x60c8(%rsp), %rdi
callq 0x1a6f60
movl %eax, 0x60a4(%rsp)
movl 0x60a4(%rsp), %edi
movq 0x60b0(%rsp), %rsi
callq 0x302730
movl %eax, 0x60a0(%rsp)
movq 0x60c8(%rsp), %rdi
callq 0x1a7760
movsd %xmm0, 0x2030(%rsp)
movq 0x60b8(%rsp), %rdi
movq 0x6090(%rsp), %rdx
addq 0x6080(%rsp), %rdx
movq 0x6090(%rsp), %rcx
addq 0x6088(%rsp), %rcx
movl 0x60a0(%rsp), %r8d
leaq 0x2905d3(%rip), %rsi    # 0x592a86
callq 0x16c7e0
movq %rax, 0x60a8(%rsp)
leaq 0x2060(%rsp), %rdi
movsd 0x2030(%rsp), %xmm0
movl $0x2000, %esi           # imm = 0x2000
leaq 0x247130(%rip), %rdx    # 0x54960d
movb $0x1, %al
callq 0x19b90
movq 0x60a8(%rsp), %rdi
leaq 0x2060(%rsp), %rdx
leaq 0x27b4aa(%rip), %rsi    # 0x57d9a5
callq 0x16d660
movq 0x60a8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x60d0(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x11d510
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x16c170
movq 0x60d0(%rsp), %rax
cmpq $-0x1, 0x50(%rax)
je 0x302577
leaq 0x20(%rsp), %rdi
movq 0x60d0(%rsp), %rax
movq 0x50(%rax), %rcx
movl $0x2000, %esi           # imm = 0x2000
leaq 0x28cab2(%rip), %rdx    # 0x58f009
movb $0x0, %al
callq 0x19b90
movq 0x60a8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
leaq 0x271f44(%rip), %rsi    # 0x5744b6
callq 0x16d660
movq 0x2050(%rsp), %rdi
callq 0xa2db0
movq %rax, 0x4068(%rsp)
movq 0x4068(%rsp), %rdi
leaq 0x292ee4(%rip), %rsi    # 0x59547f
callq 0x19b40
movq %rax, 0x4060(%rsp)
cmpq $0x0, 0x4060(%rsp)
je 0x3026ad
movq $0x0, 0x18(%rsp)
movq 0x4060(%rsp), %rdi
callq 0xa2db0
movq %rax, %rdi
callq 0x11d510
movq %rax, 0x18(%rsp)
movq 0x4060(%rsp), %rdi
leaq 0x290372(%rip), %rsi    # 0x59295b
movl $0xf8, %edx
callq 0xe88c0
xorl %eax, %eax
movl %eax, %edi
leaq 0x292e81(%rip), %rsi    # 0x59547f
callq 0x19b40
movq %rax, 0x4060(%rsp)
cmpq $0x0, %rax
je 0x302661
movq 0x18(%rsp), %rdi
leaq 0x29047a(%rip), %rsi    # 0x592a97
callq 0x11d550
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x4060(%rsp), %rdi
callq 0xa2db0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x11d550
movq 0x4060(%rsp), %rdi
leaq 0x290306(%rip), %rsi    # 0x59295b
movl $0xfc, %edx
callq 0xe88c0
jmp 0x3025f3
leaq 0x4070(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
callq 0x11dee0
movq (%rsp), %rdi
movq %rax, %rcx
movq 0x6070(%rsp), %r8
movq 0x6078(%rsp), %r9
movl $0x2000, %esi           # imm = 0x2000
leaq 0x233b4e(%rip), %rdx    # 0x5361e8
movb $0x0, %al
callq 0x19b90
movq 0x18(%rsp), %rdi
callq 0x11f560
jmp 0x3026e0
leaq 0x4070(%rsp), %rdi
movq 0x2050(%rsp), %rcx
movq 0x6070(%rsp), %r8
movq 0x6078(%rsp), %r9
movl $0x2000, %esi           # imm = 0x2000
leaq 0x233b0f(%rip), %rdx    # 0x5361e8
movb $0x0, %al
callq 0x19b90
movq 0x60a8(%rsp), %rdi
leaq 0x4070(%rsp), %rdx
leaq 0x257b0d(%rip), %rsi    # 0x55a204
callq 0x16d660
movq 0x60b0(%rsp), %rdi
movq 0x60a8(%rsp), %rsi
callq 0x16d010
movq 0x60c8(%rsp), %rdi
callq 0x1a6fb0
addq $0x60d8, %rsp           # imm = 0x60D8
retq
nopw %cs:(%rax,%rax)