// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/lua-5.1.5/src/lparser.c
// Function: singlevaraux
static int singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) {
  if (fs == NULL) {  /* no more levels? */
    init_exp(var, VGLOBAL, NO_REG);  /* default is global variable */
    return VGLOBAL;
  }
  else {
    int v = searchvar(fs, n);  /* look up at current level */
    if (v >= 0) {
      init_exp(var, VLOCAL, v);
      if (!base)
        markupval(fs, v);  /* local will be used as an upval */
      return VLOCAL;
    }
    else {  /* not found at current level; try upper one */
      if (singlevaraux(fs->prev, n, var, 0) == VGLOBAL)
        return VGLOBAL;
      var->u.s.info = indexupvalue(fs, n, var);  /* else was LOCAL or UPVAL */
      var->k = VUPVAL;  /* upvalue in this level */
      return VUPVAL;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
testq %rdi, %rdi
je 0x64f49
movq %rsi, %r15
movq %rdi, %rbx
movzbl 0x4a(%rdi), %edx
testq %rdx, %rdx
jle 0x64f6a
movq (%rbx), %rax
movq 0x30(%rax), %rax
movzwl 0xc2(%rbx,%rdx,2), %esi
decq %rdx
shll $0x4, %esi
cmpq %r15, (%rax,%rsi)
jne 0x64f27
jmp 0x64f6f
movq $-0x1, 0x10(%r14)
movl $0x8, (%r14)
movl $0xff, 0x8(%r14)
movl $0x8, %eax
jmp 0x650c8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
testl %edx, %edx
js 0x64fb1
movq $-0x1, 0x10(%r14)
movl $0x6, (%r14)
movl %edx, 0x8(%r14)
movl $0x6, %eax
testl %ecx, %ecx
jne 0x650c8
addq $0x28, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x650c8
cmpb %dl, 0xc(%rbx)
ja 0x64f97
movb $0x1, 0xd(%rbx)
jmp 0x650c8
movq 0x10(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x64f0a
movl %eax, %ecx
movl $0x8, %eax
cmpl $0x8, %ecx
je 0x650c8
movq (%rbx), %r13
movslq 0x48(%r13), %rbp
movzbl 0x70(%r13), %ecx
testq %rcx, %rcx
je 0x65008
movl (%r14), %edx
xorl %eax, %eax
movzbl 0x4b(%rbx,%rax,2), %esi
cmpl %esi, %edx
jne 0x65000
movzbl 0x4c(%rbx,%rax,2), %esi
cmpl %esi, 0x8(%r14)
je 0x650b8
incq %rax
cmpq %rax, %rcx
jne 0x64fe8
cmpb $0x3c, %cl
jae 0x650d7
leaq 0x48(%r13), %r12
cmpl %ecx, %ebp
jg 0x6503f
movq 0x20(%rbx), %rdi
movq 0x38(%r13), %rsi
leaq 0x89b57(%rip), %r9      # 0xeeb7f
movl $0x8, %ecx
movq %r12, %rdx
movl $0x7ffffffd, %r8d       # imm = 0x7FFFFFFD
callq 0x6372c
movq %rax, 0x38(%r13)
movslq (%r12), %rax
cmpl %eax, %ebp
jge 0x6505b
movq 0x38(%r13), %rcx
movq $0x0, (%rcx,%rbp,8)
incq %rbp
cmpq %rbp, %rax
jne 0x65047
movq 0x38(%r13), %rax
movzbl 0x70(%r13), %ecx
movq %r15, (%rax,%rcx,8)
testb $0x3, 0x9(%r15)
je 0x6509d
movb 0x9(%r13), %al
testb $0x4, %al
je 0x6509d
movq 0x20(%rbx), %rcx
movq 0x20(%rcx), %rdi
cmpb $0x1, 0x21(%rdi)
jne 0x6508f
movq %r15, %rsi
callq 0x66a62
jmp 0x6509d
andb $-0x8, %al
movb 0x20(%rdi), %cl
andb $0x3, %cl
orb %al, %cl
movb %cl, 0x9(%r13)
movb (%r14), %cl
movzbl 0x70(%r13), %eax
movb %cl, 0x4b(%rbx,%rax,2)
movb 0x8(%r14), %cl
movb %cl, 0x4c(%rbx,%rax,2)
leal 0x1(%rax), %ecx
movb %cl, 0x70(%r13)
movl %eax, 0x8(%r14)
movl $0x7, (%r14)
movl $0x7, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x89112(%rip), %rdx     # 0xee1f0
movq %rbx, %rdi
movl $0x3c, %esi
callq 0x64877