// File: /workspace/github_c_makefile_star2_O3/tylerneylon[P]APIsWithLua/lua/lvm.c
// Function: luaV_finishset
void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
                     StkId val, const TValue *slot) {
  int loop;  /* counter to avoid infinite loops */
  for (loop = 0; loop < MAXTAGLOOP; loop++) {
    const TValue *tm;  /* '__newindex' metamethod */
    if (slot != NULL) {  /* is 't' a table? */
      Table *h = hvalue(t);  /* save 't' table */
      lua_assert(ttisnil(slot));  /* old value must be nil */
      tm = fasttm(L, h->metatable, TM_NEWINDEX);  /* get metamethod */
      if (tm == NULL) {  /* no metamethod? */
        if (slot == luaO_nilobject)  /* no previous entry? */
          slot = luaH_newkey(L, h, key);  /* create one */
        /* no metamethod and (now) there is an entry with given key */
        setobj2t(L, cast(TValue *, slot), val);  /* set its new value */
        invalidateTMcache(h);
        luaC_barrierback(L, h, val);
        return;
      }
      /* else will try the metamethod */
    }
    else {  /* not a table; check metamethod */
      if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX)))
        luaG_typeerror(L, t, "index");
    }
    /* try the metamethod */
    if (ttisfunction(tm)) {
      luaT_callTM(L, tm, t, key, val, 0);
      return;
    }
    t = tm;  /* else repeat assignment over 'tm' */
    if (luaV_fastset(L, t, key, slot, luaH_get, val))
      return;  /* done */
    /* else loop */
  }
  luaG_runerror(L, "'__newindex' chain too long; possible loop");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r12
movq %rcx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, %r13
movq %rdi, %rbx
movl $0x7d0, %r15d           # imm = 0x7D0
testq %r12, %r12
je 0x1191b
movq (%r13), %r14
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x11988
testb $0x2, 0xa(%rdi)
jne 0x11988
movq 0x18(%rbx), %rax
movq 0xe8(%rax), %rdx
movl $0x1, %esi
callq 0x10949
testq %rax, %rax
je 0x11988
movq %rax, %rbp
movl 0x8(%rax), %eax
jmp 0x11939
movq %rbx, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x10974
movq %rax, %rbp
movl 0x8(%rax), %eax
testl %eax, %eax
je 0x11a54
movl %eax, %ecx
andl $0xf, %ecx
cmpl $0x6, %ecx
je 0x119ec
cmpl $0x45, %eax
jne 0x11968
movq (%rbp), %rdi
movq 0x10(%rsp), %rsi
callq 0x106ef
movq %rax, %r12
cmpl $0x0, 0x8(%rax)
je 0x1196b
jmp 0x11a15
xorl %r12d, %r12d
movq %rbp, %r13
decl %r15d
jne 0x118d9
leaq 0x117de(%rip), %rsi     # 0x2315c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x7dd3
leaq 0x10cc1(%rip), %rax     # 0x22650
cmpq %rax, %r12
jne 0x119a7
movq %rbx, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rdx
callq 0x10155
movq %rax, %r12
movq 0x8(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, (%r12)
movb $0x0, 0xa(%r14)
testb $0x40, 0x8(%rax)
je 0x11a45
testb $0x4, 0x9(%r14)
je 0x11a45
movq (%rax), %rax
testb $0x3, 0x9(%rax)
je 0x11a45
movq %rbx, %rdi
movq %r14, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa246
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r8
xorl %r9d, %r9d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10a4a
movq 0x8(%rsp), %r14
testb $0x40, 0x8(%r14)
je 0x11a3c
movq (%rbp), %rsi
testb $0x4, 0x9(%rsi)
je 0x11a3c
movq (%r14), %rax
testb $0x3, 0x9(%rax)
je 0x11a3c
movq %rbx, %rdi
callq 0xa246
movups (%r14), %xmm0
movups %xmm0, (%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1243c(%rip), %rdx     # 0x23e97
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7d95