// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/annotationsketch/style.c
// Function: gt_style_get_color_with_track
GtStyleQueryStatus gt_style_get_color_with_track(const GtStyle *sty,
                                                 const char *section,
                                                 const char *key,
                                                 GtColor *color,
                                                 GtFeatureNode *gn,
                                                 const GtStr *track_id,
                                                 GtError *err)
{
#ifndef NDEBUG
  int stack_size;
#endif
  int i = 0;
  gt_assert(sty && section && key && color);
  gt_error_check(err);
  gt_rwlock_wrlock(sty->lock);
#ifndef NDEBUG
  stack_size = lua_gettop(sty->L);
#endif
  /* set default colors */
  color->red = 0.5; color->green = 0.5; color->blue = 0.5; color->alpha = 0.5;
  /* 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 color entry for given feature */
  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_istable(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_NOT_SET;
  } else i++;
  /* update color struct */
  lua_getfield(sty->L, -1, "red");
  if (!lua_isnil(sty->L, -1) && lua_isnumber(sty->L, -1))
    color->red = lua_tonumber(sty->L,-1);
  lua_pop(sty->L, 1);
  lua_getfield(sty->L, -1, "green");
  if (!lua_isnil(sty->L, -1) && lua_isnumber(sty->L, -1))
    color->green = lua_tonumber(sty->L,-1);
  lua_pop(sty->L, 1);
  lua_getfield(sty->L, -1, "blue");
  if (!lua_isnil(sty->L, -1) && lua_isnumber(sty->L, -1))
    color->blue = lua_tonumber(sty->L,-1);
  lua_pop(sty->L, 1);
  lua_getfield(sty->L, -1, "alpha");
  if (!lua_isnil(sty->L, -1) && lua_isnumber(sty->L, -1))
    color->alpha = lua_tonumber(sty->L,-1);
  lua_pop(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
movq %r9, 0x10(%rsp)
movq %rsi, %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %rcx, %xmm0
movq %rdx, %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 0x33460
movq %r8, %rbp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x33149
callq 0xc103
testb %al, %al
jne 0x33491
movq 0x10(%rbx), %rdi
callq 0x15e99
movq (%rbx), %rdi
callq 0x377ed
movl %eax, %r13d
movaps 0xa1cbc(%rip), %xmm0    # 0xd4e20
movups %xmm0, (%r14)
movups %xmm0, 0x10(%r14)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x33525
movq (%rbx), %rdi
testl %eax, %eax
js 0x331e0
movl %eax, 0xc(%rsp)
pushq $-0x1
popq %r12
movl %r12d, %esi
movq %r15, %rdx
callq 0x38a63
movq (%rbx), %rdi
movl %r12d, %esi
callq 0x37b59
cmpl $0x6, %eax
jne 0x3327f
testq %rbp, %rbp
je 0x3321f
movq %rbp, %rdi
callq 0x1bec8
movq (%rbx), %rdi
movq %rax, %rsi
callq 0x67934
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x33223
pushq $0x2
popq %rbp
movq (%rbx), %r15
callq 0x143d2
movq %r15, %rdi
movq %rax, %rsi
callq 0x38431
jmp 0x33226
callq 0x377ed
cmpl %r13d, %eax
je 0x33443
movq 0xfadc3(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x96e67(%rip), %rsi     # 0xca066
leaq 0xa1d65(%rip), %rdx     # 0xd4f6b
leaq 0xa1e5c(%rip), %rcx     # 0xd5069
leaq 0xa1c81(%rip), %r8      # 0xd4e95
movl $0x152, %r9d            # imm = 0x152
jmp 0x33519
xorl %ebp, %ebp
jmp 0x33226
pushq $0x1
popq %rbp
movq (%rbx), %rdi
pushq $0x1
popq %rdx
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x39305
testl %eax, %eax
je 0x3327f
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
xorl %edx, %edx
callq 0x37f9b
leaq 0xa485c(%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 %r13d, %eax
jne 0x334ed
pushq $0x2
jmp 0x33445
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37b59
testl %eax, %eax
je 0x3342b
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37b59
cmpl $0x5, %eax
jne 0x3342b
movq (%rbx), %rdi
leaq 0xa6609(%rip), %rdx     # 0xd98b9
pushq $-0x1
popq %rbp
movl %ebp, %esi
callq 0x38a63
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x37b59
testl %eax, %eax
je 0x332e7
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37bad
testl %eax, %eax
je 0x332e7
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37f19
movsd %xmm0, (%r14)
movq (%rbx), %rdi
pushq $-0x2
popq %rsi
callq 0x377fa
movq (%rbx), %rdi
leaq 0xa1d8b(%rip), %rdx     # 0xd5087
pushq $-0x1
popq %rbp
movl %ebp, %esi
callq 0x38a63
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x37b59
testl %eax, %eax
je 0x33334
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37bad
testl %eax, %eax
je 0x33334
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37f19
movsd %xmm0, 0x8(%r14)
movq (%rbx), %rdi
pushq $-0x2
popq %rsi
callq 0x377fa
movq (%rbx), %rdi
leaq 0xa1d44(%rip), %rdx     # 0xd508d
pushq $-0x1
popq %rbp
movl %ebp, %esi
callq 0x38a63
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x37b59
testl %eax, %eax
je 0x33381
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37bad
testl %eax, %eax
je 0x33381
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37f19
movsd %xmm0, 0x10(%r14)
movq (%rbx), %rdi
pushq $-0x2
popq %rbp
movl %ebp, %esi
callq 0x377fa
movq (%rbx), %rdi
leaq 0xb3194(%rip), %rdx     # 0xe652c
pushq $-0x1
popq %r15
movl %r15d, %esi
callq 0x38a63
movq (%rbx), %rdi
movl %r15d, %esi
callq 0x37b59
testl %eax, %eax
je 0x333d3
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37bad
testl %eax, %eax
je 0x333d3
movq (%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x37f19
movsd %xmm0, 0x18(%r14)
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x377fa
movq (%rbx), %rdi
subl 0xc(%rsp), %ebp
movl %ebp, %esi
callq 0x377fa
movq (%rbx), %rdi
callq 0x377ed
xorl %ebp, %ebp
cmpl %r13d, %eax
je 0x33446
movq 0xfabb7(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x96c5b(%rip), %rsi     # 0xca066
leaq 0xa1b59(%rip), %rdx     # 0xd4f6b
leaq 0xa1c50(%rip), %rcx     # 0xd5069
leaq 0xa1a75(%rip), %r8      # 0xd4e95
movl $0x189, %r9d            # imm = 0x189
jmp 0x33519
movq (%rbx), %rdi
pushq $-0x4
popq %rsi
callq 0x377fa
movq (%rbx), %rdi
callq 0x377ed
cmpl %r13d, %eax
jne 0x334bf
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 0xfab51(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x96bf5(%rip), %rsi     # 0xca066
leaq 0xa1bd2(%rip), %rdx     # 0xd504a
leaq 0xa1bea(%rip), %rcx     # 0xd5069
leaq 0xa1a0f(%rip), %r8      # 0xd4e95
movl $0x146, %r9d            # imm = 0x146
jmp 0x33519
movq 0xfab20(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x96bc4(%rip), %rsi     # 0xca066
leaq 0x971b0(%rip), %rdx     # 0xca659
leaq 0xa1bb9(%rip), %rcx     # 0xd5069
leaq 0xa19de(%rip), %r8      # 0xd4e95
movl $0x147, %r9d            # imm = 0x147
jmp 0x33519
movq 0xfaaf2(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x96b96(%rip), %rsi     # 0xca066
leaq 0xa1a94(%rip), %rdx     # 0xd4f6b
leaq 0xa1b8b(%rip), %rcx     # 0xd5069
leaq 0xa19b0(%rip), %r8      # 0xd4e95
movl $0x172, %r9d            # imm = 0x172
jmp 0x33519
movq 0xfaac4(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x96b68(%rip), %rsi     # 0xca066
leaq 0xa1a66(%rip), %rdx     # 0xd4f6b
leaq 0xa1b5d(%rip), %rcx     # 0xd5069
leaq 0xa1982(%rip), %r8      # 0xd4e95
movl $0x16a, %r9d            # imm = 0x16A
xorl %eax, %eax
callq 0xb8c0
callq 0xb300