// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: luaO_pushvfstring
static const char*luaO_pushvfstring(lua_State*L,const char*fmt,va_list argp){
int n=1;
pushstr(L,"");
for(;;){
const char*e=strchr(fmt,'%');
if(e==NULL)break;
setsvalue(L,L->top,luaS_newlstr(L,fmt,e-fmt));
incr_top(L);
switch(*(e+1)){
case's':{
const char*s=va_arg(argp,char*);
if(s==NULL)s="(null)";
pushstr(L,s);
break;
}
case'c':{
char buff[2];
buff[0]=cast(char,va_arg(argp,int));
buff[1]='\0';
pushstr(L,buff);
break;
}
case'd':{
setnvalue(L->top,cast_num(va_arg(argp,int)));
incr_top(L);
break;
}
case'f':{
setnvalue(L->top,cast_num(va_arg(argp,l_uacNumber)));
incr_top(L);
break;
}
case'p':{
char buff[4*sizeof(void*)+8];
sprintf(buff,"%p",va_arg(argp,void*));
pushstr(L,buff);
break;
}
case'%':{
pushstr(L,"%");
break;
}
default:{
char buff[3];
buff[0]='%';
buff[1]=*(e+1);
buff[2]='\0';
pushstr(L,buff);
break;
}
}
n+=2;
fmt=e+2;
}
pushstr(L,fmt);
luaV_concat(L,n+1,cast_int(L->top-L->base)-1);
L->top-=n;
return svalue(L->top-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x1011b(%rip), %rsi     # 0x148fb
callq 0x4cbd
movl $0x1, %r13d
movq %r15, %rdi
movl $0x25, %esi
callq 0x30f0
movq %rax, %rbp
testq %rax, %rax
je 0x4a01
movq 0x10(%rbx), %r12
movq %rbp, %rdx
subq %r15, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x412b
movq %rax, (%r12)
movl $0x4, 0x8(%r12)
movq 0x38(%rbx), %rax
subq 0x10(%rbx), %rax
cmpq $0x10, %rax
jg 0x4841
movq %rbx, %rdi
movl $0x1, %esi
callq 0x4d13
movq 0x10(%rbx), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movb 0x1(%rbp), %cl
movzbl %cl, %edx
cmpl $0x65, %edx
jg 0x488a
cmpl $0x25, %edx
je 0x48bc
cmpl $0x63, %edx
je 0x48fa
cmpl $0x64, %edx
jne 0x48e8
movl (%r14), %edx
cmpq $0x28, %rdx
ja 0x494a
movq %rdx, %rcx
addq 0x10(%r14), %rcx
addl $0x8, %edx
movl %edx, (%r14)
jmp 0x4956
cmpl $0x66, %edx
je 0x48cb
cmpl $0x70, %edx
je 0x4919
cmpl $0x73, %edx
jne 0x48e8
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0x498b
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0x4997
movq %rbx, %rdi
leaq 0xfda2(%rip), %rsi      # 0x14668
jmp 0x49f4
movl 0x4(%r14), %edx
cmpq $0xa0, %rdx
ja 0x4938
movq %rdx, %rcx
addq 0x10(%r14), %rcx
addl $0x10, %edx
movl %edx, 0x4(%r14)
jmp 0x4944
movb $0x25, (%rsp)
movb %cl, 0x1(%rsp)
movb $0x0, 0x2(%rsp)
jmp 0x49c3
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0x49ad
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0x49b9
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0x49cb
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0x49d7
movq 0x8(%r14), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%r14)
movsd (%rcx), %xmm0
jmp 0x495d
movq 0x8(%r14), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%r14)
xorps %xmm0, %xmm0
cvtsi2sdl (%rcx), %xmm0
movsd %xmm0, 0x10(%rax)
movl $0x3, 0x18(%rax)
movq 0x38(%rbx), %rax
subq 0x10(%rbx), %rax
cmpq $0x10, %rax
jg 0x4984
movq %rbx, %rdi
movl $0x1, %esi
callq 0x4d13
addq $0x10, 0x10(%rbx)
jmp 0x49f9
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movq (%rax), %rsi
testq %rsi, %rsi
leaq 0xfcba(%rip), %rax      # 0x1465e
cmoveq %rax, %rsi
movq %rbx, %rdi
jmp 0x49f4
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movb (%rax), %al
movb %al, (%rsp)
movb $0x0, 0x1(%rsp)
movq %rbx, %rdi
movq %rsp, %rsi
jmp 0x49f4
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movq (%rax), %rdx
movq %rsp, %r15
movq %r15, %rdi
leaq 0xfc7e(%rip), %rsi      # 0x14665
xorl %eax, %eax
callq 0x3290
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4cbd
addl $0x2, %r13d
leaq 0x2(%rbp), %r15
testq %rbp, %rbp
jne 0x47eb
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4cbd
leal 0x1(%r13), %esi
movq 0x10(%rbx), %rdx
subq 0x18(%rbx), %rdx
shrq $0x4, %rdx
decl %edx
movq %rbx, %rdi
callq 0x4d28
movq 0x10(%rbx), %rax
movslq %r13d, %rcx
shlq $0x4, %rcx
movq %rax, %rdx
subq %rcx, %rdx
movq %rdx, 0x10(%rbx)
negq %rcx
movq -0x10(%rax,%rcx), %rax
addq $0x18, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq