// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movq 0x20(%rsp), %rax
cmpl $0x7, 0x8(%rax)
jne 0xdf00
movq 0x18(%rsp), %rdi
callq 0x50a0
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0xdcdb
cmpl $0x1, 0x10(%rsp)
jle 0xdcd6
movq 0x18(%rsp), %rax
movl 0x10(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x22, %eax
jne 0xdcd6
movq 0x18(%rsp), %rax
movl 0x10(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq 0x18(%rsp), %rdi
addq $0x1, %rdi
movl $0xc0, %esi
callq 0xdfb0
jmp 0xdf00
jmp 0xded2
movq 0x18(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0xddae
movq 0x18(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0xddae
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5080
movsd %xmm0, (%rsp)
movq 0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xdda9
movq 0xe4b7(%rip), %rax      # 0x1c1e0
addq $0x1, %rax
addq $0x8, %rax
leaq 0xc4a8(%rip), %rcx      # 0x1a1e0
addq $0x2000, %rcx           # imm = 0x2000
cmpq %rcx, %rax
jbe 0xdd66
movq 0xc2ad(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
leaq 0x85e3(%rip), %rsi      # 0x16338
movb $0x0, %al
callq 0x5110
movl $0x1, %edi
callq 0x5190
movq 0xe473(%rip), %rax      # 0x1c1e0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0xe465(%rip)      # 0x1c1e0
movb $-0x5, (%rax)
movq 0xe45b(%rip), %rdi      # 0x1c1e0
movq %rsp, %rsi
movl $0x8, %edx
callq 0xe2f0
movq 0xe447(%rip), %rax      # 0x1c1e0
addq $0x8, %rax
movq %rax, 0xe43c(%rip)      # 0x1c1e0
jmp 0xdf00
jmp 0xded0
movq 0x18(%rsp), %rdi
leaq 0x8651(%rip), %rsi      # 0x1640b
callq 0x50f0
cmpl $0x0, %eax
jne 0xde21
movq 0xe415(%rip), %rax      # 0x1c1e0
addq $0x1, %rax
leaq 0xc40a(%rip), %rcx      # 0x1a1e0
addq $0x2000, %rcx           # imm = 0x2000
cmpq %rcx, %rax
jbe 0xde04
movq 0xc20f(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
leaq 0x8545(%rip), %rsi      # 0x16338
movb $0x0, %al
callq 0x5110
movl $0x1, %edi
callq 0x5190
movq 0xe3d5(%rip), %rax      # 0x1c1e0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0xe3c7(%rip)      # 0x1c1e0
movb $-0x3, (%rax)
jmp 0xdf00
cmpl $0x4, 0x10(%rsp)
jle 0xdecc
movq 0x18(%rsp), %rdi
leaq 0x85da(%rip), %rsi      # 0x16412
movl $0x4, %edx
callq 0x5050
cmpl $0x0, %eax
jne 0xdecc
movq 0xe38e(%rip), %rax      # 0x1c1e0
addq $0x2, %rax
leaq 0xc383(%rip), %rcx      # 0x1a1e0
addq $0x2000, %rcx           # imm = 0x2000
cmpq %rcx, %rax
jbe 0xde8b
movq 0xc188(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
leaq 0x84be(%rip), %rsi      # 0x16338
movb $0x0, %al
callq 0x5110
movl $0x1, %edi
callq 0x5190
movq 0xe34e(%rip), %rax      # 0x1c1e0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0xe340(%rip)      # 0x1c1e0
movb $-0x4, (%rax)
movq 0x18(%rsp), %rdi
addq $0x4, %rdi
callq 0x5170
movb %al, %cl
movq 0xe326(%rip), %rax      # 0x1c1e0
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0xe318(%rip)      # 0x1c1e0
movb %cl, (%rax)
jmp 0xdf00
jmp 0xdece
jmp 0xded0
jmp 0xded2
movq 0xc11f(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
movq 0x18(%rsp), %rcx
leaq 0x852f(%rip), %rsi      # 0x16417
leaq 0x824b(%rip), %rdx      # 0x1613a
movb $0x0, %al
callq 0x5110
movl $0x1, %edi
callq 0x5190
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)