// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/ltable.c
// Function: mainposition
static Node *mainposition (const Table *t, const TValue *key) {
  switch (ttype(key)) {
    case LUA_TNUMBER:
      return hashnum(t, nvalue(key));
    case LUA_TLNGSTR: {
      TString *s = rawtsvalue(key);
      if (s->tsv.extra == 0) {  /* no hash? */
        s->tsv.hash = luaS_hash(getstr(s), s->tsv.len, s->tsv.hash);
        s->tsv.extra = 1;  /* now it has its hash */
      }
      return hashstr(t, rawtsvalue(key));
    }
    case LUA_TSHRSTR:
      return hashstr(t, rawtsvalue(key));
    case LUA_TBOOLEAN:
      return hashboolean(t, bvalue(key));
    case LUA_TLIGHTUSERDATA:
      return hashpointer(t, pvalue(key));
    case LUA_TLCF:
      return hashpointer(t, fvalue(key));
    default:
      return hashpointer(t, gcvalue(key));
  }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x40(%rsp), %rax
movl 0x8(%rax), %eax
andl $0x3f, %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0x30(%rsp)
subl $0x15, %eax
ja 0x24ea6
movq 0x30(%rsp), %rax
leaq 0x120d9(%rip), %rcx     # 0x36db0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rax
movsd (%rax), %xmm0
callq 0x25130
movq %rax, 0x50(%rsp)
jmp 0x24eeb
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movzbl 0xa(%rax), %eax
cmpl $0x0, %eax
jne 0x24d4a
movq 0x38(%rsp), %rdi
addq $0x18, %rdi
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x38(%rsp), %rax
movl 0xc(%rax), %edx
callq 0x204d0
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x38(%rsp), %rax
movb $0x1, 0xa(%rax)
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, 0x2c(%rsp)
movq 0x48(%rsp), %rcx
movzbl 0xb(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl 0x2c(%rsp), %ecx
subl $0x1, %edx
andl %edx, %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x50(%rsp)
jmp 0x24eeb
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, 0x28(%rsp)
movq 0x48(%rsp), %rcx
movzbl 0xb(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl 0x28(%rsp), %ecx
subl $0x1, %edx
andl %edx, %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x50(%rsp)
jmp 0x24eeb
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x40(%rsp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x24(%rsp)
movq 0x48(%rsp), %rcx
movzbl 0xb(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl 0x24(%rsp), %ecx
subl $0x1, %edx
andl %edx, %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x50(%rsp)
jmp 0x24eeb
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x48(%rsp), %rcx
movzbl 0xb(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
orl $0x1, %ecx
xorl %edx, %edx
divl %ecx
movq 0x18(%rsp), %rax
movl %edx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x50(%rsp)
jmp 0x24eeb
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x48(%rsp), %rcx
movzbl 0xb(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
orl $0x1, %ecx
xorl %edx, %edx
divl %ecx
movq 0x10(%rsp), %rax
movl %edx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x50(%rsp)
jmp 0x24eeb
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x48(%rsp), %rcx
movzbl 0xb(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
orl $0x1, %ecx
xorl %edx, %edx
divl %ecx
movq 0x8(%rsp), %rax
movl %edx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)