// File: /workspace/github_c_makefile_star2_O0/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: g_read
static int g_read(lua_State*L,FILE*f,int first){
int nargs=lua_gettop(L)-1;
int success;
int n;
clearerr(f);
if(nargs==0){
success=read_line(L,f);
n=first+1;
}
else{
luaL_checkstack(L,nargs+20,"too many arguments");
success=1;
for(n=first;nargs--&&success;n++){
if(lua_type(L,n)==3){
size_t l=(size_t)lua_tointeger(L,n);
success=(l==0)?test_eof(L,f):read_chars(L,f,l);
}
else{
const char*p=lua_tostring(L,n);
luaL_argcheck(L,p&&p[0]=='*',n,"invalid option");
switch(p[1]){
case'n':
success=read_number(L,f);
break;
case'l':
success=read_line(L,f);
break;
case'a':
read_chars(L,f,~((size_t)0));
success=1;
break;
default:
return luaL_argerror(L,n,"invalid format");
}
}
}
}
if(ferror(f))
return pushresult(L,0,NULL);
if(!success){
lua_pop(L,1);
lua_pushnil(L);
}
return n-first;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movl %edx, 0x2c(%rsp)
movq 0x38(%rsp), %rdi
callq 0x10910
subl $0x1, %eax
movl %eax, 0x28(%rsp)
movq 0x30(%rsp), %rdi
callq 0x31b0
cmpl $0x0, 0x28(%rsp)
jne 0x1cce7
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1cb80
movl %eax, 0x24(%rsp)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x1ce9f
movq 0x38(%rsp), %rdi
movl 0x28(%rsp), %esi
addl $0x14, %esi
leaq 0x64b4(%rip), %rdx      # 0x231ae
callq 0x1b9c0
movl $0x1, 0x24(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x28(%rsp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, 0x28(%rsp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xf(%rsp)
je 0x1cd33
cmpl $0x0, 0x24(%rsp)
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x1cd40
jmp 0x1ce9d
movq 0x38(%rsp), %rdi
movl 0x20(%rsp), %esi
callq 0x10930
cmpl $0x3, %eax
jne 0x1cda8
movq 0x38(%rsp), %rdi
movl 0x20(%rsp), %esi
callq 0x11740
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x1cd83
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1cf00
movl %eax, 0x8(%rsp)
jmp 0x1cd9b
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x1cf50
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x1ce8b
movq 0x38(%rsp), %rdi
movl 0x20(%rsp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x3c60
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x1cdda
movq 0x10(%rsp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x2a, %ecx
movb %al, 0x7(%rsp)
je 0x1cdf9
movq 0x38(%rsp), %rdi
movl 0x20(%rsp), %esi
leaq 0x63d7(%rip), %rdx      # 0x231c1
callq 0x10980
cmpl $0x0, %eax
setne %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
movq 0x10(%rsp), %rax
movsbl 0x1(%rax), %eax
movl %eax, (%rsp)
subl $0x61, %eax
je 0x1ce4e
jmp 0x1ce10
movl (%rsp), %eax
subl $0x6c, %eax
je 0x1ce39
jmp 0x1ce1a
movl (%rsp), %eax
subl $0x6e, %eax
jne 0x1ce6e
jmp 0x1ce24
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1d090
movl %eax, 0x24(%rsp)
jmp 0x1ce89
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1cb80
movl %eax, 0x24(%rsp)
jmp 0x1ce89
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq $-0x1, %rdx
callq 0x1cf50
movl $0x1, 0x24(%rsp)
jmp 0x1ce89
movq 0x38(%rsp), %rdi
movl 0x20(%rsp), %esi
leaq 0x6352(%rip), %rdx      # 0x231d0
callq 0x10980
movl %eax, 0x44(%rsp)
jmp 0x1cef0
jmp 0x1ce8b
jmp 0x1ce8d
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x1cd0f
jmp 0x1ce9f
movq 0x30(%rsp), %rdi
callq 0x30a0
cmpl $0x0, %eax
je 0x1cec4
movq 0x38(%rsp), %rdi
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1c960
movl %eax, 0x44(%rsp)
jmp 0x1cef0
cmpl $0x0, 0x24(%rsp)
jne 0x1cee4
movq 0x38(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x11600
movq 0x38(%rsp), %rdi
callq 0x11870
movl 0x20(%rsp), %eax
subl 0x2c(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)