// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/annotationsketch/style.c
// Function: gt_style_get_bool_with_track
GtStyleQueryStatus gt_style_get_bool_with_track(const GtStyle *sty,
                                                const char *section,
                                                const char *key, bool *val,
                                                GtFeatureNode *gn,
                                                const GtStr *track_id,
                                                GtError *err)
{
#ifndef NDEBUG
  int stack_size;
#endif
  int i = 0;
  gt_assert(sty && key && section);
  gt_error_check(err);
  gt_rwlock_wrlock(sty->lock);
#ifndef NDEBUG
  stack_size = lua_gettop(sty->L);
#endif
  /* get section */
  i = style_find_section_for_getting(sty, section);
  /* could not get section, return default */
  if (i < 0) {
    gt_assert(lua_gettop(sty->L) == stack_size);
    gt_rwlock_unlock(sty->lock);
    return GT_STYLE_QUERY_NOT_SET;
  }
  /* lookup entry for given key */
  lua_getfield(sty->L, -1, key);

  /* execute callback if function is given */
  if (lua_isfunction(sty->L, -1))
  {
    int num_of_args = 0;
    if (gn) {
      GtGenomeNode *gn_lua = gt_genome_node_ref((GtGenomeNode*) gn);
      gt_lua_genome_node_push(sty->L, gn_lua);
      num_of_args++;
      if (track_id) {
        lua_pushstring(sty->L, gt_str_get(track_id));
        num_of_args++;
      }
    }
    if (lua_pcall(sty->L, num_of_args, 1, 0) != 0) {
      gt_error_set(err, "%s", lua_tostring(sty->L, -1));
      lua_pop(sty->L, 3);
      gt_assert(lua_gettop(sty->L) == stack_size);
      gt_rwlock_unlock(sty->lock);
      return GT_STYLE_QUERY_ERROR;
    }
  }

  if (lua_isnil(sty->L, -1) || !lua_isboolean(sty->L, -1)) {
    lua_pop(sty->L, i+1);
    gt_assert(lua_gettop(sty->L) == stack_size);
    gt_rwlock_unlock(sty->lock);
    return GT_STYLE_QUERY_NOT_SET;
  } else i++;

  /* retrieve value */
  *val = lua_toboolean(sty->L, -1);
  /* reset stack to original state for subsequent calls */
  lua_pop(sty->L, i);
  gt_assert(lua_gettop(sty->L) == stack_size);
  gt_rwlock_unlock(sty->lock);
  return GT_STYLE_QUERY_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rsi, %rsi
je 0x34345
movq %rdi, %rbx
testq %rdi, %rdi
je 0x34345
movq %rdx, %rbp
testq %rdx, %rdx
je 0x34345
movq %r9, %r13
movq %r8, %r14
movq %rsi, %r12
movq %rcx, 0x10(%rsp)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x34161
callq 0xc103
testb %al, %al
jne 0x34376
movq 0x10(%rbx), %rdi
callq 0x15e99
movq (%rbx), %rdi
callq 0x377ed
movl %eax, %r15d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x33525
movq (%rbx), %rdi
testl %eax, %eax
js 0x341ec
movl %eax, %r12d
movq %r13, 0x8(%rsp)
pushq $-0x1
popq %r13
movl %r13d, %esi
movq %rbp, %rdx
callq 0x38a63
movq (%rbx), %rdi
movl %r13d, %esi
callq 0x37b59
cmpl $0x6, %eax
jne 0x3428b
testq %r14, %r14
je 0x3422b
movq %r14, %rdi
callq 0x1bec8
movq (%rbx), %rdi
movq %rax, %rsi
callq 0x67934
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3422f
pushq $0x2
popq %rbp
movq (%rbx), %r14
callq 0x143d2
movq %r14, %rdi
movq %rax, %rsi
callq 0x38431
jmp 0x34232
callq 0x377ed
cmpl %r15d, %eax
je 0x34328
movq 0xf9db7(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x95e5b(%rip), %rsi     # 0xca066
leaq 0xa0d59(%rip), %rdx     # 0xd4f6b
leaq 0xa0f4e(%rip), %rcx     # 0xd5167
leaq 0xa0c75(%rip), %r8      # 0xd4e95
movl $0x291, %r9d            # imm = 0x291
jmp 0x343fe
xorl %ebp, %ebp
jmp 0x34232
pushq $0x1
popq %rbp
movq (%rbx), %rdi
pushq $0x1
popq %rdx
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x39305
testl %eax, %eax
je 0x3428b
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
xorl %edx, %edx
callq 0x37f9b
leaq 0xa3850(%rip), %rsi     # 0xd7aa9
movq 0x50(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc007
movq (%rbx), %rdi
pushq $-0x4
popq %rsi
callq 0x377fa
movq (%rbx), %rdi
callq 0x377ed
cmpl %r15d, %eax
jne 0x343d2
pushq $0x2
jmp 0x3432a
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37b59
testl %eax, %eax
je 0x3430d
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37b59
cmpl $0x1, %eax
jne 0x3430d
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37f77
testl %eax, %eax
movq 0x10(%rsp), %rax
setne (%rax)
movq (%rbx), %rdi
pushq $-0x2
popq %rsi
subl %r12d, %esi
callq 0x377fa
movq (%rbx), %rdi
callq 0x377ed
xorl %ebp, %ebp
cmpl %r15d, %eax
je 0x3432b
movq 0xf9cd5(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x95d79(%rip), %rsi     # 0xca066
leaq 0xa0c77(%rip), %rdx     # 0xd4f6b
leaq 0xa0e6c(%rip), %rcx     # 0xd5167
leaq 0xa0b93(%rip), %r8      # 0xd4e95
movl $0x2b9, %r9d            # imm = 0x2B9
jmp 0x343fe
movq (%rbx), %rdi
pushq $-0x2
popq %rsi
subl %r12d, %esi
callq 0x377fa
movq (%rbx), %rdi
callq 0x377ed
cmpl %r15d, %eax
jne 0x343a4
pushq $0x1
popq %rbp
movq 0x10(%rbx), %rdi
callq 0x15f0a
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xf9c6c(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x95d10(%rip), %rsi     # 0xca066
leaq 0xa0d48(%rip), %rdx     # 0xd50a5
leaq 0xa0e03(%rip), %rcx     # 0xd5167
leaq 0xa0b2a(%rip), %r8      # 0xd4e95
movl $0x287, %r9d            # imm = 0x287
jmp 0x343fe
movq 0xf9c3b(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x95cdf(%rip), %rsi     # 0xca066
leaq 0x962cb(%rip), %rdx     # 0xca659
leaq 0xa0dd2(%rip), %rcx     # 0xd5167
leaq 0xa0af9(%rip), %r8      # 0xd4e95
movl $0x288, %r9d            # imm = 0x288
jmp 0x343fe
movq 0xf9c0d(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x95cb1(%rip), %rsi     # 0xca066
leaq 0xa0baf(%rip), %rdx     # 0xd4f6b
leaq 0xa0da4(%rip), %rcx     # 0xd5167
leaq 0xa0acb(%rip), %r8      # 0xd4e95
movl $0x2b0, %r9d            # imm = 0x2B0
jmp 0x343fe
movq 0xf9bdf(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x95c83(%rip), %rsi     # 0xca066
leaq 0xa0b81(%rip), %rdx     # 0xd4f6b
leaq 0xa0d76(%rip), %rcx     # 0xd5167
leaq 0xa0a9d(%rip), %r8      # 0xd4e95
movl $0x2a8, %r9d            # imm = 0x2A8
xorl %eax, %eax
callq 0xb8c0
callq 0xb300