// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x68, %rsp
movq 0x70(%rsp), %rax
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq %r8, 0x38(%rsp)
movq %r9, 0x30(%rsp)
movl $0x0, 0x28(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x490a7
cmpq $0x0, 0x48(%rsp)
je 0x490a7
cmpq $0x0, 0x50(%rsp)
jne 0x490df
movq 0x16af2a(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x114fae(%rip), %rsi    # 0x15e066
leaq 0x1201fe(%rip), %rdx    # 0x1692bd
leaq 0x12020d(%rip), %rcx    # 0x1692d3
leaq 0x11ffe0(%rip), %r8     # 0x1690ad
movl $0x1c6, %r9d            # imm = 0x1C6
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x490e1
jmp 0x490e3
cmpq $0x0, 0x70(%rsp)
je 0x49133
movq 0x70(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x490fb
jmp 0x49133
movq 0x16aed6(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x114f5a(%rip), %rsi    # 0x15e066
leaq 0x115535(%rip), %rdx    # 0x15e648
leaq 0x1201b9(%rip), %rcx    # 0x1692d3
leaq 0x11ff8c(%rip), %r8     # 0x1690ad
movl $0x1c7, %r9d            # imm = 0x1C7
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x49135
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1c100
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0x4f0e0
movl %eax, 0x2c(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x48a70
movl %eax, 0x28(%rsp)
cmpl $0x0, 0x28(%rsp)
jge 0x491d8
jmp 0x49170
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0x4f0e0
cmpl 0x2c(%rsp), %eax
je 0x491bb
movq 0x16ae4e(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x114ed2(%rip), %rsi    # 0x15e066
leaq 0x11ffe8(%rip), %rdx    # 0x169183
leaq 0x120131(%rip), %rcx    # 0x1692d3
leaq 0x11ff04(%rip), %r8     # 0x1690ad
movl $0x1d0, %r9d            # imm = 0x1D0
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x491bd
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1c1a0
movl $0x1, 0x64(%rsp)
jmp 0x494b6
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movq 0x48(%rsp), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x51640
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4f800
cmpl $0x6, %eax
jne 0x49352
movl $0x0, 0x24(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x4927f
movq 0x38(%rsp), %rdi
callq 0x25140
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0xaade0
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x4927d
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rdi
callq 0x19940
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x50970
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x4927f
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movl 0x24(%rsp), %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x527f0
cmpl $0x0, %eax
je 0x49350
movq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x50180
movq 0x8(%rsp), %rdi
movq %rax, %rdx
leaq 0x122bde(%rip), %rsi    # 0x16bead
movb $0x0, %al
callq 0xc0d0
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x4f100
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0x4f0e0
cmpl 0x2c(%rsp), %eax
je 0x49333
movq 0x16acd6(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x114d5a(%rip), %rsi    # 0x15e066
leaq 0x11fe70(%rip), %rdx    # 0x169183
leaq 0x11ffb9(%rip), %rcx    # 0x1692d3
leaq 0x11fd8c(%rip), %r8     # 0x1690ad
movl $0x1e8, %r9d            # imm = 0x1E8
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x49335
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1c1a0
movl $0x2, 0x64(%rsp)
jmp 0x494b6
jmp 0x49352
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4f800
cmpl $0x0, %eax
je 0x49384
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4f9e0
cmpl $0x0, %eax
jne 0x49407
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movl 0x28(%rsp), %eax
addl $0x1, %eax
xorl %esi, %esi
subl %eax, %esi
subl $0x1, %esi
callq 0x4f100
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0x4f0e0
cmpl 0x2c(%rsp), %eax
je 0x493ea
movq 0x16ac1f(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x114ca3(%rip), %rsi    # 0x15e066
leaq 0x11fdb9(%rip), %rdx    # 0x169183
leaq 0x11ff02(%rip), %rcx    # 0x1692d3
leaq 0x11fcd5(%rip), %r8     # 0x1690ad
movl $0x1f0, %r9d            # imm = 0x1F0
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x493ec
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1c1a0
movl $0x1, 0x64(%rsp)
jmp 0x494b6
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x50180
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x190b0
movq 0x58(%rsp), %rax
movq (%rax), %rdi
xorl %esi, %esi
subl 0x28(%rsp), %esi
subl $0x1, %esi
callq 0x4f100
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0x4f0e0
cmpl 0x2c(%rsp), %eax
je 0x4949e
movq 0x16ab6b(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x114bef(%rip), %rsi    # 0x15e066
leaq 0x11fd05(%rip), %rdx    # 0x169183
leaq 0x11fe4e(%rip), %rcx    # 0x1692d3
leaq 0x11fc21(%rip), %r8     # 0x1690ad
movl $0x1f8, %r9d            # imm = 0x1F8
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x494a0
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1c1a0
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nop