// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/gtlua/diagram_lua.c
// Function: diagram_lua_new_from_array
static int diagram_lua_new_from_array(lua_State *L)
{
  GtDiagram **diagram;
  GtArray *nodes;
  GtRange range;
  GtStyle *style;
  /* get array */
  nodes = genome_node_table_to_array(L);
  /* get range */
  range.start = luaL_checklong(L, 2);
  range.end   = luaL_checklong(L, 3);
  luaL_argcheck(L, range.start > 0, 2, "must be > 0");
  luaL_argcheck(L, range.end > 0, 3, "must be > 0");
  luaL_argcheck(L, range.start <= range.end, 2, "must be <= endpos");
  /* create diagram */
  style = gt_lua_get_style_from_registry(L);
  diagram = lua_newuserdata(L, sizeof (GtDiagram*));
  gt_assert(diagram);
  *diagram = gt_diagram_new_from_array(nodes, &range, style);
  gt_array_delete(nodes);
  luaL_getmetatable(L, DIAGRAM_METATABLE);
  lua_setmetatable(L, -2);
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
pushq $0x1
popq %rsi
pushq $0x5
popq %rdx
callq 0x3af12
pushq $0x8
popq %rdi
callq 0x4b380
movq %rax, %r14
pushq $0x1
popq %r12
pushq $-0x1
popq %r13
pushq $-0x2
popq %rbp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x38270
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0x3894c
movq %rbx, %rdi
movl %r13d, %esi
callq 0x37b59
testl %eax, %eax
je 0x90b9c
movq %rbx, %rdi
movl %r13d, %esi
callq 0x381c6
testq %rax, %rax
je 0x90b5f
movq %rax, %r15
movq %rbx, %rdi
movl %r13d, %esi
callq 0x38cb7
testl %eax, %eax
je 0x90b5f
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
leaq 0x4dc59(%rip), %rdx     # 0xde787
callq 0x38a63
movq %rbx, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0x37c5c
testl %eax, %eax
je 0x90b5f
movq %rbx, %rdi
pushq $-0x3
popq %rsi
callq 0x377fa
movq %r14, %rdi
movq %r15, %rsi
pushq $0x8
popq %rdx
callq 0x4b801
jmp 0x90b8a
movq %rbx, %rdi
leaq 0x4e120(%rip), %rsi     # 0xdec89
leaq 0x4dc17(%rip), %rdx     # 0xde787
movq %r12, %rcx
xorl %eax, %eax
callq 0x38764
movq %r14, %rdi
callq 0x4c19d
movq %rbx, %rdi
callq 0x3972e
incq %r12
movq %rbx, %rdi
movl %ebp, %esi
callq 0x377fa
jmp 0x90ad4
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x3b001
movq %rax, %r15
movq %rax, 0x8(%rsp)
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x3b001
movq %rax, %r12
movq %rax, 0x10(%rsp)
testq %r15, %r15
jne 0x90bd9
leaq 0x4df08(%rip), %rdx     # 0xdead6
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x3ab1c
testq %r12, %r12
jne 0x90bf0
leaq 0x4def1(%rip), %rdx     # 0xdead6
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x3ab1c
cmpq %r12, %r15
jbe 0x90c07
leaq 0x4dee6(%rip), %rdx     # 0xdeae2
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x3ab1c
movq %rbx, %rdi
callq 0x9590b
movq %rax, %r15
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x39c01
testq %rax, %rax
je 0x90c72
movq %rax, %r12
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x2a8e3
movq %rax, (%r12)
movq %r14, %rdi
callq 0x4c19d
leaq 0x55c6b(%rip), %rdx     # 0xe68b3
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x38a63
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x3914f
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9d33f(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x393e3(%rip), %rsi     # 0xca066
leaq 0x55c35(%rip), %rdx     # 0xe68bf
leaq 0x55c60(%rip), %rcx     # 0xe68f1
leaq 0x55c03(%rip), %r8      # 0xe689b
movl $0x80, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
nop