// File: /workspace/github_c_makefile_star2_O0/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: str_format
static int str_format(lua_State*L){
int top=lua_gettop(L);
int arg=1;
size_t sfl;
const char*strfrmt=luaL_checklstring(L,arg,&sfl);
const char*strfrmt_end=strfrmt+sfl;
luaL_Buffer b;
luaL_buffinit(L,&b);
while(strfrmt<strfrmt_end){
if(*strfrmt!='%')
luaL_addchar(&b,*strfrmt++);
else if(*++strfrmt=='%')
luaL_addchar(&b,*strfrmt++);
else{
char form[(sizeof("-+ #0")+sizeof("l")+10)];
char buff[512];
if(++arg>top)
luaL_argerror(L,arg,"no value");
strfrmt=scanformat(L,strfrmt,form);
switch(*strfrmt++){
case'c':{
sprintf(buff,form,(int)luaL_checknumber(L,arg));
break;
}
case'd':case'i':{
addintlen(form);
sprintf(buff,form,(long)luaL_checknumber(L,arg));
break;
}
case'o':case'u':case'x':case'X':{
addintlen(form);
sprintf(buff,form,(unsigned long)luaL_checknumber(L,arg));
break;
}
case'e':case'E':case'f':
case'g':case'G':{
sprintf(buff,form,(double)luaL_checknumber(L,arg));
break;
}
case'q':{
addquoted(L,&b,arg);
continue;
}
case's':{
size_t l;
const char*s=luaL_checklstring(L,arg,&l);
if(!strchr(form,'.')&&l>=100){
lua_pushvalue(L,arg);
luaL_addvalue(&b);
continue;
}
else{
sprintf(buff,form,s);
break;
}
}
default:{
return luaL_error(L,"invalid option "LUA_QL("%%%c")" to "
LUA_QL("format"),*(strfrmt-1));
}
}
luaL_addlstring(&b,buff,strlen(buff));
}
}
luaL_pushresult(&b);
return 1;
}

