// File: /workspace/github_c_makefile_star2_O3/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, %r13
movq %rdi, %rbx
leaq 0x11027(%rip), %rsi     # 0x15923
callq 0x4e14
movq %r13, %rdi
movl $0x25, %esi
callq 0x30f0
testq %rax, %rax
je 0x4b59
movq %rax, %r15
movl $0x1, %ebp
movq 0x10(%rbx), %r12
movq %r15, %rdx
subq %r13, %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4265
movq %rax, (%r12)
movl $0x4, 0x8(%r12)
movq 0x10(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
cmpq $0x10, %rcx
jg 0x496c
movl 0x58(%rbx), %eax
leal 0x1(%rax), %ecx
leal (%rax,%rax), %esi
testl %eax, %eax
cmovlel %ecx, %esi
movq %rbx, %rdi
callq 0x50e7
movq 0x10(%rbx), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movb 0x1(%r15), %cl
movzbl %cl, %edx
cmpl $0x65, %edx
jg 0x49b2
cmpl $0x25, %edx
je 0x49e4
cmpl $0x63, %edx
je 0x4a22
cmpl $0x64, %edx
jne 0x4a10
movl (%r14), %edx
cmpq $0x28, %rdx
ja 0x4a72
movq %rdx, %rcx
addq 0x10(%r14), %rcx
addl $0x8, %edx
movl %edx, (%r14)
jmp 0x4a7e
cmpl $0x66, %edx
je 0x49f3
cmpl $0x70, %edx
je 0x4a41
cmpl $0x73, %edx
jne 0x4a10
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0x4ac6
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0x4ad2
movq %rbx, %rdi
leaq 0x10ca2(%rip), %rsi     # 0x15690
jmp 0x4b2f
movl 0x4(%r14), %edx
cmpq $0xa0, %rdx
ja 0x4a60
movq %rdx, %rcx
addq 0x10(%r14), %rcx
addl $0x10, %edx
movl %edx, 0x4(%r14)
jmp 0x4a6c
movb $0x25, (%rsp)
movb %cl, 0x1(%rsp)
movb $0x0, 0x2(%rsp)
jmp 0x4afe
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0x4ae8
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0x4af4
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0x4b06
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0x4b12
movq 0x8(%r14), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%r14)
movsd (%rcx), %xmm0
jmp 0x4a85
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 0x10(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
cmpq $0x10, %rcx
jg 0x4abc
movl 0x58(%rbx), %eax
leal 0x1(%rax), %ecx
leal (%rax,%rax), %esi
testl %eax, %eax
cmovlel %ecx, %esi
movq %rbx, %rdi
callq 0x50e7
movq 0x10(%rbx), %rax
addq $0x10, %rax
movq %rax, 0x10(%rbx)
jmp 0x4b34
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movq (%rax), %rsi
testq %rsi, %rsi
leaq 0x10ba7(%rip), %rax     # 0x15686
cmoveq %rax, %rsi
movq %rbx, %rdi
jmp 0x4b2f
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 0x4b2f
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movq (%rax), %rdx
movq %rsp, %r12
movq %r12, %rdi
leaq 0x10b6b(%rip), %rsi     # 0x1568d
xorl %eax, %eax
callq 0x3290
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4e14
addl $0x2, %ebp
movq %r15, %r13
addq $0x2, %r13
movq %r13, %rdi
movl $0x25, %esi
callq 0x30f0
movq %rax, %r15
testq %rax, %rax
jne 0x491f
jmp 0x4b5e
movl $0x1, %ebp
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4e14
leal 0x1(%rbp), %esi
movq 0x10(%rbx), %rdx
subq 0x18(%rbx), %rdx
shrq $0x4, %rdx
decl %edx
movq %rbx, %rdi
callq 0x4e7d
movq 0x10(%rbx), %rax
movl %ebp, %ecx
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