// File: /workspace/github_c_makefile_star2_O2/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: str_find_aux
static int str_find_aux(lua_State*L,int find){
size_t l1,l2;
const char*s=luaL_checklstring(L,1,&l1);
const char*p=luaL_checklstring(L,2,&l2);
ptrdiff_t init=posrelat(luaL_optinteger(L,3,1),l1)-1;
if(init<0)init=0;
else if((size_t)(init)>l1)init=(ptrdiff_t)l1;
if(find&&(lua_toboolean(L,4)||
strpbrk(p,"^$*+?.([%-")==NULL)){
const char*s2=lmemfind(s+init,l1-init,p,l2);
if(s2){
lua_pushinteger(L,s2-s+1);
lua_pushinteger(L,s2-s+l2);
return 2;
}
}
else{
MatchState ms;
int anchor=(*p=='^')?(p++,1):0;
const char*s1=s+init;
ms.L=L;
ms.src_init=s;
ms.src_end=s+l1;
do{
const char*res;
ms.level=0;
if((res=match(&ms,s1,p))!=NULL){
if(find){
lua_pushinteger(L,s1-s+1);
lua_pushinteger(L,res-s);
return push_captures(&ms,NULL,0)+2;
}
else
return push_captures(&ms,s1,res);
}
}while(s1++<ms.src_end&&!anchor);
}
lua_pushnil(L);
return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movl %esi, %ebp
movq %rdi, %r14
pushq $0x1
popq %rsi
leaq 0x20(%rsp), %rbx
movq %rbx, %rdx
callq 0x9b97
movq %rax, %r15
pushq $0x2
popq %rsi
leaq 0x18(%rsp), %rdx
movq %r14, %rdi
callq 0x9b97
movq %rax, %r12
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x9c2f
movq (%rbx), %r13
leaq 0x1(%r13), %rcx
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rcx, %rdx
addq %rax, %rdx
xorl %eax, %eax
testq %rdx, %rdx
movl $0x0, %ebx
cmovgq %rdx, %rbx
decq %rbx
cmpq %r13, %rbx
cmovaeq %r13, %rbx
testq %rdx, %rdx
cmovleq %rax, %rbx
testl %ebp, %ebp
movq %r14, 0x8(%rsp)
movq %r15, 0x10(%rsp)
je 0x109b6
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x9522
testl %eax, %eax
je 0x1099e
leaq (%r15,%rbx), %rbp
movq %r15, %rax
movq 0x18(%rsp), %r15
testq %r15, %r15
je 0x10a6e
subq %rbx, %r13
cmpq %r13, %r15
ja 0x10a73
decq %r15
subq %r15, %r13
movq %r12, %rax
incq %rax
movq %rax, (%rsp)
testq %r13, %r13
je 0x10a73
movsbl (%r12), %esi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x3130
testq %rax, %rax
je 0x10a73
movq %rax, %r14
leaq 0x1(%rax), %rbx
movq %rbx, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
callq 0x31f0
testl %eax, %eax
je 0x10a9e
addq %rbp, %r13
subq %rbx, %r13
movq %rbx, %rbp
jmp 0x10953
leaq 0x273d(%rip), %rsi      # 0x130e2
movq %r12, %rdi
callq 0x3210
testq %rax, %rax
je 0x10922
movl %ebp, (%rsp)
movq %r14, %rcx
movb (%r12), %r14b
xorl %eax, %eax
cmpb $0x5e, %r14b
sete %al
addq %rax, %r12
movq %r15, %rax
addq %rbx, %r15
leaq 0x28(%rsp), %rbp
movq %rcx, 0x10(%rbp)
movq %rax, (%rbp)
addq %rax, %r13
movq %r13, 0x8(%rbp)
incq %rbx
andl $0x0, 0x40(%rsp)
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x10afa
testq %rax, %rax
jne 0x10a1a
cmpb $0x5e, %r14b
je 0x10a73
leaq 0x1(%r15), %rax
incq %rbx
cmpq 0x30(%rsp), %r15
movq %rax, %r15
jb 0x109e9
jmp 0x10a73
cmpl $0x0, (%rsp)
je 0x10a8c
movq 0x8(%rsp), %rsi
movq 0x10(%rsi), %rcx
cvtsi2sd %rbx, %xmm0
movsd %xmm0, (%rcx)
pushq $0x3
popq %rdi
movl %edi, 0x8(%rcx)
movq 0x10(%rsi), %rcx
leaq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rsi)
subq 0x10(%rsp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x10(%rcx)
movl %edi, 0x18(%rcx)
addq $0x10, 0x10(%rsi)
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10e94
addl $0x2, %eax
jmp 0x10ae8
testq %rax, %rax
jne 0x10aa1
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rax
andl $0x0, 0x8(%rax)
addq $0x10, %rax
movq %rax, 0x10(%rcx)
pushq $0x1
jmp 0x10ae7
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x10e94
jmp 0x10ae8
movq %r14, %rbp
subq 0x10(%rsp), %rbp
leaq 0x1(%rbp), %rax
cvtsi2sd %rax, %xmm0
movq 0x8(%rsp), %rdx
movq 0x10(%rdx), %rax
movsd %xmm0, (%rax)
pushq $0x3
popq %rsi
movl %esi, 0x8(%rax)
movq 0x10(%rdx), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdx)
addq 0x18(%rsp), %rbp
cvtsi2sd %rbp, %xmm0
movsd %xmm0, 0x10(%rax)
movl %esi, 0x18(%rax)
addq $0x10, 0x10(%rdx)
pushq $0x2
popq %rax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq