// File: /workspace/github_c_makefile_star2_O0/tylerneylon[P]APIsWithLua/lua/lvm.c
// Function: luaV_concat
void luaV_concat (lua_State *L, int total) {
  lua_assert(total >= 2);
  do {
    StkId top = L->top;
    int n = 2;  /* number of elements handled in this pass (at least 2) */
    if (!(ttisstring(top-2) || cvt2str(top-2)) || !tostring(L, top-1))
      luaT_trybinTM(L, top-2, top-1, top-2, TM_CONCAT);
    else if (isemptystr(top - 1))  /* second operand is empty? */
      cast_void(tostring(L, top - 2));  /* result is first operand */
    else if (isemptystr(top - 2)) {  /* first operand is an empty string? */
      setobjs2s(L, top - 2, top - 1);  /* result is second op. */
    }
    else {
      /* at least two non-empty string values; get as many as possible */
      size_t tl = vslen(top - 1);
      TString *ts;
      /* collect total length and number of strings */
      for (n = 1; n < total && tostring(L, top - n - 1); n++) {
        size_t l = vslen(top - n - 1);
        if (l >= (MAX_SIZE/sizeof(char)) - tl)
          luaG_runerror(L, "string length overflow");
        tl += l;
      }
      if (tl <= LUAI_MAXSHORTLEN) {  /* is result a short string? */
        char buff[LUAI_MAXSHORTLEN];
        copy2buff(top, n, buff);  /* copy strings to buffer */
        ts = luaS_newlstr(L, buff, tl);
      }
      else {  /* long string; copy strings directly to final result */
        ts = luaS_createlngstrobj(L, tl);
        copy2buff(top, n, getstr(ts));
      }
      setsvalue2s(L, top - n, ts);  /* create result */
    }
    total -= n-1;  /* got 'n' strings to create 1 new */
    L->top -= n-1;  /* popped 'n' strings and pushed one */
  } while (total > 1);  /* repeat until only 1 result left */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x2, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl -0x18(%rax), %eax
andl $0xf, %eax
cmpl $0x4, %eax
je 0x1a883
movq -0x18(%rbp), %rax
movl -0x18(%rax), %eax
andl $0xf, %eax
cmpl $0x3, %eax
jne 0x1a8b8
movq -0x18(%rbp), %rax
movl -0x8(%rax), %eax
andl $0xf, %eax
cmpl $0x4, %eax
je 0x1a8e4
movq -0x18(%rbp), %rax
movl -0x8(%rax), %eax
andl $0xf, %eax
cmpl $0x3, %eax
jne 0x1a8b8
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $-0x10, %rsi
callq 0x10d60
movb $0x1, %al
testb $0x1, %al
jne 0x1a8e4
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $-0x20, %rsi
movq -0x18(%rbp), %rdx
addq $-0x10, %rdx
movq -0x18(%rbp), %rcx
addq $-0x20, %rcx
movl $0x16, %r8d
callq 0x189d0
jmp 0x1abe8
movq -0x18(%rbp), %rax
cmpl $0x44, -0x8(%rax)
jne 0x1a95d
movq -0x18(%rbp), %rax
movq -0x10(%rax), %rax
movzbl 0xb(%rax), %eax
cmpl $0x0, %eax
jne 0x1a95d
movq -0x18(%rbp), %rax
movl -0x18(%rax), %ecx
andl $0xf, %ecx
movb $0x1, %al
cmpl $0x4, %ecx
movb %al, -0x81(%rbp)
je 0x1a952
movq -0x18(%rbp), %rax
movl -0x18(%rax), %ecx
andl $0xf, %ecx
xorl %eax, %eax
cmpl $0x3, %ecx
movb %al, -0x82(%rbp)
jne 0x1a946
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $-0x20, %rsi
callq 0x10d60
movb $0x1, %al
movb %al, -0x82(%rbp)
movb -0x82(%rbp), %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
jmp 0x1abe6
movq -0x18(%rbp), %rax
cmpl $0x44, -0x18(%rax)
jne 0x1a9a0
movq -0x18(%rbp), %rax
movq -0x20(%rax), %rax
movzbl 0xb(%rax), %eax
cmpl $0x0, %eax
jne 0x1a9a0
movq -0x18(%rbp), %rax
addq $-0x20, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x10(%rcx), %rdx
movq %rdx, (%rax)
movq -0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
jmp 0x1abe4
movq -0x18(%rbp), %rax
movq -0x10(%rax), %rax
movzbl 0x8(%rax), %eax
cmpl $0x4, %eax
jne 0x1a9c6
movq -0x18(%rbp), %rax
movq -0x10(%rax), %rax
movzbl 0xb(%rax), %eax
movq %rax, -0x90(%rbp)
jmp 0x1a9d9
movq -0x18(%rbp), %rax
movq -0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
xorl %eax, %eax
cmpl -0xc(%rbp), %ecx
movb %al, -0x91(%rbp)
jge 0x1aa8e
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl -0x8(%rax), %ecx
andl $0xf, %ecx
movb $0x1, %al
cmpl $0x4, %ecx
movb %al, -0x92(%rbp)
je 0x1aa82
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl -0x8(%rax), %ecx
andl $0xf, %ecx
xorl %eax, %eax
cmpl $0x3, %ecx
movb %al, -0x93(%rbp)
jne 0x1aa76
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x4, %rax
addq %rax, %rsi
addq $-0x10, %rsi
callq 0x10d60
movb $0x1, %al
movb %al, -0x93(%rbp)
movb -0x93(%rbp), %al
movb %al, -0x92(%rbp)
movb -0x92(%rbp), %al
movb %al, -0x91(%rbp)
movb -0x91(%rbp), %al
testb $0x1, %al
jne 0x1aa9d
jmp 0x1ab54
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x10(%rax), %rax
movzbl 0x8(%rax), %eax
cmpl $0x4, %eax
jne 0x1aae3
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x10(%rax), %rax
movzbl 0xb(%rax), %eax
movq %rax, -0xa0(%rbp)
jmp 0x1ab06
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
subq -0x30(%rbp), %rcx
cmpq %rcx, %rax
jb 0x1ab3a
movq -0x8(%rbp), %rdi
leaq 0x1aa10(%rip), %rsi     # 0x35543
movb $0x0, %al
callq 0x98e0
movq -0x40(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1a9eb
cmpq $0x28, -0x30(%rbp)
ja 0x1ab82
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq -0x70(%rbp), %rdx
callq 0x1ac30
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x16890
movq %rax, -0x38(%rbp)
jmp 0x1aba7
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x16920
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x38(%rbp), %rdx
addq $0x18, %rdx
callq 0x1ac30
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, (%rax)
movq -0x80(%rbp), %rax
movzbl 0x8(%rax), %ecx
orl $0x40, %ecx
movq -0x78(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x1abe6
jmp 0x1abe8
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
movl -0x1c(%rbp), %edx
subl $0x1, %edx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movslq %edx, %rsi
xorl %edx, %edx
subq %rsi, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq %rcx, 0x10(%rax)
cmpl $0x1, -0xc(%rbp)
jg 0x1a852
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)