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 "data176.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(25755,15,"sb_qb64pe_extension.bm");}while(r);
S_36257:;
fornext_value4254= 0 ;
fornext_finalvalue4254=func_ubound(__ARRAY_STRING_SBUFN,1,1);
fornext_step4254= 1 ;
if (fornext_step4254<0) fornext_step_negative4254=1; else fornext_step_negative4254=0;
if (is_error_pending()) goto fornext_error4254;
goto fornext_entrylabel4254;
while(1){
fornext_value4254=fornext_step4254+(*_FUNC_OPENBUFFER_INTEGER_BUF);
fornext_entrylabel4254:
*_FUNC_OPENBUFFER_INTEGER_BUF=fornext_value4254;
qbs_cleanup(qbs_tmp_base,0);
if (fornext_step_negative4254){
if (fornext_value4254<fornext_finalvalue4254) break;
}else{
if (fornext_value4254>fornext_finalvalue4254) break;
}
fornext_error4254:;
if(qbevent){evnt(25755,17,"sb_qb64pe_extension.bm");if(r)goto S_36257;}
S_36258:;
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(25755,18,"sb_qb64pe_extension.bm");if(r)goto S_36258;}
do{
goto fornext_exit_4253;
if(!qbevent)break;evnt(25755,18,"sb_qb64pe_extension.bm");}while(r);
}
fornext_continue_4253:;
}
fornext_exit_4253:;
S_36262:;
qbs_set(sc_4255,qbs_ucase(qbs_left(_FUNC_OPENBUFFER_STRING_SBMODE, 1 )));
qbs_cleanup(qbs_tmp_base,0);
if(qbevent){evnt(25755,21,"sb_qb64pe_extension.bm");if(r)goto S_36262;}
S_36263:;
if ((qbs_cleanup(qbs_tmp_base,qbs_equal(sc_4255,qbs_new_txt_len("A",1))))||is_error_pending()){
if(qbevent){evnt(25755,22,"sb_qb64pe_extension.bm");if(r)goto S_36263;}
S_36264:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF>func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(25755,23,"sb_qb64pe_extension.bm");if(r)goto S_36264;}
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(25755,23,"sb_qb64pe_extension.bm");}while(r);
}
do{
*_FUNC_OPENBUFFER_LONG_NUL=FUNC_SEEKBUF(_FUNC_OPENBUFFER_INTEGER_BUF,&(pass4256= 0 ),&(pass4257= -24ll ));
if(!qbevent)break;evnt(25755,24,"sb_qb64pe_extension.bm");}while(r);
sc_ec_142_end:;
goto sc_4255_end;
}
S_36268:;
if ((qbs_cleanup(qbs_tmp_base,qbs_equal(sc_4255,qbs_new_txt_len("B",1))))||is_error_pending()){
if(qbevent){evnt(25755,25,"sb_qb64pe_extension.bm");if(r)goto S_36268;}
S_36269:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF>func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(25755,26,"sb_qb64pe_extension.bm");if(r)goto S_36269;}
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(25755,26,"sb_qb64pe_extension.bm");}while(r);
}
do{
*_FUNC_OPENBUFFER_LONG_NUL=FUNC_SEEKBUF(_FUNC_OPENBUFFER_INTEGER_BUF,&(pass4258= 0 ),&(pass4259= -22ll ));
if(!qbevent)break;evnt(25755,27,"sb_qb64pe_extension.bm");}while(r);
sc_ec_143_end:;
goto sc_4255_end;
}
S_36273:;
if ((qbs_cleanup(qbs_tmp_base,qbs_equal(sc_4255,qbs_new_txt_len("I",1))))||is_error_pending()){
if(qbevent){evnt(25755,28,"sb_qb64pe_extension.bm");if(r)goto S_36273;}
S_36274:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF>func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(25755,29,"sb_qb64pe_extension.bm");if(r)goto S_36274;}
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(25755,29,"sb_qb64pe_extension.bm");}while(r);
}
do{
*_FUNC_OPENBUFFER_LONG_NUL=FUNC_SEEKBUF(_FUNC_OPENBUFFER_INTEGER_BUF,&(pass4260= 0 ),&(pass4261= -22ll ));
if(!qbevent)break;evnt(25755,30,"sb_qb64pe_extension.bm");}while(r);
sc_ec_144_end:;
goto sc_4255_end;
}
S_36278:;
if ((qbs_cleanup(qbs_tmp_base,qbs_equal(sc_4255,qbs_new_txt_len("O",1))))||is_error_pending()){
if(qbevent){evnt(25755,31,"sb_qb64pe_extension.bm");if(r)goto S_36278;}
S_36279:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF<=func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(25755,32,"sb_qb64pe_extension.bm");if(r)goto S_36279;}
do{
SUB_DISPOSEBUF(_FUNC_OPENBUFFER_INTEGER_BUF);
if(!qbevent)break;evnt(25755,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(25755,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(25755,33,"sb_qb64pe_extension.bm");}while(r);
sc_ec_145_end:;
goto sc_4255_end;
}
do{
*_FUNC_OPENBUFFER_INTEGER_BUF= -1ll ;
if(!qbevent)break;evnt(25755,35,"sb_qb64pe_extension.bm");}while(r);
sc_4255_end:;
do{
*_FUNC_OPENBUFFER_INTEGER_OPENBUFFER=*_FUNC_OPENBUFFER_INTEGER_BUF;
if(!qbevent)break;evnt(25755,37,"sb_qb64pe_extension.bm");}while(r);
do{
goto exit_subfunc;
if(!qbevent)break;evnt(25755,38,"sb_qb64pe_extension.bm");}while(r);
LABEL_NEWBUF:;
if(qbevent){evnt(25755,40,"sb_qb64pe_extension.bm");r=0;}
do{
*_FUNC_OPENBUFFER_INTEGER_BUF=FUNC_CREATEBUF();
if(!qbevent)break;evnt(25755,41,"sb_qb64pe_extension.bm");}while(r);
do{
SUB_CONVBUFTONATIVEEOL(_FUNC_OPENBUFFER_INTEGER_BUF);
if(!qbevent)break;evnt(25755,41,"sb_qb64pe_extension.bm");}while(r);
S_36291:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF>func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(25755,42,"sb_qb64pe_extension.bm");if(r)goto S_36291;}
do{
if (__ARRAY_STRING_SBUFN[2]&2){
error(10);
}else{
static int64 alloc_new_desc[8];
static uint64 alloc_req_elems;
static uint64 alloc_req_bytes;
static uint64 alloc_dim_value;
static uint64 alloc_bytes_per_element;
((mem_lock*)((ptrszint*)__ARRAY_STRING_SBUFN)[8])->id=(++mem_lock_id);
static ptrszint preserve_old_ptr;
static ptrszint preserve_old_flags;
static uint64 preserve_old_total;
static uint64 preserve_new_total;
static uint64 preserve_copy_count;
static ptrszint preserve_new_ptr;
if (__ARRAY_STRING_SBUFN[2]&1){
preserve_old_ptr=__ARRAY_STRING_SBUFN[0];
preserve_old_flags=__ARRAY_STRING_SBUFN[2];
preserve_old_total=__ARRAY_STRING_SBUFN[5];
}else{
preserve_old_total=0; preserve_old_ptr=0; preserve_old_flags=0; preserve_new_total=0; preserve_copy_count=0;
}
alloc_new_desc[4]= 0 ;
alloc_new_desc[5]=(*_FUNC_OPENBUFFER_INTEGER_BUF+ 99 )-alloc_new_desc[4]+1;
if (alloc_new_desc[5]<=0) error(5);
alloc_new_desc[6]=1;
alloc_req_elems=1;
alloc_bytes_per_element=(uint64)(8);
if (!alloc_bytes_per_element) error(257);
if (((int64)((ptrszint)alloc_new_desc[4]))!=alloc_new_desc[4]) error(257);
if (alloc_new_desc[5]<0) error(257);
if (((int64)((ptrszint)alloc_new_desc[5]))!=alloc_new_desc[5]) error(257);
if (alloc_new_desc[6]<0) error(257);
if (((int64)((ptrszint)alloc_new_desc[6]))!=alloc_new_desc[6]) error(257);
alloc_dim_value=(uint64)alloc_new_desc[5];
if (alloc_dim_value){
if (alloc_req_elems>(18446744073709551615ull/alloc_dim_value)) error(257);
alloc_req_elems*=alloc_dim_value;
}
if (alloc_req_elems>(18446744073709551615ull/alloc_bytes_per_element)) error(257);
alloc_req_bytes=alloc_req_elems*alloc_bytes_per_element;
if (((uint64)((ptrszint)alloc_req_elems))!=alloc_req_elems) error(257);
if (((uint64)((size_t)alloc_req_bytes))!=alloc_req_bytes) error(257);
preserve_new_total=alloc_req_elems;
preserve_copy_count=preserve_old_total;
if (preserve_new_total<preserve_copy_count) preserve_copy_count=preserve_new_total;
if (preserve_old_total){
preserve_new_ptr=(ptrszint)malloc((size_t)alloc_req_bytes);
if (!preserve_new_ptr) error(257);
__ARRAY_STRING_SBUFN[0]=preserve_new_ptr;
__ARRAY_STRING_SBUFN[2]|=1;
tmp_long=(ptrszint)alloc_req_elems;
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);
}
tmp_long=preserve_copy_count;
while(tmp_long--){
qbs_set((qbs*)((uint64*)(preserve_new_ptr))[tmp_long],(qbs*)((uint64*)(preserve_old_ptr))[tmp_long]);
}
tmp_long=preserve_old_total;
while(tmp_long--) qbs_free((qbs*)((uint64*)(preserve_old_ptr))[tmp_long]);
free((void*)(preserve_old_ptr));
__ARRAY_STRING_SBUFN[0]=preserve_new_ptr;
}else{
__ARRAY_STRING_SBUFN[0]=(ptrszint)malloc((size_t)alloc_req_bytes);
if (!__ARRAY_STRING_SBUFN[0]) error(257);
__ARRAY_STRING_SBUFN[2]|=1;
tmp_long=(ptrszint)alloc_req_elems;
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);
}
}
__ARRAY_STRING_SBUFN[4]=alloc_new_desc[4];
__ARRAY_STRING_SBUFN[5]=alloc_new_desc[5];
__ARRAY_STRING_SBUFN[6]=alloc_new_desc[6];
__ARRAY_STRING_SBUFN[7]=alloc_new_desc[7];
}
if(!qbevent)break;evnt(25755,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(25755,43,"sb_qb64pe_extension.bm");}while(r);
do{
#include "ret176.txt"
if(!qbevent)break;evnt(25755,44,"sb_qb64pe_extension.bm");}while(r);
LABEL_LOADBUF:;
if(qbevent){evnt(25755,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(25755,47,"sb_qb64pe_extension.bm");}while(r);
do{
SUB_CONVBUFTONATIVEEOL(_FUNC_OPENBUFFER_INTEGER_BUF);
if(!qbevent)break;evnt(25755,47,"sb_qb64pe_extension.bm");}while(r);
S_36298:;
if ((qbs_cleanup(qbs_tmp_base,-(*_FUNC_OPENBUFFER_INTEGER_BUF>func_ubound(__ARRAY_STRING_SBUFN,1,1))))||is_error_pending()){
if(qbevent){evnt(25755,48,"sb_qb64pe_extension.bm");if(r)goto S_36298;}
do{
if (__ARRAY_STRING_SBUFN[2]&2){
error(10);
}else{
static int64 alloc_new_desc[8];
static uint64 alloc_req_elems;
static uint64 alloc_req_bytes;
static uint64 alloc_dim_value;
static uint64 alloc_bytes_per_element;
((mem_lock*)((ptrszint*)__ARRAY_STRING_SBUFN)[8])->id=(++mem_lock_id);
static ptrszint preserve_old_ptr;
static ptrszint preserve_old_flags;
static uint64 preserve_old_total;
static uint64 preserve_new_total;
static uint64 preserve_copy_count;
static ptrszint preserve_new_ptr;
if (__ARRAY_STRING_SBUFN[2]&1){
preserve_old_ptr=__ARRAY_STRING_SBUFN[0];
preserve_old_flags=__ARRAY_STRING_SBUFN[2];
preserve_old_total=__ARRAY_STRING_SBUFN[5];
}else{
preserve_old_total=0; preserve_old_ptr=0; preserve_old_flags=0; preserve_new_total=0; preserve_copy_count=0;
}
alloc_new_desc[4]= 0 ;
alloc_new_desc[5]=(*_FUNC_OPENBUFFER_INTEGER_BUF+ 99 )-alloc_new_desc[4]+1;
if (alloc_new_desc[5]<=0) error(5);
alloc_new_desc[6]=1;
alloc_req_elems=1;
alloc_bytes_per_element=(uint64)(8);
if (!alloc_bytes_per_element) error(257);
if (((int64)((ptrszint)alloc_new_desc[4]))!=alloc_new_desc[4]) error(257);
if (alloc_new_desc[5]<0) error(257);
if (((int64)((ptrszint)alloc_new_desc[5]))!=alloc_new_desc[5]) error(257);
if (alloc_new_desc[6]<0) error(257);
if (((int64)((ptrszint)alloc_new_desc[6]))!=alloc_new_desc[6]) error(257);
alloc_dim_value=(uint64)alloc_new_desc[5];
if (alloc_dim_value){
if (alloc_req_elems>(18446744073709551615ull/alloc_dim_value)) error(257);
alloc_req_elems*=alloc_dim_value;
}
if (alloc_req_elems>(18446744073709551615ull/alloc_bytes_per_element)) error(257);
alloc_req_bytes=alloc_req_elems*alloc_bytes_per_element;
if (((uint64)((ptrszint)alloc_req_elems))!=alloc_req_elems) error(257);
if (((uint64)((size_t)alloc_req_bytes))!=alloc_req_bytes) error(257);
preserve_new_total=alloc_req_elems;
preserve_copy_count=preserve_old_total;
if (preserve_new_total<preserve_copy_count) preserve_copy_count=preserve_new_total;
if (preserve_old_total){
preserve_new_ptr=(ptrszint)malloc((size_t)alloc_req_bytes);
if (!preserve_new_ptr) error(257);
__ARRAY_STRING_SBUFN[0]=preserve_new_ptr;
__ARRAY_STRING_SBUFN[2]|=1;
tmp_long=(ptrszint)alloc_req_elems;
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);
}
tmp_long=preserve_copy_count;
while(tmp_long--){
qbs_set((qbs*)((uint64*)(preserve_new_ptr))[tmp_long],(qbs*)((uint64*)(preserve_old_ptr))[tmp_long]);
}
tmp_long=preserve_old_total;
while(tmp_long--) qbs_free((qbs*)((uint64*)(preserve_old_ptr))[tmp_long]);
free((void*)(preserve_old_ptr));
__ARRAY_STRING_SBUFN[0]=preserve_new_ptr;
}else{
__ARRAY_STRING_SBUFN[0]=(ptrszint)malloc((size_t)alloc_req_bytes);
if (!__ARRAY_STRING_SBUFN[0]) error(257);
__ARRAY_STRING_SBUFN[2]|=1;
tmp_long=(ptrszint)alloc_req_elems;
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);
}
}
__ARRAY_STRING_SBUFN[4]=alloc_new_desc[4];
__ARRAY_STRING_SBUFN[5]=alloc_new_desc[5];
__ARRAY_STRING_SBUFN[6]=alloc_new_desc[6];
__ARRAY_STRING_SBUFN[7]=alloc_new_desc[7];
}
if(!qbevent)break;evnt(25755,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(25755,49,"sb_qb64pe_extension.bm");}while(r);
do{
#include "ret176.txt"
if(!qbevent)break;evnt(25755,50,"sb_qb64pe_extension.bm");}while(r);
exit_subfunc:;
free_mem_lock(sf_mem_lock);
#include "free176.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;
}
