// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xe8, %rsp
movl %r8d, 0x4c(%rsp)
movq %rcx, %rax
movl 0x4c(%rsp), %ecx
movq %rax, 0x50(%rsp)
movq %rdx, %rax
movq 0x50(%rsp), %rdx
movq %rax, 0x58(%rsp)
movq %rsi, %rax
movq 0x58(%rsp), %rsi
movq %rax, 0x60(%rsp)
movq %rdi, %r8
movq 0x60(%rsp), %rdi
movb %r9b, %al
movq 0xf8(%rsp), %r9
movq 0xf0(%rsp), %r9
movq %r8, 0xd8(%rsp)
movq %rdi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movq %rdx, 0xc0(%rsp)
andb $0x1, %cl
movb %cl, 0xbf(%rsp)
andb $0x1, %al
movb %al, 0xbe(%rsp)
movq $0x0, 0xa8(%rsp)
movl $0x0, 0x7c(%rsp)
cmpq $0x0, 0xd8(%rsp)
je 0x1db0c0
cmpq $0x0, 0xc0(%rsp)
je 0x1db0c0
cmpq $0x0, 0xd0(%rsp)
je 0x1db0c0
cmpq $0x0, 0xf8(%rsp)
jne 0x1db0f8
movq 0x460ed9(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33af42(%rip), %rsi    # 0x516013
leaq 0x38ae9e(%rip), %rdx    # 0x565f76
leaq 0x38aeb9(%rip), %rcx    # 0x565f98
leaq 0x38ada6(%rip), %r8     # 0x565e8c
movl $0x1be, %r9d            # imm = 0x1BE
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1db0fa
callq 0x33bb50
movq %rax, 0xb0(%rsp)
cmpq $0x0, 0xb0(%rsp)
jne 0x1db138
movq 0xf8(%rsp), %rdi
leaq 0x38ae97(%rip), %rsi    # 0x565fb8
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xe4(%rsp) # imm = 0xFFFFFFFF
jmp 0x1db8c7
movq 0xb0(%rsp), %rdi
leaq 0x45b529(%rip), %rsi    # 0x636670
callq 0x1db8e0
movq 0xc8(%rsp), %rax
movq %rax, 0x80(%rsp)
movb 0xbf(%rsp), %al
andb $0x1, %al
movb %al, 0x88(%rsp)
movb 0xbe(%rsp), %al
andb $0x1, %al
movb %al, 0x89(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xb0(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x336790
movq 0xd8(%rsp), %rax
movq (%rax), %rdi
leaq 0x791(%rip), %rsi       # 0x1db950
leaq 0x80(%rsp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0xe1200
movq 0xb0(%rsp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x33bdf9(%rip), %rdx    # 0x516fdd
callq 0x336d90
movq 0xb0(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x336790
movq 0xd8(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x7d3(%rip), %rsi       # 0x1db9e0
leaq 0x80(%rsp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0xe1200
movq 0xb0(%rsp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x374544(%rip), %rdx    # 0x54f776
callq 0x336d90
movq 0xb0(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x336790
movq 0xd8(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x785(%rip), %rsi       # 0x1db9e0
leaq 0x80(%rsp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0xe1200
movq 0xb0(%rsp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x38ad54(%rip), %rdx    # 0x565fd4
callq 0x336d90
movq 0xb0(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x336790
movq 0xd8(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x737(%rip), %rsi       # 0x1db9e0
leaq 0x80(%rsp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0xe1200
movq 0xb0(%rsp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x341344(%rip), %rdx    # 0x51c612
callq 0x336d90
movq 0xb0(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x336790
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rdi
leaq 0x6e9(%rip), %rsi       # 0x1db9e0
leaq 0x80(%rsp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0xe1200
movq 0xb0(%rsp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x38acbe(%rip), %rdx    # 0x565fda
callq 0x336d90
movq 0xb0(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x336790
movq 0xd8(%rsp), %rax
movq 0x50(%rax), %rdi
callq 0x11fcc0
cmpq $0x0, %rax
jbe 0x1db415
movq $0x0, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0xd8(%rsp), %rax
movq 0x50(%rax), %rdi
callq 0x11fcc0
movq %rax, %rcx
movq 0x40(%rsp), %rax
cmpq %rcx, %rax
jae 0x1db413
movq 0xb0(%rsp), %rdi
movq 0x70(%rsp), %rax
incq %rax
movq %rax, %xmm0
movaps 0x33d592(%rip), %xmm1   # 0x518930
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x33d596(%rip), %xmm1   # 0x518940
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0x3354a0
movq 0xb0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xd8(%rsp), %rax
movq 0x50(%rax), %rdi
movq 0x70(%rsp), %rsi
callq 0x11f8c0
movq 0x38(%rsp), %rdi
movq %rax, %rsi
callq 0x335740
movq 0xb0(%rsp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x1db356
jmp 0x1db415
movq 0xb0(%rsp), %rdi
leaq 0x33af80(%rip), %rdx    # 0x5163a4
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x336d90
movq 0xb0(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x336790
movq 0xb0(%rsp), %rdi
leaq 0x3c1e0c(%rip), %rsi    # 0x59d25a
callq 0x335740
movq 0xb0(%rsp), %rdi
movq 0xf0(%rsp), %rsi
callq 0x335740
movq 0xb0(%rsp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
movl %esi, 0xc(%rsp)
callq 0x336e40
movq 0xb0(%rsp), %rdi
leaq 0x38ab56(%rip), %rsi    # 0x565fe3
callq 0x335740
movq 0xb0(%rsp), %rdi
movq 0xc0(%rsp), %rsi
callq 0x335740
movl 0xc(%rsp), %esi
movq 0xb0(%rsp), %rdi
callq 0x336e40
movq 0xb0(%rsp), %rdi
leaq 0x38ab2a(%rip), %rsi    # 0x565ff1
callq 0x335740
movq 0xb0(%rsp), %rdi
movq 0xd0(%rsp), %rsi
callq 0x335740
movl 0xc(%rsp), %esi
movq 0xb0(%rsp), %rdi
callq 0x336e40
movq 0xb0(%rsp), %rdi
leaq 0x38ab02(%rip), %rsi    # 0x566003
callq 0x335740
movq 0xb0(%rsp), %rdi
movzbl 0xbf(%rsp), %esi
andl $0x1, %esi
callq 0x336110
movl 0xc(%rsp), %esi
movq 0xb0(%rsp), %rdi
callq 0x336e40
movq 0xb0(%rsp), %rdi
leaq 0x38aad2(%rip), %rsi    # 0x566010
callq 0x335740
movq 0xb0(%rsp), %rdi
movzbl 0xbe(%rsp), %esi
andl $0x1, %esi
callq 0x336110
movl 0xc(%rsp), %esi
movq 0xb0(%rsp), %rdi
callq 0x336e40
movq 0xb0(%rsp), %rdi
leaq 0x38aaa4(%rip), %rsi    # 0x56601f
callq 0x335740
movq 0xb0(%rsp), %rdi
movzbl 0xbe(%rsp), %esi
andl $0x1, %esi
callq 0x336110
movl 0xc(%rsp), %esi
movq 0xb0(%rsp), %rdi
callq 0x336e40
movq 0xb0(%rsp), %rdi
leaq 0x38aa77(%rip), %rsi    # 0x56602f
callq 0x335740
movq 0xb0(%rsp), %rdi
movq 0xd8(%rsp), %rax
movq 0x40(%rax), %xmm0
movaps 0x33d357(%rip), %xmm1   # 0x518930
movaps %xmm1, 0x10(%rsp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x33d356(%rip), %xmm1   # 0x518940
movaps %xmm1, 0x20(%rsp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0x3354a0
movl 0xc(%rsp), %esi
movq 0xb0(%rsp), %rdi
callq 0x336e40
movq 0xb0(%rsp), %rdi
leaq 0x38aa18(%rip), %rsi    # 0x56603b
callq 0x335740
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm1
movq 0xb0(%rsp), %rdi
movq 0xd8(%rsp), %rax
movq 0x38(%rax), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0x3354a0
movl 0xc(%rsp), %esi
movq 0xb0(%rsp), %rdi
callq 0x336e40
movq 0xb0(%rsp), %rdi
leaq 0x38a9cc(%rip), %rsi    # 0x56604b
callq 0x335740
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm1
movq 0xb0(%rsp), %rdi
movq 0xd8(%rsp), %rax
movq 0x48(%rax), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0x3354a0
movl 0xc(%rsp), %esi
movq 0xb0(%rsp), %rdi
callq 0x336e40
movq 0xb0(%rsp), %rdi
leaq 0x38a97e(%rip), %rsi    # 0x566059
callq 0x335740
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm1
movq 0xb0(%rsp), %rdi
movq 0xd8(%rsp), %rax
movq 0x30(%rax), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0x3354a0
movq 0xb0(%rsp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0xb0(%rsp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x33bbf7(%rip), %rdx    # 0x517334
callq 0x336d90
movq 0xb0(%rsp), %rdi
leaq 0x6af(%rip), %rsi       # 0x1dbe00
xorl %edx, %edx
callq 0x335ef0
movq 0xb0(%rsp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x38a8fb(%rip), %rdx    # 0x566067
callq 0x336d90
movq 0xb0(%rsp), %rdi
movq 0xd0(%rsp), %rsi
callq 0x1a4050
movq 0xc8(%rsp), %rdi
callq 0x180280
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x180420
movq 0xa8(%rsp), %rdi
callq 0x180470
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x1fef60
movq 0xb0(%rsp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x38a898(%rip), %rdx    # 0x566076
callq 0x336d90
movq 0xb0(%rsp), %rdi
leaq 0x4622c6(%rip), %rsi    # 0x63dab8
callq 0x336160
movq 0xb0(%rsp), %rdi
movq 0xc8(%rsp), %rsi
callq 0x336160
movq 0xb0(%rsp), %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x336ae0
movq 0xb0(%rsp), %rdi
movq 0xd0(%rsp), %rsi
callq 0x33b630
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, 0x37(%rsp)
jne 0x1db85d
movq 0xb0(%rsp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x3375c0
cmpl $0x0, %eax
setne %al
movb %al, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x7c(%rsp)
cmpl $0x0, 0x7c(%rsp)
je 0x1db8af
movq 0xb0(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x334f50
movq %rax, 0x68(%rsp)
movq 0xf8(%rsp), %rdi
movq 0x68(%rsp), %rdx
leaq 0x3c0781(%rip), %rsi    # 0x59c021
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x7c(%rsp) # imm = 0xFFFFFFFF
movq 0xb0(%rsp), %rdi
callq 0x339e40
movl 0x7c(%rsp), %eax
movl %eax, 0xe4(%rsp)
movl 0xe4(%rsp), %eax
addq $0xe8, %rsp
retq
nopw %cs:(%rax,%rax)