#line 28329 "qb64pe.bas"
void SUB_SETPRELET(qbs*_SUB_SETPRELET_STRING_FLAGNAME,qbs*_SUB_SETPRELET_STRING_FLAGVALUE){
#line 28329 "qb64pe.bas"
qbs *tqbs;
#line 28329 "qb64pe.bas"
ptrszint tmp_long;
#line 28329 "qb64pe.bas"
int32 tmp_fileno;
#line 28329 "qb64pe.bas"
uint32 qbs_tmp_base=qbs_tmp_list_nexti;
#line 28329 "qb64pe.bas"
uint8 *tmp_mem_static_pointer=mem_static_pointer;
#line 28329 "qb64pe.bas"
uint32 tmp_cmem_sp=cmem_sp;
#line 28329 "qb64pe.bas"
#include "data110.txt"
#line 28329 "qb64pe.bas"
mem_lock *sf_mem_lock;
#line 28329 "qb64pe.bas"
new_mem_lock();
#line 28329 "qb64pe.bas"
sf_mem_lock=mem_lock_tmp;
#line 28329 "qb64pe.bas"
sf_mem_lock->type=3;
#line 28329 "qb64pe.bas"
libqb_check_stack();
#line 28329 "qb64pe.bas"
if (is_error_pending()) goto exit_subfunc;
#line 28331 "qb64pe.bas"
S_36698:;
#line 28331 "qb64pe.bas"
fornext_value3464=*__INTEGER_USERDEFINECOUNTPRESETS+ 1 ;
#line 28331 "qb64pe.bas"
fornext_finalvalue3464=*__INTEGER_USERDEFINECOUNT;
#line 28331 "qb64pe.bas"
fornext_step3464= 1 ;
#line 28331 "qb64pe.bas"
if (fornext_step3464<0) fornext_step_negative3464=1; else fornext_step_negative3464=0;
#line 28331 "qb64pe.bas"
if (is_error_pending()) goto fornext_error3464;
#line 28331 "qb64pe.bas"
goto fornext_entrylabel3464;
#line 28331 "qb64pe.bas"
while(1){
#line 28331 "qb64pe.bas"
fornext_value3464=fornext_step3464+(*_SUB_SETPRELET_LONG_I);
#line 28331 "qb64pe.bas"
fornext_entrylabel3464:
#line 28331 "qb64pe.bas"
*_SUB_SETPRELET_LONG_I=fornext_value3464;
#line 28331 "qb64pe.bas"
if (fornext_step_negative3464){
#line 28331 "qb64pe.bas"
if (fornext_value3464<fornext_finalvalue3464) break;
#line 28331 "qb64pe.bas"
}else{
#line 28331 "qb64pe.bas"
if (fornext_value3464>fornext_finalvalue3464) break;
#line 28331 "qb64pe.bas"
}
#line 28331 "qb64pe.bas"
fornext_error3464:;
#line 28331 "qb64pe.bas"
if(qbevent){evnt(28331);if(r)goto S_36698;}
#line 28332 "qb64pe.bas"
S_36699:;
#line 28332 "qb64pe.bas"
if ((qbs_cleanup(qbs_tmp_base,qbs_equal((((qbs**)(__ARRAY_STRING_USERDEFINE[0]))[array_check(( 0 )-__ARRAY_STRING_USERDEFINE[8],__ARRAY_STRING_USERDEFINE[9])+array_check((*_SUB_SETPRELET_LONG_I)-__ARRAY_STRING_USERDEFINE[4],__ARRAY_STRING_USERDEFINE[5])*__ARRAY_STRING_USERDEFINE[6]]),_SUB_SETPRELET_STRING_FLAGNAME)))||is_error_pending()){
#line 28332 "qb64pe.bas"
if(qbevent){evnt(28332);if(r)goto S_36699;}
#line 28332 "qb64pe.bas"
do{
#line 28332 "qb64pe.bas"
tmp_long=array_check(( 1 )-__ARRAY_STRING_USERDEFINE[8],__ARRAY_STRING_USERDEFINE[9])+array_check((*_SUB_SETPRELET_LONG_I)-__ARRAY_STRING_USERDEFINE[4],__ARRAY_STRING_USERDEFINE[5])*__ARRAY_STRING_USERDEFINE[6];
#line 28332 "qb64pe.bas"
if (!is_error_pending()) qbs_set( ((qbs**)(__ARRAY_STRING_USERDEFINE[0]))[tmp_long],_SUB_SETPRELET_STRING_FLAGVALUE);
#line 28332 "qb64pe.bas"
qbs_cleanup(qbs_tmp_base,0);
#line 28332 "qb64pe.bas"
if(!qbevent)break;evnt(28332);}while(r);
#line 28332 "qb64pe.bas"
do{
#line 28332 "qb64pe.bas"
goto exit_subfunc;
#line 28332 "qb64pe.bas"
if(!qbevent)break;evnt(28332);}while(r);
#line 28332 "qb64pe.bas"
}
#line 28333 "qb64pe.bas"
fornext_continue_3463:;
#line 28333 "qb64pe.bas"
}
#line 28333 "qb64pe.bas"
fornext_exit_3463:;
#line 28335 "qb64pe.bas"
do{
#line 28335 "qb64pe.bas"
*__INTEGER_USERDEFINECOUNT=*__INTEGER_USERDEFINECOUNT+ 1 ;
#line 28335 "qb64pe.bas"
if(!qbevent)break;evnt(28335);}while(r);
#line 28336 "qb64pe.bas"
S_36705:;
#line 28336 "qb64pe.bas"
if ((qbs_cleanup(qbs_tmp_base,-(*__INTEGER_USERDEFINECOUNT>func_ubound(__ARRAY_STRING_USERDEFINE, 2 ,2))))||is_error_pending()){
#line 28336 "qb64pe.bas"
if(qbevent){evnt(28336);if(r)goto S_36705;}
#line 28337 "qb64pe.bas"
do{
if (__ARRAY_STRING_USERDEFINE[2]&2){
error(10);
}else{
static int64 alloc_new_desc[12];
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_USERDEFINE)[12])->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_USERDEFINE[2]&1){
preserve_old_ptr=__ARRAY_STRING_USERDEFINE[0];
preserve_old_flags=__ARRAY_STRING_USERDEFINE[2];
preserve_old_total=__ARRAY_STRING_USERDEFINE[5]*__ARRAY_STRING_USERDEFINE[9];
}else{
preserve_old_total=0; preserve_old_ptr=0; preserve_old_flags=0; preserve_new_total=0; preserve_copy_count=0;
}
alloc_new_desc[8]= 0 ;
alloc_new_desc[9]=( 1 )-alloc_new_desc[8]+1;
if (alloc_new_desc[9]<=0) error(5);
alloc_new_desc[10]=1;
alloc_new_desc[4]= 0 ;
alloc_new_desc[5]=(func_ubound(__ARRAY_STRING_USERDEFINE, 2 ,2)+ 10 )-alloc_new_desc[4]+1;
if (alloc_new_desc[5]<=0) error(5);
alloc_new_desc[6]=alloc_new_desc[10]*alloc_new_desc[9];
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 (((int64)((ptrszint)alloc_new_desc[8]))!=alloc_new_desc[8]) error(257);
if (alloc_new_desc[9]<0) error(257);
if (((int64)((ptrszint)alloc_new_desc[9]))!=alloc_new_desc[9]) error(257);
if (alloc_new_desc[10]<0) error(257);
if (((int64)((ptrszint)alloc_new_desc[10]))!=alloc_new_desc[10]) error(257);
alloc_dim_value=(uint64)alloc_new_desc[9];
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_USERDEFINE[0]=preserve_new_ptr;
__ARRAY_STRING_USERDEFINE[2]|=1;
tmp_long=(ptrszint)alloc_req_elems;
if (__ARRAY_STRING_USERDEFINE[2]&4){
while(tmp_long--) ((qbs**)(__ARRAY_STRING_USERDEFINE[0]))[tmp_long]=qbs_new_cmem(0,0);
}else{
while(tmp_long--) ((qbs**)(__ARRAY_STRING_USERDEFINE[0]))[tmp_long]=qbs_new(0,0);
}
tmp_long=preserve_copy_count;
while(tmp_long--){
qbs_set(((qbs**)(preserve_new_ptr))[tmp_long],((qbs**)(preserve_old_ptr))[tmp_long]);
}
tmp_long=preserve_old_total;
while(tmp_long--) qbs_free(((qbs**)(preserve_old_ptr))[tmp_long]);
free((void*)(preserve_old_ptr));
__ARRAY_STRING_USERDEFINE[0]=preserve_new_ptr;
}else{
__ARRAY_STRING_USERDEFINE[0]=(ptrszint)malloc((size_t)alloc_req_bytes);
if (!__ARRAY_STRING_USERDEFINE[0]) error(257);
__ARRAY_STRING_USERDEFINE[2]|=1;
tmp_long=(ptrszint)alloc_req_elems;
if (__ARRAY_STRING_USERDEFINE[2]&4){
while(tmp_long--) ((qbs**)(__ARRAY_STRING_USERDEFINE[0]))[tmp_long]=qbs_new_cmem(0,0);
}else{
while(tmp_long--) ((qbs**)(__ARRAY_STRING_USERDEFINE[0]))[tmp_long]=qbs_new(0,0);
}
}
__ARRAY_STRING_USERDEFINE[4]=alloc_new_desc[4];
__ARRAY_STRING_USERDEFINE[5]=alloc_new_desc[5];
__ARRAY_STRING_USERDEFINE[6]=alloc_new_desc[6];
__ARRAY_STRING_USERDEFINE[7]=alloc_new_desc[7];
__ARRAY_STRING_USERDEFINE[8]=alloc_new_desc[8];
__ARRAY_STRING_USERDEFINE[9]=alloc_new_desc[9];
__ARRAY_STRING_USERDEFINE[10]=alloc_new_desc[10];
__ARRAY_STRING_USERDEFINE[11]=alloc_new_desc[11];
}
#line 28337 "qb64pe.bas"
if(!qbevent)break;evnt(28337);}while(r);
#line 28338 "qb64pe.bas"
}
#line 28339 "qb64pe.bas"
do{
#line 28339 "qb64pe.bas"
tmp_long=array_check(( 0 )-__ARRAY_STRING_USERDEFINE[8],__ARRAY_STRING_USERDEFINE[9])+array_check((*__INTEGER_USERDEFINECOUNT)-__ARRAY_STRING_USERDEFINE[4],__ARRAY_STRING_USERDEFINE[5])*__ARRAY_STRING_USERDEFINE[6];
#line 28339 "qb64pe.bas"
if (!is_error_pending()) qbs_set( ((qbs**)(__ARRAY_STRING_USERDEFINE[0]))[tmp_long],_SUB_SETPRELET_STRING_FLAGNAME);
#line 28339 "qb64pe.bas"
qbs_cleanup(qbs_tmp_base,0);
#line 28339 "qb64pe.bas"
if(!qbevent)break;evnt(28339);}while(r);
#line 28340 "qb64pe.bas"
do{
#line 28340 "qb64pe.bas"
tmp_long=array_check(( 1 )-__ARRAY_STRING_USERDEFINE[8],__ARRAY_STRING_USERDEFINE[9])+array_check((*__INTEGER_USERDEFINECOUNT)-__ARRAY_STRING_USERDEFINE[4],__ARRAY_STRING_USERDEFINE[5])*__ARRAY_STRING_USERDEFINE[6];
#line 28340 "qb64pe.bas"
if (!is_error_pending()) qbs_set( ((qbs**)(__ARRAY_STRING_USERDEFINE[0]))[tmp_long],_SUB_SETPRELET_STRING_FLAGVALUE);
#line 28340 "qb64pe.bas"
qbs_cleanup(qbs_tmp_base,0);
#line 28340 "qb64pe.bas"
if(!qbevent)break;evnt(28340);}while(r);
#line 28341 "qb64pe.bas"
do{
#line 28341 "qb64pe.bas"
qbs_set(__STRING_USERDEFINELIST,qbs_add(qbs_add(__STRING_USERDEFINELIST,_SUB_SETPRELET_STRING_FLAGNAME),qbs_new_txt_len("@",1)));
#line 28341 "qb64pe.bas"
qbs_cleanup(qbs_tmp_base,0);
#line 28341 "qb64pe.bas"
if(!qbevent)break;evnt(28341);}while(r);
#line 28342 "qb64pe.bas"
exit_subfunc:;
#line 28342 "qb64pe.bas"
free_mem_lock(sf_mem_lock);
#line 28342 "qb64pe.bas"
#include "free110.txt"
#line 28342 "qb64pe.bas"
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;
#line 28342 "qb64pe.bas"
cmem_sp=tmp_cmem_sp;
#line 28342 "qb64pe.bas"
}
