// File: /workspace/github_c_makefile_star2_O0/fanf2[P]luajit-2/src/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 (allowany && !strcmp("any", p)) {
      return 0xff;
    } 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 $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movl %edx, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0xe774
movq 0x18(%rsp), %rdi
movl $0x20, %esi
callq 0x40b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0xe52a
movq 0x8(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rsp)
movb $0x0, (%rax)
movq 0x8(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
cmpl $0x0, 0x24(%rsp)
je 0xe5ba
movq 0x18(%rsp), %rdi
leaq 0x6938(%rip), %rsi      # 0x14e82
movl $0x6, %edx
callq 0x4050
cmpl $0x0, %eax
jne 0xe5ba
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, %ecx
leaq 0x8e02(%rip), %rax      # 0x17370
cmpq $0x0, (%rax,%rcx,8)
je 0xe5b5
movl 0x14(%rsp), %eax
movl %eax, %ecx
leaq 0x8dee(%rip), %rax      # 0x17370
movq (%rax,%rcx,8), %rdi
movq 0x18(%rsp), %rsi
addq $0x6, %rsi
callq 0x40f0
cmpl $0x0, %eax
jne 0xe5a6
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0xe77c
jmp 0xe5a8
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xe561
jmp 0xe747
cmpl $0x0, 0x24(%rsp)
je 0xe63d
movq 0x18(%rsp), %rdi
leaq 0x68bc(%rip), %rsi      # 0x14e89
movl $0x5, %edx
callq 0x4050
cmpl $0x0, %eax
jne 0xe63d
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, %ecx
leaq 0x8def(%rip), %rax      # 0x173e0
cmpq $0x0, (%rax,%rcx,8)
je 0xe638
movl 0x14(%rsp), %eax
movl %eax, %ecx
leaq 0x8ddb(%rip), %rax      # 0x173e0
movq (%rax,%rcx,8), %rdi
movq 0x18(%rsp), %rsi
addq $0x5, %rsi
callq 0x40f0
cmpl $0x0, %eax
jne 0xe629
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0xe77c
jmp 0xe62b
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xe5e4
jmp 0xe745
cmpl $0x0, 0x24(%rsp)
je 0xe6c0
movq 0x18(%rsp), %rdi
leaq 0x683f(%rip), %rsi      # 0x14e8f
movl $0x7, %edx
callq 0x4050
cmpl $0x0, %eax
jne 0xe6c0
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, %ecx
leaq 0x8dcc(%rip), %rax      # 0x17440
cmpq $0x0, (%rax,%rcx,8)
je 0xe6bb
movl 0x14(%rsp), %eax
movl %eax, %ecx
leaq 0x8db8(%rip), %rax      # 0x17440
movq (%rax,%rcx,8), %rdi
movq 0x18(%rsp), %rsi
addq $0x7, %rsi
callq 0x40f0
cmpl $0x0, %eax
jne 0xe6ac
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0xe77c
jmp 0xe6ae
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xe667
jmp 0xe743
cmpl $0x0, 0x20(%rsp)
je 0xe6ea
movq 0x18(%rsp), %rsi
leaq 0x67c4(%rip), %rdi      # 0x14e97
callq 0x40f0
cmpl $0x0, %eax
jne 0xe6ea
movl $0xff, 0x34(%rsp)
jmp 0xe77c
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, %ecx
leaq 0x89e1(%rip), %rax      # 0x170e0
cmpq $0x0, (%rax,%rcx,8)
je 0xe73f
movl 0x14(%rsp), %eax
movl %eax, %ecx
leaq 0x89cd(%rip), %rax      # 0x170e0
movq (%rax,%rcx,8), %rdi
movq 0x18(%rsp), %rsi
callq 0x40f0
cmpl $0x0, %eax
jne 0xe730
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0xe77c
jmp 0xe732
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xe6f2
jmp 0xe741
jmp 0xe743
jmp 0xe745
jmp 0xe747
movq 0x98aa(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq 0x18(%rsp), %rdx
movl 0xbb24(%rip), %ecx      # 0x1a280
leaq 0x6738(%rip), %rsi      # 0x14e9b
movb $0x0, %al
callq 0x4110
movl $0x1, %edi
callq 0x4190
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)