// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/annotationsketch/style.c
// Function: gt_style_get_str_with_track
GtStyleQueryStatus gt_style_get_str_with_track(const GtStyle *sty,
                                               const char *section,
                                               const char *key, GtStr *text,
                                               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_isstring(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 string */
  gt_str_set(text, lua_tostring(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 0x33ad3
movq %rdi, %rbx
testq %rdi, %rdi
je 0x33ad3
movq %rdx, %rbp
testq %rdx, %rdx
je 0x33ad3
movq %r9, %r13
movq %r8, %r14
movq %rsi, %r15
movq %rcx, 0x10(%rsp)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x338e8
callq 0xc103
testb %al, %al
jne 0x33b04
movq 0x10(%rbx), %rdi
callq 0x15e99
movq (%rbx), %rdi
callq 0x377ed
movl %eax, %r12d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x33525
movq (%rbx), %rdi
testl %eax, %eax
js 0x33973
movl %eax, %r15d
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 0x33a12
testq %r14, %r14
je 0x339b2
movq %r14, %rdi
callq 0x1bec8
movq (%rbx), %rdi
movq %rax, %rsi
callq 0x67934
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x339b6
pushq $0x2
popq %rbp
movq (%rbx), %r14
callq 0x143d2
movq %r14, %rdi
movq %rax, %rsi
callq 0x38431
jmp 0x339b9
callq 0x377ed
cmpl %r12d, %eax
je 0x33ab4
movq 0xfa630(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x966d4(%rip), %rsi     # 0xca066
leaq 0xa15d2(%rip), %rdx     # 0xd4f6b
leaq 0xa171b(%rip), %rcx     # 0xd50bb
leaq 0xa14ee(%rip), %r8      # 0xd4e95
movl $0x1d0, %r9d            # imm = 0x1D0
jmp 0x33b8c
xorl %ebp, %ebp
jmp 0x339b9
pushq $0x1
popq %rbp
movq (%rbx), %rdi
pushq $0x1
popq %rdx
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x39305
testl %eax, %eax
je 0x33a12
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
xorl %edx, %edx
callq 0x37f9b
leaq 0xa40c9(%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 %r12d, %eax
jne 0x33b60
pushq $0x2
jmp 0x33ab6
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37b59
testl %eax, %eax
je 0x33a99
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37c2b
testl %eax, %eax
je 0x33a99
movq (%rbx), %rdi
xorl %r14d, %r14d
pushq $-0x1
popq %rsi
xorl %edx, %edx
callq 0x37f9b
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x13e63
movq (%rbx), %rdi
pushq $-0x2
popq %rsi
subl %r15d, %esi
callq 0x377fa
movq (%rbx), %rdi
callq 0x377ed
cmpl %r12d, %eax
je 0x33ab8
movq 0xfa549(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x965ed(%rip), %rsi     # 0xca066
leaq 0xa14eb(%rip), %rdx     # 0xd4f6b
leaq 0xa1634(%rip), %rcx     # 0xd50bb
leaq 0xa1407(%rip), %r8      # 0xd4e95
movl $0x1f8, %r9d            # imm = 0x1F8
jmp 0x33b8c
movq (%rbx), %rdi
pushq $-0x2
popq %rsi
subl %r15d, %esi
callq 0x377fa
movq (%rbx), %rdi
callq 0x377ed
cmpl %r12d, %eax
jne 0x33b32
pushq $0x1
popq %r14
movq 0x10(%rbx), %rdi
callq 0x15f0a
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xfa4de(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x96582(%rip), %rsi     # 0xca066
leaq 0xa15ba(%rip), %rdx     # 0xd50a5
leaq 0xa15c9(%rip), %rcx     # 0xd50bb
leaq 0xa139c(%rip), %r8      # 0xd4e95
movl $0x1c6, %r9d            # imm = 0x1C6
jmp 0x33b8c
movq 0xfa4ad(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x96551(%rip), %rsi     # 0xca066
leaq 0x96b3d(%rip), %rdx     # 0xca659
leaq 0xa1598(%rip), %rcx     # 0xd50bb
leaq 0xa136b(%rip), %r8      # 0xd4e95
movl $0x1c7, %r9d            # imm = 0x1C7
jmp 0x33b8c
movq 0xfa47f(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x96523(%rip), %rsi     # 0xca066
leaq 0xa1421(%rip), %rdx     # 0xd4f6b
leaq 0xa156a(%rip), %rcx     # 0xd50bb
leaq 0xa133d(%rip), %r8      # 0xd4e95
movl $0x1f0, %r9d            # imm = 0x1F0
jmp 0x33b8c
movq 0xfa451(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x964f5(%rip), %rsi     # 0xca066
leaq 0xa13f3(%rip), %rdx     # 0xd4f6b
leaq 0xa153c(%rip), %rcx     # 0xd50bb
leaq 0xa130f(%rip), %r8      # 0xd4e95
movl $0x1e8, %r9d            # imm = 0x1E8
xorl %eax, %eax
callq 0xb8c0
callq 0xb300