int16 FUNC_OPENBUFFER(qbs*_FUNC_OPENBUFFER_STRING_SBMODE,qbs*_FUNC_OPENBUFFER_STRING_SBNAME){
qbs *tqbs;
ptrszint tmp_long;
int32 tmp_fileno;
uint32 qbs_tmp_base=qbs_tmp_list_nexti;
uint8 *tmp_mem_static_pointer=mem_static_pointer;
uint32 tmp_cmem_sp=cmem_sp;
#include "data167.txt"
mem_lock *sf_mem_lock;
new_mem_lock();
sf_mem_lock=mem_lock_tmp;
sf_mem_lock->type=3;
if (is_error_pending()) goto exit_subfunc;
do{
if(!qbevent)break;evnt(24221,15,"sb_qb64pe_extension.bm");}while(r);
S_34736:;
fornext_value4023= 0 ;
fornext_finalvalue4023=func_ubound(__ARRAY_STRING_SBUFN,1,1);
fornext_step4023= 1 ;
if (fornext_step4023<0) fornext_step_negative4023=1; else fornext_step_negative4023=0;
if (is_error_pending()) goto fornext_error4023;
goto fornext_entrylabel4023;
while(1){
fornext_value4023=fornext_step4023+(*_FUNC_OPENBUFFER_INTEGER_BUF);
fornext_entrylabel4023:
*_FUNC_OPENBUFFER_INTEGER_BUF=fornext_value4023;
qbs_cleanup(qbs_tmp_base,0);
if (fornext_step_negative4023){
if (fornext_value4023<fornext_finalvalue4023) break;
}else{
if (fornext_value4023>fornext_finalvalue4023) break;
}
fornext_error4023:;
if(qbevent){evnt(24221,17,"sb_qb64pe_extension.bm");if(r)goto S_34736;}
S_34737:;
if ((qbs_cleanup(qbs_tmp_base,qbs_equal(((qbs*)(((uint64*)(__ARRAY_STRING_SBUFN[0]))[array_check((*_FUNC_OPENBUFFER_INTEGER_BUF)-__ARRAY_STRING_SBUFN[4],__ARRAY_STRING_SBUFN[5])])),_FUNC_OPENBUFFER_STRING_SBNAME)))||is_error_pending()){
if(qbevent){evnt(24221,18,"sb_qb64pe_extension.bm");if(r)goto S_34737;}
do{
goto fornext_exit_4022;
if(!qbevent)break;evnt(24221,18,"sb_qb64pe_extension.bm");}while(r);
}
fornext_continue_4022:;
}
fornext_exit_4022:;
S_34741:;
qbs_set(sc_4024,qbs_ucase(qbs_left(_FUNC_OPENBUFFER_STRING_SBMODE, 1 )));
qbs_cleanup(qbs_tmp_base,0);
if(qbevent){evnt(24221,21,"sb_qb64pe_extension.bm");if(r)goto S_34741;}
S_34742:;
if ((qbs_cleanup(qbs_tmp_base,qbs_equal(sc_4024,qbs_new_txt_len("A",1))))||is_error_pending()){
if(qbevent){evnt(24221,22,"sb_qb64pe_extension.bm");if(r)goto S_34742;}
S_34743:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF>func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(24221,23,"sb_qb64pe_extension.bm");if(r)goto S_34743;}
do{
return_point[next_return_point++]=14;
if (next_return_point>=return_points) more_return_points();
goto LABEL_NEWBUF;
RETURN_14:;
if(!qbevent)break;evnt(24221,23,"sb_qb64pe_extension.bm");}while(r);
}
do{
*_FUNC_OPENBUFFER_LONG_NUL=FUNC_SEEKBUF(_FUNC_OPENBUFFER_INTEGER_BUF,&(pass4025= 0 ),&(pass4026= -24ll ));
if(!qbevent)break;evnt(24221,24,"sb_qb64pe_extension.bm");}while(r);
sc_ec_142_end:;
goto sc_4024_end;
}
S_34747:;
if ((qbs_cleanup(qbs_tmp_base,qbs_equal(sc_4024,qbs_new_txt_len("B",1))))||is_error_pending()){
if(qbevent){evnt(24221,25,"sb_qb64pe_extension.bm");if(r)goto S_34747;}
S_34748:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF>func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(24221,26,"sb_qb64pe_extension.bm");if(r)goto S_34748;}
do{
return_point[next_return_point++]=15;
if (next_return_point>=return_points) more_return_points();
goto LABEL_NEWBUF;
RETURN_15:;
if(!qbevent)break;evnt(24221,26,"sb_qb64pe_extension.bm");}while(r);
}
do{
*_FUNC_OPENBUFFER_LONG_NUL=FUNC_SEEKBUF(_FUNC_OPENBUFFER_INTEGER_BUF,&(pass4027= 0 ),&(pass4028= -22ll ));
if(!qbevent)break;evnt(24221,27,"sb_qb64pe_extension.bm");}while(r);
sc_ec_143_end:;
goto sc_4024_end;
}
S_34752:;
if ((qbs_cleanup(qbs_tmp_base,qbs_equal(sc_4024,qbs_new_txt_len("I",1))))||is_error_pending()){
if(qbevent){evnt(24221,28,"sb_qb64pe_extension.bm");if(r)goto S_34752;}
S_34753:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF>func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(24221,29,"sb_qb64pe_extension.bm");if(r)goto S_34753;}
do{
return_point[next_return_point++]=16;
if (next_return_point>=return_points) more_return_points();
goto LABEL_LOADBUF;
RETURN_16:;
if(!qbevent)break;evnt(24221,29,"sb_qb64pe_extension.bm");}while(r);
}
do{
*_FUNC_OPENBUFFER_LONG_NUL=FUNC_SEEKBUF(_FUNC_OPENBUFFER_INTEGER_BUF,&(pass4029= 0 ),&(pass4030= -22ll ));
if(!qbevent)break;evnt(24221,30,"sb_qb64pe_extension.bm");}while(r);
sc_ec_144_end:;
goto sc_4024_end;
}
S_34757:;
if ((qbs_cleanup(qbs_tmp_base,qbs_equal(sc_4024,qbs_new_txt_len("O",1))))||is_error_pending()){
if(qbevent){evnt(24221,31,"sb_qb64pe_extension.bm");if(r)goto S_34757;}
S_34758:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF<=func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(24221,32,"sb_qb64pe_extension.bm");if(r)goto S_34758;}
do{
SUB_DISPOSEBUF(_FUNC_OPENBUFFER_INTEGER_BUF);
if(!qbevent)break;evnt(24221,32,"sb_qb64pe_extension.bm");}while(r);
do{
tmp_long=array_check((*_FUNC_OPENBUFFER_INTEGER_BUF)-__ARRAY_STRING_SBUFN[4],__ARRAY_STRING_SBUFN[5]);
if (!is_error_pending()) qbs_set( ((qbs*)(((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long])),qbs_new_txt_len("",0));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(24221,32,"sb_qb64pe_extension.bm");}while(r);
}
do{
return_point[next_return_point++]=17;
if (next_return_point>=return_points) more_return_points();
goto LABEL_NEWBUF;
RETURN_17:;
if(!qbevent)break;evnt(24221,33,"sb_qb64pe_extension.bm");}while(r);
sc_ec_145_end:;
goto sc_4024_end;
}
do{
*_FUNC_OPENBUFFER_INTEGER_BUF= -1ll ;
if(!qbevent)break;evnt(24221,35,"sb_qb64pe_extension.bm");}while(r);
sc_4024_end:;
do{
*_FUNC_OPENBUFFER_INTEGER_OPENBUFFER=*_FUNC_OPENBUFFER_INTEGER_BUF;
if(!qbevent)break;evnt(24221,37,"sb_qb64pe_extension.bm");}while(r);
do{
goto exit_subfunc;
if(!qbevent)break;evnt(24221,38,"sb_qb64pe_extension.bm");}while(r);
LABEL_NEWBUF:;
if(qbevent){evnt(24221,40,"sb_qb64pe_extension.bm");r=0;}
do{
*_FUNC_OPENBUFFER_INTEGER_BUF=FUNC_CREATEBUF();
if(!qbevent)break;evnt(24221,41,"sb_qb64pe_extension.bm");}while(r);
do{
SUB_CONVBUFTONATIVEEOL(_FUNC_OPENBUFFER_INTEGER_BUF);
if(!qbevent)break;evnt(24221,41,"sb_qb64pe_extension.bm");}while(r);
S_34770:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF>func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(24221,42,"sb_qb64pe_extension.bm");if(r)goto S_34770;}
do{

if (__ARRAY_STRING_SBUFN[2]&2){
error(10);
}else{
((mem_lock*)((ptrszint*)__ARRAY_STRING_SBUFN)[8])->id=(++mem_lock_id);
static int32 preserved_elements;
if (__ARRAY_STRING_SBUFN[2]&1){
preserved_elements=__ARRAY_STRING_SBUFN[5];
}
else preserved_elements=0;
__ARRAY_STRING_SBUFN[4]= 0 ;
__ARRAY_STRING_SBUFN[5]=(*_FUNC_OPENBUFFER_INTEGER_BUF+ 99 )-__ARRAY_STRING_SBUFN[4]+1;
__ARRAY_STRING_SBUFN[6]=1;
if (preserved_elements){
static ptrszint tmp_long2;
tmp_long2=__ARRAY_STRING_SBUFN[5];
if (tmp_long2<preserved_elements){
for(tmp_long=tmp_long2;tmp_long<preserved_elements;tmp_long++) {
qbs_free((qbs*)((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long]);
}}
__ARRAY_STRING_SBUFN[0]=(ptrszint)realloc((void*)(__ARRAY_STRING_SBUFN[0]),tmp_long2*8);
if (!__ARRAY_STRING_SBUFN[0]) error(257);
if (preserved_elements<tmp_long2){
for(tmp_long=preserved_elements;tmp_long<tmp_long2;tmp_long++){
if (__ARRAY_STRING_SBUFN[2]&4){
((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long]=(uint64)qbs_new_cmem(0,0);
}else{
((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long]=(uint64)qbs_new(0,0);
}
}
}
}else{
__ARRAY_STRING_SBUFN[0]=(ptrszint)malloc(__ARRAY_STRING_SBUFN[5]*8);
if (!__ARRAY_STRING_SBUFN[0]) error(257);
__ARRAY_STRING_SBUFN[2]|=1;
tmp_long=__ARRAY_STRING_SBUFN[5];
if (__ARRAY_STRING_SBUFN[2]&4){
while(tmp_long--) ((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long]=(uint64)qbs_new_cmem(0,0);
}else{
while(tmp_long--) ((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long]=(uint64)qbs_new(0,0);
}
}
}
if(!qbevent)break;evnt(24221,42,"sb_qb64pe_extension.bm");}while(r);
}
do{
tmp_long=array_check((*_FUNC_OPENBUFFER_INTEGER_BUF)-__ARRAY_STRING_SBUFN[4],__ARRAY_STRING_SBUFN[5]);
if (!is_error_pending()) qbs_set( ((qbs*)(((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long])),_FUNC_OPENBUFFER_STRING_SBNAME);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(24221,43,"sb_qb64pe_extension.bm");}while(r);
do{
#include "ret167.txt"
if(!qbevent)break;evnt(24221,44,"sb_qb64pe_extension.bm");}while(r);
LABEL_LOADBUF:;
if(qbevent){evnt(24221,46,"sb_qb64pe_extension.bm");r=0;}
do{
*_FUNC_OPENBUFFER_INTEGER_BUF=FUNC_FILETOBUF(_FUNC_OPENBUFFER_STRING_SBNAME);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(24221,47,"sb_qb64pe_extension.bm");}while(r);
do{
SUB_CONVBUFTONATIVEEOL(_FUNC_OPENBUFFER_INTEGER_BUF);
if(!qbevent)break;evnt(24221,47,"sb_qb64pe_extension.bm");}while(r);
S_34777:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF>func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(24221,48,"sb_qb64pe_extension.bm");if(r)goto S_34777;}
do{

if (__ARRAY_STRING_SBUFN[2]&2){
error(10);
}else{
((mem_lock*)((ptrszint*)__ARRAY_STRING_SBUFN)[8])->id=(++mem_lock_id);
static int32 preserved_elements;
if (__ARRAY_STRING_SBUFN[2]&1){
preserved_elements=__ARRAY_STRING_SBUFN[5];
}
else preserved_elements=0;
__ARRAY_STRING_SBUFN[4]= 0 ;
__ARRAY_STRING_SBUFN[5]=(*_FUNC_OPENBUFFER_INTEGER_BUF+ 99 )-__ARRAY_STRING_SBUFN[4]+1;
__ARRAY_STRING_SBUFN[6]=1;
if (preserved_elements){
static ptrszint tmp_long2;
tmp_long2=__ARRAY_STRING_SBUFN[5];
if (tmp_long2<preserved_elements){
for(tmp_long=tmp_long2;tmp_long<preserved_elements;tmp_long++) {
qbs_free((qbs*)((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long]);
}}
__ARRAY_STRING_SBUFN[0]=(ptrszint)realloc((void*)(__ARRAY_STRING_SBUFN[0]),tmp_long2*8);
if (!__ARRAY_STRING_SBUFN[0]) error(257);
if (preserved_elements<tmp_long2){
for(tmp_long=preserved_elements;tmp_long<tmp_long2;tmp_long++){
if (__ARRAY_STRING_SBUFN[2]&4){
((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long]=(uint64)qbs_new_cmem(0,0);
}else{
((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long]=(uint64)qbs_new(0,0);
}
}
}
}else{
__ARRAY_STRING_SBUFN[0]=(ptrszint)malloc(__ARRAY_STRING_SBUFN[5]*8);
if (!__ARRAY_STRING_SBUFN[0]) error(257);
__ARRAY_STRING_SBUFN[2]|=1;
tmp_long=__ARRAY_STRING_SBUFN[5];
if (__ARRAY_STRING_SBUFN[2]&4){
while(tmp_long--) ((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long]=(uint64)qbs_new_cmem(0,0);
}else{
while(tmp_long--) ((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long]=(uint64)qbs_new(0,0);
}
}
}
if(!qbevent)break;evnt(24221,48,"sb_qb64pe_extension.bm");}while(r);
}
do{
tmp_long=array_check((*_FUNC_OPENBUFFER_INTEGER_BUF)-__ARRAY_STRING_SBUFN[4],__ARRAY_STRING_SBUFN[5]);
if (!is_error_pending()) qbs_set( ((qbs*)(((uint64*)(__ARRAY_STRING_SBUFN[0]))[tmp_long])),_FUNC_OPENBUFFER_STRING_SBNAME);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(24221,49,"sb_qb64pe_extension.bm");}while(r);
do{
#include "ret167.txt"
if(!qbevent)break;evnt(24221,50,"sb_qb64pe_extension.bm");}while(r);
exit_subfunc:;
free_mem_lock(sf_mem_lock);
#include "free167.txt"
if ((tmp_mem_static_pointer>=mem_static)&&(tmp_mem_static_pointer<=mem_static_limit)) mem_static_pointer=tmp_mem_static_pointer; else mem_static_pointer=mem_static;
cmem_sp=tmp_cmem_sp;
return *_FUNC_OPENBUFFER_INTEGER_OPENBUFFER;
}
