// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movq %rdx, %rbp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rdi), %rax
movq %rax, 0x8(%rsp)
xorl %r15d, %r15d
leaq 0x1(%rbx), %rax
movq %rax, 0x10(%rsp)
movq %rbp, %r12
movzbl (%r12), %eax
cmpl $0x25, %eax
jne 0x13844
movzbl 0x1(%r12), %r13d
cmpq $0x66, %r13
jne 0x13877
cmpb $0x5b, 0x2(%r12)
jne 0x13b61
addq $0x2, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x13c39
movq %rax, %rbp
cmpq (%r14), %rbx
je 0x13811
movzbl -0x1(%rbx), %edi
jmp 0x13813
xorl %edi, %edi
leaq -0x1(%rbp), %r13
movq %r12, %rsi
movq %r13, %rdx
callq 0x13cb6
testl %eax, %eax
jne 0x13ab3
movzbl (%rbx), %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x13cb6
movq %rbp, %r12
testl %eax, %eax
jne 0x137ce
jmp 0x13ab3
cmpl $0x27, %eax
jg 0x13863
testl %eax, %eax
je 0x13a00
cmpl $0x24, %eax
jne 0x13891
cmpb $0x0, 0x1(%r12)
jne 0x13891
jmp 0x13b44
cmpl $0x29, %eax
je 0x13a24
cmpl $0x28, %eax
je 0x13a08
jmp 0x13891
cmpl $0x62, %r13d
je 0x138ef
callq 0x32f0
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r13,2)
jne 0x1398a
movq %r14, %rdi
movq %r12, %rsi
callq 0x13c39
movq %rax, %rbp
cmpq 0x8(%r14), %rbx
jae 0x138ba
movzbl (%rbx), %edi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x13d47
testl %eax, %eax
setne %al
jmp 0x138bc
xorl %eax, %eax
movzbl (%rbp), %ecx
cmpl $0x3f, %ecx
jne 0x1394e
testb %al, %al
je 0x138e7
leaq 0x1(%rbp), %rdx
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x1379f
testq %rax, %rax
jne 0x13a79
incq %rbp
jmp 0x137cb
movb 0x2(%r12), %al
testb %al, %al
je 0x13b73
movb 0x3(%r12), %cl
testb %cl, %cl
je 0x13b73
cmpb %al, (%rbx)
jne 0x13ab3
movq 0x8(%r14), %rdx
incq %rbx
cmpq %rdx, %rbx
jae 0x13ab3
movl $0x1, %esi
movb (%rbx), %dil
cmpb %cl, %dil
jne 0x13934
decl %esi
jne 0x13941
jmp 0x1397b
xorl %r8d, %r8d
cmpb %al, %dil
sete %r8b
addl %r8d, %esi
incq %rbx
cmpq %rdx, %rbx
jne 0x13926
jmp 0x13ab3
cmpl $0x2a, %ecx
je 0x13acc
cmpl $0x2b, %ecx
je 0x13ac5
cmpl $0x2d, %ecx
je 0x13aeb
testb %al, %al
je 0x13ab3
movq 0x10(%rsp), %rbx
jmp 0x137c2
incq %rbx
addq $0x4, %r12
movq %r12, %rbp
jmp 0x137c2
cmpb $0x31, %r13b
jb 0x13b80
leal -0x31(%r13), %eax
cmpl 0x18(%r14), %eax
jge 0x13b80
movl %eax, %eax
shlq $0x4, %rax
movq 0x8(%rsp), %rcx
movq 0x8(%rcx,%rax), %r13
cmpq $-0x1, %r13
je 0x13b80
movq 0x8(%r14), %rcx
subq %rbx, %rcx
cmpq %r13, %rcx
jb 0x13ab3
movq 0x8(%rsp), %rcx
movq (%rcx,%rax), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x3200
testl %eax, %eax
jne 0x13ab3
testq %rbx, %rbx
je 0x13ab3
addq %r13, %rbx
addq $0x2, %r12
movq %r12, %rbp
jmp 0x137c2
movq %rbx, %r15
jmp 0x13ab3
cmpb $0x29, 0x1(%r12)
jne 0x13a7e
addq $0x2, %r12
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
jmp 0x13a8f
incq %r12
movl 0x18(%r14), %eax
movq %rax, %rcx
shlq $0x4, %rcx
addq %r14, %rcx
addq $0x18, %rcx
movq 0x8(%rsp), %r15
testl %eax, %eax
jle 0x13b54
decq %rax
cmpq $-0x1, (%rcx)
leaq -0x10(%rcx), %rcx
jne 0x13a3e
movl %eax, %r13d
shlq $0x4, %r13
movq %rbx, %rax
subq (%r15,%r13), %rax
movq %rax, 0x8(%r15,%r13)
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1379f
testq %rax, %rax
je 0x13aa2
movq %rax, %r15
jmp 0x13ab3
incq %r12
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13bee
movq %r15, %rcx
addq %r13, %rcx
movq $-0x1, 0x8(%rcx)
xorl %r15d, %r15d
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %al, %al
je 0x13ab0
incq %rbx
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %rbp, %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13d78
movq %rbp, %r13
incq %r13
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1379f
testq %rax, %rax
jne 0x13a79
jmp 0x13b39
movzbl (%rbx), %edi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x13d47
testl %eax, %eax
je 0x13ab0
incq %rbx
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1379f
movq %rax, %r15
testq %rax, %rax
jne 0x13ab3
cmpq 0x8(%r14), %rbx
jb 0x13b0a
jmp 0x13ab0
xorl %r15d, %r15d
cmpq 0x8(%r14), %rbx
cmoveq %rbx, %r15
jmp 0x13ab3
movq 0x10(%r14), %rdi
leaq 0x25c3(%rip), %rsi      # 0x16122
jmp 0x13b6c
movq 0x10(%r14), %rdi
leaq 0x2581(%rip), %rsi      # 0x160ed
xorl %eax, %eax
callq 0xa940
movq 0x10(%r14), %rdi
leaq 0x25bc(%rip), %rsi      # 0x1613a
jmp 0x13b6c
movq 0x10(%r14), %rdi
leaq 0x2605(%rip), %rsi      # 0x16190
jmp 0x13b6c