// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/spec_results.c
// Function: gt_spec_results_render_template
int gt_spec_results_render_template(GtSpecResults *sr, const char *template,
                                    GtFile *outfile, const char *specfile,
                                    bool details, bool colored,
                                    const char *runtime_str, GtError *err)
{
  lua_State *L;
  GtNodeVisitor *vis = NULL;
  GtSpecResultsReportInfo info;
  int had_err = 0;
  gt_assert(sr && specfile && template && err);

  L = luaL_newstate();
  if (!L) {
    gt_error_set(err, "cannot create new Lua state");
    return -1;
  }
  spec_results_luaL_opencustomlibs(L, spec_results_luasecurelibs);

  /* fill info */
  info.outfile = outfile;
  info.details = details;
  info.colored = colored;
  info.L = L;
  info.sr = sr;

  /* make model for nodes/aspects */
  lua_newtable(L);
  gt_hashmap_foreach_in_key_order(sr->feature_aspects,
                                  gt_spec_results_make_feature_model,
                                  &info, NULL);
  lua_setglobal(L, "features");
  lua_newtable(L);
  gt_hashmap_foreach_in_key_order(sr->region_aspects,
                                  gt_spec_results_make_aspect_model,
                                  &info, NULL);
  lua_setglobal(L, "regions");
  lua_newtable(L);
  gt_hashmap_foreach_in_key_order(sr->meta_aspects,
                                  gt_spec_results_make_aspect_model,
                                  &info, NULL);
  lua_setglobal(L, "metas");
  lua_newtable(L);
  gt_hashmap_foreach_in_key_order(sr->sequence_aspects,
                                  gt_spec_results_make_aspect_model,
                                  &info, NULL);
  lua_setglobal(L, "sequences");
  lua_newtable(L);
  gt_hashmap_foreach_in_key_order(sr->comment_aspects,
                                  gt_spec_results_make_aspect_model,
                                  &info, NULL);
  lua_setglobal(L, "comments");

  /* add warnings */
  lua_newtable(L);
  if (gt_str_array_size(sr->warnings) > 0) {
    GtUword i;
    for (i = 0; i < gt_str_array_size(sr->warnings); i++) {
      lua_pushnumber(L, i+1);
      lua_pushstring(L, gt_str_array_get(sr->warnings, i));
      lua_rawset(L, -3);
    }
  }
  lua_setglobal(L, "warnings");

  /* dome global settings */
  lua_newtable(L);
  lua_pushstring(L, "runtime");
  lua_pushstring(L, runtime_str);
  lua_rawset(L, -3);
  lua_pushstring(L, "spec_filename");
  lua_pushstring(L, specfile);
  lua_rawset(L, -3);
  lua_pushstring(L, "template_filename");
  lua_pushstring(L, template);
  lua_rawset(L, -3);
  lua_pushstring(L, "show_details");
  lua_pushboolean(L, details);
  lua_rawset(L, -3);
  lua_pushstring(L, "colored_output");
  lua_pushboolean(L, colored);
  lua_rawset(L, -3);
  lua_pushstring(L, "coloured_output");
  lua_pushboolean(L, colored);
  lua_rawset(L, -3);
  lua_pushstring(L, "checked_ccs");
  lua_pushnumber(L, sr->checked_ccs);
  lua_rawset(L, -3);
  lua_pushstring(L, "checked_aspects");
  lua_pushnumber(L, sr->checked_aspects);
  lua_rawset(L, -3);
  lua_pushstring(L, "checked_nodes");
  lua_pushnumber(L, sr->checked_nodes);
  lua_rawset(L, -3);
  lua_pushstring(L, "checked_types");
  lua_pushnumber(L, sr->checked_types);
  lua_rawset(L, -3);
  lua_setglobal(L, "global");

  /* add own print function to support -o etc. */
  lua_pushcfunction(L, gt_spec_results_lua_print);
  lua_setglobal(L, "template_print");

  /* gt.script_dir is useful in templates too */
  gt_lua_set_script_dir(L, template);

  /* also push a GtGFF3Visitor writing to outfile*/
  vis = gt_gff3_visitor_new(outfile);
  gt_gff3_visitor_retain_id_attributes((GtGFF3Visitor*) vis);
  gt_gff3_visitor_allow_nonunique_ids((GtGFF3Visitor*) vis);
  gt_lua_genome_visitor_push(L, vis);
  lua_setglobal(L, "gff3_out_visitor");

  lua_pushlightuserdata(L, (void*) &spec_resuserdata);
  lua_pushlightuserdata(L, (void*) outfile);
  lua_settable(L, LUA_REGISTRYINDEX);

  /* render template */
  had_err = (luaL_loadfile(L, template)
               || lua_pcall(L, 0, 0, 0));
  if (had_err) {
    const char *error = lua_tostring(L, -1);
    gt_error_set(err, "%s", error);
    had_err = -1;
  }

  lua_close(L);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0x4(%rsp)
movl %r8d, (%rsp)
movq %rdx, 0x8(%rsp)
movq 0x78(%rsp), %rbx
movq %rcx, %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %rbx, %xmm0
movq %rsi, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm0
shufps $0xdd, %xmm2, %xmm0     # xmm0 = xmm0[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1     # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm0, %xmm1
movmskps %xmm1, %eax
testl %eax, %eax
jne 0x17ed0c
movq %rcx, %r12
movq %rsi, %r15
movq %rdi, %r13
callq 0x231b44
testq %rax, %rax
je 0x17ecd8
movq %rax, %r14
leaq 0x3406f5(%rip), %rbp    # 0x4beec0
leaq 0xb33b4(%rip), %rbx     # 0x231b86
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x22e48c
movq (%rbp), %rsi
movq 0x18(%rbp), %rbx
movq %r14, %rdi
callq 0x22e0c4
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x22efe6
addq $0x10, %rbp
testq %rbx, %rbx
jne 0x17e7d2
leaq 0x10(%rsp), %rbp
movq 0x8(%rsp), %rax
movq %rax, (%rbp)
movl (%rsp), %eax
movb %al, 0x8(%rbp)
movl 0x4(%rsp), %eax
movb %al, 0x9(%rbp)
movq %r14, 0x18(%rbp)
movq %r13, 0x20(%rbp)
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22e8fc
movq (%r13), %rdi
leaq 0x4d0(%rip), %rsi       # 0x17ed11
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x105b27
leaq 0x1d0772(%rip), %rdx    # 0x34efc4
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x22ec93
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22e8fc
movq 0x10(%r13), %rdi
leaq 0x4ea(%rip), %rbx       # 0x17ed60
movq %rbx, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x105b27
leaq 0x207cb4(%rip), %rdx    # 0x38653e
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x22ec93
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22e8fc
movq 0x8(%r13), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x105b27
leaq 0x21e285(%rip), %rdx    # 0x39cb40
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x22ec93
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22e8fc
movq 0x20(%r13), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x105b27
leaq 0x1d5cee(%rip), %rdx    # 0x3545da
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x22ec93
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22e8fc
movq 0x18(%r13), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x105b27
leaq 0x21e229(%rip), %rdx    # 0x39cb46
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x22ec93
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22e8fc
movq 0x50(%r13), %rdi
callq 0x121e78
testq %rax, %rax
je 0x17e9b6
movq 0x50(%r13), %rdi
callq 0x121e78
testq %rax, %rax
je 0x17e9b6
xorl %ebx, %ebx
leaq 0x1(%rbx), %rbp
movq %rbp, %xmm1
punpckldq 0x1d1f7b(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d1f83(%rip), %xmm1   # 0x3508f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x22debe
movq 0x50(%r13), %rdi
movq %rbx, %rsi
callq 0x121cfa
movq %r14, %rdi
movq %rax, %rsi
callq 0x22e0c4
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x22ecef
movq 0x50(%r13), %rdi
callq 0x121e78
movq %rbp, %rbx
cmpq %rax, %rbp
jb 0x17e954
leaq 0x1cf9d1(%rip), %rdx    # 0x34e38e
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x22ec93
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22e8fc
leaq 0x254a85(%rip), %rsi    # 0x3d3462
movq %r14, %rdi
callq 0x22e0c4
movq %r14, %rdi
movq 0x70(%rsp), %rsi
callq 0x22e0c4
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x22ecef
leaq 0x21e149(%rip), %rsi    # 0x39cb4f
movq %r14, %rdi
callq 0x22e0c4
movq %r14, %rdi
movq %r12, %rsi
callq 0x22e0c4
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x22ecef
leaq 0x21e130(%rip), %rsi    # 0x39cb5d
movq %r14, %rdi
callq 0x22e0c4
movq %r14, %rdi
movq %r15, %rsi
callq 0x22e0c4
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x22ecef
leaq 0x21e11b(%rip), %rsi    # 0x39cb6f
movq %r14, %rdi
callq 0x22e0c4
movzbl (%rsp), %esi
movq %r14, %rdi
callq 0x22e570
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x22ecef
leaq 0x21e100(%rip), %rsi    # 0x39cb7c
movq %r14, %rdi
callq 0x22e0c4
movzbl 0x4(%rsp), %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x22e570
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x22ecef
leaq 0x21e0e4(%rip), %rsi    # 0x39cb8b
movq %r14, %rdi
callq 0x22e0c4
movq %r14, %rdi
movl %ebx, %esi
callq 0x22e570
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x22ecef
leaq 0x21e0ce(%rip), %rsi    # 0x39cb9b
movq %r14, %rdi
callq 0x22e0c4
movsd 0x40(%r13), %xmm1
unpcklps 0x1d1dfe(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d1e06(%rip), %xmm1   # 0x3508f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x22debe
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x22ecef
leaq 0x21e095(%rip), %rsi    # 0x39cba7
movq %r14, %rdi
callq 0x22e0c4
movsd 0x38(%r13), %xmm1
unpcklps 0x1d1db9(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d1dc1(%rip), %xmm1   # 0x3508f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x22debe
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x22ecef
leaq 0x21e060(%rip), %rsi    # 0x39cbb7
movq %r14, %rdi
callq 0x22e0c4
movsd 0x48(%r13), %xmm1
unpcklps 0x1d1d74(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d1d7c(%rip), %xmm1   # 0x3508f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x22debe
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x22ecef
leaq 0x21e029(%rip), %rsi    # 0x39cbc5
movq %r14, %rdi
callq 0x22e0c4
movsd 0x30(%r13), %xmm1
unpcklps 0x1d1d2f(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d1d37(%rip), %xmm1   # 0x3508f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x22debe
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x22ecef
leaq 0x1d073b(%rip), %rdx    # 0x34f31c
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x22ec93
leaq 0x373(%rip), %rsi       # 0x17ef68
movq %r14, %rdi
xorl %edx, %edx
callq 0x22e48c
leaq 0x21dfcd(%rip), %rdx    # 0x39cbd3
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x22ec93
movq %r14, %rdi
movq %r15, %rsi
callq 0x16401e
movq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x1530bc
movq %rax, %rbx
movq %rax, %rdi
callq 0x1531cf
movq %rbx, %rdi
callq 0x1531df
movq %r14, %rdi
movq %rbx, %rsi
callq 0x19102e
leaq 0x21df92(%rip), %rdx    # 0x39cbe2
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x22ec93
leaq 0x34658c(%rip), %rsi    # 0x4c51f0
movq %r14, %rdi
callq 0x22e58a
movq %r14, %rdi
movq %r12, %rsi
callq 0x22e58a
movq %r14, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x22ea7e
movq %r14, %rdi
movq %r15, %rsi
callq 0x23180b
movb $0x1, %cl
testl %eax, %eax
jne 0x17eca8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x22f092
testl %eax, %eax
setne %cl
testb %cl, %cl
je 0x17ecf0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x22db9e
leaq 0x25350a(%rip), %rsi    # 0x3d21d1
movq 0x78(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1019cf
jmp 0x17ecf3
leaq 0x21de45(%rip), %rsi    # 0x39cb24
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x17ecfb
movzbl %cl, %ebx
movq %r14, %rdi
callq 0x2307b5
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x561e8