// File: /workspace/github_c_makefile_star2_O3/tylerneylon[P]APIsWithLua/lua/lobject.c
// Function: luaO_pushvfstring
const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) {
  int n = 0;
  for (;;) {
    const char *e = strchr(fmt, '%');
    if (e == NULL) break;
    pushstr(L, fmt, e - fmt);
    switch (*(e+1)) {
      case 's': {  /* zero-terminated string */
        const char *s = va_arg(argp, char *);
        if (s == NULL) s = "(null)";
        pushstr(L, s, strlen(s));
        break;
      }
      case 'c': {  /* an 'int' as a character */
        char buff = cast(char, va_arg(argp, int));
        if (lisprint(cast_uchar(buff)))
          pushstr(L, &buff, 1);
        else  /* non-printable character; print its code */
          luaO_pushfstring(L, "<\\%d>", cast_uchar(buff));
        break;
      }
      case 'd': {  /* an 'int' */
        setivalue(L->top, va_arg(argp, int));
        goto top2str;
      }
      case 'I': {  /* a 'lua_Integer' */
        setivalue(L->top, cast(lua_Integer, va_arg(argp, l_uacInt)));
        goto top2str;
      }
      case 'f': {  /* a 'lua_Number' */
        setfltvalue(L->top, cast_num(va_arg(argp, l_uacNumber)));
      top2str:  /* convert the top element to a string */
        luaD_inctop(L);
        luaO_tostring(L, L->top - 1);
        break;
      }
      case 'p': {  /* a pointer */
        char buff[4*sizeof(void *) + 8]; /* should be enough space for a '%p' */
        int l = l_sprintf(buff, sizeof(buff), "%p", va_arg(argp, void *));
        pushstr(L, buff, l);
        break;
      }
      case 'U': {  /* an 'int' as a UTF-8 sequence */
        char buff[UTF8BUFFSZ];
        int l = luaO_utf8esc(buff, cast(long, va_arg(argp, long)));
        pushstr(L, buff + UTF8BUFFSZ - l, l);
        break;
      }
      case '%': {
        pushstr(L, "%", 1);
        break;
      }
      default: {
        luaG_runerror(L, "invalid option '%%%c' to 'lua_pushfstring'",
                         *(e + 1));
      }
    }
    n += 2;
    fmt = e+2;
  }
  luaD_checkstack(L, 1);
  pushstr(L, fmt, strlen(fmt));
  if (n > 0) luaV_concat(L, n + 1);
  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, %r12
movq %rdi, %rbx
movq %rsi, %rdi
movl $0x25, %esi
callq 0x5160
testq %rax, %rax
je 0xc301
movq %rax, %r15
xorl %ebp, %ebp
movq %r15, %rdx
subq %r12, %rdx
movq 0x10(%rbx), %r13
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf828
movq %rax, (%r13)
movzbl 0x8(%rax), %eax
orl $0x40, %eax
movl %eax, 0x8(%r13)
movq %rbx, %rdi
callq 0x89bd
movzbl 0x1(%r15), %eax
cmpl $0x63, %eax
jg 0xc067
cmpl $0x54, %eax
jg 0xc0a6
cmpl $0x25, %eax
je 0xc104
cmpl $0x49, %eax
jne 0xc37d
movq 0x10(%rbx), %rax
movl (%r14), %edx
cmpq $0x28, %rdx
ja 0xc1e1
movq %rdx, %rcx
addq 0x10(%r14), %rcx
addl $0x8, %edx
movl %edx, (%r14)
jmp 0xc1ed
cmpl $0x6f, %eax
jg 0xc0d7
cmpl $0x64, %eax
je 0xc11c
cmpl $0x66, %eax
jne 0xc37d
movq 0x10(%rbx), %rax
movl 0x4(%r14), %edx
cmpq $0xa0, %rdx
ja 0xc1fa
movq %rdx, %rcx
addq 0x10(%r14), %rcx
addl $0x10, %edx
movl %edx, 0x4(%r14)
jmp 0xc206
cmpl $0x55, %eax
je 0xc138
cmpl $0x63, %eax
jne 0xc37d
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0xc233
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0xc23f
cmpl $0x70, %eax
je 0xc150
cmpl $0x73, %eax
jne 0xc37d
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0xc268
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0xc274
movq 0x10(%rbx), %r12
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x1667d(%rip), %rsi     # 0x22794
jmp 0xc2bf
movq 0x10(%rbx), %rax
movl (%r14), %edx
cmpq $0x28, %rdx
ja 0xc168
movq %rdx, %rcx
addq 0x10(%r14), %rcx
addl $0x8, %edx
movl %edx, (%r14)
jmp 0xc174
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0xc179
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0xc185
movl (%r14), %ecx
cmpq $0x28, %rcx
ja 0xc1a7
movq %rcx, %rax
addq 0x10(%r14), %rax
addl $0x8, %ecx
movl %ecx, (%r14)
jmp 0xc1b3
movq 0x8(%r14), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%r14)
movslq (%rcx), %rcx
jmp 0xc1f0
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movq (%rax), %rsi
movq %rsp, %rdi
callq 0xbeb2
movslq %eax, %rdx
leaq 0x8(%rsp), %rsi
subq %rdx, %rsi
movq 0x10(%rbx), %r12
movq %rbx, %rdi
jmp 0xc2bf
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movq (%rax), %rcx
movl $0x28, %esi
movq %rsp, %r13
movq %r13, %rdi
leaq 0x171cc(%rip), %rdx     # 0x23394
xorl %eax, %eax
callq 0x5180
movslq %eax, %rdx
movq 0x10(%rbx), %r12
movq %rbx, %rdi
movq %r13, %rsi
jmp 0xc2bf
movq 0x8(%r14), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%r14)
movq (%rcx), %rcx
movq %rcx, (%rax)
movl $0x13, %ecx
jmp 0xc213
movq 0x8(%r14), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%r14)
movsd (%rcx), %xmm0
movsd %xmm0, (%rax)
movl $0x3, %ecx
movl %ecx, 0x8(%rax)
movq %rbx, %rdi
callq 0x89bd
movq 0x10(%rbx), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0xbf1c
jmp 0xc2dc
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movl (%rax), %eax
movzbl %al, %edx
movb %dl, (%rsp)
leaq 0x17442(%rip), %rax     # 0x23690
testb $0x4, 0x1(%rdx,%rax)
jne 0xc2b0
movq %rbx, %rdi
leaq 0x1652f(%rip), %rsi     # 0x2278e
xorl %eax, %eax
callq 0xc391
jmp 0xc2dc
movq 0x8(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
movq (%rax), %r12
testq %r12, %r12
leaq 0x16506(%rip), %rax     # 0x22787
cmoveq %rax, %r12
movq %r12, %rdi
callq 0x5140
movq 0x10(%rbx), %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xf828
movq %rax, (%r13)
movzbl 0x8(%rax), %eax
orl $0x40, %eax
movl %eax, 0x8(%r13)
jmp 0xc2d4
movq 0x10(%rbx), %r12
movl $0x1, %edx
movq %rbx, %rdi
movq %rsp, %rsi
callq 0xf828
movq %rax, (%r12)
movzbl 0x8(%rax), %eax
orl $0x40, %eax
movl %eax, 0x8(%r12)
movq %rbx, %rdi
callq 0x89bd
addl $0x2, %ebp
movq %r15, %r12
addq $0x2, %r12
movq %r12, %rdi
movl $0x25, %esi
callq 0x5160
movq %rax, %r15
testq %rax, %rax
jne 0xbff7
jmp 0xc303
xorl %ebp, %ebp
movq 0x10(%rbx), %r14
movq 0x30(%rbx), %rax
subq %r14, %rax
cmpq $0x10, %rax
jg 0xc325
movq %rbx, %rdi
movl $0x1, %esi
callq 0x88b9
movq 0x10(%rbx), %r14
movq %r12, %rdi
callq 0x5140
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xf828
movq %rax, (%r14)
movzbl 0x8(%rax), %eax
orl $0x40, %eax
movl %eax, 0x8(%r14)
movq %rbx, %rdi
callq 0x89bd
testl %ebp, %ebp
je 0xc362
orl $0x1, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x12004
movq 0x10(%rbx), %rax
movq -0x10(%rax), %rax
addq $0x18, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsbl %al, %edx
leaq 0x1640f(%rip), %rsi     # 0x22796
movq %rbx, %rdi
xorl %eax, %eax
callq 0x7dd3