// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/lua/src/lvm.c
// Function: luaV_concat
void luaV_concat (lua_State *L, int total, int last) {
  do {
    StkId top = L->base + last + 1;
    int n = 2;  /* number of elements handled in this pass (at least 2) */
    if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) {
      if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT))
        luaG_concaterror(L, top-2, top-1);
    } else if (tsvalue(top-1)->len == 0)  /* second op is empty? */
      (void)tostring(L, top - 2);  /* result is first op (as string) */
    else {
      /* at least two string values; get as many as possible */
      size_t tl = tsvalue(top-1)->len;
      char *buffer;
      int i;
      /* collect total length */
      for (n = 1; n < total && tostring(L, top-n-1); n++) {
        size_t l = tsvalue(top-n-1)->len;
        if (l >= MAX_SIZET - tl) luaG_runerror(L, "string length overflow");
        tl += l;
      }
      buffer = luaZ_openspace(L, &G(L)->buff, tl);
      tl = 0;
      for (i=n; i>0; i--) {  /* concat all strings */
        size_t l = tsvalue(top-i)->len;
        memcpy(buffer+tl, svalue(top-i), l);
        tl += l;
      }
      setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl));
    }
    total -= n-1;  /* got `n' strings to create 1 new */
    last -= n-1;
  } while (total > 1);  /* repeat until only 1 result left */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
addq $0x10, %rax
movq %rax, -0x18(%rbp)
movl $0x2, -0x1c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x4, -0x18(%rax)
je 0x174c8
movq -0x18(%rbp), %rax
cmpl $0x3, -0x18(%rax)
jne 0x174e8
movq -0x18(%rbp), %rax
cmpl $0x4, -0x8(%rax)
je 0x17532
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $-0x10, %rsi
callq 0x167c0
cmpl $0x0, %eax
jne 0x17532
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 $0xf, %r8d
callq 0x17750
cmpl $0x0, %eax
jne 0x1752d
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $-0x20, %rsi
movq -0x18(%rbp), %rdx
addq $-0x10, %rdx
callq 0xa4d0
jmp 0x17721
movq -0x18(%rbp), %rax
movq -0x10(%rax), %rax
cmpq $0x0, 0x10(%rax)
jne 0x17572
movq -0x18(%rbp), %rcx
movb $0x1, %al
cmpl $0x4, -0x18(%rcx)
movb %al, -0x51(%rbp)
je 0x1756a
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $-0x20, %rsi
callq 0x167c0
cmpl $0x0, %eax
setne %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
jmp 0x1771f
movq -0x18(%rbp), %rax
movq -0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
xorl %eax, %eax
cmpl -0xc(%rbp), %ecx
movb %al, -0x52(%rbp)
jge 0x175e5
movq -0x18(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
xorl %eax, %eax
subq %rdx, %rax
shlq $0x4, %rax
addq %rax, %rcx
movb $0x1, %al
cmpl $0x4, -0x8(%rcx)
movb %al, -0x53(%rbp)
je 0x175df
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 0x167c0
cmpl $0x0, %eax
setne %al
movb %al, -0x53(%rbp)
movb -0x53(%rbp), %al
movb %al, -0x52(%rbp)
movb -0x52(%rbp), %al
testb $0x1, %al
jne 0x175ee
jmp 0x1764e
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, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq $-0x3, %rcx
subq -0x28(%rbp), %rcx
cmpq %rcx, %rax
jb 0x17634
movq -0x8(%rbp), %rdi
leaq 0x14877(%rip), %rsi     # 0x2bea4
movb $0x0, %al
callq 0xa410
movq -0x40(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x17589
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0x58, %rsi
movq -0x28(%rbp), %rdx
callq 0x1a710
movq %rax, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jle 0x176e1
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
addq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
addq $0x18, %rsi
movq -0x48(%rbp), %rdx
callq 0x5310
movq -0x48(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x17679
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x140d0
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
movl $0x4, 0x8(%rax)
jmp 0x17721
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movl -0x10(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x10(%rbp)
cmpl $0x1, -0xc(%rbp)
jg 0x17492
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)