// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
testq %rdi, %rdi
je 0x1c2259
movq %rdx, %rbx
testq %rdx, %rdx
je 0x1c2259
movq %rsi, %r15
movq %rdi, %rbp
cmpl $0x1, 0x38(%rbx)
jne 0x1c2059
movq 0x18(%rbx), %rax
imulq $-0x3, %rax, %r12
addq 0x70(%rbp), %r12
subq 0x20(%rbx), %r12
subq 0x10(%rbx), %rax
leaq (%rax,%rax,2), %r13
movq %r12, %r14
jmp 0x1c207f
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq (%rax,%rax,2), %rdx
movq 0x20(%rbx), %rsi
addq 0x68(%rbp), %rdx
leaq (%rsi,%rdx), %r13
addq $-0x3, %r13
subq %rax, %rcx
leaq (%rcx,%rcx,2), %r12
movq %r13, %r14
movq 0x40(%rbx), %rdi
callq 0x586a4
testq %rax, %rax
jne 0x1c209a
cmpb $0x1, 0x90(%rbp)
jne 0x1c223c
incq %r14
addq %r13, %r12
addq $0x4, %r12
movq 0x28(%rbp), %rdi
callq 0xdd14a
movl 0x38(%rbx), %r8d
leaq 0x15ef71(%rip), %rsi    # 0x321029
movq %rax, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0xd9acb
movq %rax, %r12
movq 0x50(%rbx), %rdi
callq 0xad4d2
leaq 0x19e3aa(%rip), %rsi    # 0x360483
leaq -0x113fdd(%rip), %r14   # 0xae103
movq %r12, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0xdd810
movq 0x58(%rbx), %rdi
callq 0xad4d2
leaq 0x19e394(%rip), %rsi    # 0x360492
movq %r12, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0xdd810
movq 0x88(%rbp), %rsi
movq %r12, %rdi
callq 0xd96be
cvtsd2ss 0x28(%rbx), %xmm0
movq %r12, %rdi
callq 0xda425
movl 0x20(%rbx), %ecx
leaq 0x1a8258(%rip), %rdx    # 0x36a38a
leaq 0x10(%rsp), %r14
pushq $0x20
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x17bf0
leaq 0x16bb37(%rip), %rsi    # 0x32dc82
movq %r12, %rdi
movq %r14, %rdx
callq 0xdb38d
movq 0x30(%r15), %rdx
testq %rdx, %rdx
je 0x1c216e
leaq 0x160a05(%rip), %rsi    # 0x322b6b
movq %r12, %rdi
callq 0xdb38d
movq 0x40(%rbx), %rdi
callq 0x586a4
cmpq $0x2, %rax
jb 0x1c2230
cmpb $0x1, 0x90(%rbp)
jne 0x1c2230
movq %rbp, 0x8(%rsp)
cmpq $0x0, 0x40(%rbx)
je 0x1c2291
xorl %ebp, %ebp
callq 0xacb84
movq %rax, %r13
pushq $0x3a
popq %r14
movq 0x40(%rbx), %rdi
callq 0x586a4
cmpq %rax, %rbp
jae 0x1c2209
movq 0x30(%r15), %rsi
movq %r13, %rdi
callq 0xacbfb
movq %r13, %rdi
movl %r14d, %esi
callq 0xaced9
movq 0x40(%rbx), %rdi
movq %rbp, %rsi
callq 0x581aa
movq (%rax), %rsi
movq %r13, %rdi
callq 0xace26
movq 0x40(%rbx), %rdi
callq 0x586a4
decq %rax
cmpq %rax, %rbp
je 0x1c2204
movq %r13, %rdi
pushq $0x2c
popq %rsi
callq 0xaced9
incq %rbp
jmp 0x1c21ac
movq %r13, %rdi
callq 0xad1fa
leaq 0x17cc8b(%rip), %rsi    # 0x33eea3
movq %r12, %rdi
movq %rax, %rdx
callq 0xda48b
movq %r13, %rdi
callq 0xae103
movq 0x8(%rsp), %rbp
movq 0x28(%rbp), %rdi
movq %r12, %rsi
callq 0xda055
movq 0x40(%rbx), %rdi
callq 0x58eb9
andq $0x0, 0x40(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x275d08(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x122da9(%rip), %rsi    # 0x2e5013
leaq 0x19ebab(%rip), %rdx    # 0x360e1c
leaq 0x19ebb4(%rip), %rcx    # 0x360e2c
leaq 0x19e463(%rip), %r8     # 0x3606e2
movl $0x243, %r9d            # imm = 0x243
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x275cd0(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x122d71(%rip), %rsi    # 0x2e5013
leaq 0x19eba8(%rip), %rdx    # 0x360e51
leaq 0x19eb7c(%rip), %rcx    # 0x360e2c
leaq 0x19e42b(%rip), %r8     # 0x3606e2
movl $0x261, %r9d            # imm = 0x261
jmp 0x1c2285
nop