// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/gtlua/diagram_lua.c
// Function: diagram_lua_new
static int diagram_lua_new(lua_State *L)
{
  GtDiagram **diagram;
  GtFeatureIndex **feature_index;
  GtRange *range;
  GtError *err;
  const char *seqid;
  GtStyle *style;
  bool has_seqid;
  /* get feature index */
  feature_index = check_feature_index(L, 1);
  /* get seqid */
  seqid = luaL_checkstring(L, 2);
  err = gt_error_new();
  if (gt_feature_index_has_seqid(*feature_index, &has_seqid, seqid, err))
    return gt_lua_error(L, err);
  gt_error_delete(err);
  luaL_argcheck(L, has_seqid,
                2, "feature index does not contain the given sequence id");
  /* get range */
  range = check_range(L, 3);
  /* create diagram */
  style = gt_lua_get_style_from_registry(L);
  diagram = lua_newuserdata(L, sizeof (GtDiagram*));
  gt_assert(diagram);
  err = gt_error_new();
  *diagram = gt_diagram_new(*feature_index, seqid, range, style, err);
  if (gt_error_is_set(err))
    return gt_lua_error(L, err);
  gt_error_delete(err);
  luaL_getmetatable(L, DIAGRAM_METATABLE);
  lua_setmetatable(L, -2);
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x86f13(%rip), %rdx     # 0x17ba7d
callq 0x559c0
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x558e0
movq %rax, 0x10(%rsp)
callq 0xc0b0
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
leaq 0x7(%rsp), %rsi
callq 0x1ddb0
cmpl $0x0, %eax
je 0xf4bcf
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xe84e0
movl %eax, 0x44(%rsp)
jmp 0xf4d1c
movq 0x18(%rsp), %rdi
callq 0xc490
movb $0x1, %al
testb $0x1, 0x7(%rsp)
movb %al, 0x6(%rsp)
jne 0xf4c06
movq 0x38(%rsp), %rdi
movl $0x2, %esi
leaq 0x6cd64(%rip), %rdx     # 0x16195b
callq 0x55420
cmpl $0x0, %eax
setne %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
movq 0x38(%rsp), %rdi
movl $0x3, %esi
leaq 0x7eb16(%rip), %rdx     # 0x173731
callq 0x559c0
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rdi
callq 0xfbfa0
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
movl $0x8, %esi
callq 0x53950
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0xf4c88
movq 0xbf381(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x69405(%rip), %rsi     # 0x15e066
leaq 0x86e0d(%rip), %rdx     # 0x17ba75
leaq 0x86e28(%rip), %rcx     # 0x17ba97
leaq 0x86ddb(%rip), %r8      # 0x17ba51
movl $0x3a, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xf4c8a
callq 0xc0b0
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq 0x10(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %r8
callq 0x3b4e0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0xf4cd0
jmp 0xf4ce5
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xe84e0
movl %eax, 0x44(%rsp)
jmp 0xf4d1c
movq 0x18(%rsp), %rdi
callq 0xc490
movq 0x38(%rsp), %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
leaq 0x86d69(%rip), %rdx     # 0x17ba69
callq 0x51640
movq 0x38(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x523f0
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)