// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lvm.c
// Function: luaV_finishOp
void luaV_finishOp (lua_State *L) {
  CallInfo *ci = L->ci;
  StkId base = ci->u.l.base;
  Instruction inst = *(ci->u.l.savedpc - 1);  /* interrupted instruction */
  OpCode op = GET_OPCODE(inst);
  switch (op) {  /* finish its execution */
    case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV:
    case OP_MOD: case OP_POW: case OP_UNM: case OP_LEN:
    case OP_GETTABUP: case OP_GETTABLE: case OP_SELF: {
      setobjs2s(L, base + GETARG_A(inst), --L->top);
      break;
    }
    case OP_LE: case OP_LT: case OP_EQ: {
      int res = !l_isfalse(L->top - 1);
      L->top--;
      /* metamethod should not be called when operand is K */
      lua_assert(!ISK(GETARG_B(inst)));
      if (op == OP_LE &&  /* "<=" using "<" instead? */
          ttisnil(luaT_gettmbyobj(L, base + GETARG_B(inst), TM_LE)))
        res = !res;  /* invert result */
      lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_JMP);
      if (res != GETARG_A(inst))  /* condition failed? */
        ci->u.l.savedpc++;  /* skip jump instruction */
      break;
    }
    case OP_CONCAT: {
      StkId top = L->top - 1;  /* top when 'call_binTM' was called */
      int b = GETARG_B(inst);      /* first element to concatenate */
      int total = cast_int(top - 1 - (base + b));  /* yet to concatenate */
      setobj2s(L, top - 2, top);  /* put TM result in proper position */
      if (total > 1) {  /* are there elements to concat? */
        L->top = top - 1;  /* top is one after last element (at top-2) */
        luaV_concat(L, total);  /* concat them (may yield again) */
      }
      /* move final result to final position */
      setobj2s(L, ci->u.l.base + GETARG_A(inst), L->top - 1);
      L->top = ci->top;  /* restore top */
      break;
    }
    case OP_TFORCALL: {
      lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_TFORLOOP);
      L->top = ci->top;  /* correct top */
      break;
    }
    case OP_CALL: {
      if (GETARG_C(inst) - 1 >= 0)  /* nresults >= 0? */
        L->top = ci->top;  /* adjust results */
      break;
    }
    case OP_TAILCALL: case OP_SETTABUP: case OP_SETTABLE:
      break;
    default: lua_assert(0);
  }
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rax
movl -0x4(%rax), %eax
movl %eax, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
andl $0x3f, %eax
movl %eax, 0x58(%rsp)
movl 0x58(%rsp), %eax
addl $-0x6, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x1c, %eax
ja 0x28c51
movq 0x8(%rsp), %rax
leaq 0xe6d5(%rip), %rcx      # 0x37098
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x70(%rsp), %rcx
movq 0x10(%rcx), %rax
addq $-0x10, %rax
movq %rax, 0x10(%rcx)
movq %rax, 0x50(%rsp)
movq 0x60(%rsp), %rax
movl 0x5c(%rsp), %ecx
shrl $0x6, %ecx
andl $0xff, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq 0x50(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x8(%rax)
jmp 0x28c53
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rcx
movb $0x1, %al
cmpl $0x0, -0x8(%rcx)
movb %al, 0x7(%rsp)
je 0x28a6e
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rcx
xorl %eax, %eax
cmpl $0x1, -0x8(%rcx)
movb %al, 0x6(%rsp)
jne 0x28a66
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, -0x10(%rax)
sete %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x44(%rsp)
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rcx
addq $-0x10, %rcx
movq %rcx, 0x10(%rax)
cmpl $0x1a, 0x58(%rsp)
jne 0x28ad7
movq 0x70(%rsp), %rdi
movq 0x60(%rsp), %rsi
movl 0x5c(%rsp), %eax
shrl $0x17, %eax
andl $0x1ff, %eax            # imm = 0x1FF
cltq
shlq $0x4, %rax
addq %rax, %rsi
movl $0xe, %edx
callq 0x26540
cmpl $0x0, 0x8(%rax)
jne 0x28ad7
cmpl $0x0, 0x44(%rsp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
movl 0x5c(%rsp), %ecx
shrl $0x6, %ecx
andl $0xff, %ecx
cmpl %ecx, %eax
je 0x28afd
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rcx
addq $0x4, %rcx
movq %rcx, 0x38(%rax)
jmp 0x28c53
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rax
addq $-0x10, %rax
movq %rax, 0x38(%rsp)
movl 0x5c(%rsp), %eax
shrl $0x17, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, 0x34(%rsp)
movq 0x38(%rsp), %rax
addq $-0x10, %rax
movq 0x60(%rsp), %rcx
movslq 0x34(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
subq %rcx, %rax
sarq $0x4, %rax
movl %eax, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rax
addq $-0x20, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x8(%rax)
cmpl $0x1, 0x30(%rsp)
jle 0x28ba8
movq 0x38(%rsp), %rcx
addq $-0x10, %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x70(%rsp), %rdi
movl 0x30(%rsp), %esi
callq 0x28280
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rax
addq $-0x10, %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rsp), %rax
movq 0x30(%rax), %rax
movl 0x5c(%rsp), %ecx
shrl $0x6, %ecx
andl $0xff, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x28c53
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x28c53
movl 0x5c(%rsp), %eax
shrl $0xe, %eax
andl $0x1ff, %eax            # imm = 0x1FF
subl $0x1, %eax
cmpl $0x0, %eax
jl 0x28c4d
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x28c53
jmp 0x28c53
jmp 0x28c53
addq $0x78, %rsp
retq
nopl (%rax,%rax)