// File: /workspace/github_c_makefile_star2_O3/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 $0x258, %rsp            # imm = 0x258
movl %esi, %r13d
movq %rdi, %r14
leaq 0x30(%rsp), %rbx
movl $0x1, %esi
movq %rbx, %rdx
callq 0xb00c
movq %rax, 0x18(%rsp)
leaq 0x28(%rsp), %rdx
movq %r14, %rdi
movl $0x2, %esi
callq 0xb00c
movq %rax, %r15
movl $0x1, %edx
movq %r14, %rdi
movl $0x3, %esi
callq 0xb093
movq (%rbx), %r12
leaq 0x1(%r12), %rcx
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rcx, %rdx
addq %rax, %rdx
xorl %eax, %eax
testq %rdx, %rdx
movl $0x0, %ebp
cmovgq %rdx, %rbp
decq %rbp
cmpq %r12, %rbp
cmovaeq %r12, %rbp
testq %rdx, %rdx
cmovleq %rax, %rbp
movl %r13d, 0xc(%rsp)
testl %r13d, %r13d
je 0x135aa
movq 0x10(%r14), %rdx
movq 0x18(%r14), %rcx
addq $0x30, %rcx
cmpq %rdx, %rcx
leaq 0x1f25(%rip), %rax      # 0x15498
cmovbq %rcx, %rax
movl 0x8(%rax), %ecx
testl %ecx, %ecx
je 0x13590
cmpl $0x1, %ecx
jne 0x13622
cmpl $0x0, (%rax)
jne 0x13622
leaq 0x2b4b(%rip), %rsi      # 0x160e2
movq %r15, %rdi
movq %rdx, %rbx
callq 0x3220
movq %rbx, %rdx
testq %rax, %rax
je 0x13622
movb (%r15), %bl
xorl %eax, %eax
cmpb $0x5e, %bl
sete %al
addq %rax, %r15
movq 0x18(%rsp), %rcx
leaq (%rcx,%rbp), %r13
movq %r14, %rax
leaq 0x38(%rsp), %r14
movq %rax, 0x10(%rsp)
movq %rax, 0x10(%r14)
movq %rcx, (%r14)
addq %rcx, %r12
movq %r12, 0x8(%r14)
incq %rbp
movl $0x0, 0x50(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x1379f
testq %rax, %rax
jne 0x136b1
cmpb $0x5e, %bl
je 0x13614
leaq 0x1(%r13), %rax
incq %rbp
cmpq 0x40(%rsp), %r13
movq %rax, %r13
jb 0x135df
movq 0x10(%rsp), %r14
movq 0x10(%r14), %rdx
jmp 0x13710
movq 0x18(%rsp), %rax
leaq (%rax,%rbp), %rbx
movq 0x28(%rsp), %rcx
testq %rcx, %rcx
je 0x1370b
subq %rbp, %r12
cmpq %r12, %rcx
ja 0x13710
decq %rcx
subq %rcx, %r12
je 0x13710
movq %rcx, %rbp
movq %rdx, 0x20(%rsp)
movq %r14, 0x10(%rsp)
movsbl (%r15), %eax
movl %eax, 0xc(%rsp)
incq %r15
movq %rbx, %rdi
movl 0xc(%rsp), %esi
movq %r12, %rdx
callq 0x3140
testq %rax, %rax
je 0x136a5
movq %rax, %r14
leaq 0x1(%rax), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x3200
testl %eax, %eax
je 0x13748
addq %rbx, %r12
movq %r13, %rbx
subq %r13, %r12
jne 0x13669
movq 0x10(%rsp), %r14
movq 0x20(%rsp), %rdx
jmp 0x13710
cmpl $0x0, 0xc(%rsp)
je 0x13736
movq 0x10(%rsp), %rdi
movq 0x10(%rdi), %rcx
cvtsi2sd %rbp, %xmm0
movsd %xmm0, (%rcx)
movl $0x3, %edx
movl %edx, 0x8(%rcx)
movq 0x10(%rdi), %rcx
leaq 0x10(%rcx), %rsi
movq %rsi, 0x10(%rdi)
subq 0x18(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x10(%rcx)
movl %edx, 0x18(%rcx)
addq $0x10, 0x10(%rdi)
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x13b8d
addl $0x2, %eax
jmp 0x13724
testq %rax, %rax
jne 0x1375a
movl $0x0, 0x8(%rdx)
addq $0x10, %rdx
movq %rdx, 0x10(%r14)
movl $0x1, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x13b8d
jmp 0x13724
movq %r14, %rbx
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rdx
subq %rax, %rbx
leaq 0x1(%rbx), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, (%rdx)
movl $0x3, %eax
movl %eax, 0x8(%rdx)
movq 0x10(%r14), %rcx
leaq 0x10(%rcx), %rdx
movq %rdx, 0x10(%r14)
addq 0x28(%rsp), %rbx
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
movsd %xmm0, 0x10(%rcx)
movl %eax, 0x18(%rcx)
addq $0x10, 0x10(%r14)
movl $0x2, %eax
jmp 0x13724