// File: /workspace/github_c_makefile_star2_O1/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, %rbx
leaq 0x30(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0xa6a8
movq %rax, 0x18(%rsp)
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
movl $0x2, %esi
callq 0xa6a8
movq %rax, %rbp
movl $0x1, %edx
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
movl $0x3, %esi
callq 0xa737
movq (%r14), %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, %r15d
cmovgq %rdx, %r15
decq %r15
cmpq %r12, %r15
cmovaeq %r12, %r15
testq %rdx, %rdx
cmovleq %rax, %r15
movl %r13d, 0xc(%rsp)
testl %r13d, %r13d
je 0x1272a
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rbx
movq 0x18(%rax), %rcx
addq $0x30, %rcx
cmpq %rbx, %rcx
leaq 0x1d2b(%rip), %rax      # 0x14420
cmovbq %rcx, %rax
movl 0x8(%rax), %ecx
testl %ecx, %ecx
je 0x12712
cmpl $0x1, %ecx
jne 0x12822
cmpl $0x0, (%rax)
jne 0x12822
leaq 0x29a1(%rip), %rsi      # 0x150ba
movq %rbp, %rdi
callq 0x3220
testq %rax, %rax
je 0x12822
movb (%rbp), %bl
xorl %eax, %eax
cmpb $0x5e, %bl
sete %al
addq %rax, %rbp
movq %rbp, %r13
movq 0x18(%rsp), %rcx
leaq (%rcx,%r15), %r14
leaq 0x38(%rsp), %rdx
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rdx)
movq %rcx, (%rdx)
addq %rcx, %r12
movq %r12, 0x8(%rdx)
incq %r15
movl $0x0, 0x50(%rsp)
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x1292a
movq %rax, %rbp
testq %rax, %rax
je 0x127f6
cmpl $0x0, 0xc(%rsp)
je 0x127e3
movq 0x10(%rsp), %rdx
movq 0x10(%rdx), %rax
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
movsd %xmm0, (%rax)
movl $0x3, %esi
movl %esi, 0x8(%rax)
movq 0x10(%rdx), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdx)
movq %rbp, %rcx
subq 0x18(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
movsd %xmm0, 0x10(%rax)
movl %esi, 0x18(%rax)
addq $0x10, 0x10(%rdx)
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x12d64
movl %eax, %r12d
addl $0x2, %r12d
jmp 0x127f6
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x12d64
movl %eax, %r12d
testq %rbp, %rbp
jne 0x12915
cmpb $0x5e, %bl
je 0x128f7
leaq 0x1(%r14), %rax
incq %r15
cmpq 0x40(%rsp), %r14
movq %rax, %r14
jb 0x1275f
jmp 0x128f7
movq 0x18(%rsp), %rax
leaq (%rax,%r15), %r13
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x128a5
subq %r15, %r12
cmpq %r12, %rax
ja 0x12898
decq %rax
subq %rax, %r12
je 0x12898
movq %rax, %r15
movq %rbx, 0x20(%rsp)
movq %rbp, %rbx
movsbl (%rbp), %eax
movl %eax, 0xc(%rsp)
incq %rbx
movq %r13, %rdi
movl 0xc(%rsp), %esi
movq %r12, %rdx
callq 0x3140
testq %rax, %rax
je 0x12893
movq %rax, %rbp
leaq 0x1(%rax), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3200
testl %eax, %eax
je 0x1289d
addq %r13, %r12
movq %r14, %r13
subq %r14, %r12
jne 0x1285b
xorl %r13d, %r13d
jmp 0x128a0
xorl %r13d, %r13d
jmp 0x128a5
movq %rbp, %r13
movq 0x20(%rsp), %rbx
testq %r13, %r13
je 0x128f7
subq 0x18(%rsp), %r13
leaq 0x1(%r13), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, (%rbx)
movl $0x3, %eax
movl %eax, 0x8(%rbx)
movq 0x10(%rsp), %rsi
movq 0x10(%rsi), %rcx
leaq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rsi)
addq 0x28(%rsp), %r13
xorps %xmm0, %xmm0
cvtsi2sd %r13, %xmm0
movsd %xmm0, 0x10(%rcx)
movl %eax, 0x18(%rcx)
addq $0x10, 0x10(%rsi)
movl $0x2, %r12d
jmp 0x12915
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rax
movl $0x0, 0x8(%rax)
addq $0x10, %rax
movq %rax, 0x10(%rcx)
movl $0x1, %r12d
movl %r12d, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq