// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movl %r9d, 0xc(%rsp)
movl %r8d, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x88(%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 0x11b289
movq %rcx, %rbp
movq %rsi, %r15
movq %rdi, %r13
callq 0x1df5e2
testq %rax, %rax
je 0x11b262
movq %rax, %r14
movq %r15, 0x18(%rsp)
leaq 0x318164(%rip), %r12    # 0x432ed8
pushq $0x1
popq %rbx
movq (%r12), %rsi
testq %rsi, %rsi
je 0x11ada9
movq %r14, %rdi
xorl %edx, %edx
callq 0x1dc3ec
movq -0x8(%r12), %rsi
movq %r14, %rdi
callq 0x1dc009
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x1dce3a
addq $0x10, %r12
jmp 0x11ad77
leaq 0x20(%rsp), %rbx
movq 0x10(%rsp), %rax
movq %rax, (%rbx)
movl 0x8(%rsp), %eax
movb %al, 0x8(%rbx)
movl 0xc(%rsp), %eax
movb %al, 0x9(%rbx)
movq %r14, 0x18(%rbx)
movq %r13, 0x20(%rbx)
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1dc7bd
movq (%r13), %rdi
leaq 0x4de(%rip), %rsi       # 0x11b2c1
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x8f595
leaq 0x1cb1d0(%rip), %rdx    # 0x2e5fc4
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x1dcb19
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1dc7bd
movq 0x10(%r13), %rdi
leaq 0x4f6(%rip), %r12       # 0x11b30e
movq %r12, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x8f595
leaq 0x2027aa(%rip), %rdx    # 0x31d5d6
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x1dcb19
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1dc7bd
movq 0x8(%r13), %rdi
movq %r12, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x8f595
leaq 0x218bc0(%rip), %rdx    # 0x333a1d
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x1dcb19
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1dc7bd
movq 0x20(%r13), %rdi
movq %r12, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x8f595
leaq 0x1d073d(%rip), %rdx    # 0x2eb5cb
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x1dcb19
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1dc7bd
movq 0x18(%r13), %rdi
movq %r12, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x8f595
leaq 0x218b64(%rip), %rdx    # 0x333a23
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x1dcb19
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1dc7bd
movq 0x50(%r13), %rdi
callq 0xae61c
testq %rax, %rax
je 0x11af4e
xorl %r12d, %r12d
pushq $-0x3
popq %rbx
movq 0x50(%r13), %rdi
callq 0xae61c
cmpq %rax, %r12
jae 0x11af4e
leaq 0x1(%r12), %r15
movq %r15, %xmm1
punpckldq 0x1cc9d4(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1cc9dc(%rip), %xmm1   # 0x2e78f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x1dbe33
movq 0x50(%r13), %rdi
movq %r12, %rsi
callq 0xae386
movq %r14, %rdi
movq %rax, %rsi
callq 0x1dc009
movq %r14, %rdi
movl %ebx, %esi
callq 0x1dcb75
movq %r15, %r12
jmp 0x11aeec
leaq 0x1ca439(%rip), %rdx    # 0x2e538e
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x1dcb19
xorl %r12d, %r12d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1dc7bd
leaq 0x24f1ca(%rip), %rsi    # 0x36a142
movq %r14, %rdi
callq 0x1dc009
movq %r14, %rdi
movq 0x80(%rsp), %rsi
callq 0x1dc009
pushq $-0x3
popq %rbx
movq %r14, %rdi
movl %ebx, %esi
callq 0x1dcb75
leaq 0x218a88(%rip), %rsi    # 0x333a2c
movq %r14, %rdi
callq 0x1dc009
movq %r14, %rdi
movq %rbp, %rsi
callq 0x1dc009
movq %r14, %rdi
movl %ebx, %esi
callq 0x1dcb75
leaq 0x218a72(%rip), %rsi    # 0x333a3a
movq %r14, %rdi
callq 0x1dc009
movq %r14, %rdi
movq 0x18(%rsp), %r15
movq %r15, %rsi
callq 0x1dc009
movq %r14, %rdi
movl %ebx, %esi
callq 0x1dcb75
leaq 0x218a5b(%rip), %rsi    # 0x333a4c
movq %r14, %rdi
callq 0x1dc009
movzbl 0x8(%rsp), %esi
movq %r14, %rdi
callq 0x1dc4d2
movq %r14, %rdi
movl %ebx, %esi
callq 0x1dcb75
leaq 0x218a42(%rip), %rsi    # 0x333a59
movq %r14, %rdi
callq 0x1dc009
movzbl 0xc(%rsp), %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x1dc4d2
movq %r14, %rdi
movl %ebx, %esi
callq 0x1dcb75
leaq 0x218a29(%rip), %rsi    # 0x333a68
movq %r14, %rdi
callq 0x1dc009
movq %r14, %rdi
movl %ebp, %esi
callq 0x1dc4d2
movq %r14, %rdi
movl %ebx, %esi
callq 0x1dcb75
leaq 0x218a16(%rip), %rsi    # 0x333a78
movq %r14, %rdi
callq 0x1dc009
movsd 0x40(%r13), %xmm1
unpcklps 0x1cc869(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1cc871(%rip), %xmm1   # 0x2e78f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x1dbe33
movq %r14, %rdi
movl %ebx, %esi
callq 0x1dcb75
leaq 0x2189e0(%rip), %rsi    # 0x333a84
movq %r14, %rdi
callq 0x1dc009
movsd 0x38(%r13), %xmm1
unpcklps 0x1cc827(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1cc82f(%rip), %xmm1   # 0x2e78f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x1dbe33
movq %r14, %rdi
movl %ebx, %esi
callq 0x1dcb75
leaq 0x2189ae(%rip), %rsi    # 0x333a94
movq %r14, %rdi
callq 0x1dc009
movsd 0x48(%r13), %xmm1
unpcklps 0x1cc7e5(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1cc7ed(%rip), %xmm1   # 0x2e78f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x1dbe33
movq %r14, %rdi
movl %ebx, %esi
callq 0x1dcb75
leaq 0x21897a(%rip), %rsi    # 0x333aa2
movq %r14, %rdi
callq 0x1dc009
movsd 0x30(%r13), %xmm1
unpcklps 0x1cc7a3(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1cc7ab(%rip), %xmm1   # 0x2e78f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x1dbe33
movq %r14, %rdi
movl %ebx, %esi
callq 0x1dcb75
leaq 0x1cb1b2(%rip), %rdx    # 0x2e631c
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x1dcb19
leaq 0x441(%rip), %rsi       # 0x11b5bf
movq %r14, %rdi
xorl %edx, %edx
callq 0x1dc3ec
leaq 0x218921(%rip), %rdx    # 0x333ab0
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x1dcb19
movq %r14, %rdi
movq %r15, %rsi
callq 0xf9f52
movq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0xe64a1
movq %rax, %rbx
movq %rax, %rdi
callq 0xe65ab
movq %rbx, %rdi
callq 0xe65ee
movq %r14, %rdi
movq %rbx, %rsi
callq 0x131308
leaq 0x2188e6(%rip), %rdx    # 0x333abf
movq %r14, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x1dcb19
leaq 0x31dfb3(%rip), %rsi    # 0x4391a0
movq %r14, %rdi
callq 0x1dc4ec
movq %r14, %rdi
movq %r13, %rsi
callq 0x1dc4ec
movq %r14, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x1dc936
movq %r14, %rdi
movq %r15, %rsi
callq 0x1df308
testl %eax, %eax
jne 0x11b22e
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1dcedd
testl %eax, %eax
je 0x11b258
pushq $-0x1
popq %r12
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x1dbb73
leaq 0x24dc63(%rip), %rsi    # 0x368ea9
movq 0x88(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x89dbb
movq %r14, %rdi
callq 0x1de4cb
jmp 0x11b277
leaq 0x218798(%rip), %rsi    # 0x333a01
movq %rbx, %rdi
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r12
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x31ccd8(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1c9d79(%rip), %rsi    # 0x2e5013
leaq 0x21871e(%rip), %rdx    # 0x3339bf
leaq 0x218739(%rip), %rcx    # 0x3339e1
leaq 0x218626(%rip), %r8     # 0x3338d5
movl $0x1be, %r9d            # imm = 0x1BE
xorl %eax, %eax
callq 0x17a50
callq 0x17390