// File: /workspace/github_c_makefile_star2_O2/zenkj[P]luajit-arm64/src/host/buildvm_lib.c
// Function: libdef_push
static void libdef_push(BuildCtx *ctx, char *p, int arg)
{
  UNUSED(arg);
  if (ctx->mode == BUILD_libdef) {
    int len = (int)strlen(p);
    if (*p == '"') {
      if (len > 1 && p[len-1] == '"') {
	p[len-1] = '\0';
	libdef_name(p+1, LIBINIT_STRING);
	return;
      }
    } else if (*p >= '0' && *p <= '9') {
      char *ep;
      double d = strtod(p, &ep);
      if (*ep == '\0') {
	if (optr+1+sizeof(double) > obuf+sizeof(obuf)) {
	  fprintf(stderr, "Error: output buffer overflow\n");
	  exit(1);
	}
	*optr++ = LIBINIT_NUMBER;
	memcpy_endian(optr, &d, sizeof(double));
	optr += sizeof(double);
	return;
      }
    } else if (!strcmp(p, "lastcl")) {
      if (optr+1 > obuf+sizeof(obuf)) {
	fprintf(stderr, "Error: output buffer overflow\n");
	exit(1);
      }
      *optr++ = LIBINIT_LASTCL;
      return;
    } else if (len > 4 && !strncmp(p, "top-", 4)) {
      if (optr+2 > obuf+sizeof(obuf)) {
	fprintf(stderr, "Error: output buffer overflow\n");
	exit(1);
      }
      *optr++ = LIBINIT_COPY;
      *optr++ = (uint8_t)atoi(p+4);
      return;
    }
    fprintf(stderr, "Error: bad value for %sPUSH(%s)\n", LIBDEF_PREFIX, p);
    exit(1);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpl $0x7, 0x8(%rdi)
jne 0xa20d
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x50a0
movq %rax, %r14
movb (%rbx), %al
cmpb $0x22, %al
jne 0xa129
cmpl $0x2, %r14d
jl 0xa217
decl %r14d
cmpb $0x22, (%rbx,%r14)
jne 0xa217
movb $0x0, (%rbx,%r14)
incq %rbx
movq %rbx, %rdi
movl $0xc0, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xa2a8
addb $-0x30, %al
cmpb $0x9, %al
ja 0xa17a
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5080
movq (%r14), %rax
cmpb $0x0, (%rax)
jne 0xa217
movq 0xe09e(%rip), %rax      # 0x181f0
leaq 0x9(%rax), %rcx
leaq 0xe093(%rip), %rdx      # 0x181f0
cmpq %rdx, %rcx
ja 0xa23b
movb $-0x5, (%rax)
movsd %xmm0, 0x1(%rax)
movq %rcx, 0xe07b(%rip)      # 0x181f0
jmp 0xa20d
leaq 0x72aa(%rip), %rsi      # 0x1142b
movq %rbx, %rdi
callq 0x5110
testl %eax, %eax
je 0xa1ec
cmpl $0x5, %r14d
jl 0xa217
leaq 0x7294(%rip), %rsi      # 0x11432
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x5050
testl %eax, %eax
jne 0xa217
movq 0xe03c(%rip), %r14      # 0x181f0
leaq 0x2(%r14), %r15
leaq 0xe031(%rip), %rax      # 0x181f0
cmpq %rax, %r15
ja 0xa23b
leaq 0x1(%r14), %rax
movq %rax, 0xe021(%rip)      # 0x181f0
movb $-0x4, (%r14)
addq $0x4, %rbx
movq %rbx, %rdi
callq 0x51a0
movq %r15, 0xe00a(%rip)      # 0x181f0
movb %al, 0x1(%r14)
jmp 0xa20d
movq 0xdffd(%rip), %rax      # 0x181f0
leaq 0x1(%rax), %rcx
leaq 0xdff2(%rip), %rdx      # 0x181f0
cmpq %rdx, %rcx
ja 0xa23b
movq %rcx, 0xdfe6(%rip)      # 0x181f0
movb $-0x3, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0xbdda(%rip), %rax      # 0x15ff8
movq (%rax), %rdi
leaq 0x720f(%rip), %rsi      # 0x11437
leaq 0x6f2b(%rip), %rdx      # 0x1115a
movq %rbx, %rcx
xorl %eax, %eax
callq 0x5130
jmp 0xa257
movq 0xbdb6(%rip), %rax      # 0x15ff8
movq (%rax), %rcx
leaq 0x710c(%rip), %rdi      # 0x11358
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
callq 0x51d0
pushq $0x1
popq %rdi
callq 0x51c0