// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x20(%rdi), %rax
movq %rax, (%rsp)
leaq 0x1(%r15), %r13
movq %rbp, %r12
movzbl (%r12), %eax
leal -0x24(%rax), %ecx
cmpl $0x5, %ecx
ja 0x10bcb
leaq 0x18b3(%rip), %rdx      # 0x123e8
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movzbl 0x1(%r12), %r14d
cmpq $0x66, %r14
jne 0x10bac
cmpb $0x5b, 0x2(%r12)
jne 0x10e68
addq $0x2, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10f51
movq %rax, %rbp
cmpq (%rbx), %r15
je 0x10b74
movzbl -0x1(%r15), %edi
jmp 0x10b76
xorl %edi, %edi
leaq -0x1(%rbp), %r14
movq %r12, %rsi
movq %r14, %rdx
callq 0x10fce
testl %eax, %eax
jne 0x10daf
movzbl (%r15), %edi
movq %r12, %rsi
movq %r14, %rdx
callq 0x10fce
movq %rbp, %r12
testl %eax, %eax
jne 0x10b1d
jmp 0x10daf
cmpl $0x62, %r14d
je 0x10c3a
callq 0x32e0
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r14,2)
je 0x10be1
jmp 0x10ccb
testl %eax, %eax
je 0x10db3
jmp 0x10be1
cmpb $0x0, 0x1(%r12)
je 0x10e4c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10f51
movq %rax, %rbp
cmpq 0x8(%rbx), %r15
jae 0x10c0b
movzbl (%r15), %edi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x1104f
testl %eax, %eax
setne %al
jmp 0x10c0d
xorl %eax, %eax
movzbl (%rbp), %ecx
cmpl $0x3f, %ecx
jne 0x10c8e
testb %al, %al
je 0x10c32
leaq 0x1(%rbp), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x10afa
testq %rax, %rax
jne 0x10db6
incq %rbp
jmp 0x10b1a
movb 0x2(%r12), %al
testb %al, %al
je 0x10e7a
movb 0x3(%r12), %cl
testb %cl, %cl
je 0x10e7a
cmpb %al, (%r15)
jne 0x10daf
movq 0x8(%rbx), %rdx
pushq $0x1
popq %rsi
cmpq %rdx, %r13
jae 0x10daf
movb (%r13), %dil
cmpb %cl, %dil
jne 0x10c7c
decl %esi
jne 0x10c89
jmp 0x10cb9
xorl %r8d, %r8d
cmpb %al, %dil
sete %r8b
addl %r8d, %esi
incq %r13
jmp 0x10c64
cmpl $0x2a, %ecx
je 0x10dee
cmpl $0x2b, %ecx
je 0x10de7
cmpl $0x2d, %ecx
je 0x10e0d
testb %al, %al
je 0x10daf
incq %r15
jmp 0x10b16
incq %r13
addq $0x4, %r12
movq %r12, %rbp
movq %r13, %r15
jmp 0x10b16
cmpb $0x31, %r14b
jb 0x10e87
leal -0x31(%r14), %eax
cmpl 0x18(%rbx), %eax
jge 0x10e87
movl %eax, %eax
shlq $0x4, %rax
movq (%rsp), %rcx
movq 0x8(%rcx,%rax), %r13
cmpq $-0x1, %r13
je 0x10e87
movq 0x8(%rbx), %rcx
subq %r15, %rcx
cmpq %r13, %rcx
jb 0x10daf
movq (%rsp), %rcx
movq (%rcx,%rax), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x31f0
testl %eax, %eax
jne 0x10daf
testq %r15, %r15
movl $0x0, %eax
je 0x10db6
addq %r13, %r15
addq $0x2, %r12
movq %r12, %rbp
jmp 0x10b16
cmpb $0x29, 0x1(%r12)
jne 0x10dc5
addq $0x2, %r12
pushq $-0x2
jmp 0x10dca
incq %r12
movl 0x18(%rbx), %eax
movq %rax, %rcx
shlq $0x4, %rcx
addq %rbx, %rcx
addq $0x18, %rcx
movq (%rsp), %r13
testl %eax, %eax
jle 0x10e5b
decq %rax
cmpq $-0x1, (%rcx)
leaq -0x10(%rcx), %rcx
jne 0x10d6b
movl %eax, %r14d
shlq $0x4, %r14
movq %r15, %rax
subq (%r13,%r14), %rax
movq %rax, 0x8(%r13,%r14)
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x10afa
testq %rax, %rax
jne 0x10db6
addq %r14, %r13
orq $-0x1, 0x8(%r13)
xorl %eax, %eax
jmp 0x10db6
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incq %r12
pushq $-0x1
popq %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f06
testb %al, %al
je 0x10daf
incq %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbp, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1107e
movq %rbp, %r13
incq %r13
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x10afa
testq %rax, %rax
jne 0x10db6
cmpq 0x8(%rbx), %r15
jae 0x10daf
movzbl (%r15), %edi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x1104f
incq %r15
testl %eax, %eax
movl $0x0, %eax
jne 0x10e13
jmp 0x10db6
xorl %eax, %eax
cmpq 0x8(%rbx), %r15
cmoveq %r15, %rax
jmp 0x10db6
movq 0x10(%rbx), %rdi
leaq 0x22bc(%rip), %rsi      # 0x13122
jmp 0x10e73
movq 0x10(%rbx), %rdi
leaq 0x227a(%rip), %rsi      # 0x130ed
xorl %eax, %eax
callq 0x9546
movq 0x10(%rbx), %rdi
leaq 0x22b5(%rip), %rsi      # 0x1313a
jmp 0x10e73
movq 0x10(%rbx), %rdi
leaq 0x22fe(%rip), %rsi      # 0x13190
jmp 0x10e73