// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/lua-5.1.5/src/lobject.c
// Function: luaO_pushvfstring
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;
    setsvalue2s(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]; /* should be enough space for a `%p' */
        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 0x9657e(%rip), %rsi     # 0xeeb7f
callq 0x66d58
movl $0x1, %r13d
movq %r15, %rdi
movl $0x25, %esi
callq 0xb210
movq %rax, %rbp
testq %rax, %rax
je 0x58822
movq 0x10(%rbx), %r12
movq %rbp, %rdx
subq %r15, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x583e8
movq %rax, (%r12)
movl $0x4, 0x8(%r12)
movq 0x38(%rbx), %rax
subq 0x10(%rbx), %rax
cmpq $0x10, %rax
jg 0x58662
movq %rbx, %rdi
movl $0x1, %esi
callq 0x576ac
movq 0x10(%rbx), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movb 0x1(%rbp), %cl
movzbl %cl, %edx
cmpl $0x65, %edx
jg 0x586ab
cmpl $0x25, %edx
je 0x586dd
cmpl $0x63, %edx
je 0x5871b
cmpl $0x64, %edx
jne 0x58709
movl (%r14), %edx
cmpq $0x28, %rdx
ja 0x5876b
movq %rdx, %rcx
addq 0x10(%r14), %rcx
addl $0x8, %edx
movl %edx, (%r14)
jmp 0x58777
cmpl $0x66, %edx
je 0x586ec
cmpl $0x70, %edx
je 0x5873a
cmpl $0x73, %edx
jne 0x58709
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0x587ac
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0x587b8
movq %rbx, %rdi
leaq 0x95c35(%rip), %rsi     # 0xee31c
jmp 0x58815
movl 0x4(%r14), %edx
cmpq $0xa0, %rdx
ja 0x58759
movq %rdx, %rcx
addq 0x10(%r14), %rcx
addl $0x10, %edx
movl %edx, 0x4(%r14)
jmp 0x58765
movb $0x25, (%rsp)
movb %cl, 0x1(%rsp)
movb $0x0, 0x2(%rsp)
jmp 0x587e4
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0x587ce
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0x587da
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0x587ec
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0x587f8
movq 0x8(%r14), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%r14)
movsd (%rcx), %xmm0
jmp 0x5877e
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 0x587a5
movq %rbx, %rdi
movl $0x1, %esi
callq 0x576ac
addq $0x10, 0x10(%rbx)
jmp 0x5881a
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movq (%rax), %rsi
testq %rsi, %rsi
leaq 0x95b50(%rip), %rax     # 0xee315
cmoveq %rax, %rsi
movq %rbx, %rdi
jmp 0x58815
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 0x58815
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movq (%rax), %rdx
movq %rsp, %r15
movq %r15, %rdi
leaq 0x95eb6(%rip), %rsi     # 0xee6be
xorl %eax, %eax
callq 0xb110
movq %rbx, %rdi
movq %r15, %rsi
callq 0x66d58
addl $0x2, %r13d
leaq 0x2(%rbp), %r15
testq %rbp, %rbp
jne 0x5860c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x66d58
leal 0x1(%r13), %esi
movq 0x10(%rbx), %rdx
subq 0x18(%rbx), %rdx
shrq $0x4, %rdx
decl %edx
movq %rbx, %rdi
callq 0x59c5f
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