// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x7d0, -0x2c(%rbp)     # imm = 0x7D0
jge 0x19e20
cmpq $0x0, -0x28(%rbp)
je 0x19cef
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x19c09
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0x19c52
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movzbl 0xa(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x19c25
xorl %eax, %eax
movq %rax, -0x50(%rbp)
jmp 0x19c4a
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0xe8(%rax), %rdx
movl $0x1, %esi
callq 0x185d0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x19ced
leaq 0x1ae4c(%rip), %rax     # 0x34ab8
cmpq %rax, -0x28(%rbp)
jne 0x19c87
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x17640
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movb $0x0, 0xa(%rax)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x19ce6
movq -0x40(%rbp), %rax
movzbl 0x9(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x19ce6
movq -0x20(%rbp), %rax
movq (%rax), %rax
movzbl 0x9(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x19ce6
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xd820
jmp 0x19ce8
jmp 0x19ce8
jmp 0x19e32
jmp 0x19d21
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x18640
movq %rax, -0x38(%rbp)
cmpl $0x0, 0x8(%rax)
jne 0x19d1f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x1c86d(%rip), %rdx     # 0x36587
callq 0x9870
jmp 0x19d21
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
andl $0xf, %eax
cmpl $0x6, %eax
jne 0x19d51
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
xorl %r9d, %r9d
callq 0x187d0
jmp 0x19e32
movq -0x38(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x45, 0x8(%rax)
je 0x19d7a
movq $0x0, -0x28(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x19e0e
jmp 0x19e10
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x17f80
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x19d9f
xorl %eax, %eax
movl %eax, -0x54(%rbp)
jmp 0x19e06
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x19de6
movq -0x10(%rbp), %rax
movq (%rax), %rax
movzbl 0x9(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x19de6
movq -0x20(%rbp), %rax
movq (%rax), %rax
movzbl 0x9(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x19de6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0xd820
jmp 0x19de8
jmp 0x19de8
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl $0x0, %eax
je 0x19e10
jmp 0x19e32
jmp 0x19e12
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x19bd3
movq -0x8(%rbp), %rdi
leaq 0x1b6ed(%rip), %rsi     # 0x35518
movb $0x0, %al
callq 0x98e0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)