// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x12dba(%rip), %rsi     # 0x1d1a2
callq 0xa68b
movq %r13, %rdi
movl $0x25, %esi
callq 0x4160
testq %rax, %rax
je 0xa633
movq %rax, %r15
movl $0x1, %ebp
movq 0x10(%rbx), %r12
movq %r15, %rdx
subq %r13, %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xd282
movq %rax, (%r12)
movl $0x4, 0x8(%r12)
movq 0x10(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
cmpq $0x10, %rcx
jg 0xa44f
movq %rbx, %rdi
movl $0x1, %esi
callq 0x7c11
movq 0x10(%rbx), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movb 0x1(%r15), %cl
movzbl %cl, %edx
cmpl $0x65, %edx
jg 0xa495
cmpl $0x25, %edx
je 0xa4c7
cmpl $0x63, %edx
je 0xa505
cmpl $0x64, %edx
jne 0xa4f3
movl (%r14), %edx
cmpq $0x28, %rdx
ja 0xa555
movq %rdx, %rcx
addq 0x10(%r14), %rcx
addl $0x8, %edx
movl %edx, (%r14)
jmp 0xa561
cmpl $0x66, %edx
je 0xa4d6
cmpl $0x70, %edx
je 0xa524
cmpl $0x73, %edx
jne 0xa4f3
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0xa5a0
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0xa5ac
movq %rbx, %rdi
leaq 0x112c6(%rip), %rsi     # 0x1b797
jmp 0xa609
movl 0x4(%r14), %edx
cmpq $0xa0, %rdx
ja 0xa543
movq %rdx, %rcx
addq 0x10(%r14), %rcx
addl $0x10, %edx
movl %edx, 0x4(%r14)
jmp 0xa54f
movb $0x25, (%rsp)
movb %cl, 0x1(%rsp)
movb $0x0, 0x2(%rsp)
jmp 0xa5d8
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0xa5c2
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0xa5ce
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0xa5e0
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0xa5ec
movq 0x8(%r14), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%r14)
movsd (%rcx), %xmm0
jmp 0xa568
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 0xa596
movq %rbx, %rdi
movl $0x1, %esi
callq 0x7c11
movq 0x10(%rbx), %rax
addq $0x10, %rax
movq %rax, 0x10(%rbx)
jmp 0xa60e
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movq (%rax), %rsi
testq %rsi, %rsi
leaq 0x111d7(%rip), %rax     # 0x1b790
cmoveq %rax, %rsi
movq %rbx, %rdi
jmp 0xa609
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 0xa609
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movq (%rax), %rdx
movq %rsp, %r12
movq %r12, %rdi
leaq 0x1202d(%rip), %rsi     # 0x1c629
xorl %eax, %eax
callq 0x44c0
movq %rbx, %rdi
movq %r12, %rsi
callq 0xa68b
addl $0x2, %ebp
movq %r15, %r13
addq $0x2, %r13
movq %r13, %rdi
movl $0x25, %esi
callq 0x4160
movq %rax, %r15
testq %rax, %rax
jne 0xa40b
jmp 0xa638
movl $0x1, %ebp
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa68b
leal 0x1(%rbp), %esi
movq 0x10(%rbx), %rdx
subq 0x18(%rbx), %rdx
shrq $0x4, %rdx
decl %edx
movq %rbx, %rdi
callq 0xf190
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