// Assembly:
subq $0x22d8, %rsp           # imm = 0x22D8
movq %rdi, 0x22c8(%rsp)
movq 0x22c8(%rsp), %rdi
callq 0x10910
movl %eax, 0x22c4(%rsp)
movl $0x1, 0x22c0(%rsp)
movq 0x22c8(%rsp), %rdi
movl 0x22c0(%rsp), %esi
leaq 0x22b8(%rsp), %rdx
callq 0x11450
movq %rax, 0x22b0(%rsp)
movq 0x22b0(%rsp), %rax
addq 0x22b8(%rsp), %rax
movq %rax, 0x22a8(%rsp)
movq 0x22c8(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x1b5c0
movq 0x22b0(%rsp), %rax
cmpq 0x22a8(%rsp), %rax
jae 0x1e0a2
movq 0x22b0(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x1dd2e
movq 0x290(%rsp), %rcx
leaq 0x290(%rsp), %rdx
addq $0x18, %rdx
addq $0x2000, %rdx           # imm = 0x2000
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, 0x5f(%rsp)
jb 0x1dcf3
leaq 0x290(%rsp), %rdi
callq 0x1b990
cmpq $0x0, %rax
setne %al
movb %al, 0x5f(%rsp)
movb 0x5f(%rsp), %al
movq 0x22b0(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x22b0(%rsp)
movb (%rax), %cl
movq 0x290(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x290(%rsp)
movb %cl, (%rax)
jmp 0x1e09d
movq 0x22b0(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x22b0(%rsp)
movsbl 0x1(%rax), %eax
cmpl $0x25, %eax
jne 0x1ddc7
movq 0x290(%rsp), %rcx
leaq 0x290(%rsp), %rdx
addq $0x18, %rdx
addq $0x2000, %rdx           # imm = 0x2000
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, 0x5e(%rsp)
jb 0x1dd8c
leaq 0x290(%rsp), %rdi
callq 0x1b990
cmpq $0x0, %rax
setne %al
movb %al, 0x5e(%rsp)
movb 0x5e(%rsp), %al
movq 0x22b0(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x22b0(%rsp)
movb (%rax), %cl
movq 0x290(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x290(%rsp)
movb %cl, (%rax)
jmp 0x1e09b
movl 0x22c0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x22c0(%rsp)
cmpl 0x22c4(%rsp), %eax
jle 0x1ddfc
movq 0x22c8(%rsp), %rdi
movl 0x22c0(%rsp), %esi
leaq 0x4e16(%rip), %rdx      # 0x22c0d
callq 0x10980
movq 0x22c8(%rsp), %rdi
movq 0x22b0(%rsp), %rsi
leaq 0x270(%rsp), %rdx
callq 0x1fd10
movq %rax, 0x22b0(%rsp)
movq 0x22b0(%rsp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, 0x22b0(%rsp)
movsbl (%rax), %eax
addl $-0x45, %eax
movl %eax, %ecx
movq %rcx, 0x50(%rsp)
subl $0x33, %eax
ja 0x1e047
movq 0x50(%rsp), %rax
leaq 0x4547(%rip), %rcx      # 0x223a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x70(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x270(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x22c8(%rsp), %rdi
movl 0x22c0(%rsp), %esi
callq 0x1ff10
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
cvttsd2si %xmm0, %edx
movb $0x0, %al
callq 0x3280
jmp 0x1e072
leaq 0x270(%rsp), %rdi
callq 0x1ff70
leaq 0x70(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x270(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x22c8(%rsp), %rdi
movl 0x22c0(%rsp), %esi
callq 0x1ff10
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
cvttsd2si %xmm0, %rdx
movb $0x0, %al
callq 0x3280
jmp 0x1e072
leaq 0x270(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x1ff70
leaq 0x70(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x22c8(%rsp), %rdi
movl 0x22c0(%rsp), %esi
callq 0x1ff10
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rdx
movq %rdx, %rcx
sarq $0x3f, %rcx
movsd 0x483d(%rip), %xmm1     # 0x22788
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rcx, %rax
orq %rax, %rdx
movb $0x0, %al
callq 0x3280
jmp 0x1e072
leaq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x270(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x22c8(%rsp), %rdi
movl 0x22c0(%rsp), %esi
callq 0x1ff10
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movb $0x1, %al
callq 0x3280
jmp 0x1e072
movq 0x22c8(%rsp), %rdi
movl 0x22c0(%rsp), %edx
leaq 0x290(%rsp), %rsi
callq 0x1fff0
jmp 0x1dc8f
movq 0x22c8(%rsp), %rdi
movl 0x22c0(%rsp), %esi
leaq 0x68(%rsp), %rdx
callq 0x11450
movq %rax, 0x60(%rsp)
leaq 0x270(%rsp), %rdi
movl $0x2e, %esi
callq 0x3100
cmpq $0x0, %rax
jne 0x1e02c
cmpq $0x64, 0x68(%rsp)
jb 0x1e02c
movq 0x22c8(%rsp), %rdi
movl 0x22c0(%rsp), %esi
callq 0xf7f0
leaq 0x290(%rsp), %rdi
callq 0x1b760
jmp 0x1dc8f
leaq 0x70(%rsp), %rdi
leaq 0x270(%rsp), %rsi
movq 0x60(%rsp), %rdx
movb $0x0, %al
callq 0x3280
jmp 0x1e072
movq 0x22c8(%rsp), %rdi
movq 0x22b0(%rsp), %rax
movsbl -0x1(%rax), %edx
leaq 0x5306(%rip), %rsi      # 0x23368
movb $0x0, %al
callq 0x10790
movl %eax, 0x22d4(%rsp)
jmp 0x1e0ba
leaq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x30f0
movq 0x8(%rsp), %rsi
movq %rax, %rdx
leaq 0x290(%rsp), %rdi
callq 0x1b690
jmp 0x1e09d
jmp 0x1dc8f
leaq 0x290(%rsp), %rdi
callq 0x1b730
movl $0x1, 0x22d4(%rsp)
movl 0x22d4(%rsp), %eax
addq $0x22d8, %rsp           # imm = 0x22D8
retq
nopl (%rax)