// File: /workspace/github_c_makefile_star2_O0/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: match
static const char*match(MatchState*ms,const char*s,const char*p){
init:
switch(*p){
case'(':{
if(*(p+1)==')')
return start_capture(ms,s,p+2,(-2));
else
return start_capture(ms,s,p+1,(-1));
}
case')':{
return end_capture(ms,s,p+1);
}
case'%':{
switch(*(p+1)){
case'b':{
s=matchbalance(ms,s,p+2);
if(s==NULL)return NULL;
p+=4;goto init;
}
case'f':{
const char*ep;char previous;
p+=2;
if(*p!='[')
luaL_error(ms->L,"missing "LUA_QL("[")" after "
LUA_QL("%%f")" in pattern");
ep=classend(ms,p);
previous=(s==ms->src_init)?'\0':*(s-1);
if(matchbracketclass(uchar(previous),p,ep-1)||
!matchbracketclass(uchar(*s),p,ep-1))return NULL;
p=ep;goto init;
}
default:{
if(isdigit(uchar(*(p+1)))){
s=match_capture(ms,s,uchar(*(p+1)));
if(s==NULL)return NULL;
p+=2;goto init;
}
goto dflt;
}
}
}
case'\0':{
return s;
}
case'$':{
if(*(p+1)=='\0')
return(s==ms->src_end)?s:NULL;
else goto dflt;
}
default:dflt:{
const char*ep=classend(ms,p);
int m=s<ms->src_end&&singlematch(uchar(*s),p,ep);
switch(*ep){
case'?':{
const char*res;
if(m&&((res=match(ms,s+1,ep+1))!=NULL))
return res;
p=ep+1;goto init;
}
case'*':{
return max_expand(ms,s,p,ep);
}
case'+':{
return(m?max_expand(ms,s+1,p,ep):NULL);
}
case'-':{
return min_expand(ms,s,p,ep);
}
default:{
if(!m)return NULL;
s++;p=ep;goto init;
}
}
}
}
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
movl %eax, %ecx
movq %rcx, 0x28(%rsp)
subl $0x29, %eax
ja 0x1ef4f
movq 0x28(%rsp), %rax
leaq 0x3799(%rip), %rcx      # 0x22470
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x58(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x29, %eax
jne 0x1ed15
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq $0x2, %rdx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x1f190
movq %rax, 0x70(%rsp)
jmp 0x1f0d9
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq $0x1, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x1f190
movq %rax, 0x70(%rsp)
jmp 0x1f0d9
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq $0x1, %rdx
callq 0x1f260
movq %rax, 0x70(%rsp)
jmp 0x1f0d9
movq 0x58(%rsp), %rax
movsbl 0x1(%rax), %eax
movl %eax, 0x24(%rsp)
subl $0x62, %eax
je 0x1ed80
jmp 0x1ed72
movl 0x24(%rsp), %eax
subl $0x66, %eax
je 0x1edc6
jmp 0x1ee92
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq $0x2, %rdx
callq 0x1f300
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x60(%rsp)
jne 0x1edb3
movq $0x0, 0x70(%rsp)
jmp 0x1f0d9
movq 0x58(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x58(%rsp)
jmp 0x1ecb3
movq 0x58(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
je 0x1edf8
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x44ab(%rip), %rsi      # 0x2329c
movb $0x0, %al
callq 0x10790
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x1f410
movq %rax, 0x50(%rsp)
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x1ee23
xorl %eax, %eax
movl %eax, 0x20(%rsp)
jmp 0x1ee30
movq 0x60(%rsp), %rax
movsbl -0x1(%rax), %eax
movl %eax, 0x20(%rsp)
movl 0x20(%rsp), %eax
movb %al, 0x4f(%rsp)
movzbl 0x4f(%rsp), %edi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq $-0x1, %rdx
callq 0x1f530
cmpl $0x0, %eax
jne 0x1ee75
movq 0x60(%rsp), %rax
movzbl (%rax), %edi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq $-0x1, %rdx
callq 0x1f530
cmpl $0x0, %eax
jne 0x1ee83
movq $0x0, 0x70(%rsp)
jmp 0x1f0d9
movq 0x50(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x1ecb3
callq 0x32d0
movq (%rax), %rax
movq 0x58(%rsp), %rcx
movzbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x1eefa
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rax
movzbl 0x1(%rax), %edx
callq 0x1f660
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x60(%rsp)
jne 0x1eee7
movq $0x0, 0x70(%rsp)
jmp 0x1f0d9
movq 0x58(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x58(%rsp)
jmp 0x1ecb3
jmp 0x1ef51
movq 0x60(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x1f0d9
movq 0x58(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x1ef4d
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1ef35
movq 0x60(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x1ef3e
xorl %eax, %eax
movq %rax, 0x18(%rsp)
jmp 0x1ef3e
movq 0x18(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x1f0d9
jmp 0x1ef51
jmp 0x1ef51
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x1f410
movq %rax, 0x40(%rsp)
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %rdx
xorl %eax, %eax
cmpq 0x8(%rdx), %rcx
movb %al, 0x17(%rsp)
jae 0x1ef9c
movq 0x60(%rsp), %rax
movzbl (%rax), %edi
movq 0x58(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x1f710
cmpl $0x0, %eax
setne %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, 0x3c(%rsp)
movq 0x40(%rsp), %rax
movsbl (%rax), %eax
addl $-0x2a, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x15, %eax
ja 0x1f0aa
movq 0x8(%rsp), %rax
leaq 0x3547(%rip), %rcx      # 0x22518
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x3c(%rsp)
je 0x1f017
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
addq $0x1, %rsi
movq 0x40(%rsp), %rdx
addq $0x1, %rdx
callq 0x1eca0
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
je 0x1f017
movq 0x30(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x1f0d9
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x1ecb3
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x40(%rsp), %rcx
callq 0x1f7b0
movq %rax, 0x70(%rsp)
jmp 0x1f0d9
cmpl $0x0, 0x3c(%rsp)
je 0x1f077
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
addq $0x1, %rsi
movq 0x58(%rsp), %rdx
movq 0x40(%rsp), %rcx
callq 0x1f7b0
movq %rax, (%rsp)
jmp 0x1f07f
xorl %eax, %eax
movq %rax, (%rsp)
jmp 0x1f07f
movq (%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x1f0d9
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x40(%rsp), %rcx
callq 0x1f890
movq %rax, 0x70(%rsp)
jmp 0x1f0d9
cmpl $0x0, 0x3c(%rsp)
jne 0x1f0bc
movq $0x0, 0x70(%rsp)
jmp 0x1f0d9
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x1ecb3
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)