// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x288, %rsp            # imm = 0x288
movq %rdi, 0x278(%rsp)
movl %esi, 0x274(%rsp)
movq 0x278(%rsp), %rdi
movl $0x1, %esi
leaq 0x268(%rsp), %rdx
callq 0x11450
movq %rax, 0x258(%rsp)
movq 0x278(%rsp), %rdi
movl $0x2, %esi
leaq 0x260(%rsp), %rdx
callq 0x11450
movq %rax, 0x250(%rsp)
movq 0x278(%rsp), %rdi
movl $0x3, %esi
movl $0x1, %edx
callq 0x115b0
movq %rax, %rdi
movq 0x268(%rsp), %rsi
callq 0x1e7e0
subq $0x1, %rax
movq %rax, 0x248(%rsp)
cmpq $0x0, 0x248(%rsp)
jge 0x1e8d6
movq $0x0, 0x248(%rsp)
jmp 0x1e8fa
movq 0x248(%rsp), %rax
cmpq 0x268(%rsp), %rax
jbe 0x1e8f8
movq 0x268(%rsp), %rax
movq %rax, 0x248(%rsp)
jmp 0x1e8fa
cmpl $0x0, 0x274(%rsp)
je 0x1e9e6
movq 0x278(%rsp), %rdi
movl $0x4, %esi
callq 0x10720
cmpl $0x0, %eax
jne 0x1e93d
movq 0x250(%rsp), %rdi
leaq 0x4963(%rip), %rsi      # 0x23291
callq 0x3210
cmpq $0x0, %rax
jne 0x1e9e6
movq 0x258(%rsp), %rdi
addq 0x248(%rsp), %rdi
movq 0x268(%rsp), %rsi
subq 0x248(%rsp), %rsi
movq 0x250(%rsp), %rdx
movq 0x260(%rsp), %rcx
callq 0x1eb80
movq %rax, 0x240(%rsp)
cmpq $0x0, 0x240(%rsp)
je 0x1e9e1
movq 0x278(%rsp), %rdi
movq 0x240(%rsp), %rsi
movq 0x258(%rsp), %rax
subq %rax, %rsi
addq $0x1, %rsi
callq 0x1ab20
movq 0x278(%rsp), %rdi
movq 0x240(%rsp), %rsi
movq 0x258(%rsp), %rax
subq %rax, %rsi
addq 0x260(%rsp), %rsi
callq 0x1ab20
movl $0x2, 0x284(%rsp)
jmp 0x1eb6d
jmp 0x1eb55
movq 0x250(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x5e, %eax
jne 0x1ea15
movq 0x250(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x250(%rsp)
movl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x1ea1d
xorl %eax, %eax
movl %eax, 0x4(%rsp)
jmp 0x1ea1d
movl 0x4(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x258(%rsp), %rax
addq 0x248(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x278(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x258(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x258(%rsp), %rax
addq 0x268(%rsp), %rax
movq %rax, 0x28(%rsp)
movl $0x0, 0x38(%rsp)
movq 0x10(%rsp), %rsi
movq 0x250(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x1eca0
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x1eb19
cmpl $0x0, 0x274(%rsp)
je 0x1eafc
movq 0x278(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x258(%rsp), %rax
subq %rax, %rsi
addq $0x1, %rsi
callq 0x1ab20
movq 0x278(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x258(%rsp), %rax
subq %rax, %rsi
callq 0x1ab20
leaq 0x20(%rsp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x1f0f0
addl $0x2, %eax
movl %eax, 0x284(%rsp)
jmp 0x1eb6d
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x1f0f0
movl %eax, 0x284(%rsp)
jmp 0x1eb6d
jmp 0x1eb1b
movq 0x10(%rsp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
xorl %eax, %eax
cmpq 0x28(%rsp), %rcx
movb %al, 0x3(%rsp)
jae 0x1eb47
cmpl $0x0, 0x1c(%rsp)
setne %al
xorb $-0x1, %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
testb $0x1, %al
jne 0x1ea69
jmp 0x1eb55
movq 0x278(%rsp), %rdi
callq 0x11870
movl $0x1, 0x284(%rsp)
movl 0x284(%rsp), %eax
addq $0x288, %rsp            # imm = 0x288
retq
nopl (%rax)