// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/annotationsketch/style.c
// Function: gt_style_get_num_with_track
GtStyleQueryStatus gt_style_get_num_with_track(const GtStyle *sty,
                                               const char *section,
                                               const char *key, double *val,
                                               GtFeatureNode *gn,
                                               const GtStr *track_id,
                                               GtError *err)
{
#ifndef NDEBUG
  int stack_size;
#endif
  int i = 0;
  gt_assert(sty && key && section && val);
  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_isnumber(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_tonumber(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
pushq %rax
movq %r9, (%rsp)
movq %rdx, %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %rcx, %xmm0
movq %rsi, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm0
shufps $0xdd, %xmm2, %xmm0     # xmm0 = xmm0[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1     # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm0, %xmm1
movmskps %xmm1, %eax
testl %eax, %eax
jne 0x545c3
movq %r8, %rbp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x5442b
callq 0x3566a
testb %al, %al
jne 0x545c8
movq 0x10(%rbx), %rdi
callq 0x3d934
movq (%rbx), %rdi
callq 0x578c5
movl %eax, %r13d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x53da2
movq (%rbx), %rdi
testl %eax, %eax
js 0x544b2
movl %eax, %r12d
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r15, %rdx
callq 0x58b98
movq (%rbx), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x57c5c
cmpl $0x6, %eax
jne 0x5452f
testq %rbp, %rbp
je 0x544ca
movq %rbp, %rdi
callq 0x41ca0
movq (%rbx), %rdi
movq %rax, %rsi
callq 0x87acd
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x544ce
movq (%rbx), %r15
callq 0x3c40b
movq %r15, %rdi
movq %rax, %rsi
callq 0x58568
movl $0x2, %esi
jmp 0x544d3
callq 0x578c5
movl $0x1, %ebp
cmpl %r13d, %eax
je 0x545a9
callq 0x183a3
xorl %esi, %esi
jmp 0x544d3
movl $0x1, %esi
movq (%rbx), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x59536
testl %eax, %eax
je 0x5452f
movq (%rbx), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x58042
leaq 0x9a64d(%rip), %rsi     # 0xeeb49
movq 0x40(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3559f
movq (%rbx), %rdi
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x578d2
movq (%rbx), %rdi
callq 0x578c5
movl $0x2, %ebp
cmpl %r13d, %eax
je 0x545a9
callq 0x182f8
movq (%rbx), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x57c5c
testl %eax, %eax
je 0x54587
movq (%rbx), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x57cb2
testl %eax, %eax
je 0x54587
movq (%rbx), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x57fbe
movsd %xmm0, (%r14)
movq (%rbx), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
subl %r12d, %esi
callq 0x578d2
movq (%rbx), %rdi
callq 0x578c5
xorl %ebp, %ebp
cmpl %r13d, %eax
je 0x545a9
callq 0x18331
movq (%rbx), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
subl %r12d, %esi
callq 0x578d2
movq (%rbx), %rdi
callq 0x578c5
movl $0x1, %ebp
cmpl %r13d, %eax
jne 0x545cd
movq 0x10(%rbx), %rdi
callq 0x3d94f
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x18286
callq 0x182bf
callq 0x1836a