// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/annotationsketch/style.c
// Function: gt_style_load_file
int gt_style_load_file(GtStyle *sty, const char *filename, GtError *err)
{
#ifndef NDEBUG
  int stack_size;
#endif
  int had_err = 0;
  gt_error_check(err);
  gt_rwlock_wrlock(sty->lock);
  gt_assert(sty && sty->L && filename);
#ifndef NDEBUG
  stack_size = lua_gettop(sty->L);
#endif
  gt_rwlock_unlock(sty->lock);
  gt_rwlock_wrlock(sty->lock);
  sty->filename = gt_cstr_dup(filename);
  gt_log_log("Trying to load style file: %s...", filename);
  if (luaL_loadfile(sty->L, filename) || lua_pcall(sty->L, 0, 0, 0)) {
    gt_error_set(err, "cannot run style file: %s", lua_tostring(sty->L, -1));
    had_err = -1;
    lua_pop(sty->L, 1);
  }
  if (!had_err) {
    lua_getglobal(sty->L, "style");
    if (lua_isnil(sty->L, -1) || !lua_istable(sty->L, -1)) {
      gt_error_set(err, "'style' is not defined or is not a table in \"%s\"",
                   filename);
      had_err = -1;
    }
    lua_pop(sty->L, 1);
  }
  gt_assert(lua_gettop(sty->L) == stack_size);
  gt_rwlock_unlock(sty->lock);
  return had_err;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl $0x0, 0x8(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x4813b
movq 0x10(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x48103
jmp 0x4813b
movq 0x16bece(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x115f52(%rip), %rsi    # 0x15e066
leaq 0x11652d(%rip), %rdx    # 0x15e648
leaq 0x121082(%rip), %rcx    # 0x1691a4
leaq 0x120f84(%rip), %r8     # 0x1690ad
movl $0xe7, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x4813d
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1c100
cmpq $0x0, 0x20(%rsp)
je 0x48166
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0x48166
cmpq $0x0, 0x18(%rsp)
jne 0x4819e
movq 0x16be6b(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x115eef(%rip), %rsi    # 0x15e066
leaq 0x121039(%rip), %rdx    # 0x1691b7
leaq 0x12101f(%rip), %rcx    # 0x1691a4
leaq 0x120f21(%rip), %r8     # 0x1690ad
movl $0xe9, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x481a0
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0x4f0e0
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1c1a0
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1c100
movq 0x18(%rsp), %rdi
callq 0x7c400
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x18(%rsp), %rsi
leaq 0x120fe2(%rip), %rdi    # 0x1691d1
movb $0x0, %al
callq 0xc930
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0x56860
cmpl $0x0, %eax
jne 0x48225
movq 0x20(%rsp), %rax
movq (%rax), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x527f0
cmpl $0x0, %eax
je 0x48273
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x50180
movq (%rsp), %rdi
movq %rax, %rdx
leaq 0x120fa0(%rip), %rsi    # 0x1691f2
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4f100
cmpl $0x0, 0x8(%rsp)
jne 0x482f3
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x134871(%rip), %rdx    # 0x17caff
callq 0x51640
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4f800
cmpl $0x0, %eax
je 0x482c1
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4f800
cmpl $0x5, %eax
je 0x482e1
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
leaq 0x120f3a(%rip), %rsi    # 0x16920c
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4f100
jmp 0x482f5
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0x4f0e0
cmpl 0xc(%rsp), %eax
je 0x48340
movq 0x16bcc9(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x115d4d(%rip), %rsi    # 0x15e066
leaq 0x120e63(%rip), %rdx    # 0x169183
leaq 0x120e7d(%rip), %rcx    # 0x1691a4
leaq 0x120d7f(%rip), %r8     # 0x1690ad
movl $0xff, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x48342
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1c1a0
movl 0x8(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)