// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/lua/src/lvm.c
// Function: luaV_settable
void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
  int loop;
  for (loop = 0; loop < MAXTAGLOOP; loop++) {
    const TValue *tm;
    if (ttistable(t)) {  /* `t' is a table? */
      Table *h = hvalue(t);
      TValue *oldval = luaH_set(L, h, key); /* do a primitive set */
      if (!ttisnil(oldval) ||  /* result is no nil? */
          (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
        setobj2t(L, oldval, val);
        luaC_barriert(L, h, val);
        return;
      }
      /* else will try the tag method */
    }
    else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX)))
      luaG_typeerror(L, t, "index");
    if (ttisfunction(tm)) {
      callTM(L, tm, t, key, val);
      return;
    }
    t = tm;  /* else repeat with `tm' */ 
  }
  luaG_runerror(L, "loop in settable");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r13
movq %rdx, 0x10(%rsp)
movq %rsi, %r12
movq %rdi, %rbx
movl $0x64, %r14d
movq %rcx, 0x8(%rsp)
cmpl $0x5, 0x8(%r12)
jne 0x293ea
movq (%r12), %r13
movq %rbx, %rdi
movq %r13, %rsi
movq 0x10(%rsp), %rdx
callq 0x27aa4
movq %rax, %r15
cmpl $0x0, 0x8(%rax)
je 0x29417
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq %rax, (%r15)
movl 0x8(%rcx), %eax
movl %eax, 0x8(%r15)
cmpl $0x4, 0x8(%rcx)
jl 0x293e6
movq (%rcx), %rax
testb $0x3, 0x9(%rax)
je 0x293e6
testb $0x4, 0x9(%r13)
je 0x293e6
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1f9cd
xorl %eax, %eax
jmp 0x2944d
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x28a1b
movq %rax, %rbp
cmpl $0x0, 0x8(%rax)
jne 0x2945a
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x9f55(%rip), %rdx      # 0x33365
callq 0x1d5a0
jmp 0x2945a
movq 0x10(%r13), %rdi
testq %rdi, %rdi
je 0x29440
testb $0x2, 0xa(%rdi)
jne 0x29440
movq 0x20(%rbx), %rax
movq 0x130(%rax), %rdx
movl $0x1, %esi
callq 0x289f0
movq %rax, %rbp
jmp 0x29442
xorl %ebp, %ebp
movb $0x1, %al
testq %rbp, %rbp
je 0x29508
testb %al, %al
je 0x294f0
movq 0x8(%rsp), %r13
movb $0x1, %r15b
cmpl $0x6, 0x8(%rbp)
jne 0x294eb
movq 0x10(%rbx), %rax
movq (%rbp), %rcx
movq %rcx, (%rax)
movl 0x8(%rbp), %ecx
movl %ecx, 0x8(%rax)
movq 0x10(%rbx), %rax
movq (%r12), %rcx
movq %rcx, 0x10(%rax)
movl 0x8(%r12), %ecx
movl %ecx, 0x18(%rax)
movq 0x10(%rbx), %rax
movq 0x10(%rsp), %rdx
movq (%rdx), %rcx
movq %rcx, 0x20(%rax)
movl 0x8(%rdx), %ecx
movl %ecx, 0x28(%rax)
movq 0x10(%rbx), %rax
movq (%r13), %rcx
movq %rcx, 0x30(%rax)
movl 0x8(%r13), %ecx
movl %ecx, 0x38(%rax)
movq 0x38(%rbx), %rax
subq 0x10(%rbx), %rax
cmpq $0x40, %rax
jg 0x294d0
movq %rbx, %rdi
movl $0x4, %esi
callq 0x1dd72
movq 0x10(%rbx), %rsi
leaq 0x40(%rsi), %rax
movq %rax, 0x10(%rbx)
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1e364
jmp 0x294f8
movq %rbp, %r12
jmp 0x294f8
xorl %r15d, %r15d
movq 0x8(%rsp), %r13
testb %r15b, %r15b
je 0x2950f
decl %r14d
jne 0x2938e
jmp 0x2951e
xorl %ebp, %ebp
jmp 0x293b3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa254(%rip), %rsi      # 0x33779
movq %rbx, %rdi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1d7d5