// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/ltr/ltrdigest_pdom_visitor.c
// Function: gt_ltrdigest_pdom_visitor_attach_hit
static int gt_ltrdigest_pdom_visitor_attach_hit(GtLTRdigestPdomVisitor *lv,
                                                GtHMMERModelHit *modelhit,
                                                GtHMMERSingleHit *singlehit)
{
  GT_UNUSED GtUword i;
  GtGenomeNode *gf;
  int had_err = 0;
  GtRange rrng;
  gt_assert(lv && singlehit);

  rrng = gt_ltrdigest_pdom_visitor_coords(lv, singlehit);

  if (gt_array_size(singlehit->chains) > 0 || lv->output_all_chains) {
    char buf[32];
    gf = gt_feature_node_new(gt_genome_node_get_seqid((GtGenomeNode*)
                                                      lv->ltr_retrotrans),
                             gt_ft_protein_match,
                             rrng.start,
                             rrng.end,
                             singlehit->strand);
    gt_genome_node_add_user_data((GtGenomeNode*) gf, "pdom_alignment",
                                 gt_str_ref(singlehit->alignment),
                                 (GtFree) gt_str_delete);
    gt_genome_node_add_user_data((GtGenomeNode*) gf, "pdom_aaseq",
                                 gt_str_ref(singlehit->aastring),
                                 (GtFree) gt_str_delete);
    gt_feature_node_set_source((GtFeatureNode*) gf, lv->tag);
    gt_feature_node_set_score((GtFeatureNode*) gf, (float) singlehit->evalue);
    (void) snprintf(buf, (size_t) 32, "%d", (int) singlehit->frame);
    gt_feature_node_add_attribute((GtFeatureNode*) gf,
                                    "reading_frame", buf);
    if (modelhit->modelname != NULL) {
      gt_feature_node_add_attribute((GtFeatureNode*) gf, "name",
                                    modelhit->modelname);
    }
    if (gt_array_size(singlehit->chains) > 1UL && lv->output_all_chains) {
      GtStr *buffer;
      GtUword j;
      gt_assert(singlehit->chains != NULL);
      buffer = gt_str_new();
      for (j = 0UL; j < gt_array_size(singlehit->chains); j++) {
        gt_str_append_cstr(buffer, modelhit->modelname);
        gt_str_append_char(buffer, ':');
        gt_str_append_uword(buffer,
                          *(GtUword*) gt_array_get(singlehit->chains, j));
        if (j != gt_array_size(singlehit->chains) - 1) {
          gt_str_append_char(buffer, ',');
        }
      }
      gt_feature_node_set_attribute((GtFeatureNode*) gf, "chains",
                                    gt_str_get(buffer));
      gt_str_delete(buffer);
    }
    gt_feature_node_add_child(lv->ltr_retrotrans, (GtFeatureNode*) gf);
  }
  gt_array_delete(singlehit->chains);
  singlehit->chains = NULL;
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x20dcb9
movq %rdx, %rbx
testq %rdx, %rdx
je 0x20dcb9
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x1, 0x38(%rbx)
jne 0x20dab2
movq 0x70(%r14), %r13
movq 0x18(%rbx), %rax
leaq (%rax,%rax,2), %rcx
subq %rcx, %r13
subq 0x20(%rbx), %r13
subq 0x10(%rbx), %rax
leaq (%rax,%rax,2), %rbp
movq %r13, %r12
jmp 0x20dad8
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq (%rax,%rax,2), %rdx
movq 0x20(%rbx), %rsi
addq 0x68(%r14), %rdx
leaq (%rsi,%rdx), %rbp
addq $-0x3, %rbp
subq %rax, %rcx
leaq (%rcx,%rcx,2), %r13
movq %rbp, %r12
movq 0x40(%rbx), %rdi
callq 0xd24e0
testq %rax, %rax
jne 0x20daf4
cmpb $0x1, 0x90(%r14)
jne 0x20dc99
incq %r12
addq %rbp, %r13
addq $0x4, %r13
movq 0x28(%r14), %rdi
callq 0x144635
movl 0x38(%rbx), %r8d
leaq 0x173107(%rip), %rsi    # 0x380c19
movq %rax, %rdi
movq %r12, %rdx
movq %r13, %rcx
callq 0x1422f4
movq %rax, %r12
movq 0x50(%rbx), %rdi
callq 0x11b1f3
leaq 0x1b2500(%rip), %rsi    # 0x3c0033
leaq -0xf1d7b(%rip), %r13    # 0x11bdbf
movq %r12, %rdi
movq %rax, %rdx
movq %r13, %rcx
callq 0x144a7d
movq 0x58(%rbx), %rdi
callq 0x11b1f3
leaq 0x1b24ea(%rip), %rsi    # 0x3c0042
movq %r12, %rdi
movq %rax, %rdx
movq %r13, %rcx
callq 0x144a7d
movq 0x88(%r14), %rsi
movq %r12, %rdi
callq 0x141fb5
cvtsd2ss 0x28(%rbx), %xmm0
movq %r12, %rdi
callq 0x1429dc
movl 0x20(%rbx), %ecx
leaq 0x1bc3fe(%rip), %rdx    # 0x3c9f8a
movq %rsp, %r13
movl $0x20, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x17c60
leaq 0x17fced(%rip), %rsi    # 0x38d892
movq %r12, %rdi
movq %r13, %rdx
callq 0x14329d
movq 0x30(%r15), %rdx
testq %rdx, %rdx
je 0x20dbc8
leaq 0x174b9f(%rip), %rsi    # 0x38275f
movq %r12, %rdi
callq 0x14329d
movq 0x40(%rbx), %rdi
callq 0xd24e0
cmpq $0x2, %rax
jb 0x20dc8d
cmpb $0x1, 0x90(%r14)
jne 0x20dc8d
cmpq $0x0, 0x40(%rbx)
je 0x20dcbe
callq 0x11ac6c
movq %rax, %r13
movq 0x40(%rbx), %rdi
callq 0xd24e0
testq %rax, %rax
je 0x20dc6b
xorl %ebp, %ebp
movq 0x30(%r15), %rsi
movq %r13, %rdi
callq 0x11acf3
movq %r13, %rdi
movl $0x3a, %esi
callq 0x11af23
movq 0x40(%rbx), %rdi
movq %rbp, %rsi
callq 0xd2207
movq (%rax), %rsi
movq %r13, %rdi
callq 0x11ae72
movq 0x40(%rbx), %rdi
callq 0xd24e0
decq %rax
cmpq %rax, %rbp
je 0x20dc5a
movq %r13, %rdi
movl $0x2c, %esi
callq 0x11af23
incq %rbp
movq 0x40(%rbx), %rdi
callq 0xd24e0
cmpq %rax, %rbp
jb 0x20dc0c
movq %r13, %rdi
callq 0x11b0a1
leaq 0x190f29(%rip), %rsi    # 0x39eba3
movq %r12, %rdi
movq %rax, %rdx
callq 0x142a0f
movq %r13, %rdi
callq 0x11bdbf
movq 0x28(%r14), %rdi
movq %r12, %rsi
callq 0x14275f
movq 0x40(%rbx), %rdi
callq 0xd2938
movq $0x0, 0x40(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8143a
callq 0x81473
nop