// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/lua/src/lparser.c
// Function: indexupvalue
static int indexupvalue (FuncState *fs, TString *name, expdesc *v) {
  int i;
  Proto *f = fs->f;
  int oldsize = f->sizeupvalues;
  for (i=0; i<f->nups; i++) {
    if (fs->upvalues[i].k == v->k && fs->upvalues[i].info == v->u.s.info) {
      lua_assert(f->upvalues[i] == name);
      return i;
    }
  }
  /* new one */
  luaY_checklimit(fs, f->nups + 1, LUAI_MAXUPVALUES, "upvalues");
  luaM_growvector(fs->L, f->upvalues, f->nups, f->sizeupvalues,
                  TString *, MAX_INT, "");
  while (oldsize < f->sizeupvalues) f->upvalues[oldsize++] = NULL;
  f->upvalues[f->nups] = name;
  luaC_objbarrier(fs->L, f, name);
  lua_assert(v->k == VLOCAL || v->k == VUPVAL);
  fs->upvalues[f->nups].k = cast_byte(v->k);
  fs->upvalues[f->nups].info = cast_byte(v->u.s.info);
  return f->nups++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl 0x48(%rax), %eax
movl %eax, -0x34(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x30(%rbp), %rcx
movzbl 0x70(%rcx), %ecx
cmpl %ecx, %eax
jge 0x12bd2
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzbl 0x4b(%rax,%rcx,2), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x12bc5
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzbl 0x4c(%rax,%rcx,2), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x12bc5
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x12d06
jmp 0x12bc7
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x12b80
movq -0x30(%rbp), %rax
movzbl 0x70(%rax), %eax
addl $0x1, %eax
cmpl $0x3c, %eax
jle 0x12bf7
movq -0x10(%rbp), %rdi
movl $0x3c, %esi
leaq 0x18f02(%rip), %rdx     # 0x2baf4
callq 0x11fe0
movq -0x30(%rbp), %rax
movzbl 0x70(%rax), %eax
addl $0x1, %eax
movq -0x30(%rbp), %rcx
cmpl 0x48(%rcx), %eax
jle 0x12c45
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x30(%rbp), %rdx
addq $0x48, %rdx
movl $0x8, %ecx
movl $0x7ffffffd, %r8d       # imm = 0x7FFFFFFD
leaq 0x1a6e1(%rip), %r9      # 0x2d316
callq 0xf380
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
jmp 0x12c47
movl -0x34(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x48(%rcx), %eax
jge 0x12c73
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rax
movl -0x34(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x34(%rbp)
movslq %ecx, %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0x12c47
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x30(%rbp), %rcx
movzbl 0x70(%rcx), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movzbl 0x9(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x12cc0
movq -0x30(%rbp), %rax
movzbl 0x9(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x12cc0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xde90
movq -0x20(%rbp), %rax
movl (%rax), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movzbl 0x70(%rcx), %ecx
movb %dl, 0x4b(%rax,%rcx,2)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movzbl 0x70(%rcx), %ecx
movb %dl, 0x4c(%rax,%rcx,2)
movq -0x30(%rbp), %rcx
movb 0x70(%rcx), %al
movb %al, %dl
addb $0x1, %dl
movb %dl, 0x70(%rcx)
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop