// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x20(%rdi), %r13
movq %r13, 0x10(%rsp)
movzbl (%r15), %eax
cmpl $0x25, %eax
jne 0x129df
movzbl 0x1(%r15), %r14d
cmpq $0x66, %r14
jne 0x12a1c
cmpb $0x5b, 0x2(%r15)
jne 0x12d38
addq $0x2, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x12e10
movq %rax, %r14
cmpq (%rbx), %r12
je 0x12990
movzbl -0x1(%r12), %edi
jmp 0x12992
xorl %edi, %edi
leaq -0x1(%r14), %rbp
movq %r15, %rsi
movq %rbp, %rdx
callq 0x12e83
movb $0x1, %r13b
testl %eax, %eax
je 0x129b2
movq $0x0, (%rsp)
jmp 0x129cc
movzbl (%r12), %edi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x12e83
testl %eax, %eax
je 0x129a8
xorl %r13d, %r13d
movq %r14, %r15
testb %r13b, %r13b
movq 0x10(%rsp), %r13
je 0x1294a
jmp 0x12cbf
cmpl $0x27, %eax
jg 0x12a05
testl %eax, %eax
je 0x12c5a
cmpl $0x24, %eax
jne 0x12aa1
cmpb $0x0, 0x1(%r15)
jne 0x12aa1
jmp 0x12d1b
cmpl $0x29, %eax
je 0x12c60
cmpl $0x28, %eax
je 0x12cd2
jmp 0x12aa1
cmpl $0x62, %r14d
jne 0x12a8d
movb 0x2(%r15), %al
testb %al, %al
je 0x12d4a
movb 0x3(%r15), %cl
testb %cl, %cl
je 0x12d4a
cmpb %al, (%r12)
jne 0x12a78
movq 0x8(%rbx), %rdx
incq %r12
cmpq %rdx, %r12
jae 0x12a78
movl $0x1, %esi
movb (%r12), %dil
cmpb %cl, %dil
jne 0x12a63
decl %esi
jne 0x12a70
jmp 0x12c52
xorl %r8d, %r8d
cmpb %al, %dil
sete %r8b
addl %r8d, %esi
incq %r12
cmpq %rdx, %r12
jne 0x12a51
xorl %r12d, %r12d
testq %r12, %r12
je 0x12d11
addq $0x4, %r15
jmp 0x1294a
callq 0x32f0
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r14,2)
jne 0x12bbf
movq %rbx, %rdi
movq %r15, %rsi
callq 0x12e10
movq %rax, %r14
cmpq 0x8(%rbx), %r12
jae 0x12acc
movzbl (%r12), %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x12f14
testl %eax, %eax
setne %al
jmp 0x12ace
xorl %eax, %eax
movzbl (%r14), %ecx
cmpl $0x2c, %ecx
jg 0x12b0c
cmpl $0x2a, %ecx
je 0x12b82
cmpl $0x2b, %ecx
jne 0x12b75
movb $0x1, %bpl
testb %al, %al
je 0x12c0b
leaq 0x1(%r12), %rsi
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x12f45
jmp 0x12bb9
cmpl $0x3f, %ecx
je 0x12b9c
cmpl $0x2d, %ecx
jne 0x12b75
movq %r14, 0x8(%rsp)
movq %r14, %rbp
incq %rbp
movq %r12, %r14
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x1292a
testq %rax, %rax
je 0x12b43
xorl %ecx, %ecx
movq %rax, (%rsp)
jmp 0x12b6f
cmpq 0x8(%rbx), %r14
jae 0x12b65
movzbl (%r14), %edi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
callq 0x12f14
testl %eax, %eax
je 0x12b65
incq %r14
movb $0x1, %cl
jmp 0x12b6f
movq $0x0, (%rsp)
xorl %ecx, %ecx
testb %cl, %cl
jne 0x12b28
jmp 0x12b97
testb %al, %al
je 0x12c08
incq %r12
jmp 0x12c01
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x12f45
movq %rax, (%rsp)
movb $0x1, %bpl
jmp 0x12c13
testb %al, %al
je 0x12bfe
leaq 0x1(%r12), %rsi
leaq 0x1(%r14), %rdx
movq %rbx, %rdi
callq 0x1292a
testq %rax, %rax
je 0x12bfe
movb $0x1, %bpl
movq %rax, (%rsp)
jmp 0x12c13
cmpb $0x31, %r14b
jb 0x12d57
leal -0x31(%r14), %eax
cmpl 0x18(%rbx), %eax
jge 0x12d57
movl %eax, %eax
shlq $0x4, %rax
cmpq $-0x1, 0x8(%r13,%rax)
je 0x12d57
movq 0x8(%r13,%rax), %r14
movq 0x8(%rbx), %rcx
subq %r12, %rcx
cmpq %r14, %rcx
jae 0x12c21
xorl %r12d, %r12d
jmp 0x12c40
incq %r14
xorl %ebp, %ebp
movq %r14, %r15
jmp 0x12c13
movb $0x1, %bpl
movq $0x0, (%rsp)
testb %bpl, %bpl
je 0x1294a
jmp 0x12cbf
addq %r13, %rax
movq (%rax), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3200
addq %r14, %r12
testl %eax, %eax
movl $0x0, %eax
cmovneq %rax, %r12
testq %r12, %r12
je 0x12d11
addq $0x2, %r15
jmp 0x1294a
incq %r12
jmp 0x12a7b
movq %r12, (%rsp)
jmp 0x12cbf
incq %r15
movl 0x18(%rbx), %eax
movq %rax, %rcx
shlq $0x4, %rcx
addq %rbx, %rcx
addq $0x18, %rcx
testl %eax, %eax
jle 0x12d2b
decq %rax
cmpq $-0x1, (%rcx)
leaq -0x10(%rcx), %rcx
jne 0x12c74
movl %eax, %r14d
shlq $0x4, %r14
movq %r12, %rax
subq (%r13,%r14), %rax
movq %rax, 0x8(%r13,%r14)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1292a
movq %rax, (%rsp)
testq %rax, %rax
jne 0x12cbf
addq %r14, %r13
movq $-0x1, 0x8(%r13)
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x29, 0x1(%r15)
jne 0x12ced
addq $0x2, %r15
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
jmp 0x12cfe
incq %r15
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12dc5
movq $0x0, (%rsp)
jmp 0x12cbf
xorl %eax, %eax
cmpq 0x8(%rbx), %r12
cmoveq %r12, %rax
movq %rax, (%rsp)
jmp 0x12cbf
movq 0x10(%rbx), %rdi
leaq 0x23c4(%rip), %rsi      # 0x150fa
jmp 0x12d43
movq 0x10(%rbx), %rdi
leaq 0x2382(%rip), %rsi      # 0x150c5
xorl %eax, %eax
callq 0xa049
movq 0x10(%rbx), %rdi
leaq 0x23bd(%rip), %rsi      # 0x15112
jmp 0x12d43
movq 0x10(%rbx), %rdi
leaq 0x2406(%rip), %rsi      # 0x15168
jmp 0x12d43