// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq %rdx, 0x10(%rsp)
movq %rsi, %rbp
movq %rdi, 0x8(%rsp)
movl $0x7d0, %ebx            # imm = 0x7D0
testq %r12, %r12
je 0x110f8
movq (%rbp), %r15
movq 0x28(%r15), %rdi
testq %rdi, %rdi
je 0x11093
testb $0x2, 0xa(%rdi)
jne 0x11093
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0xe8(%rax), %rdx
movl $0x1, %esi
callq 0x102d9
movq %rax, %r13
jmp 0x11096
xorl %r13d, %r13d
testq %r13, %r13
jne 0x110ee
leaq 0x1057e(%rip), %rax     # 0x21620
cmpq %rax, %r12
jne 0x110bc
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
callq 0xfb20
movq %rax, %r12
movups (%r14), %xmm0
movups %xmm0, (%r12)
movb $0x0, 0xa(%r15)
testb $0x40, 0x8(%r14)
je 0x110ee
testb $0x4, 0x9(%r15)
je 0x110ee
movq (%r14), %rax
testb $0x3, 0x9(%rax)
je 0x110ee
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x9ee6
testq %r13, %r13
jne 0x1111a
xorl %r15d, %r15d
jmp 0x11146
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movl $0x1, %edx
callq 0x10304
cmpl $0x0, 0x8(%rax)
je 0x111d1
movq %rax, %r13
xorl %r12d, %r12d
movl 0x8(%r13), %eax
movl %eax, %ecx
andl $0xf, %ecx
cmpl $0x6, %ecx
jne 0x1114b
xorl %r15d, %r15d
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq 0x10(%rsp), %rcx
movq %r14, %r8
xorl %r9d, %r9d
callq 0x103d7
movq %rbp, %r13
jmp 0x1119f
movb $0x1, %r15b
cmpl $0x45, %eax
jne 0x1119c
movq (%r13), %rdi
movq 0x10(%rsp), %rsi
callq 0x10094
movq %rax, %r12
cmpl $0x0, 0x8(%rax)
je 0x1119f
testb $0x40, 0x8(%r14)
je 0x1118e
movq (%r13), %rsi
testb $0x4, 0x9(%rsi)
je 0x1118e
movq (%r14), %rax
testb $0x3, 0x9(%rax)
je 0x1118e
movq 0x8(%rsp), %rdi
callq 0x9ee6
movups (%r14), %xmm0
movups %xmm0, (%r12)
xorl %r15d, %r15d
jmp 0x1119f
xorl %r12d, %r12d
testb %r15b, %r15b
je 0x111c2
movq %r13, %rbp
decl %ebx
jne 0x11058
leaq 0x10f16(%rip), %rsi     # 0x220cc
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0x7cd8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11c2f(%rip), %rdx     # 0x22e07
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x7c9a