// File: /workspace/github_c_makefile_star2_O3/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 0x4f9b
cmpl $0x4, 0x8(%r13)
je 0x4ede
movq %rbx, %rdi
movq %r13, %rsi
callq 0x51cc
testl %eax, %eax
je 0x4f9b
movl %r12d, 0xc(%rsp)
movq (%r13), %rax
movq 0x10(%rax), %r12
testq %r12, %r12
je 0x4fc5
movq %r14, 0x30(%rsp)
movl $0x1, %r14d
movq 0x10(%rsp), %r13
cmpl $0x2, %r13d
jl 0x4f52
movl $0x1, %r14d
cmpl $0x4, 0x8(%r15)
je 0x4f26
movq %rbx, %rdi
movq %r15, %rsi
callq 0x51cc
testl %eax, %eax
je 0x4f52
movq (%r15), %rax
movq 0x10(%rax), %rax
movq $-0x3, %rcx
subq %r12, %rcx
cmpq %rcx, %rax
jae 0x5098
addq %rax, %r12
incq %r14
addq $-0x10, %r15
cmpq %r14, %r13
jne 0x4f10
movl %r13d, %r14d
movq 0x20(%rbx), %r13
movq 0x68(%r13), %rdx
cmpq %r12, %rdx
jae 0x4fe6
cmpq $0x21, %r12
movl $0x20, %eax
cmovbq %rax, %r12
leaq 0x1(%r12), %rax
cmpq $-0x3, %rax
ja 0x50de
movq 0x58(%r13), %rsi
movq %rbx, %rdi
movq %r12, %rcx
callq 0x43d1
movq %rax, %r15
movq %rax, 0x58(%r13)
movq %r12, 0x68(%r13)
jmp 0x4fea
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r15, %rcx
movl $0xf, %r8d
callq 0x522a
movl $0x1, %r14d
testl %eax, %eax
jne 0x5075
jmp 0x50a9
movl $0x1, %r14d
cmpl $0x4, -0x8(%r13)
je 0x5070
movq %rbx, %rdi
movq %r15, %rsi
callq 0x51cc
jmp 0x5070
movq 0x58(%r13), %r15
movq 0x30(%rsp), %rax
leaq (%rax,%rbp), %rcx
addq $0x10, %rcx
movq %rcx, 0x28(%rsp)
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 0x5019
movq 0x28(%rsp), %r13
subq 0x20(%rsp), %r13
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4265
movq %rax, (%r13)
movl $0x4, 0x8(%r13)
decl %r14d
movl 0xc(%rsp), %r12d
movq 0x10(%rsp), %rsi
subl %r14d, %esi
subl %r14d, %r12d
cmpl $0x1, %esi
jg 0x4e96
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x105f3(%rip), %rsi     # 0x15692
movq %rbx, %rdi
xorl %eax, %eax
callq 0x47e0
movl -0x8(%r13), %eax
addl $-0x3, %eax
cmpl $0x2, %eax
cmovbq %r13, %r15
movslq 0x8(%r15), %rax
leaq 0x1679e(%rip), %rcx     # 0x1b860
movq (%rcx,%rax,8), %rcx
leaq 0x105f3(%rip), %rsi     # 0x156c0
leaq 0x10732(%rip), %rdx     # 0x15806
movq %rbx, %rdi
xorl %eax, %eax
callq 0x47e0
leaq 0x1055c(%rip), %rsi     # 0x15641
jmp 0x509f