// File: /workspace/github_c_makefile_star2_O2/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lparser.c
// Function: close_func
static void close_func (LexState *ls) {
  lua_State *L = ls->L;
  FuncState *fs = ls->fs;
  Proto *f = fs->f;
  luaK_ret(fs, 0, 0);  /* final return */
  leaveblock(fs);
  luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction);
  f->sizecode = fs->pc;
  luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int);
  f->sizelineinfo = fs->pc;
  luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue);
  f->sizek = fs->nk;
  luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *);
  f->sizep = fs->np;
  luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar);
  f->sizelocvars = fs->nlocvars;
  luaM_reallocvector(L, f->upvalues, f->sizeupvalues, fs->nups, Upvaldesc);
  f->sizeupvalues = fs->nups;
  lua_assert(fs->bl == NULL);
  ls->fs = fs->prev;
  /* last token read was anchored in defunct function; must re-anchor it */
  anchor_token(ls);
  L->top--;  /* pop table of constants */
  luaC_checkGC(L);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x30(%rdi), %r15
movq 0x38(%rdi), %rbx
movq (%r15), %r12
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1a0fb
movq %r15, %rdi
callq 0x11a28
movslq 0x28(%r15), %rcx
cmpq $-0x2, %rcx
jle 0x10db5
movq 0x18(%r12), %rsi
movslq 0x58(%r12), %rdx
shlq $0x2, %rdx
shlq $0x2, %rcx
movq %rbx, %rdi
callq 0xed73
movq %rax, 0x18(%r12)
movslq 0x28(%r15), %rcx
movl %ecx, 0x58(%r12)
cmpq $-0x2, %rcx
jle 0x10db5
movq 0x28(%r12), %rsi
movslq 0x5c(%r12), %rdx
shlq $0x2, %rdx
shlq $0x2, %rcx
movq %rbx, %rdi
callq 0xed73
movq %rax, 0x28(%r12)
movl 0x28(%r15), %eax
movl %eax, 0x5c(%r12)
movslq 0x34(%r15), %rcx
cmpq $-0x2, %rcx
jle 0x10db5
movq 0x10(%r12), %rsi
movslq 0x54(%r12), %rdx
shlq $0x4, %rdx
shlq $0x4, %rcx
movq %rbx, %rdi
callq 0xed73
movq %rax, 0x10(%r12)
movl 0x34(%r15), %eax
movl %eax, 0x54(%r12)
movslq 0x38(%r15), %rcx
cmpq $-0x2, %rcx
jle 0x10db5
movq 0x20(%r12), %rsi
movslq 0x60(%r12), %rdx
shlq $0x3, %rdx
shlq $0x3, %rcx
movq %rbx, %rdi
callq 0xed73
movq %rax, 0x20(%r12)
movl 0x38(%r15), %eax
movl %eax, 0x60(%r12)
movswq 0x40(%r15), %rcx
movabsq $-0x1000000000000000, %rax # imm = 0xF000000000000000
addq %rcx, %rax
incq %rax
shrq $0x3c, %rax
cmpl $0xe, %eax
jbe 0x10db5
movq 0x30(%r12), %rsi
movslq 0x64(%r12), %rdx
shlq $0x4, %rdx
shlq $0x4, %rcx
movq %rbx, %rdi
callq 0xed73
movq %rax, 0x30(%r12)
movswl 0x40(%r15), %eax
movl %eax, 0x64(%r12)
movzbl 0x43(%r15), %ecx
movq 0x38(%r12), %rsi
movslq 0x50(%r12), %rdx
shlq $0x4, %rdx
shll $0x4, %ecx
movq %rbx, %rdi
callq 0xed73
movq %rax, 0x38(%r12)
movzbl 0x43(%r15), %eax
movl %eax, 0x50(%r12)
movq 0x10(%r15), %rax
movq %rax, 0x30(%r14)
movl 0x10(%r14), %eax
andl $-0x2, %eax
cmpl $0x120, %eax            # imm = 0x120
jne 0x10d86
movq 0x18(%r14), %rsi
movq 0x10(%rsi), %rdx
addq $0x18, %rsi
movq %r14, %rdi
callq 0x1c4f4
addq $-0x10, 0x10(%rbx)
movq 0x18(%rbx), %rax
cmpq $0x0, 0x18(%rax)
jle 0x10da9
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xcd44
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0xed64