// File: /workspace/github_c_makefile_star2_O2/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: luaV_concat
static void luaV_concat(lua_State*L,int total,int last){
do{
StkId top=L->base+last+1;
int n=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)
(void)tostring(L,top-2);
else{
size_t tl=tsvalue(top-1)->len;
char*buffer;
int i;
for(n=1;n<total&&tostring(L,top-n-1);n++){
size_t l=tsvalue(top-n-1)->len;
if(l>=((size_t)(~(size_t)0)-2)-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--){
size_t l=tsvalue(top-i)->len;
memcpy(buffer+tl,svalue(top-i),l);
tl+=l;
}
setsvalue(L,top-n,luaS_newlstr(L,buffer,tl));
}
total-=n-1;
last-=n-1;
}while(total>1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r14d
movl %esi, 0x8(%rsp)
movq %rdi, (%rsp)
movq (%rsp), %rax
movq 0x18(%rax), %rbx
movslq %r14d, %rbp
shlq $0x4, %rbp
leaq (%rbx,%rbp), %r15
leaq (%rbx,%rbp), %r12
addq $-0x10, %r12
movl 0x8(%r12), %eax
addl $-0x3, %eax
cmpl $0x1, %eax
ja 0x4c60
cmpl $0x4, 0x8(%r15)
je 0x4be0
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x4ea1
testl %eax, %eax
je 0x4c60
movq (%r15), %rax
movq 0x10(%rax), %r13
testq %r13, %r13
je 0x4c86
movl %r14d, 0xc(%rsp)
movq %rbx, 0x18(%rsp)
leaq (%rbx,%rbp), %rax
addq $0x10, %rax
movq %rax, 0x20(%rsp)
movl 0x8(%rsp), %eax
movslq %eax, %r15
cmpl $0x2, %r15d
pushq $0x1
popq %rbx
cmovgel %eax, %ebx
pushq $0x1
popq %r14
cmpq %r15, %r14
jge 0x4cab
cmpl $0x4, 0x8(%r12)
je 0x4c3d
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x4ea1
testl %eax, %eax
je 0x4ca8
movq (%r12), %rax
movq 0x10(%rax), %rax
pushq $-0x3
popq %rcx
subq %r13, %rcx
cmpq %rcx, %rax
jae 0x4d90
addq %rax, %r13
incq %r14
addq $-0x10, %r12
jmp 0x4c1c
movq (%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r12, %rcx
pushq $0xf
popq %r8
callq 0x4efd
pushq $0x1
popq %rbx
testl %eax, %eax
jne 0x4d6b
jmp 0x4da2
cmpl $0x4, -0x8(%r15)
pushq $0x1
popq %rbx
je 0x4d6b
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x4ea1
pushq $0x1
popq %rbx
jmp 0x4d6b
movl %r14d, %ebx
movq (%rsp), %rax
movq 0x20(%rax), %r14
movq 0x68(%r14), %rdx
cmpq %r13, %rdx
jae 0x4cf2
cmpq $0x21, %r13
pushq $0x20
popq %rax
cmovbq %rax, %r13
leaq 0x1(%r13), %rax
cmpq $-0x3, %rax
ja 0x4dc3
movq 0x58(%r14), %rsi
movq (%rsp), %rdi
movq %r13, %rcx
callq 0x4158
movq %rax, %r12
movq %rax, 0x58(%r14)
movq %r13, 0x68(%r14)
jmp 0x4cf6
movq 0x58(%r14), %r12
movl %ebx, %r14d
movq %r14, %rax
shlq $0x4, %rax
movq %rax, 0x10(%rsp)
subq %rax, %rbp
movq 0x18(%rsp), %rax
addq %rax, %rbp
addq $0x10, %rbp
xorl %r15d, %r15d
testq %r14, %r14
jle 0x4d40
movq (%rbp), %rsi
movq 0x10(%rsi), %r13
leaq (%r12,%r15), %rdi
addq $0x18, %rsi
movq %r13, %rdx
callq 0x31a0
addq %r13, %r15
decq %r14
addq $0x10, %rbp
jmp 0x4d17
movq 0x20(%rsp), %r14
subq 0x10(%rsp), %r14
movq (%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4008
movq %rax, (%r14)
movl $0x4, 0x8(%r14)
decl %ebx
movl 0xc(%rsp), %r14d
movl 0x8(%rsp), %eax
subl %ebx, %eax
subl %ebx, %r14d
movl %eax, 0x8(%rsp)
cmpl $0x1, %eax
jg 0x4b99
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd8fb(%rip), %rsi      # 0x12692
movq (%rsp), %rdi
xorl %eax, %eax
callq 0x450d
movl -0x8(%r15), %eax
addl $-0x3, %eax
cmpl $0x2, %eax
cmovbq %r15, %r12
leaq 0xda4f(%rip), %rdx      # 0x12806
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x6b77
movq (%rsp), %rdi
callq 0x44fe