// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/lua/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 $0x38, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x11805(%rip), %rsi     # 0x1b17a
callq 0x9c10
pushq $-0x10
popq %r15
pushq $0x2
popq %rbp
movq %r13, %rdi
pushq $0x25
popq %rsi
callq 0x4160
testq %rax, %rax
je 0x9bc9
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 0xc466
movq %rax, (%r15)
movl $0x4, 0x8(%r15)
movq 0x10(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
cmpq $0x10, %rcx
jg 0x99de
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0x7732
movq 0x10(%rbx), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movzbl 0x1(%r12), %ecx
cmpl $0x25, %ecx
je 0x9ace
cmpl $0x63, %ecx
movq %rbp, %r15
je 0x9aa9
cmpl $0x64, %ecx
movl %r14d, %ebp
movq 0x8(%rsp), %rsi
je 0x9a3a
cmpl $0x66, %ecx
je 0x9a74
cmpl $0x70, %ecx
je 0x9a57
cmpl $0x73, %ecx
jne 0x9a96
movl (%rsi), %ecx
cmpq $0x28, %rcx
ja 0x9b70
movq %rcx, %rax
addq 0x10(%rsi), %rax
addl $0x8, %ecx
movl %ecx, (%rsi)
jmp 0x9b7c
movl (%rsi), %edx
cmpq $0x28, %rdx
ja 0x9ae8
movq %rdx, %rcx
addq 0x10(%rsi), %rcx
addl $0x8, %edx
movl %edx, (%rsi)
jmp 0x9af4
movl (%rsi), %ecx
cmpq $0x28, %rcx
ja 0x9afa
movq %rcx, %rax
addq 0x10(%rsi), %rax
addl $0x8, %ecx
movl %ecx, (%rsi)
jmp 0x9b06
movl 0x4(%rsi), %edx
cmpq $0xa0, %rdx
ja 0x9b2a
movq %rdx, %rcx
addq 0x10(%rsi), %rcx
addl $0x10, %edx
movl %edx, 0x4(%rsi)
jmp 0x9b36
movb $0x25, 0x10(%rsp)
movb %cl, 0x11(%rsp)
movb $0x0, 0x12(%rsp)
jmp 0x9ba9
movq 0x8(%rsp), %rdx
movl (%rdx), %ecx
cmpq $0x28, %rcx
movl %r14d, %ebp
ja 0x9b92
movq %rcx, %rax
addq 0x10(%rdx), %rax
addl $0x8, %ecx
movl %ecx, (%rdx)
jmp 0x9b9e
movq %rbx, %rdi
leaq 0xfc9f(%rip), %rsi      # 0x19777
callq 0x9c10
movq %rbp, %r15
movl %r14d, %ebp
jmp 0x9bb6
movq 0x8(%rsi), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsi)
cvtsi2sdl (%rcx), %xmm0
jmp 0x9b3a
movq 0x8(%rsi), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsi)
movq (%rax), %rdx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
leaq 0x10ad1(%rip), %rsi     # 0x1a5e9
xorl %eax, %eax
callq 0x44b0
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x9bb1
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 0x9b66
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0x7732
movq 0x10(%rbx), %rax
addq $0x10, %rax
movq %rax, 0x10(%rbx)
jmp 0x9bb6
movq 0x8(%rsi), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsi)
movq (%rax), %rsi
testq %rsi, %rsi
leaq 0xfbe7(%rip), %rax      # 0x19770
cmoveq %rax, %rsi
movq %rbx, %rdi
jmp 0x9bb1
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 0x9c10
addq $0x2, %r12
addq $-0x20, %r15
addl $0x2, %ebp
movq %r12, %r13
jmp 0x9981
movq %rbx, %rdi
movq %r13, %rsi
callq 0x9c10
movq 0x10(%rbx), %rdx
subq 0x18(%rbx), %rdx
shrq $0x4, %rdx
decl %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0xdea8
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