// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %esi
movl $0x5, %edx
callq 0x5a731
movl $0x8, %edi
callq 0x6ef7c
movq %rax, %r14
movl $0x1, %r15d
movl $0x1, %esi
movq %rbx, %rdi
callq 0x5772d
movq %rbx, %rdi
movl $0x1, %esi
callq 0x57e45
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x56f9b
testl %eax, %eax
je 0xadf21
leaq 0x47ada(%rip), %r12     # 0xf5929
leaq 0x475d1(%rip), %r13     # 0xf5427
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x57668
testq %rax, %rax
je 0xadec1
movq %rax, %rbp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x58207
testl %eax, %eax
je 0xadec1
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
movq %r13, %rdx
callq 0x57f56
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x570ae
testl %eax, %eax
je 0xadec1
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x56b09
movl $0x8, %edx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x6f240
jmp 0xadee4
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x57c58
movq %r14, %rdi
callq 0x6f768
movq %rbx, %rdi
callq 0x58d50
incq %r15
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x56b09
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5772d
movq %rbx, %rdi
movl $0x1, %esi
callq 0x57e45
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x56f9b
testl %eax, %eax
jne 0xade56
movq %rbx, %rdi
movl $0x2, %esi
callq 0x5a844
movq %rax, %r15
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movl $0x3, %esi
callq 0x5a844
movq %rax, %r12
movq %rax, 0x10(%rsp)
testq %r15, %r15
jne 0xadf64
leaq 0x4781f(%rip), %rdx     # 0xf5776
movq %rbx, %rdi
movl $0x2, %esi
callq 0x5a2e1
testq %r12, %r12
jne 0xadf7d
leaq 0x47806(%rip), %rdx     # 0xf5776
movq %rbx, %rdi
movl $0x3, %esi
callq 0x5a2e1
cmpq %r12, %r15
jbe 0xadf96
leaq 0x477f9(%rip), %rdx     # 0xf5782
movq %rbx, %rdi
movl $0x2, %esi
callq 0x5a2e1
movq %rbx, %rdi
callq 0xb1c05
movq %rax, %r15
movl $0x8, %esi
movq %rbx, %rdi
callq 0x5924a
testq %rax, %rax
je 0xae007
movq %rax, %r12
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x4c433
movq %rax, (%r12)
movq %r14, %rdi
callq 0x6f768
leaq 0x4f5d4(%rip), %rdx     # 0xfd5ad
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x57f56
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x586d6
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x261e9