// File: /workspace/github_c_makefile_star2_O1/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 0x5b30c
movl $0x8, %edi
callq 0x6e93c
movq %rax, %r14
movl $0x1, %r15d
movl $0x1, %esi
movq %rbx, %rdi
callq 0x58377
movq %rbx, %rdi
movl $0x1, %esi
callq 0x58a66
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x57c5c
testl %eax, %eax
je 0xaea5d
leaq 0x46ffe(%rip), %r12     # 0xf5989
leaq 0x46af5(%rip), %r13     # 0xf5487
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x582b2
testq %rax, %rax
je 0xae9fd
movq %rax, %rbp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x58e77
testl %eax, %eax
je 0xae9fd
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
movq %r13, %rdx
callq 0x58b98
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x57d6f
testl %eax, %eax
je 0xae9fd
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x578d2
movl $0x8, %edx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x6ec0e
jmp 0xaea20
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x58880
movq %r14, %rdi
callq 0x6f134
movq %rbx, %rdi
callq 0x5999c
incq %r15
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x578d2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x58377
movq %rbx, %rdi
movl $0x1, %esi
callq 0x58a66
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x57c5c
testl %eax, %eax
jne 0xae992
movq %rbx, %rdi
movl $0x2, %esi
callq 0x5b41f
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movl $0x3, %esi
callq 0x5b41f
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0xaea9d
leaq 0x46d46(%rip), %rdx     # 0xf57d6
movq %rbx, %rdi
movl $0x2, %esi
callq 0x5aeac
cmpq $0x0, 0x10(%rsp)
jne 0xaeab9
leaq 0x46d2a(%rip), %rdx     # 0xf57d6
movq %rbx, %rdi
movl $0x3, %esi
callq 0x5aeac
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
jbe 0xaead9
leaq 0x46d16(%rip), %rdx     # 0xf57e2
movq %rbx, %rdi
movl $0x2, %esi
callq 0x5aeac
movq %rbx, %rdi
callq 0xb273d
movq %rax, %r15
movl $0x8, %esi
movq %rbx, %rdi
callq 0x59e95
testq %rax, %rax
je 0xaeb4a
movq %rax, %r12
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x4d0c3
movq %rax, (%r12)
movq %r14, %rdi
callq 0x6f134
leaq 0x4eafb(%rip), %rdx     # 0xfd617
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x58b98
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x59337
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x26339
nop