// File: /workspace/github_c_makefile_star2_O0/zenkj[P]luajit-arm64/src/host/buildvm_fold.c
// Function: nexttoken
static uint32_t nexttoken(char **pp, int allowlit, int allowany)
{
  char *p = *pp;
  if (p) {
    uint32_t i;
    char *q = strchr(p, ' ');
    if (q) *q++ = '\0';
    *pp = q;
    if (allowlit && !strncmp(p, "IRFPM_", 6)) {
      for (i = 0; irfpm_names[i]; i++)
	if (!strcmp(irfpm_names[i], p+6))
	  return i;
    } else if (allowlit && !strncmp(p, "IRFL_", 5)) {
      for (i = 0; irfield_names[i]; i++)
	if (!strcmp(irfield_names[i], p+5))
	  return i;
    } else if (allowlit && !strncmp(p, "IRCALL_", 7)) {
      for (i = 0; ircall_names[i]; i++)
	if (!strcmp(ircall_names[i], p+7))
	  return i;
    } else if (allowlit && !strncmp(p, "IRCONV_", 7)) {
      for (i = 0; irt_names[i]; i++) {
	const char *r = strchr(p+7, '_');
	if (r && !strncmp(irt_names[i], p+7, r-(p+7))) {
	  uint32_t j;
	  for (j = 0; irt_names[j]; j++)
	    if (!strcmp(irt_names[j], r+1))
	      return (i << 5) + j;
	}
      }
    } else if (allowlit && *p >= '0' && *p <= '9') {
      for (i = 0; *p >= '0' && *p <= '9'; p++)
	i = i*10 + (*p - '0');
      if (*p == '\0')
	return i;
    } else if (allowany && !strcmp("any", p)) {
      return allowany;
    } else {
      for (i = 0; ir_names[i]; i++)
	if (!strcmp(ir_names[i], p))
	  return i;
    }
    fprintf(stderr, "Error: bad fold definition token \"%s\" at line %d\n", p, lineno);
    exit(1);
  }
  return 0;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movl %edx, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0xee2c
movq 0x28(%rsp), %rdi
movl $0x20, %esi
callq 0x50b0
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0xea1a
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movb $0x0, (%rax)
movq 0x18(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
cmpl $0x0, 0x34(%rsp)
je 0xeaaa
movq 0x28(%rsp), %rdi
leaq 0x7b4c(%rip), %rsi      # 0x16586
movl $0x6, %edx
callq 0x5050
cmpl $0x0, %eax
jne 0xeaaa
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl %eax, %ecx
leaq 0xa6a2(%rip), %rax      # 0x19100
cmpq $0x0, (%rax,%rcx,8)
je 0xeaa5
movl 0x24(%rsp), %eax
movl %eax, %ecx
leaq 0xa68e(%rip), %rax      # 0x19100
movq (%rax,%rcx,8), %rdi
movq 0x28(%rsp), %rsi
addq $0x6, %rsi
callq 0x50f0
cmpl $0x0, %eax
jne 0xea96
movl 0x24(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xee34
jmp 0xea98
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xea51
jmp 0xedff
cmpl $0x0, 0x34(%rsp)
je 0xeb2d
movq 0x28(%rsp), %rdi
leaq 0x7ad0(%rip), %rsi      # 0x1658d
movl $0x5, %edx
callq 0x5050
cmpl $0x0, %eax
jne 0xeb2d
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl %eax, %ecx
leaq 0xa68f(%rip), %rax      # 0x19170
cmpq $0x0, (%rax,%rcx,8)
je 0xeb28
movl 0x24(%rsp), %eax
movl %eax, %ecx
leaq 0xa67b(%rip), %rax      # 0x19170
movq (%rax,%rcx,8), %rdi
movq 0x28(%rsp), %rsi
addq $0x5, %rsi
callq 0x50f0
cmpl $0x0, %eax
jne 0xeb19
movl 0x24(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xee34
jmp 0xeb1b
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xead4
jmp 0xedfd
cmpl $0x0, 0x34(%rsp)
je 0xebb0
movq 0x28(%rsp), %rdi
leaq 0x7a53(%rip), %rsi      # 0x16593
movl $0x7, %edx
callq 0x5050
cmpl $0x0, %eax
jne 0xebb0
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl %eax, %ecx
leaq 0xa69c(%rip), %rax      # 0x19200
cmpq $0x0, (%rax,%rcx,8)
je 0xebab
movl 0x24(%rsp), %eax
movl %eax, %ecx
leaq 0xa688(%rip), %rax      # 0x19200
movq (%rax,%rcx,8), %rdi
movq 0x28(%rsp), %rsi
addq $0x7, %rsi
callq 0x50f0
cmpl $0x0, %eax
jne 0xeb9c
movl 0x24(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xee34
jmp 0xeb9e
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xeb57
jmp 0xedfb
cmpl $0x0, 0x34(%rsp)
je 0xeccf
movq 0x28(%rsp), %rdi
leaq 0x79d4(%rip), %rsi      # 0x1659b
movl $0x7, %edx
callq 0x5050
cmpl $0x0, %eax
jne 0xeccf
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl %eax, %ecx
leaq 0xa441(%rip), %rax      # 0x19030
cmpq $0x0, (%rax,%rcx,8)
je 0xecca
movq 0x28(%rsp), %rdi
addq $0x7, %rdi
movl $0x5f, %esi
callq 0x50b0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0xecb8
movl 0x24(%rsp), %eax
movl %eax, %ecx
leaq 0xa405(%rip), %rax      # 0x19030
movq (%rax,%rcx,8), %rdi
movq 0x28(%rsp), %rsi
addq $0x7, %rsi
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rax
addq $0x7, %rax
subq %rax, %rdx
callq 0x5050
cmpl $0x0, %eax
jne 0xecb8
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, %ecx
leaq 0xa3c8(%rip), %rax      # 0x19030
cmpq $0x0, (%rax,%rcx,8)
je 0xecb6
movl 0xc(%rsp), %eax
movl %eax, %ecx
leaq 0xa3b4(%rip), %rax      # 0x19030
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rsi
addq $0x1, %rsi
callq 0x50f0
cmpl $0x0, %eax
jne 0xeca7
movl 0x24(%rsp), %eax
shll $0x5, %eax
addl 0xc(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xee34
jmp 0xeca9
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xec5b
jmp 0xecb8
jmp 0xecba
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xebe2
jmp 0xedf9
cmpl $0x0, 0x34(%rsp)
je 0xed74
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0xed74
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0xed74
movl $0x0, 0x24(%rsp)
movq 0x28(%rsp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, 0xb(%rsp)
jl 0xed25
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
setle %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0xed2f
jmp 0xed55
imull $0xa, 0x24(%rsp), %eax
movq 0x28(%rsp), %rcx
movsbl (%rcx), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, 0x24(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0xed00
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xed6f
movl 0x24(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xee34
jmp 0xedf7
cmpl $0x0, 0x30(%rsp)
je 0xed9e
movq 0x28(%rsp), %rsi
leaq 0x781c(%rip), %rdi      # 0x165a3
callq 0x50f0
cmpl $0x0, %eax
jne 0xed9e
movl 0x30(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xee34
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl %eax, %ecx
leaq 0x9f7d(%rip), %rax      # 0x18d30
cmpq $0x0, (%rax,%rcx,8)
je 0xedf3
movl 0x24(%rsp), %eax
movl %eax, %ecx
leaq 0x9f69(%rip), %rax      # 0x18d30
movq (%rax,%rcx,8), %rdi
movq 0x28(%rsp), %rsi
callq 0x50f0
cmpl $0x0, %eax
jne 0xede4
movl 0x24(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xee34
jmp 0xede6
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xeda6
jmp 0xedf5
jmp 0xedf7
jmp 0xedf9
jmp 0xedfb
jmp 0xedfd
jmp 0xedff
movq 0xb1f2(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
movq 0x28(%rsp), %rdx
movl 0xd47c(%rip), %ecx      # 0x1c290
leaq 0x778c(%rip), %rsi      # 0x165a7
movb $0x0, %al
callq 0x5110
movl $0x1, %edi
callq 0x5190
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)