// File: /workspace/github_c_makefile_star2_O1/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 $0x38, %rsp
movl %edx, %r12d
movq %rdi, %rbx
movq %rdi, 0x18(%rsp)
movl %esi, %esi
movq %rsi, 0x10(%rsp)
movq 0x18(%rbx), %r14
movslq %r12d, %rbp
shlq $0x4, %rbp
leaq (%r14,%rbp), %r13
leaq (%r14,%rbp), %r15
addq $-0x10, %r15
movl 0x8(%r15), %eax
addl $-0x3, %eax
cmpl $0x1, %eax
ja 0x4ec9
cmpl $0x4, 0x8(%r13)
je 0x4d89
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5064
testl %eax, %eax
je 0x4ec9
movl %r12d, 0xc(%rsp)
movq (%r13), %rax
movq 0x10(%rax), %r12
testq %r12, %r12
je 0x4eec
movq %r14, 0x30(%rsp)
movl $0x1, %r14d
movq 0x10(%rsp), %r13
cmpl $0x2, %r13d
jl 0x4dfd
movl $0x1, %r14d
cmpl $0x4, 0x8(%r15)
je 0x4dd1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5064
testl %eax, %eax
je 0x4dfd
movq (%r15), %rax
movq 0x10(%rax), %rax
movq $-0x3, %rcx
subq %r12, %rcx
cmpq %rcx, %rax
jae 0x4f2c
addq %rax, %r12
incq %r14
addq $-0x10, %r15
cmpq %r14, %r13
jne 0x4dbb
movl %r13d, %r14d
movq 0x20(%rbx), %r15
movq 0x68(%r15), %rdx
cmpq %r12, %rdx
jae 0x4e3d
cmpq $0x21, %r12
movl $0x20, %eax
cmovbq %rax, %r12
leaq 0x1(%r12), %rax
cmpq $-0x3, %rax
ja 0x4f72
movq 0x58(%r15), %rsi
movq %rbx, %rdi
movq %r12, %rcx
callq 0x42ab
movq %rax, 0x58(%r15)
movq %r12, 0x68(%r15)
movq 0x30(%rsp), %rax
leaq (%rax,%rbp), %rcx
addq $0x10, %rcx
movq %rcx, 0x28(%rsp)
movq 0x58(%r15), %r15
movl %r14d, %ecx
leal 0x1(%r14), %r13d
shlq $0x4, %rcx
movq %rcx, 0x20(%rsp)
subq %rcx, %rbp
addq %rax, %rbp
addq $0x10, %rbp
xorl %r12d, %r12d
movq %r12, %rbx
movq (%rbp), %rsi
movq 0x10(%rsi), %r12
leaq (%r15,%rbx), %rdi
addq $0x18, %rsi
movq %r12, %rdx
callq 0x31b0
addq %rbx, %r12
decl %r13d
addq $0x10, %rbp
cmpl $0x1, %r13d
jg 0x4e70
movq 0x28(%rsp), %r13
subq 0x20(%rsp), %r13
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x412b
movq %rax, (%r13)
movl $0x4, 0x8(%r13)
decl %r14d
jmp 0x4f04
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r15, %rcx
movl $0xf, %r8d
callq 0x50c2
movl $0x1, %r14d
testl %eax, %eax
jne 0x4f09
jmp 0x4f3d
movl $0x1, %r14d
cmpl $0x4, -0x8(%r13)
je 0x4f04
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5064
movl 0xc(%rsp), %r12d
movq 0x10(%rsp), %rsi
subl %r14d, %esi
subl %r14d, %r12d
cmpl $0x1, %esi
jg 0x4d41
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf737(%rip), %rsi      # 0x1466a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x46c4
movl -0x8(%r13), %eax
addl $-0x3, %eax
cmpl $0x2, %eax
cmovbq %r13, %r15
movslq 0x8(%r15), %rax
leaq 0x1590a(%rip), %rcx     # 0x1a860
movq (%rcx,%rax,8), %rcx
leaq 0xf737(%rip), %rsi      # 0x14698
leaq 0xf876(%rip), %rdx      # 0x147de
movq %rbx, %rdi
xorl %eax, %eax
callq 0x46c4
leaq 0xf6a0(%rip), %rsi      # 0x14619
jmp 0x4f33