// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, %r13
movq %rdi, %rbx
leaq 0xe2fa(%rip), %rsi      # 0x12923
callq 0x4b0d
pushq $-0x10
popq %r15
pushq $0x2
popq %rbp
movq %r13, %rdi
pushq $0x25
popq %rsi
callq 0x30f0
testq %rax, %rax
je 0x487d
movq %rax, %r12
movl %ebp, %r14d
movq %r15, %rbp
movq 0x10(%rbx), %r15
movq %rax, %rdx
subq %r13, %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4008
movq %rax, (%r15)
movl $0x4, 0x8(%r15)
movq 0x10(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
cmpq $0x10, %rcx
jg 0x4692
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0x4b6b
movq 0x10(%rbx), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movzbl 0x1(%r12), %ecx
cmpl $0x25, %ecx
je 0x4782
cmpl $0x63, %ecx
movq %rbp, %r15
je 0x475d
cmpl $0x64, %ecx
movl %r14d, %ebp
movq 0x8(%rsp), %rsi
je 0x46ee
cmpl $0x66, %ecx
je 0x4728
cmpl $0x70, %ecx
je 0x470b
cmpl $0x73, %ecx
jne 0x474a
movl (%rsi), %ecx
cmpq $0x28, %rcx
ja 0x4824
movq %rcx, %rax
addq 0x10(%rsi), %rax
addl $0x8, %ecx
movl %ecx, (%rsi)
jmp 0x4830
movl (%rsi), %edx
cmpq $0x28, %rdx
ja 0x479c
movq %rdx, %rcx
addq 0x10(%rsi), %rcx
addl $0x8, %edx
movl %edx, (%rsi)
jmp 0x47a8
movl (%rsi), %ecx
cmpq $0x28, %rcx
ja 0x47ae
movq %rcx, %rax
addq 0x10(%rsi), %rax
addl $0x8, %ecx
movl %ecx, (%rsi)
jmp 0x47ba
movl 0x4(%rsi), %edx
cmpq $0xa0, %rdx
ja 0x47de
movq %rdx, %rcx
addq 0x10(%rsi), %rcx
addl $0x10, %edx
movl %edx, 0x4(%rsi)
jmp 0x47ea
movb $0x25, 0x10(%rsp)
movb %cl, 0x11(%rsp)
movb $0x0, 0x12(%rsp)
jmp 0x485d
movq 0x8(%rsp), %rdx
movl (%rdx), %ecx
cmpq $0x28, %rcx
movl %r14d, %ebp
ja 0x4846
movq %rcx, %rax
addq 0x10(%rdx), %rax
addl $0x8, %ecx
movl %ecx, (%rdx)
jmp 0x4852
movq %rbx, %rdi
leaq 0xdf04(%rip), %rsi      # 0x12690
callq 0x4b0d
movq %rbp, %r15
movl %r14d, %ebp
jmp 0x486a
movq 0x8(%rsi), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsi)
cvtsi2sdl (%rcx), %xmm0
jmp 0x47ee
movq 0x8(%rsi), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsi)
movq (%rax), %rdx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
leaq 0xdec1(%rip), %rsi      # 0x1268d
xorl %eax, %eax
callq 0x3280
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x4865
movq 0x8(%rsi), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsi)
movsd (%rcx), %xmm0
movsd %xmm0, 0x10(%rax)
movl $0x3, 0x18(%rax)
movq 0x10(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
cmpq $0x10, %rcx
jg 0x481a
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0x4b6b
movq 0x10(%rbx), %rax
addq $0x10, %rax
movq %rax, 0x10(%rbx)
jmp 0x486a
movq 0x8(%rsi), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsi)
movq (%rax), %rsi
testq %rsi, %rsi
leaq 0xde49(%rip), %rax      # 0x12686
cmoveq %rax, %rsi
movq %rbx, %rdi
jmp 0x4865
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movb (%rax), %al
movb %al, 0x10(%rsp)
movb $0x0, 0x11(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x4b0d
addq $0x2, %r12
addq $-0x20, %r15
addl $0x2, %ebp
movq %r12, %r13
jmp 0x4635
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4b0d
movq 0x10(%rbx), %rdx
subq 0x18(%rbx), %rdx
shrq $0x4, %rdx
decl %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4b80
movq 0x10(%rbx), %rax
leaq (%rax,%r15), %rcx
movq %rcx, 0x10(%rbx)
movq -0x10(%rax,%r15), %rax
addq $0x18, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq