// File: /workspace/github_c_makefile_star2_O3/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 0x17687a
movq %rcx, %rbp
movq %rsi, %r15
movq %rdi, %r13
callq 0x22810a
testq %rax, %rax
je 0x176851
movq %rax, %r14
leaq 0x33db78(%rip), %r12    # 0x4b3eb0
leaq 0xb1e0d(%rip), %rbx     # 0x22814c
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2247b8
movq (%r12), %rsi
movq 0x18(%r12), %rbx
movq %r14, %rdi
callq 0x2243ba
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2252cf
addq $0x10, %r12
testq %rbx, %rbx
jne 0x17633f
leaq 0x10(%rsp), %r12
movq 0x8(%rsp), %rax
movq %rax, (%r12)
movl (%rsp), %eax
movb %al, 0x8(%r12)
movl 0x4(%rsp), %eax
movb %al, 0x9(%r12)
movq %r14, 0x18(%r12)
movq %r13, 0x20(%r12)
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x224be0
movq (%r13), %rdi
leaq 0x4ca(%rip), %rsi       # 0x17687f
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x100bf3
leaq 0x1cfbfe(%rip), %rdx    # 0x345fc4
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x224f78
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x224be0
movq 0x10(%r13), %rdi
leaq 0x4e4(%rip), %rbx       # 0x1768ce
movq %rbx, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x100bf3
leaq 0x206dd0(%rip), %rdx    # 0x37d1ce
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x224f78
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x224be0
movq 0x8(%r13), %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x100bf3
leaq 0x21d295(%rip), %rdx    # 0x3936c4
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x224f78
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x224be0
movq 0x20(%r13), %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x100bf3
leaq 0x1d516b(%rip), %rdx    # 0x34b5cb
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x224f78
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x224be0
movq 0x18(%r13), %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x100bf3
leaq 0x21d239(%rip), %rdx    # 0x3936ca
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x224f78
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x224be0
movq 0x50(%r13), %rdi
callq 0x11c131
testq %rax, %rax
je 0x17652a
movq 0x50(%r13), %rdi
callq 0x11c131
testq %rax, %rax
je 0x17652a
xorl %ebx, %ebx
leaq 0x1(%rbx), %r12
movq %r12, %xmm1
punpckldq 0x1d1407(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d140f(%rip), %xmm1   # 0x3478f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x2241c8
movq 0x50(%r13), %rdi
movq %rbx, %rsi
callq 0x11bfb3
movq %r14, %rdi
movq %rax, %rsi
callq 0x2243ba
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x224fd4
movq 0x50(%r13), %rdi
callq 0x11c131
movq %r12, %rbx
cmpq %rax, %r12
jb 0x1764c8
leaq 0x1cee5d(%rip), %rdx    # 0x34538e
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x224f78
xorl %r12d, %r12d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x224be0
leaq 0x2537ee(%rip), %rsi    # 0x3c9d42
movq %r14, %rdi
callq 0x2243ba
movq %r14, %rdi
movq 0x70(%rsp), %rsi
callq 0x2243ba
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x224fd4
leaq 0x21d156(%rip), %rsi    # 0x3936d3
movq %r14, %rdi
callq 0x2243ba
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2243ba
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x224fd4
leaq 0x21d13d(%rip), %rsi    # 0x3936e1
movq %r14, %rdi
callq 0x2243ba
movq %r14, %rdi
movq %r15, %rsi
callq 0x2243ba
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x224fd4
leaq 0x21d128(%rip), %rsi    # 0x3936f3
movq %r14, %rdi
callq 0x2243ba
movzbl (%rsp), %esi
movq %r14, %rdi
callq 0x2248a3
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x224fd4
leaq 0x21d10d(%rip), %rsi    # 0x393700
movq %r14, %rdi
callq 0x2243ba
movzbl 0x4(%rsp), %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x2248a3
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x224fd4
leaq 0x21d0f1(%rip), %rsi    # 0x39370f
movq %r14, %rdi
callq 0x2243ba
movq %r14, %rdi
movl %ebx, %esi
callq 0x2248a3
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x224fd4
leaq 0x21d0db(%rip), %rsi    # 0x39371f
movq %r14, %rdi
callq 0x2243ba
movsd 0x40(%r13), %xmm1
unpcklps 0x1d1287(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d128f(%rip), %xmm1   # 0x3478f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x2241c8
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x224fd4
leaq 0x21d0a2(%rip), %rsi    # 0x39372b
movq %r14, %rdi
callq 0x2243ba
movsd 0x38(%r13), %xmm1
unpcklps 0x1d1242(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d124a(%rip), %xmm1   # 0x3478f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x2241c8
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x224fd4
leaq 0x21d06d(%rip), %rsi    # 0x39373b
movq %r14, %rdi
callq 0x2243ba
movsd 0x48(%r13), %xmm1
unpcklps 0x1d11fd(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d1205(%rip), %xmm1   # 0x3478f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x2241c8
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x224fd4
leaq 0x21d036(%rip), %rsi    # 0x393749
movq %r14, %rdi
callq 0x2243ba
movsd 0x30(%r13), %xmm1
unpcklps 0x1d11b8(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d11c0(%rip), %xmm1   # 0x3478f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x2241c8
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x224fd4
leaq 0x1cfbc4(%rip), %rdx    # 0x34631c
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x224f78
leaq 0x36a(%rip), %rsi       # 0x176ad6
movq %r14, %rdi
xorl %edx, %edx
callq 0x2247b8
leaq 0x21cfda(%rip), %rdx    # 0x393757
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x224f78
movq %r14, %rdi
movq %r15, %rsi
callq 0x15c282
movq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x14badb
movq %rax, %rbx
movq %rax, %rdi
callq 0x14bbee
movq %rbx, %rdi
callq 0x14bbfe
movq %r14, %rdi
movq %rbx, %rsi
callq 0x188a02
leaq 0x21cf9f(%rip), %rdx    # 0x393766
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x224f78
leaq 0x343a15(%rip), %rsi    # 0x4ba1f0
movq %r14, %rdi
callq 0x2248bd
movq %r14, %rdi
movq %r13, %rsi
callq 0x2248bd
movq %r14, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x224d62
movq %r14, %rdi
movq %r15, %rsi
callq 0x227ca2
testl %eax, %eax
jne 0x17681c
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x22537b
testl %eax, %eax
je 0x176847
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x223ea8
leaq 0x252271(%rip), %rsi    # 0x3c8aa9
movq 0x78(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfcb67
movq %r14, %rdi
callq 0x226b39
jmp 0x176868
leaq 0x21ce50(%rip), %rsi    # 0x3936a8
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5508a