// File: /workspace/github_c_makefile_star2_O1/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 0x217680
movq %rdx, %rbx
testq %rdx, %rdx
je 0x217680
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x1, 0x38(%rbx)
jne 0x217474
movq 0x70(%r14), %r12
movq 0x18(%rbx), %r13
leaq (,%r13,2), %rax
addq %r13, %rax
subq %rax, %r12
subq 0x20(%rbx), %r12
subq 0x10(%rbx), %r13
jmp 0x217493
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %r13
leaq (%rax,%rax,2), %rcx
movq 0x20(%rbx), %rdx
addq 0x68(%r14), %rcx
leaq (%rdx,%rcx), %r12
addq $-0x3, %r12
subq %rax, %r13
movq 0x40(%rbx), %rdi
callq 0xd4a9a
testq %rax, %rax
jne 0x2174af
cmpb $0x1, 0x90(%r14)
jne 0x217660
leaq (,%r13,2), %rax
addq %r13, %rax
leaq (%r12,%rax), %r13
addq $0x4, %r13
incq %r12
movq 0x28(%r14), %rdi
callq 0x14b89b
movl 0x38(%rbx), %r8d
leaq 0x172afe(%rip), %rsi    # 0x389fd7
movq %rax, %rdi
movq %r12, %rdx
movq %r13, %rcx
callq 0x14952c
movq %rax, %r12
movq 0x50(%rbx), %rdi
callq 0x120e79
leaq 0x1b21b9(%rip), %rsi    # 0x3c96b3
leaq -0xf59fe(%rip), %r13    # 0x121b03
movq %r12, %rdi
movq %rax, %rdx
movq %r13, %rcx
callq 0x14bd18
movq 0x58(%rbx), %rdi
callq 0x120e79
leaq 0x1b21a3(%rip), %rsi    # 0x3c96c2
movq %r12, %rdi
movq %rax, %rdx
movq %r13, %rcx
callq 0x14bd18
movq 0x88(%r14), %rsi
movq %r12, %rdi
callq 0x1491f1
cvtsd2ss 0x28(%rbx), %xmm0
movq %r12, %rdi
callq 0x149c09
movl 0x20(%rbx), %ecx
leaq 0x1bc157(%rip), %rdx    # 0x3d36aa
movq %rsp, %r13
movl $0x20, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x17c60
leaq 0x17f706(%rip), %rsi    # 0x396c72
movq %r12, %rdi
movq %r13, %rdx
callq 0x14a4d2
movq 0x30(%r15), %rdx
testq %rdx, %rdx
je 0x21758f
leaq 0x17459b(%rip), %rsi    # 0x38bb22
movq %r12, %rdi
callq 0x14a4d2
movq 0x40(%rbx), %rdi
callq 0xd4a9a
cmpq $0x2, %rax
jb 0x217654
cmpb $0x1, 0x90(%r14)
jne 0x217654
cmpq $0x0, 0x40(%rbx)
je 0x217685
callq 0x1208f8
movq %rax, %r13
movq 0x40(%rbx), %rdi
callq 0xd4a9a
testq %rax, %rax
je 0x217632
xorl %ebp, %ebp
movq 0x30(%r15), %rsi
movq %r13, %rdi
callq 0x12097f
movq %r13, %rdi
movl $0x3a, %esi
callq 0x120ba5
movq 0x40(%rbx), %rdi
movq %rbp, %rsi
callq 0xd47ba
movq (%rax), %rsi
movq %r13, %rdi
callq 0x120af4
movq 0x40(%rbx), %rdi
callq 0xd4a9a
decq %rax
cmpq %rax, %rbp
je 0x217621
movq %r13, %rdi
movl $0x2c, %esi
callq 0x120ba5
incq %rbp
movq 0x40(%rbx), %rdi
callq 0xd4a9a
cmpq %rax, %rbp
jb 0x2175d3
movq %r13, %rdi
callq 0x120d23
leaq 0x190a32(%rip), %rsi    # 0x3a8073
movq %r12, %rdi
movq %rax, %rdx
callq 0x149c3c
movq %r13, %rdi
callq 0x121b03
movq 0x28(%r14), %rdi
movq %r12, %rsi
callq 0x149997
movq 0x40(%rbx), %rdi
callq 0xd4ef4
movq $0x0, 0x40(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x833d1
callq 0x8340a
nop