#include <windows.h>
#include <windowsx.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include "tlhelp32.h"
#define MAX_LOADSTRING 100
#define NP 10 // chislo segmentov zoni programm
#define T1 0x80000000
#define T2 0x80000001
#define T3 0x00200000
#define T4 0x0000FFFF
#define T5 0xFFFF0000
#define T6 0xFFE00000
#define T7 0x00400000
#define T8 0x00400001
#define T9 0x0000001F
#define T10 0xFFFFFFFF
#define T11 0x0007FFFF
#define L0 0x00200104   // log.simvol NOL
#define L1 0x002000F6   // log.simvol ISSLEDOVAT
#define L2 0x00200068   // log.simvol VHOD
#define L3 0x00200119   // log.simvol PUSTOESLOVO
#define L4 0x00200112   // max uroven ishodnoj zadachi
#define L5 0x002000F4   // log.simvol OPISAT
#define L6 0x0020011A   // log.simvol OTKAZ
#define L7 0x00200105   // log.simvol ODIN
#define L8 0x002000D2   // log.simvol MINUS
#define L9 0x00200011   // log.simvol VIHOD
#define L10 0x00200136   // log.simvol ESLI
#define L11 0x00200137   // log.simvol TO
#define L12 0x00200064   // log.simvol NEIZVESTNIE
#define L13 0x002000F7   // log. simvol ISTINA
#define L14 0x002000F3   // log.simvol DOKAZATb
#define L15 0x00200194   // log.simvol ,
#define L16 0x00200007   // log.simvol DLJALUBOGO
#define L17 0x00200008   // log.simvol SUSHESTVUET
#define L18 0x00201325   // log.simvol OTOBRAGENIE
#define L19 0x00201324   // log.simvol KLASS
#define L20 0x0020000F   // log.simvol SUMMAVSEH
#define L21 0x00200010   // log.simvol VIPISKA
#define L22 0x0020000E   // log.simvol PERECHISLENIE
#define L23 0x00201326   // log.simvol SUSHEST-
                         //            VUETEDINSTVENNOE
UINT* Z;  // zona zadach
UINT* S; // globalnij stack
UINT* SD; // dopolnitelnij massiv globalnogo stack'a.
          // Vveden dlja sohranenija razlichnoj
          // informacii, soprovogdajushej kadri globalnogo
          // stack'a. Massiv soprovogdajushih dannih kadra
          // K raspologen v "SD" po tomu ge smesheniju,
          // chto sam kadr K v "S". Ispolzujutsja
          // sledujushie jachejki etogo massiva:
          //  1-ja jachejka (smeshenie 0): nomer N
          // poslednego srabotavshego v dannom kadre
          // operatora "priem(N)" libo "kontrolpriema(
          // s N r)".
          //  2-ja jachejka: esli poslednim
          // srabatival operator "priem(...)", to 0,
          // inache - nomer simvola s,
          //  3-ja jachejka: 0 libo smeshenie v zone zadach pari (protokol A),
          // gde $A$ - nabor inf. elementov, obrazujushih protokol reshenija
          // obobshennoj zadachi kadra K.
          //  4-ja jachejka: esli 2-ja jachejka ne 0, to nomer
          // simvola, javljajushegosja zagolovkom zagolovka priema r.

UINT* T; // stack virajenij
UINT* P[NP]; // zona programm
UINT* K;  // katalog programm
UINT* KC; // indikatori c-programm
UINT* V;  // slovar
UINT* SL; // vneshslovar
UINT* R; // vspom.massiv
UINT* F; // vtoroj vspom.massiv (portitsja pri retacte)
UINT* B; // bufer tekstov.0 - 15999 jacheiki - sobstvenno
         // bufer tekstov;16000 - 31999 i 32000 - 47999 -
         // dopolnitelnie buferi tekstov;48000 - 64000 -
         // bufer tekstovogo redaktora;48000 - chislo
         // zanjatih jacheek bufera tekstovogo redaktora
char* C; // bufer bitmap'ov
char* IZ; // bufer izobragenij
char* RS; // bufer risunkov
UINT* ZP; // bufer adresov prodolgenija, predstavlennih kak chetverki v zone zadach.
          // Pervaja jachejka bufera hranit chislo ispolzovannih dlja ssilok na
          // nabori jacheek.
UINT* fiksir; // massiv ssilok na zakrepljaemije teksti zoni zadach
              // ispolzuetsja programma LOSa, skompilirovannim na C.
char* RSA; // dopolnitelnij bufer risunkov
unsigned char *J1,*J2; // buferi konvertora
UINT* OBL1; // 1-j bufer oblastej izobragenija
UINT* OBL2; // 2-j bufer oblastej izobragenija
UINT* OBL3; // 3-j bufer oblastej izobragenija
UINT* OBL4; // 4-j bufer oblastej izobragenija
UINT* PROT; // bufer protokolov sozdanija objektov izobragenija
UINT* CLIN; // bufer razvertki granichnih linij
UINT* TCV; // tablica diskretizacii cvetnosti
UINT* ZCV; // tablica znachenij cvetov
UINT* CVOTR; // massiv grafa otrezkov pri analize izobragenij
UINT* CVOBJ; // massiv vtorogo grafa otrezkov pri analize izobragenij
UINT* CVSTR; // massiv ssilok na nachala strok v CVOTR
UINT* LN; // bufer fragmentov linij
UINT* SE; // setka risunka
UINT* STK; // setka izobragenija
UINT* LL; // bufer linij
UINT* TT; // bufer tochek
UINT* U; // bufer ssilok na uplotnjaemije faili
UINT *U1,*U2,*U3,*U4; // buferi uplotnenija inf.failov
UINT *FR; // perehodnik megdu fragmentom po FR1 i ego
          // predstavleniem v zone zadach po FR2
UINT *PR; // stek ustanovok na prerivanie.V etom steke ustanovka
			 // na prerivanie sostoit iz 7 jacheek:
			 // 1 - tip prerivanija libo 0
			 // 2 - smeshenie kadra,k kotoromu otnositsja
          // ustanovka,libo 0
			 // 3 - log.simvol prerivanija libo osobaja
          //     informacia libo 0
			 // 4 - ssilka v faile na fragment prerivanija libo 0
			 // 5 - ssilka v zone programm na operator prerivanija (starshie
			 //  16 bit - smeshenie v massive;mladshie - nomer massiva)libo 0
			 // 6,7 - chislo na schetchike shagov libo 0
UINT *SP; // stek prerivanij.V etom steke hranjatsja
          // gruppi znachenij peremennih:
          // peresm;otvet;symbol;ind;ist;uroven;delta;cadr;
          // smeshenie v T do st;tec.operacia -  sohranennih pered
          // vhodom v prerivanie.
UINT *CONTR; // massiv dlja informacii o rezultate
             // kontrolja failov
UINT *UPL;  // bufer obmenov s u.sol
UINT *MT; // massiv tekstov
UINT *FBUF; // bufer filtrov. Sostoit iz 32-bitnih jacheek;
            // v starshih 16 bitah jachejki hranitsja nomer
            // log.simvola, v mladshih 16 bitah - nomer uzla
            // teoremi. Pervaja jachejka massiva FBUF hranit
            // chislo zanjatih jacheek.
UINT *bufisi; // stek indikatorov isi.
HMENU MENU[32]; // bufer handlov podmenu
HGLOBAL hZ,hS,hSD,hT,hK,hKC,hB,hC,hRS,hRSA,hSE,hU,hU1,hU2,
        hU3,hU4,hJ1,hJ2,hIZ,hFR,hOBL1,hOBL2,hOBL3,hOBL4,hATOBL,hextr,hextr1,hextr2,hextr3;   // handli
HGLOBAL hP[NP],hV,hSL,hR,hZP,hcvet,hcvgr,hcvpr,
               hF,hPR,hSP,hCONTR,       // dlja
               hUPL,hMT,hLN,hLL,hTT,
               hMAS,hFBUF;              // pamjati
UINT *MSV; // massiv par (starshie 32 bita - mladshie 32 bita ukazatela na massiv dlja
            //vspomogatelnih chislennih massivov dopolnitelnih funkcij
           // interpretatora
HMENU hmenu,hhmenu; // handle glavnogo i zapasnogo menu
UINT64 step, // schetchik shagov
       stop, // na shage s nomerom stop - kontrol limitov
       Step = 0; // ostanovka na shage s nomerom Step

UINT ind, // perekluchatel obrashenij v osnovnom cicle:
			 //  0 - k funkcii scanproc;
			 //  1 - k funkcii interp;
			 //  2 - vihod (ogidanie vneshnei informacii)
			 //  3 - zavershenie programmi
			 //  4 - prerivanie s informaciej ob oshibke
	  peresm,  // ukazatel peresmotra v scanirovanii zadaci (1 - peresmotr)
	  otvet, // ukazatel otveta zadaci (0 - net otveta)
	  cadr,  // smeshenie v glob.stacke tecushego cadra
	  symbol, // log. simvol,programma kotorogo realizuetsia
	  nomprog, // nomer tek. massiva zoni pgogramm (nachinaia s 0)
	  *A, // ukazatel na nachalo tek. massiva zoni programm
	  fragm, // smeshenie nachala tek.fragmenta v tek.massive
	  *tec,  //  ukazatel na tek. jachejku tek. fragmenta libo 0
	  level, //  tek. uroven perecheslenija
	  *st, // ukazatel na pervuju svobodnuju jachejku stack'a viragenij
	  svob, // smeshenije v zone zadach jachejki,nachinaja s kotoroj
			  //  osushestvljaetsia poisk svobodnogo mesta
	  lcadr, // smeshenije v glob. stack'e poslednego stackovogo cadra
	  ist, // registr istinnosti (0-false;1-istina)
	  *suff, // ukazatel na pervuju jachejku suffiksa tek. fragmenta
	  *vremsuff, // ispolzuetsja operatorom "perehod"
	  svobprog, // nomer massiva zoni programm,v kotorij schitivajutsia
					// fragmenti iz prog. fajla
	  svobfrag, // smeshenije v massive P[svobprog],nachinaja s kotorogo
					// zapisivaetsia ocherednoj fragment iz prog.fajla
	  prer, // smeshenie v PR tekushego kadra ustanovok na prerivanie.
			  // Pervaja jachejka etogo kadra hranit tip prerivanija:
			  // 0 - net prerivanij;
			  // 1 - na vidachu otveta zadachi zadannogo kadra;
			  // 2 - na preobrazovanie zadachi zadannogo kadra;
			  // 3 - pri obrashenii k programme zadannogo log.simvola;
			  // 4 - pri obrashenii k fragmentu programmi po ssilke v faile;
			  // 5 - pri obrashenii k operatoru po ssilke v zone programm;
			  // 6 - poshagovaja trassirovka;
			  // 7 - poshagovaja trassirovka v zadannom kadre;
			  // 8 - pooperatornaja trassirovka v zadannom kadre;
			  // 9 - prerivanie pri vihode iz zadannogo kadra;
			  // 10 - prerivanie pri vihode na kadr zadachi;
			  // 11 - prerivanie po dostigenii zadannogo chisla shagov;
           // 12 - pri obrashenii v zadannom kadre k operatoru
           //      po ssilke v zone programm,
           // 13 - pri obrashenii v zadannom kadre k fragmentu
           //      programmi po ssilke v faile
           // 14 - pri obrashenii v zadannom kadre k
           //      operatoru ZAMENA dlja zadannoj peremennoj
           //      (ee nomer pomeshaetsja v 3-ju jachejku
           //      ustanovki na prerivanie)
           // 15 - pri obrashenii k operatoru IZMENENIE
           //      dlja vhojgdenija v zadannij nabor
           //      (smeshenie ego pomeshaetsja v 3-ju jachejku
           //      ustanovki na prerivanie)
           // 16 - pri obrashenii k operatoru
           //      KONTROLPRIEMA(a1 a2 a3);a1 - v 3-j
           //      jachejke ustanovki na prerivanie;a2 - v 4-j;
           //      a3 - v 6-j.
           // 17 - pri obrashenii v zadannom kadre k
           //      operatoram STANDSLEDSTVIE,
           //      KONTROLNORMALIZACII, libo pri izmenenii
           //      znachenija peremennoj x1.
           // 18 - pri obrashenii k operatoru PRIEM(a)
           // programmi log.simvola b. b - v 3-j jachejke
           // ustanovki na prerivanie; a - v 4 -j.
           // 19 - sostavlenie protokola reshenija.
           // 20 - pri pereustanovke prerivanija posle
           // otkata po LIMIT'u.
           // 21 - pri vidache otkaza na zadachu po
           // ischerpanii sredstv.
		   // 22 - pri obrashenii k operatoru "Kontrolzameni".
		   // 23 - pri vihode na operator "otvet" v programme spravochnika
		   // "fraza".
	  tact, // ukazatel takta zakreplenija v tekushem cicle poiska mesta
			  // po zone zadach (libo 0x80000000,libo 0x80000001)
	  tipprer, // ukazatel tipa obrashenija k programme "prerivanie":
				// 1 - perepolnenije zoni zadach
				// 2 - perepolnenije glob. stack'a
				// 3 - previshenije dopustimogo sbrosa
				// 4 - ischerpanije peremennih
            // 5 - net programmi log.simvola
            // 6 - previshenie maksimalno dopustimogo razmera teksta
            // 7 - nekorrektnoe obrashenie k operatoru
            // 8 - perepolnenie steka viragenij
            // 9 - prerivanie iz trassirovki
            // 10 - kontrol zaciklivanija po razmeru
            //      globalnogo steka
            // 11 - sostavlenie protokola reshenija
			// 12 - kontrol otkata k povtornomu resheniju
	  uroven, // registr urovnja obrashenija
	  input, // registr tipa vozvrashenija k osnovnomu ciclu
				// interpretatora:
				// 0 - prostoe vozvrashenie;
				// 1 - vozvrashenie v operator KLAVIATURA.
                // 3 - vozvrashenie posle operatora KARANDASH.
      shift, // flag shift'a
 	  ctrl, // flag levogo ctrl'a
	  ctrr, // flag pravogo ctrl'a
	  rus, // flag russkih registrov klaviaturi: 1 - rus;0 - lat
	  alt, // flag alt'a
	  stroka, // nomer tek.stroki na ekrane (ot 0 do 479)
	  stolbec, // nomer tek.stolbca na ekrane (ot 0 do 639)
	  rectleft, // levij stolbec ramki na ekrane
	  isi, // indikator obrashenij k operatoram LOSa, skompilirovannim na SI
	  *tekisi, // ukazatel na pervuju svobodnuju jachejku v bufisi
	  rectright, // pravij stolbec ramki na ekrane
	  recttop, // verhnjaja stroka ramki na ekrane
	  rectbottom, // nignjaja stroka ramki na ekrane
	  sdvig, // shag sdviga po vertikali megdu strokami
      crfail = 1, // ukazatel formirovanija novogo faila
                // proceduroj tekfail
      CVOTREND, // pervaja svobodnaja jachejka v CVOTR
      CVEND, // Pervaja jachejka v CVOTR posle otrezkov
      CVOBJEND, // pervaja svobodnaja jachejka v CVOBJ
      PROTEND, // pervaja svobodnaja jachejka v PROT
      PTNBGN, // nachalo massiva cvetnih pjaten v CVOTR
      OBJBGN, // nachalo massiva objektov v CVOBJ
      LINEND, // pervaja jachejka v OBL4 posle spiska ssilok na linii
      UZLEND, // pervaja jachejka v OBL4 posle spiska ssilok na uzli
      CHAREND, // pervaja ne ispolzuemaja dlja harakterizacii
               // elementov izobragenija jachejka v OBL4.
	  tekup, // smeshenie v U pervoj svobodnoj jacheik i
	  fiksr, // smeshenie pervoj svobodnoj jachejki massiva fiksir
	  *vdannie, // startovaja pozicija v steke viragenij pri obrabotke
	            // dopolnitelnih funkcij interpretatora

	  *FR1, // 0 libo ukazatel na pervuju jacheiku fragmenta programmi,
			  // dlja kotorogo imeetsja predstavlenie v zone zadach
	  FR2, // 0 libo smeshenie v zone zadach predstavlenija fragmenta
			  // po FR1
	  delta, // prirashenie schetchika shagov (0 libo 1)
      ndelta, // schetchik vvedennih "passivov"
              // trassirovki
      stp, // smeshenie v steke prerivanij pervoj svobodnoj jachejki
      blokprer, // esli 1,to blokirovka prerivanij
		ralt, // indikator chtenija iz alternativnogo prog.faila;
				// esli raven 0,to chtenie iz osnovnogo prog.faila
      ialt, // indikator raboti s inf.blokami iz directorii
            // ALT (1 - directorija ALT; 0 - tekushaja
            // directorija.
      iialt, // indikator raboti s drugim komputerom seti.
	         // Raven smesheniju v puti k inf.bloku poslednej
			 // cifri. Dlja osnovnogo komputera raven 0.
      menu, // maska zanjatih handlov podmenu (1 - zanjat)
      mousex, // stolbec kursora mishi
      mousey, // stroka kursora mishi
      mouse, // tip soobshenija ot mishi:
             // 0 - nagatie levoj knopki
             // 1 - dvojnoe nagatie levoj knopki
             // 2 - nagatie pravoj knopki
             // 3 - dvojnoe nagatie pravoj knopki
      nachl, // indikator perioda do pervogo
             // vnutrennego perezapuska: snachala 0,
             // zatem 1
      iMT = 0, // indikator nalichija massiva tekstov:
           //0 - net massiva,1 - estb
      jMT, // smeshenie v MT pervoj svob.jachejki.
      keyend, //indikator nagatija klavishi "end".
      prokrutka, // indikator zapuska parallelnoj prokrutki
	             // na dopolnitelnom komputere
	  kontrhol, // indikator regima kontrolja
	            // holostogo hoda priemov: 0 - net
                // regima;1 - estb regim.
      kontrpr, // indikator obrashenija k LOS-programme
               // KONTROLPRIEMA(...): 1 - vklucheno;
               // 0 - viklucheno.
      istprer, // flag operatora KTP;
      tekzad, // registr tekushej zadachi;
      cadrzad, // kadr sbrosa registra tekushej zadachi;
	  polnij, //indikator nalichija faila inf. libo prog.bloka,
              // imejushego bolee 4 mln. bajt.
      Polnij, //indikator nalichija faila prog.bloka,
	          // imejushego bolee 4 mln. bajt.
      razmerobl, // razmer oblasti pri poslednem obrashenii k operatoru
	             // "izobragenie(bolshe)".

      lbufper, // smeshenie pervoj svobodnoj jachejki
               // v "bufperem".
      dpusthod, // registr otmeni operatora "dopusthod" (1 - otmena, 0 - net)
	  ris1,  // registri operatora KARANDASH.
      ris2,  // ris1-ris4 - granici ramki risunka;
      ris3,  // ris5 - ukazatel "karandash" (=0) -
      ris4,  // "lastik" (N>0, 2N-1 - razmeri kvadrata)
      ris5,  // ris6 - cvet zakraski.F22
      ris6,
      risx, // koordinati predidushej tochki risunka
      risy,
      rish,  // shirina risunka v 16-bitnih slovah
      risl,  // dlina ispolzuemoj chasti bufera risunkov
             // v 16-bitnih slovah
      smotvet,// registr smeshenija kadra globalnogo
              // steka, pri vihode iz kotorogo -
              // obrashenie k programme "prerivanie".
              // Ispolzuetsja v regime tekst-formulnogo
              // soprovogdenija,esli ne bil vibran
              // vhod v podprocess.
      filtpr, // ukazatel regima filtracii priemov s FBUF:
              // 1 - est filtracija, 0 - net.
      indobl1, // ukazatel aktivnogo 1-go bufera oblastej izobragenija:
	          // 0 - passiven, 1 - aktiven.
      indobl2, // ukazatel aktivnogo 2-go bufera oblastej izobragenija:
	          // 0 - passiven, 1 - aktiven.
      oblshirina, // shirina ispolzuemoj chasti bufera oblastej
	              // izobragenija.
	  oblvisota,  // visota ispolzuemoj chasti bufera oblastej
	              // izobragenija.
      koneclinij, // pervaja svobodnaja jachejka v OBL4 posle raboti
	              // operatora "pikseli"
      indparal = 0, //indikator parallelnoj prokrutki
	            // 0 - net prokrutki, 1 - est
				// blokiruet prorisovku.
	  filtrblok, // indikator blokirovki izmeneij filtracii priemov:
	             // 1 - zablokirovano, 0 - net.
      Scontr,  // indikator kontrolja zaciklivanija po
              // globalnomu steku: 1, esli uge
              // predprinimalsja kontrol posle previshenija
              // zadannoj granici, inache 0.
      Dlinpath, // uvelichennaja na 8 dlina puti k
                // rabochej direktorii.
      dLinpath, // uvelichennaja na 5 dlina puti k
                     // rabochej direktorii.
      Symbol = 0,// ostanovka pri vihode na programmu
                 // dannogo simvola
      Fragm = 0,//ostanovka pri vihode na fragment s
                // dannim smesheniem v zone programm
      Cadr = 1, //ostanovka pri cadr == Cadr
      itcv, // indikator zagrugennoj tablici TCV.
      itcg, // indikator zagrugennoj tablici grupp cvetnosti
      itpg, // indikator zagrugennoj tablici produkcij cvetnosti
      xlin, // koordinati koncov linii pri otladke operatorom cvtest
      ylin,
      linx,
      liny,
      DZ = 0, // smeshenie v Z
      dZ = 0, // znachenie po DZ,na kotorom ostanov
      DS = 0, // smeshenie v S
      dS = 0, // znachenie po DS,na kotorom ostanov
      DP = 0, // smeshenie v massive zoni programm
      DDP = 0, // nomer massiva zoni programm (nachinaja s 1)
      dP = 0, // znachenie po DP,DDP,na kotorom ostanov
      *DT = 0, // smeshenie
      dT = 0, // znachenie po DT,na kotorom ostanov
      *AP, // ukazatel na nachalo massiva po DDP
      Contprog = 0, // nomer prog.faila dlja kontrolja
      Contblok = 0, // nomer inf.bloka  -   dlja
      Continf = 0,  // nomer inf.faila    kontrolja
      CC, // registr kontrolja
	  timer, //ID timera
	  RR1,RR2,RR3,RR4,RR5,RR6,RR7, // globalnie peremennia raznogo naznachenija
      ttt;

DWORD bs,
      dlinpath; // chislo bait v puti k rabochej
                // direktorii
UINT teksl; // bufer operatora TEKSLOVO
UINT BT[61]; // bufer videlennih priemov vivoda
             // BT[0] - smeshenie pervoj svobodnoj
             // jachejki; dalee - pari (log.simvol -
             // nomer uzla, perevedennij v format UINT)
char nn[40]; // putb k tek.fragmentu (ot fragmenta
             // k kornju)
char chislo[200]; // bufer dlja perevoda chisel v
                       // mashinnij format
double chislp[200]; // bufer vichislenij v formate s
                    // plavajushej zapjatoj;
signed long chislc[200]; // bufer vichislenij v formate
                    // celogo so znakom;

UINT bufperem[200]; // bufer peremennih (sm. "perem")
char imjakomp[200];
DWORD bufimja = 200;
int zDelta = 0;
int vektx,vekty; // vihodnie znachenija koordinat
                // vektora pri analize izobragenij
double notchisl = 1e99;
double plusbesk = 2e99;
double minusbesk = -2e99;
char nuli[4] = {0,0,0,0};
char pathbuf[120];
char bufr[40];
char pathaconv[120];
char pathconv[120];
char pathkat[120] = "\\LOS\\k.los";
char pathdop[120] = "\\LOS\\dop.los";
char nazvanie[30] = "Логическая система Искра";
extern char pathvoc[120] = "\\INF\\v.los";
extern char pathslv[120] = "\\INF\\s.los";  // vnesh.slovar
extern char pathcvet[120] = "\\INF\\zc.los"; // tablica diskretizacii cvetov
extern char pathcvgr[120] = "\\INF\\zg.los";// tablica grupp cvetnosti
extern char pathcvpr[120] = "\\INF\\zp.los"; // tablica progukcij cvetnocti
char pathuplotn[120] = "\\INF\\u.los"; // ssilki dlja uplotnenija
char pathprog[120] = "\\LOS\\L000.los";  // tek.prog.fail
char pathaltkat[120] = "\\alt\\LOS\\k.los";  // alternativnij prog.fail
char pathaltprog[120] = "\\alt\\LOS\\L000.los";
char pathaltvoc[120] = "\\alt\\INF\\v.los";
char pathdoplos[120] = "\\doplos.cpp"; // put k blanku dopolnitelnogo fajla interpretatora
char pathvichprog[120] = "\\vichprog.cpp"; // put k dopolnitelnomu fajlu interpretatora
char pathaltslv[120] = "\\alt\\INF\\s.los";
char pathinput[240] = "\\FLS\\";  // direktorija vneshnih
                                // failov
char pathico[120] = "\\logsyst.ico"; // put k ikonke
char pathvkl[120] = "\\vkl.los"; // put k indikatoru
char pathsignum[120] = "\\signum.los"; // put k indikatoru zavershenija prokrutki
char pathvklex[120] = "\\EX1\\vkl.los"; // put k indikatoru soprocessa
char pathfin[120] = "\\fin.los"; // put k indikatoru zavershenija
char pathfinex[120] = "\\EX1\\fin.los"; // put k indikatoru zavershenija soprocessa
char pathprokr[120] = "\\\\L\\logsyst\\prokrutka.los"; // put k vkljuchatelju prokrutki
                                         // na sosednem komputere seti
char pathtest[120] = "\\\\L\\logsyst\\vkl.los"; // put k signalnomu fajlu
                                                         // vkl.los na sosednem komputere seti
char pathsign[120] = "\\\\L\\logsyst\\signum.los"; // put k indikatoru zavershenija prokrutki

char pathstart[120] = "\\prokrutka.los"; // put k signalnomu fajlu prokrutki
char pathfnx[120] = "fenix.exe"; // put k skriptu
char path1[120] = "\\INF\\I000.los"; // inform.blok N1
char path2[120] = "\\TCH\\E000.los"; // inform.blok N2 - katalog
char path3[120] = "\\INF\\H000.los"; // inform.blok N3 - katalog
char path4[120] = "\\INF\\R000.los"; // inform.blok N4
char path5[120] = "\\INF\\Q000.los"; // inform.blok N5 - katalog
char path6[120] = "\\TER\\M000.los"; // inform.blok N6 - katalog
char path7[120] = "\\TXT\\W000.los"; // inform.blok N7 - katalog
char path8[120] = "\\GEN\\P000.los"; // inform blok N8 - katalog
char path9[120] = "\\INF\\T000.los"; // inform.blok N9 - katalog
char path10[120] = "\\TCH\\A000.los"; // inform.blok N10 - katalog
char path11[120] = "\\GEN\\B000.los"; // inform.blok N11 - katalog
char path12[120] = "\\INF\\C000.los"; // inform.blok N12 - katalog
char path13[120] = "\\TCH\\D000.los"; // inform.blok N13 - katalog
char path14[120] = "\\INF\\F000.los"; // inform blok N14 - katalog
char path15[120] = "\\TER\\G000.los"; // inform.blok N15 - katalog
char path16[120] = "\\INF\\J000.los"; // inform.blok N16 - katalog
char path17[120] = "\\INF\\K000.los"; // inform.blok N17 - katalog

char* path[17] = {path1,path2,path3,path4,path5,path6,path7,
					   path8,path9,path10,path11,path12,path13,
                  path14,path15,path16,path17
					  };// massiv ssilok na puti inf.failov.
char pathex1[120] = "\\EX1\\logsyst.exe";
char pathex2[120] = "\\EX1";
char altpath1[120] = "\\alt\\INF\\I000.los"; // inform.blok N1
char altpath2[120] = "\\alt\\TCH\\E000.los"; // inform.blok N2 - katalog
char altpath3[120] = "\\alt\\INF\\H000.los"; // inform.blok N3 - katalog
char altpath4[120] = "\\alt\\INF\\R000.los"; // inform.blok N4
char altpath5[120] = "\\alt\\INF\\Q000.los"; // inform.blok N5 - katalog
char altpath6[120] = "\\alt\\TER\\M000.los"; // inform.blok N6 - katalog
char altpath7[120] = "\\alt\\TXT\\W000.los"; // inform.blok N7 - katalog
char altpath8[120] = "\\alt\\GEN\\P000.los"; // inform blok N8 - katalog
char altpath9[120] = "\\alt\\INF\\T000.los"; // inform.blok N9 - katalog
char altpath10[120] = "\\alt\\TCH\\A000.los"; // inform.blok N10 - katalog
char altpath11[120] = "\\alt\\GEN\\B000.los"; // inform.blok N11 - katalog
char altpath12[120] = "\\alt\\INF\\C000.los"; // inf.blok N12 - katalog
char altpath13[120] = "\\alt\\TCH\\D000.los"; // inf.blok N13 - katalog
char altpath14[120] = "\\alt\\INF\\F000.los"; // inf.blok N14 - katalog
char altpath15[120] = "\\alt\\TER\\G000.los"; // inf.blok N15 - katalog
char altpath16[120] = "\\alt\\INF\\J000.los"; // inf.blok N16 - katalog
char altpath17[120] = "\\alt\\INF\\K000.los"; // inf.blok N17 - katalog

char* altpath[17] = {altpath1,altpath2,altpath3,altpath4,
                     altpath5,altpath6,altpath7,altpath8,
                     altpath9,altpath10,altpath11,altpath12,
                     altpath13,altpath14,altpath15,altpath16,
                     altpath17
					     };// massiv ssilok na puti alt.inf.failov.
char izobrag[120] = "\\BIT\\bit000.bmp";
unsigned char FONT[9728]; // font reshatelja
HANDLE proghndl;  // handle tekushego prog.faila
HANDLE infhndl; // handle tekushego inf.faila
HANDLE inphndl; // handle vhodnogo faila
HANDLE slvhndl; // handle slovarej
HANDLE uplotnhndl; // handle faila U.SOL
HANDLE kthndl;
HANDLE doploshndl;
HANDLE signumhndl;
HANDLE dophndl; //handle dopolnitelnogo kataloga programm
HANDLE vichproghndl;
UINT subdir;
UINT* dirr;
UINT nominf; // nomer aktivnogo inf.faila (nachinaja c 1)
HWND hwnd;
HWND hhwnd,dhwnd;
HDC hdc,hdcm,hdcp,hsdc;
HANDLE smdir;
WIN32_FIND_DATAA files;
BOOL nextfile;
MSG kmsg;
DEVMODE dvmode;
SYSTEMTIME time;
DOCINFO din;
HBITMAP hbmp,hbmpold,hbbmp,hrmp,hsmp,hsmpold;
HBRUSH hbr,hbrold;
PAINTSTRUCT pst;
POINT points[2];
POINT Points[4];
POINT TL,RB;
RECT rect,drect;
HPEN hpen,hpenold;
UINT progcount;
STARTUPINFOA cif1,cif2,cif3,cif4,cif5,cif6,cif7,cif8,cif9,cif10,cif11,cif12,cif13,cif14,
cif15,cif16,cif17,cif18,cif19,cif20,cif21,cif22,cif23,ciff;
PROCESS_INFORMATION pi1,pi2,pi3,pi4,pi5,pi6,pi7,pi8,pi9,pi10,pi11,pi12,pi13,pi14,pi15,
pi16,pi17,pi18,pi19,pi20,pi21,pi22,pi23,pif;
UINT B1,B2,B3,B4,B5,B6,B7,B8,B9;
                // vspom jacheiki dlja peredachi vihodnih
                //znachenij nekotorih funkcij

UINT DK0[75] =  {8,  9,  13, 19, 27, 32, 33, 34, 35, 36,
					  37, 38, 39, 40, 45, 46, 48, 49, 50, 51,
					  52, 53, 54, 55, 56, 57, 65, 66, 67, 68,
					  69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
					  79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
					  89, 90, 112,113,114,115,116,117,118,119,
					  120,121,122,123,186,187,188,189,190,191,
					  192,219,220,221,222
					 };  // virtualnie kodi klaviaturi
UINT DK1[75] =  {274,425,288,439,261,32, 413,421,419,411,
					  415,412,417,420,422,423,389,380,381,382,
					  383,384,385,386,387,388,290,308,306,292,
					  278,293,294,295,283,296,297,298,310,309,
					  284,285,276,279,291,280,282,307,277,305,
					  281,304,364,365,366,367,368,369,370,371,
					  372,373,399,400,299,391,311,390,312,313,
					  301,286,303,287,314
					 }; // registr levij ctr
UINT DK2[75] =  {440,441,442,443,444,445,392,378,377,379,
					  375,401,376,405,406,407,446,447,448,449,
					  450,451,452,453,454,455,456,457,458,459,
					  460,461,462,463,464,465,466,467,468,469,
					  470,471,472,473,474,475,476,477,478,479,
					  480,481,354,355,356,357,358,359,360,361,
					  362,363,397,398,482,483,484,485,486,487,
					  488,489,490,491,492  // registr pravij ctr
					 };
UINT DK3[75] =  {8,  9,  13, 19, 27, 32, 333,341,339,331,
					  335,332,337,340,342,343,48, 49, 50, 51,
					  52, 53, 54, 55, 56, 57, 97, 98, 99, 100,
					  101,102,103,104,105,106,107,108,109,110,
					  111,112,113,114,115,116,117,118,119,120,
					  121,122,319,320,321,322,323,324,325,326,
					  327,328,393,394,59, 61, 44, 45, 46, 47,
					  96, 91, 92, 93, 39
					 }; // nignij latinskij registr

UINT DK4[75] =  {8,  9,  13, 19, 27, 32, 333,341,339,331,
					  335,332,337,340,342,343,41, 33, 64, 35,
					  36, 37, 94, 38, 42, 40, 65, 66, 67, 68,
					  69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
					  79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
					  89, 90, 319,320,321,322,323,324,325,326,
					  327,328,393,394,58, 43, 60, 95, 62, 63,
					  126,123,124,125,34
					 };  // verhnij latinskij registr
UINT DK5[75] =  {8,  9,  13, 19, 27, 32, 333,341,339,331,
					  335,332,337,340,342,343,48, 49, 50, 51,
					  52, 53, 54, 55, 56, 57, 228,168,225,162,
					  227,160,175,224,232,174,171,164,236,226,
					  233,167,169,170,235,165,163,172,230,231,
					  173,239,319,320,321,322,323,324,325,326,
					  327,328,393,394,166,61, 161,45, 238,46,
					  41, 229,92, 234,237
					 };  // nignij russkij registr
UINT DK6[75] =  {8,  9,  13, 19, 27, 32, 333,341,339,331,
					  335,332,337,340,342,343,41, 33, 34, 37,
					  59, 58, 58, 63, 59, 40, 148,136,145,130,
					  147,128,143,144,152,142,139,132,156,146,
					  153,135,137,138,155,133,131,140,150,151,
					  141,159,319,320,321,322,323,324,325,326,
					  327,328,393,394,134,43, 129,95, 158,44,
					  40, 149,124,154,157  // verhnij russkij registr
					 };
UINT DEBLOK[23] = {0x00200038,
                   0x00200087,
                   0x002000C2,
                   0x002000D5,
                   0x00200145,
                   0x00200149,
                   0x0020016F,
                   0x0020018F,
                   0x002001A6,
                   0x002001BC,
                   0x00200208,
                   0x00200254,
                   0x002002D4,
                   0x0020032D,
                   0x002003A0,
                   0x0020041E,
                   0x0020041F,
                   0x00200420,
                   0x00200422,
                   0x00200437,
                   0x0020048F,
                   0x00200517,
                   0x002005A7,
                  };
UINT priem[5] = {0,0,0,0,0};
unsigned char red[16] =   {0,0,0,0,127,127,127,127,0,0,0,0,255,255,255,255};
unsigned char green[16] = {0,0,127,127,0,0,127,127,0,0,255,255,0,0,255,255};
unsigned char blue[16] =  {0,127,0,127,0,127,0,127,0,255,0,255,0,255,0,255};
unsigned char operatori[] = {1,1,1,1,1,1,1,1,1,0, //10
                    1,1,1,0,0,0,1,1,1,1, //20  maska LOS-operatorov:
                    0,1,1,0,0,1,1,1,1,1, //30  1 - operator;
                    1,1,1,0,0,0,0,0,0,0, //40  0 - operatornoe viragenie
                    0,0,0,0,0,0,0,0,0,0, //50
                    1,1,1,1,1,1,1,1,1,1, //60
                    1,1,1,1,1,1,1,1,1,1, //70
                    1,1,1,1,1,1,1,1,1,1, //80
                    1,1,1,1,1,1,1,1,1,1, //90
                    1,1,1,1,1,1,1,1,1,1, //100
                    1,1,1,1,1,1,1,1,1,1, //110
                    1,1,1,1,1,1,1,1,1,1, //120
                    1,1,1,1,1,1,1,1,1,1, //130
                    1,1,1,1,1,1,1,1,1,1, //140
                    1,1,1,1,1,1,1,1,1,1, //150
                    1,1,1,1,1,1,1,1,1,1, //160
                    1,1,1,1,1,1,1,1,1,1, //170
                    1,1,1,1,1,1,1,1,1,1, //180
                    1,1,1,1,1,1,1,1,1,1, //190
                    1,1,1,1,1,1,1,1,1,1, //200
                    1,1,1,1,1,1,1,1,1,1, //210
                    1,1,1,1,1,1,1,1,1,0, //220
                    0,0,1,1,0,0,0,0,0,0, //230
                    0,0,0,0,0,0,0,0,0,0, //240
                    0,0,0,0,0,0,1,0,0,1, //250
                    0,1,0,0,1,0,0,0,1,1, //260
                    0,0,0,0,0,0,1,0,0,0, //270
                    0,0,0,0,0,0,0,0,0,0, //280
                    0,0,0,0,0,0,0,0,0,1, //290
                    0,1,1,0,0,0,0,1,0,0}; //300
const double pi = 3.14159265358979;
  // PROTOTIPI FUNKCIJ
 void initsolv(void);
 void maincycle(void);
 void scanpr(void);
 void interp(void);
 UINT ves(void);
 void scanblock(void);
 UINT scanstep(UINT);
 void endpr(void);
 void contin(void);
 UINT fragment(UINT);
 void raschistca(void);
 void zacrep(UINT,UINT);
 void otkat(void);
 void raschist(void);
 void perehod(UINT);
 HANDLE Nopen(LPCSTR);
 UINT Nread(HANDLE,LPVOID,UINT);
 HANDLE Ncreat(LPCSTR);
 UINT Nwrite(HANDLE,LPCVOID,UINT);
 void zac(UINT);
 void retact(void);
 UINT mesto(UINT);
 extern UINT mem(UINT);
 void uplotn(void);
 UINT correctadr(UINT);
 void opr(UINT,UINT);
 UINT ravntext(UINT,UINT);
 UINT sravn(UINT,UINT);
 UINT slog(UINT,UINT,UINT);
 UINT contprog(UINT);
 UINT continf(UINT,UINT);
 UINT text1(UINT*);
 UINT text2(UINT*);
 UINT razn(UINT,UINT,UINT);
 UINT sravnmod(UINT,UINT);
 UINT summa(UINT,UINT);
 UINT nomer(UINT);
 UINT lenman(UINT);
 UINT dopnuli(UINT,UINT);
 UINT* norman(UINT*);
 void rcvet(void);
 UINT cvdelta(UINT,UINT,UINT,UINT);
 UINT cvrasst(UINT,UINT);
 UINT cvperesech(UINT,UINT);
 UINT vnutrlin(UINT);
 UINT lindelta(UINT);
 void cfree(UINT,UINT);
 void cvobj(void);
 UINT grvekt(UINT,UINT,UINT);
 UINT diskr(UINT,UINT,UINT);
 UINT diskrcv(UINT);
 void cvetn(UINT);
 void pereklput(UINT,UINT,UINT);
 void udlin(UINT);
 void novcadr(UINT,UINT);
 void udalmassiv(UINT);
 UINT tekur(void);
 double chisld(UINT);
 double* getmasd(UINT);
 int* getmasi(UINT);
 UINT regmasd(double*);
 UINT smtabl(UINT,UINT,UINT);
 UINT grcopy(UINT,int,int);
 UINT grafcopy(UINT);
 int chislnol(UINT);
 UINT regmasi(int*);
 int chisli(UINT);
 void cadrprod(UINT);
 UINT prfx(UINT,UINT);
 extern UINT sffx(UINT,UINT);
 UINT SETX,SETY,SETEND;// shirina i visota setki izobragenija;
                       // chislo ee kletok
 UINT isklch(UINT,UINT);
 UINT cmntr(UINT,UINT*);
 UINT spskprm(void);
 UINT svbvhg(UINT);
 UINT novrebro(UINT,UINT,UINT,UINT);
 void prmter(UINT);
 UINT perenos(UINT);
 void smfail(UINT,UINT);
 void F165(void);
 void F185(void);
 void F176(void);
 void F200(void);
 void F292(void);
 void F293(void);
 void nachprog(void);
 extern void(* inter[])();
 extern UINT(* konv[])(UINT,UINT,UINT);
 extern UINT(* dekonv[])(UINT*,UINT);
 extern void(* inter2[])();
 UINT dekonvert(UINT*);
 void initprer(UINT);
 void slovin(UINT);
 void slovout(char*,UINT*);
 extern void konvertor(void);
 extern void tchk(UINT,UINT,UINT,UINT,UINT);
 extern void linfragm(UINT*);
 extern void Bitmap(UINT*);
 extern void initsetka(UINT,UINT);
 extern void extrnol(UINT*);
 extern void cvsvjazi(void);
 extern void cvizolir(UINT,UINT);
 extern void cvgruppi(UINT);
 extern void cvobjekti(void);
 extern void cvlinsist(UINT*);
 extern void cvsokrash(void);
 extern void sokrazv(UINT*);
 extern void pjatngrup(void);
 extern void linrazlichni(void);
 void cvprisoed(void);
 extern void cviskljuch(UINT);
 extern void cvpjatna(void);
 UINT cvnutr(UINT,UINT);
 UINT doublos(double);
 UINT intlos(int);
 UINT kopijamatr(UINT);
 UINT cvtest(UINT,UINT,UINT);
 UINT cveta(UINT);
 UINT linsokr(UINT,UINT);
 extern void lomanaja(UINT*);
 extern void risotrezki(UINT*);
 extern void cvotrezki(void);
 extern void vtorotrezki(void);
 extern void linsetka(UINT,UINT);
 extern void izobrprot(UINT*);
 extern void izobrvosst(void);
 extern UINT naprkletki(int, int, int, int, UINT);
 extern void smataka(UINT*);
 extern UINT dopusthod(UINT,UINT,UINT,UINT,UINT,UINT);
 extern UINT oprhod(UINT,UINT,UINT);
 extern void smhod(UINT*);
 extern void smHod(UINT*);
 UINT element(UINT*,UINT);
 extern void shahmotdeljaet(UINT*);
 extern void smnapadenie(UINT*);
 extern void kontrpolja(UINT*);
 extern void smzashita(UINT*);
 extern void shahpomeha(UINT*);
 extern void shahblock(UINT*);
 extern void shahsvjazka(UINT*);
 extern void blokataki(UINT*);
 extern void skvoznhod(UINT*);
 extern void oprgrup(UINT*);
 extern UINT convchisl(UINT);
 extern int intchisl(UINT);
 extern UINT losint(INT);
 extern UINT loschisl(UINT);
 extern UINT svertdlin(UINT*);
 extern UINT ostmn96(UINT*, UINT*);
 extern UINT* nod96(UINT*,UINT*,UINT*,UINT*,UINT*);
 extern void minusmn(UINT*);
 extern void minusmnkomp(UINT*);
 extern void domnogmn(UINT*,double);
 extern UINT delmnog(UINT*,UINT*,UINT*);
 extern UINT delmnogkomp(UINT*,UINT*,UINT*);
 extern void umnogmn(UINT*,UINT*,UINT*);
 extern void umnogmnkomp(UINT*,UINT*,UINT*);
 extern void domnogmnkomp(UINT*,double,double);
 extern void plusmn(UINT*,UINT*);
 extern UINT svertmn(UINT*);
 extern void razvertmn(UINT,UINT*);
 extern void razvmnkomp(UINT,UINT*);
 extern UINT svertmnkomp(UINT*);
 extern void plusmnkomp(UINT*,UINT*);
 extern void minusmn96(UINT*);
 extern UINT domnogmn96(UINT*,UINT*);
 extern void razvertmn96(UINT,UINT*);
 extern UINT svertmn96(UINT*);
 extern UINT plusmn96(UINT*,UINT*);
 extern UINT umnogmn96(UINT*,UINT*,UINT*);
 extern UINT delmnog96(UINT*,UINT*,UINT*);
 extern UINT delmod96(UINT,UINT,UINT);
 extern UINT deleniemod96(UINT*,UINT*,UINT*,UINT*);
 extern void umnogmod96(UINT*,UINT*,UINT*,UINT*);
 extern void minusmod96(UINT*,UINT*);
 extern void plusmod96(UINT*,UINT*,UINT*);
 extern UINT delenie96(UINT*,UINT*,UINT*,UINT*);
 extern UINT umnog96(UINT*,UINT*,UINT*);
 extern UINT delenie10(UINT*);
 extern void cifrplus96(UINT*,UINT);
 extern void umnog10(UINT*);
 extern void razvert96(UINT,UINT*);
 extern void svert96(UINT*,UINT);
 extern UINT plus96(UINT*,UINT*);
 extern void minus96(UINT*);
 void sdvigpath(char*);
 char* pp(void);
 void uchhol(UINT);

 void initsolv(void)  // inicializacia zoni zadach,stackov i osnovnih
						// parametrov - pri sohranenii zoni programm
  {UINT a;
	UINT b[14]={14,T1,L1,0,16,0,28,0,34,0,42,0,T1,0}; // ishodnaia zadacha
	UINT c[6]={6,T1,22,0,T1,0}; // spisok posilok ishodnoj zadachi
	UINT d[8] = {8,T1,L3,0,L3,0,T1,0}; // kommentarii k posilkam
	UINT e[14] = {59,0,1,0,0,0,0,L4,14,2,0,0,0,L0}; // kadr ich. zadachi
	for (a = 0;a < 14;++ a) Z[a+2] = b[a];
	for (a=0;a<6;++a) Z[a+16]=c[a];
	c[2] = L2; c[3] = 0x00030002; // fiktivnaja posilka VHOD
	for (a=0;a<6;++a) { Z[a+22]=c[a];Z[a+42]=c[a];}
	c[2] = L0; // spisok vesov posilok
	for (a=0;a<6;++a) Z[a+28]=c[a];
	for (a = 0;a < 8;++a)
		Z[a+34] = d[a];
	ind = 0; peresm = 0; otvet = 0; symbol = 0; nomprog = 0; fragm = 0; tec = 0;
	level = 0; svob = 48; st = T; keyend = 0; kontrhol = 0;
	for(a=0;a<14;++a)S[a] = e[a];
    SD[0] = 0; SD[1] = 0; SD[2] = 0; SD[3] = 0;
	for (a=14;a<59;++a)S[a]=0;
	cadr = 0; lcadr = 0; ist = 1; step = 0; prer = 0;
    delta = 1; ndelta = 0;
    blokprer = 0; stop = 0;
    itcv = 0; itcg = 0; itpg = 0;
	for(a = 0;a < 6;a++)PR[a] = 0;
	tact=T1; Z[48]=2097056; Z[49]=T2; tipprer = 0;
	input = 0; infhndl = 0; inphndl = 0; shift = 0;
    proghndl = 0; smotvet = 0;
	ctrl = 0; ctrr = 0; alt = 0; nominf = 1; menu = 0;
	stolbec = 0; stroka = 0; sdvig = 0x00200117;
    tekup = 0; polnij = 0; Polnij = 0; ialt = 0; iialt = 0; Scontr = 0;
	uplotnhndl = 0;FR1 = 0;FR2 = 0;ralt = 0;stp =0; isi = L0;
    kontrpr = 0; filtpr = 0; filtrblok = 0;
	FBUF[0] = 0; tekisi = bufisi; fiksr = 0;
    for(a = 6;a < 9;a++)pathprog[a + dlinpath] = '0';
    Dlinpath = dlinpath + 8; dLinpath = dlinpath + 5;
    srand(5673); BT[0] = 1; ZP[0] = 0; SE[0]= 0; lbufper = 0; tekzad = 0;
    cadrzad = 0; dpusthod = 0; indobl1 = 0; indobl2 = 0; prokrutka = 0;
    return;
  }

   HANDLE Nopen(LPCSTR a) // otkrivaet fail

   {HANDLE c;
    c = CreateFileA(a, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
		NULL, OPEN_EXISTING,
	  FILE_ATTRIBUTE_NORMAL, NULL);
	return c;
   }

    UINT Nread(HANDLE a, LPVOID b, UINT c) // chitaet iz faila: a - put, b- bufer, c-
	                                    // chislo bajt
	{DWORD d;
	 ReadFile(a,b,c,&d,NULL);
     return (UINT)d;
	}

	UINT Nwrite(HANDLE a, LPCSTR b, UINT c) //Zapisivaet v fail; analogichno Nread

	{DWORD d;
	 WriteFile(a,b,c,&d,NULL);
	 return (UINT)d;
	}

    HANDLE Ncreat(LPCSTR a) // sozdajet libo zanuljaet fail

	{HANDLE c;
	 c = CreateFileA(a, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
		 NULL, CREATE_NEW,
     FILE_ATTRIBUTE_NORMAL, NULL);
     if(c == INVALID_HANDLE_VALUE)
	  {c = CreateFileA(a, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
		 NULL, TRUNCATE_EXISTING,
		 FILE_ATTRIBUTE_NORMAL, NULL);
	   if(c == INVALID_HANDLE_VALUE)
	    {c = CreateFileA(a, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
		  NULL, TRUNCATE_EXISTING,
		  FILE_ATTRIBUTE_NORMAL, NULL);
	    }
	  }
	 return c;
    }

	UINT Npointer(HANDLE a, UINT b, UINT c) // ustanavlivaet ukazatel fajla "a" s pozicii b;
	                                         // esli c = 0, to s nachala fajla, inache s konca.
	{UINT d;
	 if(c == 0)
	  {d = SetFilePointer(a,b,NULL,FILE_BEGIN);}
	 else
      {d = SetFilePointer(a,b,NULL,FILE_END);}
	 return d;
	}

 void Nclose(HANDLE a)

 {CloseHandle(a);
  return;
 }

 UINT NPeekMessage(void)

 {UINT a;
  a = PeekMessage(&kmsg,hhwnd,0,0,PM_REMOVE);
  return a;
 }

 UINT NGetInputState(void)
  {UINT b;
   b = GetInputState();
   return b;
  }

 void NGlobalUnlock(HGLOBAL a)
  {GlobalUnlock(a);
   return;
  }

 void NGlobalFree(HGLOBAL a)
 {GlobalFree(a);
  return;
 }

HDC NGetDC(HWND a)
 {HDC b;
  b = GetDC(a);
  return b;
 }
HDC NCreateCompatibleDC(HDC a)
{HDC b;
 b = CreateCompatibleDC(a);
 return b;
}

void NSetPixel(HDC a, UINT b, UINT c, UINT d)

{SetPixel(a,b,c,RGB(red[d],green[d],blue[d]));
 return;
}

HGDIOBJ NSelectObject(HDC a, HGDIOBJ b)

{HGDIOBJ c;
 c = SelectObject(a,b);
 return c;
}
HBITMAP NCreateBitmap(UINT a, UINT b, UINT c, UINT d, const void* e)
{HBITMAP f;
 f = CreateBitmap(a,b,c,d,e);
 return f;
}

void NSetTextColor(HDC a, UINT b)
{SetTextColor(a,RGB(red[b],green[b],blue[b]));
 return;
}

void NBitBlt(HDC a, UINT b, UINT c, UINT d, UINT e, HDC f, UINT g, UINT h, UINT i)
{BitBlt(a,b,c,d,e,f,g,h,(i == 0? SRCCOPY : SRCAND));
 return;
}

HBITMAP NCreateCompatibleBitmap(HDC a, UINT b, UINT c)
{HBITMAP d;
 d = CreateCompatibleBitmap(a,b,c);
 return d;
}

void NDeleteDC(HDC a)
{DeleteDC(a);
 return;
}

void NDeleteObject(HGDIOBJ a)
{DeleteObject(a);
 return;
}

void NReleaseDC(HWND a, HDC b)
 {ReleaseDC(a,b);
  return;
 }

UINT NGetFileAttributesA(LPCSTR a)
{UINT b;
 b = GetFileAttributesA(a);
 return b;
}

void NSetBkColor(HDC a, UINT c)

{UINT d;
 d = RGB(red[c],green[c],blue[c]);
 SetBkColor(a,d);
 return;
}

HPEN NCreatePen(UINT a, char b, char c, char d)
{HPEN e;
 e = CreatePen(PS_SOLID,a,RGB(b,c,d));
 return e;
}

HBRUSH NCreateSolidBrush(char b, char c, char d)
{HBRUSH a;
 a = CreateSolidBrush(RGB(b,c,d));
 return a;
}

void NPolygon(HDC a, const POINT* b, UINT c)

{Polygon(a,b,4);
 return;
}

void NRectangle(HDC a, UINT b, UINT c, UINT d, UINT e)

{Rectangle(a,b,c,d,e);
 return;
}

BOOL NMoveToEx(HDC a, UINT b, UINT c)
{BOOL d;
 d = MoveToEx(a,b,c,NULL);
 return d;
}

BOOL NLineTo(HDC a, UINT b, UINT c)
{BOOL d;
 d = LineTo(a,b,c);
 return d;
}

void NDestroyWindow(HWND a)
{DestroyWindow(a);
 return;
}

void reprogram(void)

 {UINT i,j,*a;
   kthndl = Nopen(pathkat);
   Npointer(kthndl,0,0);
   Nread(kthndl,(char*)K,2097152);
   Nclose(kthndl);
   for(i = 0; i < NP; i++)
    {a = P[i];
     for(j = 0 ; j <= 65535; j++)
	  {a[j] = 0;}
    }
   svobprog = 0; svobfrag = 0;
   if(proghndl != 0)Nclose(proghndl);
   if(infhndl != 0)Nclose(infhndl);
 }

  void maincycle()  // osnovnoj cicle interpretatora
   {while (ind < 2 || ind == 4)
    if (ind == 0)scanpr();
    else
     {if(ind == 1)interp();
      else initprer(1);
     }
   }

  void sdvigpath(char* a) // a - ukazatel na massiv,
   // sodergashij koncevoj fragment puti k failu ili
   // direktorii. V nachalo etogo massiva vstavljaetsja
   // put k rabochej direktorii.

   {UINT i,j;
    i = 0; while(a[i] != 0) i++;
    i--; j = i + dlinpath;
	a[j+1] = 0;
    while(i != 0)
     {a[j] = a[i]; j--; i--;}
    a[j] = a[0];
    for(i = 0; i < dlinpath; i++)
    a[i] = pathbuf[i];
    return;
   }
			 //  FUNKCII SCANIROVANIJA ZADACHI
	 void scanpr()  // scanirovanije zadachi - osnovnoj cicle
	{UINT a,b;
	 if (otvet!=0) endpr();  // vidacha otveta na zadachu
	 else
	  {lcadr = cadr;
      for(a = 0x0000000F;a < S[cadr+8];a++)
      S[cadr+a] = 0;
      S[cadr+8] = 0x0000000E;
      if (peresm == 1)
       {peresm = 0;S[cadr+6]=0;S[cadr+10]=0;S[cadr+13]=L0;}
      if(S[cadr+10] == 0)  // obrashenije k programme tipa zadachi
		 {S[cadr+10]=L0;S[cadr+11]=L0;S[cadr+12]=L0;
		  symbol =  Z[S[cadr+9]+2]; // ustanovka na programmu tipa zadachi
		  ind=1;tec = 0; // perehod k rabochemu ciclu interpretatora
		 }
		else    // sobstvenno skanirovanije
		 {if(S[cadr+10] == L0) scanblock(); // nachalo scanirovanija
		  else
		  	{a=S[cadr+10];
          do {a+=2;b=Z[a];}
			 while (!(b&0x80200000));
			 if(b&T1) // konec prosmotra simvolov tek.terma
			  {if(S[cadr+6] == 0)Z[ves()]++;
            scanblock();
           }
			 else {S[cadr+10]=a;symbol=b;ind=1;tec = 0;}
			}
		 }
	  }
	}
	UINT ves()    // vozvrashaet smeshenije jachejki,hranjashej ves
					  // tek.terma
	 {UINT a,b; a=S[cadr+9]; if(S[cadr+12] == L0) b=a+6;
									  else b=a+12;
		 if(S[cadr+12] != L0 && Z[a+2] != L5) return b;
		 else return (Z[b]+(S[cadr+11]-Z[b-2]));
	 }

	void scanblock()  // ishet ocherednoj tek.term i organizuet perehod
							// k rassmotreniju ego pervogo simvola
	{UINT a,b,c;
	 if(S[cadr+6] != 0)
	  {if(S[cadr+13]<S[cadr+6])
		 {S[cadr+13]++;a=Z[S[cadr+11]]+2;
        S[cadr+10]=a;symbol=Z[a];
		  ind=1;return;
       }
		else S[cadr+6]=0;
	  }
	 a=(S[cadr+10]==L0 ? 0:ves());
	 b=S[cadr+13]+1;
	 do a = scanstep(a);
	 while (a!=0 && (Z[a]>b ||
    (!(Z[Z[S[cadr+11]]+2]&T3) && (Z[a]++,1))));
	 if(a==0)
	  {if((S[cadr+7] & 0x0000FFFF)==(S[cadr+13] & 0x0000FFFF))
       {otvet=L6;
        if(PR[prer] == 2 && PR[prer+1] == cadr)
         {tipprer = 9; PR[prer] = 21; ind = 9;
          initprer(1);return;
         }
        endpr();return;}
		else
       {S[cadr+13]++;S[cadr+10]=0;return;}
	  }
	 else
     {c=Z[S[cadr+11]]+2;S[cadr+10]=c;
      symbol=Z[c];ind=1;
		if(Z[a]==b)
       {S[cadr+6]=S[cadr+13];S[cadr+13]=L0;}
	  }
   }

	 UINT scanstep(UINT a)  // a-0 libo smeshenije vesa tek.terma.
									// Realizuetsija perehod k ocherednomu tek.
									// termu;vozvrashaet novoe smeshenije ego vesa
									// libo 0.
	 {UINT b;
     b=S[cadr+9];
	  if(a==0)
	   {if(Z[b+2]==L1)
        {S[cadr+12]=L0;S[cadr+11]=Z[b+4]+2;
			return(Z[b+6]+2);
        }
		 else
        {S[cadr+12]=L7;
			if(Z[b+2]==L5)
			  {S[cadr+11]=Z[b+10]+2;return(Z[b+12]+2);}
			else {S[cadr+11]=b+10;return(b+12);}
		  }
		}
	  else
      {if(S[cadr+12]==L7)
        {if(Z[b+2] != L5 || (Z[a+2] & T1))
		    {S[cadr+12] = L0;S[cadr+11]=Z[b+4]+2;
           return(Z[b+6]+2);
          }
		   else
          {S[cadr+11] += 2;a += 2;return a;}
		  }
       else
        {if(Z[a+2] & T1)return 0;
         else
          {S[cadr+11] += 2;a += 2;return a;}
        }
	   }
    }

	 void endpr()  // vidacha otveta na zadachu

	  {UINT b,c,*d,e,f,g,h;
	   UINT64 i;
      peresm = 0;
      if(cadr==0)ind=3;
		else
       {h = S[cadr+3];
        if((PR[prer] == 2 || PR[prer] == 17)
          && (PR[prer+1] == h ||
              (S[h+2] == 2 && PR[prer+1]== S[h+3])))
        {b = S[9]; b = Z[b+8]; b += (Z[b] - 4);
         b = Z[b] + 2;
	      for(c = Z[b];!(c & T1);b += 2,c = Z[b])
	       {if(!(c & T6))
           {if(Z[c+2] == 0x0020038D)
            {e = Z[c+4];
             if(!(e & T6))
              {g = e + Z[e] - 4;
               g = Z[g];
               if(Z[g + 10] == 0x00200104)
               Z[g+10] = otvet;
               i = step;d = st;
	            if(i == 0)f = L0;
	            else
	             {while(i != 0)
		           {*st = (i % 10) + L0;i /= 10;st++;}
		            if(st == d+1)
		             {st = d;f = *st;}
		            else f = text2(d);

                }
               Z[g+8] = f;
              }
             break;
            }
           }
          }
        }
        *st=otvet;st++;otvet=0;contin();
       }
	  }


	 void contin()  // vozvrashenije k programme
                   // istochnika tek.kadra

	  {UINT a,b,c,*p,d,e,f;
	   UINT64 i;
      a=S[cadr+4];nomprog=a&T4;
      A=P[nomprog];fragm=a>>16;
		a=S[cadr+5];tec=A+(a&T4);level=a>>16;
      lcadr=S[cadr+1];
      suff=A+fragm+A[fragm];
      if(S[cadr+2] == 3 && S[cadr+3] >= 0xFFFFFFFD)
       {stp -= 10;peresm = SP[stp];
        blokprer = 0xFFFFFFFF - S[cadr+3];
        otvet = SP[stp+1];symbol = SP[stp+2];
        ind = SP[stp+3];
        if(ist == 1)st--;
        ist = SP[stp+4];
        uroven = SP[stp+5];
	     delta = SP[stp+6];cadr = SP[stp+7];
        prer -= 7;
        if(ind == 9)
         {ind = 0; endpr();return;}
        ind = 1;
        if(ist == 2)
        {a = S[cadr+2];
         ist = 1;
         contin();
         if(a == 2)ist = 0;
         else
          {ist = 1;*st = L0;st++;}
         return;
        }
       }
		else
       {if((PR[prer] == 2 || PR[prer] == 17)
          && PR[prer+1] == cadr)
        {b = S[9]; b = Z[b+8]; b += (Z[b] - 4);
         b = Z[b] + 2;
	      for(c = Z[b];!(c & T1);b += 2,c = Z[b])
	       {if(!(c & T6))
           {if(Z[c+2] == 0x0020038D)
            {Z[c+4] = L3;
             break;
            }
           }
          }
        }
        cadr = S[cadr+3];ind = 1;
        if((PR[prer] == 2 || PR[prer] == 17)
          && PR[prer+1] == cadr)
        {b = S[9]; b = Z[b+8]; b += (Z[b] - 4);
         b = Z[b] + 2;
	      for(c = Z[b];!(c & T1);b += 2,c = Z[b])
	       {if(!(c & T6))
           {if(Z[c+2] == 0x0020038D)
            {e = Z[c+4];
             if(!(e & T6))
              {d = e + Z[e] - 4;
               d = Z[d];
               if(Z[d + 10] == 0x00200104)
                {Z[d+10] = L6;
                 i = step;p = st;
	              if(i == 0)f = L0;
	              else
	               {while(i != 0)
		              {*st = (i % 10) + L0;i /= 10;st++;}
		             if(st == p+1)
		              {st = p;f = *st;}
		             else f = text2(p);

                  }
                 Z[d+8] = f;
                }
              }
             break;
            }
           }
          }
        }
       }
	  }

					//  RABOCHIJ CICLE INTERPRETATORA

	 void interp()
	  {UINT a,b,c,d,*e,f,g,h,*m,n,k,
	   R1,R2,R3,R4;
		if(tec == 0)
       {nachprog();if(ind == 4)return;
        if(tec == 0)return;
       }
       do {a = *tec;tec++;
           if(!(a & 0xFFF00000))
            {d = a + 8;
             if(d >= S[cadr+8])*st = T1 | a;
             else
              {*st = S[cadr+d];
			    if(*st == 0)*st = T1 | a;
              }
             st++;
            }
		   else
            {if(a & 0x00200000){*st = a;st++;}
			 else
            {step += delta;
            if(!(step & 0x000007FF))
             {b = 1;
              while(b != 0)
                {b = NPeekMessage();
                 if(b != 0)
                  {switch (kmsg.message)
	                {case WM_KEYDOWN:
	               	d = kmsg.wParam;
	               	switch (d)
		                {case VK_F11: rus = 1;
                        break;
                       case VK_F12: rus = 0;
                        break;
                       case VK_SHIFT:
		                  shift = 1;
                        break;
		               case VK_CONTROL:
		                if(kmsg.lParam & 0x01000000)ctrr = 1;
		                else ctrl = 1;
		                break;
                       case 0x13:
                        PR[prer] = 6;
                        PR[prer+1] = 0;
                        PR[prer+2] = 0;
                        PR[prer+3] = 0;
                        PR[prer+4] = 0;
                        PR[prer+5] = 0;
						PR[prer+6] = 0;
					    break;
					    case 0x23:
                        keyend = 1;
                        break;
                      }
                     break;
                     case WM_PAINT:
                     BeginPaint(hhwnd,&pst);
                     hdc = pst.hdc;
                     rect = pst.rcPaint;
                     R1 = rect.left;R2 = rect.top;
                     R3 = rect.right;R4 = rect.bottom;
                     NBitBlt(hdc,R1,R2,R3 - R1 + 1,R4 - R2 + 1,hsdc,
                     R1,R2,0);
                     EndPaint(hhwnd,&pst);
	                 break;
                     case WM_KEYUP:
		               d = kmsg.wParam;
		               switch(d)
		                {case VK_SHIFT:
		                	shift = 0;
			               break;
		                 case VK_CONTROL:
			               ctrr = 0;ctrl = 0;
			               break;
		                }
		               break;
   					 default:
                     DefWindowProc(hhwnd,kmsg.message, kmsg.wParam, kmsg.lParam);
					 break;

                   }
                  }
                }
              }
            g = 0; h = 0;
            if(step == stop)
            {b = cadr;c = lcadr;d = 0;stop = 0;
              while(c != 0)
               {if(S[c+2] == 4 && S[c+8] == 1 &&
                   S[c+3] == b &&
                   step >= *((UINT64*)(S+c+9)))
			        {d = c;}
                if(b == c)b = S[b+3];
                c = S[c+1];
               }
              if(d != 0)
               {c = cadr;
                while(c != 0 && d < c)
                 {if(S[c+2] == 2)
                   {if(c == cadr)
                     {m = A; n = fragm;}
                    else
                     {k = S[c];
                      while(k < lcadr && S[k+3] != c &&
                            S[k+3] < 0xFFFFFFFD)
                      k = S[k];
                      m = P[S[k+4] & 0x0000FFFF];
                      n = S[k+4] >> 16;
                     }
		              while(b = m[n+3],b & 0xFFFF0000)
		                {n = b & T11;
                       m = P[(b >> 19) - 1];
		                }
		              b |= 0x00200000;
                    if(b == 0x00200142 || b == 0x002004C2
                    || b == 0x0020014B || b == 0x00200341)
                     {h = 1; break;}
                   }
                  c = S[c+1];
                 }
                c = 500;
                if(a == 0x0010001D || a == 0x001000F3 ||
				   a == 0x0010001A)
                 {h = 1; c = 2;}
                if(h == 1) stop = step + c;
                else
                 {cadr = S[d+3];lcadr = d;st = T + S[d+11];
                  if(cadr < cadrzad)
				   {tekzad = 0;cadrzad = 0;
				   }
				  if((PR[prer] == 2 || PR[prer] == 17)&&
                      PR[prer+1] > cadr &&
                      PR[prer+1] != 0xFFFFFFFF)
                  {b = S[9]; b = Z[b+8]; b += (Z[b] - 4);
                   b = Z[b] + 2;
	                for(c = Z[b];!(c & T1);b += 2,c = Z[b])
	                 {if(!(c & T6))
                      {if(Z[c+2] == 0x0020038D)
                        {Z[c+4] = L3;
                         break;
                        }
                      }
                    }
                   g = 1;
                  }
                  for(b = 0;b <= prer;b += 7)
                  if(PR[b + 1] > cadr &&
                     PR[b + 1] != 0xFFFFFFFF)
                   for(c = 0;c < 7;c++)PR[b+c] = 0;
                   otkat();a = *tec;tec++;
                 }
                }
              if(h == 0)
               {b = cadr;c = lcadr;d = 0;
                while(c != 0)
                 {if(S[c+2] == 4 && S[c+8] == 1 &&
                     S[c+3] == b && *((UINT64*)(S+c+9)) != step &&
                     *((UINT64*)(S+c+9)) >= step)
                   {if(d == 0)
                     {stop = *((UINT64*)(S+c+9));d = 1;}
                    else
                     {if(*((UINT64*)(S+c+9)) - step < stop - step)
                       stop = *((UINT64*)(S+c+9));
                     }
                   }
                  if(b == c)b = S[b+3];
                  c = S[c+1];
                 }
                if(smotvet > cadr)
                {smotvet = 4;tipprer = 9;initprer(1);return;}
               }
            }
            if(g == 1)
             {PR[prer] = 20;PR[prer+1] = cadr;
              tipprer = 9;initprer(1);return;
             }
			if(delta == 1 && !(step & 0x000FFFFF))
			 {tipprer = 12;initprer(1);return;
			 }
		    if(4 < PR[prer])
            switch(PR[prer])
            {case 5:  // prerivanie po zadannomu operatoru
             c = PR[prer+4];
             if((c & 0x0000FFFF) == nomprog &&
                 tec == A + ((c >> 16) + 1))
             {tipprer = 9;initprer(1);return;}
             break;
             case 6:  // poshagovaja trassirovka
             c = (a & T4) - 1;
             if(operatori[c] == 1)
             {tipprer = 9;initprer(1);return;}
             break;
             case 7:  // poshagovaja trassirovka v zadannom kadre
             c = (a & T4) - 1;
             if(operatori[c] == 1 && cadr == PR[prer+1])
             {tipprer = 9;initprer(1);return;}
             break;
             case 8 : // pooperatornaja trassirovka v zadannom kadre
             if(cadr == PR[prer+1])
             {if(FR1 != A + fragm)
              {dekonvert(A+fragm);if(ind == 4)return;
              }
              b = (tec - A - 1) - fragm;
              c = FR[b];
              if(c != 0)
               {while(!(Z[c-1] & 0x80000000))c -= 2;
                e = tec - 1;f = 1;
                while(4 < b)
                 {b--;e--;d = FR[b];
                  if(d != 0)
                   {if(d < c || d > c-2 + Z[c-2])break;
                    if(*e & 0x00100000)
                     {f = 0;break;}
                   }
                 }
                if(f == 1)
                 {tipprer = 9;initprer(1);return;}
               }
             }
             break;
             case 9: // prerivanie pri vihode iz zadannogo kadra
             if(cadr < PR[prer+1])
             {tipprer = 9;initprer(1);return;}
             break;
             case 10: // prerivanie pri vihode na kadr zadachi
             if(S[cadr+2] == 1)
             {tipprer = 9;initprer(1);return;}
             break;
             case 11: // prerivanie po dostigenii zadannogo chisla shagov
             if(step == *((UINT64*)(PR+prer+5)))
             {tipprer = 9;initprer(1);return;}
             break;
             case 12: // operator v kadre
             if(cadr < PR[prer+1])
              {PR[prer+4] = 0;PR[prer] = 9;
               tipprer = 9;initprer(1);return;}
             c = PR[prer+4];
             if((c & 0x0000FFFF) == nomprog &&
                 tec == A + ((c >> 16) + 1) &&
                 PR[prer+1] == cadr)
             {tipprer = 9;initprer(1);return;}
             break;
             case 13:
             case 14:
             if(cadr < PR[prer+1])
              {PR[prer+4] = 0;PR[prer] = 9;
               PR[prer+2] = 0;
               tipprer = 9;initprer(1);return;}
             break;
            }
//              if(step == Step || symbol == Symbol ||
//             fragm == Fragm || Cadr == cadr)
//             {pp();
//             }
            inter[(a & T4)-1]();
            // if((DZ != 0 && Z[DZ] == dZ) ||
            //   (DS != 0 && S[DS] == dS) ||
            //  (DDP != 0 && (AP = P[DDP-1],AP[DP] == dP))||
            //   (DT !=0 && *DT == dT)
            //  )
           //  {pp();
           //  }
        //    if(Contprog != 0)
        //     {b = contprog(Contprog);
        //      R[0] = b;Contprog ++;
        //     }
        //   if(Contblok != 0)
        //   {b = continf(Contblok,Continf);
        //      R[0] = b;Continf ++;
        //     }
            if(blokprer != 0)
             {a = *tec;
              if(a & 0x00100000)
               {if(tec == A+fragm+4)step += delta;
                tec++;blokprer --;
                inter[(a & T4)-1]();
               }
              blokprer = 0;
             }
           }
			 }
		   }
		  while (ind == 1 && tec != suff && tec != 0);
		  if(tec == suff)
         {a = S[cadr+2];
          if (a == 1)ind = 0;
          else
           {contin();
           	if(a == 2)ist = 0;
				else {*st = L0;st++;}
			  }
		   }
	  }

	  void nachprog()

	  {UINT a,b;
		a = (symbol & T11) - 1;
		b = K[a];
      if(b == 0)
	   {ind = 4;tipprer = 5;return;}
	  if(b & T1)
       {b = fragment(b);
	    if(b == 0)
		 {ind = 4;tipprer = 5;return;}
        K[a] = b;
       }
		nomprog = (b >> 19)-1; A = P[nomprog];
		fragm = b & T11;tec = A + fragm + 4;
		A[fragm + 3] = symbol & T11;
		suff = A + fragm + A[fragm];
      if(PR[prer] == 3 &&
         PR[prer+2] == symbol)
       {tipprer = 9;tec++;initprer(1);return;}
     }


				  // FUNKCIJI ZONI PROGRAMM

	 UINT fragment(UINT a) // a - glob.adres fragmenta v prog.fajlah.Etot
								  // fragment zanositsja v zonu programm.Vozvrashaet
								  // ssilku na fragment v zone programm.Pri neudache
                          // vozvrashaet 0.
	 {UINT b,d,*e,f,g,h,p,s,t,v,j;
	  char c[3] = {'0','0','0'};
	  b = a >> 22;
	  for(d = 0;d < 2;d++)
	   {c[d] += (char)(b & 7);b >>= 3;}
	  if(ralt == 2)
	  {if(proghndl != 0)Nclose(proghndl);
		for(d = 0;d < 2;d++) pathaltprog[Dlinpath + 4 - d] = c[d];
	 	proghndl = Nopen(pathaltprog);
	  }
	  else
	  {d = 0;while(c[d] == pathprog[Dlinpath-d] && d < 2)d++;
		if(d != 2)
		{if(proghndl != 0)Nclose(proghndl);
		 for(d = 0;d < 2;d++) pathprog[Dlinpath - d] = c[d];
		 proghndl = Nopen(pathprog);
		}
      else
       {if(proghndl == 0)proghndl = Nopen(pathprog);
	   }
	  }
      if(proghndl == INVALID_HANDLE_VALUE)return 0;
	  b = a & 0x003FFFFF;
	  Npointer(proghndl,b,0);
	  progcount = Nread(proghndl,(char*)R,4);
	  v = R[0] >> 16;
      if(v < (R[0] & 0x00003FFF))return 0;
	  Npointer(proghndl,b,0);
      progcount = Nread(proghndl,R,v);
	  if(svobfrag > 65522)raschistca();
	  e = P[svobprog];d = svobfrag;e[svobfrag] = 0;
	  e[svobfrag + 3] = a;svobfrag += 5;
	  b = (R[0] & 0x00003FFF) - 7; // b - chislo ostavshihsja bait teksta
	  f = 2;g = R[1] >> 24;      // f - smeshenie pervoj neispolzovannoj
	  h = 1;             		  // jachejki iz R;g - dlinnij bufer;
	  s = 0;t = 1;v = 8 * b;  // h - kolichestvo bait v bufere g
									  // s - nakopitel - so 2-go bita;t - pervij
									  // svobodnij bit v nakopitele;v - chislo
									  // ostavshihsja bit

	  while(v > 10)        // cicle schitivanija osnovnoj chasti
	   {while(t < 21 && b != 0)
		  {s |= ((g & 0x000000FF) << t);t += 8;
			if(h == 1){g = R[f];f++;h = 4;}
			else {h--;g >>= 8;}
		  }

		 if(s & 2)
			{j = (s >> 3) & 0x000001FF;v -= 11;
			 if(s & 4)j |= 0x00100000;
			 s >>= 11;t -= 11;
			}
		 else {j = (((s >> 2) & T11) | 0x00200000);
             v -= 20;s >>= 20;t -= 20;}
		 e[svobfrag] = j;svobfrag ++;
		 if(svobfrag > 65522)
          {d = perenos(d);e = P[svobprog];}
	   }
	  e[d+1] = svobfrag - d - 1;
	  b = R[0] & 0x00003FFF; // chislo bait do suffiksa
	  f = ((R[0] >> 16) - b)/3; // chislo ssilok iz fragmenta
	  e[d+2] = e[d+1] + f;
		if(f != 0)
		  {g = b/4;h = R[g];t = b%4;if(t > 0)h >>= (8*t);
			t = 4 - t;  // g - ssilka na tek.jachejku istochnika v R
							// h - bufer;t - chislo bait v bufere

			while(f != 0)   // cicle formirovanija ssilok iz fragmenta
			 {s = 0; // zagotovka ssilki
			  for(j = 0;j < 24;j += 8)
				{p = h & 0x000000FF;s |= (p << j);
				 if(t == 1) {g++;h = R[g];t = 4;}
				 else {h >>= 8;t--;}
				}
			  s |= (s & 0x00800000 ? 0xFFC00000 : (a & 0xFFC00000));
			  e[svobfrag] = s;svobfrag++;
			  if(svobfrag > 65522)
            {d = perenos(d);e = P[svobprog];}
			  f--;
			 }
		  }
	  if(ralt == 2){Nclose(proghndl); proghndl = 0;};
	  return (((svobprog+1) << 19) | d+1);
	 }

     UINT contrfragment(UINT a) // a - globalnij adres fragmenta v prog.fajle.
		                   // Schitivaet etot fragment v massiv F v tom ge formate,
						   // kak v zone programm. Ispolzuetsja dlja kontrolja zoni programm
						   // Pri udache vozvrashaet 1, inache 0.
	 {UINT b,d,f,g,h,p,s,t,v,j,q;
	  char c[3] = {'0','0','0'};
	  b = a >> 22;
	  for(d = 0;d < 2;d++)
	   {c[d] += (char)(b & 7);b >>= 3;}
	  d = 0;while(c[d] == pathprog[Dlinpath-d] && d < 2)d++;
	  if(d != 2)
	   {if(proghndl != 0)Nclose(proghndl);
	    for(d = 0;d < 2;d++) pathprog[Dlinpath - d] = c[d];
	    proghndl = Nopen(pathprog);
       }
      else
       {if(proghndl == 0)proghndl = Nopen(pathprog);}

      if(proghndl == INVALID_HANDLE_VALUE)return 0;
	  b = a & 0x003FFFFF;
	  Npointer(proghndl,b,0);
	  progcount = Nread(proghndl,(char*)R,4);
      v = R[0] >> 16;
      if(v < (R[0] & 0x00003FFF))return 0;
	  Npointer(proghndl,b,0);
      progcount = Nread(proghndl,R,v);
	  F[0] = 0;
	  F[3] = a;q = 5;
	  b = (R[0] & 0x00003FFF) - 7; // b - chislo ostavshihsja bait teksta
	  f = 2;g = R[1] >> 24;      // f - smeshenie pervoj neispolzovannoj
	  h = 1;             		  // jachejki iz R;g - dlinnij bufer;
	  s = 0;t = 1;v = 8 * b;  // h - kolichestvo bait v bufere g
									  // s - nakopitel - so 2-go bita;t - pervij
									  // svobodnij bit v nakopitele;v - chislo
									  // ostavshihsja bit

	  while(v > 10)        // cicle schitivanija osnovnoj chasti
	   {while(t < 21 && b != 0)
		  {s |= ((g & 0x000000FF) << t);t += 8;
			if(h == 1){g = R[f];f++;h = 4;}
			else {h--;g >>= 8;}
		  }

		 if(s & 2)
			{j = (s >> 3) & 0x000001FF;v -= 11;
			 if(s & 4)j |= 0x00100000;
			 s >>= 11;t -= 11;
			}
		 else {j = (((s >> 2) & T11) | 0x00200000);
             v -= 20;s >>= 20;t -= 20;}
		 F[q] = j;q ++;

	   }
	  F[1] = q - 1;
	  b = R[0] & 0x00003FFF; // chislo bait do suffiksa
	  f = ((R[0] >> 16) - b)/3; // chislo ssilok iz fragmenta
	  F[2] = F[1] + f;
		if(f != 0)
		  {g = b/4;h = R[g];t = b%4;if(t > 0)h >>= (8*t);
			t = 4 - t;  // g - ssilka na tek.jachejku istochnika v R
							// h - bufer;t - chislo bait v bufere

			while(f != 0)   // cicle formirovanija ssilok iz fragmenta
			 {s = 0; // zagotovka ssilki
			  for(j = 0;j < 24;j += 8)
				{p = h & 0x000000FF;s |= (p << j);
				 if(t == 1) {g++;h = R[g];t = 4;}
				 else {h >>= 8;t--;}
				}
			  s |= (s & 0x00800000 ? 0xFFC00000 : (a & 0xFFC00000));
			  F[q] = s;q++;
			  f--;
			 }
		  }
	  return 1;
	 }

     void testprog () // sravnivaet sodergimoe zoni programm s
		              // ishodnimi versijami fragmentov, hranjashimisja
					  // v bloke programm
	 {UINT i,j,*a,b,c,d,e,k,m;
	  for(i = 0; i < NP; i++)
	   {a = P[i];
        j = 1;
	    while(a[j] != 0)
	     {b = a[j+2];
	      c = contrfragment(b);
		  if(c == 1)
		   {d = a[j];
		    e = F[1];
		    if(d != e)
		     {ttt = 1;} // raznie dlini fragmentov
		    for(k = 5, m = j+4; k < d; k++,m++)
		     {if(a[m] != F[k])
		      {ttt = 1;}  // nesovpadenie komand
		     }
           }
		  else
		   {ttt = 1;} // ne schitan  fragment v F
		  j += (a[j+1]+1);
	     }
	   }
      return; // oshibok ne obnarugeno
	 }

	 void raschistca()  // raschishaet ocherednoj massiv zoni programm
							  // dlja zapisi fragmenta iz prog.fajlov.Ispolzu-
							  // emie fragmenti etogo massiva cdvigajutsia v ego
							  // nachalo i sohranjajutsia
	 {UINT *a,c,b,d,e,f,g,h,p,*q,r;
	  FR1 = 0;FR2 = 0;
     for(b = 0;b <= prer;b += 7)
	   {c = PR[b+4];
	    if(c != 0)
        {d = (c & 0x0000FFFF);
         c >>= 16;
         a = P[d];
         while(a[c] != 0)c--;
         c++;
         PR[b+3] = c;
        }
	   }
     if(svobprog < NP - 1) svobprog ++; else svobprog = 0;
	  a = P[svobprog]; // a - ukazatel na nachalo raschishaemogo
											// massiva
	  if (a[1] == 0) {svobfrag = 0;return;}
	  for (b = 0;b <= lcadr;b = S[b])
	  	{c = S[b+4];
       if(c != 0)zacrep(c & T4,c >> 16);
      }
	  if(tec != 0) zacrep(nomprog,fragm);
	  for(b = 0;b <= prer;b += 7)
	   {c = PR[b+4];
	    if(c != 0)
        {d = PR[b+3];
         zacrep(c & T4,d);
        }
	   }
	  for(b = 1; b <= ZP[0]; b++)
	   {c = ZP[b];
	    d = Z[c + 2]; d &= 0x0007FFFF;
	    e = Z[c + 4]; e &= 0x0007FFFF;
	    if(e == svobprog)
	 	 {zacrep(e,d);}
	   }
	  c = 1;  // novoe smeshenije zakreplennogo fragmenta
	  d = 1; // smeshenije tek. fragmenta
	  do
      {if(a[d-1] != 0)
        {a[d-1] = c;c += (a[d+1]+1);}
       e = d + a[d];f = d + a[d+1];
       r = (a[d-1] == 0 ? 0 : ((svobprog + 1) << 19) | a[d-1]);
    	 while (e < f)
        {g = a[e];
		   if (!(g & T1)) // korrekcija vozvratnih
									 // ssilok na fragment iz
		   {h = g >> 19;      // drugih segmentov
          if(h-1 != svobprog && h != 0 && h <= NP)
           {p = g & T11;q = P[h-1];q[p+3]=r;}
         }
		   e++;
		  }
       if(a[d-1] == 0)r = a[d+2];
       e = a[d+3];
		 if(e != 0)
		  {f = e >> 19;g = e & T11;  // korrekcija prjamih ssilok
			if(f == 0)K[g-1] = r;  // na fragment i vozvratnih
			else                   // v tom ge segmente
          {q = P[f-1];
           h = ((svobprog + 1) << 19) | d;
           e = g + q[g];p = g + q[g+1];
			  while (q[e] != h && e < p)e++;
           if(e < p)q[e] = r;
           if(f-1 == svobprog)
            {if(q[g-1] == 0)a[d+3] = 0;
             else a[d+3] = (f << 19) | q[g-1];
            }
			 }
		  }
		 d += (a[d+1]+1);
		}
	  while (d < 65536 && a[d] != 0);
	  for(b = 0;b <= lcadr; b = S[b])  // korrekcija ssilok
		{c = S[b+4];d = c & T4;  // iz glob.steka
       if(c != 0 && d == svobprog)
        {e = c >> 16;f = e - a[e-1];
         S[b+4] -= (f << 16);
			S[b+5] -= f;
        }
       if((S[b+3]& 0xFFFFFFF0) == 0xFFFFFFF0)
        {c = S[b+8];
         if(c > 17)
          {c = S[b+17];
           if(!(c & T6) && !(Z[c+1]&T1))
            {c = Z[c]; g = Z[c+4] & T4;
             if(g == svobprog && (Z[c+1]&T1)&&(Z[c] == 12))
              {e = Z[c+2]; e &= 0x0000FFFF;
               f = e - a[e-1];
               Z[c+2] -= f;
               Z[c+6] -= f;
              }
            }
          }
        }
	   }
	  if((tec != 0) && (nomprog == svobprog))  // korrekcija
		{e = fragm - a[fragm - 1]; // ssilki na tek.operator
       tec -= e; suff -= e; vremsuff -= e;
		 fragm -= e;
      }
	  for(b = 0;b <= prer;b += 7)
	   {c = PR[b+4];
		 if(c != 0 && ((c & 0x0000FFFF) == svobprog))
		  {d = PR[b+3]; e = d - a[d-1];
         e <<= 16;PR[b+4] -= e;
		  }
	   }
	  for(b = 1; b <= ZP[0]; b++)
	   {c = ZP[b];
	    e = Z[c+4] & 0x0007FFFF;
		if(e == svobprog)
		 {d = Z[c+2] & 0x0007FFFF;
		  e = a[d-1];
		  Z[c+2] = 0x00200000 | e;
		 }
	   }
	  c = 0;d = 1;   // perenesenije zakreplennih fragmentov v nacalo
	  do
      {if(a[d-1] != 0)
		  {a[c] = 0;c ++;
         e = d + a[d+1];
			do
          {a[c] = a[d];c ++;d ++;
          }
			while (d < e);
			d ++;
		  }
		 else d += (a[d+1]+1);
	  	}
	  while (d < 65536 && a[d] != 0);
	  for(d = c;d < 65536;d++)a[d] = 0;
     for(b = 0;b <= prer;b += 7)
	   {d = PR[b+4];
		 if(d != 0)PR[b+3] = 0;
      }
     svobfrag = c;
     ZP[0] = 0;
	 }

	 void zacrep(UINT a,UINT b) // a-nomer massiva zoni programm,b -
										//smeshenie v etom massive fragmenta,
										//podlegashego zakrepleniju - zaneseniju 1
										// neposredstvenno pered fragmentom.Zakrep-
										// ljajutsja takge vse nadfragmenti.
	 {UINT *c,e,f;
	  c = P[a];
     if (a == svobprog)c[b-1] = 1;
	  while ((e = c[b+3],b = e & T11,f = e >> 19) != 0)
		{f--;c = P[f];
       if(f == svobprog)c[b-1] = 1;
      }
	 }

	 UINT perenos(UINT a) // a - smeshenie v svobprog nachala zapolnjaemogo
								 // fragmenta.Perehodit k ocherednomu segmentu
								 // zoni programm;raschishaet ego,i perenosit na
								 // novoe mesto dannoe nachalo fragmenta.Vozvra-
								 // shaet smeshenie ego novogo nachala.
	 {UINT b,*c,*d,e;
	  b = svobfrag;c = P[svobprog];raschistca();
     d = P[svobprog];e = svobfrag;
	  while(a != b)
        {d[svobfrag] = c[a];c[a]= 0;
         a++;svobfrag++;
        }
	  return e;
	 }


			 // PROGRAMMI VSPOMOGATELNIH FUNKCIJ

   void uchhol(UINT a) // UCHET HOLOSTOGO HODA PRIEMOV;
                       // a - prirashenie shagov.
   {UINT b,c,d,e,f,g,*h,q;
    a >>= 10; b = S[lcadr+9]; // b - log.simvol priema
	c = S[9] + 8; q = Z[c];
    q += (Z[q]-4); // q - smeshenie adresa spiska kommentariev
                   // k posilkam ishodnoj zadachi.
    c = Z[q]+2;
    while(!(Z[c]& T1))
     {d = Z[c];
      if(!(d & 0xFFC00000) && Z[d+2] == 0x00200010)
      {d = Z[d+4]+2; // d - smeshenie nachala spiska
                     // par (log.simv. - *)
       if(!(d & 0x00200000))
       while(!(Z[d]&T1))
        {e = Z[d];
         if(Z[e+2] == b)
         {e = Z[e+4]+2; // e - smeshenie nachala spiska
                        // par (zagolovok priema - *)
          while(!(Z[e]&T1))
           {f = Z[e];
            if(sravn(Z[f+2],S[lcadr+11]))
            {f = Z[f+4]+2; // f - smeshenie nachala spiska
                           // troek (nomer uzla - * - *)
             while(!(Z[f]&T1))
              {g = Z[f];
               if(sravn(Z[g+2],S[lcadr+10]))
                {Z[g+4] += a; return;}
               f += 2;
              }
			  if(kontrhol == 2)
			   {return;}
			  else
			   {h = st; *st = S[lcadr+10]; st++;
                *st = 0x00200104 + a; st++;
                *st = 0x00200104; st++; f = Z[e];
                Z[f+4] = sffx(Z[f+4],text1(h));
                return;
			   }
            }
            e += 2;
           }
		  if(kontrhol == 2)
		   {return;}
		  else
		   {h = st; *st = S[lcadr+10]; st++;
            *st = 0x00200104 + a; st++;
            *st = 0x00200104; st++; a = text1(h);
            *st = a; st++; a = text1(h);
            *st = S[lcadr+11]; st++; *st = a; st++;
            f = Z[d]; Z[f+4] = sffx(Z[f+4],text1(h));
            return;
		   }
         }
         d += 2;
        }
	   if(kontrhol == 2)
	    {return;}
	   else
	    {h = st; *st = S[lcadr+10]; st++;
         *st = 0x00200104 + a; st++;
         *st = 0x00200104; st++; a = text1(h);
         *st = a; st++; a = text1(h);
         *st = S[lcadr+11]; st++; *st = a; st++;
         a = text1(h); *st = a; st++; a = text1(h);
         *st = b; st++; *st = a; st++;
         f = Z[c]; Z[f+4] = sffx(Z[f+4],text1(h));
        return;
	   }
      }
      c += 2;
     }
	if(kontrhol == 2)
 	 {return;}
	else
	 {h = st; *st = S[lcadr+10]; st++;
      *st = 0x00200104 + a; st++;
      *st = 0x00200104; st++; a = text1(h);
      *st = a; st++; a = text1(h);
      *st = S[lcadr+11]; st++; *st = a; st++;
      a = text1(h); *st = a; st++; a = text1(h);
      *st = b; st++; *st = a; st++; a = text1(h);
      *st = a; st++; a = text1(h);
      *st = 0x00200010; st++; *st = a; st++;
      Z[q] = sffx(Z[q],text1(h));
      return;
	}
   }


	void otkat()  // OTKAT PO POSLEDNEMU KADRU

	{UINT a,b,c,d,e,*f,p;
	 UINT64 i;
    if(st - T > 14000)
    {ind = 4;tipprer = 8;initprer(1);return;}
      a = S[lcadr + 2];
     if((kontrhol == 1 || kontrhol == 2) && a == 4 && S[lcadr+8] == 3 &&
        S[lcadr] > lcadr+8)
      {i = step - *((UINT64*)(S+lcadr+12));
       if(1000 < i && i < 0x5FFFFFFF)uchhol((UINT)i);
       lcadr = S[lcadr+1];
       a = S[lcadr + 2];
      }
	  if(a == 4)
      {for(d = lcadr;d != cadr;d = S[d+3])
			{e = S[d+3];b = e + S[d+6];
          c = e + S[e+8];S[e+8] = S[d+6];
          if(c > S[e])
          {ind = 4;tipprer = 3;initprer(1);return;}
			 while(b < c){S[b] = 0;b ++;}
          if(S[lcadr + 7] == 0 && S[lcadr + 8] != 4
             && (PR[prer] == 2 || PR[prer] == 17)
             && PR[prer + 1] == e)
          {b = S[9]; b = Z[b+8]; b += (Z[b] - 4);
           b = Z[b] + 2;
	        for(c = Z[b];!(c & T1);b += 2,c = Z[b])
	         {if(!(c & T6))
             {if(Z[c+2] == 0x0020038D)
               {e = Z[c+4];
                if(!(e & T6))
                 {p = e + Z[e] - 4;
                  p = Z[p];
                  p = Z[p + 2];
                  if((p & 0x0000FFFF) >= (S[d+6] - 8))
                   {f = st; e += 2;
                    for(p = Z[e];
                     (!(p & T1) &&
                        (Z[p+2] & 0x0000FFFF)< (S[d+6]-8));
                         e += 2, p = Z[e])
                      {*st = p; st++;
                      }
                    Z[c+4] = text1(f);
                   }
                 }
                break;
               }
             }
            }
          }

        	}
		  b = S[lcadr + 4];cadr = S[lcadr + 3];
          nomprog = b & T4;
		  A = P[nomprog];fragm = b >> 16;b = S[lcadr + 5];
		  tec = A + (b & T4); suff = A + fragm;
		  suff += A[fragm];
		  level = b >> 16; ist = 1;return;
		}
	 else {if(a == 1){tec = 0;ind = 0;ist = 1;return;}
			 else
           {if(a == 2)
            {for(d = lcadr;d != cadr;d = S[d+3])
             {e = S[d+3]; b = e + S[d+6];
              c = e + S[e+8]; S[e+8] = S[d+6];
              if(c > S[e])
              {ind = 4;tipprer = 3;initprer(1);return;}
              while(b < c){S[b] = 0;b++;}
              if((PR[prer] == 2 || PR[prer] == 17)
                 && PR[prer + 1] == e)
              {b = S[9]; b = Z[b+8]; b += (Z[b] - 4);
               b = Z[b] + 2;
	            for(c = Z[b];!(c & T1);b += 2,c = Z[b])
	             {if(!(c & T6))
                 {if(Z[c+2] == 0x0020038D)
                  {e = Z[c+4];
                   if(!(e & T6))
                    {p = e + Z[e] - 4;
                     p = Z[p];
                     p = Z[p + 2];
                     if((p & 0x0000FFFF) >= (S[d+6] - 8))
                      {f = st; e += 2;
                       for(p = Z[e];
                       (!(p & T1) &&
                        (Z[p+2] & 0x0000FFFF)< (S[d+6]-8));
                         e += 2, p = Z[e])
                         {*st = p;
                          st++;
                         }
                       Z[c+4] = text1(f);
                      }
                    }
                   break;
                  }
                 }
                }
              }
             }
            }
            cadr = lcadr;
            if(PR[prer] == 17 && PR[prer+1] == cadr &&
               blokprer == 0)
              {tipprer = 9;tec = 0;ist = 2;
               initprer(2);return;}
			if(PR[prer] == 17 && PR[prer+2] == cadr)
			 {PR[prer+2] = 0;}
            contin();
            if(a == 2)ist = 0;
				else
             {if(blokprer == 0)
              {*st = L0;ist = 1;st++;}
             }
			  }
			}
	}
	void raschist() // RASCHISTKA PO POSLEDNEMU KADRU PRODOLGENIJA I
						 // UDALENIJE ETOGO KADRA
	{UINT a,b;
	  a = S[lcadr + 6] + cadr;b = S[cadr + 8] + cadr;
	  S[cadr + 8] = S[lcadr + 6];
	  while (a < b) { S[a] = 0;a ++;} lcadr = S[lcadr + 1];
	}

	void perehod(UINT a) // PEREHOD PO SSILKE IZ TEK.FRAGMENTA C NOMEROM a
								// a - LOG.SIMVOL
	{UINT *b,c,d;
	  b = suff + (a - 0x00200105);c = *b;
	  if(c & T1)
      {vremsuff = b;
	   c = fragment(c);
       if(c == 0)
	    {ind = 4;tipprer = 5;return;}
       *vremsuff = c;
      }
     d = ((nomprog + 1)<< 19) | fragm; nomprog = (c >> 19) - 1;
	  A = P[nomprog];fragm = c & T11;tec = A + fragm + 4;
	  A[fragm + 3] = d;suff = A + fragm + A[fragm];ist = 1;
     if(PR[prer] == 4 &&
        PR[prer+3] == A[fragm+2] && blokprer == 0)
     {tipprer = 9;tec++;initprer(1);}
     if(PR[prer] == 13 &&
        PR[prer+3] == A[fragm+2] && PR[prer+1] == cadr &&
        blokprer == 0)
     {tipprer = 9;tec++;initprer(1);}

	}

	void zac(UINT a) // a - SMESHENIE V ZONE ZADACH JACHEJKI
                    // NEKOTOROGO TEKSTA. ZAKREPLJAETSJA
                    // VETVb ETOGO TEKSTA.
	{UINT c,d,e;
     while(!(Z[a+1] & T1))a -= 2;
	  if(Z[a+1] == tact)return;
	  Z[a+1] = tact;
     if((Z[a+2] & 0x40000000)|| Z[a+3] != 0)return;
	  c = 1;F[1] = a + 2;
	  do{d = F[c];
        while(e = Z[d],Z[d] != T1)
         {d += 2;
          if(!(e & T6) && e != 0)
           {while(!(Z[e+1] & T1)) e -= 2;
            if(Z[e+1] != tact)
             {Z[e+1] = tact;
			     if(Z[e+3] == 0)
               {F[c] = d;
                c++;F[c] = e + 2;c++;
                break;
               }
             }
           }
         }
        c--;
		 }
	  while (c != 0);
	}

	void retact() // IZMENJAETSJA UKAZATELb tact I
                  //PEREZAKREPLJAJUTSJA
					  // VSE ISPOLZUEMIE OB'EKTI ZONI ZADACH
	{UINT a,b,c,d,e,f,g;
	  FR1 = 0;FR2 = 0;
	  tact ^= 1;
	  for(a = 0;a <= lcadr;a = S[a])
		{b = S[a];
       if(S[a+2] != 4 || S[a+8] != 1)
       {for(c = a + 9;c < b;c++)
		   {d = S[c] & 0xBFFFFFFF; // uchet ssilok na "neopred"
		    if(d != 0 && !(d & T6))
           {zac(d);}
		   }
       }
       if(S[a+2] != 4)
        {c = SD[a+2];
         if(c != 0 && !(c & T6))
          {zac(c);
          }
        }
		}
	  a = st - T;
	  for(b = 0;b < a;b++)
		{c = T[b];if(c != 0 && !(c & T6))zac(c);}
     for(b = 0;b < stp;b += 10)
      {c = SP[b+1];if(c != 0 && !(c & T6))zac(c);}
     for(b = 0; b < lbufper; b++)
      {c = bufperem[b];
       if(!(c & T6))zac(c);
      }
     for(b = 0; b < fiksr; b++)
      {c = fiksir[b];
       zac(c);
      }
     if(SE[0] != 0)
      {b = SE[0];
       for(c = 9; c < b; c += 16)
        {d = c; e = d + 16;
         while(SE[d] != 0 && d < e)
          {f = SE[d]; zac(f);
           d++;
          }
        }
      }
     for(b = 0;b <= prer;b += 7)
      {if(PR[b] == 16)
        {c = PR[b+3];
         if(!(c & T6))zac(c);
         c = PR[b+5];
         if(!(c & T6))zac(c);
        }
       if(PR[b] == 18)
        {c = PR[b+3];zac(c);
        }
      }
     for(b = 0;b <= prer;b += 7)
      {if(PR[b] == 15 && Z[PR[b+2] + 1] != tact)
        {PR[b] = 0;PR[b+2] = 0;}
      }
	 d = ZP[0];
	 for(b = 1; b <= ZP[0]; b++)
	  {c = ZP[b];
	   g = Z[c+1];
	   if(g != tact)
       ZP[b] = 0;
	  }
	 b = 1; c = 0;
	 while(b <= ZP[0])
      {if(ZP[b] != 0)
        {ZP[c+1] = ZP[b]; c++;}
       b ++;
      }
     ZP[0] = c;
	 svob = 2;
	}

	UINT mesto(UINT a) // POISK V ZONE ZADACH MESTA DLJA TEKSTA DLINI a
							 // (V a VKLJUCHAJUTSJA SUFFIKS I PREFIKS).ESLI
							 // MESTO NAJDENO,TO VOZVRASHAET SSILKU NA NEGO;
							 // FORMIRUJUTSJA SUFFIKS I PREFIKS.ESLI MESTO NE
							 // NAJDENO,VOZVRASHAET 0 (SMENA TAKTA I UPLOTNENIE
							 // NE VIPOLNJAJUTSJA)
	{UINT b;
     if(svob >= 2097102)return 0;
	  do{if(Z[svob + 1] == tact)svob += Z[svob];
		  else
			{do{udalmassiv(svob);
             if(a <= Z[svob])
				  {b = Z[svob] - a;
					if(b != 0)
				    {Z[svob + a] = b;
                Z[svob + a + 1] = Z[svob + 1];}
					b = svob;svob += a;Z[b] = a;Z[b+1] = tact;
					Z[svob - 2] = T1;Z[svob - 1] = 0;return b;
			     }
				 else
              {b = svob + Z[svob];
				  	if(b >= 2097104) {Z[svob + 1] = tact;return 0;}
				  	if(Z[b+1] == tact){Z[svob + 1] = tact;svob = b;}
				  	else Z[svob] += Z[b];
				  }
				}
			 while(Z[svob+1] != tact);
			}
		 }
	  while(svob < 2097104);return 0;
	}

	UINT mem(UINT a) // POISK MESTA V ZONE ZADACH DLJA TEKSTA DLINI a
						  // (VKLJUCHAJA PREFIKS I SUFFIKS).VOZVRASHAET SSILKU
						  // NA TEKST,S VVEDENNIMI PREFIKSOM I SUFFIKSOM.
						  // ISPOLZUJUTSJA,ESLI NUGNO,SMENA TAKTA I UPLOTNENIE
						  // ZONI ZADACH.PRI NEUDACHE VOZVRASHAET 0 I
						  // USTANAVLIVAET ind NA 4.
	{UINT b;
     if(a > 150000)
     {ind = 4;tipprer = 6;return 0;}
	  b = mesto(a);
     if(b != 0)return b;retact();
	  b = mesto(a);
     if(b != 0)return b;retact();uplotn();
	  b = mesto(a);
     if(b != 0)return b;ind = 4;tipprer = 1;return 0;
	}

	void uplotn() // UPLOTNENIE ZONI ZADACH

	{UINT a,b,c,d,e,f;
	  a = 2;
	  for(b = 2;b < 2097104;b += Z[b]) //rasstanovka novih adresov
		if(Z[b+1] == tact)
      {c = Z[b];
       Z[b + c - 1] = a;
       a += Z[b];
      }
	  for(b = 0;b <= lcadr;b = S[b]) // korrekcia ssilok iz osn.steka
		 {c = (S[b+2] == 4 ?
         (S[b+8] == 0 || S[b+8] == 4 ? S[b]:
            (S[b+8] == 3 ? S[b] - 1 : b)
         )
         : b + S[b+8]);
		  for(d = b + 9;d < c;d++)
			{e = S[d];f = e & 0x40000000;e &= 0xBFFFFFFF;
			 if(e != 0 && !(e & T6))S[d] = (correctadr(e) | f);
			}
        if(S[b+2] != 4)
         {d = SD[b+2];
          if(d != 0 && !(d & T6))
           {SD[b+2] = correctadr(d);}
         }
		 }
	  a = st - T;
	  for(b = 0;b < a;b++)  // korrekcia ssilok iz steka viragenij
		{c = T[b];
		 if(c != 0 && !(c & T6)) T[b] = correctadr(c);
		}
	 if(SE[0] != 0)
	  {b = SE[0];
	   for(c = 9;c < b;c += 16)
	    {d = c; e = d + 16;
	     while(SE[d] != 0 && d < e)
		  {f = SE[d]; f = correctadr(f);
		   SE[d] = f; d ++;
		  }
	    }
	  }
     for(b = 0;b < lbufper;b++)
      {c = bufperem[b];
       if(c != 0 && !(c & T6))
         bufperem[b] = correctadr(c);
      }
     for(b = 0;b <= prer;b += 7)
      {if(PR[prer] == 15)
        {c = PR[prer+2];
          if(c != 0)PR[prer+2] = correctadr(c);
        }
       if(PR[prer] == 16)
        {c = PR[prer+3];
          if(!(c & T6))PR[prer+3] = correctadr(c);
         c = PR[prer+5];
          if(!(c & T6))PR[prer+5] = correctadr(c);
        }
       if(PR[prer] == 18)
        {c = PR[prer+3];
         PR[prer+3] = correctadr(c);
        }
      }
	 for(a = 1; a <= ZP[0]; a++)
	  {b = ZP[a];
	   b = correctadr(b);
	   ZP[a] = b;
	  }
     for(a = 2;a < 2097104;a += Z[a]) // korrekcia ssilok iz zoni zadach
		if(Z[a+1] == tact)
		  {b = a + Z[a] - 2;
			for(c = a + 2;c < b;c += 2)
			 {d = Z[c];
			  if(d != 0 && !(d & T6))Z[c] = correctadr(d);
			 }
		  }
	  a = 2;b = 2;                        // perezapisb
     while(b < 2097104)
     {c = b + Z[b];
	   if(Z[b+1] == tact)
		 {while(b < c)
		   {Z[a] = Z[b];a++;b++;}
		  Z[a-1] = 0;
		 }
      else b = c;
     }
	  Z[a] = 2097104 - a;Z[a+1] = tact ^ 1;svob = a;
	}

	UINT correctadr(UINT a)  // korrekcia adresa a pri uplotnenii zoni zadach
									 // vozvrashaet novij adres
	{UINT b,c;
	 if(Z[a+1] & T1)
    {b = Z[a];return Z[a + b - 1];}
	 b = a;
	 do a -= 2;
	 while(!(Z[a+1] & T1));
    c = Z[a];
	 return(b - (a - Z[a + c - 1]));
	}

	void opr(UINT a, UINT b)  // PEREMENNOJ S NOMEROM a PRISVAIVAETSJA V
									  // TEK.KADRE ZNACHENIE b.
	{UINT c,d,e,f,g;
    if(!(a & T1)){ind = 4;tipprer = 7;return;}
	  a = (a & T4) + 8;c = cadr + a;
	  if(c < S[cadr])
		 {S[c] = b;
		  if(S[cadr + 8] <= a)S[cadr + 8] = a + 1;
		  return;
		 }
	  d = S[cadr];e = c - d + 10;  // sdvig stekovih kadrov;e - velichina
											 // sdviga
	  for(f = S[lcadr] - 1,g = f + e;f >= d;f--,g--)
		 {S[g] = S[f]; SD[g] = SD[f];}
	  do{S[g] = 0;g--;}
	  while(g >= d);
	  if(lcadr > cadr)lcadr += e;
	  for(d = 0;d <= prer;d += 7)
	   {if(PR[d+1] > cadr && PR[d+1] != 0xFFFFFFFF)
          PR[d+1] += e;
      }
		S[cadr] += e;d = S[cadr];f = d;
	  while(d <= lcadr)
		 {S[d] += e;
		  if(d != f)S[d+1] += e;
		  g = S[d+3];
		  if(g > cadr)S[d+3] = (g + e);
		  d = S[d];
		 }
	  S[c] = b;
	  if(S[cadr + 8] <= a)S[cadr + 8] = a+1;
	}

	UINT ravntext(UINT a,UINT b) // SRAVNENIE TEKSTOV a,b; VOZVRASHAET 1,
										  // ESLI RAVNI,I 0,ESLI NE RAVNI.
	{UINT c,d,e,f,g;
	 if(Z[a] != Z[b]) return 0;
	 if(Z[a+3] != 0)
	  {e = a + Z[a] - 2;
		for(c = a + 2,d = b + 2; c < e;c++,d++)
		 if(Z[c] != Z[d])return 0;
		return 1;
	  }
	 c = 2;F[2] = a+ 2;F[3] = b + 2;
	 do
     {d = F[c];e = F[c+1];
	 	while(f = Z[d],g = Z[e],!(f & T1) && (f == g) &&
					(Z[d+1] == Z[e+1]))
		 {d += 2;e += 2;}
		if(f & T1)c -= 2;
		else
		 {if(f & T6 || g & T6 || Z[d+1] != Z[e+1] || !(Z[f+1] & T1) ||
			  	!(Z[g+1] & T1) ||Z[f] != Z[g])return 0;
        F[c] = d+2;F[c+1] = e+2;
		  c += 2;F[c] = f + 2;F[c+1] = g + 2;
       }
	  }
	 while(c != 0);
	 return 1;
	}

	UINT sravn(UINT a,UINT b) // SRAVNENIE OB'EKTOV a,b.VOZVRASHAET 1,
									  // ESLI RAVNI;0 - ESLI NE RAVNI.
	{if(a == b)return 1;
	 if(a & T6 || b & T6 || !(Z[a+1] & T1) || !(Z[b+1] & T1))return 0;
	 return(ravntext(a,b));
	}

	UINT slog(UINT a,UINT b,UINT c) // a,b - des.chisla;c-ukazatel znaka
										 // (0 - plus,1 - minus).Vozvrashaet summu
										 // modulei chisel a,b,vziatuju so znakom c.
										 //Vozmogna ustanovka ind na 4.
	{UINT *d,e,f,g,h,p,q,r,*s;
	 e = lenman(a);f = lenman(b);
	 if(e != f)
		 {if(e < f) {a = dopnuli(a,f - e);if(a == 0)return 0;}
		  else {b = dopnuli(b,e - f);if(b == 0)return 0;}
		 }
	 d = st;
	 if((a & T6) && (b & T6)) //a,b - cifri
	  {e = a + b - 0x00400208;
		if(e > 9)
		 {*st = (e - 10) + L0;*(st+1) = L7;st += 2;}
		else {*st = e + L0;st++;}
	  }
	 else
	  {if(a & T6){f = a;a = b;b = f;}
		f = a + Z[a] - 4;g = a + 2;    // f - smeshenie poslednej cifri;
		if(Z[g] == L8)g += 2;          // g - pervoj
		if(b & T6)   // odno slagaemoe - cifra,drugoe - tekst
		 {h = Z[f] + b - 0x00400208;
		  if(h > 9){*st = (h - 10) + L0;p = 1;}
		  else {*st = h + L0;p = 0;}
		  st++;
		  while(f != g)
			{f -= 2;
			 if(p == 0)*st = Z[f];
			 else {h = Z[f] + 1;
					 if(h == 0x0020010E){*st = L0;p = 1;}
					 else {*st = h;p = 0;}
					}
			 st ++;
			}
		  if(p == 1){*st = L7;st++;}
		 }
		else          // oba slagaemih - teksti
		 {h = b + Z[b] - 4;p = b + 2;
		  if(Z[p] == L8)p += 2;
		  if(f - g < h - p)
			{q = f;f = h;h = q;q = g;g = p;p = q;}
		  r = 0;
		  while(h >= p)
			{if(Z[h] == L15)*st = L15;
			 else
			  {q = Z[h] + Z[f] + r - 0x00400208;
				if(q > 9)
				 {r = 1;*st = (q - 10) + L0;}
				else {r = 0;*st = q + L0;}
			  }
			 st++;h -= 2;f -= 2;
			}
		  while(f >= g)
		  {if(r == 0)*st = Z[f];
			else
			 {h = Z[f] + 1;
			  if(h == 0x0020010E){*st = L0;r = 1;}
			  else {*st = h;r = 0;}
			 }
			st++;f -= 2;
		  }
		  if(r == 1) {*st = L7;st++;}
		 }
	  }
	 s = norman(d);
	 if(c == 1 && (st != s+1 || *s != L0)){*st = L8;st++;}
	 if(st == s+1) {st = d;return(*s);}
	 else {h = text2(s);st = d;return h;}
	}

	UINT text1(UINT *a)  // vvoditsja tekst nabora (bez skobok)
								// po sodergimomu steka viragenij, nachinaja
								// s ukazatelja a i po (st-1).st ustanavlivaetsja
								// na a.Pri udache vozvrashaet ssilku na tekst,
								// inache 0.Vozmogna vidacha log.simvola
								// PUSTOESLOVO.

	{UINT b,c,*d,e;
	  if(st == a)return L3;
     e = 2*(st-a)+4;
	  b = mem(e);
	  if(b != 0)
		 {c = b + 2;
		  for(d = a;d != st;d++)
			{Z[c] = *d;Z[c+1] = 0;c += 2;}
        if(e == 6 && Z[b+2] & T6)Z[b+3] = 0x00030002;

		 }
	  st = a;return b;
	}

	UINT text2(UINT *a)  // analog text1,no schitivanie  iz steka viragenij
								// v obratnom porjadke.
	{UINT b,c,*d,e;
	  if(st == a)return L3;
     e = 2*(st - a) + 4;
	  b = mem(e);
	  if(b != 0)
		 {c = b + 2;
		  for(d = st;d != a;d--)
			{Z[c] = *(d-1);Z[c+1] = 0;c += 2;}
        if(e == 6 && Z[b+2] & T6)Z[b+3] = 0x00030002;
		 }
	  st = a;return b;
	}
 double* getmasd(UINT a) // videljaet pamjat dlja massiva doubl'ov dlini a
                            // registriruet v svobodnom meste massiva MSV paru
							// (adres nachala massiva - handle massiva). Vozvrashaet
							// ssilku na massiv.
	{double* b;
	 UINT c,d,f,i;
	 UINT64 e;
	 a *= 8;
     b = (double*)calloc(a,1);
     e = reinterpret_cast<UINT64>(b);
     c = (UINT)(e & 0x00000000FFFFFFFF);
     e >>= 32;
     f = (UINT)e;
     d = 0;
	 for(i = 0; i <2000; i += 2)
	  {if(MSV[i] == 0)
	    {MSV[i] = c;
	     MSV[i+1] = f;
	     d = 1;
	     break;
	    }
	  }
	 if(d == 0)
       {tipprer = 9;tec++;initprer(1);}
	 return b;
	}

	int* getmasi(UINT a) // videljaet pamjat dlja massiva int'ov dlini a
                            // registriruet v svobodnom meste massiva MSV paru
							// (adres nachala massiva - handle massiva). Vozvrashaet
							// ssilku na massiv.
	{int* b;
	 UINT c,d,f,i;
	 UINT64 e;
	 a *= 4;
     b = (int*)calloc(a,1);
     e = reinterpret_cast<UINT64>(b);
     c = (UINT)(e & 0x00000000FFFFFFFF);
     e >>= 32;
     f = (UINT)e;
     d = 0;
	 for(i = 0; i <2000; i += 2)
	  {if(MSV[i] == 0)
	    {MSV[i] = c;
	     MSV[i+1] = f;
	     d = 1;
	     break;
	    }
	  }
	 if(d == 0)
       {tipprer = 9;tec++;initprer(1);}
	 return b;
	}

  UINT regmasd(double* a)

  {UINT c,d,e,f,i;
   UINT64 e1;
   e1 = reinterpret_cast<UINT64>(a);
   c = (UINT)(e1 & 0x00000000FFFFFFFF);
   e1 >>= 32;
   f = (UINT)e1;
   for(i = 0; i < 2000; i+= 2)
    {if(MSV[i] == c && MSV[i+1] == f)
      {MSV[i] = 0;
	   MSV[i+1] = 0;
	   break;
      }
    }
   e = mem(8);
   Z[e+2] = 0x50200001;
   Z[e+3] = c;
   Z[e+4] = 0x50200001;
   Z[e+5] = f;
   return e;
  }

 UINT regmasi(int* a)

  {UINT c,d,e,f,i;
   UINT64 e1;
   e1 = reinterpret_cast<UINT64>(a);
   c = (UINT)(e1 & 0x00000000FFFFFFFF);
   e1 >>= 32;
   f = (UINT)e1;
   for(i = 0; i < 2000; i+= 2)
    {if(MSV[i] == c && MSV[i+1] == f)
      {MSV[i] = 0;
	   MSV[i+1] = 0;
	   break;
      }
    }
   e = mem(8);
   Z[e+2] = 0x70200001;
   Z[e+3] = c;
   Z[e+4] = 0x70200001;
   Z[e+5] = f;
   return e;
  }

	UINT razn(UINT a,UINT b,UINT c) //a,b - des.chisla;modul a ne menshe
											  // modulja b;c - ukazatel znaka (0 -
											  // plus;1 - minus).Vozvrashaet raznost
											  // modulej a i b,vzjatuju so znakom c.
											  // vozmogna ustanovka ind na 4
	{UINT *d,e,f,g,h,p,q,r,*s;
	 e = lenman(a);f = lenman(b);
	 if(e != f)
	  {if(e < f)
		  {a = dopnuli(a,f-e);if(a == 0)return 0;}
		else {b = dopnuli(b,e-f);if(b == 0)return 0;}
	  }
	 d = st;
	 if((a & T6) && (b & T6)){*st = (a - b) + L0;st++;} // a,b - cifri
	 else
	  {if(a & T6)                     // a-cifra,b-tekst,nachinajushijsja s
		 {*st = (a - Z[b+4]) + L0;st++;}   // minusa
		else
		 {f = a + Z[a] - 4;g = a + 2;
		  if(Z[g] == L8)g += 2; //f - smesh.posledn.cifri,g - pervoj
		  if(b & T6)      // b - cifra,a - tekst
			{h = Z[f];
			 if(h < b){*st = ((h + 10)-b)+L0;p = 1;}
			 else {*st = (h - b) + L0;p = 0;}
			 st++;
			 while(f != g)
			  {f -= 2;
				if(p == 0)*st = Z[f];
				else
				 {h = Z[f]-1;
				  if(h == 0x00200103){*st = 0x0020010D;p = 1;}
				  else {*st = h;p = 0;}
				 }
				st++;
			  }
			}
		  else          // oba chisla - teksti
			{h = b + Z[b] - 4;p = b + 2;
			 if(Z[p] == L8)p += 2;
			 r = 0;
			 while (h >= p)
			  {if(Z[f] == L15)*st = L15;
				else
				 {e = Z[f];q = Z[h] + r;
				  if(e < q)
					{r = 1;*st = ((e + 10) - q) + L0;}
				  else {r = 0;*st = (e - q) + L0;}
				 }
				st++;h -= 2;f -= 2;
			  }
			 while(f >= g)
			  {if(r == 0)*st = Z[f];
				else
				 {h = Z[f] - 1;
				  if(h == 0x00200103)
					{*st = 0x0020010D;r = 1;}
				  else {*st = h;r = 0;}
				 }
				st++;f -= 2;
			  }
			}
		 }
	  }
	 s = norman(d);
	 if(c == 1 && (st != s+1 || *s != L0))
	  {*st = L8;st++;}
	 if(st == s+1) {st = d;return(*s);}
	 else {h = text2(s);st = d;return h;}
	}

	UINT sravnmod(UINT a,UINT b) //a,b - des.chisla.Esli modul a ne menshe
										  // modulja b,vozvrashaet 0,inache 1.
	{UINT c,d;
	 c = lenman(a);d = lenman(b);
	 if(c != d)
	  {if(c < d)
		 {a = dopnuli(a,d-c);if(a == 0)return 2;}
		else {b = dopnuli(b,c-d);if(b == 0)return 2;}
	  }
	 if(a & T6)  // a -cifra
	  {if(b & T6)   // b- cifra
		 return (a >= b ? 0 : 1);
		else return ((Z[b] != 8 || Z[b+2] != L8 ||a < Z[b+4])? 1 : 0);
	  }
	 else       // a - tekst
	  {if(b & T6)
		  return((Z[a] != 8 || Z[a+2] != L8 || Z[a+4] >= b)? 0 : 1);
		else           // a,b - teksti
		 {c = Z[a];d = Z[b];
		  a += 2;
		  if(Z[a] == L8){a += 2;c -= 2;}
		  b += 2;
		  if(Z[b] == L8){b += 2;d -= 2;}
		  if (c < d) return 1;
		  if (d < c) return 0;
		  while(!(Z[a] & T1))
			{if(Z[b] < Z[a])return 0;
			 if(Z[b] > Z[a])return 1;
			 a += 2;b += 2;
			}
		  return 0;
		 }
	  }
	}

	UINT summa(UINT a,UINT b) // a,b - des.chisla.Vozvrashaet ih summu.
									  //Vozmogna ustanovka ind na 4.
	{UINT c,d,e;
	  c = ((!(a & T6) && (Z[a+2] == L8)) ? 1 : 0);
	  d = ((!(b & T6) && (Z[b+2] == L8)) ? 1 : 0);
	  if(c == d)return slog(a,b,c);
	  else
		{e = sravnmod(a,b);if(e == 2)return 0;
		 if(e == 0)return razn(a,b,c);
		 else return razn(b,a,d);
		}
	}

	UINT nomer(UINT a)   // a - log.simvol.Vozvrashaet des.chislo - nomer
								// etogo simvola.vozmogna ustanovka ind na 4
	{UINT *b;
	  b = st;a &= T11;
	  if(a == 0)return L0;
	  while(a != 0)
		 {*st = (a % 10) + L0;a /= 10;st++;}
	  if(st == b+1)
		 {st = b;return(*st);}
	  else return(text2(b));
	}

	UINT lenman(UINT a)  // a- des.chislo.vozvrashaet dlinu ego mantissi

	{UINT b,c,d;
	  if(a & T6) return 0;
	  d = 0;
	  for(b = a + 2;!(Z[b] & T1);b += 2)
		{if(Z[b] == L15)
		  {for(c = b + 2;!(Z[c] & T1);c += 2)d++;
			return d;
		  }
		}
	  return 0;
	}

	UINT dopnuli(UINT a,UINT b) // a- des.chislo.K koncu mantissi a
										 // dopisivaetsja b nulej;vozvrashaet
										 // ssilku na rezultat.Moget ustanovitb
										 // ind na 4.
	{UINT *c,d,e;
	  c = st;d = 0;
	  if(a & T6){*c = a;st++;}
	  else
		{for(e = a + 2;!(Z[e] & T1);e += 2)
		  {*st = Z[e];
			if(*st == L15)d = 1;
			st++;
		  }
		}
	  if(d == 0){*st = L15;st++;}
	  while(b != 0)
		 {*st = L0;st++;b--;}
	  return(text1(c));
	}

	UINT* norman(UINT *a)  //a - ukazatel pozicii steka viragenij,
								  // nachinaja s kotoroj raspologeno des.chislo
								  //(do st;nachinaja s mladshih razrjadov).
								  // Osushestvl.normalizaciju;vozvrashaet
								  // ukazatel na novuju poziciju - nachalo
								  // zapisi chisla
	{UINT *b,*c;
	  b = 0;
	  for(c = a;(c != st);c++)
		{if(*c == L15)b = c;}
	  if(b != 0)
		{while(a != (b+1) && (*a == L0 || *a == L15))a++;
		}
	  while(*(st-1) == L0 && st != a+1 && *(st-2) != L15)st--;
	  return a;
	}

 double chisld(UINT a) // perevod v double LOS-chisla 's plav.zapjatoj
  {double b;
   UINT* c;
   c = (UINT*)&b;
   *c = Z[a+3]; *(c+1) = Z[a+5];
   return b;
  }

int chisli(UINT a) // perevod v int LOS-chisla "celoe"
{int b;
 b = (int)Z[a+3];
 return b;
}

int chislnol(UINT a) // esli a - nol v odnom iz
                     // vichislitelnih formatov LOSa,
                     // vozvrashaet 0. Inache - 1.
 {UINT *d,i;
  double p;
  if(Z[a+2] == 0x40200001)
   {d = (UINT*)&p;
    *d = Z[a+3]; *(d+1) = Z[a+5];
    if(p == 0)return 0;
    else return 1;
   }
  else
   {if(Z[a+2] == 0x60200001)
     {if(Z[a+3] == 0)
       return 0;
      else return 1;

     }
    else
     {i = a+3;
      while(!(Z[i-1] & 0x80000000))
       {if(Z[i] != 0)
         {return 1;
         }
        i += 2;
       }
      return 0;
     }
   }
 }



   void udalmassiv(UINT a) // a - smeshenie v zone zadach
                           // nachala teksta. Esli etot
                           // tekst hranit ssilku na massiv
                           // chisel mashinnogo formata, to
                           // proishodit udalenie etogo
                           // massiva
   {UINT *b;
    UINT64 h;
    if(Z[a+2] & 0x10000000)
     {h = Z[a+5];
      h <<= 32;
      h |= Z[a+3];
      b = reinterpret_cast<UINT*>(h);
      Z[a+2] = 0x40200001;
      free(b);
     }
    return;
   }


	void udlin(UINT a) // a-smeshenie kadra vipiski libo perechislenija
							 // s nepustim nakopitelem.Proishodit udlinenie
							 // etogo nakopitelja na 10.
	{UINT b,c,d;
	  b = S[a+9];c = mem(Z[b]+20);
	  if(c == 0)return;
	  d = c + 2;b += 2;
	  while(!(Z[b] & T1))
     {Z[d] = Z[b];Z[d+1] = 0;d += 2;b += 2;}
     for(b = 0;b < 20;b++)Z[d+b] = 0;
	  S[a+9] = c;S[a+10] = d;
	}

	void novcadr(UINT a,UINT b) // vvodit novij kadr operatora libo opera-
										 //tornogo viragenija.Tip kadra a;v ego
										 // 7-ju jachejku pomeshaetsja b.
	{UINT c,d,e,f;
	  c = S[lcadr];if(delta == 1 && c > 14500){ind = 4;tipprer = 2;return;}
	  S[c+1] = lcadr;S[c+2] = a;S[c+3] = cadr;
	  S[c+4] = nomprog |(fragm << 16);
	  S[c+5] = (tec - A)|(level << 16);
	  S[c+6] = b;d = *(st-1)- L0;S[c] = c + d + 20;
	  S[c+8] = d + 9;
	  symbol = *(st - 2);
	  st -= 3;
	  for(e = S[c+8] - 1;d > 0;d--)
      {S[c + e] = *st;st--;e--;}
	  f = S[c] - c;st++;
	  for(e = S[c+8];e < f;e++)S[c + e] = 0;
	  tec = 0;cadr = c;lcadr = c;SD[c]=0;SD[c+1]=0;
      SD[c+2]=0; SD[c+3]=0;
   }

	UINT tekur() // vozvrashaet tek.uroven poslednej zadachi

	{UINT a;
	  a = lcadr;
	  while (S[a+2] != 1)a = S[a+1];
	  return S[a+13];
	}

	void cadrprod(UINT a) //vvoditsja novij kadr prodolgenija dlini a
								 // dlja neposredstvenno realizuemogo pere-
								 // chisljajushego operatora
	{UINT b;
	  b = S[lcadr];
     if(delta == 1 && b > 14500){ind = 4;tipprer = 2;return;}
	  S[b+1] = lcadr;S[b+2] = 4;S[b] = b + a;S[b+3] = cadr;
	  S[b+4] = nomprog |(fragm << 16);
     S[b+5] = (tec - A - 1)|(level << 16);
	  S[b+6] = S[cadr+8];
     S[b+7] = level;S[b+8] = 0;
     lcadr = b;
	}

	UINT prfx(UINT a,UINT b) // vvoditsja tekst,poluchajushijsja
									 // dobavleniem elementa a k nachalu nabora b.
									 // Vozvrashaet ssilku na nego.
	{UINT c,d,e,f;
	 *st = a;*(st+1) = b;st += 2;
	 c = ((b == L3)? 4 : Z[b]) + 2;
    d = mem(c);if(d == 0)return 0;
	 st -= 2; Z[d+2] = *st;Z[d+3] = 0;
	 if(*(st+1) != L3)
		for(e = d+4,f = *(st+1)+2;!(Z[f] & T1);e += 2,f += 2)
		 {Z[e] = Z[f];Z[e+1] = 0;}
    if(c == 6 && Z[d+2] & T6)Z[d+3] = 0x00030002;
	 return d;
	}

	UINT sffx(UINT a,UINT b) // vvoditsja tekst,poluchennij prisoedineniem kf
									 // koncu nabora a elementa b.Vozvrashaet
									 // ssilku na etot tekst
	{UINT c,d,e,f;
	  *st = a;*(st+1) = b;st += 2;
	  c = ((a == L3)? 4 : Z[a]) + 2;d = mem(c);if(d == 0)return 0;
	  st -= 2;e = d + 2;
	  if(*st != L3)
		for(f = *st+2;!(Z[f] & T1);e += 2,f += 2)
		 {Z[e] = Z[f];Z[e+1] = 0;}
	  Z[e] = *(st+1);Z[e+1] = 0;
     if(c == 6 && Z[d + 2] & T6)Z[d+3] = 0x00030002;
     return d;
	}

	UINT isklch(UINT a,UINT b) // vvoditsja tekst,poluchajushijsja iz
										// teksta a isklucheniem ob'ekta po
										// vhogdeniju b.Vozvrashaet ssilku
										// na rezultat.
	{UINT c,d;
	 if(Z[a] == 6)return L3;*st = a;*(st+1) = b;st += 2;
	 c = mem(Z[a] - 2);if(c == 0)return 0;
	 st -= 2;
	 for(d = c + 2,a = *st + 2;!(Z[a] & T1);a += 2)
		if(a != *(st+1)){Z[d] = Z[a];Z[d+1] = 0;d += 2;}
    if(Z[c] == 6 && Z[c+2] & T6)Z[c+3] = 0x00030002;
	 return c;
	}

	UINT cmntr(UINT a,UINT *b) // a - spisok;b - ukazatel na poziciju
									 // v steke viragenij,nachinaja s kotoroj
									 // hranitsja kommentarij.Vozvrashaet:
									 // 1,esli etogo kommentarija net v spiske,
									 // inache 0.
	{UINT c,d,e,*f;
	  if(a == L3)return 1;
	  e = 2*(st-b) + 4;
	  for(c = a + 2;!(Z[c] & T1); c += 2)
		 if(b == st-1){if(Z[c] == *b)return 0;}
		 else
		  {if(!(Z[c] & T6))
			 {d = Z[c];
			  if(Z[d] == e && Z[d+2] == *b)
				{for(d += 4,f = b + 1;f != st;d += 2,f++)
					if(!(sravn(Z[d],*f))) break;
				 if(f == st)return 0;
				}
			 }
		  }
	  return 1;
	}

	UINT spskprm() //Po maske peremennih (pervie 16 jacheek v massive R)
						// formiruet tekst spiska peremennih;vozvrashaet ssilku
						// na etot tekst.
	{UINT *a,b,c,d;
	  a = st;
	  for(b = 0;b < 16;b++)
		{if(R[b] != 0)
		  {for(c = 1,d = 1;d < 33;c <<= 1,d++)
			 if(R[b] & c){*st = T7 | ((b << 5) + d);st++;}
		  }
		}
	  if(a == st)return L3;
	  else return text1(a);
	}

	UINT svbvhg(UINT a) // a - vhogdenie peremennoj.Esli ono svobodnoe,
							  // vozvrashaet 1,inache 0.
	{UINT b,c;
	  b = a;
	  while((Z[b+1] >> 16) != 3)
		 {b -= (Z[b+1] >> 16);
		  if((Z[b+2] & T7) && (c = Z[b],c == L16
         || c == L17 || c == L18	|| c == L19
         || c == L20 || c == L21 || c == L22
         || c == L23) && (Z[b+1] & 0x0000FFFF)!= 4)
			 {for(c = b + 2;Z[c] & T7;c += 2)
				if(Z[c] == Z[a])return 0;
			 }
		 }
	  return 1;
	}

	void prmter(UINT a)  // a - ssilka na term.V maske peremennih
								// registrirujutsja vse ego parametri
	{UINT b,c,d;
	  b = 0;
	  for(c = a + 2;!(Z[c] & T1);c += 2)
		{if(Z[c] & T7)
		  {if(b == 0 || svbvhg(c))
			 {d = Z[c] - T8;R[d >> 5] |= (1 << (d & T9));
			 }
		  }
		 else
			{d = Z[c];
			 if((Z[c+2] & T7) && (d == L16 || d == L17
             || d == L18 || d == L19 || d == L20
             || d == L21 || d == L22 || d == L23)
            )
				b = 1;
			}
		}
	}

	UINT numkey(UINT a) // a - virtualnij kod klaviaturi.Vozvrashaet
							  //  ego nomer stroki v tablicah drivera
							  // klaviaturi.Esli a ne vhodit v tablicu DK0,
							  // vozvrashaet 100.
	{UINT b,c,d;
	  b = 0;c = 74;
	  while(b <= c)
		{d = (b + c)/2;
		 if(DK0[d] == a)return d;
		 else
		  {if(DK0[d] < a)b = d + 1;
			else c = d - 1;
		  }
		}
	  return 100;
	}

	void tekfail(UINT a) // a - ssilka na ob'ekt inform.faila.Etot fail
   							// otkrivaetsia;esli ego ne bilo - vvoditsja,
							// i infhndl stanovitsja ravno ego handl'u.
							// Korrektiruetsja nomer faila v stroke dlja
							// ego puti.
	{UINT b,c,f,n;
	 char *d,e,g;
	 b = 0;c = Dlinpath;
    n = dLinpath;
    if(ialt == 0)d = path[nominf - 1];
    else
     {d = altpath[nominf - 1];
	  if(iialt == 0)
	   {c += 4; n += 4;}
	  else
	  {c = iialt; n = iialt-3;}
     }
	 f = a >> 22;
    while(c > n)
	 {e = d[c];
	  g = (char)(f & 7);
	  g += '0';
	  f >>= 3;
	  if(e != g){b = 1;d[c] = g;}
	  c--;
	 }
	 if(b == 0 && infhndl != 0)return;
	 if(infhndl != 0){Nclose(infhndl);infhndl = 0;};
	 infhndl = Nopen(d);
	 if(infhndl == INVALID_HANDLE_VALUE)
	  {infhndl = 0;
		if(crfail == 1)
      infhndl = Ncreat(d);
	  }
	}

	UINT adrcod(UINT a) // a - ssilka na paru log.simvolov v zone
					    // zadach,kodirujushuju ssilku na ob'ekt
					    // inform.faila.Vozvrashaet ssilku na etot
					    // ob'ekt libo (pri neudache)0.
	{UINT b;
    if(a & T6 || !(Z[a+1] & T1) || Z[a] != 8)
    return 0;
	 b = (Z[a + 2] - L0) << 16;b |= (Z[a + 4] - L0);
    b |= 0x80000000;
	 return b;
	}
	UINT codadr(UINT a) // a - ssilka na ob'ekt inform.faila.
						// Sozdaet v zone zadach paru log.simvolov,
					    // kodirujushuju ssilku a,i vozvrashaet ssilku
					    // na etu paru.Pri neudache vozvrashaet 0.
	{UINT b;
	 b = mem(8);if(b == 0){ind = 4;return 0;}
	 Z[b + 2] = (a >> 16) + L0;Z[b+3] = 0;
	 Z[b + 4] = (a & T4) + L0;Z[b+5] = 0;
	 return b;
	}
	UINT readinf(UINT a) // a - ssilka na ob'ekt inform.faila,dlja kotorogo
								// uge ustanovlen infhndl.Etot ob'ekt schitivaetsja
								// v massiv R.Vozvrashaet scorrectirovannuju
								// ssilku na ob'ekt (s udaleniem promegutochnih
								// perehodov cherez "musor").Pri neudache
                        // vozvrashaet 0.
	{UINT b,c;
    unsigned char *d;
	 b = a & 0x003FFFFF;
    d = (unsigned char*)R;
	 do{Npointer(infhndl,b-3,0);
		Nread(infhndl,R,10);
        if(R[0] & 0x00FFFFFF)return 0;
        for(c = 0;c < 7;c++)
         d[c] = d[c+3];
		if(R[0] & 0x40000000)b = R[1] & 0x003FFFFF;
	   }
	 while(R[0] & 0x40000000);
	  Npointer(infhndl,b + 4,0);
	 c = R[0] & T4;
	 Nread(infhndl,R + 1,c - 4);
	 return ((a & 0xFFC00000) | b);
	}

	UINT poiskmetki(UINT a) // a - metka perehoda(log.simvol libo peremennaja
									// libo ssilka na term v zone zadach.V massive
									// R nahoditsja sodergimoe ukazatelja-spiska.
									// Predprinimaetsja poisk metki a v etom ukaza-
									// tele,i esli ona naidena,to vozvrashaet smeshe-
									// nie (v baitah!)v R pervoj jachejki ee polja
									// (ona hranit dlinu).Pri etom B1 - smeshenie
									// v baitah nachala polja ssilok;B2 - dlina polja
									// metki.Inache vozvrashaet 0.
	{UINT b,c,d,e,f,g,s,t,q,u,i,m;
	 b = ((R[0] >> 16) & 0x00000FFF); // b - chislo bait v pole ukazatelja
	 c = 0; // c - chislo obrabotannih bait v pole ukazatelja
	 d = 4; // d - smeshenie v baitah do nachala polja metki
	 while(c < b)
	  {e = d >> 2; // e - nomer tek.jachejki iz R
		f = R[e];g = d & 3;         // f - istochnik bait
		if(g != 0)f >>= (g << 3);
		g = 4 - g; // g - chislo bait v f
		if(g == 1)
		 {B2 = f | ((R[e+1] & 0x000000FF) << 8);
		  e++;
		  f = R[e] >> 8;
		  g = 3;
		 }
		else
		 {B2 = f & T4;
		  g -= 2;
		  if(g == 0)
		   {e++;
		    f = R[e];
			g = 4;
		   }
		  else f >>= 16;
		 }; // B2 - chislo bait v pole metki
		B1 = c + 6; // B1 - chislo bait do metki
		s = 0; // s - skobochnij itog
		t = 0; // t - tek.smeshenie v metke a,esli ona - term
		m = 0; // m - tek.smeshenie vneshnego operanda v metke a,
				 // esli ona - term.
		q = 0; // q - indikator nesovpadenija
		do{u = 0;  // u - tek.log.simvol v pole metki
			for(i = 0;i < 17;i += 8)
			 {u |= ((f & 0x000000FF) << i);
			  if(g == 1){e++;f = R[e];g = 4;}
			  else {f >>= 8;g--;}
			 };
			B1 += 3; // B1 - chislo bait do sledujushej jachejki v pole metki
			if(a & T6)
             {if(((a ^ u) & T11) || (u & 0x00600000))q = 1;
		      else
		       {if((u ^ (a << 1)) & 0x00800000)q = 1;
			    else return(c + 4);
		       }
		     }
			else
			{if(t == 0)t = a + 2;
			 if(u & T11)
			  {if(((u ^ Z[t]) & T11) ||
               ((m != 0) && (m != t - (Z[t+1] >> 16))))
				  q = 1;
				else
				 {if(u & 0x00200000)
					{s++;if((Z[t+1] & T4) == 2)q = 1;
						  else {m = t;t += 2;}
					}
				  else
					{if(u & 0x00400000)
					  {s--;i = Z[m+1] >> 16;
						if(i == 3)
                    {if(s == 0)t += 2;
                     else q = 1;
                    }
						else{m -= i;t += 2;}
					  }
					 else t += 2;
					}
				 }
			  }
			 else
			  {s--;i= Z[m+1] >> 16;
				if(i == 3)
              {if(s != 0)q = 1;
              }
				else m -= i;
			  };
			 if(q != 1 && s == 0)
				{if(Z[t] & T1)return (c + 4);
				 else q = 1;
				}
			}
		  }
		while (q != 1);
		B2 += 2;c += B2;d += B2;
	  };
	 return 0;
	}
	UINT sledmetka(UINT a,UINT b) // a - chislo bait v pole ukazatelja-
								  // spiska;b - smeshenie v baitah polja
								  // metki.Esli metka ne poslednjaja,voz-
								  //vrashaet smeshenie nachala polja sled.
								  //metki.Inache vozvrashaet 0.
	{UINT c;
	 unsigned char *d;
	 d =(unsigned char*) R;
     c = (UINT)d[b] | ((UINT)d[b+1] << 8);
	 b += c;b += 2;
	 return (b < a + 4 ? b : 0);
	}

	UINT tekstmetki(UINT a,UINT b) // a - smeshenije v baitah do teksta
								   // metki ukazatelja - spiska.Esli b = 1,
	    						   // zanosit po *st ssilku na metku - sfor-
		      					   // mirovannij v zone zadach term libo
								   // simvol.Pri nehvatke mesta vozvrashaet 0.
								   // Esli b = 0,ogranichivaetsja poiskom
								   // konca teksta metki i ne menjaet st.
								   // Vozvrashaet smeshenie v baitah do
								   // polja ssilok metki.
	{UINT c,e,f,g,h;
	 unsigned char *d;
	 d =(unsigned char*) R;
	 e = 8000; // e - smeshenie v R tek.zapolnjaemoj jachejki terma
	 c = 0; // c - skobochnij itog
	 f = 0; // f - smeshenie vneshnei operacii
	 do
	 {g = d[a] | (d[a+1] << 8) | (d[a+2] << 16); // tek simvol
	  if(b == 1)
		{h = g & 0x0007FFFF;
		 if(h == 0){R[f+1] |= e - f;f -= (R[f+1] >> 16);}
		 else
		  {R[e] =  h | (g & 0x00800000 ? T7 : T3);
			R[e+1] = (f == 0 ? 3 : e - f) << 16;
			if(g & 0x00200000)f = e;
			else
			 {R[e+1] |= 2;
			  if(g & 0x00400000)
            {R[f+1] |= e - f + 2;
             f -= (R[f+1] >> 16);
            }
			 }
			e += 2;
		  }
		};
	  if(g & 0x00200000)c++;
	  else
		{if(g & 0x00400000)c--;}
	  a += 3;
	 }
	 while (c != 0);
	 if(b == 0)return a;
	 if(e == 8002){*st = R[8000];st++;return a;}
	 h = mem(e - 7996);if(h == 0)return 0;
	 for(f = 8000,g = h + 2;f < e;f++,g++)Z[g] = R[f];
	 *st = h;st++;return a;
	}

	UINT infterm(UINT a,UINT b) // a - log.simvol libo peremennaja
										 // libo ssilka na term v zone zadach;
										 // b - smeshenie v massive R (v baitah).
										 // Proishodit perezapis a v R nachinaja
										 // s b,v formate inform.failov.Vozvra-
										 // shaet smeshenie v R pervogo baita
										 // posle teksta.
	{UINT c,f,e,g;
	 unsigned char *d;
	 d =(unsigned char*) R;
	 if(a & T6)
		{c = (a & T11);if(a & T7)c |= 0x00800000;
		 d[b] = (unsigned char)(c & 0x000000FF);
		 d[b+1] = (unsigned char)((c >> 8) & 0x000000FF);
		 d[b+2] = (unsigned char)(c >> 16);
		 return b+3;
		}
	 else
	  {a += 2; // a - smeshenie tek.podterma
		c = 0; // c - smeshenie vneshnego podterma
		while(!(Z[a] & T1))
		 {f = 0; // indikator dopolnitelnih zakrivajushih skobok
		  e = Z[a] & T11;if(Z[a] & T7)e |= 0x00800000;
		  if((Z[a+1] & T4) != 2){e |= 0x00200000;c = a;}
		  else
			 {if(c != 0)
				{if(Z[a+2] & T1)
					{e |= 0x00400000;f = 0xFFFFFFFF;}
				 else
				  {g = a + 2 - (Z[a+3] >> 16);
					if(c != g)
					  {e |= 0x00400000;f = g;
					  }
				  }
				}
			 }
		  d[b] = (unsigned char)(e & 0x000000FF);
		  d[b+1] = (unsigned char)((e >> 8) & 0x000000FF);
		  d[b+2] = (unsigned char)(e >> 16);
		  b += 3;
		  if(f != 0)
			{g = Z[c+1] >> 16;c = (g == 3 ? 0 : c - g);
			 while(c != 0 && c != f)
			  {d[b] = 0;d[b+1] = 0;d[b+2] = 0x40;b += 3;
				g = Z[c+1] >> 16;c = (g == 3 ? 0 : c - g);
			  }
			}
		  a += 2;
		 }
		return b;
	  }
	}

	UINT novssilka(UINT a,UINT b) // a- metka,po kotoroj v zagotovku
								  // ukazatelja-spiska iz R zanositsja
								  // ssilka na ob'ekt b.Izmenjaet chislo
	{UINT c,e,f;                  // zanjatih bait,no ne izmenjaet obshego
	 unsigned char *d;            // chisla bait (sm.R[0]).Vozvrashaet chislo
	 d =(unsigned char*) R;       // ispolzovannih bait v R;pri neudache -
	 c = ((R[0] >> 16) & 0x00000FFF); // vozvrashaet 0.
	 e = poiskmetki(a);
	 if(e == 0)
	  {f = infterm(a,c + 6);
		d[f] = (unsigned char)(b & 0x000000FF);
		d[f+1] = (unsigned char)((b >> 8) & 0x000000FF);
		d[f+2] = (unsigned char)(b >> 16);
		f += 3;e = f - c - 6;
		if(f > 4090)return 0;
		d[c + 4] = (unsigned char)(e & 0x000000FF);
		d[c + 5] = (unsigned char)(e >> 8);
		R[0] += ((f - c - 4) << 16);
		return f;
	  }
	 else
	  {for(f = c + 3;f >= B1;f--)d[f+3] = d[f];
		d[B1] = (unsigned char)(b & 0x000000FF);
		d[B1 + 1] = (unsigned char)((b >> 8) & 0x000000FF);
		d[B1 + 2] = (unsigned char)(b >> 16);
		f = d[e] | (d[e+1] << 8);f += 3;
		d[e] = (unsigned char)(f & 0x000000FF);
		d[e+1] = (unsigned char)(f >> 8);
		R[0] += 0x00030000;
		return (c+7);
	  }
	}

	UINT iskluchssilki(UINT a,UINT b) // a - metka v ukazatele-spiske,
									  // schitannom v massiv R;b - ssilka
									  // po metke a.Proishodit iskluchenie
									  // etoj ssilki.Vozvrashaet chislo
									  // zanjatih bait v R.
	{UINT c,e,f,g,h;
	 unsigned char *d;
	 b &= 0x003FFFFF;
	 c = poiskmetki(a);if(c == 0)return (R[0] & T4);
	 d = (unsigned char*)R;
	 e = (UINT)d[c];e |= ((UINT)d[c+1] << 8);e += 2;
	 g = c + e;
	 f = B1;
	 while(f < g)
	  {h = (UINT)d[f] | ((UINT)d[f+1] << 8) |
      ((UINT)d[f+2] << 16);
		if(b == h)
		 {if(g == B1 + 3)
			{R[0] -= (e << 16);h = (R[0] & T4) - e;
			 for(f = c;f < h;f++)d[f] = d[f + e];
			 return h;
			}
		  else
			{e -= 5;
			 d[c]= (unsigned char)(e & 0x000000FF);
			 d[c+1] = (unsigned char)((e >> 8) & 0x000000FF);
			 R[0] -= (3 << 16);h = (R[0] & T4) - 3;
			 for(g = f;g < h;g++)d[g] = d[g+3];
			 return h;
			}
		 }
		f += 3;
	  }
	 return (R[0] & T4);
	}

	UINT izmenenie(UINT a,UINT b) // a - ssilka na ob'ekt v tekushem inf.
	        					  // faile.Novaja versija etogo ob'ekta
								  // hranitsja v massive R (v R[0] sohra-
								  // neno chislo bait staroj versii).b -
								  // chislo bait novoj versii v R.Predpri-
								  // nimaetsja izmenenie versii ob'ekta v
								  // inf.faile.Vozvrashaet ssilku na novuju
	{UINT c,e;                    // versiju libo,pri neudache,0.
	 unsigned char *d;
     c = 0xFFFFFFFF;
     Npointer(infhndl,(a & 0x003FFFFF) - 3,0);
     Nread(infhndl,(char*)&c,3);
     if(c & 0x00FFFFFF){ind = 4;return 0;}
	 c = R[0] & T4;
	 if((c == b) || ((c > b) && ((R[0] & 0xF0000000) != T1)))
	  {d = (unsigned char*)R;
	   if(R[0] & T1)
	    {while(b < c){d[b] = 0;b++;}
	    }
	   Npointer(infhndl,a & 0x003FFFFF,0);
	   Nwrite(infhndl,(char*)d,c);
       return a;
	  }
	 else
	  {e = R[0];
	   R[0] = (e & 0xFFFF0000) | b;
	   c =  Npointer(infhndl,0,1);
	   Nwrite(infhndl,nuli,3);
	   c += 3;d = (unsigned char *)R;
	   Npointer(infhndl,0,1);
	   Nwrite(infhndl,(char*)d,b);
       if(4000000 < c + b)polnij = 1;
	   R[0] = e | 0x40000000;R[1] = c;
	   Npointer(infhndl,a & 0x003FFFFF,0);
	   Nwrite(infhndl,(char*)d,7);
	   e = a & 0xFFC00000;
	   smfail(a,nominf);
	   return (e | c);
	  }
	}

	void registracia(UINT a,UINT b,UINT c) // Proishodit registracia ob'ekta
	               						   // tek.faila,ssilka na kotorij
										   // - c,po metke b v ukazatele,
										   // ssilka na kotorij - a.
	{UINT d,e;
	 if((a & 0x7FC00000) == 0 && nominf != 1 && nominf != 4)
	  {if(!(b & 0x00200000))
        {ind = 4;return;}
       tekfail(0x80000000);d = (b & T11) * 4;
	   Npointer(infhndl,d - 4,0);
	   Nread(infhndl,(char*)&e,4);
	   if(e != 0)
		{*st = 0x00200067;*(st+1) = a;
		 *(st+2) = b;*(st+3) = 0x00200104;
		 *(st+4) = 0x00200107;F165();
		}
	   Npointer(infhndl,d - 4,0);
	   Nwrite(infhndl,(char*)&c,4);
	  }
	 else
	  {tekfail(a);
      if(infhndl == 0){ind = 4;return;}
		d = readinf(a);
      if( d == 0 || R[0] & T1)
      {ind = 4;return;}
		e = novssilka(b,(c & 0x003FFFFF));
		if(e == 0)
      {ind = 4;return;}
		izmenenie(d,e);
	  }
	 return;
	}

	UINT poslednijfail(void) // Ustanavlivaet infhndl na poslednij fail serii
							 // inf.failov,imejushih obshij katalog.Vozvrashaet
							 // shablon ssilok na ob'ekti etogo faila (starshie
							 // 10 razrjadov ssilki)
	{char *a,d;
	 UINT b,c,n;
     if(ialt == 0)a = path[nominf - 1];
     else a = altpath[nominf - 1];
     c = 1;
	 if(infhndl != 0){Nclose(infhndl);infhndl = 0;}
	 while(c != 0xFFFFFFFF)
	  {b = Dlinpath; n = dLinpath;
      if(ialt != 0)
       {if(iialt == 0)
	     {b += 4; n += 4;}
	    else
		 {n = iialt; b = iialt-3;}
       }
		while(b > n)
		 {d = a[b];
		  if(d == '7')
		   {a[b] = '0';b--;
		   }
		  else
		   {a[b] = (char)(d + 1);break;
		   }
		 }
		c = NGetFileAttributesA(a);
	  }
	 if(a[Dlinpath - 2] == '0'
       && a[Dlinpath - 1] == '0' && a[Dlinpath] == '1')
		{infhndl = Ncreat(a);return 0x80400000;}
	 else
	  {b = Dlinpath;
	   while(b > dLinpath)
	    {d = a[b];
	     if(d == '0')
		  {a[b] = '7';b--;
		  }
		 else
		  {a[b] =(char)(d - 1);break;
		  }
		}
	   infhndl = Nopen(a);
	   b = Dlinpath - 2;c = 0;
	   while(b <= Dlinpath)
	    {c = (c << 3) | (a[b] - '0');b++;
	    }
	   c <<= 22;c |= T1;
	   return c;
	  }
	}

	void smfail(UINT a,UINT b) // a - ssilka na ob'ekt inf. libo prog.
							   // faila.b - 0 v sluchae prog.faila,
							   // inache - nomer inf.bloka.Realizuet uchet
							   // v massive U i falle U.SOL  ssilki dlja
							   // uplotnenija dannogo faila.V sluchae prog.
							   // faila proghndl pered obrasheniem dolgen
							   // bitb ustanovlen soglasno a.
	{UINT c,d,e,f;
	 c = (a & 0xFFC00000) | b;
	 d = 0;
	 while (d < tekup)
	 {if(U[d] == c)return;
	  d++;
	 }
	 if(tekup == 490)tekup = 0;
	 U[tekup] = c;tekup++;
	 uplotnhndl = Nopen(pathuplotn);
	 if(uplotnhndl == INVALID_HANDLE_VALUE)
	  uplotnhndl = Ncreat(pathuplotn);
	 e =  Npointer(uplotnhndl,0,1);
	 if(e != 0)
	  {Npointer(uplotnhndl,0,0);
	   Nread(uplotnhndl,(char*)F,e);
	   e /= 4;
       if(e > 7000)
        {Nclose(uplotnhndl);uplotnhndl = 0;return;}
	     for(f = 0;f < e;f++)
	     if(F[f] == c)
          {Nclose(uplotnhndl);
		   uplotnhndl = 0;
		   return;
		  }
	     Npointer(uplotnhndl,0,1);
	    }
	 Nwrite(uplotnhndl,(char*)&c,4);
     Nclose(uplotnhndl);uplotnhndl = 0;
	}

	UINT uplotninf(UINT a,UINT b) // uplotnenie tek.inf.faila,schitannogo v
								// massiv U2.a - chislo bait v U2.Esli imeetsja
								//katalog,to on schitan v U1.Korrektiruet ssilki
								//v U1,U2.Vozvrashaet chislo bait v U2 posle
								//uplotnenija.b - maska nomera tek.inf.faila.
	{UINT c,e,f,g,h,p,*r,s,t;
	 unsigned char *d,*v;
	 d = (unsigned char*)U2;
	 f = 0;c = 3; // f- tek.smeshenie do uplotnenija;c - tek.smeshenie
					  // posle uplotnenija
	 if((nominf == 1 || nominf == 4) && (d[6] & 0x40))
	  {e = 3;              // kornevoj ob'ekt faila dolgen okazatsja
		while(d[e+3] & 0x40)  // v nachale faila posle uplotnenija
		e = (UINT)d[e+4] | ((UINT)d[e+5] << 8) | ((UINT)d[e+6] << 16);
		d[e-3] = 3;d[e-2] = 0;d[e-1] = 0;
		c = ((UINT)d[e] | ((UINT)d[e+1] << 8)) + 6;
	  }
	 while(f < a) // cicle rasstanovki novih smeshenij
	  {e = (UINT)d[f + 3] | ((UINT)d[f+4] << 8);
	   if(!(d[f+6] & 0x40) && d[f] != 3)
	    {d[f] = (unsigned char)(c & 0x000000FF);
	     d[f+1] = (unsigned char)((c >> 8) & 0x000000FF);
	     d[f+2] = (unsigned char)((c >> 16) & 0x000000FF);
	     c += e;c += 3;
		}
	   f += (e + 3);
	  }
	 if(nominf != 1 && nominf != 4)
	  for(g = 0;g < 524288;g++)   //cicle correkcii ssilok iz kataloga
		{h = U1[g];
		 if((h & 0xFFC00000) == b)
		  {h &= 0x003FFFFF;
		   while(d[h+3] & 0x40)
		   h = (UINT)d[h+4] | ((UINT)d[h+5] << 8) | ((UINT)d[h+6] << 16);
		   p = (UINT)d[h-3] | ((UINT)d[h-2] << 8) | ((UINT)d[h-1] << 16);
		   U1[g] = p | b;
		  }
		}
	 r = R; // sohranjaetsja znachenie R
	 f = 0;  // f - tek.ssilka na ob'ekt v U2
	 while(f < a) // cicle correkcii ssilok v U2
	  {e = (UINT)d[f+3] | ((UINT)d[f+4] << 8);
		if(!(d[f+6] & 0xC0))  // ukazatel-spisok
		 {R = (UINT*)(d + f + 3);
		  g = (UINT)d[f+5] | ((UINT)d[f+6] << 8);g &= 0x00000FFF;
		  h = 4;
		  while(h < g + 4) //cicle prosmotra metok
			{p = (UINT)d[f + h + 3] | ((UINT)d[f + h + 4] << 8);
			 p += (h + 2); // p - smeshenie polja sled.metki
			 s = tekstmetki(h + 2,0);
			 while(s < p)
			  {t = (UINT)d[f + s + 3] | ((UINT)d[f + s + 4] << 8) |
					 ((UINT)d[f + s + 5] << 16);
				while(d[t+3] & 0x40)
				t = (UINT)d[t+4] | ((UINT)d[t+5] << 8) | ((UINT)d[t+6] << 16);
				d[f + s + 3] = d[t - 3];
				d[f + s + 4] = d[t - 2];
				d[f + s + 5] = d[t - 1];
				s += 3;
			  }
			 h = p;
			}
		 }
		f += (e + 3);
	  }
	 R = r;
	 f = 0;c = 0; // f - tek.smeshenie do uplotnenija;c - posle
					  // uplotnenija
	 while(f < a)  // cilce perezapisi
	  {if(d[f] == 3 && d[f+1] == 0 && d[f+2] == 0)
		p = c + 3;
		e = (UINT)d[f + 3] | ((UINT)d[f+4] << 8);
		if(!(d[f+6] & 0x40))
		 {d[c] = 0;d[c+1] = 0;d[c+2] = 0;
		  if(c < f)
			{c += 3;f += 3;g = f + e;
			 while(f < g)
			  {d[c] = d[f];c++;f++;}
			}
		  else
			{f += (e + 3);c = f;}
		 }
		else f += (e + 3);
	  }
	  if(p != 3)  // perenesenie kornevogo ob'ekta v nachalo faila
	  {e = (UINT)d[p] | ((UINT)d[p+1] << 8);
		v = (unsigned char*)F;
		for(f = 0,t = p;f < e;f++,t++)v[f] = d[t];
		p -= 4;e += 3;
		while(p != 0){d[p + e] = d[p];p--;}
		d[e] = 0;e -= 3;
		for(f = 0;f < e;f++)d[f + 3] = v[f];
	  }
	 return c;
	}

	UINT bufsimv(UINT a,UINT b,UINT c,UINT d) // zanosit v bufer tekstov
									 // log.simvol libo peremennuju a nachinaja s
									 // jachejki nomer b;c,d - cvet
									 // fona i simvolov(log.simvoli).
									 // Vozvrashaet nomer pervoj
									 // jachejki v bufere tekstov
									 // posle log.simvola;pri nehva-
									 // tke mesta vidaet 0.
	{UINT g,h,i,j,s,p,r;
	 g = (((c - L7)& 0x0000000F)<< 12) |
	 (((d - L7)&0x0000000F)<< 8);  // maska cvetnosti
	 if(a & T7) // a - peremennaja
	  {if(15998 < b)return 0;
	   B[b] = (g | 0x000000E5);b++;
	   a &= T4;h = 1;
	   while(a != 0)
	    {if(15998 < b)return 0;
         p = a%10;a = a/10;F[h] = (g | (p + 48));
		 h++;
	    }
	   h--;
	   while(h != 0)
	    {B[b] = F[h];b++;h--;}
	  }
	 else  // a - log.simvol
	  {r = a - 0x00200001;
       r *= 6;
	   r += 524288;  // r - smeshenie v segmente slovarja do nachala teksta
	   s = r+5;
	   h = V[r];i = 4; // h - nakopitel;i - chislo bait v nem
       if(h == 0)
        {B[b] = g | 0x00000021;b++;
         a &= T11;h = 1;
		 while(a != 0)
		  {if(15998 < b)return 0;
           p = a & 0x0000000F;a >>= 4;
           F[h] = (g | ((p < 10) ? (p + 48) : (p + 87)));
		   h++;
		  }
		 h--;
		 while(h != 0)
		  {B[b] = F[h];b++;h--;}
        }
       else
		while(j = h & 0x000000FF)
		 {if(15998 < b)return 0;
		  B[b] = (g | j);b++;h >>= 8;i--;
		  if(i == 0)
           {if(s == r)return b;
		    else
			 {r++;h = V[r];i = 4;
		     }
		   }
		 }
	   }
     return b;
	}
	UINT prorisovka(UINT a,UINT b) // Vidaet na ekran soderjimoe bufera teks-
						           // tov nachinaja s jachejki nomer a do
								   // jachejki nomer (b-1).Tekst vidaetsja
								   // s tek.pozicii vnutri tek.ramki.Vozvra-
								   // shaet nomer jacheiki bufera tekstov,
								   // pervoi posle vidannoj chasti teksta
								   // (v tom chisle esli v tek.ramke ne hva-
								   // tilo mesta).
	{UINT c,d,e,f,g,h,i,j,k,p,s,t,u,w;
	 if(stolbec < rectleft)return a;
	 if(stroka < recttop || stroka > rectbottom - 18)
    return a;
	 c = stolbec - (8 * ((stolbec - rectleft) / 8)); // c - levij krai teksta
	 if(c > rectright - 7)return a;
	 d = ( stolbec > rectright - 7 ?  // d - pravij krai teksta
			c + (8 * ((rectright - c - 7) / 8)):
			stolbec + (8 * ((rectright - stolbec - 7) / 8)));
	 while ( a < b)
	  {if(stolbec > d)
       {stolbec = c;stroka += sdvig;sdvig = 19;};
		if(stroka > rectbottom - 18)return a;
		e = 1; // e - chislo strok v ocherednom fragmente
		f = a; // f - tek.pozicia v bufere tekstov
		g = 0; // g - dalee stanet poziciej v bufere tekstov dlja konca
				 // predidushej stroki
		h = 0; // h - indikator okonchanija cicla
		s = B[a] & 0x0000FF00; // s - maska cvetnosti
		t = stolbec; // t - tek.stolbec
		do{if(((B[f] ^ s) & 0x0000FF00) || f == b)
           {h = 1;f--;
             if(e > 1){f = g;e--;}
			  }
			else
          {if(t < d){t += 8;f++;}
			  else
           {if(stolbec == c){t = c;g = f;f++;e++;}
				 else h = 1;
			  }
			 }
		  }
		while(h == 0); // f - poslednjaja pozicia v bufere tekstov dlja
							// prorisovki
		h = (e == 1 ? (f - a + 1) : (((d - c)/8) + 1)); // h - chislo stolbcov
		g = 0; // g - nachalo v bufere bitmapov ocherednoj stroki
		t = a; // t - tek.pozicia v bufere tekstov
		p = h + (h%2);
		for(i = 0;i < e;i++)
		{for(j = 0;j < h;j++)
		  {u = (B[t] & 0x000000FF) * 38; // u - smeshenie v FONT do tek.bukvi
			w = g;
			for(k = 0;k < 19;k++)
			 {C[w] = FONT[u];
			  w += p;u += 2;
			 };
			t++;g++;
		  };if(p != h)g++;
		 g += 18*p;
		}      // sformirovan bitmap
		if(indparal == 0)
		 {hdc = NGetDC(hhwnd);hdcm = NCreateCompatibleDC(hdc);
		  hbmp = NCreateBitmap(8*h,19*e,1,1,C);
		  hbmpold = (HBITMAP)NSelectObject(hdcm,hbmp);
		  s >>= 8;u = s & 0x0000000F;
		  NSetTextColor(hdc,u);
          NSetTextColor(hsdc,u);
		  s >>= 4;u = s & 0x0000000F;
		  NSetBkColor(hdc,u);
		  NSetBkColor(hsdc,u);
		  NBitBlt(hdc,stolbec,stroka,8*h,19*e,hdcm,0,0,0);
		  NBitBlt(hsdc,stolbec,stroka,8*h,19*e,hdcm,0,0,0);
		  NSelectObject(hdcm,hbmpold);
		  NDeleteObject(hbmp);
		  NDeleteDC(hdcm);
		  NReleaseDC(hhwnd,hdc);
		 }
		if(e == 1)
       {stolbec += 8*h;
        if(stolbec > d)
        {stolbec = c;stroka += 19;}
       }
		else {stolbec = c;stroka += 19*e;}
		a = f + 1;
	  }
	 return a;
	}

	void bufbukva(UINT a,UINT b,UINT c,UINT d) // zanosit v bufer tekstov na
								               // poziciju a bukvu b s cvetom
											   // fona c i cvetom simvolov
											   // d
	{UINT e;
	 e = (((c - L7) & 0x0000000F) << 12) | (((d - L7) & 0x0000000F) << 8);
	 e |= ((b - L0) & 0x000000FF);
	 B[a] = e;
	}

	UINT poiskslova(UINT a) // a - ishodnaja pozicia v bufere tekstov.
							// Esli nachinaja s etoj pozicii nahoditsja
							// tekst log.simvola,to vozvrashaet etot log.
							// simvol i ustanavlivaet B1 na smeshenie
							// pervoj jachejki posle ego teksta,a B3 - na
							// smeshenie jachejki v nachale slovarja,
                            // hranjashej nomer log.simvola; inache
                            // vozvrashaet 0.
							// V poslednem sluchae B3 ustanavlivaetsja
							// na smeshenie jachejki slovarja, kuda
							// sleduet vstavljat novij simvol.
	{UINT c,d,g,h,i,j,m,r;
	 unsigned char p,q,*f;
     B3 = 0xFFFFFFFF;
	 f = (unsigned char*)V;
	 c = 0;d = 524287; // c,d - granici promegutka
	 while (c <= d && d < 524288)
	  {g = ((c + d) >> 1);
       r = V[g];
	   if(r == 0)
        {if(d == g)
         {B3 = c;return 0;}
         else d = g;
        }
	   else
		{h = (r-1)*24;
		 h += 2097152;
		 j = 0; //j - indikator okonchanija cicla sravnenija
		 i = a;m = 0;
		 while(j == 0)
		 {p = (unsigned char)B[i];q = f[h];
		  if(p == 0 || p == 0x20 || p == 0x28 || p == 0x29)
			{if(q == 0)
           {B1 = i;B3 = g;return (0x00200000 | r);}
			 else {d = g - 1;j = 1;}
			}
		  else
			{if(q == 0){c = g + 1;j = 1;}
			 else
			 {if(p < q){d = g - 1;j = 1;}
			  else
				{if(p > q){c = g + 1;j = 1;}
				 else
				  {if(m == 23)
					 {p = (unsigned char)B[i+1];
					  if(p == 0 || p == 0x20 || p == 0x28 || p == 0x29)
						{B1 = i+1;B3 = g;
                         return(0x00200000 | r);
					    }
					  else return(0);
					 }
					else{i++;h++;m++;}
				  }
				}
			 }
			}
		 }
		}
	  }
	 B3 = c;
	 return(0);
	}

	UINT iskluchslova(UINT a) // a - ishodnaja pozicia v bufere tekslov.
							  // V slovare ishetsja log.simvol,nazvanie
	     					  // kotorogo raspologeno s dannoj pozicii,
							  // i etot simvol iskluchaetsja iz slovarja.
							  // Vozvrashaet dannij log.simvol,prichem B1
							  // ustanavlivaet na smeshenie v bufere tekstov
							  // pervoj jachejki posle ego teksta;esli takogo
							  // simvola ne bilo naideno,vozvrashaet 0.
	{UINT b,d,f;
	 b = poiskslova(a);
	 if(b == 0)return 0;
	 d = b & 0x0007FFFF;
     d--;d *= 6;d += 524288;
	 for(f = 0;f < 6;f++)V[d + f] = 0;
	 for(f = B3; f < 524287; f++)
	  {V[f] = V[f+1];
	   if(V[f] == 0)break;
	  }
     V[f] = 0;
	 return b;
	}

	UINT konvblock(UINT a,UINT b,UINT c) // a - smeshenie tek.operatora
								    	 // v zone zadach;b - smeshenie
									     // vhogdenija tek.terma;c - smeshe-
										 // nie pervoj svob.jacheiki v R.
										 // Realizuet obrashenie k procedure
                                         // massiva konv[];vozvrashaet
										 // smeshenie pervoj svob.jacheiki
										 // v R,libo,pri neudache,0.
	{UINT d,e,f;
	 d = Z[b];if(d & 0x00400000)return 0;
	 f = (d & T4);if(242 < f)return 0;
	 e = konv[f - 1](a,b,c);
	 return e;
	}

	UINT konvoper(UINT a,UINT b,UINT c) // a,b,c - takie ge,kak v konvblock.
									 	// Realizuet operator OP.Vozvrashaet-
										// kak konvblock.
	{UINT d,e,g,h,p,q,r,s;
	 if((Z[b+1] & T4) == 2)
	 {d = Z[b];R[c] = ((d & 0x00200000)? d : (d & T4));
	  c++;return c;
	 }
	 else
	 {p = b;d = konvblock(a,b,c);
	  if(d != 0)return d;
	  else
	  {s = Z[b];e = b + (Z[b+1] & T4);b += 2;
		g = L0;
     	while(b < e)
		{h = konvoper(a,b,c);g++;
		 b += (Z[b+1] & T4);c = h;
		}
		R[c] = s;c++;
		R[c] = g;c++;q = (Z[p+1] >> 16);
		if(q == 3 || (r = p - q,(Z[r] == 0x00200002 ||
         Z[r] == 0x00200005 || Z[r] == 0x00200006 ||
         Z[r] == 0x00200008 || Z[r] == 0x00200007 ||
			Z[r] == 0x00200009 || (Z[r] == 0x0020000A && q == 2)
         ||((Z[r] == 0x0020000E || Z[r] == 0x00200010 ||
         Z[r] == 0x0020000F) &&
         (r + (Z[r+1] & T4) != p + (Z[p+1] & T4))))))
	   R[c] = 0x00100124;
		else R[c] = 0x00100125;
		c++;
     	return c;
	  }
	 }
	}


	void konvert(UINT a) // a - smeshenie v zone zadach fragmenta
				         // programmi.Formiruet v massive R tekst etogo
						 // fragmenta v formate zoni programm.Ssilki iz
						 // fragmenta - libo 2 - 13 biti ravni 0,i togda
						 // mladshie 19 bit - smeshenie v prog.faile,
						 // libo eti biti ravni 1,i togda mladshie
						 // 16 bit - iz log.simvola - metki nedoopredelen-
						 // nogo perehoda.Prefiks fragmenta v R - s 0-j
						 // jachejki (zapolnjaetsja chastichno).

	{UINT b,c,d,e,f,g,p,q,m;
	 b = a + 2;e = 4;B1 = 0; // e - tek.jach. v R;B1 - v F,gde nakaplivajutsja
									// ssilki iz fragmenta
	 while(!(Z[b] & T1))
	 {c = Z[b] + 2;d = konvblock(b,c,e);g = Z[c];
	  if(d == 0)
	  {f = c + (Z[c+1] & T4);c += 2;
		q = L0;
      if(g == 0x00200191)
       {m = e; R[e] = 0x00200104;
        R[e+1] = 0x00100135;
        e += 2;
       }
		while(c < f)
		{p = konvoper(b,c,e);q++;c += (Z[c+1] & T4);e = p;}
		 R[e] = g;e++;
		 R[e] = q;e++;R[e] = 0x00100124;e++;
       if(g == 0x00200191)
        {R[m] += (e - m);
        }
	  }
	  else e = d;
	  if(g != 0x002000BF && g != 0x002000BE &&
        g != 0x00200011 && g != 0x00200012 &&
        g != 0x00200004 && g != 0x00200013 &&
		  g != 0x00200014 && g != 0x0020001B &&
        g != 0x002000F1 && g != 0x002000F2 &&
        ((Z[b+2] & T1) || Z[Z[b+2]+2] != 0x002000F2))
	  {R[e] = 0x001000F3;e++;}
	  b += 2;
	 }
	 R[0] = e;R[1] = e + B1;
	 for(b = 0;b < B1;b++)
	 {R[e] = F[b];e++;}
	}

	UINT konvperechisl(UINT a,UINT b,UINT c,UINT f) // konvertsija perechisl.
													// operatorov.f - konst.
	{UINT d,e;                                      // proceduri prodolgenija
	 d = b + (Z[b+1] & T4);e = b + 2;
	 while(e < d)
	 {c = konvoper(a,e,c);e += (Z[e + 1] & T4);}
	 R[c] = (0x00100000 | (Z[b] & T4));c++;
	 R[c] = f;c++;
	 return c;
	}

	void konvssilka(UINT a) // a - smeshenie v zone zadach vhogdenija
							// simvola vetvb libo inache - iz predstavlenija
							// fragmenta programmi.Formiruet v massive F
							// ocherednuju ssilku dlja etogo perehoda i
							// korrektiruet B1.
	{UINT b;
	 if((Z[a+1] & T4) == 4)
     F[B1] = (Z[a+2] & T11) | 0xFFC00000;
	 else
	  {b = Z[a+2] & T4;b--;b &= 0x0000007F;b <<= 15;
		b += ((Z[a+4] & T4) - 1);
		F[B1] = T1 | b;
	  }
	 B1++;
	}

	void dekop(UINT *a,UINT b,UINT p) // a - ukazatel na pervuju jachejku
									// fragmenta programmi;b - smeshenie v etom frag-
									// mente tek.jachejki.Schitivaet v R operatori
									// do jachejki so smesheniem p (ne vkljuchaja
									// etu jachejku).Korrektiruet B1.
	{UINT e,f;
	 while(b < p)
	 {e = a[b];
	  if(!(e & 0x00100000))
	  {f = (e & 0xFFF00000 ? e : 0x00400000 | e);
		R[B1 + 2] = f;R[B1 + 1] = (b << 16) + 2;B1 += 2;b++;
	  }
	  else
	  {e &= T4;
      if(e == 309)
       {B1 -= 2;b++;}
      else
       {if(e > 300){ind = 4;return;}
        else b = dekonv[e-1](a,b);
       }
	  }
	 }
	}

	UINT dekonvert(UINT *a) // a - ukazatel na pervuju jachejku fragmenta
							// programmi.Etot fragment preobrazuetsja v
							// format zoni zadach;vozvrashaet smeshenie v
							// zone zadach spiska operatorov fragmenta.
							// Korrektirujutsja FR1 i FR2.V FR sozdaetsja
							// perehodnik: na pozicijah,sootvetstvujushih
							// obrashenijam k proceduram interpretatora v
							// fragmente programmi,ukazivajutsja smeshenija
							// v zone zadach vhogdenij LOS-operatorov,rea-
							// lizuemih etimi procedurami.Pri neudache -
							// vozvrashaet 0.

  {UINT b,c,*d,e,f,g,h,i,j;
	B1 = 0; // B1 - smeshenie poslednej zanjatoj jacheiki v R.Massiv R
			  // - nakopitel ocherednogo terma.On razbit na pari jacheek:
			  // vtoroj element pari - log.simvol libo peremennaja f ;pervij
			  // element pari v mladshih 16 bitah imeet dlinu podterma s
			  // zagolovkom f (f idet neposredstvenno posle spiska operan-
			  // dov),a v starshih 16 bitah - smeshenie v fragmente programmi
			  // obrashenija k procedure f
	b = *a; // b - smeshenie nachala suffiksa
	c = 4; // c - smeshenie tek.jachejki fragmenta programmi
	dekop(a,c,b);
   if(ind == 4)return 0;
   d = st;
	for(e = 4;e < b;e++)FR[e] = 0;
	while(B1 > 0)
	{e = R[B1 - 1] & T4;
    f = mem(e + 4);if(ind == 4)return 0;
	 *st = f;st++;g = 2; // g - smeshenie v F tek.pari jacheek - smeshenij
								// v zagotovke teksta i v R
	 F[2] = f + 2;F[3] = B1;
	 while(0 < g)
	 {h = F[g];i = F[g+1];
	  Z[h] = R[i];
	  Z[h+1] = (((g == 2)? 3 : (h - F[g-2])) << 16) | (R[i-1] & T4);
	  j = R[i-1] >> 16;
	  if(j != 0)FR[j] = h;
	  if((Z[h+1] & T4) == 2)
	  {while((Z[h + 1] >> 16) == 2)
		{g -= 2;h = F[g];
       i = F[g+1];
      }
		if(g == 2)g = 0;
		else
		{j = (R[i-1] & T4);F[g+1] -= j;
       j = F[g+1];F[g] -= (R[j-1] & T4);
      }
	  }
	  else
	  {h += ((R[i-1] & T4) - (R[i-3] & T4));
		g += 2;F[g] = h;F[g+1] = i - 2;
	  }
	 }
	 B1 -= (R[B1 -1] & T4);
	}
	e = text2(d);FR1 = a;FR2 = e;
	return e;
  }

  UINT novprog(void) // Ustanavlivaet proghndl na poslednij fail serii
					// prog.failov.Vozvrashaet shablon ssilok na fragmenti
					// etogo faila (starshie 10 razrjadov ssilki).
	{char d;
	 UINT b,c;
	 c = 1;
	 if(proghndl != 0)
	  {Nclose(proghndl); proghndl = 0;}
	 while(c != 0xFFFFFFFF)
	  {b = Dlinpath;
	   while(b > dLinpath)
	    {d = pathprog[b];
	     if(d == '7')
		  {pathprog[b] = '0';b--;}
		 else {pathprog[b] = (char)(d + 1);break;}
	    }
	   c = NGetFileAttributesA(pathprog);
	  }
	 b = Dlinpath;
	 while(b > dLinpath)
	  {d = pathprog[b];
	   if(d == '0')
	    {pathprog[b] = '7';b--;}
	   else
	    {pathprog[b] =(char)(d - 1);break;}
	  }
	 proghndl = Nopen(pathprog);
	 b = dLinpath + 1;c = 0;
	 while(b <= Dlinpath)
		{c = (c << 3) | (pathprog[b] - '0');b++;}
	 c <<= 22;c |= T1;
	 return c;
	}

	void tekprog(UINT a) // a - ssilka na ob'ekt prog.faila.Etot fail
			     		 // otkrivaetsia,i proghndl stanovitsja raven
						 // ego handl'u.Korrektiruetsja nomer faila v
						 // stroke dlja ego puti.
	{UINT b,c,f;
	 char e,g;
	 b = 0;c = Dlinpath;
	 f = a >> 22;
	 while(c > dLinpath)
	 {e = pathprog[c];
	  g = (char)(f & 7);
	  g += '0';
	  f >>= 3;
	  if(e != g){b = 1;pathprog[c] = g;}
	  c--;
	 }
	 if(b == 0)
     {if(proghndl == 0)
       proghndl = Nopen(pathprog);
      return;
     }
	 Nclose(proghndl);
	 proghndl = Nopen(pathprog);
	}

	UINT fragfile(void) // v massive R nahoditsja fragment programmi,
					    // sformirovannij operatorom KONVERT.Osushestvljaet
					    // preobrazovanije etogo fragmenta v format
					    // prog.faila;rezultat formiruetsja v massive
					    // F.Vozvrashaet chislo bait,zanjatih etim
					    // rezultatom (dlja perezapisi v fail).
	{UINT a,b,c,d,g,h,p,r,*i;
	 char e,*f,q;
	 a = 7;f = (char*)F; // a - smeshenie tek.baita v F
	 e = 0;b = 0; // e - nakopitel tek.baita dlja F;b - chislo zanjatih
					  // bit v e
	 d = R[0];  // c - tek.smeshenie v R
	 for(c = 4;c < d;c++)
	 {g = R[c];
	  if(g & 0x00100000)
      {g = (((g & T4) << 2) | 0x00000003);h = 11;}
	  else
		{if(g & 0x00200000){g = (g & T11) << 1;h = 20;}
		 else
		 {g = (((g & T4) << 2) | 0x00000001);h = 11;}
		} // g - dlinnij nakopitel;h - chislo bait v nem
	  while(h != 0)
	  {p = (b == 0 ? g : (g << b));
		q = (char)p;e |= q;r = 8 - b;
		if(r <= h)
		{h -= r;g >>= r;f[a] = e;a++;e = 0;b = 0;}
		else
		{b += h;h = 0;}
	  }
	 }
	 if(b != 0){f[a] = e;a++;}
	 F[0] = a;
	 c = R[0];d = R[1];f += a;
	 while(c < d) // cicle formirovanija ssilok
	 {g = R[c];h = g & 0x003FFFFF;
	  if((g & 0xFFC00000) == 0xFFC00000)h |= 0x00800000;
	  i = (UINT *)f;*i = h;f += 3;c++;a += 3;
	 }
	 F[0] |= (a << 16);
	 return a;
	}

	void isklprog(UINT a) // a - ssilka na fragment prog.faila.Predprinima-
			              // etsja iskluchenije vsej vetvi etogo fragmenta.
						  // Vneshnjaja ssilka na fragment po a dolgna
						  // bitb predvaritelno udalena.
	{UINT b,*c,d,e,f,y,z,r;
	 tekprog(a);F[2] = a & 0x003FFFFF;R[2] = 0;
	 b = 8; // b - nomer nachalnogo baita poslednego 3-h baitovogo
			  // smeshenija v steke F
	 while(b > 7)
	 {c = (UINT*)((char*)F + b);
	  d = *c & 0x00FFFFFF;
     if(d & 0x00800000)b -= 3;
     else
      {y =  Npointer(proghndl,d,0);
       if(y == 0xFFFFFFFF)
        {ind = 4;return;}
	    Nread(proghndl,(char*)F,7);
       c = (UINT*)((char*)R + b);
       z = *c & 0x00FFFFFF;
       if(z != 0 && (F[1] & 0x00FFFFFF) != z)
        {ind = 4;return;}
	    F[0] |= 0x00008000;
	     Npointer(proghndl,d,0);
       Nwrite(proghndl,(char*)F,2);
	    e = (F[0] >> 16) & 0x00003FFF;
	    f = F[0] & 0x00003FFF;
	    if(e != f)
	     {r = d + f;e -= f;
         if(90 < e){ind = 4;return;}
		   y =  Npointer(proghndl,r,0);
         if(y == 0xFFFFFFFF)
          {ind = 4;return;}
		   Nread(proghndl,(char*)F + b,e);
         for(y = b;y < b + e;y += 3)
          {c = (UINT*)((char*)R + y);
           *c = d;
          }
		   b += (e - 3);
	     }
	    else b -= 3;
      }
	 }
	}

	UINT uplotnprog(UINT a,UINT b) // uplotnenie tek.prog.faila,schitannogo v
   							 // massiv U2.a - chislo bait v U2.Katalog schitan
								// v K.Korrektiruet ssilki v K,U2.Vozvrashaet
								// chislo bait v U2 posle uplotnenija.b - maska
								// nomera tek.prog.faila.
	{UINT c,f,g,h;
	 unsigned char *d,*e;
     U4 = (UINT*)calloc(a,1);
	 d = (unsigned char*)U2;e = (unsigned char*)U4;
	 c = 0;f = 0; // c - smeshenie do uplotnenija;f - posle
	 while(c < a) // rasstanovka novih smeshenij (v zone zadach)
	 {g = ((UINT)d[c+2] | ((UINT)d[c+3] << 8));
	  if(!(d[c+1] & 0x80))
	  {e[c] = (unsigned char)(f & 0x000000FF);
		e[c+1] = (unsigned char)((f >> 8) & 0x000000FF);
		e[c+2] = (unsigned char)((f >> 16) & 0x000000FF);
		f += g;
	  }
	  c += g;
	 }
	 for(c = 0;c < 65536;c++) // korrekcia ssilok iz kataloga
	 {if((K[c] & 0xFFC00000) == b)
	  {f = K[c] & 0x003FFFFF;
		K[c] = b | (UINT)e[f] | ((UINT)e[f+1] << 8) | ((UINT)e[f+2] << 16);
	  }
	 }
	 c = 0;
	 while(c < a)   // korrekcia ssilok v U2
	 {g = ((UINT)d[c+2] | ((UINT)d[c+3] << 8));
	  if(!(d[c+1] & 0x80))
	  {if(!(d[c+1] & 0x40))
		{h = (UINT)d[c+4] | ((UINT)d[c+5] << 8) | ((UINT)d[c+6] <<16);
		 d[c+4] = e[h];d[c+5] = e[h+1];d[c+6] = e[h+2];
		}
		f = c + (((UINT)d[c] | ((UINT)d[c+1] << 8)) & 0x00003FFF);
		c += g;
		while(f < c)
		{h = (UINT)d[f] | ((UINT)d[f+1] << 8) | ((UINT)d[f+2] << 16);
		 d[f] = e[h];d[f+1] = e[h+1];d[f+2] = e[h+2];
		 f += 3;
		}
	  }
	  else c += g;
	 }
	 c = 0;f = 0;  // cicle perezapisi c - otkuda;f - kuda
	 while(c < a)
	 {g = ((UINT)d[c+2] | ((UINT)d[c+3] << 8));
	  if(!(d[c+1] & 0x80))
	  {h = c + g;
		if(f != c)
		while(c < h)
		{d[f] = d[c];f++;c++;
		}
		else
		{f += g;c += g;
		}
	  }
	  else c += g;
	 }
    free(U4);
    return f;
	}

   void initprer(UINT d) // inicializiruetsja obrashenie k programme
                        // simvola "prerivanie".d - 1 libo 2 -
                        // ukazatel na blokprer posle vihoda
                        // iz prerivanija
   {UINT a,b,c;
    c = 0xFFFFFFFF - d;
    SP[stp] = peresm;SP[stp+1] = otvet;
    SP[stp+2] = symbol;SP[stp+3] = ind;
    SP[stp+4] = ist;SP[stp+5] = uroven;
    SP[stp+6] = delta;SP[stp+7] = cadr;SP[stp+8] = st - T;
    if(tec != 0)tec--;
    SP[stp+9] = (tec == 0 ? 0 : *tec);
    stp += 10;
    delta = 0;prer += 7;
    for(a = 0;a < 6;a++) PR[prer + a] = 0;
    a = S[lcadr];
    S[a+1] = lcadr;S[a+2] = 3;S[a+3] = c;
	 S[a+4] = nomprog |(fragm << 16);
	 S[a+5] = (tec - A)|(level << 16);
	 S[a+6] = 0x00200104;S[a+7] = 0;
	 S[a+8] = 9;S[a] = a + 40;
     SD[a] = 0; SD[a+1] = 0; SD[a+2] = 0; SD[a+3] = 0;
	 symbol = 0x0020040D;
	 for(b = 9;b < 40;b++)S[a + b] = 0;
	 tec = 0;cadr = a;lcadr = a;
    ind = 1;otvet = 0;peresm = 0;
    level = 0;ist = 1;uroven = 0;
    return;
   }

   char* pp() // poisk puti k tek.fragmentu

   {UINT a,b,c,*d,g,h;
    char f;
    for(a=0;a<40;a++)nn[a]='0';
    d = A;b = d[fragm + 3];
    c = 0;g = ((nomprog+1) << 19) | fragm;
    while((b & 0xFFF80000) != 0)
     {h = (b >> 19) - 1;d = P[h];
      b &= 0x0000FFFF;
      a = b + d[b];f = '1';
      while(d[a] != g)
      {f++;a++;
       if(a >= b+d[b+1])
        {nn[c] = '!';return nn;}
      }
      nn[c] = f;c++;
      g = ((h+1) << 16)|b;b = d[b + 3];
     }
    symbol = 0x00200000 | (b & 0x0000FFFF);
    return nn;
   }

   UINT confrag(UINT *a, UINT *b) // a,b - ukazateli na
                         // nachalo fragmenta programmi v
                         // formate faila programm i na
                         // svob.mesto dlja ego preobrazovanija
                         // v format zoni programm.Vipolnjaet
                         // eto preobrazovanie.Pri udache
                         // vozvrashaet 1, inache 0.Ssilki
                         // iz fragmenta sozdaet kak
                         // smeshenija,bez ukazanija nomera
                         // faila

   {UINT c,f,g,h,s,t,v,j,p,*e;
     c = (a[0] & 0x00003FFF) - 7; // c - chislo ostavshihsja bait teksta
	  f = 2;g = a[1] >> 24;      // f - smeshenie pervoj neispolzovannoj
	  h = 1;             	  // jachejki iz a;g - dlinnij bufer;
	  s = 0;t = 1;v = 8 * c;  // h - kolichestvo bait v bufere g
	  e = b + 4;			  // s - nakopitel - so 2-go bita;t - pervij
							  // svobodnij bit v nakopitele;v - chislo
							  // ostavshihsja bit

	  while(v > 10)        // cicle schitivanija osnovnoj chasti
		{while(t < 21 && c != 0)
		  {s |= ((g & 0x000000FF) << t);t += 8;
			if(h == 1){g = a[f];f++;h = 4;}
			else {h--;g >>= 8;}
		  }

		 if(s & 2)
			{j = (s >> 3) & 0x000001FF;v -= 11;
			 if(s & 4)j |= 0x00100000;
			 s >>= 11;t -= 11;
			}
		 else
        {j = (((s >> 2) & T11) | 0x00200000);
         v -= 20;s >>= 20;t -= 20;
        }
		 *e = j;e++;
	   }
	  b[0] = e - b;
	  c = a[0] & 0x00003FFF; // chislo bait do suffiksa
	  f = ((a[0] >> 16) - c)/3; // chislo ssilok iz fragmenta
	  b[1] = b[0] + f;
	  if(f != 0)
		{g = c/4;h = a[g];t = c%4;if(t > 0)h >>= (8*t);
		 t = 4 - t;  // g - ssilka na tek.jachejku istochnika v R
							// h - bufer;t - chislo bait v bufere

		 while(f != 0)   // cicle formirovanija ssilok iz fragmenta
		  {s = 0; // zagotovka ssilki
		   for(j = 0;j < 24;j += 8)
		    {p = h & 0x000000FF;s |= (p << j);
			  if(t == 1) {g++;h = a[g];t = 4;}
			   else {h >>= 8;t--;}
			 }
         if(s & 0x00800000)s |= 0xFFC00000;
		 else s |= T1;
         *e = s;e++;f--;
        }
      }
    return 1;
   }

   UINT contprog(UINT a) // a - nomer prog.faila (3 x 3 bit)
                        // Predprinimaetsja proverka korrek-
                        // tnosti etogo prog.faila.Pri
                        // obnarugenii oshibok v massive CONTR
                        // perechisljajutsja : tip
                        // oshibki - smeshenie v faile
                        // (libo v U1) mesta,gde oshibka.
                        // Vozvrahaet smeshenie pervoj
                        // svobodnoj jachejki v CONTR.
                        // Tipi oshibok:
                        // 1 - otsutstvie vneshnei ssilki
                        // 2 - bolee odnoj ssilki na
                        //    fragment - togda dve inf.
                        //   jachejki - smeshenie fragmenta
                        //   i chislo ssilok na nego
                        // 3 - fragment ne dekonvertiruem
                        // 4 - bolee 30 ssilok iz
                        //     fragmenta
                        // 5 - bolee 10000 bait v
                        //   fragmente
                        // 6 - vnutri fragmenta okazalasb
                        //  ssilka iz drugogo fragmenta -
                        //  v etom sluchae dalee idut dve
                        //  inf.jachejki - smeshenie fragmenta
                        //  i smeshenie vnutri nego,na kotoroe
                        //  ssilka
                        // 7 - ssilka vne faila;dalee - smeshenie
                        // fragmenta i smeshenie ssilki iz nego
                        // 8 - ssilka na otkluchennij fragment
                        // 9 - nepravilnaja vozvratnaja ssilka
   {UINT b,c,d,g,h,p,q,v,r,s,*t;
    unsigned char *e,*f;
   	r = 0; // smeshenie pervoj svob.jachejki v CONTR
    a <<= 22;a |= T1;
    tekprog(a);
    if(proghndl == INVALID_HANDLE_VALUE)return 0xFFFFFFFF;
	b =  Npointer(proghndl,0,1);
	U1 = (UINT*)calloc(b+4,1);
    Npointer(proghndl,0,0);
	Nread(proghndl,(char*)U1,b);
    U2 = (UINT*)calloc(b+4,1);
    e = (unsigned char*)U1;
    f = (unsigned char*)U2;
    U3 = (UINT*)calloc(2097152,1);
    kthndl = Nopen(pathkat);
	Npointer(kthndl,0,0);
	Nread(kthndl,(char*)U3,2097152);
	Nclose(kthndl);
    for(c = 0;c < 524288;c++) // rasstanovka v U2 chisel
                             // vneshnih ssilok po
                             // nachalam fragmentov
     {d = U3[c];
      if(d != 0 && !((d ^ a) & 0xFFC00000))
      {d &= 0x003FFFFF;f[d] += 1;   //kornevoj fragment
       g = 1;R[1] = d;
       if(!(e[d+1] & 0x40))
       {if(r < 96)
        {CONTR[r] = 9;CONTR[r+1] = d;r += 2;}
       }
    //   e[d+1] |= 0x40;
    //    p = c+1;
    //   e[d+4] = (unsigned char)p;
    //   e[d+5] = (unsigned char)(p >> 8);
    //   e[d+6] = (unsigned char)(p >> 16);
       while(g != 0)
       {h = R[g];g--;
        p = (UINT)e[h] | ((UINT)e[h+1] << 8);
        p &= 0x00003FFF;p += h;
        q = (UINT)e[h+2] | ((UINT)e[h+3] << 8);
        q &= 0x0000FFFF;
        q += h;
        if(p != q)
         {if(90 < q-p) // bolee 30 ssilok - ???
           {if(r < 96)
             {CONTR[r] = 4;CONTR[r+1] = h;r += 2;}
           }
          else          // uchet ssilok
           {while(p < q)
            {s = (UINT)e[p] | ((UINT)e[p+1] << 8) |
                    ((UINT)e[p+2] << 16);
             if(!(s & 0x00800000) && s >= b)
              {if(r < 96)
                {CONTR[r] = 7;CONTR[r+1] = h;
                 CONTR[r+2] = p;r += 3;
                }
              }
             else
              {if(!(s & 0x00800000))
               {if(e[s+1] & 0x80)
                 {if(r < 96)
                   {CONTR[r] = 8;CONTR[r+1] = h;
                    CONTR[r+2] = p;r += 3;
                   }
                 }
                else
                 {g++;R[g] = s;f[s] += 1;
                  if((e[s+1] & 0x40) ||
                     ((UINT)e[s+4] | ((UINT)e[s+5] << 8) |
                      ((UINT)e[s+6] << 16)) != h)
                  {if(r < 96)
                   {CONTR[r] = 9;CONTR[r+1] = s;
                    r += 2;
                   }
                  }
                   ;

              //  e[s+1] &= 0xBF;
              //  e[s+4] = (unsigned char)h;
              //  e[s+5] = (unsigned char)(h >> 8);
              //  e[s+6] = (unsigned char)(h >> 16);
                 }
               }
              }
             p += 3;
            }
           }
         }
       }
      }
     }
    c = 0;v = 0;      // prosmotr chisel ssilok na fragmenti
    while(c < b)
     {if(f[c] == 0 && !(e[c+1] & 0x80))
       {if(r < 96 && v != 0xFFFFFFFF)
        {CONTR[r] = 1;CONTR[r+1] = c;r += 2;}
       }
      else
       {if(f[c] > 1)
         {if(r < 96)
          {CONTR[r] = 2;CONTR[r+1] = c;
           CONTR[r+2] = f[c];r += 3;
          }
         }
       }
      p = ((UINT)e[c] | ((UINT)e[c+1] << 8));
      p &= 0x00003FFF;
      q = ((UINT)e[c+2] | ((UINT)e[c+3] << 8));
      q &= 0x0000FFFF;
      if(90 < q - p && f[c] == 0)
       {if(r < 96)
        {CONTR[r] = 4;CONTR[r+1] = c;r += 2;}
       }
      if(q > 10000)
       {if(r < 96)
        {CONTR[r] = 5;CONTR[r+1] = c;r += 2;}
       }
      for(s = c+1; s < c+q; s++)
        if(f[s] != 0)
         {if(r < 96)
          {CONTR[r] = 6;CONTR[r+1] = c;
           CONTR[r+2] = s;r += 3;
          }
         }
      v = c;c += q;
     }
    c = 0;  // prosmotr fragmentov i dekonvertirovanie
	while(c < b)
     {if(!(e[c] & 0x80))
       {t = (UINT*)(e + c);
        CC = c;
		confrag(t,U2);
        s = dekonvert(U2);
        if(s == 0)
         {if(r < 96)
           {CONTR[r] = 3;CONTR[r+1] = c;r += 2;}
         }
       }
      q = ((UINT)e[c+2] | ((UINT)e[c+3] << 8));
      q &= 0x0000FFFF;
      c += q;
     }
    free(U1);
    free(U2);
    free(U3);
    return r;
   }

   UINT continf(UINT a,UINT b) // a - nomer inf.bloka;
                               // b - nomer ego faila.
                               // Vipolnjaet kontrol korrek-
                               // tnosti dannogo faila.Infor-
                               // macia ob oshibkah sohranjaetsja
                               // v massive CONTR.Tipi oshibok:
                               // 1 - net ssilki na ob'ekt;
                               // 2 - chislo ssilok na ob'ekt ne
                               //    ravno chislu zacreplenij.
                               // 3 - ssilka ne na nachalo
                               //    ob'ekta

   {UINT c,d,g,h,p,q,r,s,v,*m,n,i;
    unsigned char *e,*f;
    if(nominf != a)
     {if(infhndl != 0){Nclose(infhndl);infhndl = 0;}
	   nominf = a;
     }
     r = 0; // smeshenie pervoj svob.jachejki v CONTR
    if(a != 1 && a != 4)
     {crfail = 0;tekfail(T1);
      crfail = 1;
      U1 = (UINT*)calloc(2097152,1);
      Npointer(infhndl,0,0);
	  Nread(infhndl,(char*)U1,2097152);
     }
    b <<= 22;b |= T1;
    crfail = 0;tekfail(b);crfail = 1;
    if(infhndl == 0)return 0xFFFFFFFF;
    c =  Npointer(infhndl,0,1);
    U2 = (UINT*)calloc(c,1);
    Npointer(infhndl,0,0);
    Nread(infhndl,(char*)U2,c);
    U3 = (UINT*)calloc(c,1);
    e = (unsigned char*)U2;
    f = (unsigned char*)U3;
    for(d = 0;d < 524288;d++) // rasstanovka v U3 chisel
                             // vneshnih ssilok po
                             // nachalam fragmentov
    {g = ((a == 1 || a == 4) ?
          (d == 0 ? (b | 0x3) : 0) : U1[d]);
	 if(d == 0x16a)
	  {ttt = 1;}
     if(g != 0 && !((g ^ b) & 0xFFC00000))
      {g &= 0x003FFFFF;
       if(e[g-1] | e[g-2] | e[g-3])
        {if(r < 96)
         {CONTR[r] = 3;CONTR[r+1] = g;r += 2;}
        }
       else
       {f[g] += 1;   //kornevoj fragment
        v = 1;F[1] = g;
        while(v != 0)
        {h = F[v];v--;
         if(e[h+3] & 0x40)
          {p = (UINT)e[h+4] | ((UINT)e[h+5] << 8) |
            ((UINT)e[h+6] << 16);
           if(p != 0)
            {if(e[p-1] | e[p-2] | e[p-3])
              {if(r < 96)
               {CONTR[r] = 3;CONTR[r+1] = p;r += 2;}
              }
             else
              {v++;F[v] = p;f[p] += 1;}
            }
          }
         else
          {if(!(e[h+3] & 0x80))
           {m = R;e += h;R = (UINT*)e;
            p = (R[0] >> 16) & 0x00000FFF;
            q = 4;
            while(q != 0 && p != 0)
            {s = tekstmetki(q+2,0);
             n = (UINT)e[q] | ((UINT)e[q+1] << 8);
             n += (q + 2);
             while(s < n)
              {v++;i = (UINT)e[s] | ((UINT)e[s+1] << 8) |
                ((UINT)e[s+2] << 16);e -= h;
               if(e[i-1] | e[i-2] | e[i-3])
                {if(r < 96)
                 {CONTR[r] = 3;CONTR[r+1] = i;r += 2;}
                }
               else
                {F[v] = i;f[i] += 1;}
               s += 3;e += h;
              }
             q = sledmetka(p,q);
            }
            e -= h;R = m;
           }
          }
        }
		 }
      }
    }
    d = 3;      // prosmotr chisel ssilok na fragmenti
     while(d < c)
     {if(f[d] == 0 && !(e[d+3] & 0x40))
      // {if(e[d-1] == 0 && e[d-2] == 0 && e[d-3] == 0)
      //  e[d+3] |= 0x40;
      // }
       {if(r < 96)
        {CONTR[r] = 1;CONTR[r+1] = d;r += 2;}
       }
      else
       {if((f[d] > 1 && (!(e[d+3] & 0x80) ||
          (f[d] != e[d+2] && !(e[d+3] & 0x40))))
           || (f[d] == 1 && (e[d+3] & 0x80)
               && e[d+2] != 1)
           || ((e[d+3] & 0x80) && e[d+3] & 0xF)
          )
        {if(r < 96)
          {CONTR[r] = 2;CONTR[r+1] = d;
           CONTR[r+2] = f[d];r += 3;
          }
        }
       }
      d += (((UINT)e[d] | ((UINT)e[d+1] << 8)) + 3);
     }
    // _llseek(infhndl,0,FILE_BEGIN);
	 // Nwrite(infhndl,(char*)U2,c);
    if(a != 1 && a != 4)
     {free(U1);
     }
    free(U2);
    free(U3);
    return r;
   }

   char rusfont(unsigned char a) // konvertor russkih bukv

   {if(0x80 <= a && a <= 0xaf)a += 0x40;
    else
     {if(0xe0 <= a && a <= 0xef)a += 0x10;}
    return (char)a;
   }

   UINT convchisl(UINT a) // a - des.chislo v formate LOSa.
                          // Vozvrashaet
                          // ego znachenie v formate UINT.
   {UINT b;
    if(a & T6)
     {return(a - L0);}
    else
     {b = 0; a += 2;
      while(!(Z[a] & T1))
       {b *= 10; b += (Z[a] - L0);
        a += 2;
       }
      return b;
     }
   }

   UINT los64(UINT64 a)// vozvrashaet ssilku na
                        // predstavlenie chisla a (UINT64) v formate LOSa.

   {UINT b,*c;
    c= st;
    if(a == 0)
     b = L0;
    else
     {while(a != 0)
       {*st = (a%10)+L0; a /= 10; st++;}
      if(st == c+1)
       {st = c; b = *st;
       }
      else
       b = text2(c);

     }
    return b;
   }

   int intchisl(UINT a) //  a - des.chislo v formate LOSa.
                        // Vozvrashaet
                        // ego znachenie v formate INT.
   {int b; UINT c,d;
    if(a & T6)
     {a -= L0; b = (int)a; return(b);
     }
    else
     {b = 0; a += 2;
      c = 0;
      if(Z[a] == L8)
       {c = 1; a += 2;
       }
      while(!(Z[a] & T1))
       {b *= 10; d = (Z[a] - L0); b += (int)d;
        a += 2;
       }
      if(c == 1) b = -b;
      return b;
     }
   }

   UINT kodpodobija (UINT a) // a - smeshenie v zone zadach
                             // nachala terma. Vozvrashaet
                             // summu kodov log. simvolov
                             // i peremennih v etom terme;
                             // kod peremennoj - 1.
   {UINT b,c;
     b = 0;
     a += 2;
     while(!(Z[a] & T1))
      {c = Z[a];
       if(c & 0x00200000)
        b += c;
       else b += 1;
       a += 2;
      }
     return b;
   }


   UINT dlinazoni (UINT a, UINT b) // a - smeshenie
                           // v zone zadach
                           // jachejki, otnosjashejsja k
                           // nekotoromu tekstu. Esli b=1,
                           // to vtoroj bit vtorogo slova
                           // prefiksa vseh dostigimih iz
                           // ukazannogo teksta tekstov zoni
                           // zadach izmenjaetsja na 1,i
                           // vozvrashaetsja summarnaja
                           // dlina takih tekstov (krome
                           // teh, u kotorih rassmatrivaemij
                           // bit uge bil raven 1). Esli
                           // b=0, to vse vvedennie pri b=1
                           // vspomogatelnie edinici
                           // zamenjajutsja nuljami.

   {UINT c,d,e,f;
     f = 0;b = (b == 0 ? 0 : 0x40000000);
     while(!(Z[a+1] & T1))a -= 2;
	  if((Z[a+1] & 0x40000000) == b)return f;
     Z[a+1] ^= 0x40000000;
     f += Z[a];
	  if(Z[a+3] != 0)return f;
	  c = 1;F[1] = a + 2;
	  do{d = F[c];
        while(e = Z[d],Z[d] != T1)
         {d += 2;
          if(!(e & T6) && e != 0)
           {while(!(Z[e+1] & T1)) e -= 2;
            if((Z[e+1] & 0x40000000) != b)
             {Z[e+1] ^= 0x40000000;
              f += Z[e];
			     if(Z[e+3] == 0)
               {F[c] = d;
                c++;F[c] = e + 2;c++;
                break;
               }
             }
           }
         }
        c--;
		 }
	  while (c != 0);
     return f;
	}

   UINT smslovo(UINT a,UINT c)
                  // a - nomer pozicii v bufere tekstov;
                  // c - nomer razrjada,do kotorogo vkljuchitelno
                  // proishodit sravnenie slov.Pered
                  // obrasheniem v B1,B2 zanosjatsja
                  // smeshenija v nignej chasti SL
                  // nachala i conca otrezka poiska.
                  // Predprinimaetsja poisk na etom
                  // otrezke log.simvola,slovo kotorogo
                  // javljaetsja nachalom teksta,raspo-
                  // logennogo v bufere tekstov nachinaja
                  // s a. V sluchae neudachi vozvrashaet 0,
                  // inache - naidennij log.simvol S. Pri
                  // etom B1,B2 ukazivajut na novie granici
                  // otrezka poiska (B1 > B2 - pustoj
                  // otrezok);B3:= nignjaja granica prodol-
                  // genija libo 0;B4:= nomer razrjada,do
                  // kotorogo pri prodolgenii proishodit
                  // sravnenie slov;B5:= smeshenie v bufere
                  // tekstov posle schitannogo slova.
   {UINT d,f,g,i,j,m;
    unsigned char *b,p,q;
    b = (unsigned char*)SL;
	B3 = 0; B4 = 24;
    while (B1 <= B2 && B2 < 524288)
	  {d = ((B1 + B2)>> 1);
	   f = SL[d];
	   if(f == 0)
        {if(B2 == d)return 0;
         else B2 = d;
        }
	   else
		{g = (f - 1)*24;g += 2097152;
		 j = 0; // j - indikator zavershenija sravnenija
		 i = a; m = 1;
		 while(j == 0)
		 {p = (unsigned char)B[i];q = b[g];
		  if((p == 0 || p == 0x20) && (q != 0))
			{B2 = d - 1;j = 1;}
		  else
			{if(q == 0)
              {B1 = d + 1;
               if((B3 == 0 || B4 < m) && d != 0)
                {B3 = d - 1; B4 = m;}
               B5 = i;
               f |= 0x00200000;
               return f;
              }
			else
			 {if(p < q){B2 = d - 1;j = 1;}
			  else
				{if(p > q)
                  {B1 = d + 1;
                   if((B3 == 0 || B4 < m-1) && d != 0)
                    {B3 = d - 1; B4 = m-1;}
                   j = 1;
                  }
				else
				 {if(m == 24)
				   {B1 = d + 1;
                    if((B3 == 0 || B4 < m) && d != 0)
                     {B3 = d - 1; B4 = m;}
                    B5 = i+1;
                    f |= 0x00200000;
                    return f;
                   }
				  else
                    {if(m == c)
                      {if(b[g+1] == 0)
                        {B1 = d + 1;
                         if((B3 == 0 || B4 < m) && d != 0)
                          {B3 = d - 1; B4 = m;}
                           B5 = i+1;
                           f |= 0x00200000;
                           return f;
                          }
                         else
                          {B2 = d - 1;j=1;}
                      }
                     else
                      {i++;g++;m++;}
                    }
				  }
				}
			 }
			}
		 }
		}
	  }
     return 0;
   }

   UINT sledslovo(UINT a)
                  // a - nomer pozicii v bufere tekstov;
                  // Pered
                  // obrasheniem v B1,B2 zanosjatsja
                  // smeshenija v nignej chasti SL
                  // nachala i conca otrezka poiska;
                  // v B7 - nomer razrjada,do kotorogo
                  // vkljuchitelno proishodit sravnenie
                  // slov;
                  // v B3 - nignjaja granica prodolgenija
                  // libo 0. Nachinaja s dannoj ustanovki,
                  // vo vneshnem slovare predprinimaetsja
                  // poisk log.simvola,slovo kotorogo
                  // javljaetsja nachalom teksta,raspo-
                  // logennogo v bufere tekstov nachinaja
                  // s a. V sluchae neudachi vozvrashaet 0,
                  // inache - naidennij log.simvol S. Pri
                  // etom B1,B2 ukazivajut na novie granici
                  // otrezka poiska (B1 > B2 - pustoj
                  // otrezok); B7 - chislo sravnivaemih
                  // razrjadov dlja B1-B2;
                  // B3:= nignjaja granica prodol-
                  // genija libo 0;B4:= nomer razrjada,do
                  // kotorogo pri prodolgenii proishodit
                  // sravnenie slov;B5:= smeshenie v bufere
                  // tekstov posle schitannogo slova;
   {UINT g;
    g = 0; B8 = B3; B9 = B4;
    while(g == 0 && B3 != 0)
     {g = smslovo(a,B7);
	  if((B8 != 1) && B3 < B8)B3 = B8;
	  if((B8 != 1) && B4 < B9)B4 = B9;
      B8 = 0; B9 = 0;
      if(g == 0 && B3 != 0)
	   {B7 = B4; B1 = 0; B2 = B3;}
     }
    if(g != 0)
     {return g;}
    return 0;
   }

   UINT kluchslova(UINT a,UINT b)
                  // a,b - nachalo i konec v bufere
                  // tekstov kluchevoj posledovatelnosti K;
                  // Vozvrashaet smeshenie v SL,
                  // po kotoromu nahoditsja log.simvol,
                  // oboznachajushij pervoe slovo s zadannim
                  // nachalom K.Esli takih slov net,vozvra-
                  // shaet 0xFFFFFFFF.
   {UINT f,g,h,j,r,m;
    unsigned char *e,p,q;
    e = (unsigned char*)SL;
    f = 0;g = 524287; // f,g - granici promegutka
	 while (f <= g && g < 524288)
	  {h = ((f + g)>> 1);
	   r = SL[h];
	   if(r == 0)
        {if(g == h)return 0xFFFFFFFF;
         else g = h;
        }
	   else
		{m = (r - 1)*24;m += 2097152;
		 for(j = a;j <= b;j++)
		 {p = (unsigned char)B[j];q = e[m];
		  if(q == 0){f = h + 1;break;}
		  else
			{if(p < q){g = h - 1;break;}
			 else
			  {if(p > q){f = h + 1;break;}
				else
				 {if(j == b)
				   {if(h == g)return h;
                else
                {g = h;break;}
               }
              m++;
             }
           }
         }
       }
      }
     }
    return 0xFFFFFFFF;
   }

   UINT shagslova(void) // Bufer "teksl" hranit ishodnoe
                        // smeshenie vnesh.slovarja.
					    // Esli ono sootvetstvuet log. simvolu,
						// to vozvrashaet etot simvol i uvelichivaet
						// teksl na 1, inache vozvrashaet 0.

   {UINT b,r;
    b = 0; // nakopitel rezult.log.simv.
    if(teksl < 524288)
    r = SL[teksl];
    if(r == 0)return 0;
	else
	 {teksl++; r |= 0x00200000;
	  return r;
	 }
   }


 UINT loschisl(UINT a) // vozvrashaet ssilku na
    //predstavlenie chisla a (UINT) v formate LOSa.

 {UINT b,*c;
  c = st;
  if(a == 0)b = L0;
  else
	{while(a != 0)
	  {*st = (a % 10) + L0;
	    a /= 10; st++;}
	    if(st == c+1)
	     {st = c; b = *st;}
	    else b = text2(c);
      }
  return b;
 }

 UINT losint(INT a) // vozvrashaet ssilku na
    //predstavlenie chisla a (INT) v formate LOSa.

 {UINT b,*c,d,e;
  c = st;
  if(a == 0)b = L0;
  else
	{e = 0;
    if(a < 0)
     {e = 1; a = -a;}
    d = (UINT)a;
    while(d != 0)
	  {*st = (d % 10) + L0; d /= 10; st++;}
    if(e == 1){*st = L8; st++;}
	 if(st == c+1)
	  {st = c; b = *st;}
	 else b = text2(c);
   }
  return b;
 }

 double losplav(UINT b) // b - chislo v formate LOSa.
        // Perevodit v format "s plav. zapjatoj".

 {UINT c,n;
  double d;

  if(b & 0x00200000)
   {c = b - 0x00200104;
    chislo[0] = (char)c + '0';
    chislo[1] = 0;
   }
  else
   {b += 2;n = 0;
    while(!(Z[b]& T1))
     {c = Z[b];
      if(c == 0x002000D2)
       chislo[n]= '-';
      else
       {if(c == 0x00200194)
         chislo[n] = '.';
        else
         {c -= 0x00200104;
          chislo[n] = (char)c + '0';
         }
       }
      n++; b+= 2;
     }
    chislo[n] = 0;
   }
  d = atof(chislo);
  return d;
 }

 UINT doublos(double d) // perevodit d v vichisl format LOSa.
 {UINT *e,f;
  e = (UINT*)&d;
  f = mem(8);
  Z[f+2] = 0x40200001;
  Z[f+3] = *e;
  Z[f+4] = 0x40200001;
  Z[f+5] = *(e+1);
  return f;
 }

 UINT intlos(int a) // perevodit a v vichisl format LOSa.
 {UINT b,c;
  b = (UINT)a;
  c = mem(6);
  Z[c+2] = 0x60200001;
  Z[c+3] = b;
  return c;
 }

 UINT element(UINT* a, UINT b) // esli b steke viragenij nachinaja
                               // s jachejki "a" vstrechaetsja ob'ekt b,
                               // to vozvrashaet 1, inache 0.
 {UINT c,d;
  while(a < st)
   {c = *a;
    d = sravn(c,b);
    if(d == 1)
     return 1;
    a++;
   }
  return 0;
 }

 UINT kopijamatr(UINT a) // a - nabor naborov.
                         // V zone zadach sozdaetsja kopija
                         // etogo nabora, zapolnennaja kopijami
                         // ego elementov.
 {UINT *b,c,d,e,f;
  b = st;
  c = a+2;
  while(!(Z[c] & 0x80000000))
   {d = Z[c];
    *st = c; st++;
    f = Z[d];
    e = mem(f);
    c = *(st-1);
    *(st-1) = e;
    d = Z[c];
    f = d + Z[d];
    c += 2;
    while(d < f)
     {Z[e] = Z[d];
      e++; d++;
     }
   }
  d = text1(b);
  return d;
 }


 UINT plavlos(double d) // d - chislo v formate "s plav.
  // zapjatoj". Perevodit v LOS-nabor dlini 2 dlja
  // operatora "vich(vihod...).

 {UINT *e,c,n,p;
  char q;

  _gcvt(d,15,chislo);
  e = st; n=0;
  while(chislo[n] != 0 && chislo[n] != 'e')
   {q = chislo[n];
    if(q == '-')
     {*st = 0x002000D2; st++;}
    else
     {if(q == '.')
       {if(chislo[n+1] != 0 && chislo[n+1] != 'e')
	      {*st = 0x00200194; st++;}
	   }
      else
       {q -= '0';
        c = (UINT)q;
        *st = 0x00200104 + c;
        st++;
       }
     }
    n++;
   }
  if(e == st)*e = 0x00200104;
  else
   {if(e != st-1)
     {c = text1(e);
      if(ind == 4)return 0;
      *e = c;
     }
   }
  e++;st = e;
  if(chislo[n] == 'e')
   {n++; p = 0;
    if(chislo[n] == '-')
     {*st = 0x002000D2; st++;}
    n++;
	while(chislo[n] == '0')
	 {n++;}
    while(chislo[n] != 0)
	 {q = chislo[n] - '0';
      c = (UINT)q;
      *st = 0x00200104 + c;
	  p = 1;
	  n++;
      st++;
     };
    if(p == 1)
     {c = text1(e);
      if(ind == 4)return 0;
      *e = c;
      st++;
     }
	else
	{*e = 0x00200104; st = (e+1);
	}
   }
  else
   {*e = 0x00200104;st++;}
  e--;
  c = text1(e);
  return c;
 }

 UINT plavdes(double a) // perevodit chislo double
                        // v desjatichnij format LOSa
 {UINT *e,c,n,i,j,m,p,p1;
  int k,r;
  char q;
  e = st;
  k = 0; // porjadok
  p = 0; // indikator prohogdenija nachalnih nulej mantissi
  p1 = 0; // indikator prohogdenija zapjatoj
  _gcvt(a,15,chislo);
  i = 0; n=0;
  while(chislo[n] != 0 && chislo[n] != 'e')
   {q = chislo[n];
    if(q == '-')
     {*st = 0x002000D2; st++;} // znak minus
    else
     {if(q == '.')
       {p1 = 1;
       }
	  else
       {q -= '0';
        c = (UINT)q;
        if(p != 0 || c != 0)
         {p = 1;
          R[i] = 0x00200104 + c;  // v R nakaplivajutsja cifri nachinaja c nenulevoj
          i++;
          if(p1 = 1)
           {k--;
           }
         }
       }
     }
    n++;
   }
  if(i == 0)
   {return 0x00200104;}
  m = 0; // znak porjadka (bez ucheta k)
  r = 0; // modul porajdka (bez ucheta k)
  if(chislo[n] == 'e')
   {n++;
    if(chislo[n] == '-')
     {m = 1;}
    n++;
	while(chislo[n] == '0')
	 {n++;}
    while(chislo[n] != 0)
	 {q = chislo[n] - '0';
      c = (int)q;
      r = (10*r) + c;
	  n++;
     }
   }
  if(m == 1)
   {r = -r;}
  k += r; // istinnij porjadok
  if(k < 0)
   {k = (-k);
    *st = 0x00200104; st++;
    if(k >= i)
     {*st = 0x00200194; st++;
       while(k > i)
        {k--;
         *st = 0x00200104; st++;
        }
       for(j = 0; j < i; j++)
        {*st = R[j]; st++;
        }
       m = text1(e);
     }
    else
     {k = i - k;
      for(j = 0; j < i; j++)
       {*st = R[j]; st++;
        if(j == k)
         {*st = 0x00200194; st++;}
       }
      m = text1(e);
     }
   }
  else
   {for(j = 0; j < i; j++)
     {*st = R[j]; st++;
     }
    while(k != 0)
     {*st = 0x00200104; *st++;
      k--;
     }
    m = text1(e);
   }
  return m;
 }


 void slovin(UINT a) // a - libo 0, libo 1. V pervom sluchae proishodit
	                 // zagruzka iz fajla massiva V, vo vtorom - SL.
 {UINT *b,c,d,i,j;
  char *e;
  if(a == 0)
   {e = pathvoc; b = V;}
  else
   {e = pathslv; b = SL;}
  slvhndl = Nopen(e);
  c = Npointer(slvhndl,0,1);
  Npointer(slvhndl,0,0);
  j =  Nread(slvhndl, (char*)b,c);
  Nclose(slvhndl);
  d = b[0];
  for(i=0; i<d-1; i++)
   b[i] = b[i+1];
   b[i] = 0;
   c >>= 2;
  j = (524287 - d) + c;
  for(i = c-1; i>= d;i--,j--)
   b[j] = b[i];
  for(i=d; i<524288; i++)
   b[i] = 0;
  return;
 }

 void slovout(char* a, UINT* b) // a - put k fajlu slovarja libo
	                            // vneshnego slovarja; b - obnulennij
								// massiv V libo SL.
								// Etot massiv zapisivaetsja v fajl.
 {UINT c,d,i,j;
  i = 3670010;
  while(b[i] == 0)
   {i -= 6;}
  i += 6;
  c = (i << 2);
  U1 = (UINT*)calloc(c,1);
  for(j=0,c=1; j<524288; j++,c++)
   {d=b[j];
    if(d == 0)break;
	U1[c] = d;
   }
  U1[0] = c;
  for(j = 524288; j<i; j++,c++)
   {U1[c] = b[j];}
  c *= 4;
  slvhndl = Ncreat(a);
  Nwrite(slvhndl,(char*)U1,c);
  Nclose(slvhndl);
  free(U1);
  return;
 }


void pereklput(UINT a, UINT b, UINT c) // pereustanavlivaet put
                     // altpath s nomerom c : pri a = 1 (LOS) - na komputer 'L', pri
					 // a = 2 (LOS) - na komputer 'M', pri a = 0 (LOS) -
					 // k ishodnomu vidu. b - nomer poddirektorii EXi libo
					 // v sluchae 0 - ukazatel na osnovnuju direktoriju.
{char *d,e;
 UINT i,j;
 b -= 0x00200104;
 d = altpath[c];
 i = 0;
 while(d[i] != '.')
  {i++;}
 i -= 9;
 for(j = 0; j < 13; i++,j++)
  {bufr[j] = d[i];}
 if(a == 0x00200104)
  {d[0] = '\\';
   d[1] = 'a'; d[2] = 'l'; d[3] = 't';
   j = 4;
   for(i=0; i < 13; i++,j++)
    {d[j] = bufr[i];}
   d[j] = 0;
   sdvigpath(d);
  }
 else
  {d[0] = '\\';
   d[1] = '\\';
   d[2] = (a == 0x00200105 ? 'L' : 'M');
   d[3] = '\\'; d[4] = 'l'; d[5] = 'o'; d[6] = 'g';
   d[7] = 's'; d[8] = 'y'; d[9] = 's'; d[10] = 't';
   j = 11;
   if(b != 0)
    {d[11] = '\\'; d[12] = 'E';
     d[13] = 'X';
	 e = '0';
	 if(b >= 10)
	  {e = 'a';
	   b -= 10;
	  }
	 e += (char)b;
     d[14] = e;
	 j = 15;
    }
   for(i=0; i < 13; i++,j++)
    {d[j] = bufr[i];}
   d[j] = 0;
  }
 return;
}

UINT polncopy(UINT a) // kopiruet vse derevo nabora a

{UINT b,*c,d;

 if(!(a & T6) && (Z[a+1] & T1) && !(Z[a+2] & 0x40000000))
  {if(Z[a+3] == 0 || Z[a] == 6)
    {c = st;
     for(b = a+2; !(Z[b] & T1); b += 2)
      {d = Z[b];
       d = polncopy(d);
       *st = d; st++;
      }
     d = text1(c);
     return d;
    }

  }
 else return a;
}

 void otmv(UINT a, UINT b)// realizuet operator LOSa 'otmv'.
                          // a - graf libo orgraf, b - nabor ukazatelej
                          // tipov otmetok

 {UINT c,e,g,h,i,p;
  a += 2;
  *st = a;
  st++;
  c = Z[b] + 2; // dlina novoj otmetki
  b += 2;
  *st = b;
  st++;
  while(!(Z[a] & T1))
   {g = Z[a]; // tek. vershina
    g += 2; // vhogdenie otmetki
    *st = g; st++;
    e = mem(c);
    h = *(st-2); // nachalo prosmotra nabora 'b'
    i = e+2;
    while(!(Z[h] & T1))
     {if(Z[h] == 0x00200104)
       {Z[i] = 0x0020045B;
       }
      else
       if(Z[h] == 0x00200105)
        {p = intlos(0);
         Z[i] = p;
        }
       else
        if(Z[h] == 0x00200106)
         {p = doublos(0);
          Z[i] = p;
         }
        else
         {Z[i] = 0x00200104;
         }
      Z[i+1] = 0;
      i += 2; h += 2;
     }
    g = *(st-1);
    st--;
    Z[i] = Z[g];
    Z[i+1] = 0;
    Z[g] = e;
    a = *(st-2);
    a += 2;
    *(st-2) = a;
   }
  st -= 2;
  return;
 }

 void ishv(UINT a)// realizuet operator LOSa 'ishvotmv'.
                          // a - graf libo orgraf.

 {UINT g,h,p;
  a += 2;
  while(!(Z[a] & T1))
   {g = Z[a]; // tek. vershina
    g += 2; // vhogdenie otmetki
    h = Z[g];
    p = h + Z[h];
    p -= 4;
    Z[g] = Z[p];
    a += 2;
   }
  return;
 }

 void otmr(UINT a, UINT b)// realizuet operator LOSa 'otmr'.
                          // a - graf libo orgraf, b - nabor ukazatelej
                          // tipov otmetok

 {UINT c,d,e,p,i,j,h,h1,h2;
  a += 2;
  *st = a;
  st++;
  c = Z[b] + 2; // dlina novoj otmetki
  b += 2;
  *st = b;
  st++;
  while(!(Z[a] & T1))
   {d = Z[a]; // vershina
    h = Z[d + 6];// spisok reber vershini
    if(h != 0x00200119)
    {for(j = h+2; !(Z[j] & T1); j += 2)
     {h1 = Z[j]-2; // rebro
      if(Z[d] == 14 || Z[h1 + 4] == d)
       {h1 += 2; // vhogdenie otmetki
        *st = h1; st++;
        e = mem(c);
        h2 = *(st-2); // nachalo prosmotra nabora 'b'
        i = e+2;
        while(!(Z[h2] & T1))
         {if(Z[h2] == 0x00200104)
           {Z[i] = 0x0020045B;
           }
          else
          if(Z[h2] == 0x00200105)
           {p = intlos(0);
            Z[i] = p;
           }
          else
          if(Z[h2] == 0x00200106)
           {p = doublos(0);
            Z[i] = p;
           }
          else
           {Z[i] = 0x00200104;
           }
          Z[i+1] = 0;
          i += 2; h2 += 2;
         }
        h1 = *(st-1);
        st--;
        Z[i] = Z[h1];
        Z[i+1] = 0;
        Z[h1] = e;
       }
     }
    }
    a = *(st-2);
    a += 2;
    *(st-2) = a;
   }
  st -= 2;
  return;
 }

 void ishr(UINT a)// realizuet operator LOSa 'ishr'.
                  // a - graf libo orgraf.

 {UINT d,j,h,h1,h2;
  a += 2;
  while(!(Z[a] & T1))
   {d = Z[a]; // vershina
    h = Z[d + 6];// spisok reber vershini
    if(h != 0x00200119)
    {for(j = h+2; !(Z[j] & T1); j += 2)
     {h1 = Z[j]-2; // rebro
      if(Z[d] == 14 || Z[h1 + 4] == d)
       {h1 += 2; // vhogdenie otmetki
        h2 = Z[h1];
        h2 += Z[h2];
        h2 -= 4;
        Z[h1] = Z[h2];
       }
     }
    }
    a += 2;
   }
  return;
 }

 UINT novrebro(UINT a, UINT b, UINT c, UINT d)
    // a - graf libo orgraf; b,c - ego vershini.
    // Ot b k c provoditsja rebro s otmetkoj d.
    // Vozvrashaet eto rebro. Esli rebro s takoj
    // otmetkoj uge imelos, vozvrashaet 0.
 {UINT e,f,g,p1,p2,q;
  p1 = Z[b+4]; p2 = Z[b+6]; // spiski vershin i reber, vihodjashih
                            // iz vershini b;
  if(p1 != 0x00200119)
   {p1 += 2; p2 += 2;
    while(!(Z[p1] & T1))
    {q = Z[p1]-2;
     if(q == c)
      {q = Z[p2];
       q = Z[q];
       e = sravn(d,q);
       if(e == 1)
        {return 0;
        }
      }
     p1 += 2; p2 += 2;
    }
   }
  f = mem(10);
  Z[f+2] = d;
  Z[f+3] = 0;
  Z[f+4] = b;
  Z[f+5] = 0;
  Z[f+6] = c;
  Z[f+7] = 0;
  g = Z[b+4];
  g = sffx(g,c+2);
  Z[b+4] = g;
  g = Z[b+6];
  g = sffx(g,f+2);
  Z[b+6] = g;
  if(Z[b-2]== 10)
   {g = Z[c+4];
    g = sffx(g,b+2);
    Z[c+4] = g;
    g = Z[c+6];
    g = sffx(g,f+2);
    Z[c+6] = g;
   }
  else
   {g = Z[c+8];
    g = sffx(g,b+2);
    Z[c+8] = g;
    g = Z[c+10];
    g = sffx(g,f+2);
    Z[c+10] = g;
   }
  return f;
 }

 void chislv(UINT a, UINT b, UINT c) // a - graf libo orgraf
                                     // b - log.simv 0 ili nomer elementa nabora
                                     // c - ukazatel preobrazovanija etogo elementa
                                     // v drugoj format chisel: 0 - des.chislo v celoe;
                                     // 1 - obratno; 2 - des.chislo v plav.zapatuju; 3 - obratno
                                     // b,c - simvoli LOSa. Preobrazujutsja otmetki vershin grafa a.
 {UINT g,h;
  int p;
  double q;
  a += 2;
  b -= 0x00200104;
  b <<= 1;
  while(!(Z[a] & T1))
   {g = Z[a]; // tek. vershina
    g += 2; // vhogdenie otmetki
    if(b != 0)
     {g = Z[g];
      g += b;
     }
    h = Z[g];
    if(c == 0x00200104)
     {p = intchisl(h);
      h = intlos(p);
      Z[g] = h;
     }
    else
     {if(c == 0x00200105)
       {p = chisli(h);
        h = losint(p);
        Z[g] = h;
       }
      else
       {if(c == 0x00200106)
         {q = losplav(h);
          h = doublos(q);
          Z[g] = h;
         }
        else
         {q = chisld(h);
          h = plavdes(q);
          Z[g] = h;
         }
       }
     }

    a += 2;
   }
  return;
 }

  void chislr(UINT a, UINT b, UINT c) // a - graf libo orgraf
                                     // b - log.simv 0 ili nomer elementa nabora
                                     // c - ukazatel preobrazovanija etogo elementa
                                     // v drugoj format chisel: 0 - des.chislo v celoe;
                                     // 1 - obratno; 2 - des.chislo v plav.zapatuju; 3 - obratno
                                     // b,c - simvoli LOSa. Preobrazujutsja otmetki reber grafa a.
 {UINT d,h,h1,h2,j;
  int p;
  double q;
  a += 2;
  b -= 0x00200104;
  b <<= 1;
  while(!(Z[a] & T1))
   {d = Z[a]; // vershina
    h = Z[d + 6];// spisok reber vershini
    for(j = h+2; !(Z[j] & T1); j += 2)
     {h1 = Z[j]-2; // rebro
      if(Z[d] == 14 || Z[h1 + 4] == d)
       {h1 += 2; // vhogdenie otmetki
        if(b != 0)
         {h1 = Z[h1];
          h1 += b;
         }
        h2= Z[h1];
       if(c == 0x00200104)
        {p = intchisl(h2);
         h2 = intlos(p);
         Z[h1] = h2;
        }
       else
        {if(c == 0x00200105)
          {p = chisli(h2);
           h2 = losint(p);
           Z[h1] = h2;
          }
         else
          {if(c == 0x00200106)
            {q = losplav(h2);
             h2 = doublos(q);
             Z[h1] = h2;
            }
           else
            {q = chisld(h2);
             h2 = plavdes(q);
             Z[h1] = h2;
            }
          }
        }
      }
     }
    a += 2;
   }
 }

 UINT grcopy(UINT a, int b, int c)// sozdaet kopiju grafa
                  // s pometkami 'neopred'; b i c -
                  // - ih kolichestva
 {UINT d,*e,*e1,*e2,f,g,g1,h,h1,i,i1,j,j1,k,k1,p1,p2,p3,p4;
  e = st;
  g = a;
  g += 2;
  p1 = (UINT)b;
  p1 *= 2;
  p2 = (UINT)c;
  p2 *= 2;
  while(!(Z[g] & T1))
   {d = Z[g];
    f = mem(Z[d]);
    d += 2;
    for(i = f+2; !(Z[d]& T1); i++)
     {Z[i] = Z[d]; d++;}
    *st = f; st++;
    g += 2;
   }
  f = text1(e);
  e1 = st; // zakrepili kopiju grafa
  *st = f; st++;
  for(i = a+2, j = f+2; !(Z[i] & T1); i += 2, j += 2)
   {g = Z[i];
    Z[g+2] = Z[j] + 2;
   }
  for(i = a+2; !(Z[i]& T1); i += 2)
  {g1 = Z[i];
   h = Z[g1 + 6];// spisok reber vershini
   for(j = h+2; !(Z[j] & T1); j += 2)
    {h1 = Z[j]-2;
     if(Z[g1] == 14 || Z[h1 + 4] == g1)
      {e = st; // nachalo formirovanija novogo rebra
       e2 = st;
       *st = Z[h1+2]; st++;
       g = mem(p2+6);
       for(i1 = 0,j1 = g+2; i1 < p2; i1 += 2, j1 += 2)
        {Z[j1] = 0x0020045B;
        }
       Z[j1] = h1;
       *st = g; st++;
       g = text1(e2);
       *st = g; st++;
       g = Z[h1+4];
       g = Z[g+2]; g -= 2;
       *st = g; st++;
       g = Z[h1+6];
       g = Z[g+2]; g -= 2;
       *st = g; st++;
       g = text1(e); // novoe rebro
       Z[h1+2] = g+2;
      }
    }
  }
 for(i = f+2; !(Z[i]& T1); i += 2)
  {g = Z[i];
   for(j = g+4; !(Z[j] & T1); j += 2)
    {h = Z[j];
     e = st;
     for(k = h+2; !(Z[k] & T1); k += 2)
      {h1 = Z[k];
       *st = Z[h1];
       st++;
      }
     h1 = text1(e);
     Z[j] = h1;
    }
  }
 for(i = a+2; !(Z[i]& T1); i += 2)
  {g = Z[i];
   h = Z[g+6];// spisok reber vershini
   for(j = h+2; !(Z[j] & T1); j += 2)
    {h1 = Z[j]-2;
     if(Z[g] == 14 || Z[h1 + 4] == g)
      {p3 = Z[h1+2];
       p4 = Z[p3];
       Z[h1+2] = Z[p4+2];
       Z[p3] = Z[p4+4];
      }
    }
  }
  for(i = a+2,j = f+2; !(Z[i] & T1); i += 2, j += 2)
   {h = Z[i]; h1 = Z[j];
    Z[h+2] = Z[h1+2];
    g = mem(p1+6);
    for(k = 0,k1 = g+2; k < p1; k += 2, k1 += 2)
        {Z[k1] = 0x0020045B;
        }
    Z[k1] = h;
    Z[h1+2] = g;
   }
  st--;
  return f;
 }


 UINT grafcopy(UINT a) // sozdaet copiju grafa a

 {UINT d,*e,*e1,*e2,f,g,h,h1,i,j,k,k1,p1,p2;
  e = st;
  g = a;
  g += 2;
  while(!(Z[g] & T1))
   {d = Z[g];
    f = mem(Z[d]);
    d += 2;
    for(i = f+2; !(Z[d]& T1); i++)
     {Z[i] = Z[d]; d++;}
    *st = f; st++;
    g += 2;
   }
  f = text1(e);
  e1 = st; // zakrepili kopiju grafa
  *st = f; st++;
  for(i = a+2, j = f+2; !(Z[i] & T1); i += 2, j += 2)
   {g = Z[i];
    Z[g+2] = Z[j] + 2;
   }
  for(i = a+2; !(Z[i]& T1); i += 2)
  {g = Z[i];
   h = Z[g+6];// spisok reber vershini
   for(j = h+2; !(Z[j] & T1); j += 2)
    {h1 = Z[j];
     if(Z[g] == 14 || Z[h1 + 4] == g)
      {e = st; // nachalo formirovanija novogo rebra
       e2 = st;
       *st = Z[h1+2]; st++;
       p1 = polncopy(*(st-1));
       *st = p1; st++;
       g = text1(e2);
       *st = g; st++;
       g = Z[h1+4];
       g = Z[g+2]; g -= 2;
       *st = g; st++;
       g = Z[h1+6];
       g = Z[g+2]; g -= 2;
       *st = g; st++;
       g = text1(e); // novoe rebro
       Z[h1+2] = g+2;
      }
    }
  }
 for(i = f+2; !(Z[i]& T1); i += 2)
  {g = Z[i];
   for(j = g+4; !(Z[j] & T1); j += 2)
    {h = Z[j];
     e = st;
     for(k = h+2; !(Z[k] & T1); k += 2)
      {h1 = Z[k];
       *st = Z[h1]; st++;
      }
     h1 = text1(e);
     Z[j] = h1;
    }
  }
 for(i = a+2; !(Z[i]& T1); i += 2)
  {g = Z[i];
   h = Z[g+6];// spisok reber vershini
   for(j = h+2; !(Z[j] & T1); j += 2)
    {h1 = Z[j];
     if(Z[g] == 14 || Z[h1 + 4] == g)
      {p1 = Z[h1+2];
       p2 = Z[p1];
       Z[h1+2] = Z[p2+2];
       Z[p1] = Z[p2+4];
      }
    }
  }
  for(i = a+2,j = f+2; !(Z[i] & T1); i += 2, j += 2)
   {h = Z[i]; h1 = Z[j];
    p1 = Z[h1+2];
    Z[h+2] = p1;
    p1 = polncopy(p1);
    Z[h1+2] = p1;
   }
  st--;
  return f;
 }

 UINT smtabl(UINT a, UINT b, UINT c)
         // funkcija dlja 'tablznachenie',
         // ispolzuemaja v fajle vichprog
         // a,b,c - vhodnie dannie.
 {UINT d,e;
  for(d = a + 2;!(Z[d] & T1);d += 2)
	{if(sravn(Z[d],c))
	  {e = Z[b + (d - a)]; return e;}
	}
  return c;
 }

 void rcvet(void) // zagruzka tablici TCV iz fajla.
 {UINT a;
  char *b;
  if(itcv == 1) return;
  hcvet = Nopen(pathcvet);
  b = (char*)R;
  Nread(hcvet,b,4);
  a = R[0];
  b = (char*)TCV;
  Npointer(hcvet,4,0);
  Nread(hcvet,b,a);
  Npointer(hcvet,a,0);
  b = (char*)ZCV;
  Nread(hcvet, b, 4000);
  Nclose(hcvet);
  itcv = 1;
  a >>= 2;
  TCV[a-1] = 0;
  return;
 }



UINT cvnutr(UINT a, UINT b) // a - pjatno, b - linija. Esli linja b otnositsja k vnutrennim
                            // granicam pjatna a, vozvrashaet 1, inache 0.
{UINT c,d,e,f,g;
 c = 0;
 d = CVOTR[a+3];
 if(d != 0)
  {e = CVOTR[d];
   d++;
   while(d < e && c == 0)
    {f = CVOTR[d];
     g = CVOTR[f];
     f++;
     while(f < g && c == 0)
      {if(CVOTR[f] == b)
        {c = 1;}
       f += 2;
      }
     d++;
    }
  }
 return c;
}




UINT diskr(UINT a, UINT b, UINT c) //a,b,c - znachenija B,G,R
                                   // vozvrashaet nomer diskretizirovannogo cveta
                                   // libo 0
{UINT c1,c2,c3,d,d1,d2,d3,d4,d5,d6,d7,e,k,t1,t2;
 c1 = a & 0xF0;
 c1 <<= 4;
 c2 = b & 0xF0;
 c1 |= c2;
 c3 = c & 0xF0;
 c3 >>= 4;
 c1 |= c3;
 d = TCV[c1];
 e = 0;
 R[1] = a; R[2] = b; R[3] = c;
 while(e == 0 && d != 0)
  {d1 = TCV[d];
   d = TCV[d+1]; // adres gruppi vo 2 zone;
   d2 = TCV[d1]; // konec gruppi
   k = d1+2; // tekushaja chetverka;
   d3 = 0; // indikator obriva;
   while(d3 == 0 && k < d2)
    {d4 = TCV[k];  // znachenija i1,i2
     d5 = TCV[k+1];
     t1 = TCV[k+2];// znachenija a1,a2
     t2 = TCV[k+3];
     if(d5 == 0)
      {d6 = R[d4];
       if(t2 == 0)
        {if(t1 > d6)
          {d3 = 1;
          }
        }
       else
        {if(d6 > t1)
          {d3 = 1;}
        }
      }
     else
      {d6 = R[d4];
       d7 = R[d5];
       if((t1 * d6) > (t2 * d7))
        {d3 = 1;
        }
      }
     k += 4;
    }
   if(d3 == 0)
    {e = TCV[d1+1];
    }
  }
 return e;
}

void cfree(UINT a, UINT b) // Nachinaja so smeshenija a
            // v CVOTR i konchaja smesheniem b (vkljuchitelno) idut pari koordinat
            // pikselej. V sootvetstvujushie jachejki karti granic cvetnih pjaten
            // v OBL3 zanositsja 0.
{UINT i,c,d;
 for(i = a; i <= b; i += 2)
  {c = CVOTR[i];
   d = CVOTR[i+1];
   d *= (oblshirina+1);
   d += c;
   OBL3[d] = 0;
  }
 return;
}


UINT diskrcv(UINT a) // a - 32-bitnoe RGB
                     // vozvrashaet nomer diskretnogo cveta ili 0
{UINT b,c,d,e;
 a &= 0x7FFFFFFF;
 b = (a >> 16);
 c = (a >> 8) & 0xFF;
 d = a & 0xFF;
 e = diskr(b,c,d);
 return e;
}

UINT cvnerav(UINT a, UINT b)// a,b - smeshenija grupp chetverok
                   // vo 2-j zone TCV. Esli sistemi neravenstv dlja
                   // etih grupp nesovmestni, vozvrashaet 1,
                   // inache - 0.
{UINT a1,a2,b1,b2,c,d,d1,d2,d3,i,i1,i2,j,j1,j2,p,p1,p2,p3;
 c = 0;
 d = 0;
 i = TCV[a];
 for(j = a+2; j < i; j++)
  {R[d] = TCV[j];
   d++;
  }
 i = TCV[b];
 for(j = b+2; j < i; j++)
  {R[d] = TCV[j];
   d++;
  }    // v massive R nachinaja s 0 i do d idut chetverki grupp a,b.
       // dalee d - konec ocherednoj gruppi v R.
  d1 = 0; // nachalo ocherednoj gruppi neravenstv v R
  d3 = d; // pervaja svobodnaja jachejka v R
 for(i = 3; i > 1 ; i--) // i - nomer iskljuchaemoj RGB - peremennoj.
  {while(d1 < d)
    {i1 = R[d1]; i2 = R[d1+1];
     a1 = R[d1+2]; a2 = R[d1+3];
     if(i2 == 0 && i1 == i)
      {if(a2 == 0)
        {d2 = d1+4;
         while(d2 < d)
          {j1 = R[d2]; j2 = R[d2+1];
           b1 = R[d2+2]; b2 = R[d2+3];
           if(j2 == 0 && b2 == 1 && j1 == i && a1 > b1)
            {return 1;}
           if(j2 != 0 && j1 == i)
            {p = a1*b1;
             p1 = p/b2;
             p2 = p%b2;
             if(p2 !=0)
              {p1++;}
             R[d3] = j2;
             R[d3+1] = 0;
             R[d3+2] = p1;
             R[d3+3] = 0;
             d3 += 4;
            }
           d2 += 4;
          }
        }
       else
        {d2 = d1+4;
         while(d2 < d)
          {j1 = R[d2]; j2 = R[d2+1];
           b1 = R[d2+2]; b2 = R[d2+3];
           if(j2 == 0 && b2 == 0 && j1 == i && b1 > a1)
            {return 1;}
           if(j2 != 0 && j2 == i)
            {p = a1*b2;
             p1 = p/b1;
             R[d3] = j1;
             R[d3+1] = 0;
             R[d3+2] = p1;
             R[d3+3] = 1;
             d3 += 4;
            }
           d2 += 4;
          }
        }
      }
     if(i2 != 0 && i1 == i)
      {d2 = d1+4;
       while(d2 < d)
        {j1 = R[d2]; j2 = R[d2+1];
         b1 = R[d2+2]; b2 = R[d2+3];
         if(j2 == 0 && b2 == 0 && j1 == i)
          {p = a1*b1;
           p1 = p/a2;
           p2 = p%a2;
           if(p2 !=0)
            {p1++;}
           R[d3] = i2;
           R[d3+1] = 0;
           R[d3+2] = p1;
           R[d3+3] = 0;
           d3 += 4;
          }
         if(j2 != 0 && j2 == i)
          {p1 = a1*b1; p2 = a2*b2;
           if(j1 != i2)
            {R[d3] = j1; R[d3+1] = i2;
             R[d3+2] = p1; R[d3+3] = p2;
             d3 += 4;
            }
           else
            {if(p1 > p2)
              {R[d3] = j1;
               R[d3+1] = 0;
               R[d3+2] = 0;
               R[d3+3] = 1;
               d3 += 4;
              }
            }
          }
         d2 += 4;
        }
      }
     if(i2 != 0 && i2 == i)
      {d2 = d1+4;
       while(d2 < d)
        {j1 = R[d2]; j2 = R[d2+1];
         b1 = R[d2+2]; b2 = R[d2+3];
         if(j2 == 0 && b2 == 1 && j1 == i)
          {p = a2*b1;
           p1 = p/a1;
           R[d3] = i1;
           R[d3+1] = 0;
           R[d3+2] = p1;
           R[d3+3] = 1;
           d3 += 4;
          }
         if(j2 != 0 && j1 == i)
          {p1 = a1*b1; p2 = a2*b2;
           if(i1 != j2)
            {R[d3] = i1; R[d3+1] = j2;
             R[d3+2] = p1; R[d3+3] = p2;
             d3 += 4;
            }
           else
            {if(p1 > p2)
              {R[d3] = i1;
               R[d3+1] = 0;
               R[d3+2] = 0;
               R[d3+3] = 1;
               d3 += 4;
              }
            }
          }
         d2 += 4;
        }
      }
     d1 += 4;
    }
   d1 = d;
   d = d3;
  }
 p1 = 0; p2 = 1000000000;
 while(d1 < d)
  {d2 = R[d1+2];
   d3 = R[d1+3];
   if(d3 == 0)
    {if(p1 < d2)
      {p1 = d2;}
    }
   else
    {if(d2 < p2)
      {p2 = d2;}
    }
   d1 += 4;
  }
 if(p1 > p2)
  {c = 1;}
 return c;
}

UINT cvdelta(UINT a1, UINT a2, UINT b1, UINT b2) // (a1,a2) i (b1,b2) -
                     // koordinati pikselej. Vozvrashaet summu modulej
                     // raznosti znachenij R,G,B dlja etih pikselej.
 {UINT c,d,p,q,i,r,s;
  char h1,h2;
  unsigned char f1,f2;
  c = a1 + oblshirina*a2;
  c *= 4;
  d = b1 + oblshirina*b2;
  d *= 4;
  s = 0;
  for(i=0; i<3; i++)
   {h1 = IZ[c+i];
    f1 = (unsigned char)h1;
    p = (UINT)f1;
    h2 = IZ[d+i];
    f2 = (unsigned char)h2;
    q = (UINT)f2;
    r = (p < q ? q - p : p - q);
    s += r;
   }
  return s;
 }

 UINT cvrasst(UINT a, UINT b) // summa modulej raznostej komponent cvetnisti
                              // dvuh BGR-naborov a,b
 {UINT c,d,e,f,i;
  if(!(a & 0x80000000))
   {a = ZCV[a-1];}
  if(!(b & 0x80000000))
   {b = ZCV[b-1];}
  c = 0;
  for(i=0; i < 3; i++)
   {d = (a & 0xFF);
    e = (b & 0xFF);
    f = (d < e ? e-d : d-e);
    c += f;
    a >>= 8;
   }
  return c;
 }

 UINT lindelta(UINT a) //a - smeshenie linii v CVOTR.
             // Vozvrashaet srednijuju summu moduleja raznostu
             //R,G,B znachenij cveta pikselej sleva i sprava ot
             // linii a
 {UINT b,c,r,s,n,p1,p2,q1,q2;
  b = CVOTR[a+2]; // pervaja jachejka posle massiva par koordinat
  c = CVOTR[a+3]; // nachalo massiva par koordinat
  s = 0;
  n = 0;
  while(c < b-2)
   {p1 = CVOTR[c];
    p2 = CVOTR[c+1];
    q1 = CVOTR[c+2];
    q2 = CVOTR[c+3];
    if(p1 == q1 && p1 != 0 && p1 != (oblshirina - 1))
     {if(p2 < q2)
       {r = cvdelta(p1-1,p2,p1,p2);
        s += r; n++;
       }
      else
       {r = cvdelta(p1-1,q2,p1,q2);
        s += r; n++;
       }
     }
    else
     {if(p2 == q2 && p2 != 0 && p2 != (oblvisota - 1))
       {if(p1 < q1)
         {r = cvdelta(p1,p2-1,p1,p2);
          s += r; n++;
         }
        else
         {r = cvdelta(q1,p2-1,q1,p2);
          s += r; n++;
         }
       }
     }
    c += 2;
   }
  if(n == 0)
   {r = 1000;}
  else
   {r = s/n;}
  return r;
 }

UINT grvekt(UINT a, UINT b, UINT c) // a- smeshenie uzla v CVOTR, b - smeshenie linii v CVOTR.
                         // Esli c ravno 0, opredeljaet napravljajushij vektor linii b pri
                         // othode ot uzla a; esli c ravno 1, to - pri podhode k uzlu.
                         // Koordinati vektora sohranjajutsja v vektx, vekty. Pri uspehe vozvrashaet
                         // 1, inache - 0.
 {UINT d,e;
  int p1,q1,p2,q2;
  p1 = (int)CVOTR[a];  // koordinati uzla
  q1 = (int)CVOTR[a+1];
  e = CVOTR[b+3];
  d = CVOTR[b+2] - e;
  d >>= 1;
  if(d < 6)
   {return 0;}
  if(a == CVOTR[b+4])
   {p2 = (int)CVOTR[e+8];
    q2 = (int)CVOTR[e+9];
   }
  else
   {e = CVOTR[b+2];
    p2 = (int)CVOTR[e-10];
    q2 = (int)CVOTR[e-9];
   }
  if(c == 0)
   {vektx = p2-p1;
    vekty = q2-q1;
   }
  else
   {vektx = p1-p2;
    vekty = q1-q2;
   }
  return 1;
 }

 UINT cvtest(UINT a, UINT b, UINT c) // a,b - nomera cvetnih pjaten, c - linija
                             // Vozvrashaet 1, esli eti pjatna otnesni k odnomu
                             //i tomu ge objektu. Pri etom peremennim xlin, ylin
                             // prisvaivajutsja koordinati nachala linii c, a
                             //peremennim linx,liny - koordinati konca.
 {UINT d,e,f;
 d = PTNBGN+(a*4);
 e = PTNBGN+(b*4);
 d = CVOTR[d];
 e = CVOTR[e];
 d = OBL4[d+3];
 e = OBL4[e+3];
 if(d != 0 && e != 0)
  {while(CVOTR[d+1] != 0)
    {d = CVOTR[d+1];}
   while(CVOTR[e+1] != 0)
    {e = CVOTR[e+1];}
   if(d == e)
    {f = CVOTR[c+4];
     xlin = CVOTR[f];
     ylin = CVOTR[f+1];
     f = CVOTR[c+5];
     linx = CVOTR[f];
     liny = CVOTR[f+1];
     return 1;
    }
  }
  return 0;
 }

 UINT linsokr(UINT a, UINT b) // a - smeshenie v CVOTR massiva
                    // par koordinat pikselej nekotoroj linii, b -
                    // smeshenie pervoj jachejki posle massiva.
                    // Etot massiv perezapisivaetsja s pozicii a,
                    // prichem propuskajutsja pari, nachinajushiesja
                    // s 0xFFFFFFFF. Vozvrashaet smeshenie pervoj jachejki
                    // posle novoj versii massiva.
  {UINT c,d;
   c = a; d = a;
   while(c < b)
    {if(CVOTR[c] == 0xFFFFFFFF)
      {c += 2;}
     else
      {if(d < c)
        {CVOTR[d] = CVOTR[c];
         CVOTR[d+1] = CVOTR[c+1];
        }
       d += 2; c += 2;
      }
    }
   return d;
  }


void cvobj(void) // rasstanovka v 4-h harakteristikah
               // cvetnih pjaten smeshenij v CVOTR par (chislo
               // pikselej v objekte, k kotoromu otneseno pjatno -
               // 0). Eta para odna i ta ge dlja vseh pjaten,
               // megdu kotorimi sterti peregorodki (t.e.
               // otnesennih k odnomu itomu ge objektu)
{UINT a,b,c,d,e,i,p,q,r,s;
 for(i = 0; i < LINEND; i++)
  {a = OBL4[i];
   b = CVOTR[a+6];
   if(OBL4[b] & 0x80000000)
   {c = CVOTR[a]; // c,d - smegnie pjatna
    d = CVOTR[a+1];
    p = CVOTR[c]; // p,q - smeshenija v OBL4 nachal otrezkov harakteristik smegnih pjaten
    q = CVOTR[d];
    if(OBL4[p+3] == 0)
     {if(OBL4[q+3] == 0)
       {e = CVOTR[c+1] + CVOTR[d+1];
        CVOTR[CVOTREND] = e;
        CVOTR[CVOTREND+1] = 0;
        OBL4[p+3] = CVOTREND;
        OBL4[q+3] = CVOTREND;
        CVOTREND += 2;
       }
     else
      {r = OBL4[q+3];
       while(CVOTR[r+1] != 0)
        {r = CVOTR[r+1];}
       CVOTR[r] += CVOTR[c+1];
       OBL4[p+3] = r;
      }
     }
   else
    {r = OBL4[p+3];
     while(CVOTR[r+1] != 0)
      {r = CVOTR[r+1];}
     if(OBL4[q+3]== 0)
      {CVOTR[r] += CVOTR[d+1];
       OBL4[q+3] = r;
      }
     else
      {s = OBL4[q+3];
       while(CVOTR[s+1] != 0)
        {s = CVOTR[s+1];}
       if(r != s)
        {CVOTR[r] += CVOTR[s];
         CVOTR[s+1] = r;
        }
      }
    }
   }
  }
 return;
}


UINT cvperesech(UINT a, UINT b) // a,b - nachala v CVOTR cepochek par.
           // esli v etih cepochkah imeetsjz edinstvennij obshij element, to
           // on vozvrashaetsja. Inache vozvrashaet 0.
{UINT c,d,p;
 c = 0;
 while(a != 0)
  {d = CVOTR[a];
   p = b;
   while(p != 0)
    {if(CVOTR[p] == d)
      {if(c != 0)
        {return 0;}
       else
        {c = d;}
      }
     p = CVOTR[p+1];
    }
   a = CVOTR[a+1];
  }
 return c;
}

UINT vnutrlin(UINT a) // a - smeshenie linii v CVOTR.
  // Esli ona otdeljaet dva pjatna odnogo i togo ge objekta,
  // vozvrashaet 1. Inache - 0. Esli 2-ja harakteristika linii
  // ne nulevaja, vozvrashaet ee uvelichennuju na 1.

{UINT b,c,d;
 b = CVOTR[a];
 b = CVOTR[b];
 b = OBL4[b+3];
 c = CVOTR[a+1];
 c = CVOTR[c];
 c = OBL4[c+3];
 d = CVOTR[a+6];
 d = OBL4[d+1];
 if(d !=0)
  {d++;
   return d;
  }
 if(b != 0 && b == c)
  {return 1;}
 else
  {return 0;}
}

            // FUNKCII DLJA OPERATOROV LOS'A


	void F1()

	{return;}

	void F2() //  NE
	{ ist = 1 - ist;}

	void F4() //SBROS

	{UINT a;
	 a = lcadr;st--;
	 while(*st != L0)
	  {while ((S[a+2] != 4 && S[a+2] != 2) || S[a+7] != 0
			     || S[a+3] != cadr)
		 {if(a <= cadr){ind = 4;tipprer = 3;return;}
		  else a = S[a+1];
		 }
      a = S[a+1];*st -= 1;
	  }
	  lcadr = a; otkat();
   }


	void F11() // RESHITb

	{if(S[cadr + 2] != 1)ist = 0;}

	void F12() // UROVENb

	{UINT a,b;
	 a = *(st-1)-L0;b = S[cadr +13];st -= 2;
	 while(a != 0)
     {a--;if(b == *st){st -= a;return;}
      if(a != 0)st--;
     }
	 ist = 0;
	}

	void F13() // OPREDELENO

	{st--;if(*st == 0 || *st & 0xC0000000)ist = 0;}

	void F17() //VIHOD

	{UINT a,b,c,*d,e,f,g;
	 UINT64 i;
    if(PR[prer] == 17 && PR[prer+1] == cadr
       && blokprer == 0)
      {tipprer = 9;initprer(2);return;}
    if(PR[prer] == 17 && PR[prer+2] == cadr)
	 {PR[prer+2] = 0;}
	if(smotvet == cadr)
      {smotvet = 1;tipprer = 9;initprer(2);return;}
    a = S[cadr+2];
    if(a == 2)
     {if((PR[prer] == 2 || PR[prer] == 17)
          && PR[prer+1] == S[cadr+3])
       {b = S[9]; b = Z[b+8]; b += (Z[b] - 4);
        b = Z[b] + 2;
	     for(c = Z[b];!(c & T1);b += 2,c = Z[b])
	      {if(!(c & T6))
          {if(Z[c+2] == 0x0020038D)
           {e = Z[c+4];
            if(!(e & T6))
             {g = e + Z[e] - 4;
              g = Z[g];
              if(Z[g + 10] == 0x00200104)
               {Z[g+10] = L13;
                 i = step;d = st;
	              if(i == 0)f = L0;
	              else
	               {while(i != 0)
		              {*st = (i % 10) + L0;i /= 10;st++;}
		             if(st == d+1)
		              {st = d;f = *st;}
		             else f = text2(d);

                  }
                Z[g+8] = f;
               }
             }
            break;
           }
          }
         }
       }
      contin();
     }
	 else
     {if(a == 1)ind = 0;
	   else {*st = L0;st++;contin();}
	  }
 	}

	void F18()  // STOP

	{UINT a,b,c,*d,e,f,g;
	 UINT64 i;
     if(PR[prer] == 17 && PR[prer+1] == cadr &&
        blokprer == 0)
       {tipprer = 9;initprer(2);return;}
     if(smotvet == cadr)
       {smotvet = 2;tipprer = 9;initprer(2);return;}
     a = S[cadr + 2];
     if(a == 2)
      {if((PR[prer] == 2 || PR[prer] == 17)
          && PR[prer+1] == S[cadr+3])
       {b = S[9]; b = Z[b+8]; b += (Z[b] - 4);
        b = Z[b] + 2;
	     for(c = Z[b];!(c & T1);b += 2,c = Z[b])
	      {if(!(c & T6))
          {if(Z[c+2] == 0x0020038D)
           {e = Z[c+4];
            if(!(e & T6))
             {g = e + Z[e] - 4;
              g = Z[g];
              if(Z[g + 10] == 0x00200104)
               {Z[g+10] = L6;
                 i = step;d = st;
	              if(i == 0)f = L0;
	              else
	               {while(i != 0)
		              {*st = (i % 10) + L0;i /= 10;st++;}
		             if(st == d+1)
		              {st = d;f = *st;}
		             else f = text2(d);

                  }
                Z[g+8] = f;
               }
             }
            break;
           }
          }
         }
       }
       contin();ist = 0;return;}
	  else
      {if(a == 1)
        ind = 0;
		 else
        {*st = L0;st++;contin();}
	   }
   }

	void F19() // OBRIV

	{while((S[lcadr + 2] != 4 && S[lcadr + 2] != 2) ||
           S[lcadr + 7] != 0 || S[lcadr + 3] != cadr)
	  {if(lcadr == cadr){ind = 4;tipprer = 3;return;}
		else lcadr = S[lcadr + 1];
	  }
    lcadr = S[lcadr + 1];otkat();

	}

	void F20()  // PRODOLGENIE

	{otkat();}

   void F21()  // MENU
   {
   }
	void F22()  // OBRASHENIE

	{UINT a,b;
	 if(S[cadr + 2] != 3)
     {ist = 0;st -= (*(st-1)-0x00200103);return;}
	 a = *(st-1)-L0;b = S[cadr+6];st -= 2;
	 while(a != 0)
    {a--;if(b == *st){st -= a;return;}
     if(a != 0)st--;
    }
	 ist = 0;
	}

   void F23() // mishb

   {opr(*(st-3),mouse + L0);
    opr(*(st-2),mousex);
    opr(*(st-1),mousey);
    st -= 3;
   }

   void F24() // nignjajastroka

   {UINT a;
    RECT r;
    if(!(*(st-1)& T1))
    {tipprer = 7;initprer(1);return;}
    GetClientRect(hhwnd,&r);
    a = r.bottom + L0;
	if(indparal != 0)
	 {a = 0x0020035B;}
	opr(*(st-1),a);st--;
   }

   void F25() // russhrift

   {if(*(st-1) == 0x00200105)rus = 1;
    if(*(st-1) == 0x00200104)rus = 0;
    st--;
   }

	void F26()  //KONTROL

	{UINT a,b,c,d;
	  a = S[cadr + 9];b = Z[a+2];
	  if(b != L1)
		 {if(b == L5)
			{c = Z[a+12]+2;
			  do {d = Z[c];
               if(d == L0)
                {peresm = 1;return;}
               c += 2;
              }
			  while(!(d & T1));
			}
		  else {if(Z[a+12] == L0){peresm = 1;return;}}
		 }
	  c = Z[a+6]+2;
     do {d = Z[c];
         if(d == L0)
          {peresm = 1;return;}
	      c += 2;
	     }
	  while(!(d & T1));
	  otkat();
	}

	void F27() // POVTORENIE

	{UINT a;
	  a = S[lcadr];
     if(delta == 1 && a >14500)
       {ind = 4;tipprer = 2;return;}
	  S[a+1] = lcadr;S[a+2] = 4;S[a] = a + 9;S[a+3] = cadr;
	  S[a+4] = nomprog |(fragm << 16);
     S[a+5] = (tec - A)|(level << 16);
	  S[a+6] = S[cadr + 8];S[a+7] = level;
     S[a+8] = 0;lcadr = a;
	}

	void F28() // PERESTANOVKA

	{ UINT a,b,c;
	  st -= 2;b = (*st) - L0 + 8;c = *(st+1) - L0 + 8;
	  a = S[cadr + b];
	  S[cadr + b] = S[cadr + c];
	  S[cadr + c] = a;
	}

	void F29() // PERESMOTR

	{peresm = 1;}

	void F30() // NOVIJ

	{if(S[cadr + 6] != 0)ist = 0;}

	void F31() //NOVIJSIMVOL

	{UINT a,b;
    if(!(*(st-1) & T1))
    a = 0;b = 0x00200001;
	 while(K[a] != 0){a++;b++;}
	 opr(*(st-1),b);st--;
	}

	void F32() // PROGRAMMA

	{if (S[cadr + 2] != 2)ist = 0;}

	void F33() // POSLEDNIJUROVENb

	{if((S[cadr + 7] & 0x0000FFFF) != (S[cadr + 13] & 0x0000FFFF))ist = 0;}

    void F34() // TABLZNACH

	{UINT a,b,c;
	 st -= 2;b = *(st-1);
     if(b == L3){*(st-1) = *(st+1);return;}
     c = *st;
     if(b & T6 || c & T6 || !(Z[b+1] & T1) ||
       !(Z[c+1] & T1))
      {tipprer = 7;st += 2;initprer(1);return;}
     else
      {for(a = b + 2;!(Z[a] & T1);a += 2)
		if(Z[a] == *(st+1))
		 {*(st-1) = Z[c + (a - b)];return;}
	  }
     *(st-1) = *(st+1);
	}
   void F35()  // NOVOPERAND

   {UINT a,b,c,d;
    st -= 2;tec++;a = *st;b = *(st+1);
    if(a & T6 || Z[a+1] & T1)
     {tipprer = 7;st += 2;tec--;initprer(1);return;}
    c = (Z[a+1] >> 16);
    if(c == 3)
     {tipprer = 7;st += 2;tec--;initprer(1);return;}
    d = a - c;
    c = Z[d+1] & T4;
    c += d;
    d = Z[a+1] & T4;
    a += d;
    if(a >= c)
     {ist = 0;return;}
	 else
     {cadrprod(12);opr(b,a);
		if(ind == 4)return;
      S[lcadr + 9] = a;
		S[lcadr + 10] = c;
      S[lcadr + 11] = b;
	  }
	}

   void F36()  // PROCEDURA

   {UINT a,b,c,d,e;
    a = *(st-3); // zagolovok
    b = *(st-2);  //  nabor
    c = *(st-1);  //  operator - viragenie
    if(!(a & T6) || (b & T6) || !(Z[b+1] & T1))
     {tipprer = 7;initprer(1);return;}
    st -= 3;
    b += 2;
    e = 0x00200104;
    while(!(Z[b] & T1))
     {d = Z[b];
      if(d == 0x0020045B)  // simvol "neopred"
       d = 0x40000000 | b;
      *st = d;st++;
      b += 2;e++;
     }
    *st = a;st++;
    *st = e;st++;
    if(c == 0x00200104)F292();
    else F293();
   }

   void F37() // VIDEOKLJUCH

   {UINT a,b,c,d,e,f;
	 st -= 4;tec++;a = *st - L0;b = *(st+1) - L0;
    c = *(st+2);
    if(iMT == 0 || b >= jMT)
    {tipprer = 7;st += 4;initprer(1);return;}
    for(d = a; d <= b; d++)
	  {e = MT[d] & 0x000000FF; e += L0;
      if(e == c)
		 {d += L0; f = *(st+3);
        cadrprod(13); opr(f,d);
        if(ind == 4)return;
		  S[lcadr + 9] = d;S[lcadr + 10] = b + L0;
        S[lcadr + 11] = c;
		  S[lcadr + 12] = f;
        return;
		 }
	  }
	 ist = 0;
	}

   void F38() // VNESHKONTROL

   {if(keyend == 1)
     {keyend = 0;ist = 0;}
   }

   void F39() // VNESHKADR

   {UINT a,b,c,d,e,*f;
    a = *(st-2)-0x00200104;
    c = cadr;
    while(a != 0)
     {d = c;c = S[c+3];a--;}
    b = *(st-1) - 0x00200104;st -= 2;
    if(b == 0)
     {if(S[c+2] == 1)
       {a = S[c+9];*st = Z[a+2];st++;return;}
      if(S[c+2] == 3)
       {*st = S[c+7];st++;return;}
      f = P[S[d+4] & 0x0000FFFF];e = S[d+4] >> 16;
      while(d = f[e+3],d & 0xFFF80000)
		 {e = d & T11;f = P[(d >> 19) - 1];
		 }
		*st = 0x00200000 | d;st++;return;
     }
    else
     {if(S[c+8] > b+8)
       {*st = S[c + b + 8];st++;return;}
      else
       *st = 0x0020040C;st++;
     }
   }

   void F40() // OPERANDNOMER

   {UINT a,b,c;
    a = *(st-2);
    if((a & T6) || (Z[a+1] & T1) || Z[a+1] == 0)
     {tipprer = 7;initprer(1);return;}
    b = *(st-1) - 0x00200105;
    if(b > 10000)
     {tipprer = 7;initprer(1);return;}
    st -= 2;
    c = a + (Z[a+1] & 0x0000FFFF);
    a += 2;
    while(b != 0)
     {if(a >= c)
       {*st = 0x00200104;st++;return;}
      else
       a += (Z[a+1] & 0x0000FFFF);
      b--;
     }
    if(a >= c)
     {*st = 0x00200104;st++;return;}
    *st = a;st++;
   }

   void F41() //  KLUCHPODOBIJA

   {UINT a,b,c,d,e,f;
	 st -= 3;tec++;e = *st;a = *(st+1);
    if(e == L3){ist = 0;return;}
    if(e & T6 || !(Z[e+1] & T1) ||
       a & T6 || !(Z[a+1] & T1))
     {tipprer = 7;st += 3;initprer(1);return;}
    f = kodpodobija(a);
    for(b = (e + 2),c = Z[b];!(c & T1);b += 2,c = Z[b])
	  {if(!(c & T6) && Z[c] == Z[a] && Z[c+2] == Z[a+2]
      && kodpodobija(c) == f)
		 {d = *(st+2);cadrprod(13);opr(d,b);
        if(ind == 4)return;
		  S[lcadr + 9] = b;
        S[lcadr + 10] = e;
        S[lcadr + 11] = a;
		  S[lcadr + 12] = d;
        return;
		 }
	  }
	 ist = 0;
	}

   void F42() // SMKADR

   {UINT a,b;
    a= *(st-1);st--;
    a&= 0x0000FFFF;
    b = S[a+8] - 8;
    *st = (0x00400000 | b);
    st++;
   }

   void F43() // SMOTVET

   {UINT a;
    a = *(st-1);st--;
    smotvet = 0x0000FFFF & a;
   }

   void F44() // TABLZNACHENIE PERECHISLJAJUSHEE

    {UINT a,b,c,d,e,f;
	  st -= 4;tec++;b = *st;c = *(st+1);
     if(b & T6 || c & T6 ||
        !(Z[b+1] & T1) || !(Z[c+1] & T1))
      {tipprer = 7;st += 2;initprer(1);return;}
	 f = Z[c] - 2;
     for(a = b + 2;!(Z[a] & T1);a += 2)
		 {if(sravn(Z[a],*(st+2)))
          {cadrprod(14);
	       e = a - b;
		   if(e >= f)
		    {tipprer = 7; st+= 2; initprer(1);return;}
           d = Z[c + e];
           opr(*(st+3),d);
           if(ind == 4)return;
		   S[lcadr + 9] = b;
           S[lcadr + 10] = c;
		   S[lcadr + 11] = *(st+2);
           S[lcadr + 12] = a;
           S[lcadr + 13] = *(st+3);
           return;
			 }
       }
     ist = 0;
    }

   void F45() // SMISTOCHNIK

   {UINT a,b,c,*f,e,g;
    st -= 3; tec++; a = S[cadr + 3];
	 if(a == 0 || a >= 0x5FFFFFFF)
     {ist = 0;return;}
    b = S[a+2];
     if(b == 1)
      {c = S[a+9];c = Z[c+2];
       opr(*(st),c);
       opr(*(st+1),0x00200105);
      }
     if(b == 2)
      {f = P[S[cadr+4] & 0x0000FFFF];e = S[cadr+4] >> 16;
       while(g = f[e+3],g & 0xFFF80000)
		 {e = g & T11;f = P[(g >> 19) - 1];
		 }
		 opr(*st, 0x00200000 | g);
       opr(*(st+1), 0x00200106);
      }
     if(b == 3)
      {opr(*st, S[a+7]);
       opr(*(st+1), 0x00200107);
      }
     if(b == 4)
      {opr(*st, 0x00200104);
       opr(*(st+1), 0x00200108);
      }
    opr(*(st+2), 0x00200000 | a);
	 cadrprod(13);
    if(ind == 4)return;
	 S[lcadr+9] = (0x00200000 | a);
    S[lcadr+10] = *st;
    S[lcadr+11] = *(st+1);
    S[lcadr+12] = *(st+2);
    return;
   }

   void F46() //  SMZNACHENIE

   {UINT a,b,c,d;
    st--; a = *(st-1) & 0x0000FFFF;
	d = *st;
	if(!(d & T6))
     {tipprer = 7;st += 2;initprer(1);return;}
    b = (d - 0x00200104) + 8;
	if(S[a] < a+b)
     {*(st-1) = 0x0020040C;}
    else
     {c = S[a+b];
       if(c == 0 || (c & 0xC0000000))
        {*(st-1) = 0x0020040C;}
       else
        {*(st-1) = c;}
     }
   }

   void F47() // Zamena

    {UINT a,b;
     b = *(st-3) & 0x0000FFFF;
     if(PR[prer] == 14 && PR[prer+1] == b &&
        PR[prer+2] == (*(st-2) - L0) && blokprer == 0)
     {tipprer = 9;initprer(2);return;}
     st -= 3; a = b +(*(st+1) - L0) + 8;
     if(a >= S[b])
     {tipprer = 7;st += 3;initprer(1);return;}
     S[a] = *(st+2);
    }

   void F48()  // Obriv

    {while((S[lcadr + 2] != 4 && S[lcadr + 2] != 2) ||
            S[lcadr + 7] != 0 || S[lcadr + 3] != cadr)
	   {if(lcadr == cadr){ind = 4;tipprer = 3;return;}
		 else lcadr = S[lcadr + 1];
	   }
     lcadr = S[lcadr + 1];
    }

   void F49() // TEKSLOVO

   {UINT a,b,c,d;
    st -= 3;tec++;a = *st-0x00200104;
    b = *(st+1)-0x00200104;
    teksl = kluchslova(a,b);
    c = shagslova();
    if(c == 0)
     {ist = 0;return;}
    else
     {d = *(st+2);opr(d,c);
      cadrprod(10);
      if(ind == 4)return;
		S[lcadr + 9] = d;
      return;
     }
   }

   void F50() // vich
   {UINT *a,b,c,i,n,*e,*e1,*r,*r1,f,*g,k;
    double d,d1,d2,d3,d4,h,h1;
    int u;
    signed long p,s,w;
    UINT64 h2;
    ldiv_t m;
    st--; a = st-(*st-L0);
    switch(*a)
    {case 0x00200196: // chislo
     b = *(a+1);
     d = losplav(b);
     e = (UINT*)&d;
     f = mem(8);
     if(f == 0) return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;break;
     case 0x00200165: // kompleksnoe
     b = *(a+1);
     d = losplav(b);
     e = (UINT*)&d;
     f = mem(12);
     if(f == 0)return;
     Z[f+2] = 0x41200001;
     Z[f+3] = *e;
     Z[f+4] = 0x41200001;
     Z[f+5] = *(e+1);
     b = *(a+2);
     d = losplav(b);
     e = (UINT*)&d;
     Z[f+6] = 0x41200001;
     Z[f+7] = *e;
     Z[f+8] = 0x41200001;
     Z[f+9] = *(e+1);
     *a = f;
     break;
     case 0x002001E1: // celoe
     b = *(a+1); p = 0;
     if(b & 0x00200000)
      p = b - 0x00200104;
     else
      {b += 2;c = 0;
       if(Z[b] == 0x002000D2)
        {b += 2; c = 1;}
       while(!(Z[b] & T1))
        {f = Z[b] - 0x00200104;
         p *= 10;
         p += f;
         b += 2;
        }
       if(c == 1) p = -p;
      }
     f = mem(6);
     if(f == 0) return;
     Z[f+2] = 0x60200001;
     Z[f+3] = p;
     *a = f;
     break;
     case 0x002003A7: // Celoe (dlinnoe)
     b = *(a+1);
     R[0] = 2; R[1] = 0;
     if(b & 0x00200000)
      {R[2] = b - 0x00200104;}
     else
      {b += 2; R[2] = 0;
       if(Z[b] == 0x002000D2)
        {b += 2; R[1] = 0x80000000;}
       while(!(Z[b] & T1))
        {f = Z[b] - 0x00200104;
         umnog10(R);
         cifrplus96(R,f);
         b += 2;
        }
      }
     k = svertdlin(R);
     f = mem(k);
     if(f == 0)return;
     svert96(R,f);
     *a = f;
     break;
     case 0x00200011: // vihod
     b = *(a+1);
     if(!(Z[b+2] & 0x20000000))
      {e = (UINT*)&d;
       *e = Z[b+3];
       *(e+1) = Z[b+5];
       if(Z[b+2] == 0x40200001)
        {c = plavlos(d);
         if(ind == 4)return;
         *a = c;
        }
       else
        {f = Z[b+7];
         k = Z[b+9];
         c = plavlos(d);
         if(ind == 4) return;
         r = st;
         *st = c; st++;
         *e = f;
         *(e+1) = k;
         c = plavlos(d);
         if(ind == 4) return;
         *st = c; st++;
         c = text1(r);
         if(ind == 4) return;
         *a = c;
        }
      }
     else
      if((Z[b+2] & 0x01000000))
       {razvert96(b,R);
        e = st;
        while(!(R[2] == 0) || !(R[0] == 2))
         {c = delenie10(R);
          c += 0x00200104;
          *st = c;
          st++;
         }
        if(R[1] == 0x80000000)
         {*st = 0x002000D2; st++;}
        if(e == st)c = 0x00200104;
        else
         {if(e == st-1)c = *e;
          else
           {c = text2(e);
            if(ind == 4)return;
           }
         }
        *a = c;
       }
      else
       {p = Z[b+3]; e = st;
        if(p < 0)
         {p = -p; n = 0x002000D2;}
        else n = 0;
        while(p != 0)
        {m = ldiv(p, 10);
         p = m.quot;
         f = m.rem;
         f += 0x00200104;
         *st = f;
         st++;
        }
        if(n != 0)
         {*st = n; st++;}
        if(e == st)c = 0x00200104;
        else
         {if(e == st-1)c = *e;
          else
           {c = text2(e);
            if(ind == 4)return;
           }
         }
        *a = c;
       }
     break;
     case 0x00200069: // logsimvol
     b = *(a+1);
     u = (int)Z[b+3];
     u += 0x00200104;
     n = (UINT)u;
     *a = n;
     break;
     case 0x002000AD: // nomersimv
     b = *(a+1);
     u = (int)b;
     u -= 0x00200104;
     n = (UINT)u;
     f = mem(6);
     if(f == 0) return;
     Z[f+2] = 0x60200001;
     Z[f+3] = n;
     *a = f;
     break;
     case 0x002000B0: // simvnomer
     b = *(a+1);
     u = (int)b;
     u -= 0x00200104;
     d = (double)u;
     e = (UINT*)&d;
     f = mem(8);
     if(f == 0) return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x00200190: // znachenie
     b = *(a+1);
     h2 = Z[b+5];
     h2 <<= 32;
     h2 |= Z[b+3];
     e = reinterpret_cast<UINT*>(h2);
     n = *(a+2); n = Z[n+3];
     c = (Z[b+2] == 0x50200001 ? 8 :
          (Z[b+2] == 0x70200001 ? 6 : 12));
     f = mem(c);
     if(f == 0)return;
     if(c == 8)
      {n *= 2;
       Z[f+2] = 0x40200001;
       Z[f+3] = e[n];
       Z[f+4] = 0x40200001;
       Z[f+5] = e[n+1];
      }
     else
      {if(c == 6)
        {Z[f+2] = 0x60200001;
         Z[f+3] = e[n];
        }
       else
        {n *= 4;
         Z[f+2] = 0x61200001;
         Z[f+3] = e[n];
         Z[f+4] = 0x61200001;
         Z[f+5] = e[n+1];
         Z[f+6] = 0x61200001;
         Z[f+7] = e[n+2];
         Z[f+8] = 0x61200001;
         Z[f+9] = e[n+3];
        }
      }
     *a = f;
     break;
     case 0x00200099: // plus
     c = *(a+1); f = *(a+2);
     if(Z[c+2] == 0x40200001 || Z[c+2] == 0x41200001)
      {e = (UINT*)&d; r = (UINT*)&h;
       *e = Z[c+3]; *(e+1) = Z[c+5];
       *r = Z[f+3]; *(r+1) = Z[f+5];
       h = d + h;
       if(Z[c+2] == 0x40200001)
        {f = mem(8);
         if(f == 0)return;
         Z[f+2] = 0x40200001;
         Z[f+3] = *r;
         Z[f+4] = 0x40200001;
         Z[f+5] = *(r+1);
         *a = f;
        }
       else
        {*st = c; st++; *st = f; st++;
         k = mem(12);
         if(k == 0)return;
         Z[k+2] = 0x41200001;
         Z[k+3] = *r;
         Z[k+4] = 0x41200001;
         Z[k+5] = *(r+1);
         f = *(st-1);
         c = *(st-2);
         st -= 2;
         *e = Z[c+7]; *(e+1) = Z[c+9];
         *r = Z[f+7]; *(r+1) = Z[f+9];
         h = d + h;
         Z[k+6] = 0x41200001;
         Z[k+7] = *r;
         Z[k+8] = 0x41200001;
         Z[k+9] = *(r+1);
         *a = k;
        }
      }
     else
      if(Z[c+2] == 0x60200001)
       {p = Z[c+3]; s = Z[f+3];
        p = p + s;
        f = mem(6);
        if(f == 0)return;
        Z[f+2] = 0x60200001;
        Z[f+3] = p;
        *a = f;
       }
      else
       {razvert96(c,R);
        r = R + 300;
        razvert96(f,r);
        p = plus96(R,r);
        if(p != 0)
         {tipprer = 7; initprer(1); return;}
        k = svertdlin(R);
        f = mem(k);
        if(f == 0) return;
        svert96(R,f);
        *a = f;
       }
     break;
     case 0x002000D2: // minus
     c = *(a+1);
     if(Z[c+2] == 0x40200001 || Z[c+2] == 0x41200001)
      {e = (UINT*)&d;
       *e = Z[c+3]; *(e+1) = Z[c+5];
       d = -d;
       if(Z[c+2] == 0x40200001)
        {f = mem(8);
         if(f == 0)return;
         Z[f+2] = 0x40200001;
         Z[f+3] = *e;
         Z[f+4] = 0x40200001;
         Z[f+5] = *(e+1);
         *a = f;
        }
       else
        {*st = c; st++;
         f = mem(12);
         if(f == 0)return;
         Z[f+2] = 0x41200001;
         Z[f+3] = *e;
         Z[f+4] = 0x41200001;
         Z[f+5] = *(e+1);
         c = *(st-1);
         st--;
         *e = Z[c+7]; *(e+1) = Z[c+9];
         d = -d;
         Z[f+6] = 0x41200001;
         Z[f+7] = *e;
         Z[f+8] = 0x41200001;
         Z[f+9] = *(e+1);
         *a = f;
        }
      }
     else
      {if(Z[c+2] == 0x60200001)
        {p = Z[c+3];
         p = -p;
         f = mem(6);
         if(f == 0)return;
         Z[f+2] = 0x60200001;
         Z[f+3] = p;
         *a = f;
        }
       else
        {b = Z[c+3];
         k = Z[c];
         f = mem(k);
         if(f == 0)return;
         Z[f+2] = 0x61200001;
         Z[f+3] = (b^0x80000000);
         for(i = 4; i < k; i++)
         Z[f+i] = Z[c+i];
         *a = f;
        }
      }
     break;
     case 0x00200633: // Celie
     c = *(a+1);
     p = Z[c+3];
     f = mem(6);
     if(f == 0)return;
     Z[f+2] = 0x61200001;
     if(0 <= p)
      {Z[f+3] = p;}
     else
      {p = -p;
       Z[f+3] = p | 0x80000000;
      }
     *a = f;
     break;
     case 0x0020009A: // vichitanie
     c = *(a+1); f = *(a+2);
     if(Z[c+2] == 0x40200001 || Z[c+2] == 0x41200001)
      {e = (UINT*)&d; r = (UINT*)&h;
       *e = Z[c+3]; *(e+1) = Z[c+5];
       *r = Z[f+3]; *(r+1) = Z[f+5];
       d = d - h;
       if(Z[c+2] == 0x40200001)
        {f = mem(8);
         if(f == 0)return;
         Z[f+2] = 0x40200001;
         Z[f+3] = *e;
         Z[f+4] = 0x40200001;
         Z[f+5] = *(e+1);
         *a = f;
        }
       else
        {*st = c; st++; *st = f; st++;
         k = mem(12);
         if(k == 0)return;
         Z[k+2] = 0x41200001;
         Z[k+3] = *e;
         Z[k+4] = 0x41200001;
         Z[k+5] = *(e+1);
         f = *(st-1);
         c = *(st-2);
         st -= 2;
         *e = Z[c+7]; *(e+1) = Z[c+9];
         *r = Z[f+7]; *(r+1) = Z[f+9];
         d = d - h;
         Z[k+6] = 0x41200001;
         Z[k+7] = *e;
         Z[k+8] = 0x41200001;
         Z[k+9] = *(e+1);
         *a = k;
        }
      }
     else
      {if(Z[c+2] == 0x60200001)
        {p = Z[c+3]; s = Z[f+3];
         p = p - s;
         f = mem(6);
         if(f == 0)return;
         Z[f+2] = 0x60200001;
         Z[f+3] = p;
         *a = f;
        }
       else
        {razvert96(c,R);
         r = R + 300;
         razvert96(f,r);
         r[1] ^= 0x80000000;
         p = plus96(R,r);
         if(p != 0)
          {tipprer = 7; initprer(1); return;}
         k = svertdlin(R);
         f = mem(k);
         if(f == 0) return;
         svert96(R,f);
         *a = f;
        }
      }
     break;
     case 0x0020009B: // umnogenie
     c = *(a+1); f = *(a+2);
     if(Z[c+2] == 0x40200001 || Z[c+2] == 0x41200001)
      {e = (UINT*)&d; r = (UINT*)&h;
       *e = Z[c+3]; *(e+1) = Z[c+5];
       *r = Z[f+3]; *(r+1) = Z[f+5];
       if(Z[c+2] == 0x40200001)
        {h = (d * h);
         f = mem(8);
         if(f == 0)return;
         Z[f+2] = 0x40200001;
         Z[f+3] = *r;
         Z[f+4] = 0x40200001;
         Z[f+5] = *(r+1);
         *a = f;
        }
       else
        {e1 = (UINT*)&d1; r1 = (UINT*)&h1;
         *e1 = Z[c+7]; *(e1+1) = Z[c+9];
         *r1 = Z[f+7]; *(r1+1) = Z[f+9];
         d2 = (d * h);
         d3 = (d1 * h1);
         d2 -= d3;
         d3 = (d1 * h);
         d4 = (d * h1);
         d3 += d4;
         d = d2;
         h = d3;
         f = mem(12);
         if(f == 0)return;
         Z[f+2] = 0x41200001;
         Z[f+3] = *e;
         Z[f+4] = 0x41200001;
         Z[f+5] = *(e+1);
         Z[f+6] = 0x41200001;
         Z[f+7] = *r;
         Z[f+8] = 0x41200001;
         Z[f+9] = *(r+1);
         *a = f;
        }
      }
     else
      {if(Z[c+2] == 0x60200001)
        {p = Z[c+3]; s = Z[f+3];
         p = (p * s);
         f = mem(6);
         if(f == 0)return;
         Z[f+2] = 0x60200001;
         Z[f+3] = p;
         *a = f;
        }
       else
        {razvert96(c,R);
         r = R + 300;
         razvert96(f,r);
         e = r + 300;
         p = umnog96(R,r,e);
         if(p != 0)
          {tipprer = 7; initprer(1); return;}
         k = svertdlin(e);
         f = mem(k);
         if(f == 0) return;
         svert96(e,f);
         *a = f;
        }
      }
     break;
     case 0x002001D8: // nod
     c = *(a+1); f = *(a+2);
     razvert96(c,R);
     r = R + 300;
     razvert96(f,r);
     e = r + 300; g = e + 300;
     e = nod96(R,r,e,g,g+300);
     svert96(e,f);
     *a = f;
     break;
     case 0x0020036C:  // veshestvennajachast
     c = *(a+1);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = Z[c+3];
     Z[f+4] = 0x40200001;
     Z[f+5] = Z[c+5];
     *a = f;
     break;
     case 0x00200395:  // mnimajachast
     c = *(a+1);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = Z[c+7];
     Z[f+4] = 0x40200001;
     Z[f+5] = Z[c+9];
     *a = f;
     break;
     case 0x0020069F: // Modul
     c = *(a+1);
     e = (UINT*)&d; r = (UINT*)&h;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     *r = Z[c+7]; *(r+1) = Z[c+9];
     d *= d;
     h *= h;
     h += d;
     h = sqrt(h);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *r;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(r+1);
     *a = f;
     break;
     case 0x00200199: // drob
     c = *(a+1); f = *(a+2);
     if(Z[c+2] == 0x40200001 || Z[c+2] == 0x41200001)
      {e = (UINT*)&d;r = (UINT*)&h;
       *e = Z[c+3]; *(e+1) = Z[c+5];
       *r = Z[f+3]; *(r+1) = Z[f+5];
       if(Z[c+2] == 0x40200001)
        {h = (d / h);
         f = mem(8);
         if(f == 0)return;
         Z[f+2] = 0x40200001;
         Z[f+3] = *r;
         Z[f+4] = 0x40200001;
         Z[f+5] = *(r+1);
         *a = f;
        }
       else
        {e1 = (UINT*)&d1; r1 = (UINT*)&h1;
         *e1 = Z[c+7]; *(e1+1) = Z[c+9];
         *r1 = Z[f+7]; *(r1+1) = Z[f+9];
         d2 = h*h; d3 = h1*h1;
         d2 += d3; // znamenatel
         d3 = d*h;
         d4 = d1*h1;
         d3 += d4;
         d4 = h*d1;
         d1 = d*h1;
         d4 -= d1;
         d = d3 / d2; // veshestv. chast
         h = d4 / d2; // mnimaja chast
         f = mem(12);
         if(f == 0)return;
         Z[f+2] = 0x41200001;
         Z[f+3] = *e;
         Z[f+4] = 0x41200001;
         Z[f+5] = *(e+1);
         Z[f+6] = 0x41200001;
         Z[f+7] = *r;
         Z[f+8] = 0x41200001;
         Z[f+9] = *(r+1);
         *a = f;
        }
      }
     else
      {if(Z[c+2] == 0x60200001)
        {p = Z[c+3]; s = Z[f+3];
         p = (p / s);
         f = mem(6);
         if(f == 0)return;
         Z[f+2] = 0x60200001;
         Z[f+3] = p;
         *a = f;
        }
       else
        {razvert96(c,R);
         r = R + 300;
         razvert96(f,r);
         e = r + 300;
         g = e + 300;
         p = delenie96(R,r,e,g);
         if(p != 0)
          {tipprer = 7; initprer(1); return;}
         k = svertdlin(e);
         f = mem(k);
         if(f == 0) return;
         svert96(e,f);
         *a = f;
        }
      }
     break;
     case 0x002001C3: // stepen
     c = *(a+1); f = *(a+2);
     if(Z[c+2] == 0x40200001)
      {e = (UINT*)&d;r = (UINT*)&h;
       *e = Z[c+3]; *(e+1) = Z[c+5];
       *r = Z[f+3]; *(r+1) = Z[f+5];
       h = pow(d,h);
       f = mem(8);
       if(f == 0)return;
       Z[f+2] = 0x40200001;
       Z[f+3] = *r;
       Z[f+4] = 0x40200001;
       Z[f+5] = *(r+1);
       *a = f;
      }
     else
      {if(Z[c+2] == 0x41200001)
        {f = Z[f+3];
         e = (UINT*)&d; r = (UINT*)&h;
         *e = Z[c+3]; *(e+1) = Z[c+5];
         *r = Z[c+7]; *(r+1) = Z[c+9];
         b = mem(12);
         if(b == 0)return;
         if(f == 0)
          {d = 1; h = 0;
           Z[b+2] = 0x41200001;
           Z[b+3] = *e;
           Z[b+4] = 0x41200001;
           Z[b+5] = *(e+1);
           Z[b+6] = 0x41200001;
           Z[b+7] = *r;
           Z[b+8] = 0x41200001;
           Z[b+9] = *(r+1);
           *a = b;
          }
         else
          {d1 = d; h1 = h; // d1,h1 - sohranjajut
               // veshestv. i mnimuju chasti ishodnogo
               // chisla. d,h - nakopitel rezultata

           if(f & 0xFFFF0000)
            {if(f & 0xFF000000)
              {i = 0x80000000;}
             else
              {i = 0x00800000;}
            }
           else
            {if(f & 0x0000FF00)
              {i = 0x00008000;}
             else
              {i = 0x00000080;}
            }
           while(!(i & f))
            {i >>= 1;}
           while(i != 0x00000001)
            {i >>= 1;
             d2 = d - h; d3 = d + h;
             d2 *= d3; d3 = d * h;
             d3 *= 2;
             d = d2; h = d3;
             if(i & f)
              {d2 = d*d1; d3 = h*h1;
               d2 -= d3;
               d3 = d*h1; d4 = h*d1;
               d3 += d4;
               d = d2; h = d3;
              }
            }
           Z[b+2] = 0x41200001;
           Z[b+3] = *e;
           Z[b+4] = 0x41200001;
           Z[b+5] = *(e+1);
           Z[b+6] = 0x41200001;
           Z[b+7] = *r;
           Z[b+8] = 0x41200001;
           Z[b+9] = *(r+1);
           *a = b;
          }
        }
       else
        {if(Z[c+2] == 0x60200001)
          {p = Z[c+3]; s = Z[f+3];
           if(s < 0)p = 0;
           else
            {w = 1;
             while(s > 0)
              {w *=p; s = s-1;}
             p = w;
            }
           f = mem(6);
           if(f == 0)return;
           Z[f+2] = 0x60200001;
           Z[f+3] = p;
           *a = f;
          }
         else
          {if(Z[f+3] != 0 || Z[f+5] != 0)
            {tipprer = 7; initprer(1); return;}
           f = Z[f+7];
           razvert96(c,R);
           r = R + 10;
           for(i = 1; i <= 7; i++)
            {r[i] = 0;}
           r[2] = 1;
           r[0] = 2;
           e = r + 10;
           n = 0;
           while(f != 0)
            {if(n == 0)
              {for(i = 0; i <= 7; i++)
                {e[i] = 0;}
               p = umnog96(r,R,e);
               if(p != 0)
                {tipprer = 7; initprer(1); return;}
               n = 1;
               f -= 1;
              }
             else
              {for(i = 0; i <= 7; i++)
                {r[i] = 0;}
               p = umnog96(e,R,r);
               if(p != 0)
                {tipprer = 7; initprer(1); return;}
               n = 0;
               f -= 1;
              }
            }
           r = (n == 0 ? r : e);
           f = mem(10);
           if(f == 0) return;
           svert96(r,f);
           *a = f;
          }
        }
      }
     break;
     case 0x00200402: // naturlog
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = log(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x002001FA: // logarifm
     c = *(a+1); f = *(a+2);
     e = (UINT*)&d;r = (UINT*)&h;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     *r = Z[f+3]; *(r+1) = Z[f+5];
     h = (log(h)/log(d));
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *r;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(r+1);
     *a = f;
     break;
     case 0x002001CE: // celajachast
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = floor(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x00200204: // sinus
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = sin(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x0020020F: // cosinus
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = cos(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x00200210: // tangens
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = tan(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x00200211: // cotangens
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = cos(d)/sin(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x0020022C: // arcsinus
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = asin(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x0020022D: // arccosinus
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = acos(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x0020022E: // arctangens
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = atan(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x002004D2: // signum
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     if(d < 0)p = -1;
     else p = 1;
     f = mem(6);
     if(f == 0)return;
     Z[f+2] = 0x60200001;
     Z[f+3] = p;
     *a = f;
     break;
     case 0x002001D4: // modul
     c = *(a+1);
     if(Z[c+2] == 0x40200001)
      {e = (UINT*)&d;
       *e = Z[c+3]; *(e+1) = Z[c+5];
       d = fabs(d);
       f = mem(8);
       if(f == 0)return;
       Z[f+2] = 0x40200001;
       Z[f+3] = *e;
       Z[f+4] = 0x40200001;
       Z[f+5] = *(e+1);
       *a = f;
      }
     else
      {if(Z[c+2] == 0x60200001)
        {p = Z[c+3];
         p = labs(p);
         f = mem(6);
         if(f == 0)return;
         Z[f+2] = 0x60200001;
         Z[f+3] = p;
         *a = f;
        }
       else
        {b = Z[c+3]; i = Z[c+5]; n = Z[c+7];
         f = mem(10);
         if(f == 0)return;
         Z[f+2] = 0x61200001;
         Z[f+3] = (b & 0x7FFFFFFF);
         Z[f+4] = 0x61200001;
         Z[f+5] = i;
         Z[f+6] = 0x61200001;
         Z[f+7] = n;
         *a = f;
        }
      }
     break;
     case 0x00200400: // kvadrkoren
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = sqrt(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x00200403: // eksp
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = exp(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x00200529: // gipsinus
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = sinh(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x0020052A: // gipcosinus
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = cosh(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x00200656: // giptangens
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = tanh(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x00200657: // gipcotangens
     c = *(a+1);
     e = (UINT*)&d;
     *e = Z[c+3]; *(e+1) = Z[c+5];
     d = cosh(d)/sinh(d);
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x0020040C: // net
     e = (UINT*)&notchisl;
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x00200474: // plusbesk
     e = (UINT*)&plusbesk;
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x00200475: // minusbesk
     e = (UINT*)&minusbesk;
     f = mem(8);
     if(f == 0)return;
     Z[f+2] = 0x40200001;
     Z[f+3] = *e;
     Z[f+4] = 0x40200001;
     Z[f+5] = *(e+1);
     *a = f;
     break;
     case 0x0020011F: // Plus (po modulju)
     c = *(a+1); f = *(a+2);
     razvert96(c,R);
     r = R + 300;
     razvert96(f,r);
     e = r + 300;
     c = *(a+3);
     razvert96(c,e);
     plusmod96(R,r,e);
     k = svertdlin(R);
     f = mem(k);
     if(f == 0) return;
     svert96(R,f);
     *a = f;
     break;
     case 0x00200367: // Vichet
     c = *(a+1); f = *(a+2);
     razvert96(c,R);
     r = R + 300;
     razvert96(f,r);
     e = r + 300;
     g = e + 300;
     delenie96(R,r,e,g);
     k = svertdlin(g);
     f = mem(k);
     if(f == 0) return;
     svert96(g,f);
     *a = f;
     break;
     case 0x00200153: // Minus (po modulju)
     c = *(a+1); f = *(a+2);
     razvert96(c,R);
     r = R + 300;
     razvert96(f,r);
     minusmod96(R,r);
     k = svertdlin(R);
     f = mem(k);
     if(f == 0) return;
     svert96(R,f);
     *a = f;
     break;
     case 0x002001B8: // Umnogenie (po modulju)
     c = *(a+1); f = *(a+2); k = *(a+3);
     if(Z[k] == 6 && !(Z[k+3] & 0xFFFF0000))
      {n = Z[c+3] * Z[f+3];
       n %= Z[k+3];
       f = mem(6);
       if(f == 0)return;
       Z[f+2] = 0x61200001;
       Z[f+3] = n;
      }
     else
      {razvert96(c,R);
       r = R + 300;
       razvert96(f,r);
       e = r + 300;
       razvert96(k,e);
       g = e + 300;
       umnogmod96(R,r,e,g);
       k = svertdlin(g);
       f = mem(k);
       if(f == 0) return;
       svert96(g,f);
      }
     *a = f;
     break;
     case 0x002001C2: // Drob (po modulju)
     c = *(a+1); f = *(a+2); k = *(a+3);
     if(Z[k] == 6 && !(Z[k+3] & 0xFFFF0000))
      {n = delmod96(Z[c+3],Z[f+3],Z[k+3]);
       f = mem(6);
       if(f == 0)return;
       Z[f+2] = 0x61200001;
       Z[f+3] = n;
      }
     else
      {razvert96(c,R);
       r = R + 300;
       razvert96(f,r);
       e = r + 300;
       razvert96(k,e);
       g = e + 300;
       deleniemod96(R,r,e,g);
       k = svertdlin(g);
       f = mem(k);
       if(f == 0) return;
       svert96(g,f);
      }
     *a = f;
     break;
     case 0x00200BCD: // plusmn
     c = *(a+1); f = *(a+2);
     if(Z[c+2] == L0)
      {k = Z[c+4];
       if(Z[k+2] == 0x40200001)
        {razvertmn(c,R);
         k = R[0] + 1000;
         k <<= 2;
         r = R + k;
         razvertmn(f,r);
         plusmn(R,r);
         k = svertmn(R);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         *a = k;
        }
       else
        {razvmnkomp(c,R);
         k = R[0] + 1000;
         k <<= 4;
         r = R + k;
         razvmnkomp(f,r);
         plusmnkomp(R,r);
         k = svertmnkomp(R);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         *a = k;
        }
      }
     else
      {if(Z[f+2] == L0)
        {*a = c;}
       else
        {e = (UINT*)IZ;
         razvertmn96(c,e);
         k = e[0] + 2;
         k <<= 8;
         r = e + k;
         razvertmn96(f,r);
         p = plusmn96(r,e);
         if(p != 0)
          {tipprer = 7; initprer(1); return;}
         k = svertmn96(r);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         *a = k;
        }
      }
     break;
     case 0x00200BCE: // umnogeniemn
     c = *(a+1); f = *(a+2);
     if(Z[c+2] == L0)
      {k = Z[c+4];
       if(Z[k+2] == 0x40200001)
        {razvertmn(c,R);
         k = R[0] + 1;
         k <<= 2;
         r = R + k;
         razvertmn(f,r);
         k = r[0] + 1;
         k <<= 2;
         e = r + k;
         umnogmn(R,r,e);
         k = svertmn(e);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         *a = k;
        }
       else
        {razvmnkomp(c,R);
         k = R[0] + 1;
         k <<= 4;
         r = R + k;
         razvmnkomp(f,r);
         k = r[0] + 1;
         k <<= 4;
         e = r + k;
         umnogmnkomp(R,r,e);
         k = svertmnkomp(e);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         *a = k;
        }
      }
     else
      {if(Z[f+2] == L0)
        {*a = c;}
       else
        {g = (UINT*)IZ;
         razvertmn96(c,g);
         k = g[0] + 2;
         k <<= 8;
         r = g + k;
         razvertmn96(f,r);
         k = r[0] + 2;
         k <<= 8;
         e = r + k;
         p = umnogmn96(g,r,e);
         if(p != 0)
          {tipprer = 7; initprer(1); return;}
         k = svertmn96(e);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         *a = k;
        }
      }
     break;
     case 0x00200BA2: // domnogmn
     c = *(a+1); f = *(a+2);
     if(Z[c+2] == L0)
      {k = Z[c+4];
       if(Z[k+2] == 0x40200001)
        {razvertmn(c,R);
         e = (UINT*)&d;
         *e = Z[f+3]; *(e+1) = Z[f+5];
         domnogmn(R,d);
         k = svertmn(R);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         *a = k;
        }
       else
        {razvmnkomp(c,R);
         e = (UINT*)&d;
         e1 = (UINT*)&d1;
         *e = Z[f+3]; *(e+1) = Z[f+5];
         *(e1) = Z[f+7]; *(e1+1) = Z[f+9];
         domnogmnkomp(R,d,d1);
         k = svertmnkomp(R);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         *a = k;
        }
      }
     else
      {g = (UINT*)IZ;
       razvertmn96(c,g);
       k = g[0] + 2;
       k <<= 8;
       r = g + k;
       razvert96(f,r);
       domnogmn96(g,r);
       k = svertmn96(g);
       if(k == 0xFFFFFFFF)
        {tipprer = 7; initprer(1); return;}
       *a = k;
      }
     break;
     case 0x00200A3F: // minusmn
     c = *(a+1);
     if(Z[c+2] == L0)
      {k = Z[c+4];
       if(Z[k+2] == 0x40200001)
        {razvertmn(c,R);
         minusmn(R);
         k = svertmn(R);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         *a = k;
        }
       else
        {razvmnkomp(c,R);
         minusmnkomp(R);
         k = svertmnkomp(R);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         *a = k;
        }
      }
     else
      {g = (UINT*)IZ;
       razvertmn96(c,g);
       minusmn96(g);
       k = svertmn96(g);
       if(k == 0xFFFFFFFF)
        {tipprer = 7; initprer(1); return;}
       *a = k;
      }
     break;
     case 0x002002C9: // koefficientmn
     c = *(a+1);
     k = *(a+2);
     k = Z[k+3]; k <<= 1;
     k += 4;
     n = Z[c];
     n -= 2;
     if(k < n)
      {c += k; p = Z[c]; *a= p;}
     else
      {n = Z[n+4];
       if(n == 0x40200001)
        {f = mem(8);
         if(f == 0)return;
         Z[f+2] = 0x40200001;
         Z[f+3] = 0;
         Z[f+4] = 0x40200001;
         Z[f+5] = 0;
         *a = f;
        }
       else
        {if(n == 0x41200001)
          {f = mem(12);
           if(f == 0)return;
           Z[f+2] = 0x41200001;
           Z[f+3] = 0;
           Z[f+4] = 0x41200001;
           Z[f+5] = 0;
           Z[f+6] = 0x41200001;
           Z[f+7] = 0;
           Z[f+8] = 0x41200001;
           Z[f+9] = 0;
           *a = f;
          }
         else
          {f = mem(6);
           if(f == 0)return;
           Z[f+2] = n;
           Z[f+3] = 0;
           *a = f;
          }
        }
      }
     break;
     case 0x0020082C: // koeff
     c = *(a+1);
     k = *(a+2);
     k -= 0x00200104;
     k <<= 1;
     k += 4;
     n = Z[c];
     n -= 2;
     if(k < n)
      {c += k; p = Z[c]; *a= p;}
     else
      {n = Z[n+4];
       if(n == 0x40200001)
        {f = mem(8);
         if(f == 0)return;
         Z[f+2] = 0x40200001;
         Z[f+3] = 0;
         Z[f+4] = 0x40200001;
         Z[f+5] = 0;
         *a = f;
        }
       else
        {if(n == 0x41200001)
          {f = mem(12);
           if(f == 0)return;
           Z[f+2] = 0x41200001;
           Z[f+3] = 0;
           Z[f+4] = 0x41200001;
           Z[f+5] = 0;
           Z[f+6] = 0x41200001;
           Z[f+7] = 0;
           Z[f+8] = 0x41200001;
           Z[f+9] = 0;
           *a = f;
          }
         else
          {f = mem(6);
           if(f == 0)return;
           Z[f+2] = n;
           Z[f+3] = 0;
           *a = f;
          }
        }
      }
     break;
     case 0x00200BCF: // stepenmn
     c = *(a+1);
     k = Z[c]; k -= 4;
     k >>= 1;
     k -= 2;
     f = mem(6);
     if(f == 0)return;
     Z[f+2] = 0x60200001;
     Z[f+3] = k;
     *a = f;
     break;
     case 0x00200C49: // vichetmn
     c = *(a+1); f = *(a+2);
     if(Z[c+2] == L0)
      {razvertmn(c,R);
       k = R[0] + 1;
       k <<= 2;
       r = R + k;
       razvertmn(f,r);
       k = r[0] + 1;
       k <<= 2;
       e = r + k;
       k = delmnog(R,r,e);
       if(k == 0)
        {tipprer = 7; initprer(1); return;}
       k = svertmn(R);
       if(k == 0xFFFFFFFF)
        {tipprer = 7; initprer(1); return;}
       *a = k;
      }
     else
      {g = (UINT*)IZ;
       razvertmn96(c,g);
       k = g[0] + 2;
       k <<= 8;
       r = g + k;
       razvertmn96(f,r);
       k = r[0] + 2;
       k <<= 8;
       e = r + k;
       k = delmnog96(g,r,e);
       if(k != 0)
        {tipprer = 7; initprer(1); break;}
       k = svertmn96(g);
       if(k == 0xFFFFFFFF)
        {tipprer = 7; initprer(1); return;}
       *a = k;
      }
     break;
     case 0x0020102F: // Kompleksnoe
     f = mem(12);
     c = *(a+1);
     if(f == 0)return;
     Z[f+2] = 0x41200001;
     Z[f+3] = Z[c+3];
     Z[f+4] = 0x41200001;
     Z[f+5] = Z[c+5];
     Z[f+6] = 0x41200001;
     Z[f+7] = 0;
     Z[f+8] = 0x41200001;
     Z[f+9] = 0;
     *a = f;
     break;
     case 0x00200092: // copija
     c = *(a+1);
     if(Z[c+2] == 0x40200001)
      {f = mem(8);
       if(f == 0)return;
       Z[f+2] = 0x40200001;
       Z[f+3] = Z[c+3];
       Z[f+4] = 0x40200001;
       Z[f+5] = Z[c+5];
       *a = f;
      }
     else
      {if(Z[c+2] == 0x41200001)
        {f = mem(12);
         if(f == 0)return;
         Z[f+2] = 0x41200001;
         Z[f+3] = Z[c+3];
         Z[f+4] = 0x41200001;
         Z[f+5] = Z[c+5];
         Z[f+6] = 0x41200001;
         Z[f+7] = Z[c+7];
         Z[f+8] = 0x41200001;
         Z[f+9] = Z[c+9];
         *a = f;
        }
       else
        {if(Z[c+2] == 0x60200001)
          {p = Z[c+3];
           f = mem(6);
           if(f == 0)return;
           Z[f+2] = 0x60200001;
           Z[f+3] = p;
           *a = f;
          }
         else
          {b = Z[c+3]; i = Z[c+5]; n = Z[c+7];
           f = mem(10);
           if(f == 0)return;
           Z[f+2] = 0x61200001;
           Z[f+3] = b;
           Z[f+4] = 0x61200001;
           Z[f+5] = i;
           Z[f+6] = 0x61200001;
           Z[f+7] = n;
           *a = f;
          }
        }
      }
     break;

    }
    st=a; st++;
   }

   void F51() // Vich
   {UINT *a,b,c,*d,e,f,*g,i,j,k,s,l,t,*h;
    signed long m,n,v;
    ldiv_t r;
    double p,q,p1,q1,p2,q2;
    double *u;
    UINT64 h1;
    st--; a = st - (*st-L0);
    switch(*a)
    {case 0x002000BA: // nabor
     b= *(a+1); c = *(a+2);
     c = convchisl(c);
     if(b == 0x00200196)
      c *= 8;
     else
      {if(b == 0x002001E1)
        c *= 4;
       else
        c *= 16;
      }
     e = mem(8);
     if(e == 0) return;
     d = (UINT*)calloc(c,1);
     if(b == 0x00200196)
      Z[e+2] = 0x50200001;
     else
      {if(b == 0x002001E1)
        Z[e+2] = 0x70200001;
       else
        Z[e+2] = 0x71200001;
      }
     h1 = reinterpret_cast<UINT64>(d);
     s = (UINT)(h1 >> 32);
     h1 &= 0xFFFFFFFF;
     l = (UINT)(h1);
     Z[e+3] = l;
     Z[e+4] = Z[e+2];
     Z[e+5] = s;
     opr(*(a+3),e);
     break;
     case 0x00200071: // zapis
     b = *(a+1); h1 = (UINT64)Z[b+5];
     h1 <<= 32;
     h1 |= Z[b+3];
     d = reinterpret_cast<UINT*>(h1);
     c = *(a+2);i = Z[c+3];
     c = *(a+3);
     if(Z[c] == 6)
      d[i] = Z[c+3];
     else
      {if(Z[c] == 8)
        {i *= 2;
         d[i] = Z[c+3];
         d[i+1] = Z[c+5];
        }
       else
        {i *= 4;
         d[i] = Z[c+3];
         d[i+1] = Z[c+5];
         d[i+2] = Z[c+7];
         d[i+3] = Z[c+9];
        }
      }
     break;
     case 0x002001B5: // chetnoe
     b = *(a+1);
     if(Z[b+2] == 0x60200001)
      {c = Z[b+3]; c &= 0x00000001;
       if(c != 0)
        {ist = 0;}
      }
     else
      {b += Z[b];
       b -= 3;
       c = Z[b];
       if(c != 0)
        {ist = 0;}
      }
     break;
     case 0x002001A4: // delenie
     b = *(a+1); c = *(a+2);
     if(Z[b+2] == 0x60200001)
      {m = Z[b+3]; n = Z[c+3];
       r = ldiv(m,n);
       e = mem(6);
       if(e == 0)return;
       Z[e+2] = 0x60200001;
       Z[e+3] = r.quot;
       *st = e;st++;
       f = mem(6);
       if(f == 0)return;
       Z[f+2] = 0x60200001;
       Z[f+3] = r.rem;
       opr(*(a+3),*(st-1));
       opr(*(a+4),f);
      }
     else
      {razvert96(b,R);
       d = R + 300;
       razvert96(c,d);
       g = d + 300;
       h = g + 300;
       p = delenie96(R,d,g,h);
       if(p != 0)
        {tipprer = 7; initprer(1); return;}
       k = svertdlin(g);
       f = mem(k);
       if(f == 0) return;
       svert96(g,f);
       *st = f; st++;
       k = svertdlin(h);
       f = mem(k);
       if(f == 0) return;
       svert96(h,f);
       opr(*(a+3),*(st-1));
       opr(*(a+4),f);
      }
     break;
     case 0x002000D3: // menshe
     b = *(a+1); c = *(a+2);
     if(Z[b+2] == 0x40200001)
      {d = (UINT*)&p; g = (UINT*)&q;
       *d = Z[b+3]; *(d+1) = Z[b+5];
       *g = Z[c+3]; *(g+1) = Z[c+5];
       if(q <= p)ist = 0;
      }
     else
      {if(Z[b+2] == 0x60200001)
        {m = Z[b+3]; n = Z[c+3];
         if(n <= m)ist = 0;
        }
       else
        {m = Z[b+3] & 0x80000000;
         n = Z[c+3] & 0x80000000;
         if(m == 0 && n != 0)ist = 0;
         else
          {if(m == n)
            {if(Z[b] < Z[c])
              {if(m != 0)ist = 0;}
             else
              {if(Z[b] > Z[c])
                {if(m == 0)ist = 0;}
               else
                {i = b+3; j = c+3; ist = 0;
                 while(!(Z[i-1] & 0x80000000))
                  {if(Z[i] < Z[j])
                    {if(m == 0)ist = 1;
                     break;
                    }
                   else
                    {if(Z[i] > Z[j])
                      {if(m != 0)ist = 1;
                       break;
                      }
                     i += 2; j += 2;
                    }
                  }
                }
              }
            }
          }
        }
      }
     break;
     case 0x002003B6: // mensheiliravno
     b = *(a+1); c = *(a+2);
     if(Z[b+2] == 0x40200001)
      {d = (UINT*)&p;g = (UINT*)&q;
       *d = Z[b+3]; *(d+1) = Z[b+5];
       *g = Z[c+3]; *(g+1) = Z[c+5];
       if(q < p)ist = 0;
      }
     else
      {if(Z[b+2] == 0x60200001)
        {m = Z[b+3]; n = Z[c+3];
         if(n < m)ist = 0;
        }
       else
        {m = Z[b+3] & 0x80000000;
         n = Z[c+3] & 0x80000000;
         if(m == 0 && n != 0)ist = 0;
         else
          {if(m == n)
            {if(Z[b] < Z[c])
              {if(m != 0)ist = 0;}
             else
              {if(Z[b] > Z[c])
                {if(m == 0)ist = 0;}
               else
                {i = b+3; j = c+3; ist = 1;
                 while(!(Z[i-1] & 0x80000000))
                  {if(Z[i] < Z[j])
                    {if(m != 0)ist = 0;
                     break;
                    }
                   else
                    {if(Z[i] > Z[j])
                      {if(m == 0)ist = 0;
                       break;
                      }
                     i += 2; j += 2;
                    }
                  }
                }
              }
            }
          }
        }
      }
     break;
     case 0x002000BB: // ravno
     b = *(a+1); c = *(a+2);
     if(Z[b+2] == 0x40200001)
      {d = (UINT*)&p;g = (UINT*)&q;
       *d = Z[b+3]; *(d+1) = Z[b+5];
       *g = Z[c+3]; *(g+1) = Z[c+5];
       if(q != p)ist = 0;
      }
     else
      {if(Z[b+2] == 0x60200001)
        {m = Z[b+3]; n = Z[c+3];
         if(n != m)ist = 0;
        }
       else
        {i = b+3; j = c+3;
         while(!(Z[i-1]&0x80000000))
          {if(Z[i] != Z[j])
            {ist = 0; break;}
           i += 2; j += 2;
          }
        }
      }
     break;
     case 0x00200060: // izmenenie
     b = *(a+1); c = *(a+2);
     if(Z[b+2] == 0x40200001)
      {e = Z[c+3]; Z[b+3] = e;
       f = Z[c+5]; Z[b+5] = f;
      }
     else
      {if(Z[b+2] == 0x60200001)
        {e = Z[c+3]; Z[b+3] = e;
        }
       else
        {if(Z[c] == Z[b])
          {i = b+3; j = c+3;
           while(!(Z[i-1]&0x80000000))
            {e = Z[j]; Z[i] = e;
             i += 2; j += 2;
            }
          }
         else
          {tipprer = 7; initprer(1); return;}
        }
       }
     break;
     case 0x00200104: // nolb
     b = *(a+1);
     if(Z[b+2] == 0x40200001)
      {d = (UINT*)&p;
       *d = Z[b+3]; *(d+1) = Z[b+5];
       if(p == 0)ist = 0;
      }
     else
      {if(Z[b+2] == 0x60200001)
        {m = Z[b+3];
         if(m == 0)ist = 0;
        }
       else
        {ist = 0;
         i = b+3;
         while(!(Z[i-1] & 0x80000000))
          {if(Z[i] != 0)
            {ist = 1; break;}
           i += 2;
          }
        }
      }
     break;
     case 0x002003D9: // chastnoemn
     b = *(a+1); c = *(a+2);
     if(Z[b+2] == L0)
      {k = Z[b+4];
       if(Z[k+2] == 0x40200001)
        {razvertmn(b,R);
         k = R[0] + 1;
         k <<= 2;
         g = R + k;
         razvertmn(c,g);
         k = g[0] + 1;
         k <<= 2;
         h = g + k;
         k = delmnog(R,g,h);
         if(k == 0)
          {tipprer = 7; initprer(1); return;}
         k = svertmn(h);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         opr(*(a+3),k);
         k = svertmn(R);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         opr(*(a+4),k);
        }
       else
        {razvmnkomp(b,R);
         k = R[0] + 1;
         k <<= 4;
         g = R + k;
         razvmnkomp(c,g);
         k = g[0] + 1;
         k <<= 4;
         h = g + k;
         k = delmnogkomp(R,g,h);
         if(k == 0)
          {tipprer = 7; initprer(1); return;}
         k = svertmnkomp(h);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         opr(*(a+3),k);
         k = svertmnkomp(R);
         if(k == 0xFFFFFFFF)
          {tipprer = 7; initprer(1); return;}
         opr(*(a+4),k);
        }
      }
     else
      {d = (UINT*)IZ;
       razvertmn96(b,d);
       k = d[0] + 2;
       k <<= 8;
       g = d + k;
       razvertmn96(c,g);
       k = g[0] + 2;
       k <<= 8;
       h = g + k;
       k = delmnog96(d,g,h);
       if(k != 0)
        {ist = 0; break;}
       k = svertmn96(h);
       if(k == 0xFFFFFFFF)
        {tipprer = 7; initprer(1); return;}
       opr(*(a+3),k);
       k = svertmn96(d);
       if(k == 0xFFFFFFFF)
        {tipprer = 7; initprer(1); return;}
       opr(*(a+4),k);
      }
     break;
     case 0x00200E77: // ostatokmn
     b = *(a+1); c = *(a+2);
     d = (UINT*)IZ;
     razvertmn96(b,d);
     k = d[0] + 2;
     k <<= 8;
     g = d + k;
     razvertmn96(c,g);
     k = ostmn96(d,g);
     if(k != 0)
      {ist = 0; break;}
     k = svertmn96(d);
     if(k == 0xFFFFFFFF)
      {tipprer = 7; initprer(1); return;}
     opr(*(a+3),k);
     break;
     case 0x00200FDD: // standmn
     c = *(a+1);
     k = Z[c+4];
     if(Z[k+2] == 0x40200001)
      {razvertmn(c,R);
       k = R[0];
       u = (double*)(R+1);
       p = 1/(u[k-1]);
       u[k-1] = 1;
       for(i = 0; i < k-1; i++)
        {u[i] *= p;}
       f = svertmn(R);
       opr(*(a+2),f);
       g = (UINT*)&p;
       s = mem(8);
       if(s == 0)return;
       Z[s+2] = 0x40200001;
       Z[s+3] = *g;
       Z[s+4] = 0x40200001;
       Z[s+5] = *(g+1);
       opr(*(a+3),s);
      }
     else
      {razvmnkomp(c,R);
       k = R[0]; k <<= 1;
       u = (double*)(R+1);
       p = u[k-2];
       q = u[k-1];
       p1 = p*p;
       q1 = q*q;
       q1 += p1;
       p1 = p/q1;
       q1 = q/q1;
       q1 = -q1;
       u[k-2] = 1;
       u[k-1] = 0;
       for(i = 0; i < k-2; i += 2)
        {p = u[i];
         q = u[i+1];
         p2 = p*p1;
         q2 = q*q1;
         p2 -= q2;
         u[i] = p2;
         p2 = p*q1;
         q2 = q*p1;
         p2 += q2;
         u[i+1] = p2;
        }
       f = svertmnkomp(R);
       opr(*(a+2),f);
       g = (UINT*)&p1;
       s = mem(12);
       if(s == 0) return;
       Z[s+2] = 0x41200001;
       Z[s+3] = *g;
       Z[s+4] = 0x41200001;
       Z[s+5] = *(g+1);
       g = (UINT*)&q1;
       Z[s+6] = 0x41200001;
       Z[s+7] = *g;
       Z[s+8] = 0x41200001;
       Z[s+9] = *(g+1);
       opr(*(a+3),s);
      }
     break;
     case 0x00200020: // programma
     b = *(a+1); c = *(a+2); s = *(a+3);
     b += 2;
     if(c != L3)
      {k = c + 2; d = (UINT*)&p;
       i = 0;
       while(!(Z[k]&T1))
        {e = Z[k];
         *d = Z[e+3]; *(d+1) = Z[e+5];
         chislp[i] = p;
         i++;
         k += 2;
        }
      }
     if(s != L3)
      {k = s + 2; i = 0;
       while(!(Z[k]&T1))
        {e = Z[k];
         m = Z[e+3];
         chislc[i] = m;
         i++;
         k += 2;
        }
      }
     while(!(Z[b]&T1))
      {e = Z[b]; e += 2; b += 2; k = Z[e];
       switch(k)
       {case 0x00200105: // plus plav.zap.
        i = Z[e+2]; j = Z[e+4]; l = Z[e+6];
        chislp[l-0x00200105] =
        chislp[i-0x00200105]+chislp[j-0x00200105];
        break;
        case 0x00200106: // plus celoe
        i = Z[e+2]; j = Z[e+4]; l = Z[e+6];
        chislc[l-0x00200105] =
        chislc[i-0x00200105]+chislc[j-0x00200105];
        break;
        case 0x00200107: // minus plav.zap.
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] = - chislp[i-0x00200105];
        break;
        case 0x00200108: // minus celoe
        i = Z[e+2];j = Z[e+4];
        chislc[j-0x00200105] = - chislc[i-0x00200105];
        break;
        case 0x00200109: // umnog. plav.zap.
        i = Z[e+2]; j = Z[e+4]; l = Z[e+6];
        chislp[l-0x00200105] =
        chislp[i-0x00200105]*chislp[j-0x00200105];
        break;
        case 0x0020010A: // umnog. celoe
        i = Z[e+2]; j = Z[e+4]; l = Z[e+6];
        chislc[l-0x00200105] =
        chislc[i-0x00200105]*chislc[j-0x00200105];
        break;
        case 0x0020010B: // delenie plav.zap.
        i = Z[e+2]; j = Z[e+4]; l = Z[e+6];
        p = chislp[j-0x00200105];
        if(p == 0)
         {ist = 0; st = a; return;}
        else
        chislp[l-0x00200105] =
        chislp[i-0x00200105]/p;
        break;
        case 0x0020010C: // delenie s ostatkom celoe.
        i = Z[e+2]; j = Z[e+4];
        l = Z[e+6]; t = Z[e+8];
        if(chislc[j-0x00200105] == 0)
         {ist = 0; st=a; return;}
        r = ldiv(chislc[i-0x00200105],chislc[j-0x00200105]);
        chislc[l-0x00200105] = r.quot;
        chislc[t-0x00200105] = r.rem;
        break;
        case 0x0020010D: // stepen plav.zap.
        i = Z[e+2]; j = Z[e+4]; l = Z[e+6];
        p = chislp[j-0x00200105];
        if(chislp[i-0x00200105] < 0)
        {m = (signed long)p; q = (double)m;
         if(p != q)
          {ist = 0; st = a; return;}
        }
        if(p == 0 && chislp[i-0x00200105] == 0)
         {ist = 0; st = a; return;}
        chislp[l-0x00200105] =
        pow(chislp[i-0x00200105],p);
        break;
        case 0x0020010E: // exp
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] = exp(chislp[i-0x00200105]);
        break;
        case 0x0020010F: // stepen celoe.
        i = Z[e+2]; j = Z[e+4]; l = Z[e+6];
        m = chislc[i-0x00200105];
        n = chislc[j-0x00200105];
        v=1;
        while(0<n)
        {v *= m;n -= 1;}
        chislc[l-0x00200105] = v;
        break;
        case 0x00200110: // modul plav.zap.
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] = fabs(chislp[i-0x00200105]);
        break;
        case 0x00200111: // modul celoe
        i = Z[e+2];j = Z[e+4];
        chislc[j-0x00200105] = labs(chislc[i-0x00200105]);
        break;
        case 0x00200112: // ln
        i = Z[e+2];j = Z[e+4];
        if(chislp[i-0x00200105] <= 0)
         {ist = 0; st = a; return;}
        chislp[j-0x00200105] = log(chislp[i-0x00200105]);
        break;
        case 0x00200113: // logarifm
        i = Z[e+2]; j = Z[e+4]; l = Z[e+6];
        p = chislp[i-0x00200105];
        if(p <= 0)
          {ist = 0; st = a; return;}
        p = log(p);
        if(p == 0)
          {ist = 0; st = a; return;}
        q = chislp[j-0x00200105];
        if(q <= 0)
          {ist = 0; st = a; return;}
        chislp[l-0x00200105] =
        log(q)/p;
        break;
        case 0x00200114: // kvadr.koren
        i = Z[e+2];j = Z[e+4];
        p = chislp[i-0x00200105];
        if(p < 0)
          {ist = 0; st = a; return;}
        chislp[j-0x00200105] = sqrt(p);
        break;
        case 0x00200115: // sin
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] = sin(chislp[i-0x00200105]);
        break;
        case 0x00200116: // cos
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] = cos(chislp[i-0x00200105]);
        break;
        case 0x00200117: // tg
        i = Z[e+2];j = Z[e+4];
        p = cos(chislp[i-0x00200105]);
        if(p == 0)
          {ist = 0; st = a; return;}
        chislp[j-0x00200105] = sin(chislp[i-0x00200105])/p;
        break;
        case 0x00200118: // ctg
        i = Z[e+2];j = Z[e+4];
        p = sin(chislp[i-0x00200105]);
        if(p == 0)
          {ist = 0; st = a; return;}
        chislp[j-0x00200105] =
        cos(chislp[i-0x00200105])/p;
        break;
        case 0x00200119: // sec
        i = Z[e+2];j = Z[e+4];
        p = cos(chislp[i-0x00200105]);
        if(p == 0)
          {ist = 0; st = a; return;}
        chislp[j-0x00200105] = 1/p;
        break;
        case 0x0020011A: // cosec
        i = Z[e+2];j = Z[e+4];
        p = sin(chislp[i-0x00200105]);
        if(p == 0)
          {ist = 0; st = a; return;}
        chislp[j-0x00200105] = 1/p;
        break;
        case 0x0020011B: // arcsin
        i = Z[e+2];j = Z[e+4];
        p = chislp[i-0x00200105];
        if( p < -1 || 1 < p)
          {ist = 0; st = a; return;}
        chislp[j-0x00200105] = asin(p);
        break;
        case 0x0020011C: // arccos
        i = Z[e+2];j = Z[e+4];
        p = chislp[i-0x00200105];
        if(p < -1 || 1 < p)
          {ist = 0; st = a; return;}
        chislp[j-0x00200105] = acos(p);
        break;
        case 0x0020011D: // arctg
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] = atan(chislp[i-0x00200105]);
        break;
        case 0x0020011E: // arcctg
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] =
        (pi/2) - atan(chislp[i-0x00200105]);
        break;
        case 0x0020011F: // sh
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] = sinh(chislp[i-0x00200105]);
        break;
        case 0x00200120: // ch
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] = cosh(chislp[i-0x00200105]);
        break;
        case 0x00200121: // th
        i = Z[e+2];j = Z[e+4];
        p = cosh(chislp[i-0x00200105]);
        if(p == 0)
          {ist = 0; st = a; return;}
        chislp[j-0x00200105] = sinh(chislp[i-0x00200105])/p;
        break;
        case 0x00200122: // cth
        i = Z[e+2];j = Z[e+4];
        p = sinh(chislp[i-0x00200105]);
        if(p == 0)
          {ist = 0; st = a; return;}
        chislp[j-0x00200105] =
        cosh(chislp[i-0x00200105])/p;
        break;
        case 0x00200123: // sg
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] =
        (chislp[i-0x00200105]<0 ? -1 : 1);
        break;
        case 0x00200124: // peresilka.
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] = chislp[i-0x00200105];
        break;
        case 0x00200125: // celajachast
        i = Z[e+2];j = Z[e+4];
        chislp[j-0x00200105] = floor(chislp[i-0x00200105]);
        break;

       }

      }
      if(c != L3)
      {k = c + 2; d = (UINT*)&p;
       i = 0;
       while(!(Z[k]&T1))
        {e = Z[k];
         p = chislp[i];
         Z[e+3] = *d; Z[e+5] = *(d+1);
         i++;
         k += 2;
        }
      }
      if(s != L3)
      {k = s + 2; i = 0;
       while(!(Z[k]&T1))
        {e = Z[k];
         m = chislc[i];
         Z[e+3] = m;
         i++;
         k += 2;
        }
      }

     break;
    }
    st=a;
   }

   void F52() // TEKUSHAJAZADACHA

	{UINT a;
     if(tekzad == 0)
      {a = lcadr; while(S[a+2] != 1)a = S[a+1];
	   opr(*(st-1),S[a+9]);st--;
      }
     else
      {opr(*(st-1),tekzad); st--;
      }
	}

	void F53() // KONKATENACIJA

	{UINT a,*b,*c,d,e,f,g;
	  st--;a = *st - L0;b = st - a;d = 4;
	  for(c = b;c != st;c++)
		 {if(*c & T6)
			 {if(*c != L3)d += 2;}   // d - dlina rezultata
		  else
        {f = *c;
         if(!(Z[f+1] & T1))
          {tipprer = 7;st++;initprer(1);return;}
         d += (Z[f] - 4);
        }
		 }
	  if(d == 4){*b = L3;st = b + 1;return;}
	  e = mem(d);if(e == 0)return; f = e + 2;
	  for(c = b;c != st;c++)
		{if(*c & T6)
		  {if(*c != L3){Z[f] = *c;Z[f+1] = 0;f += 2;}
		  }
		 else {d = (*c) + 2;g = (*c) + Z[*c] - 2;
				  while(d < g)
					 {Z[f] = Z[d];Z[f+1] = 0;f += 2;d += 2;}
				}
		}
     if(Z[e] == 6 && Z[e+2] & T6)Z[e+3] = 0x00030002;
	  *b = e;st = b + 1;
	}

	void F54() // VICHERKIVANIE

	{UINT a,b,c,*d,e,f;
	  a = *(st-2);if(a == L3){st--;return;}
	  b = *(st-1);if(b == L3){st--;return;}
     if(a & T6 || b & T6 || !(Z[a+1] & T1) ||
         !(Z[b+1] & T1))
     {tipprer = 7;initprer(1);return;}
	  b += 2;
	  for(c = 0;!(Z[b] & T1);b += 2,c++)R[c] = Z[b];
	  d = st;
	  for(e = a + 2;!(Z[e] & T1);e += 2)
		{*st = Z[e];st++;
		 for(f = 0;f < c;f++)
			if(R[f] != 0 && sravn(R[f],*(st-1)))
			  {R[f] = 0;st--;break;}
		}
	  if(d == st) {st--;*(st-1) = L3;return;}
	  *(d-2) = text1(d);st--;
	}

	void F55() // POZICIA

	{UINT a; st -= 2;a = *(st+1);tec++;
	  if(a == L3){ist = 0;return;}
     if(!(*st & T1) || (a & T6) || !(Z[a+1] & T1))
     {tipprer = 7;tec--;st += 2;initprer(1);return;}
	  else {cadrprod(12);opr(*st,a+2);if(ind == 4)return;
				S[lcadr + 9] = a;S[lcadr + 10] = a + 2;
				S[lcadr +11] = *st;
			  }
	}
	void F56()  //SPRAVKA

	{UINT c,d,e,f,*g;
    if(blokprer == 0)
	 {g = st;c = S[lcadr];
     if(delta == 1 && c > 14500)
      {ind = 4;tipprer = 2;return;}
	  S[c+1] = lcadr;S[c+2] = 3;S[c+3] = cadr;
	  S[c+4] = nomprog |(fragm << 16);
	  S[c+5] = (tec - A)|(level << 16);
	  S[c+6] = *(st - (*(st-1)- L0 +3));
      SD[c] = 0; SD[c+1] = 0; SD[c+2] = 0; SD[c+3] = 0;
	  d = *(st-1)- L0;S[c] = c + d + 20;
      S[c+7] = 0x00200038;
	  S[c+8] = d + 9;st -= 2;
	  for(e = S[c+8] - 1;d > 0;d--)
      {S[c + e] = *st;st--;e--;}
	  f = S[c] - c;
	  for(e = S[c+8];e < f;e++)S[c + e] = 0;
     if(*st & 0x00400000)
     {*(st-1) = 0x00200104;return;}
     if(!(*st & 0x00200000))
     {st = g;tipprer = 7;initprer(1);return;}
	  symbol = *st;tec = 0;cadr = c;lcadr = c;
	  st--;
    }
     nachprog();
    level = 0;
	}

	void F57() // BUKVA

	{UINT a;
    st--;a = *st;
    if((a & T6) || (Z[a+1] & T1))
    {tipprer = 7;st++;initprer(1);return;}
    *st = Z[a];st++;
   }

	void F58() // SIMVOL

	{UINT a;
    st -= 2;a = *st;
    if((a & T6) || (Z[a+1] & T1))
    {tipprer = 7;st += 2;initprer(1);return;}
    if(*(st+1) & T1)opr(*(st+1),Z[a]);
	 else ist = sravn(Z[a],*(st+1));
	}

	void F59() // PEREMENNAJA

	{st--; if(!(*st & T7)) ist = 0;}

	void F60() // PODCHINENO

	{UINT a,b,c;
	  st -= 2;tec++;a = *st;b = *(st+1);
	  if(a & T1)
		 {if(b & T6 || Z[b+1] & T1)
        {tipprer = 7;st += 2;tec--;initprer(1);return;}
        cadrprod(13);opr(a,b);
        if(ind == 4)return;S[lcadr + 9] = 0x00200001;
		  S[lcadr + 10] = b;
        S[lcadr + 11] = b + (Z[b+1] & T4);
		  S[lcadr + 12] = a;
		 }
	  else {if(b & T1)
				{if(a & T6 || Z[a+1] & T1)
             {tipprer = 7;st += 2;tec--;
              initprer(1);return;}
             c = Z[a+1] >> 16;
             if(c == 3){ist = 0;return;}c = a - c;
				 cadrprod(12);opr(b,c);
             if(ind == 4)return;
             S[lcadr + 9] = 0x00200002;
				 S[lcadr + 10] = c;S[lcadr + 11] = b;
				}
			  else {if(a & T6 || b & T6 || Z[a+1] & T1
                    || Z[b+1] & T1)
                 {tipprer = 7;st += 2;
                  tec--;initprer(1);return;}
                 if(a < b){ist = 0;return;}
					  if(a >= b + (Z[b+1] & T4))
                  {ist = 0;return;}
					 }
			 }
	}

	void F61() // OPERAND

	{UINT a,b,c;
	  st -= 2;tec++;a = *st;b = *(st+1);
	  if(a & T1)
     {if(b & T6 || Z[b+1] & T1)
      {tipprer = 7;st += 2;tec--;initprer(1);return;}
      c = Z[b+1] >> 16;
      if(c == 3){ist = 0;return;}
		else opr(a,b - c);
	  }
	  else
     {if(a & T6 || Z[a+1] & T1)
      {tipprer = 7;st += 2;tec--;initprer(1);return;}
      c = Z[a+1] & T4;
		if(c == 2){ist = 0;return;}
		else {c += a;a += 2;cadrprod(12);opr(b,a);
				if(ind == 4)return;
            S[lcadr + 9] = a;
				S[lcadr + 10] = c;S[lcadr + 11] = b;
			  }
	  }
	}

	void F62()  // ZAMECHANIE

	{UINT a,*b,c,d,*g;
    if(PR[prer] == 2 &&
       S[PR[prer+1]+9] == *(st - (*(st-1) - 0x00200103))
        && blokprer == 0)
     {tipprer = 9;initprer(2);return;}
    else
    {g = st;a = *(st-1) - L0;st--;
     b = st - (a-1);c = (b == st-1 ? *b : text1(b));
	  st = b; if(ind == 4)return;d = *(st-1);
     if(d & T6 || !(Z[d+1] & T1) ||
        Z[d+2] < 0x002000F3 || Z[d+2] > 0x002000F5)
     {tipprer = 7;st = g;initprer(1);return;}
     d += 14;
	  if(Z[*(st-1)+2] == L5)
     {d = Z[d];d += (Z[d]-4);
      if(d & T6 || Z[d+1] & T1)
      {tipprer = 7;st = g;initprer(1);return;}
     }
	  *st = d;st++;
	  Z[*(st-1)] = sffx(Z[*(st - 1)],c);st -= 2;
    }
	}

	void F63()  // ZAMECHUSLOVIE

	{UINT a,*b,c,d,e,f,*g,h;
    if(PR[prer] == 2 &&
       S[PR[prer+1]+9] == *(st - (*(st-1) - 0x00200103))
       && blokprer == 0)
      {tipprer = 9;initprer(2);return;}
    else
    {g = st;a = *(st-1) - L0;st--;b = st - (a-2);
	  c = (b == st-1 ? *b : text1(b));
     st = b;if(ind == 4)return;
     e = *(st-2);f = *(st-1);
     if(e & T6 || !(Z[e+1] & T1) || Z[e+2] != 0x002000F4
        || f & T6 || Z[f+1] & T1)
     {tipprer = 7;st = g;initprer(1);return;}
     h = Z[e+10];d = f - h;
     if(f <= h || d >= Z[h])
     {tipprer = 7;st = g;initprer(1);return;}
     d += Z[e+14];*st = d;
	  st++;Z[*(st - 1)] = sffx(Z[*(st - 1)],c);st -= 3;
    }
	}

	void F64()  // PRIMECHPOSILKI

	{UINT a,*b,c,d,e,f,*g,h;
    if(PR[prer] == 2 &&
       S[PR[prer+1]+9] == *(st - (*(st-1) - 0x00200103))&&
       blokprer == 0)
     {tipprer = 9;initprer(2);return;}
    else
     {g = st;a = *(st-1) - L0;st--;b = st - (a-2);
      c = (b == st-1 ? *b : text1(b));
		st = b; if (ind == 4)return;
      e = *(st-2);f = *(st-1);
      if(e & T6 || !(Z[e+1] & T1) ||
         Z[e+2] < 0x002000F3
        || Z[e+2] > 0x002000F6 || f & T6 || Z[f+1] & T1)
       {tipprer = 7;st = g;initprer(1);return;}
      h = Z[e+4];d = f - h;
      if(f <= h || d >= Z[h])
       {tipprer = 7;st = g;initprer(1);return;}
    	d += Z[e+8];*st = d;
      st++;Z[*(st - 1)] = sffx(Z[*(st - 1)],c);
		st -= 3;
     }
	}

	void F65()  // LEVIJKRAJ

	{UINT a;
    a = *(st-1);
    if(a == 0x00200119)return;
    if(a & T6 || !(Z[a+1] & T1))
     {tipprer = 7;initprer(1);return;}
    *(st-1) += 2;
   }

   void F66() // LIMIT

   {UINT c;
    UINT64 a,b;
    b = 0;
    if(*(st-1) & T6)b = (UINT64)(*(st-1) - L0);
    else
     {c = *(st-1)+2;
      while(!(Z[c] & T1))
       {b = (b * 10)+(UINT64)(Z[c] - L0);c += 2;}
     }
    a = step + b;st--;tec++;
    cadrprod(12);S[lcadr+8] = 1;S[lcadr+11] = st - T;
    *((UINT64*)(S+lcadr+9)) = a;
    if(stop < step || b < stop - step)stop = a;
   }


	void F67()  // PREFIKS

	{UINT a;
    a = *(st-1);
    if((a & T6 || !(Z[a+1] & T1)) && a != 0x00200119)
     {tipprer = 7;initprer(1);return;}
    st--;*(st-1) = prfx(*(st-1),a);
   }

	void F68()  // SUFFIKS

	{UINT a;
    a = *(st-2);
    if((a & T6 || !(Z[a+1] & T1)) && a != 0x00200119)
     {tipprer = 7;initprer(1);return;}
    st--; *(st-1) = sffx(a,*st);
   }

	void F69()  // SBORKA

	{UINT a,b,c,d,e,f,g,h,p;
     if(*(st-1) == L3)
      {c = mem(6);
       if(c == 0)return;
       Z[c+2] = L3;
       Z[c+3] = 0x00030002;
       *(st-2)=c;
       st--;
       return;
      }
	  a = *(st-1) + 2;b = 6;//b - schetchic dlini teksta
     if(a & T6 || !(Z[a-1] & T1) || !(*(st-2) & T6))
      {tipprer = 7;initprer(1);return;}
	  for(c = a; !(Z[c] & T1); c += 2)
		{d = Z[c];
       if(d & T6)b += 2;
		 else
       {if(!(Z[d+1] & T1) || Z[d+3] == 0)
         {tipprer = 7;initprer(1);return;}
        b += (Z[d] - 4);
		 }
      }
      c = mem(b);if(c == 0)return;Z[c+2] = *(st-2);
		Z[c+3] = (0x00030000 | (b-4));*(st-2) = c;
		c += 4;d = 2; // d - smeshenie vlevo
		for(e = *(st-1)+2;!(Z[e] & T1);e += 2)
		 {f = Z[e];
        if(f & T6)
		   {Z[c] = f;Z[c+1] = (d << 16)| 2;d += 2;c+= 2;}
		  else
         {g = f + Z[f] - 2;
			 for(h = f + 2,p = c;h != g;h++,p++)Z[p] = Z[h];
			 Z[c+1] = (d << 16)|(Z[f] - 4);d += (Z[f] - 4);
			 c = p;
			}
		 }
      st--;
	}

	void F70() // LEVPOZICIA

	{UINT a,b;
    a = *(st-2);b = (*(st-1) - 0x00200103) << 1;
    if(a & T6 || !(Z[a+1] & T1) || b >= (Z[a] - 2))
     {tipprer = 7;initprer(1);return;}
    st--;*(st-1) = Z[a + b];
   }

	void F71()  // PRAVPOZICIA

	{UINT a,b,c;
    b = *(st-2);c = (*(st-1) - 0x00200102) << 1;
    if(b & T6 || !(Z[b+1] & T1) || c >= Z[b])
     {tipprer = 7;initprer(1);return;}
	 st--;a = b + Z[b];
	 *(st-1) = Z[a - c];
	}

	void F72() // ANTECEDENT

	{UINT a,b;
	  st -= 2;tec++;a = *st;
     if(a & T6)
      {tipprer = 7;st += 2;initprer(1);return;}
	  if(Z[a+1] & T1)a += 2;
     if(Z[a] != 0x00200007 || Z[a+1] == 0)
      {tipprer = 7;st += 2;initprer(1);return;}
     a += 2;while (Z[a] & T7)a += 2;
	  if(Z[a] != L10)
     {ist = 0;return;}
     a += 2;b = *(st+1);
	  cadrprod(11);opr(b,a);
     if(ind == 4)return;
     S[lcadr + 9] = a;S[lcadr + 10] = b;
	}

	void F73()  // PERVIJOPERAND

	{UINT a;
    a = *(st-1);
    if(a & T6)
     {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1)*(st-1) += 2;
    a = *(st-1);
    if((Z[a+1] & 0x0000FFFF) <= 2)
    {tipprer = 7;initprer(1);return;}
    *(st-1) += 2;
   }

	void F74()  // PERVIJTERM

	{UINT a;
	 a = *(st-1);
    if(a & T6)
    {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1)a += 2;
    if((Z[a+1] & 0x0000FFFF) <= 2)
    {tipprer = 7;initprer(1);return;}
    *(st-1) = a + 2;F185();
	}

	void F75()  // PERVIJSIMVOL

	{UINT a;
    a = *(st-2);
    if(a & T6)
     {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1) *(st-2) += 2;
    a = *(st-2);
	 if((Z[a+1] & 0x0000FFFF) <= 2)
     {tipprer = 7;initprer(1);return;}
    if(*(st-1) & T1) {opr(*(st-1),Z[a+2]);st -= 2;return;}
	 else
	  if(*(st-1) != Z[a+2])ist = 0;
    st -= 2;
	}

	void F76()  // VTOROJOPERAND

	{UINT a,b,c;
    a = *(st-1);
    if(a & T6)
     {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1)*(st-1) += 2;
    a = *(st-1);c = Z[a+1] & 0x0000FFFF;
    if(c <= 2)
     {tipprer = 7;initprer(1);return;}
    b = (Z[a+3] & T4) + 2;
    if(b == c)
     {tipprer = 7;initprer(1);return;}
    *(st-1) += b;
   }

	void F77()  // VTOROJTERM

	{UINT a,b,c;
	 a = *(st-1);
    if(a & T6)
     {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1)a += 2;
    b = Z[a+1] & 0x0000FFFF;
    if(b <= 2)
     {tipprer = 7;initprer(1);return;}
    c = (Z[a+3] & T4) + 2;
    if(b == c)
     {tipprer = 7;initprer(1);return;}
    *(st-1) = a + c;F185();
	}

	void F78()  // VTOROJSIMVOL

	{UINT a,b,c;
    a = *(st-2);
    if(a & T6)
     {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1)*(st-2) += 2;
    a = *(st-2);
	 b = Z[a+1] & 0x0000FFFF;
    if(b <= 2)
     {tipprer = 7;initprer(1);return;}
    c = (Z[a+3] & T4) + 2;
    if(b == c)
     {tipprer = 7;initprer(1);return;}
    a += c;
	 if(*(st-1) & T1) {opr(*(st-1),Z[a]);st -= 2;return;}
	 else
		if(*(st-1) != Z[a])ist = 0;
    st -= 2;
	}

	void F79() // PREDPOSLEDOPERAND

	{UINT a,b,c,d;
	 a = *(st-1);
    if(a & T6)
     {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1)a += 2;
    b = a + 2;
	 d = a + (Z[a+1] & T4);a = b + (Z[b+1] & T4);
    if(d <= b || a == d)
     {tipprer = 7;initprer(1);return;}
	 while(c = a + (Z[a+1] & T4),c < d){b = a;a = c;}
	 *(st-1) = b;
	}

	void F80() // PREDPOSLEDTERM

	{UINT a,b,c,d;
	 a = *(st-1);
    if(a & T6)
     {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1)a += 2;
    b = a + 2;
	 d = a + (Z[a+1] & T4);a = b + (Z[b+1] & T4);
	 if(d <= b || a == d)
     {tipprer = 7;initprer(1);return;}
	 while(c = a + (Z[a+1] & T4),c < d){b = a;a = c;}
	 *(st-1) = b;F185();
	}

	void F81()  // PREDPOSLEDSIMVOL

	{UINT a,b,c,d;
	 a = *(st-2);
    if(a & T6)
     {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1)a += 2;
    b = a + 2;
	 d = a + (Z[a+1] & T4);a = b + (Z[b+1] & T4);
	 if(d <= b || a == d)
     {tipprer = 7;initprer(1);return;}
	 while(c = a + (Z[a+1] & T4),c < d){b = a;a = c;}
	 if(*(st-1) & T1)
     {opr(*(st-1),Z[b]);st -= 2;return;}
	 else
	  if(*(st-1) != Z[b])ist = 0;
    st -= 2;
	}

	void F82()  // POSLEDNIJOPERAND

	{UINT a,b,c;
	 a = *(st-1);
    if(a & T6)
     {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1) a += 2;
    b = a + 2;
	 c = a + (Z[a+1] & T4);
    if(c <= b)
     {tipprer = 7;initprer(1);return;}
	 while(a = b + (Z[b+1] & T4),a < c)b = a;
	 *(st-1) = b;
	}

	void F83()  // POSLEDNIJTERM

	{UINT a,b,c;
	 a = *(st-1);
	 if(a & T6)
     {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1)a += 2;
    b = a + 2;c = a + (Z[a+1]& T4);
	 if(c <= b)
     {tipprer = 7;initprer(1);return;}
	 while(a = b + (Z[b+1] & T4),a < c)b = a;
	 *(st-1) = b;F185();
	}

	void F84() //  POSLEDNIJSIMVOL

	{UINT a,b,c;
	 a = *(st - 2);
    if(a & T6)
     {tipprer = 7;initprer(1);return;}
    if(Z[a+1] & T1)a += 2;
    b = a + 2;
	 c = a + (Z[a+1] & T4);
	 if(c <= b)
     {tipprer = 7;initprer(1);return;}
	 while(a = b + (Z[b+1] & T4),a < c)b = a;
	 if(*(st-1) & T1)
     {opr(*(st-1),Z[b]);st -= 2;return;}
	 else
		if(*(st-1) != Z[b]) ist = 0;
    st -= 2;
	}

	void F85() // LEVSOSED

	{UINT a;
    a = *(st-1);
    if(a & T6 || Z[a+1] & T1)
     {tipprer = 7;initprer(1);return;}
    if(!(Z[a-1] & T1))*(st-1) -= 2;
   }

	void F86() // PRAVSOSED

	{UINT a;
    a = *(st-1);
    if(a & T6 || Z[a+1] & T1)
     {tipprer = 7;initprer(1);return;}
    if(!(Z[*(st-1)+2] & T1))*(st-1) += 2;
   }

	void F87() // ZAMENAUSLOVIJA

	{UINT a,b,c,d,e;
     if(PR[prer] == 2 &&
        S[PR[prer+1]+9] == *(st-3) && blokprer == 0)
      {tipprer = 9;initprer(2);return;}
     else
	  {st -= 3;c = *st;
      if(c & T6 || !(Z[c+1] & T1))
       {tipprer = 7;st += 3;initprer(1);return;}
      a = Z[c+2];
      if(a < 0x002000F3 || a > 0x002000F5)
       {tipprer = 7;st += 3;initprer(1);return;}
      d = *(st+1);e = *(st+2);
      if(d & T6 || e & T6 || Z[d+1] & T1 ||
         !(Z[e+1] & T1))
       {tipprer = 7;st += 3;initprer(1);return;}
      Z[d] = e;
	   b = (a == L5 ? Z[c+12] + (d - Z[c+10]) : c + 12);
	   Z[b] = L0;peresm = 1;
     }
	}

	void F88() // ZAMENAPOSILKI

	{UINT a,b,c,d,e;
     if(PR[prer] == 2 &&
        S[PR[prer+1]+9] == *(st-3) && blokprer == 0)
      {tipprer = 9;initprer(2);return;}
	 if(PR[prer] == 17 && (S[cadr+3] == PR[prer+1] ||
		 S[cadr+3] == PR[prer+2])
	    && blokprer == 0)
	  {tipprer = 9;initprer(2);return;}
    {st -= 3;b = *st;c = *(st+1);d = *(st+2);
      if(b & T6 || c & T6 || d & T6 || !(Z[b+1] & T1)
          || Z[c+1] & T1 || !(Z[d+1] & T1))
       {tipprer = 7;st += 3;initprer(1);return;}
      e = Z[b+2];
      if(e < 0x002000F3 || e > 0x002000F6)
       {tipprer = 7;st += 3;initprer(1);return;}
      Z[c] = d;
	   a = Z[b+6]+(c - Z[b+4]);Z[a] = L0;peresm = 1;
     }
	}

	void F89() // ZAMENA

	{UINT a;
	 if(PR[prer] == 14 && PR[prer+1] == cadr &&
        PR[prer+2] == (*(st-2) - L0) && blokprer == 0)
    {tipprer = 9;initprer(2);return;}
    if(PR[prer] == 17 && PR[prer+1] == cadr &&
    *(st-2) == 0x00200105 && blokprer == 0)
    {tipprer = 9;initprer(2);return;}
    st -= 2;a = cadr +(*st - L0) + 8;
    if(a >= S[cadr])
     {tipprer = 7;st += 2;initprer(1);return;}
    S[a] = *(st+1);
   }

	void F90()  // KLJUCH

	{UINT a,b,c,d,e;
	 st -= 3;tec++;e = *st;a = *(st+1);
    if(e == L3){ist = 0;return;}
    if(e & T6 || !(Z[e+1] & T1) || !(a & T6))
     {tipprer = 7;st += 3;initprer(1);return;}
    for(b = (e + 2),c = Z[b];!(c & T1);b += 2,c = Z[b])
	  {if(((c & T6)? c : Z[c+2]) == a)
		 {d = *(st+2);cadrprod(13);opr(d,c);
        if(ind == 4)return;
		  S[lcadr + 9] = b;S[lcadr + 10] = e;
        S[lcadr + 11] = a;
		  S[lcadr + 12] = d;
        return;
		 }
	  }
	 ist = 0;
	}

	void F91()  // CELb

	{UINT a,b,c,d,e;
	 st -= 2;tec++;a = *st;
    if(a & T6 || !(Z[a+1] & T1))
     {tipprer = 7;st += 2;initprer(1);return;}
    b = Z[a+2];
    if(b < 0x002000F4 || b > 0x002000F6)
     {tipprer = 7;st += 2;initprer(1);return;}
    if(b == L1)c = Z[a+10];
	 else c = Z[a+16];
	 if(c == L3){ist = 0;return;}
    d = *(st+1);
	  if(!(d & T1))
		 {for(e = c + 2;!(Z[e] & T1);e += 2)
			{if(sravn(Z[e],d))return;}ist = 0;return;
		 }
	  else {e = c + 2;cadrprod(12);opr(d,Z[e]);
           if(ind == 4)return;
			  S[lcadr + 9] = e;S[lcadr + 10] = c;
           S[lcadr + 11] = d;
			 }
	}

	void F92()  // KOMMENTARII

	{UINT a,b,c;
    c = *(st-1);
    if(c & T6 || !(Z[c+1] & T1))
     {tipprer = 7;initprer(1);return;}
	 a = Z[c+2];
    if(a < 0x002000F3 || a > 0x002000F5)
     {tipprer = 7;initprer(1);return;}
	 if(a == L5)
     {b = Z[c+14];
		b += (Z[b] - 4);
		*(st-1) = Z[b];
	  }
	 else *(st-1) = Z[c+14];
	}

	void F93()  // KOMMENTARIIUSLOVIJA

	{UINT a,b,c;
    b = *(st-2);c = *(st-1);
    if(b & T6 || !(Z[b+1] & T1) || Z[b+2] != 0x002000F4
       || c & T6 || Z[c+1] & T1)
     {tipprer = 7;initprer(1);return;}
    a = c - Z[b+10];st--;
    *(st-1) = Z[Z[b+14] + a];
	}

	void F94()  // KOMMENTARIIPOSILKI

	{UINT a,b,c;
	 b = *(st-2);c = *(st-1);
    if(b & T6 || !(Z[b+1] & T1) || Z[b+2] < 0x002000F3
        || Z[b+2] > 0x002000F6 || c & T6 || Z[c+1] & T1)
     {tipprer = 7;initprer(1);return;}
    a = c - Z[b+4];st--;*(st-1) = Z[Z[b+8] + a];
	}

	void F95()  // MENEE

	{UINT a,b;
    st -= 2;
    a = *st;b = *(st+1);
    if(!(a & T6) || !(b & T6))
     {tipprer = 7;st += 2;initprer(1);return;}
    if(b <= a)ist = 0;
   }

	void F96()  // IZMENENIE

	{UINT a,b;
    if(PR[prer] == 15)
     {a = PR[prer+2];b = *(st-2);
      if(a < b && b < a + Z[a] && blokprer == 0)
       {tipprer = 9;initprer(2);return;}
     }
    st -= 2;a = *st;b = *(st+1);
    if(a & T6 || Z[a+1] & T1 || b & T1)
     {tipprer = 7;st += 2;initprer(1);return;}
    Z[a] = b;
	 if(!(*(st+1) & T6) && (Z[a + 1] != 0))
    Z[a + 1] = 0;
	}

	void F97()  // NACHALO

	{UINT a;
	 a = *(st-1);
    if(!(a & T6))
     {if(!(Z[a+1] & T1))
       {tipprer= 7;initprer(1);return;}
      *(st-1) = Z[a+2];
     }
   }

	void F98()  // KONEC

	{UINT a;
	 a = *(st-1);
    if(a & T6 || !(Z[a+1] & T1))
     {tipprer = 7;initprer(1);return;}
    *(st-1) =  Z[a + (Z[a] - 4)];
	}

	void F99()  // PERESEKAJUTSJA

	{UINT a,b,c; st -= 2; a = *st;b = *(st+1);
	 if(a == L3 || b == L3)
     {ist = 0;return;}
    if(a & T6 || b & T6 || !(Z[a+1] & T1) ||
        !(Z[b+1] & T1))
     {tipprer = 7;st += 2;initprer(1);return;}
	 a += 2;b += 2;
	 while(!(Z[a] & T1))
	  {for(c = b;!(Z[c] & T1);c += 2)
       if(sravn(Z[a],Z[c]))return;
		a += 2;
	  }
    ist = 0;
	}

	void F100() // NEIZVESTNIE

	{UINT a,b,c,d,e;
    e = *(st-1);
    if(e & T6 || !(Z[e+1] & T1))
     {tipprer = 7;initprer(1);return;}
	 a = Z[e+2];
    if(a < 0x002000F4 || a > 0x002000F6)
     {tipprer = 7;initprer(1);return;}
    b = ((a == L1)? Z[e + 10] : Z[e + 16]);
	  if(b == L3){*(st-1) = L3;return;}
	  for(c = b + 2; !(Z[c] & T1);c += 2)
		if(!(Z[c] & T6) && (d = Z[c],Z[d+2] == L12))
       {*(st-1) = d;return;}
	  *(st-1) = L3;
	}

	void F101() // UDALENIEUSLOVIJA

	{UINT a,b,c,d;
     if(PR[prer] == 2 && S[PR[prer+1]+9] == *(st-2) &&
         blokprer == 0)
      {tipprer = 9;initprer(2);return;}
     else
	  {c = *(st-2);d = *(st-1);
      if(c & T6 || !(Z[c+1] & T1) ||
         !(Z[c+2] == 0x002000F4) || d & T6 ||
         Z[d+1] & T1)
       {tipprer = 7;initprer(1);return;}
      a = Z[c+10];
		if(Z[a] == 6)
		  {st -= 2;b = mem(6);if(b == 0)return;
			 Z[b+2] = L13;Z[b+3] = 0x00030002;
			 Z[Z[*st+10]+2] = b;Z[Z[*st+12]+2] = L0;
			 Z[Z[*st+14]+2] = L3;peresm = 1;
		  }
		else {b = d - a;Z[*(st-2)+10] = isklch(a,d);
				 Z[*(st-2)+12] = isklch(Z[*(st-2)+12],Z[*(st-2)+12] + b);
				 Z[*(st-2)+14] = isklch(Z[*(st-2)+14],Z[*(st-2)+14] + b);
				 st -= 2;peresm = 1;
			  }
     }
   }

	void F102() // CELI

	{UINT a,b;
     b = *(st-1);
     if(b & T6 || !(Z[b+1] & T1) || Z[b+2] < 0x002000F4
         || Z[b+2] > 0x002000F6)
      {tipprer = 7;initprer(1);return;}
	  a = Z[b + 2];
	  *(st-1) = ((a == L1)? Z[b + 10] : Z[b + 16]);
	}

	void F103() //  ISKLUCHENIE

	{UINT a,b,c,d,e,f,g;
    g = *(st-2);f = *(st-1);
    if(g == L3 || f == L3)
     {st--;return;}
    if(g & T6 || f & T6 || !(Z[g+1] & T1))
     {tipprer = 7;initprer(1);return;}
    if(!(Z[f+1] & T1))
	  {if(f < g || f >= g + Z[g])
       {tipprer = 7;initprer(1);return;}
      st--;*(st-1) = isklch(g,f);
     }
	 else {a = Z[g] - (Z[f] - 4);
			  if(a == 4){st--;*(st-1) = L3;return;}
				else { b = mem(a);if(b == 0)return;c = b + 2;
						 d = *(st-2) + 2;e = *(st-1) + 2;
						 while(!(Z[d] & T1))
						  {if(d != Z[e])
							 {Z[c] = Z[d];Z[c+1] = 0;c += 2;}
							else {if(!(Z[e+2] & T1))e += 2;}
							d += 2;
						  }
                   if(a == 6 && Z[b+2] & T6)
                   Z[b+3] = 0x00030002;
						 st--;*(st-1) = b;
					  }
			 }
	}


	void F105() //  LOGSIMVOL

	{st--; if(!(*st & T3))ist = 0;}

   void F106() // VNESHZNACHENIE

   {UINT a,b,c;
    a = *(st-2);b = *(st-1)-0x00200104;st -= 2;
    c = lcadr;
    if(a != 0x00200104)
     {while(0 < c)
      {if(S[c + 2] != 3 || S[c + 7] != a)
        c = S[c+1];
       else
        {*st = S[c + b + 8];st++;return;}
      }
     }
    else
     {while(0 < c)
      {if(S[c+2] != 1)
        c = S[c+1];
       else
        {*st = S[c + b +8];st++;return;}
      }
     }
    *st = 0x0020040C;st++;
   }

	void F107() // ZANESENIEPOSILKI

	{UINT a;
    if(PR[prer] == 2 && S[PR[prer+1]+9] == *(st-1) &&
       blokprer == 0)
      {tipprer = 9;initprer(2);return;}
	if(PR[prer] == 17 && (S[cadr+3] == PR[prer+1] ||
		S[cadr+3] == PR[prer+2]) && blokprer == 0)
	  {tipprer = 9;initprer(2);return;}
    {a = *(st-1);
     if(a & T6 || !(Z[a+1] & T1) || Z[a+2] < 0x002000F3
        || Z[a+2] > 0x002000F6)
      {tipprer = 7;initprer(1);return;}
     Z[*(st-1)+4] = prfx(*(st - 2),Z[a+4]);
	  Z[*(st-1)+6] = prfx(L0,Z[*(st-1)+6]);
	  Z[*(st-1)+8] = prfx(L3,Z[*(st-1)+8]);
     st -= 2;peresm = 1;
    }
	}

	void F108() // UDALENIEZAMECHANIJA

	{UINT a,b,c;
    if(PR[prer] == 2 && S[PR[prer+1]+9] == *(st-2) &&
       blokprer == 0)
      {tipprer = 9;initprer(2);return;}
    else
    {c = *(st-2);
     if(c & T6 || !(Z[c+1] & T1) || Z[c+2] < 0x002000F3
         || Z[c+2] > 0x002000F5)
      {tipprer = 7;initprer(1);return;}
     a = c+14;if(Z[c+2] == L5){a = Z[a];a += (Z[a]-4);}
	  if(Z[a] == L3){st -= 2;return;} *st = a;st++;
	  for(b = Z[a]+2;!(Z[b] & T1);b += 2)
		 {if(sravn(Z[b],*(st-2)))
			 {Z[*(st - 1)] = isklch(Z[*(st - 1)],b);
           st -= 3;return;
          }
		 }
	  st -= 3;
    }
	}

	void F109() // RAVNOJDLINI

	{UINT a,b;
    st -= 2;a = *st;b = *(st+1);
    if(a == L3)
     {if(b == L3)return;
      if(!(Z[b+1] & T1))
       {tipprer = 7;st += 2;initprer(1);return;}
      ist = 0;return;
     }
    if(b == L3)
     {if(!(Z[a+1] & T1))
       {tipprer = 7;st += 2;initprer(1);return;}
      ist = 0;return;
     }
    if(a & T6 || b & T6 ||
       !(Z[a+1] & T1) || !(Z[b+1] & T1))
     {tipprer = 7;st += 2;initprer(1);return;}
    if(Z[a] != Z[b])ist = 0;
   }

	void F110() // TABLZNACHENIE

	{UINT a,b,c;
	 st -= 2;b = *(st-1);
    if(b == L3){*(st-1) = *(st+1);return;}
    c = *st;
    if(b & T6 || c & T6 || !(Z[b+1] & T1) ||
       !(Z[c+1] & T1))
     {tipprer = 7;st += 2;initprer(1);return;}
    else {for(a = b + 2;!(Z[a] & T1);a += 2)
			  if(sravn(Z[a],*(st+1)))
			  	{*(st-1) = Z[c + (a - b)];return;}
		   }
	 *(st-1) = *(st+1);
	}

	void F111() // RAZLICHNI

	{UINT a,b,c;
	 st--;a = *st;if(a == L3)return;
    if(a & T6 || !(Z[a+1] & T1))
     {tipprer = 7;st++;initprer(1);return;}
	 for(b = a + 2;!(Z[b] & T1);b += 2)
	  for(c = b + 2;!(Z[c] & T1);c += 2)
	  	if(sravn(Z[b],Z[c])){ist = 0;return;}
	}

	void F112() // SOOTVPOZICIJA

	{UINT a,b,c,d;
    st -= 2;a = *(st-1);b = *st;
    c = *(st+1);d = (a - b) + c;
    if(a & T6 || b & T6 || c & T6 || !(Z[b+1] & T1)
        || Z[a+1] & T1 || !(Z[c+1] & T1) || d < c
        || d >= c + Z[c])
     {tipprer = 7;st += 2;initprer(1);return;}
    *(st-1) = d;
	}

	void F113()  // ZAPISb

	{UINT a,*b,*c,d,e,f,g,h,p;
	  st--;
	  a = (*st) - L0;
	  b = st - a;
     if( !(*b & 0x00200000))
      {tipprer = 7;st++;initprer(1);return;}
	  d = 4; // d - schetchic dlini teksta
	  for(c = b;c != st;c++)
		{e = *c;
       if(e & T6)d += 2;
		 else
       {if(!(Z[e+1] & T1) || Z[e+3] == 0)
         {tipprer = 7;st++;initprer(1);return;}
        d += (Z[e] - 4);
       }
	   }
     	e = mem(d);if(e == 0)return;Z[e+2] = *b;
		Z[e+3] = (0x00030000 | (d-4)); *b = e;
      e += 4;d = 2; // d - smesh.vlevo
		for(c = b+1;c != st;c++)
		  {f = *c;
			 if(f & T6)
			  {Z[e] = f;Z[e+1] = (d << 16)| 2;e += 2;d += 2;}
			 else {g = f + Z[f] - 2;
					  for(h = f + 2,p = e;h != g;h++,p++)Z[p] = Z[h];
					  Z[e+1] = (d << 16)|(Z[f] - 4);d += (Z[f] - 4);e = p;
					}
		  }
		 st = b;st++;
	}

	void F114() // REZULTPODST

	{UINT a,b,c,d,e,f,g,p,*h,r;
     if(*(st-1) & T1)
	  {if(*(st-4) == L3)
        {opr(*(st-1),*(st-2));
         st -= 4;return;
        }
	   a = 0; b = 0;
	   c = *(st-2)+2;r = *(st-4);g = *(st-3);
       if(r & T6 || !(Z[r+1] & T1) || c & T6 || g & T6 ||
         !(Z[g+1] & T1) || Z[g] != Z[r]
         || !(Z[c-1] & T1) || Z[c+1] == 0)
        {tipprer = 7;initprer(1);return;}
       for(e = r + 2; !(Z[e] & T1); e += 2)
	    {if(!(Z[e] & T7))
	      {tipprer = 7; initprer(1); return;}
	    }
	   for(e = g + 2; !(Z[e] & T1); e += 2)
	    {p = Z[e];
	     if((p & T6) || !(Z[p+1] & T1))
	      {tipprer = 7; initprer(1); return;}
	    }
		// realizuetsja podstanovka; a - smeshenie v st[];
		// c - tek.smeshenie v ish.terme

	   while(!(Z[c] & T1))
	    {d = (a == 0 ? 3 : (b - R[a-1])) << 16;
	     if(Z[c] & T7)
	      {for(e = *(st-4)+2;!(Z[e] & T1);e += 2)
		    {if(Z[e] == Z[c])
		      {g = b; p = (e - *(st-4));
		       p += *(st-3);
			   for(f = Z[p] + 2;!(Z[f] & T1);f++)
				{st[b] = Z[f];b++;}
			     st[g+1] = d | (st[g+1] & T4); break;
			    }
			  }
			 if(Z[e] & T1)
		      {st[b] = Z[c];st[b+1] = d | 2;b += 2;
			  }
		  }
		 else
		  {p = (Z[c+1] & T4);
		   p += c;
		   R[a] = p;
		   R[a+1] = b;
		   st[b] = Z[c];
		   a += 2;
		   st[b+1] = d;
		   b += 2;
	      }
		 c += 2;
		 while(a != 0 && R[a-2] == c)
		  {p = R[a-1]; st[p + 1] += (b - p);a -= 2;
		  }
		}
       if(b%2 == 1)
        {tipprer = 7;initprer(1);return;}
	     d = mem(b+4); if(d == 0)return;
		 for(e = d+2,f = 0;f < b;e++,f++)Z[e] = st[f];
		 st -= 4;opr(*(st+3),d);
	  }
	 else  // opredelenie podstanovki
	  {if(*(st-4) == L3)
		  {if(sravn(*(st-2),*(st-1)))
          {opr(*(st-3),L3);st -= 4;}
			else {ist = 0;st -= 4;}
			return;
		  }
      c = *(st-4);r = *(st-2);g = *(st-1);
      if(c & T6 || r & T6 || g & T6 || !(Z[c+1] & T1)
         || !(Z[r+1] & T1) || !(Z[g+1] & T1)
         || Z[g+3] == 0)
       {tipprer = 7;initprer(1);return;}
		h = st;
		for(a = *(st-4)+2;!(Z[a] & T1);a += 2)
		 {*st = L3;st++;}
		a = 0;b = *(h-2)+2;c = *(h-1)+2; // a - smeshenie v R pari
													  //  konec-konec
		while(!(Z[b] & T1))
		 {while(a != 0 && R[a-2] == b)
			{if(c != R[a-1])
			  {ist = 0;st = h - 4;return;}
			 a -= 2;
			}
		  if(a != 0 && R[a-1] == c)
           {ist = 0;st = h - 4;return;}
		  if(Z[b] & T7)
			{for(d = *(h-4)+2;!(Z[d] & T1);d += 2)
			  {if(Z[d] == Z[b])
				 {e = ((d - *(h-4)) - 2) >> 1;
				  if(h[e] == L3)
					 {f = mem((Z[c+1] & T4) + 4);
                 if(ind == 4)return;
					  g = f + Z[f] - 2;
					  for(r = f + 2;r < g;r++)
						 {Z[r] = Z[c];c++;}
					  h[e] = f;
                 Z[f+3] = 0x00030000 | (Z[f+3] & T4);
					 }
				  else
					{for(g = h[e]+2;!(Z[g] & T1);g += 2)
					  {if(Z[g] != Z[c] || ((Z[g+1] ^ Z[c+1]) & T4))
						 {ist = 0;st = h - 4;return;}
						c += 2;
					  }
					}
				  b += 2;break;
				 }
			  }
			 if(Z[d] & T1)
				{if(Z[b] != Z[c]){ist = 0;st = h - 4;return;}
				 b += 2;c += 2;
				}
			}
		  else
			{if(Z[b] != Z[c]){ist = 0;st = h - 4;return;}
			 R[a] = b + (Z[b+1] & T4);
			 R[a+1] = c + (Z[c+1] & T4);a += 2;b += 2;c += 2;
			}
		 }
		if(!Z[c] & T1)
         {ist = 0; st = h - 4; return;}
        b = text1(h);if(ind == 4)return;opr(*(h-3),b);st = h - 4;
	  }
	}

	void F115() // SPISOKUSLOVIJ

	{UINT a;
    a = *(st-1);
    if(a & T6 || !(Z[a+1] & T1) || Z[a+2] != 0x002000F4)
     {tipprer = 7;initprer(1);return;}
    *(st-1) = Z[a + 10];
   }

	void F116() // ZAMENARAZRJADA

	{UINT a,b,c;
    b = *(st-3);c = *(st-2);
    if(b & T6 || c & T6 || !(Z[b+1] & T1) ||
       Z[c+1] & T1 || c < b || c >= b + Z[b])
     {tipprer = 7;initprer(1);return;}
	  a = mem(Z[*(st-3)]);if(a == 0)return;st -= 2;
	  for(b = a + 2,c = *(st-1)+2;!(Z[c] & T1);b += 2,c += 2)
		 {if(c == *st){Z[b] = *(st+1);Z[b+1] = 0;}
		  else{Z[b] = Z[c];Z[b+1] = 0;}
		 }
     if(Z[a] == 6 && Z[a+2] & T6)Z[a+3] = 0x00030002;
	  *(st-1) = a;
	}

	void F118() // PERESECHENIESPISKOV

	{UINT a,b,*c,d,e,f;
	 a = *(st-2);if(a == L3){st--;return;}
	 b = *(st-1);if(b == L3){st--;*(st-1) = L3;return;}
    if(a & T6 || b & T6 ||
       !(Z[a+1] & T1) || !(Z[b+1] & T1))
     {tipprer = 7;initprer(1);return;}
  	 b += 2;
	 for(d = 0;!(Z[b] & T1);b += 2,d++)R[d] = Z[b];
    c = st;
	 for(e = a + 2;!(Z[e] & T1);e += 2)
		for(f = 0;f < d;f++)
		  {if(R[f] != 0 && sravn(R[f],Z[e]))
			 {*st = Z[e];R[f]=0;st++;break;}
		  }
	 if(c == st) {st--;*(st-1) = L3;return;}
	 *(c-2) = text1(c);st--;
	}

	void F119() // UDALENIEPOSILKI

	{UINT a,b,c,d;
    if(PR[prer] == 2 && S[PR[prer+1]+9] == *(st-2) &&
       blokprer == 0)
      {tipprer = 9;initprer(2);return;}
    else
	 {c = *(st-2);d = *(st-1);
     if(c & T6 || !(Z[c+1] & T1) || Z[c+2] < 0x002000F3
        || Z[c+2] > 0x002000F6 || d & T6 || Z[d+1] & T1)
      {tipprer = 7;initprer(1);return;}
     a = Z[c+4];
	  if(Z[a] == 6)
		 {st -= 2;b = mem(6);if(b == 0)return;
		  Z[b+2] =  L13;Z[b+3] = 0x00030002;
		  Z[Z[(*st)+4]+2] = b;Z[Z[(*st)+6]+2] = L0;
		  Z[Z[(*st)+8]+2] = L3;peresm = 1;
		 }
	  else
      {b = *(st-1) - a;
       Z[*(st - 2)+4] = isklch(a,*(st-1));
		 Z[*(st - 2)+6] = isklch(Z[*(st - 2)+6],Z[*(st - 2)+6] + b);
		 Z[*(st - 2)+8] = isklch(Z[*(st - 2)+8],Z[*(st - 2)+8] + b);
		 st -= 2;peresm = 1;
		}
    }
	}

	void F120() // RAVNIETERMI

	{UINT a,b,c;
	 st -= 2;a = *st;b = *(st+1);
    if(a & T6 || b & T6 || Z[a+1] & T1 ||
       Z[b+1] & T1 || Z[a+1] == 0 || Z[b+1] == 0)
     {tipprer = 7;st += 2;initprer(1);return;}
    c = a + (Z[a+1] & T4);
	 while(a != c)
	  {if(Z[a] != Z[b] || ((Z[a+1]^Z[b+1]) & T4))
       {ist = 0;return;}
		a += 2;b += 2;
	  }
	}

	void F121() // PEREMENNIE

	{UINT a,b,c,d,e;
	 for(a = 0;a < 16;a++)R[a] = 0;
	 b = *(st-1);
    if(b & T6 || !(Z[b+1] & T1) || Z[b+2] < 0x002000F3
       || Z[b+2] > 0x002000F6)
     {tipprer = 7;initprer(1);return;}
	 for(c = Z[b+4]+2;!(Z[c] & T1);c += 2)
	   for(d = Z[c] + 2;!(Z[d] & T1);d += 2)
	  	 if(Z[d] & T7)
        {e = Z[d] - T8;R[e >> 5] |= (1 << (e & T9));}
	 if(Z[b+2] == L5)
	   {for(c = Z[b+10]+2;!(Z[c] & T1);c += 2)
		   for(d = Z[c]+2;!(Z[d] & T1);d += 2)
			 if(Z[d] & T7)
			  {e = Z[d] - T8;R[e >> 5] |= (1 << (e & T9));}
	   }
    else
     {if(Z[b+2] != L1)
      {c = Z[b+10];
       for(d = c+2;!(Z[d] & T1);d += 2)
        if(Z[d] & T7)
         {e = Z[d] - T8;R[e >> 5] |= (1 << (e & T9));}
      }
     }
	 if(Z[b+2] != L14)
     {a = (Z[b+2] == L1 ? Z[b+10] : Z[b+16]);
		if(a != L3)
		 for(c = a+2;!(Z[c] & T1);c += 2)
		  {if(!(Z[c] & T6) && Z[Z[c]+2] == L12)
			 for(d = Z[c]+4;!(Z[d] & T1);d += 2)
			  if(Z[d] & T7)
				{e = Z[d] - T8;R[e >> 5] |= (1 << (e & T9));}
		  }
	  }
	 *(st-1) = spskprm();
	}

	void F122() // NOVAJAPEREMENNAJA

	{UINT a,b,c;
	 if(*(st-2) == L3){opr(*(st-1),T8);st -= 2;return;}
    a = *(st-2);
    if(a & T6 || !(Z[a+1] & T1) || !(Z[a+2] & 0x00400000))
     {tipprer = 7;initprer(1);return;}
	 for(a = 0;a < 16;a++)R[a] = 0;
	 for(a = *(st-2) + 2; !(Z[a] & T1);a += 2)
	   if(Z[a] & T7)
       {b = Z[a] - T8;R[b >> 5] |= (1 << (b & T9));}
	 for(a = 0; a < 16;a++)
	   {if(R[a] != T10)
		  for(b = 1,c = 1;c < 33;b <<= 1,c++)
			if(!(R[a] & b))
			 {opr(*(st-1),T7 | ((a << 5) + c));st -= 2;return;}
		}
	  st -= 2;ist = 0;tipprer = 4;ind = 4;
	}

	void F123() // ZAMENATERMOV

	{UINT a,b,c,d,e,f,g,h,p,r,s;
    b = *(st-3);
    if(b & T6 || !(Z[b+1] & T1) || Z[b+3] == 0)
     {tipprer = 7;initprer(1);return;}
	 a = Z[b];d = *(st-2);c = *(st-1);
    if(d == L3)
     {st -= 2;return;}
    if(d & T6 || c & T6 || !(Z[c+1] & T1))
     {tipprer = 7;initprer(1);return;}
	 if(Z[d+1] & T1)
	   {if(!(Z[c+1] & T1) || Z[d] != Z[c])
        {tipprer = 7;initprer(1);return;}
       for(b = c+2;!(Z[b] & T1);b += 2)
		  {if(!(Z[b] & T6) && !(Z[Z[b] + 1] & T1))
          {tipprer = 7;initprer(1);return;}
         a += ((Z[b] & T6) ? 2 : Z[Z[b]] - 4);
        }
		 for(b = d+2;!(Z[b] & T1);b += 2)
		  {if(Z[b] & T6 || Z[Z[b]+1] & T1)
          {tipprer = 7;initprer(1);return;}
         a -= (Z[Z[b]+1] & T4);
		  }
      }
	 else
	  {if(Z[c+3] == 0)
       {tipprer = 7;initprer(1);return;}
      a += (c & T6 ? 2 : Z[c] - 4);
		a -= (Z[d + 1] & T4);
	  }
    b = mem(a);if(b == 0)return;
	 if(Z[*(st-2)+1] & T1)
	   {c = *(st-2)+2;d = *(st-1)+2;e = Z[c];f = Z[d];}
	 else {c = 0;e = *(st-2);f = *(st-1);}
	 g = 0;h = b+2;a = *(st-3) + 2;

	  //  e - tek.zamenjaemoe vhogd;f - zamenjajushij ob'ekt;
	  //  c,d - ih smeshenija libo 0;g - smeshenie v R[] cvob.jach;
	  //  v R formir.nakopitel par: (tek.konec v ish. terme - ego nachalo
	  //  v novom terme
	 while(!(Z[a] & T1))
	  {p = (g == 0 ? 3 : (h - R[g-1])) << 16;
		if(a == e)
		  {if(f & T6)
			 {Z[h] = f;Z[h+1] = p | 2;h += 2;}
			else {s = h;
					for(r = f+2;!(Z[r] & T1);r++)
					  {Z[h] = Z[r];h++;}
					Z[s+1] = p | (Z[s+1] & T4);
				  }
			if(c == 0)e = 0;
			else {c += 2;d += 2;e = Z[c];f = Z[d];}
			a += (Z[a+1] & T4);
		  }
		else {R[g] = a + (Z[a+1] & T4);R[g+1] = h;Z[h] = Z[a];
				 g += 2;Z[h+1] = p;h += 2;a += 2;
			  }
		while(g != 0 && R[g-2] == a)
		 {Z[R[g-1]+1] += (h - R[g-1]);g -= 2;}
	  }
	 st -= 2;*(st-1) = b;
	}


	void F124() // STANDART

	{UINT a;
    a = *(st-1);
    if(a & T6 || Z[a+1] & T1)
     {tipprer = 7;initprer(1);return;}
    st--;if((Z[a+1]& T4) == 2)ist = 0;
   }

	void F125()  //KORENb

	{UINT a;
    a = *(st-1);
    if(a & T6 || Z[a+1] & T1)
     {tipprer = 7;initprer(1);return;}
    st--;if((Z[a+1] >> 16) != 3)ist = 0;
   }

	void F126()  // OB'EDINENIESPISKOV

	{UINT a,b,*c,d,e,f,*g;
	 a = *(st-2);if(a == L3){st--;*(st-1) = *st;return;}
	 b = *(st-1);if(b == L3){st--;return;}
    if(a & T6 || b & T6 || !(Z[a+1] & T1) ||
        !(Z[b+1] & T1))
     {tipprer = 7;initprer(1);return;}
	 c = st;d = a + Z[a] - 2;
	 for(e = b + 2;!(Z[e] & T1);e += 2)
	  {*st = Z[e];st++;
		for(f = a + 2;f < d;f += 2)
		 {if(sravn(Z[f],Z[e])){st--;break;}
		 }
	  }
	 e = mem(Z[a] + 2*(st - c));if(e == 0)return;a += 2;
	 for(f = e + 2;a < d;a += 2,f += 2)
	   {Z[f] = Z[a];Z[f+1] = 0;}
	 for(g = c;g != st;g++)
		{Z[f] = *g;Z[f+1] = 0;f += 2;}
    if(Z[e] == 6 && Z[e+2] & T6)Z[e+3] = 0x00030002;
	  st = c - 1; *(st-1) = e;
	}

	void F127()  // KOROCHE

	{UINT a,b;
    a = *(st-2);b = *(st-1);
    if(a == L3 && b != L3){st -= 2;return;}
    if(b == L3){st -= 2;ist = 0;return;}
    if(a & T6 || b & T6 || !(Z[a+1] & T1) ||
        !(Z[b+1] & T1))
     {tipprer = 7;initprer(1);return;}
    st -= 2;if(Z[a] >= Z[b])ist = 0;
	}

	void F128() // VHOGDENIETERMA

	{UINT a,b,c,d,e,f;
	 st -= 3;tec++;a = *st;b = *(st+1);
    if(a & T6 || b & T6 || !(Z[a+1] & T1) ||
       !(Z[b+1] & T1))
     {tipprer = 7;st += 3;initprer(1);return;}
    a += 2;b += 2;
    c = *(st+1) + Z[*(st+1)] - 2;
	 for(d = a;!(Z[d] & T1);d += 2)
	  {for(e = b,f = d; e < c; e += 2,f += 2)
		 {if(Z[e] != Z[f] || ((Z[e+1]^Z[f+1]) & T4))break;
		 }
		if(e == c)
		 {e = *(st+2);cadrprod(13);opr(e,d);
        if(ind == 4)return;
		  S[lcadr + 9] = d;
        S[lcadr + 10] = *st;S[lcadr + 11] = *(st+1);
		  S[lcadr + 12] = e;return;
		 }
	  }
	 ist = 0;
	}

	void F129()  // ISKLUCHENIEOPERANDA

	{UINT a,b,c,d,e,f,g,h,p;
	 a = 6;b = 0;e = *(st-2);d = *(st-1);
    if(e & T6 || d & T6 || Z[e+1] & T1 || Z[d+1] & T1
        || Z[e+2] == 0)
     {tipprer = 7;initprer(1);return;}
	 for (c = e + 2;c - (Z[c+1] >> 16) == e;c += (Z[c+1] & T4))
	  if(c != d){a += (Z[c+1] & T4);b++;}
	 if(b == 1)a -= 2;c = mem(a);
    if(c == 0)return;
    d = c + 2;
	 if(b > 1)
      {Z[d] = Z[*(st-2)];Z[d+1] = 0x00030000|(a-4);
       d += 2;
      }
	 e = 0;
	 for(f = *(st-2)+2;f - (Z[f+1] >> 16) == *(st-2);f += (Z[f+1] & T4))
	  if(f == *(st-1))e = (Z[f+1] & T4) << 16;
	  else
      {g = f + (Z[f+1] & T4);p = d;
		 for(h = f;h < g;h++){Z[d] = Z[h];d++;}
		 Z[p+1] = ((b == 1) ? (0x00030000 | (Z[f+1] & T4)) : Z[f+1]-e);
		}
	 st--;*(st-1) = c;
	}

	void F130()  // LEKSIKOPREDSHESTVUET

	{UINT a,b,c,d;
    a = *(st-2);b = *(st-1);
    if(a & T6 || b & T6 || !(Z[a+1] & T1) ||
       !(Z[b+1] & T1))
     {tipprer = 7;initprer(1);return;}
	 st -= 2;
    while(!(Z[a + 2] & T1))
     {a += 2;b += 2;c = Z[a];d = Z[b];
      if(d & T1){ist = 0;return;}
      if(c & 0x00200000)c |= T1;
      if(d & 0x00200000)d |= T1;
      if(c > d){ist = 0;return;}
      if(c < d)return;
      c = ((Z[a+1] & T4) == 2 ?
           ((Z[a+3] & T5) == (Z[a+1] & T5) + 0x00200000 ?
             3 : 1) : 2);
      d = ((Z[b+1] & T4) == 2 ?
           ((Z[b+3] & T5) == (Z[b+1] & T5) + 0x00200000 ?
             3 : 1) : 2);
      if(c > d){ist = 0 ;return;}
      if(c < d)return;
     }
	}



	void F131()  // BAZAVHOGDENIJA

	{UINT a;
	 a = *(st-1);
    if(a & T6 || Z[a+1] & T1)
    {tipprer = 7;initprer(1);return;}
    a -= 2;
    while(!(Z[a+1] & T1))a -= 2;*(st-1) = a;
	}

	void F132()  // ZANESENIEUSLOVIJA

	{UINT a,b;
    a = *(st-2);b = *(st-1);
    if(a & T6 || b & T6 || !(Z[a+1] & T1) ||
       !(Z[b+1] & T1) || Z[b+2] != 0x002000F4
       || Z[a+3] == 0)
     {tipprer = 7;initprer(1);return;}
    if(PR[prer] == 2 && S[PR[prer+1]+9] == b &&
        blokprer == 0)
      {tipprer = 9;initprer(2);return;}
    else
    {Z[*(st-1)+10] = prfx(*(st - 2),Z[*(st-1)+10]);
	  Z[*(st-1)+12] = prfx(L0,Z[*(st-1)+12]);
	  Z[*(st-1)+14] = prfx(L3,Z[*(st-1)+14]);
     st -= 2;peresm = 1;
    }
	}

	void F133()  // PRJAMOJOTVET

	{if(blokprer == 0)uroven = 0x00200108;
    F200();
   }

	void F134()  // SERIJA

	{UINT a,b,*c,*d,e,f;
	  st--;tec++;a = *st - L0;c = st - a;
	  for(d = c;d != st;d += 2)
		{e = *(d+1);
       if(e == L3){ist = 0;st =c;return;}
       if(e & T6 || !(Z[e+1] & T1))
       {tipprer = 7;st++;initprer(1);return;}
      }
     b = 3 * (a/2); cadrprod(b + 9);if(ind == 4)return;
     for(d = c;d != st;d += 2)opr(*d,*(d+1)+2);
     for(d = c,f = lcadr + 9; d != st;d += 2,f += 3)
		{S[f] = *(d+1)+2;S[f+1] = *(d+1);
		 S[f+2] = *d;
		}
	  st = c;
	}

	void F135()  // OKONCHANIE

	{UINT a,b,c,d,e;
	 a = *(st-1);if(a == L3)return;
    if(a & T6 || !(Z[a+1] & T1))
     {tipprer = 7;initprer(1);return;}
    b = Z[a] - 2;
	 if(b == 4){*(st-1) = L3;return;}
    c = mem(b);if(c == 0)return;
	 for(d = c + 2,e = a + 4;!(Z[e] & T1);d += 2,e += 2)
	  {Z[d] = Z[e];Z[d+1] = 0;}
    if(b == 6 && Z[c+2] & T6)Z[c+3] = 0x00030002;
	 *(st-1) = c;
	}

	void F136()  // VSTAVKA

	{UINT a,b,c;
    b = *(st-3);c = *(st-2);
    if(b & T6 || c & T6 || !(Z[b+1] & T1) || Z[c+1] & T1
       || c < b || c >= b + Z[b])
    {tipprer = 7;initprer(1);return;}
	 a = mem(Z[b]+2);if(a == 0)return;
	 for(b = a + 2,c = *(st-3)+2; !(Z[c] & T1);c += 2)
	  {if(c == *(st-2))
		 {Z[b] = *(st-1);Z[b+1] = 0;b += 2;}
	   Z[b] = Z[c];Z[b+1] = 0;b += 2;
	  }
	 st -= 2;*(st-1) = a;
	}

	void F137()  // OKRESTNOSTb

	{UINT a,b;
    a = *(st-2);b = (*(st-1)- 0x00200103) << 1;
    if(a & T6 || !(Z[a+1] & T1) || b >= Z[a]-2)
     {tipprer = 7;initprer(1);return;}
    st--;*(st-1) += b;
	}

	void F138()  // PRAVIJKRAJ

	{UINT a;
    a = *(st-1);
    if(a & T6 || !(Z[a+1] & T1))
     {tipprer = 7;initprer(1);return;}
    *(st-1) += (Z[*(st-1)] - 4);
	}

	void F139()  // ZAGOLOVOK

	{UINT a,b;
    a = *(st-2);
    if(!(a & T6) && !(Z[a+1] & T1))
     {tipprer = 7;initprer(1);return;}
    b = ((a & T6) ? a : Z[a+2]);
    if(*(st-1) & T1){opr(*(st-1),b);st -= 2;}
	 else {ist = sravn(*(st-1),b);st -= 2;}
	}

	void F140()  // DLINATEKSTA

	{UINT a;
    a = *(st-2);
    if(a == L3)
     {if(*(st-1) & T1)
       {opr(*(st-1),0x00200104);st -= 2;return;}
      else
       if(*(st-1) != 0x00200104)ist = 0;
      st -= 2;
      return;
     }
    if(a & T6 || !(Z[a+1] & T1))
     {tipprer = 7;initprer(1);return;}
    if(*(st-1) & T1)
     {opr(*(st-1),0x00200102 + (Z[a] >> 1));
	   st -= 2;return;
	  }
	 else
	  if(Z[a] != (2 *(*(st-1) - L0)) + 4 )ist = 0;
	 st -= 2;
	}


	void F141()  // POSTPOZICIJA

	{UINT a,b;
    a = *(st-1);b = *(st-2);
    if(a & T6 || Z[a+1] & T1)
     {tipprer = 7;initprer(1);return;}
	 st -= 2;tec++;
	 if(b & T1)
	  {cadrprod(11);opr(*st,a);
      if(ind == 4)return;S[lcadr + 9] = a;
		S[lcadr + 10] = *st;
	  }
	 else
     {if(b & T6 || Z[b+1] & T1)
       {tipprer = 7;st += 2;tec--;initprer(1);return;}
      if(b < a)ist = 0;
     }
	}

	void F142()  //NADZADACHA

	{UINT a;
    if(!(*(st-1) & 0x00200000))
     {tipprer = 7;initprer(1);return;}
	 st -= 2;tec++;a = lcadr;
	 while(S[a+2] != 1)a = S[a+1];
	  if(a == 0){ist = 0;return;}
	  do{a = S[a+1];
		  if((S[a+2] == 1) &&
           (*(st+1) == L0 || *(st+1) == Z[S[a+9]+2]))
			{cadrprod(12);opr(*st,S[a+9]);
          if(ind == 4)return;
			 S[lcadr + 9] = S[a+9];S[lcadr + 10] = *(st+1);
			 S[lcadr + 11] = *st;return;
			}
		 }
	  while(a != 0);
	  ist = 0;
	}

	void F143()  // KOMMENTARIIPOSILOK

	{UINT a,b;
    b = *(st-1);
    if(b & T6 || !(Z[b+1] & T1) || Z[b+2] < 0x002000F3
       || Z[b+2] > 0x002000F6)
     {tipprer = 7;initprer(1);return;}
	 a = Z[b+8];
	 a += (Z[a] - 4);
	 *(st-1) =  Z[a];
	}

	void F144()  // PRIMECHANIE

	{UINT a,*b,c,d,e,*f;
    if(PR[prer] == 2 && PR[prer+1] == cadr &&
        blokprer == 0)
      {tipprer = 9;initprer(2);return;}
    else
    {f = st;a = *(st-1) - L0;st--;b = st - (a-1);
     c = (b == st-1 ? *b : text1(b));
     st = b;if (ind == 4)return;
     e = *(st-1);
     if(e & T6 || !(Z[e+1] & T1) || Z[e+2] < 0x002000F3
        || Z[e+2] > 0x002000F6)
      {tipprer = 7;st = f;initprer(1);return;}
     d = Z[e+8];d += (Z[d]-4);
	  *st = d;st++;Z[*(st - 1)] = sffx(Z[*(st - 1)],c);
     st -= 2;
    }
	}

	void F145()  // TEKUSHIJUROVENb

	{UINT a;
		st--;a = lcadr;
      while(S[a+2] != 1)a = S[a+1];
		opr(*st,S[a+13]);
	}

	void F146()  // KOPIJA

	{UINT a,b,c;
	 a = *(st-1);
	 if(!(a & T6))
	   {if(!(Z[a+1] & T1))
        {tipprer = 7;initprer(1);return;}
       b = mem(Z[a]); if(b == 0)return; a += 2;
		 for(c = b + 2;!(Z[a] & T1);c++)
        {Z[c] = Z[a];a++;}
		 *(st-1) = b;
		}
	}

	void F147()  // UDALENIEPRIMECHANIJA

	{UINT a,b,c;
    if(PR[prer] == 2 && S[PR[prer+1]+9] == *(st-2) &&
       blokprer == 0)
      {tipprer = 9;initprer(2);return;}
    else
    {c = *(st-2);
     if(c & T6 || !(Z[c+1] & T1) || Z[c+2] < 0x002000F3
        || Z[c+2] > 0x002000F6)
      {tipprer = 7;initprer(1);return;}
     a = Z[c+8];a += (Z[a]-4);
	  if(Z[a] == L3){st -= 2;return;}*st = a;st++;
	  for(b = Z[a] + 2;!(Z[b] & T1);b += 2)
		 {if(sravn(Z[b],*(st-2)))
			{Z[*(st - 1)] = isklch(Z[*(st - 1)],b);st -= 3;return;}
		 }
	  st -= 3;
    }
	}

	void F148()  // UDALENIEPRIMECHPOSILKI

	{UINT a,b,c;
    if(PR[prer] == 2 && S[PR[prer+1]+9] == *(st-3) &&
       blokprer == 0)
      {tipprer = 9;initprer(2);return;}
    else
    {c = *(st-3);
     if(c & T6 || !(Z[c+1] & T1) || Z[c+2] < 0x002000F3
        || Z[c+2] > 0x002000F6)
      {tipprer = 7;initprer(1);return;}
     b = Z[c+4];
     a = *(st-2) - b;
     if(a >= Z[b])
      {tipprer = 7;initprer(1);return;}
     a += Z[c+8];
	  if(Z[a] == L3){st -= 3;return;}*st = a;st++;
	  for(b = Z[a]+2;!(Z[b] & T1);b += 2)
		 {if(sravn(Z[b],*(st-2)))
			 {Z[*(st - 1)] = isklch(Z[*(st - 1)],b);st -= 4;return;}
		 }
	  st -= 4;
    }
	}


	void F149()  // NOVPOZICIJA

	{UINT a;
	  st -= 2;tec++;a = *(st+1);
     if(a == L3) {ist = 0;return;}
     if(a & T6 || !(*st & T1))
      {tipprer = 7;st += 2;tec--;initprer(1);return;}
     a += 2;
	  if(Z[a] & T1) {ist = 0;return;}
	  cadrprod(11);opr(*st,a);
     if(ind == 4)return;S[lcadr + 9] = a;
	  S[lcadr + 10] = *st;
	}

	void F150() // PODUROVENb

	{UINT a;
	 a = lcadr;
    while (S[a+2] != 1 || (a != 0 && S[a+9] != *(st-1)))
    a = S[a+1];
    if(a == 0)
     {uroven = 0x0020010C;}
    else
     {uroven = (0x00200000 | (S[a+7] & 0x0000FFFF));}
    st--;
	}

	void F151() // MAKSIMALNIJUROVENb

	{UINT a;
	 a = lcadr;
	 while(S[a+2] != 1 || (a != 0 && S[a+9] != *(st-1)))
    a = S[a+1];
    if(a == 0 && S[a+9] != *(st-1)) *(st-1) = 0x0020040C;
    else *(st-1) = (0x00200000 | (S[a+7] & 0x0000FFFF));
	}

	void F152()  // KONTRSERIJA

	{UINT a,*b,*c,d,e,*f;
    f = st;
	 st--; tec++; a =*st - L0;b = st - a;
    for(c = b;c != st;c += 2)
     {e = *(c + 1);
      if(e & T6 || Z[e+1] & T1 || !(*c & T1))
       {tipprer = 7;st = f;tec--;initprer(1);return;}
     }
    cadrprod(a + 9);if(ind == 4)return;
    for(c = b;c != st;c += 2)opr(*c,*(c+1));
    for(c = b,d = lcadr + 9;c != st;c += 2,d += 2)
	  {S[d] = *(c+1);S[d+1] = *c;
	  }
	 st = b;
	}

	void F153()  // PLUS

	{UINT a,b;
    a = *(st-2);b= *(st-1);
    if((a & T6 && (a < 0x00200104 || a > 0x0020010D))||
       (!(a & T6) && (!(Z[a+1] & T1) ||
        ((Z[a+2] != 0x002000D2 && (Z[a+2] < 0x00200104 ||
        Z[a+2] >0x0020010D)))))||
        (b & T6 && (b < 0x00200104 || b > 0x0020010D))||
       (!(b & T6) && (!(Z[b+1] & T1) ||
        ((Z[b+2] != 0x002000D2 && (Z[b+2] < 0x00200104 ||
        Z[b+2] >0x0020010D))))))
      {tipprer = 7;initprer(1);return;}
    st--;*(st-1) = summa(a,b);
   }

	void F154()  //VICHITANIJE

	{UINT a,b,c,d,e;
	 a = *(st-2);b = *(st-1);
    if((a & T6 && (a < 0x00200104 || a > 0x0020010D))||
       (!(a & T6) && (!(Z[a+1] & T1) ||
        ((Z[a+2] != 0x002000D2 && (Z[a+2] < 0x00200104 ||
        Z[a+2] >0x0020010D)))))||
        (b & T6 && (b < 0x00200104 || b > 0x0020010D))||
       (!(b & T6) && (!(Z[b+1] & T1) ||
        ((Z[b+2] != 0x002000D2 && (Z[b+2] < 0x00200104 ||
        Z[b+2] >0x0020010D))))))
      {tipprer = 7;initprer(1);return;}
   st--;c = ((!(a & T6)&&(Z[a+2] == L8))? 1 : 0);
	 d = ((!(b & T6)&&(Z[b+2] == L8))? 1 : 0);
	 if(c != d)*(st-1) = slog(a,b,c);
	 else {e = sravnmod(a,b);if(e == 2){*(st-1)=0;return;}
			 if(e == 0)*(st-1) = razn(a,b,c);
			 else *(st-1) = razn(b,a,1-c);
			}
	}

	void F155() //  UMNOGENIE

	{UINT a,b,*c,*d,e,f,g,h,p,*r,s,t;
    a = *(st-2);b = *(st-1);
	 if((a & T6 && (a < 0x00200104 || a > 0x0020010D))||
       (!(a & T6) && (!(Z[a+1] & T1) ||
        ((Z[a+2] != 0x002000D2 && (Z[a+2] < 0x00200104 ||
        Z[a+2] >0x0020010D)))))||
        (b & T6 && (b < 0x00200104 || b > 0x0020010D))||
       (!(b & T6) && (!(Z[b+1] & T1) ||
        ((Z[b+2] != 0x002000D2 && (Z[b+2] < 0x00200104 ||
        Z[b+2] >0x0020010D))))))
      {tipprer = 7;initprer(1);return;}
    c = st;a = 0;b = 0; // a - znak proizvedenija; b - dlina mantissi
	 if(*(st-1) & T6){R[1] = *(st-1);e = 2;} // e - nachalo vtorogo
															// mnogitelja v R
	 else{g = *(st-1) + 2;if(Z[g] == L8){a = 1;g += 2;}
			 e = 1;h = 0;f = 0;
			 while(!(Z[g] & T1))
				{if(Z[g] ==  L15){f = 1;g += 2;}
				 else {if(Z[g] != L0)h = 1;
						 if(h != 0){R[e] = Z[g];e++;}
						 b += f;g += 2;
						}
				}
		  }
	 if(*(st-2) & T6) {R[e] = *(st-2);f = e + 1;} // f - 1-ja jach posle
																  // vtorogo mnogitelja
	 else{g = *(st-2) + 2;if(Z[g] == L8){a = 1 - a;g += 2;}
			 h = 0;f = e;p = 0;
			 while(!(Z[g] & T1))
			  {if(Z[g] == L15){p = 1;g += 2;}
				else
				  {if(Z[g] != L0)h = 1;
					if(h != 0){R[f] = Z[g];f++;}
					b += p;g += 2;
				  }
			  }
		  }
	 r = c;
	 for(g = f - 1;g >= e;g--)
	  {s = 0;d = r; // s - perenos
		 for(h = e - 1;h != 0;h--)
		  {p = (R[g] - L0)*(R[h] - L0);p += s;
			p += (d < st ? (*d - L0): 0);
         *d = L0 + (p % 10);s = p / 10;
			d++;
		  }
		 if(s != 0){*d = L0 + s;d++;}
		 r++;st = d;
	  }
	 if(b != 0)
		{d = c;
		 while(b != 0){if(d >= st)*d = L0;d++;b--;}
		 for(r = st;r > d;r--)*r = *(r-1);
		 *d =  L15;if(st > d)st++;
					  else{*(d+1) = L0;st = d + 2;}
		}
    d = norman(c);
	 if(a == 1 && (st != d+1 || *d != L0))
	  {*st = L8;st++;}
    t = (st == d+1 ? *d : text2(d));
	 *(c-2) = t;
	 st = c - 1;
	}

	void F156() // SHAGDELENIJA

	{UINT a,b,c,d;
	  st -= 2;F176();st++;F176();st -= 2;
     c = *st & T4;d = (*(st+1) & T4) + 1;
     if(c > 1000 ||d > 100 || d == 1)
      {tipprer = 7;st += 3;initprer(1);return;}
	  a = c /d;
	  b = *(st+2);
	  opr(b,nomer(a));
	}

	void F157() //  DLINAMENEE

	{UINT a,b;
    a = *(st-2);b = *(st-1);
    if(a == L3)
     {if(b == 0x00200104)ist = 0;
      st -= 2;return;}
    if(a & T6 || !(Z[a+1] & T1) || !(b & 0x00200000))
     {tipprer = 7;initprer(1);return;}
    if(Z[a] >= 2*(b - L0) + 4)ist = 0;
    st -= 2;
   }

	void F158() // KLAVIATURA

	{if(zDelta >= 120)
	  {zDelta -= 120;
	   opr(*(st-1),0x00200250); st--;
      }
	 else
	  {if(zDelta <= -120)
	    {zDelta += 120;
	     opr(*(st-1),0x00200258); st--;
	    }
	   else
	    {input = 1;ind = 2;}
	  }
	}
	void F159() // VIDEO

	{UINT *a,b,c,d,e,f,g,h,p,r,m,*q,i,j,n,y,*k;
	 int s,s1;
	 char v,v1,v2,v3;
	 BOOL b1;
     unsigned char w;
     HWND hrwd;
	 RECT rr;
     double *dc,da,db,dk,dn;
     UINT64 h1;
	 st--;n = *st - L0;a = st - n;
	 switch(*a)
	 {case 0x00200039: // bukva
      if(*(a+1) != 0x00200014)
      {stolbec = *(a+1) - L0;stroka = *(a+2) - L0;
       if(n != 6)
        {tipprer = 7;st++;initprer(1);return;}
      }
      if(indparal == 0)
	   {b = (*(a+3) - L0) * 38;
	    hdc = NGetDC(hhwnd);hdcm = NCreateCompatibleDC(hdc);
	    hbmp = NCreateBitmap(8,19,1,1,&FONT[b]);
	    hbmpold = (HBITMAP)NSelectObject(hdcm,hbmp);
	    c = *(a+4) - L7;
	    NSetBkColor(hdc,c);
	    NSetBkColor(hsdc,c);
	    c = *(a+5) - L7;
	    NSetTextColor(hdc,c);
	    NSetTextColor(hsdc,c);
	    NBitBlt(hdc,stolbec,stroka,8,19,hdcm,0,0,0);
	    NBitBlt(hsdc,stolbec,stroka,8,19,hdcm,0,0,0);
	    NSelectObject(hdcm,hbmpold);
	    NDeleteObject(hbmp);
	    NDeleteDC(hdcm);
	    NReleaseDC(hhwnd,hdc);
	   }
	  stolbec += 8;
	  if(stolbec > rectright - 7)
	   {stolbec -= (8 * ((stolbec - rectleft)/8));
	    stroka += 19;
       }
	  break;
	  case 0x00200339: // prjamougolnik
      if(n != 6)
       {tipprer = 7;st++;initprer(1);return;}
	  rectleft = *(a+1) - L0;recttop = *(a+2) - L0;
	  rectright = *(a+3) - L0;rectbottom = *(a+4) - L0;
      b = *(a+5);
	  if(b == L0){st = a;return;};
	  b -= L7;
	  if(indparal == 0 || b > 15)
	   {if(b > 15)
	     {b -= 16;}
	    hdc = NGetDC(hhwnd);
		hbr = NCreateSolidBrush(red[b],green[b],blue[b]);
		hbrold = (HBRUSH)NSelectObject(hdc,hbr);
		hpen = NCreatePen(0,red[b],green[b],blue[b]);
		hpenold = (HPEN)NSelectObject(hdc,hpen);
        Points[0].x = rectleft;
		Points[0].y = recttop;
		Points[1].x = rectright;
		Points[1].y = recttop;
        Points[2].x = rectright;
        Points[2].y = rectbottom;
        Points[3].x = rectleft;
        Points[3].y = rectbottom;
        NPolygon(hdc,Points,4);
        NRectangle(hdc,rectleft,recttop,rectright,rectbottom);
		NSelectObject(hdc,hbrold);
		NSelectObject(hdc,hpenold);
		hbrold = (HBRUSH)NSelectObject(hsdc,hbr);
		hpenold = (HPEN)NSelectObject(hsdc,hpen);
		NPolygon(hsdc,Points,4);
		NRectangle(hsdc,rectleft,recttop,rectright,rectbottom);
		NSelectObject(hsdc,hbrold);
		NSelectObject(hsdc,hpenold);
		NDeleteObject(hpen);
		NDeleteObject(hbr);
		NReleaseDC(hhwnd,hdc);
	   }
      break;
      case 0x00200ACA: // mesto
      b = *(a+1);
      b -= L0;
      s = (int)b;
      c = *(a+2);
      c -= L0;
      s1 = (int)c;
      ClipCursor(0);
      SetCursorPos(s,s1);
      break;
      case 0x00200650: // prjamougolnij
      if(n != 8)
       {tipprer = 7;st++;initprer(1);return;}
	  rectleft = *(a+1) - L0;recttop = *(a+2) - L0;
	  rectright = *(a+3) - L0;rectbottom = *(a+4) - L0;
      b = *(a+5);
	  b = convchisl(b);
	  v1 = (char)(b);
      b = *(a+6);
	  b = convchisl(b);
	  v2 = (char)(b);
	  b = *(a+7);
	  b = convchisl(b);
	  v3 = (char)(b);
	  hdc = NGetDC(hhwnd);
	  hbr = NCreateSolidBrush(v1,v2,v3);
	  hbrold = (HBRUSH)NSelectObject(hdc,hbr);
	  hpen = NCreatePen(0,v1,v2,v3);
	  hpenold = (HPEN)NSelectObject(hdc,hpen);
      Points[0].x = rectleft;
	  Points[0].y = recttop;
	  Points[1].x = rectright;
	  Points[1].y = recttop;
      Points[2].x = rectright;
      Points[2].y = rectbottom;
      Points[3].x = rectleft;
      Points[3].y = rectbottom;
      NPolygon(hdc,Points,4);
      NRectangle(hdc,rectleft,recttop,rectright,rectbottom);
	  NSelectObject(hdc,hbrold);
	  NSelectObject(hdc,hpenold);
	  hbrold = (HBRUSH)NSelectObject(hsdc,hbr);
	  hpenold = (HPEN)NSelectObject(hsdc,hpen);
	  NPolygon(hsdc,Points,4);
	  NRectangle(hsdc,rectleft,recttop,rectright,rectbottom);
	  NSelectObject(hsdc,hbrold);
	  NSelectObject(hsdc,hpenold);
	  NDeleteObject(hpen);
	  NDeleteObject(hbr);
	  NReleaseDC(hhwnd,hdc);
	  break;
      case 0x00200873: // tchk
      b = *(a+5) - L0;
      c = *(a+6) - L0;
      d = *(a+7) - 0x00200105;
	  if(indparal == 0 && *(a+7) != 0x00200001)
	   {hdc = NGetDC(hhwnd);
        NSetPixel(hdc,b,c,d);
        NSetPixel(hsdc,b,c,d);
        NReleaseDC(hhwnd,hdc);
	   }
      if(*(a+1) != 0x00200001)
       {tchk(*(a+1),*(a+2),*(a+3),*(a+5),*(a+6));
       }
      break;
      case 0x0020085F: // sm
      b = *(a+3) - *(a+1);
      b++;
      b /= 8;
      c = *(a+6) - *(a+2);
      b *= c;
      d = *(a+5) - *(a+1);
      c = d / 8;
      b += c;
      c = d % 8;
      w = 0x80;
      if(c != 0){w >>= c;}
      w &= RS[b];
      c = (w == 0 ? 0x00200105 : 0x00200104);
      opr(*(a+7),c);
      break;
      case 0x002001EB: // podobl
      b = *(a+3) - *(a+1); b++;
      b /= 8; // chislo bit v stroke bufera
      c = *(a+6) - *(a+2);
      d = *(a+8) - *(a+2);
      e = *(a+5) - *(a+1);
      m = *(a+7) - *(a+1);
      while(c <= d)
      {f = b*c;
       for(h = e; h<= m; h++)
       {g = h/8;
        g += f;
        w = 0x80;
        p = h%8;
        if(p != 0){w >>= p;}
        RS[g]|= w;
       }
       c++;
      }
      break;
      case 0x00200A47: // bitmap
      b = *(a+3) - *(a+1);b++;
      c = *(a+4) - *(a+2);c++;
	  if(indparal == 0)
	   {hdc = NGetDC(hhwnd);hdcm = NCreateCompatibleDC(hdc);
		hbmp = NCreateBitmap(b,c,1,1,RS);
		hbmpold = (HBITMAP)NSelectObject(hdcm,hbmp);
        d = *(a+6) - 0x00200105;
		NSetTextColor(hdc,d);
	    NSetTextColor(hsdc,d);
		d = *(a+5) - 0x00200105;
        e = *(a+1) - L0;
        f = *(a+2) - L0;
		NSetBkColor(hdc,d);
		NSetBkColor(hsdc,d);
		NBitBlt(hdc,e,f,b,c,hdcm,0,0,0);
		NBitBlt(hsdc,e,f,b,c,hdcm,0,0,0);
		NSelectObject(hdcm,hbmpold);
		NDeleteObject(hbmp);
		NDeleteDC(hdcm);
		NReleaseDC(hhwnd,hdc);
	   }
      break;
      case 0x00200069: // logsimvol
		if(*(a+1) != 0x00200014)
		 {stolbec = *(a+1) - L0;stroka = *(a+2) - L0;}
		b = *(a+6) - L0;
      if(n != 8 || !(*(a+3) & T6))
       {tipprer = 7;st++;initprer(1);return;}
		c = bufsimv(*(a+3),b,*(a+4),*(a+5));
		if(*(a+1) == 0x00200001)
         {d = c;}
        else
         {if(c == 0 && b != 0){ist = 0;st = a;return;}
		  if(b < c)d = prorisovka(b,c);
		  if(d < c){ist = 0;st = a;return;}
         }
		opr(*(a+7),L0 + d);
		break;
	  case 0x0020023D: // term
		if(*(a+1) != 0x00200014)
		 {stolbec = *(a+1) - L0;stroka = *(a+2) - L0;}
		b = *(a+6) - L0; // b - ish.pozicia v bufere tekstov
		c = *(a+5); // smeshenie ish.simvola
		d = *(a+3);
      if(n != 9 || c & T6 || d & T6 || Z[c+1] & T1 ||
         Z[d+1] & T1 || *(a+4) & T6)
       {tipprer = 7;st++;initprer(1);return;}
      d += (Z[d + 1] & T4); // d - smeshenie pervoj jachejki
													// posle podterma
      e = *(a+4) + 2; // e - smeshenie tek.ukazatelja raskraski
		m = 0; // indikator vidachi neodnobukvennogo chisla
		R[0] = 0;i = 1; // i - indikator virtualnoj prorisovki
      g = Z[e];R[1] = Z[g + 2];R[2] = Z[g + 4];
      if(R[1] == R[2])
       {i = 0;stolbec = 0;stroka = 0;}
		f = 0;e += 2;g = Z[e]; // f - smeshenie v nakopitele R tekushej troiki
		while(!(g & T1) && (Z[g + 2] < c))
		 {f += 3;R[f] = Z[g + 2];R[f + 1] = Z[g + 4];
		  R[f + 2] = Z[g + 6];e += 2;g = Z[e];
		 }; // zapolnenie nakopitelja pered prosmotrom podterma
		h = Z[c + 1] >> 16;
		h = (h == 3 ? 0 : c - h); // h - smeshenie vneshnego operanda
		r = h; // r - smeshenie vneshnego operanda dlja vsego terma
		while(c < d)
		 {if(b <= *(a+1) - L0)y = c;
        p = Z[c+1] >> 16;
		  if((p != 3) && ((c - p) != h))  // vidacha zakrivajushej skobki
			{if(m == 0)bufbukva(b,0x0020012D,R[f+1],R[f+2]);
			 else
			 {m = 0;
			  if(c - p == h - (Z[h+1] >> 16))
			   bufbukva(b,0x00200124,R[f+1],R[f+2]);
           else b--;
			 }
			 b++;
			 if(2998 < b){ist = 0;st = a;return;}
			 if(R[f] == h)f -= 3;
			 h -= (Z[h + 1] >> 16);
			}
		  else
			{if(!(g & T1) && (Z[g + 2] == c))
			  {f += 3;R[f] = c;R[f+1] = Z[g + 4];
				R[f+2] = Z[g + 6];e += 2;g = Z[e];
			  };
			 if(Z[c] == 0x002001A2 &&
             ((Z[c+1] & 0x0000FFFF) != 2))m = 1;
			 else
          {b = bufsimv(Z[c],b,R[f+1],R[f+2]);  // vidacha simvola
			  if(b == 0){ist = 0;st = a;return;};
          }
			 if((Z[c+1] & T4) == 2) // vidacha simvola bez otkrivajushej skobki
			  {if(R[f] == c)f -= 3;
				if(m == 0 && !(Z[c+2] & T1) && ((c + 2 - (Z[c+3] >> 16)) == h))
				 {bufbukva(b,0x00200124,R[f+1],R[f+2]);b++;
				  if(2998 < b){ist = 0;st = a;return;}
				 };
			  }
			 else
			  {if(m == 0)
				{bufbukva(b,0x0020012C,R[f+1],R[f+2]);b++;
				 if(2998 < b){ist = 0;st = a;return;};
				}
				h = c;
			  };
			 c += 2;
			}
		 }
		while(r != h)
		 {if(m != 0)m = 0;
		  else
		  {bufbukva(b,0x0020012D,R[f+1],R[f+2]);b++;
			if(2998 < b){ist = 0;st = a;return;}
		  }
		  if(R[f] == h)f -= 3;
		  p = Z[h+1] >> 16;
		  h = (p == 3 ? 0 : h - p);
		 }
      if(i == 1)c = prorisovka(*(a+6) - L0,b);
      else c = b;
      opr(*(a+7),(i == 0 ? y : (b == c ? L0 : (L0 + c))));
		opr(*(a+8),L0 + b);
		break;
	  case 0x0020023F: // slovo
      if(n != 6)
      {tipprer = 7;st++;initprer(1);return;}
		if(*(a+1) != 0x00200014)
		 {stolbec = *(a+1) - L0;stroka = *(a+2) - L0;}
		b = *(a+4);
		if(b == 0x00200014)
		 {c = *(a+3) - L0;
		  while(c < 15999 && (B[c] != 0))c++;
		  c--;
		 }
		else c = b - L0;
		d = prorisovka(*(a+3) - L0,c+1);
		opr(*(a+5),(d == (c+1) ? L0 : L0 + d));
		break;
	  case 0x002002A9: // otrezok
      if(n != 3)
       {tipprer = 7;st++;initprer(1);return;}
	  b = *(a+2);b -= L7;
	  if(indparal == 0)
	   {hdc = NGetDC(hhwnd);
		hpen = NCreatePen(1,red[b],green[b],blue[b]);
     	hpenold = (HPEN)NSelectObject(hdc,hpen);
		for(c = *(a+1) + 2; !(Z[c] & T1);c += 2)
     	 {d = Z[c];
     	  e = Z[d+2] - L0;
		  f = Z[d+4] - L0;
		  g = NMoveToEx(hdc, e,f);
		  e = Z[d+6] - L0;
		  f = Z[d+8] - L0;
		  g = NLineTo(hdc, e,f);
		 };
		NSelectObject(hdc,hpenold);
     	NReleaseDC(hhwnd,hdc);
        hpenold = (HPEN)NSelectObject(hsdc,hpen);
        for(c = *(a+1) + 2; !(Z[c] & T1);c += 2)
	     {d = Z[c];
		  e = Z[d+2] - L0;
		  f = Z[d+4] - L0;
		  g = NMoveToEx(hsdc, e,f);
	      e = Z[d+6] - L0;
		  f = Z[d+8] - L0;
 		  g = NLineTo(hsdc, e,f);
		 };
		NSelectObject(hsdc,hpenold);
		NDeleteObject(hpen);
	   }
	  break;
      case 0x002003A4: // okrugnostb
      if(n != 10)
	   {tipprer = 7;st++;initprer(1);return;}
      b = *(a+9);b -= L7;
	  if(indparal == 0)
	   {hdc = NGetDC(hhwnd);
		hpen = NCreatePen(0,
               red[b],green[b],blue[b]);
		hpenold = (HPEN)NSelectObject(hdc,hpen);
        SetArcDirection(hdc,(*(a+8) == L0 ?
         AD_COUNTERCLOCKWISE : AD_CLOCKWISE));
        Arc(hdc,
          *(a+1) - *(a+3),
          *(a+2) - *(a+3),
          (*(a+1) - L0) + (*(a+3) - L0),
          (*(a+2) - L0) + (*(a+3) - L0),
          *(a+4) - L0,
          *(a+5) - L0,
          *(a+6) - L0,
          *(a+7) - L0);
     	NSelectObject(hdc,hpenold);
        hpenold = (HPEN)NSelectObject(hsdc,hpen);
        SetArcDirection(hsdc,(*(a+8) == L0 ?
        AD_COUNTERCLOCKWISE : AD_CLOCKWISE));
        Arc(hsdc,
          *(a+1) - *(a+3),
          *(a+2) - *(a+3),
          (*(a+1) - L0) + (*(a+3) - L0),
          (*(a+2) - L0) + (*(a+3) - L0),
          *(a+4) - L0,
          *(a+5) - L0,
          *(a+6) - L0,
          *(a+7) - L0);
     	NSelectObject(hsdc,hpenold);
       	NDeleteObject(hpen);
		NReleaseDC(hhwnd,hdc);
	   }
	  break;
      case 0x002004F0: // raschistka
      q = (UINT*)RS;
      for(b = 0;b <10000;b++)
      q[b] = 0xFFFFFFFF;
      break;
      case 0x0020012E: // spusk
      if(n != 4)
       {tipprer= 7;st++;initprer(1);return;}
	  if(indparal == 0)
	   {hdc = NGetDC(hhwnd);
		b = *(a+3);b -= L7;
		hbr = NCreateSolidBrush(red[b],green[b],blue[b]);
		hbrold = (HBRUSH)NSelectObject(hdc,hbr);
		hpen = NCreatePen(0,red[b],green[b],blue[b]);
		hpenold = (HPEN)NSelectObject(hdc,hpen);
		rect.left = rectleft;
		rect.right = rectright;
		rect.top = recttop;
		rect.bottom = rectbottom;
		s = *(a+2) - L0;
		c = *(a+2) - L0;
		if((*(a+1) == 0x00200044) || (*(a+1) == 0x00200055))s = -s;
		if(*(a+1) == 0x00200043 || *(a+1) == 0x00200044)
		  {ScrollDC(hdc,0,s,&rect,&rect,NULL,NULL);
			if(0 < s)NRectangle(hdc,rectleft,recttop,rectright,recttop + c);
		 	if(s < 0)NRectangle(hdc,rectleft,rectbottom - c,rectright,rectbottom);
		  }
		else
		  {ScrollDC(hdc,s,0,&rect,&rect,NULL,NULL);
			if(0 < s)NRectangle(hdc,rectleft,recttop,rectleft + c,rectbottom);
			if(s < 0)NRectangle(hdc,rectright - c,recttop,rectright,rectbottom);
		  }
		NSelectObject(hdc,hbrold);
		NSelectObject(hdc,hpenold);
		hbrold = (HBRUSH)NSelectObject(hsdc,hbr);
		hpenold = (HPEN)NSelectObject(hsdc,hpen);
		if(*(a+1) == 0x00200043 || *(a+1) == 0x00200044)
		  {ScrollDC(hsdc,0,s,&rect,&rect,NULL,NULL);
			if(0 < s)NRectangle(hsdc,rectleft,recttop,rectright,recttop + c);
		 	if(s < 0)NRectangle(hsdc,rectleft,rectbottom - c,rectright,rectbottom);
		  }
		else
		  {ScrollDC(hsdc,s,0,&rect,&rect,NULL,NULL);
			if(0 < s)NRectangle(hsdc,rectleft,recttop,rectleft + c,rectbottom);
			if(s < 0)NRectangle(hsdc,rectright - c,recttop,rectright,rectbottom);
		  }
		NSelectObject(hsdc,hbrold);
		NSelectObject(hsdc,hpenold);
		NDeleteObject(hbr);
		NDeleteObject(hpen);
		NReleaseDC(hhwnd,hdc);
	   }
	  break;
	  case 0x00200104: // nolb
		for(b = 0;b < 16000;b++)
		 B[b] = 0;
		break;
	  case 0x0020015E: // pusto
        for(b = 0;b < 48000;b++)
		 B[b] = 0;
		break;
	  case 0x00200119: // pustoeslovo
      c = *(a+1) - 0x00200104;
      d = *(a+2) - 0x00200104;
      for(b = c;b <= d;b++)
       B[b] = 0;
      break;
      case 0x00200864: // grafik
      c = convchisl(*(a+2)); // chislo
                             // stolbcov
      d = c /16; e = c % 16;
      if(e != 0)d++; d *= 2; // d - chislo bait v stroke
      e = *(a+6) - *(a+5); e++; // e - chislo strok
      f = d * e;
      for(i=0; i<f; i++)C[i]=0xFF; // raschistka bufera
                                // bitmapov
      q = (UINT*)&da;
      b = *(a+3); *q = Z[b+3]; *(q+1) = Z[b+5];
      q = (UINT*)&db;
      b = *(a+4); *q = Z[b+3]; *(q+1) = Z[b+5];
      db -= da;
      dk = (double)e - 1;
      dk /= db; // dk - koefficient masshtabirovanija
      b = *(a+1);
      h1 = (UINT64)Z[b+5];
      h1 <<= 32;
      h1 |= (UINT64)Z[b+3];
      dc = reinterpret_cast<double*>(h1);
      db = dc[0] - da; db *= dk; g = 0xFFFFFFFF;
      if(dc[0] == notchisl)g = 0xFFFFFFF1;
       else
        {if(dc[0] == plusbesk)g = 0xFFFFFFF0;
         else
          {if(0 <= db && dc[0] != minusbesk)
            {g = (UINT)(db);
             if(e < g)g = 0xFFFFFFF0;
            }
          }
        }
      h = g;
      for(i = 0;i < c-1;i++) //cicle registracii tochek v
                           // bufere bitmapov
      {dn = dc[(i == c-1 ? i : i+1)];
       db = dn - da;
       db *= dk;
       m = 0xFFFFFFFF;
       if(dn == notchisl)m = 0xFFFFFFF1;
       else
        {if(dn == plusbesk)m = 0xFFFFFFF0;
         else
           {if(0 <= db && dn != minusbesk)
            {m = (UINT)(db);
             if(e < m)m = 0xFFFFFFF0;
            }
           }
        }
       y = (g == 0xFFFFFFF1 ? h :
             ((g == 0xFFFFFFFF || h == 0xFFFFFFFF)?
              0 :((g == 0xFFFFFFF0 || h == 0xFFFFFFF0)?
             e-1 : (g+h)/2)));
       r = (m == 0xFFFFFFF1 ? h :
            ((h == 0xFFFFFFFF || m == 0xFFFFFFFF)?
             0 : ((h == 0xFFFFFFF0 || m == 0xFFFFFFF0)?
             e-1 : (h+m)/2)));
       g = h; h = m;
       if(r < y)
        {m = y; y = r; r = m;}
       m = i%8; v = (0x80 >> m);
       if(!( g & 0x80000000))
       {for(j = y; j <= r; j++)
         {n = d*(e - j - 1) + (i/8);
          C[n] ^= v;
         }
       }
      }
	  if(indparal == 0)
	   {hdc = NGetDC(hhwnd);
        hdcm = NCreateCompatibleDC(hdc);
        hbmp = NCreateBitmap(c,e,1,1,C);
        hbmpold = (HBITMAP)NSelectObject(hdcm,hbmp);
        b = *(a+8)-L7;
        NSetBkColor(hdc,b);
        b = *(a+9)-L7;
        NSetTextColor(hdc,b);
        NBitBlt(hdc,*(a+7)-L0,*(a+5)-L0,c,e,hdcm,0,0,1);
        b = *(a+8)-L7;
        NSetBkColor(hsdc,b);
        b = *(a+9)-L7;
        NSetTextColor(hsdc,b);
        NBitBlt(hsdc,*(a+7)-L0,*(a+5)-L0,c,e,hdcm,0,0,1);
        NSelectObject(hdcm,hbmpold);
        NDeleteObject(hbmp);
        NDeleteDC(hdcm);
        NReleaseDC(hhwnd,hdc);
	   }
      break;
	  case 0x00200037: // pozicia
      if(n != 3)
      {tipprer = 7;st++;initprer(1);return;}
		if(*(a+1) != 0x00200014)
		 {stolbec = *(a+1) - L0;stroka = *(a+2) - L0;}
		break;
	  case 0x002002A4: // tochka
      if(n != 3)
      {tipprer = 7;st++;initprer(1);return;}
		opr(*(a+1),stolbec + L0);opr(*(a+2),stroka + L0);
		break;
	  case 0x00200071: // zapisb
      if(n != 5)
      {tipprer = 7;st++;initprer(1);return;}
		b = *(a+1) - L0;
		c = (((*(a+3) - L7) & 0x0000000F) << 12) |
			 (((*(a+4) - L7) & 0x0000000F) << 8);
		B[b] = c | ((*(a+2) - L0) & 0x000000FF);
		break;
     case 0x002000B6:  // posilka
      if(iMT == 0 || n != 5)
      {tipprer = 7;st++;initprer(1);return;}
		b = *(a+1) - L0;
      if(b >= jMT)
      {tipprer = 7;st++;initprer(1);return;}
		c = (((*(a+3) - L7) & 0x0000000F) << 12) |
			 (((*(a+4) - L7) & 0x0000000F) << 8);

		MT[b] = c | ((*(a+2) - L0) & 0x000000FF);
		break;

	  case 0x00200190: // znachenie
      if(n != 5)
      {tipprer = 7;st++;initprer(1);return;}
        m = *(a+1);
        m -= L0;
		b = B[m];
		opr(*(a+2),L0 + (b & 0x000000FF));
		opr(*(a+3),L7 + ((b >> 12) & 0x0000000F));
		opr(*(a+4),L7 + ((b >> 8) & 0x0000000F));
		break;
     case 0x00200314: // Sm
      if(iMT == 0 || n != 5)
      {tipprer = 7;st++;initprer(1);return;}
      c = *(a+1) - L0;
      if(c >= jMT)
      {tipprer = 7;st++;initprer(1);return;}
		b = MT[c];
		opr(*(a+2),L0 + (b & 0x000000FF));
		opr(*(a+3),L7 + ((b >> 12) & 0x0000000F));
		opr(*(a+4),L7 + ((b >> 8) & 0x0000000F));
		break;
	 case 0x00200F79: // ramka
       hrwd = GetDesktopWindow();
       GetWindowRect(hrwd,&rr);
       b = rr.right;
       c = rr.bottom;
       d = (*(a+1) - L0);
	   e = *(a+2);
	   f = *(a+3);
	   g = *(a+4); g = convchisl(g);
	   h = *(a+5); h = convchisl(h);
	   if(d == 0)
	    {if(e == 0x00200104)
	      {b /= 8; b *= 8;}
	     if(e == 0x00200105)
	      {b = (4*c)/3; b /= 8; b *= 8;}
         if(e == 0x00200106)
		  {b = b/2; b /= 8; b *= 8;}
	    }
	   else
	    {b = convchisl(e);
	     c = convchisl(f);
	    }
	   SetWindowPos(hhwnd,NULL,g-6,h,b,c+4,SWP_SHOWWINDOW|SWP_DRAWFRAME);
	   break;
	 case 0x002000C9: // blank
      if(n != 3)
      {tipprer = 7;st++;initprer(1);return;}
		b = (*(a+1) - L0) * 38;
		c = *(a+2) + 2;
		for(d = 0;d < 19;d++,c += 2)
		 {e = Z[c] + 2;v = 0;
		  for(f = 0;f < 8;f++,e += 2)
			{v <<= 1;if(Z[e] == L0)v |= 1;}
		  FONT[b] = v;FONT[b+1] = 0xFF;b += 2;
		 };
		break;
	  case 0x00200088: // vstavka (sdvigaet codergimoe bufera tekstov na 1
							 // vpravo;sdvigaet tek.stroku na ekrane s tek.pozicii
							 // na odnu bukvu vpravo)
      if(n != 6)
      {tipprer = 7;st++;initprer(1);return;}
		b = *(a+5) - 0x00200103;c = *(a+4) - L0;
		if(b == 15999)b = 15998;
		while(c < b)
		 {B[b+1] = B[b];b--;}
      B[c+1] = B[c];
		if(*(a+3) == 0x00200001){st = a;return;}
		b = *(a+3) - 0x0020010B;c = *(a+1) - L0;
		if(b == c){st = a;return;}
		if(indparal == 0)
		 {hdc = NGetDC(hhwnd);
		  rect.left = c;
		  rect.right = *(a+3) - L0;
		  d = *(a+2) - L0;
		  rect.top = d;
		  rect.bottom = d + 18;
		  ScrollDC(hdc,8,0,&rect,&rect,NULL,NULL);
		  ScrollDC(hsdc,8,0,&rect,&rect,NULL,NULL);
		  NReleaseDC(hhwnd,hdc);
		 }
		break;
	  case 0x002008D3: // tekstredaktor
      if(n != 5)
      {tipprer = 7;st++;initprer(1);return;}
		b = *(a+1) - L0;
      c = *(a+2) - L0;
		d = *(a+3);
      if(d != L0)p = (((d - L7) << 12) | 0x00000020);
		e = b;
		while(e < 16000 && e < c)
		 {f = B[e] & 0x000000FF; f *= 38; g = 0;
		  for(h = 0; h < 19; h++,f+= 2)
		  if(FONT[f] != 0xFF)
			{g = 1; b = e; break;};
		  if(g == 0 && d != L0)B[e] = p;
		  e++;
		 }
		if(b < 15999)B[b+1] = 0;
		opr(*(a+4),b + L0);
		break;
	  case 0x00200067: // iskluchenie
      if(n != 5)
      {tipprer = 7;st++;initprer(1);return;}
		b = *(a+1) - L0; c = *(a+2) - L0;
		d = *(a+3) - L0;
		p = 0x00000020 | ((*(a+4) - L7) << 12);
		while( b <= d)
		 {B[b] = ((c <= d && B[c] != 0)? B[c] : p);b++;c++;}
		if(b < 15999)B[b] = 0;
		break;
	  case 0x002002BE: // aktiv
      if(n != 5)
      {tipprer = 7;st++;initprer(1);return;}
		b = *(a+1) - L0;c = *(a+2) - L0;
		d = ((*(a+3) - L7) << 12) | ((*(a+4) - L7) << 8);
		for(e = b;e <= c;e++)
		 {f = B[e]; f &= 0x000000FF;B[e] = f |d;}
		break;
	  case 0x00200241: // vhogdenie
      if(n != 4)
      {tipprer = 7;st++;initprer(1);return;}
		b = *(a+1) - L0; c = *(a+2) - L0;
		d = ((*(a+3) - L7) << 12);
		for(e = b;e <= c;e++)
		 {f = B[e];f &= 0x00000FFF;B[e] = f|d;}
		break;
	  case 0x0020001C: // perestanovka
      if(n != 4)
      {tipprer = 7;st++;initprer(1);return;}
		b = *(a+1) - L0;c = *(a+2) - L0;
		d = *(a+3) - L0;e = 0;d++;
		if(b >= c)
		 {f = d; while(f < b){R[e] = B[f];e++;f++;}
		  f = c; while(f < d){R[e] = B[f];e++;f++;}
		  for(f = 0;f < e;f++,c++)
			B[c] = R[f];
		 }
		else
		 {f = c; while(f < d){R[e] = B[f];e++;f++;}
		  f = b; while(f < c){R[e] = B[f];e++;f++;}
		  for(f = 0;f < e;f++,b++)
			B[b] = R[f];
		 }
		break;
	  case 0x00200321: // interval
		sdvig = *(a+1)- 0x00200104;
		break;
	  case 0x00200153: // Minus
     	opr(*(a+1),sdvig + 0x00200104);
		break;
	  case 0x002003AD: // komandi (poiskpari)
		b = *(a+1) - L0;
		c = B[b] & 0x000000FF;d = 1;
		if(c == 0x28)
		 while(d != 0 && b < 15999)
		  {b++;e = B[b] & 0x000000FF;
			if(e == 0x28)d++;if(e == 0x29)d--;
		  };
		if(c == 0x29)
		 while(d != 0 && 0 < b)
		  {b--;e = B[b] & 0x000000FF;
			if(e == 0x28)d--;if(e == 0x29)d++;
		  }
		opr(*(a+2),(d == 0 ? b + L0 : *(a+1)));
		break;
	  case 0x00200217: // vstavkafragmenta
		b = ((*(a+4) - 0x00200105) << 12) | 0x00000020;
		c = *(a+2) - L0;
		if(c != 0)
		 {d = *(a+3) - L0;d += c;if(d > 15999)d = 15999;
		  e = d - c;f = *(a+1) - L0;
		  if(e >= f)
			{while(e >= f && e != 0xFFFFFFFF)
           {B[d] = B[e];d--;e--;}
			 while(d >= f && d != 0xFFFFFFFF)
           {B[d] = b;d--;}
			}
		 }
		break;
	  case 0x00200092: // kopija
		switch(*(a+1))
		 {case L0:
			 for(c = 0;c < 16000;c++)B[c+16000] = B[c];
			 break;
        case 0x00200107:
		  	 for(c = 0;c < 16000;c++)B[c+32000] = B[c];
			 break;
        case L7:
			 for(c = 0;c < 16000;c++)B[c] = B[c+16000];
			 break;
        case 0x00200108:
		    for(c = 0;c < 16000;c++)B[c] = B[c+32000];
			 break;
       case 0x00200106:
			 for(c = 0;c <16000;c++)
			  {d = B[c];B[c] = B[c+16000];B[c+16000] = d;}
			 break;
		 }
		break;
     case 0x0020023E: // izvlekaetsja
      b = (*(a+1) - L0);c = (*(a+2) - L0);
      B[48000] = c - b + 1;d = 48001;
      while(b <= c)
       {B[d] = B[b];b++;d++;}
      break;
     case 0x00200072: // rezultpodst
      b = *(a+1) - L0;
      c = B[48000];
      if(c != 0)
       {d = 15999;e = d - c;
        while(e > b)
        {B[d] = B[e];d--;e--;}
        B[d] = B[e];
        for(d = b,e = 1;e <= c && d <= 15999;d++,e++)
         B[d] = B[48000 + e];
       }
      break;
	  case 0x00200126: // razvertka
		b = (*(a+1) - L0) * 38;q = st;
      for(c = 0;c < 19;c++)
		 {d = mem(20);if(ind == 4){st = a;return;}
        w = FONT[b + 2*c];f = d + Z[d]-4;w ^= 0xFF;
        for(e = 0;e < 8;e++)
         {Z[f] = L0 + (UINT)(w & 0x01);
          Z[f+1] = 0;f -= 2;w >>= 1;
         }
        *st = d;st++;
       }
      c = text1(q);if(ind == 4){st = a;return;}
      opr(*(a+2),c);
      break;
	  case 0x00200086: // serija
		stolbec = *(a+1) - L0;stroka = *(a+2) - L0;
		b = 0; // b - ish.pozicia v bufere tekstov
		c = *(a+5) + 2;// smeshenie ssilki na tek.term
		q = st; // ukazatel na nachalo v steke spiska par pozicij v bufere
		f = 1; // nomer tek ssilki
		while(!(Z[c] & T1) && b < 1999)
		{d = Z[c] + 2; // d - smeshenie tek.pozicii v terme
		 e = 0; // 0 libo smeshenie vneshnego operanda
		 m = b; // pozicia nachala terma v bufere tekstov
		 while(!(Z[d] & T1) && b < 1999)
		 {p = Z[d];
		  if(p == 0x002001A2 && (h = (Z[d+1] & 0x0000FFFF),h != 2))
			{h += d;d += 2;
			 while(d < h && b < 1999)
			 {bufbukva(b,Z[d],*(a+3),*(a+4));b++;d += 2;}
			}
		  else
			{b = bufsimv(p,b,*(a+3),*(a+4));if(b == 0){b = 1999;break;}
			 if((p == 0x002000F1 || p == 0x002000F2) && e == 0) // vetvb,inache
			  {bufbukva(b,0x00200124,*(a+3),*(a+4));b++;
				if(1998 < b)break;
				g = f;i = 1;f++;
				while(g != 0)
				{r = g % 10;g = g / 10;R[i] = 0x00200134 + r;i++;}
				while(i != 1 && b < 1999)
				{i--;bufbukva(b,R[i],*(a+3),*(a+4));b++;
				}
				bufbukva(b,0x00200124,*(a+3),*(a+4));b++;
				d += (Z[d+1] & T4);
			  }
			 else
			  {if((Z[d+1] & T4) != 2)
				{e = d;d += 2;bufbukva(b,0x0020012C,*(a+3),*(a+4));b++;}
				else
				{d += 2;
				 if(Z[d] & T1)
				 {while(e != 0)
				  {bufbukva(b,0x0020012D,*(a+3),*(a+4));b++;
					g = (Z[e + 1] >> 16);
					if(g == 3)e = 0;
					else e -= g;
				  }
				 }
				 else
				 {g = d - (Z[d+1] >> 16);
				  if(g == e)
					{bufbukva(b,0x00200124,*(a+3),*(a+4));b++;}
				  else
					while(e != g)
					{bufbukva(b,0x0020012D,*(a+3),*(a+4));b++;
					 e -= (Z[e+1] >> 16);
					}
				 }
				}
			  }
			 }
		 }
		 bufbukva(b,0x00200124,*(a+3),*(a+4));b++;
		 g = mem(8);Z[g+2] = 0x00200104 + m;
       Z[g+3] = 0;
       Z[g+4] = 0x00200103 + b;
       Z[g+5] = 0;
		 *st = g;st++;c += 2;
		}
		g = text1(q);opr(*(a+6),g);b--;
		prorisovka(0,(1998 < b ? 1998 : b));
	  break;
      case 0x002000D2: // minus
      if(indparal == 0)
	   {hdc = NGetDC(hhwnd);
        hdcm = NCreateCompatibleDC(hdc);
        GetClientRect(hhwnd,&rr);
        b = rr.right;
        d = rr.bottom;
        hbbmp = NCreateCompatibleBitmap(hdc,b,d);
	    hbmpold = (HBITMAP)NSelectObject(hdcm,hbbmp);
        NBitBlt(hdcm,0,0,b,d,hdc,0,0,0);
        NSelectObject(hdcm,hbmpold);
        NDeleteDC(hdcm);
        NReleaseDC(hhwnd,hdc);
	   }
      break;
      case 0x00200099: // plus
      if(indparal == 0)
	   {hdc = NGetDC(hhwnd);
        hdcm = NCreateCompatibleDC(hdc);
        hbmpold = (HBITMAP)NSelectObject(hdcm,hbbmp);
        GetClientRect(hhwnd,&rr);
        b = rr.right;
        d = rr.bottom;
        NBitBlt(hdc,0,0,b,d,hdcm,0,0,0);
        NBitBlt(hsdc,0,0,b,d,hdcm,0,0,0);
        NSelectObject(hdcm,hbmpold);
        NDeleteObject(hbbmp);
	    NDeleteDC(hdcm);
	    NReleaseDC(hhwnd,hdc);
	   }
      break;
      case 0x00200042: // limit
      opr(*(st-4),rectleft + L0);
      opr(*(st-3),recttop + L0);
      opr(*(st-2),rectright + L0);
      opr(*(st-1),rectbottom + L0);
      st -= 4;
      break;
      case 0x00200061: // nachalo
      if(iMT == 0)
      {MT = (UINT*)calloc(600000,1);
       iMT = 1;jMT = 0;
      }
      break;
      case 0x00200062: // konec
      if(iMT == 1)
      {free(MT);
       iMT = 0;
      }
      break;
      case 0x00200324: // obraz
      b = *(a+1) - L0;
      c = *(a+2) - L0;
      if(b <= c)
       {opr(*(a+3),jMT + L0);
        for(d = b;d <= c;d++,jMT++)
         MT[jMT] = B[d];
        opr(*(a+4),(jMT - 1) + L0);
       }
      else ist = 0;
      break;
      case 0x00200193: // proobraz
      b = *(a+1) - L0;
      c = *(a+2) - L0;
      e = *(a+3) - L0;
      if(b <= c)
       {for(d = b;d <= c;d++,e++)
        B[e] = MT[d];
       }
      else ist = 0;
      break;
      case 0x00200004: // sbros
      jMT = *(a+1) - L0;
      break;
      case 0x00200036: // vicherkivanie
      b = *(a+1) - L0;
      c = *(a+2) - L0;
      n = c - b + 1;
      for(i = c+1; i < jMT; i++)
       MT[i - n] = MT[i];
      jMT -= n;
      break;
      case 0x00200142: // zamenavhogdenija
      b = *(a+1) - L0;
      c = *(a+2) - L0;
      d = *(a+3) - L0;
      e = *(a+4) - L0;
      h = e - d;
      p = c - b;
      if(h < p)
       {n = p - h;
        for(i = c+1; i < jMT; i++)
        MT[i - n] = MT[i];
        jMT -= n;
       }
      if(h > p)
       {n = h - p;
        for(i = jMT - 1; i > c; i--)
        MT[i + n] = MT[i];
        jMT += n;
       }
      for(i = d,n = b; i <= e; i++,n++)
       MT[n] = B[i];
      break;
      case 0x002008FB: // matrica
      switch(*(a+1))
       {case 0x00200069: // logsimvol
        b=0x00200000; c= 0x00004000;
        q = st;
        d = *(a+2);
        d += 2;
        while(!(Z[d] & T1))
         {e = Z[d] + 2;
          while(!(Z[e] & T1))
           {f = Z[e]; e += 2;
            if(f != 0x00200104)b |= c;
            c >>= 1;
            if(c == 0)
             {c = 0x00004000;
              b++;
              *st = b; st++;
              b = 0x00200000;
             }
           }
          d += 2;
         }
        if(c != 0x00004000)
         {b++; *st = b; st++;}
        g = text1(q);
        opr(*(a+3),g);
        break;
        case 0x002000BA: // nabor
        b = *(a+3) - 0x00200104;
        c = *(a+4) - 0x00200104;
        d = *(a+2)+2;
        e = Z[d]; e--;
        f = 0x00004000;
        q = st;
        for(i = 1; i <= b; i++)
        {k = st;
         for(j = 1; j <= c; j++)
         {g = (e & f);
          if(g == 0)
           {*st = 0x00200104;}
          else
           {*st = 0x00200105;}
          st++; f >>= 1;
          if(f == 0)
           {d += 2; e = Z[d]; e--; f = 0x00004000;}
         }
         g = text1(k);
         *st = g; st++;
        }
        g = text1(q);
        opr(*(a+5),g);
        break;
        case 0x0020009F: // video
        b = *(a+8) - 0x00200104; // b - shirina bitmapa
        c = *(a+7) - 0x00200104; // c - visota bitmapa
        d = b/8;
        e = b%8; if(e !=0)d++; // d - chislo bait
                               // v linii bitmapa,
                               // bez dopolnenija do slova
        i = 0; // smeshenie tekushego baita bufera bitmapov
        e = *(a+6) + 2;
        f = Z[e]; f--;
        f <<= 17;
        g = 15; // f - tekushij element koda;
                // g - chislo ostavshihsja
                // bit v nem
        for(j = 1; j <= c; j++)
        {h = b; // chislo ostavshihsja bit stroki koda
         for(n = 1; n <= d; n++)
         {m = (h < 8? b : 8); // chislo schitivaemih v bait
                              // bit koda

          r = f & 0xFF000000;
          if(g <= m)
           {e += 2; f = Z[e]; f--; f <<= 17;
            if(g < m)
             {y = (f >> g) & 0xFF000000; r |= y;
              p= m-g;
              f <<= p;
              g = 15 - p;
             }
            else g = 15;
           }
          else
           {g -= m;
            f <<= m;
           }
          r ^= 0xFF000000;
          r >>= 24;
          if(m < 8)
           {p = 8 - m; y = 0x000000FF;
            y <<= p; r &= y;
           }
          v = (char)r;
          C[i] = v; i++;
         }
         p = d%2;
         if(p != 0)
          {C[i] = 0;i++;}
        }  // bitmap zapolnen
		if(indparal == 0)
		 {hdc = NGetDC(hhwnd);hdcm = NCreateCompatibleDC(hdc);
          hbmp = NCreateBitmap(b,c,1,1,C);
	      hbmpold = (HBITMAP)NSelectObject(hdcm,hbmp);
          d = *(a+4) - 0x00200105;
          e = *(a+5) - 0x00200105;
	      NSetTextColor(hdc,e);
	      NSetBkColor(hdc,d);
          f = *(a+2) - 0x00200104;
          g = *(a+3) - 0x00200104;
	      NBitBlt(hdc,f,g,b,c,hdcm,0,0,0);
	      NSetTextColor(hsdc,e);
	      NSetBkColor(hsdc,d);
          NBitBlt(hsdc,f,g,b,c,hdcm,0,0,0);
	      NSelectObject(hdcm,hbmpold);
	      NDeleteObject(hbmp);
	      NDeleteDC(hdcm);
	      NReleaseDC(hhwnd,hdc);
		 }
        break;
       }
      break;
	  case 0x002000CC: // parametri
      b = convchisl(*(a+1)); // shirina ekrana
	  c = convchisl(*(a+2)); // visota ekrana
	  d = convchisl(*(a+3)); // chastota obnovlenija
	  n = 0;
	  b1 = 1;
	  while(b1 != 0)
	   {b1 = EnumDisplaySettings(NULL,n,&dvmode);
	    e = (UINT)dvmode.dmPelsWidth;
		f = (UINT)dvmode.dmPelsHeight;
		g = (UINT)dvmode.dmDisplayFrequency;
		if(b == e && c == f && d == g &&
            dvmode.dmBitsPerPel == 32)
		 {dvmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH |
		  DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
		  ChangeDisplaySettings(&dvmode,0);
		  return;
		 }
	    n++;
	   }
	  ist = 0;
      break;
    }
	 st = a;
	}

	void F160() //  PLUSSIMV

	{UINT a;
    if(!(*(st-2) & T6) || !(*(st-1) & T6))
     {tipprer = 7;initprer(1);return;}
    st--; a = *(st-1) + ((*st) - L0);
    *(st-1) = (a & 0x0007FFFF) | (*(st-1) & 0xFFF80000);
	}

	void F161() // VICHITSIMV

	{UINT a;
    if(!(*(st-2) & T6) || !(*(st-1) & T6))
     {tipprer = 7;initprer(1);return;}
    st--; a = (*(st-1) - *st) + 0x00000104;
    *(st-1) = (a & 0x0007FFFF) |
    ((*(st-1) ^ *st)& 0xFFF80000 ? 0x00400000 : 0x00200000);
  	}

	void F162()  // UMNOGSIMV

	{if(!(*(st-2) & T6) || !(*(st-1) & T6))
    {tipprer = 7;initprer(1);return;}
    st--; *(st-1) = ((*(st-1) - L0)*((*st) - L0)) + L0;
	}

	void F163()  // CHASTNOESIMV

	{UINT a,b;
    a = *(st-4) - L0;b = *(st-3) - L0;
    if(b == 0 || a > 0x0000FFFF || b > 0x0000FFFF)
    {tipprer = 7;initprer(1);return;}
    opr(*(st-2),(a / b) + L0);
	 opr(*(st-1),(a % b) + L0);st -= 4;
	}

	void F164()  // KODTEKSTA

	{UINT b,c,*d,e,f,g,h,w,i,j,k;
	 d = st; // d - nachalo rezultata v steke viragenij
    if(*(d-3) < 0x00200104 || *(d-3) > 0x00200107)
     {tipprer = 7;initprer(1);return;}
	 b = 0; // b - tek.pozicia v bufere tekstov
	 e = 0; // e - indikator okonchania prosmotra bufera tekstov
	 h = 0x00200104; // h - ukazatel tipa oshibki
	 w = 0; // w - dalee rezultat kodirovania
	 while(e == 0)
	 {c = 1; // c - smeshenie tek.jachejki v nakopitele R
	  g = 0; // g - smeshenie vneshnego operanda v R
	  do
	 {while((B[b] &  0x000000FF) == 0x00000020 && b < 16000)b++;
	  if(B[b] == 0)e = 1;
	  else
	  {f = B[b] & 0x000000FF;
		if(f == 0x00000029)   // zakrivajushaja skobka
		{if(g == 0){h = 0x0020010A;w = b + 0x00200104;}
		 else
		 {R[g+1] |=  c - g;
		  i = R[g+1] >> 16;
		  if(i == 3)g = 0;
		  else g -= i;
		 }
		 b++;
		}
		else
		{if((f == 0x000000E5 || f == 0x00000078) && (i = (B[b+1] & 0x000000FF), // peremennaja
			 (0x00000030 < i && i < 0x0000003A)))
		 {i = b;j = 0; // j - nakopitel nomera peremennoj
		  b++;
		  while((k = B[b] & 0x000000FF,
					 (B[b]!= 0 && k != 0x00000020 && k != 0x00000029)))
		  {if(k < 0x00000030 || k > 0x00000039)
			{h = 0x00200106;w = i + 0x00200104;break;}
			else
			{j = (10 * j) + (k - 0x00000030);
			 if(j > 512)
			 {h = 0x00200107;w = i + 0x00200104;break;}
			 b++;
			}
		  }
		  if(h == 0x00200104)
		  {j |= 0x00400000;
         R[c] = j;
         R[c+1] = (((g == 0)? 3 : (c-g))<< 16) + 2;
			c += 2;
		  }
		 }
		 else
		 {if(0x0000002F < f && f < 0x0000003A) // chislo
		  {i = 0;j = b; // - i smeshenie v nakopitele F razrjadov chisla
			while((k = B[b] & 0x000000FF,
					 ((0x0000002F < k && k < 0x0000003A) ||
                  k == 0x0000002C)))
			{F[i] = (k == 0x0000002C ? 0x00200194 :
                   k + 0x002000D4);
			 i++;b++;
			}
			if(B[b] != 0 && k != 0x00000020 && k != 0x00000029)
			{h = 0x00200108;w = j;}
			else
			{if(i == 1)
			 {R[c] = F[0];
           R[c+1] = (((g == 0)? 3 : (c - g)) << 16) + 2;
			  c += 2;
			 }
			 else
			 {R[c] = 0x002001A2;
           R[c+1] = (((g == 0)? 3 : (c - g)) << 16) +
			  2 * i + 2;k = c;c += 2;
			  for(j = 0;j < i;j++)
			  {R[c] = F[j];R[c+1] = ((c - k) << 16) + 2;
				c += 2;
			  }
			 }
			 if(g != 0 && (k = R[g],(k == 0x002000F1 || k == 0x002000F2))
				 && (R[g+1] >> 16) == 3)  // vneshnie vetvb ili inache
			 {R[g+1] += (c - g);g = 0;}
			}
		  }
		  else    // log.simvol
		  {f = poiskslova(b);
			if(f == 0){h = 0x00200108;w = b + 0x00200104;}
			else
			{b = B1;i = B[b] & 0x000000FF;R[c] = f;R[c+1] =
			 (((g == 0)? 3 : c - g) << 16);
			 if(i == 0x00000028 || ((f == 0x002000F1 || f == 0x002000F2)&&
				 g == 0))g = c;
			 else R[c+1] += 2;
			 if(i == 0x00000028)b++;
			 c += 2;
			}
		  }
		 }
		}
	  }
	  if(*(d-3) == 0x00200107)e = 1;
	  }
	  while(g != 0 && h == 0x00200104 && e == 0);
     if(g != 0 && h == 0x00200104)
      {h = 0x0020010C;w = 0x00200104;}
	  if(h != 0x00200104)e = 1;
	  else
	  {if(*(d-3) == 0x00200107)w = R[1];
		else
		{if(e == 0)
		 {if(*(d-3) == 0x00200106 && c == 3)
         {*st = R[1];st++;}
		  else
		  {i = mem(c + 3);
			if(i == 0){h = 0x00200109;w = 0x00200104;}
			else
			{for(j = 1;j < c;j++)Z[i + j + 1] = R[j];
				if(*(d-3) == 0x00200104)
              {e = 1;w = i;}
				else
				  {*st = i;st++;}
			}
		  }
		 }
		}
	  }
	 }
	 if(h == 0x00200104 && *(d-3) == 0x00200105 || *(d-3) == 0x00200106)
	 {w = text1(d);
	  if(w == 0){h = 0x00200109;w = 0x00200104;}
	 }
	 else st = d;
	 opr(*(d-2),w);opr(*(d-1),h);st -= 3;
	}

	void F165()  // UKAZATEL

	{UINT *a,b,c,*d,e,f,g,h,i;
	 unsigned char *j;
	 st--;a = st - (*st - L0);
	 switch(*a)
	 {case 0x00200069: // logsimvol
	  b = adrcod(*(a+1));
      if(b == 0 || !(*(a+2) & 0x00200000) ||
        nominf == 1 || nominf == 4 ||
        ((b & 0xFFC00000) != 0x80000000))
       {tipprer = 7;st++;initprer(1);return;}
	  tekfail(b);
	  c = (*(a+2) - 0x00200001) << 2;
	  if(infhndl == 0)
       {tipprer = 7;st++;initprer(1);return;};
	  Npointer(infhndl,c,0);
	  Nread(infhndl,R,4);
	  c = R[0];
	  if(c == 0)
	   {ist = 0;st = a;return;};
	  c = codadr(c);
	  if(c == 0)
	   {tipprer = 7;st++;initprer(1);return;};
	  opr(*(a+3),c);st = a;
	  break;
	  case 0x0020024B: // spisok
	   b = adrcod(*(a+1));
       if(b == 0 ||
         (!(b & 0x7FC00000) && nominf != 1 && nominf != 4))
        {tipprer = 7;st++;initprer(1);return;}
	   tekfail(b);
       if(infhndl == 0)
        {tipprer = 7;st++;initprer(1);return;}
	   c = readinf(b);e = *(a+2);
       if(c == 0 || R[0] & 0x80000000 || (!(e & T6) &&
          !(Z[e+1] & T1)))
        {tipprer = 7;st++;initprer(1);return;}
       c = poiskmetki(e); // c - smeshenie v R do polja
	   if(c == 0)
	    {ist = 0;st =a;return;} // metki;B1 - smeshenie do polja ssilok;
										 // B2 - dlina polja metki
	   d = st;c += B2;c += 2;
	   e = B1 >> 2;
	   f = R[e];
	   g = B1 & 3; // f - nakopitel;g - chislo bait
	   if(g != 0)f >>= (g << 3);
	   g = 4 - g;     // v nem
	   while(B1 < c)
		 {h = 0;
		  for(i = 0;i < 17;i += 8)
			{h |= ((f & 0x000000FF) << i);
			 if(g == 1){e++;f = R[e];g = 4;}
			 else {f >>= 8;g--;}
			}
		  h |= (b & 0xFFC00000);
		  i = codadr(h);if(i == 0){ind = 4;st = a;return;};
		  *st = i;st++;B1 += 3;
		 }
	   h = text1(d);
	   if (h == 0)
	    {ind = 4;st = a;return;};
       opr(*(a+3),h);st = a;
	  break;
	  case 0x0020018F: // oblastb
		b = adrcod(*(a+1));
		if(b == 0 ||
         (!(b & 0x7FC00000) && nominf != 1 && nominf != 4))
       {tipprer = 7;st++;initprer(1);return;}
	   tekfail(b);
       if(infhndl == 0)
       {tipprer = 7;st++;initprer(1);return;}
		c = readinf(b);
		if(c == 0 || R[0] & 0x80000000)
       {tipprer = 7;st++;initprer(1);return;}
      c = (R[0] >> 16) & 0x00000FFF;
      if(c == 0)
       {opr(*(a+2),L3);st = a;return;}
		e = 4;d = st;
		while(e != 0)
		 {tekstmetki(e + 2,1);if(ind == 4){st = a;return;}
		  e = sledmetka(c,e);
		 }
		e = text1(d);if(e == 0){ind = 4;st = a;return;}
		opr(*(a+2),e);st = a;
		break;
	  case 0x0020001E: // novij
		if(*(a+1) == 0x00200069)
		 {tekfail(T1);
		  for(b = 0;b < 65536;b++)C[b] = 0;
		  for(b = 0;b < 32;b++)
		   {Npointer(infhndl,0,1);
            Nwrite(infhndl,C,65536);
		   }
		  opr(*(a+5),codadr(T1));st = a;
		 }
		else
		 {if(*(a+2) == 0x00200104){f = T1;tekfail(f);}
		  else
			{f = adrcod(*(a+2));
          if(f == 0)
           {tipprer = 7;st++;initprer(1);return;}
			 if((f & 0x7FC00000) == 0 && nominf != 1 && nominf != 4)
				 {f = T1;e = poslednijfail();}
			 else
           {e = f & 0xFFC00000;tekfail(f);
            Npointer(infhndl,(f & 0x0003FFFFF)-3,0);
            Nread(infhndl,(char*)R,7);
            if(R[0] & 0x00FFFFFF || R[1] & 0x00800000)
            {tipprer = 7;st++;initprer(1);return;}
           }
			}
		  b = *(a+4) - L0;
        c = *(a+3);
        if(!(c & T6) && !(Z[c+1] & T1))
         {tipprer = 7;st++;initprer(1);return;}
		  Npointer(infhndl,0,1);
          Nwrite(infhndl,nuli,3);
		  R[0] = (b + 4);
		  c =  Npointer(infhndl,0,1);
          Nwrite(infhndl,(char*)R,b + 4);
          if(4000000 < c + b)polnij = 1;
		  c |= e;
		  if(*(a+2) != 0x00200104)registracia(f,*(a+3),c);
		  opr(*(a+5),codadr(c));st = a;
		 }
		break;
	  case 0x00200067: // iskljuchenie
		b = adrcod(*(a+1));
      if(b == 0)
       {tipprer = 7;st++;initprer(1);return;}
		if(!(b & 0x7FC00000) && nominf != 1 && nominf != 4)
		 {tekfail(0x80000000);c = *(a+2);
        if(!(c & T6))
         {tipprer = 7;st++;initprer(1);return;}
          c &= T4;c *= 4;
		  Npointer(infhndl,c - 4,0);
		  Nread(infhndl,(char*)R,4);
		  e = R[0];smfail(e,nominf);
		  Npointer(infhndl,c - 4,0);
		  Nwrite(infhndl,nuli,4);
		 }
		else
		 {tekfail(b);
        if(infhndl == 0)
         {tipprer = 7;st++;initprer(1);return;}
		  f = readinf(b);
        if(f == 0 || R[0] & 0x80000000)
         {tipprer = 7;st++;initprer(1);return;}
		  e = adrcod(*(a+3));i = *(a+2);
        if(e == 0 || (b ^ e) & 0xFFC00000 ||
           (!(i & T6) && !(Z[i+1] & T1)))
         {tipprer = 7;st++;initprer(1);return;}
		  c = iskluchssilki(i,e);
        smfail(f,nominf);
	  	  izmenenie(f,c);
        if(ind == 4){tipprer = 7;st++;initprer(1);return;}
		 }
		d = (UINT*)C;
		d[1] = e;tekfail(e);
		f = 1;
		while(f != 0)
		 {g = d[f] & 0x003FFFFF;
		  do
			{h = 0;
			 Npointer(infhndl,g,0);
			 Nread(infhndl,(char*)R,7);
			 if(R[0] & 0x40000000){h = 1;g = R[1] & 0x00FFFFFF;}
			}
		  while(h == 1);
		  Npointer(infhndl,g,0);
		  if(R[0] & T1)
			{R[0] -= 0x00010000;
			 if((R[0] & 0x0FFF0000) == 0)R[0] |= 0x40000000;
			 Nwrite(infhndl,(char*)R,4);f--;
			}
		  else
			{Nread(infhndl,(char*)R,R[0] & T4);
			 R[0] |= 0x40000000;f--;
			 Npointer(infhndl,g,0);
			 Nwrite(infhndl,(char*)R,4);
			 g = ((R[0] >> 16) & 0x00000FFF) + 4;
			 h = 6;
			 j = (unsigned char*)R;
			 while(h < g)
			  {i = tekstmetki(h,0);
				c = (UINT)j[h - 2] | ((UINT)j[h - 1] << 8);
            c += h;
				while(i < c)
				 {b = (UINT)j[i] | ((UINT)j[i+1] << 8) | ((UINT)j[i+2] << 16);
				  i += 3;
				  if(f < 19100){f++;d[f] = b;}
				 }
				h = c + 2;
			  }
			}
		 }
      st = a;
		break;
	  case 0x0020001C: // perestanovka
		b = adrcod(*(a+1));
		g = adrcod(*(a+4));
      if(b == 0 || g == 0)
       {tipprer = 7;st++;initprer(1);return;}
      c = b & 0x7FC00000;i = g & 0x7FC00000;
		if(c != 0 && i != 0 && c != i)
		 {tipprer = 7;st++;initprer(1);return;}
      if(i != 0)
       {tekfail(g);
        Npointer(infhndl,(g & 0x003FFFFF)-3,0);
        Nread(infhndl,(char*)R,7);
        if(R[0] & 0x00FFFFFF || R[1] & 0x00800000)
         {tipprer = 7;st++;initprer(1);return;}
       }
		if((b & 0x7FC00000) == 0 && nominf != 1 && nominf != 4)
		 {tekfail(0x80000000);i = *(a+2);
        if(!(i & 0x00200000))
         {tipprer = 7;st++;initprer(1);return;}
          c = (i & T4) * 4;
		  Npointer(infhndl,c - 4,0);
		  Nread(infhndl,(char*)R,4);
		  e = R[0];
		  Npointer(infhndl,c - 4,0);
		  Nwrite(infhndl,nuli,4);
		 }
		else
		 {tekfail(b);
        if(infhndl == 0)
         {tipprer = 7;st++;initprer(1);return;}
		  f = readinf(b);
		  if(f == 0 || R[0] & 0x80000000)
         {tipprer = 7;st++;initprer(1);return;}
        e = adrcod(*(a+3));i = *(a+2);
        if(e == 0 || (b ^ e) & 0xFFC00000 ||
           (!(i & T6) && !(Z[i+1] & T1)))
         {tipprer = 7;st++;initprer(1);return;}
		  c = iskluchssilki(*(a+2),e);
		  izmenenie(f,c);
        if(ind == 4)
        {tipprer = 7;st++;initprer(1);return;}
		 }
		registracia(g,*(a+5),e);st = a;
		break;
	  case 0x002002D1: // terminal
		b = adrcod(*(a+3));
      if(b == 0)
       {tipprer = 7;st++;initprer(1);return;}
		tekfail(b);
      if(infhndl == 0)
       {tipprer = 7;st++;initprer(1);return;}
		c = b & 0x003FFFFF;
      Npointer(infhndl,c-3,0);
      Nread(infhndl,(char*)R,7);
      if(R[0] & 0x00FFFFFF || !(R[1] & 0x00800000))
       {tipprer = 7;st++;initprer(1);return;}
 		do{Npointer(infhndl,c,0);
		   Nread(infhndl,(char*)R,7);h = 0;
			if(R[0] & 0x40000000)
         {c = R[1] & 0x00FFFFFF;
			 b = (b & 0xFFC00000) | c;h = 1;
			}
		  }
		while (h == 1);
      g = adrcod(*(a+1));
      if(g == 0)
       {tipprer = 7;st++;initprer(1);return;}
      i = g & 0x7FC00000;
		if(i != 0 || nominf == 1 || nominf == 4)
       {tekfail(g);
        Npointer(infhndl,(g & 0x003FFFFF)-3,0);
        Nread(infhndl,(char*)F,7);
        if(F[0] & 0x00FFFFFF || F[1] & 0x00800000)
         {tipprer = 7;st++;initprer(1);return;}
       }
      h = *(a+2);
      if((i == 0 && nominf != 1 && nominf != 4 &&
          !(h & 0x00200000)) ||
         (!(h & T6) && !(Z[h+1] & T1)))
       {tipprer = 7;st++;initprer(1);return;}
        R[0] += 0x00010000;
        Npointer(infhndl,c,0);
		Nwrite(infhndl,(char*)R,4);
		registracia(g,*(a+2),b);st = a;
		break;
	  case 0x002000C2: // tip
		b = adrcod(*(a+1));
      if(b == 0)
       {tipprer = 7;st++;initprer(1);return;}
		if((b & 0x7FC00000) == 0 && nominf != 1 &&
          nominf != 4)
			{opr(*(a+2),0x00200069);st = a;return;
			}
		tekfail(b);
      if(infhndl == 0)
      {tipprer = 7;st++;initprer(1);return;}
	   c = b & 0x003FFFFF;
       Npointer(infhndl,c-3,0);
       Nread(infhndl,(char*)R,3);
       if(R[0] & 0x00FFFFFF)
        {tipprer = 7;st++;initprer(1);return;}
		 do{Npointer(infhndl,c,0);
			Nread(infhndl,(char*)R,7);h = 0;
			if(R[0] & 0x40000000)
          {c = R[1] & 0x00FFFFFF;
			  b = (b & 0xFFC00000) | c;h = 1;
			 }
		  }
		while (h == 1);
		if(R[0] & T1)
		 {if(R[0] & 0x20000000)opr(*(a+2),0x0020023D);
		  else opr(*(a+2),0x002002D1);
		 }
		else opr(*(a+2),0x0020024B);
		st = a;
		break;
	  case 0x002000A0: // plussimv
		b = adrcod(*(a+1));
      if(b == 0 || !(*(a+2) & 0x00200000) ||
         !(*(a+3) & 0x00200000))
       {tipprer = 7;st++;initprer(1);return;}
		tekfail(b);
      if(infhndl == 0)
      {tipprer = 7;st++;initprer(1);return;}
		c = readinf(b);
      if(c == 0 || R[0] & 0x80000000)
       {tipprer = 7;st++;initprer(1);return;}
      e = (R[0] >> 16) & 0x00000FFF;
		f = 4;j = (unsigned char *)R;
		i = *(a+2) & 0x0007FFFF;h = *(a+3) - L0;
		do{g = ((UINT)j[f+2] | ((UINT)j[f+3] << 8)|((UINT)(j[f+4] & 7) << 16));
		   if(g >= i)
            {g += h;
			 j[f+2] = (unsigned char)g;
			 j[f+3] = (unsigned char)(g >> 8);
			 j[f+4] = (j[f+4] & 0xF8) | (unsigned char)(g >> 16);
			}
		   f = sledmetka(e,f);
		  }
		while(f != 0);
		izmenenie(c,R[0] & T4);
		st = a;
		break;
	 }
	}

	void F166()  // SLOVAR

	{UINT *a,b,d,e,f,h;
	 unsigned char *g,p;
	 char *c;
    st--;a = st - (*st - L0);
	 switch(*a)
	 {case 0x0020016d: // proverka
		b = poiskslova(0);
		if(b == 0)ist = 0;
		else opr(*(a+1),b);
		break;
	  case 0x00200071: // zapisb
		b = poiskslova(0);
		if(b != 0)ist = 0;
		else
		 {if(B3 > 524287)opr(*(a+1),0x00200104);
		  else
		   {for(d = 524288;d < 3670016;d += 6)
			 {e = 0;
			  for(f = 0;f < 6;f++)
				if(V[d+f] != 0)
				 {e = 1;break;}
			  if(e == 0)
			   {e = d * 4;h = 0;
                g = (unsigned char*)V;
                p = (unsigned char)B[0];
				while(h < 24 && p != 0 && p != 0x20 && p != 0x28
						&& p != 0x29)
                 {g[e + h] = p;
				  h++;
				  p = (unsigned char)B[h];
				 }
				d -= 524288;d /= 6;d++;
				for(f = 524287; B3 < f; f--)
				 {V[f] = V[f-1];}
				V[B3] = d;
				d |= 0x00200000;opr(*(a+1),d);
				break;
			  }
			 }
            slovout(pathvoc,V);
		   }
		 }
      break;
	  case 0x00200067: // iskluchenie
		b = iskluchslova(0);if(b == 0)ist = 0;
	  break;
      case 0x00200149: // leksuporjadochenie
       b = *(a+1); b &= 0x0007FFFF; b--;
       f = V[b];
       if(f == 0)
        {ist = 0;}
       else
        {f |= 0x00200000;
         opr(*(a+2),f);
        }
      break;
	  case 0x00200060: // izmenenie
		b = iskluchslova(0);
		if(b == 0)ist = 0;
		else
		 {d = B1 + 1;e = poiskslova(d);
		  if(e != 0)ist = 0;
		  else
			{b &= 0x0007FFFF; e = (b-1)*24;e += 2097152;
			 h = 0;
             g = (unsigned char*)V;
             p = (unsigned char)B[d];
			 while(h < 24 && p != 0 && p != 0x20 &&
                p != 0x28 && p != 0x29)
			   {g[e + h] = p;h++;d++;p = (unsigned char)B[d];}
			 for(f = 524287; B3 < f; f--)
			  {V[f] = V[f-1];}
             V[B3] = b;
             slovout(pathvoc,V);
		    }
		 }
		break;
	  case 0x00200190: // znachenie
		b = *(a+1);b &= 0x0007FFFF;b--;
		e = *(a+2) - L0;
		g = (unsigned char*)V;
        d = b * 24;d += 2097152;
		for(h = 0;h < 24;h++,e++)
		B[e] = (0x00001F00 | (UINT)g[d + h]);
		B[e] = 0;
      	break;
	  case 0x00200069: // logsimvol
        b = *(a+1) - L0;
		d = poiskslova(b);
		if(d == 0)ist = 0;
		else
		 {opr(*(a+2),d);
		 }
        break;
	  case 0x00200009: // alternativa
        b = *(a+1); b &= 0x0007FFFF; b--;
        c = (char*)R;
		slvhndl = Nopen(pathaltvoc);
        Npointer(slvhndl,0,0);
	    Nread(slvhndl,c,4);
		d = (R[0] << 2);
		d += (b * 24);
		Npointer(slvhndl,d,0);
		Nread(slvhndl,c,24);
		Nclose(slvhndl);
        e = *(a+2) - L0;
        for(h = 0;h < 24;h++,e++)
		B[e] = (0x00001F00 | (UINT)c[h]);
		B[e] = 0;
      	break;
	 }
	 st = a;
	}

	void F167()  // TRASSIROVKA

	{UINT *a,b,c,*d,e,*f,g,h,i,p;
	 UINT64 j,q1,q2;
     HANDLE hndl;
  	 char w;
	 st--;a = st - (*st - L0);
	 switch(*a)
	 {case 0x0020040D: // prerivanie
	  b = lcadr;
	  while(0 < b && S[b + 3] < 0xFFFFFFFD)b = S[b+1];
	  if(b == 0){ist = 0;st = a;return;}
	  opr(*(a+1),0x00200000 | b);
	  break;
	  case 0x002001D2: // vneshznak
	  b = *(a+1) & 0x0000FFFF;
	  if(b == 0){ist = 0;st = a;return;}
	  c = S[b+1];opr(*(a+2),0x00200000 | c);
	  opr(*(a+3),0x00200104 + S[c+2]);
	  break;
     case 0x00200016: // obrashenie
     b = *(a+1) & 0x0000FFFF;
     if(b == 0){ist = 0;st = a;return;}
     c = S[b+3];
     if(c >= 0xFFFFFFFD)c = S[b+1];
     opr(*(a+2),0x00200000 | c);
     opr(*(a+3),0x00200104 + S[c+2]);
     break;
     case 0x002003C1: // kontekst
      b = *(a+1) & 0x0000FFFF;
	  d = st;c = S[b+2];
	  *st = 0x00200104 + c;st++;
	  if(c == 1)  // kadr zadachi
	  {*st = (b == 0 ? 0x0020040C : 0x00200000 | S[b+3]);
      st++;e = S[b+6];
      *st = (e == 0 ? 0x0020040C : e);st++;
		*st = (0x00200000 | (S[b+7] & 0x0000FFFF));st++;
		*st = 0x00200000 | (S[b+4] >> 16);st++;
		*st = 0x00200000 | (S[b+4] & 0x0000FFFF);st++;
		*st = 0x00200000 | ((S[b+5] & 0x0000FFFF) - (S[b+4] >> 16));
      st++;
		*st = 0x00200000 | (S[b+5] >> 16);st++;
	  }
	  else
	  {*st = (S[b+3] >= 0xFFFFFFFD ? 0x00400001 :
         0x00200000 | S[b+3]);st++;
		*st = 0x00200000 | (S[b+4] >> 16);st++;
		*st = 0x00200000 | (S[b+4] & 0x0000FFFF);st++;
		*st = 0x00200000 | ((S[b+5] & 0x0000FFFF) - (S[b+4] >> 16));
      st++;
		*st = 0x00200000 | (S[b+5] >> 16);st++;
		if(c == 2 || c == 3)
		{if(b == cadr)
        {f = A; e = fragm;}
       else
        {g = S[b];
         while(g < lcadr && S[g+3] != b &&
          S[g+3] < 0xFFFFFFFD)
         g = S[g];
         f = P[S[g+4] & 0x0000FFFF];e = S[g+4] >> 16;
        }
		 while(g = f[e+3],g & 0xFFF80000)
		 {e = g & T11;f = P[(g >> 19) - 1];
		 }
		 *st = 0x00200000 | g;st++;
		 if(c == 3)
		 {*st = S[b+6];st++;}
		}
		else
		{*st = 0x00200000 | S[b+7];st++;}
	  }
	  f = st;e = S[b];b += 9;
	  while(b < e)
	  {g = S[b];
		if(g == 0 || g & 0x80000000)g = 0x0020040C;
		*st = g;st++;b++;
	  }
	  e = text1(f);
	  if(ind == 4){ist = 0;st = a;return;}
	  *st = e;st++;
	  e = text1(d);
	  opr(*(a+2),e);
	  break;
	  case 0x0020012E: // spusk
      if(PR[prer] == 17 && PR[prer+1] == S[cadr+3])
	   {PR[prer+2] = cadr;
	   }
      break;
	  case 0x002000D6: // test
      pathtest[2] = (*(a+1) == L0 ? 'L' : 'M');
	  e = NGetFileAttributesA(pathtest);
	  if(e == 0xFFFFFFFF)ist = 0;
	  else ist = 1;
	  break;
	  case 0x0020092B: // zavershzadachi
      hndl = Ncreat(pathfin);
	  Nclose(hndl);
      break;
	  case 0x002000AA: // vremja
      e = *(a+1);
	  e = convchisl(e);
      Sleep(e);
	  break;
	  case 0x00200161:// imja
      GetComputerName(imjakomp,&bufimja);
	  if(imjakomp[0] == 'R')
	   {opr(*(a+1), 0x00200104);}
	  else
	   {if(imjakomp[0] == 'L')
	     {opr(*(a+1), 0x00200105);}
	    else
		 {if(imjakomp[0] == 'M')
	       {opr(*(a+1), 0x00200106);}
		  else
		   {opr(*(a+1), 0x00200107);}
	     }
	   }
      break;
	  case 0x00200020: // programma
	  d = P[*(a+2) & 0x0007FFFF];
	  d += (*(a+1) & 0x0007FFFF);
	  if(FR1 != d)
       {FR2 = dekonvert(d);
      if(ind == 4)
       {ist = 0;st = a;return;}
		FR1 = d;
	  }
	 e = mem(Z[FR2]);
	 if(ind == 4)
      {ist = 0;st = a;return;}
     if(FR2 == 0)
      {FR2 = dekonvert(d);
       if(ind == 4)
        {ist = 0;st = a;return;}
       FR1 = d;
      }
     for(g = 2;g < Z[e]-2;g++)
      Z[e + g] = Z[FR2 + g];
	  opr(*(a+4),e);
	  b = *d;
	  c = *(a+3) & 0x0007FFFF;
	  while(c < b)
	  {if(FR[c] != 0)
		{opr(*(a+6),FR[c]);
		 h = FR[c];
		 while(!(Z[h+1] & 0x80000000))h -= 2;
		 g = e + 2;
		 while(Z[g] != h)g += 2;
		 opr(*(a+5),g);st = a;return;
		}
		c++;
	  }
	  opr(*(a+5),0x00200104);
	  opr(*(a+6),0x00200104);
	  break;
     case 0x00200413: // priemi
     if(*(a+1) == 0x00200105)
      kontrpr = 1;
     else kontrpr = 0;
     break;
	  case 0x00200188: // vneshnijelement
	  d = P[*(a+2) & 0x0000FFFF] + (*(a+1) & 0x0007FFFF);
	  b = d[3];
	  if(b & 0xFFF80000)
	  {c = (b >>19) - 1;
		d = P[c] + (b & T11);
		opr(*(a+3),(0x00200000|(b & 0x0007FFFF)));
		opr(*(a+4),(0x00200000|c));
		c = *d;g = ((*(a+2)+1) << 19) | (*(a+1) & T11);
		e = 1;
		while(d[c] != g){c++;e++;}
		c = 4;g = 0;
		while(g == 0)
		{if(d[c] == 0x00100122 || d[c] == 0x00100129)e--;
		 if(e == 0)
		 {opr(*(a+5),0x00200000|c);
		  g = 1;
		 }
		 c++;
		}
	  }
	  else
	  {opr(*(a+3),0x00200104);
		opr(*(a+4),0x0020040C);
		opr(*(a+5),0x00200000 | b);
	  }
	  break;
	  case 0x00200225: // zadacha
	  b = *(a+1);c = (*(a+2) == 0x00200104 ? prer : prer - 7);
      PR[c] = 1; PR[c+1] = b & 0x0000FFFF;
	  PR[c+2] = 0; PR[c+3] = 0; PR[c+4] = 0;
	  PR[c+5] = 0;
	  break;
	  case 0x002015D0: // adrkadr
      b = *(a+1);
      c = ZP[0];
	  ZP[c + 1] = b;
	  ZP[0] = c + 1;
	  break;
	  case 0x0020000B: // reshitb
	  b = *(a+1);c = (*(a+2) == 0x00200104 ? prer : prer - 7);
     PR[c] = 2;PR[c+1] = b & 0x0000FFFF;
	  PR[c+2] = 0;PR[c+3] = 0;PR[c+4] = 0;
	  PR[c+5] = 0;
	  break;
	  case 0x00200069: // logsimvol
     c = (*(a+2) == 0x00200104 ? prer : prer - 7);
	  PR[c] = 3;PR[c+2] = *(a+1);
	  PR[c+1] = 0;PR[c+3] = 0;PR[c+4] = 0;
	  PR[c+5] = 0;
	  break;
	  case 0x002000F1: // vetvb
     c = (*(a+3) == 0x00200104 ? prer : prer - 7);
	  PR[c] = 4;b = *(a+1) & 0x0000FFFF;
	  e = ((*(a+2) - 1) & 0x00007FFF) |
          ((b - 1) << 15) | 0x80000000;
	  PR[c+3] = e;PR[c+1] = 0;PR[c+2] = 0;
	  PR[c+4] = 0;PR[c+5] = 0;
	  break;
	 case 0x00201522: // vosst
      peresm = 0;
     break;
	 case 0x00200002: // ne
     c = R[0xFFFF0000];
	 R[0xFF000000] = c;
	 break;
	 case 0x00200230: // viragenija
     b = st - T;
	 b >>= 2;
     c = loschisl(b);
	 opr(*(a+1),c);
	 break;
     case 0x0020023F: // slovo
     c = (*(a+4) == 0x00200104 ? prer : prer - 7);
	  PR[c] = 13;b = *(a+2) & 0x0000FFFF;
	  e = ((*(a+3) - 1) & 0x00007FFF) |
          ((b - 1) << 15) | 0x80000000;
	  PR[c+3] = e;PR[c+1] = *(a+1) & 0x0000FFFF;
     PR[c+2] = 0;
	  PR[c+4] = 0;PR[c+5] = 0;
	  break;
     case 0x00200037: // pozicia
     c = (*(a+3) == 0x00200104 ? prer : prer - 7);
	  PR[c] = 5;
     PR[c+4] = (*(a+2) << 16) | (*(a+1) & 0x0000FFFF);
	  PR[c+2] = 0;PR[c+3] = 0;PR[c+1] = 0;
	  PR[c+5] = 0;
	  break;
     case 0x00200034: // tekushajazadacha
     if(*(a+2) == 0x00200104)
      {tekzad = 0; peresm=0; cadrzad = 0;}
     else
      {tekzad = *(a+1);}
     break;
	 case 0x00200B15: // pusk
     b = *(a+1) - L0;
	 w = '0';
	 if(b < 10)
	   {w += (char)b;}
	 else
	   {w = 'a';
	    c = b - 10;
		w += (char)c;
	   }
	 i = dlinpath+3;
	 pathex1[i] = w;
	 pathex2[i] = w;
	 i = dlinpath+11;
	 pathex1[i] = w;
     switch(b)
	 {case 1:
       SecureZeroMemory(&cif1,sizeof(cif1));
	   cif1.cb = sizeof(cif1);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif1,&pi1);
	  break;
	  case 2:
	   SecureZeroMemory(&cif2,sizeof(cif2));
	   cif2.cb = sizeof(cif2);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif2,&pi2);
      break;
      case 3:
	   SecureZeroMemory(&cif3,sizeof(cif3));
	   cif3.cb = sizeof(cif3);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif3,&pi3);
      break;
      case 4:
       SecureZeroMemory(&cif4,sizeof(cif4));
	   cif4.cb = sizeof(cif4);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif4,&pi4);
      break;
      case 5:
       SecureZeroMemory(&cif5,sizeof(cif5));
	   cif5.cb = sizeof(cif5);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif5,&pi5);
       break;
      case 6:
       SecureZeroMemory(&cif6,sizeof(cif6));
	   cif6.cb = sizeof(cif6);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif6,&pi6);
      break;
      case 7:
       SecureZeroMemory(&cif7,sizeof(cif7));
	   cif7.cb = sizeof(cif7);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif7,&pi7);
       break;
	  case 8:
       SecureZeroMemory(&cif8,sizeof(cif8));
	   cif8.cb = sizeof(cif8);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif8,&pi8);
       break;
	 case 9:
       SecureZeroMemory(&cif9,sizeof(cif9));
	   cif9.cb = sizeof(cif9);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif9,&pi9);
       break;
	 case 10:
       SecureZeroMemory(&cif10,sizeof(cif10));
	   cif10.cb = sizeof(cif10);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif10,&pi10);
       break;
	 case 11:
       SecureZeroMemory(&cif11,sizeof(cif11));
	   cif11.cb = sizeof(cif11);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif11,&pi11);
       break;
	 case 12:
       SecureZeroMemory(&cif12,sizeof(cif12));
	   cif12.cb = sizeof(cif12);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif12,&pi12);
       break;
	 case 13:
       SecureZeroMemory(&cif13,sizeof(cif13));
	   cif13.cb = sizeof(cif13);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif13,&pi13);
       break;
	 case 14:
       SecureZeroMemory(&cif14,sizeof(cif14));
	   cif14.cb = sizeof(cif14);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif14,&pi14);
       break;
	 case 15:
       SecureZeroMemory(&cif15,sizeof(cif15));
	   cif15.cb = sizeof(cif15);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif15,&pi15);
       break;
     case 16:
       SecureZeroMemory(&cif16,sizeof(cif16));
	   cif16.cb = sizeof(cif16);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif16,&pi16);
       break;
     case 17:
       SecureZeroMemory(&cif17,sizeof(cif17));
	   cif17.cb = sizeof(cif17);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif17,&pi17);
       break;
     case 18:
       SecureZeroMemory(&cif18,sizeof(cif18));
	   cif18.cb = sizeof(cif18);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif18,&pi18);
       break;
     case 19:
       SecureZeroMemory(&cif19,sizeof(cif19));
	   cif19.cb = sizeof(cif19);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif19,&pi19);
       break;
     case 20:
       SecureZeroMemory(&cif20,sizeof(cif20));
	   cif20.cb = sizeof(cif20);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif20,&pi20);
       break;
     case 21:
       SecureZeroMemory(&cif21,sizeof(cif21));
	   cif21.cb = sizeof(cif21);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif21,&pi21);
       break;
     case 22:
       SecureZeroMemory(&cif22,sizeof(cif22));
	   cif22.cb = sizeof(cif22);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif22,&pi22);
       break;
     case 23:
       SecureZeroMemory(&cif23,sizeof(cif23));
	   cif23.cb = sizeof(cif23);
	   CreateProcessA(pathex1,NULL,NULL,NULL,FALSE,NULL,NULL,pathex2,&cif23,&pi23);
       break;
     }
     break;
	 case 0x00200403: // eksp
     if(pathprog[dlinpath-3] != 'E')
     ist = 0;
     break;
     case 0x00200489: // otkat
     cadrzad = *(a+1)& 0x0000FFFF;
	 break;
	 case 0x002004F0: // raschistka
     w = '1';
     for(i = 1; i <= 23; i++, w = (i < 10 ? '0' + (char)i:
       'a' + (char)(i-10)))
      {p = dlinpath+3;
       pathfinex[p] = w;
       DeleteFileA(pathfinex);
	  }
     break;
	 case 0x00200747: // period
     b = *(a+1);
     b -= 0x00200104;
	 for(i = 1; i <= 23; i++)
     R[i] = 0;
     while(1)
	 {w = '1';
	  for(i = 1; i <= b; i++, w = (i < 10 ? '0' + (char)i:
       'a' + (char)(i-10)))
      {p = dlinpath+3;
       pathfinex[p] = w;
       R[i] = NGetFileAttributesA(pathfinex);
	   }
	   Sleep(1000);
	  if(R[1] != 0xFFFFFFFF && R[2] != 0xFFFFFFFF &&
         R[3] != 0xFFFFFFFF && R[4] != 0xFFFFFFFF &&
		 R[5] != 0xFFFFFFFF && R[6] != 0xFFFFFFFF &&
		 R[7] != 0xFFFFFFFF && R[7] != 0xFFFFFFFF &&
		 R[8] != 0xFFFFFFFF && R[9] != 0xFFFFFFFF &&
		 R[10]!= 0xFFFFFFFF && R[11] != 0xFFFFFFFF &&
		 R[12]!= 0xFFFFFFFF && R[13] != 0xFFFFFFFF &&
		 R[14]!= 0xFFFFFFFF && R[15] != 0xFFFFFFFF &&
		 R[16] != 0xFFFFFFFF && R[17] != 0xFFFFFFFF &&
		 R[18]!= 0xFFFFFFFF && R[19] != 0xFFFFFFFF &&
		 R[20]!= 0xFFFFFFFF && R[21] != 0xFFFFFFFF &&
		 R[22]!= 0xFFFFFFFF && R[23] != 0xFFFFFFFF)

	   {Sleep(1500);return;}
	  else
	   {g = NPeekMessage();
        if(g != 0)
         {DefWindowProc(hhwnd,kmsg.message, kmsg.wParam, kmsg.lParam);
	     }
		Sleep(1000);
	   }
      }
	 break;
	 case 0x0020080B: // Period
     w = (*(a+1) == 0x00200105 ? 'L' : 'M');
	 pathsign[2] = w;
     while(1)
	 {b = NGetFileAttributesA(pathsign);
	  if(b != 0xFFFFFFFF)
	    {Sleep(1000);
	     DeleteFileA(pathsign);
		 Sleep(1500);
	     return;
	    }
	  else
	   {Sleep(2000);}
	 }
	 break;
	 case 0x00200114: // shestnadcat
     b = *(a+1);
	 b = convchisl(b);
	 f = st;
	 for(i=1; i <9; i++)
	  {p = b & 0x0000000F;
	   p += L0;
	   *st = p;
	   st++;
	   b >>= 4;
	  }
     b = text2(f);
     opr(*(a+2),b);
     break;
     case 0x00200191: // kontrolpriema
     b = (*(a+1) & 0x00400000 ?
           0xFFFFFFFF: *(a+1) & 0x0000FFFF);
     c = (*(a+5) == 0x00200104 ? prer : prer - 7);
	  PR[c] = 16;
     PR[c+1] = b;
     PR[c+2] = *(a+2);
     PR[c+3] = *(a+3);
     PR[c+4] = 0;
	  PR[c+5] = *(a+4);
     break;
     case 0x00200003: // priem
     c = (*(a+3) == 0x00200104 ? prer : prer - 7);
     PR[c] = 18;
     PR[c+1] = 0xFFFFFFFF;
     PR[c+2] = *(a+1);
     PR[c+3] = *(a+2);
     PR[c+4] = 0;
     PR[c+5] = 0;
     break;
     case 0x002002A4: // tochka
     c = (*(a+4) == 0x00200104 ? prer : prer - 7);
     PR[c] = 12;PR[c+1] = *(a+1) & 0x0000FFFF;
     PR[c+4] = (*(a+3) << 16) | (*(a+2) & 0x0000FFFF);
	  PR[c+2] = 0;PR[c+3] = 0;
	  PR[c+5] = 0;
	  break;
	  case 0x002006B7: // fraza
      PR[prer] = 23; PR[prer+1] = 0;
	  PR[prer+2] = 0; PR[prer+3] = 0;
	  PR[prer+4] = 0; PR[prer+5] = 0;
      break;
	  case 0x00200062: // konec
      c = (*(a+1) == 0x00200104 ? prer : prer - 7);
	  PR[c] = 0;PR[c+2] = 0;
	  PR[c+1] = 0;PR[c+3] = 0;PR[c+4] = 0;
	  PR[c+5] = 0;
	  break;
	  case 0x00200012: // stop
      c = (*(a+1) == 0x00200104 ? prer : prer - 7);
	  PR[c] = 6;PR[c+2] = 0;
	  PR[c+1] = 0;PR[c+3] = 0;PR[c+4] = 0;
	  PR[c+5] = 0;
	  break;
	  case 0x00201E10: // prokrutka
      if(prokrutka == 1)
	   {ist = 1; prokrutka = 0;}
	  else
	   {ist = 0;}
      break;
      case 0x00200D4F: // protokol
      c = (*(a+1) == 0x00200104 ? prer : prer - 7);
	  PR[c] = 19;PR[c+2] = 0;
	  PR[c+1] = 0;PR[c+3] = 0;PR[c+4] = 0;
	  PR[c+5] = 0;
	  break;
      case 0x00200004: // sbros
	  b = *(a+1);c = (*(a+2) == 0x00200104 ? prer : prer - 7);
      PR[c] = 7;PR[c+1] = b & 0x0000FFFF;
	  PR[c+2] = 0;PR[c+3] = 0;PR[c+4] = 0;
	  PR[c+5] = 0;
	  break;
	  case 0x00200889: // indikator
      b = *(a+1)-0x00200104;
      w = (char)b + '0';
	  nazvanie[24] = w;
	  nazvanie[25] = 0;
	  SetWindowTextA(hhwnd, nazvanie);
      break;
	  case 0x00200013: // obriv
	  b = *(a+1);c = (*(a+2) == 0x00200104 ? prer : prer - 7);
      PR[c] = 8;PR[c+1] = b & 0x0000FFFF;
	  PR[c+2]
      = 0;PR[c+3] = 0;PR[c+4] = 0;
	  PR[c+5] = 0;
	  break;
	  case 0x00200011: // vihod
	  b = *(a+1);c = (*(a+2) == 0x00200104 ? prer : prer - 7);
      PR[c] = 9;PR[c+1] = b & 0x0000FFFF;
	  PR[c+2] = 0;PR[c+3] = 0;PR[c+4] = 0;
	  PR[c+5] = 0;
	  break;
	  case 0x002000BE: // otvet
      c = (*(a+1) == 0x00200104 ? prer : prer - 7);
	  PR[c] = 10;PR[c+2] = 0;
	  PR[c+1] = 0;PR[c+3] = 0;PR[c+4] = 0;
	  PR[c+5] = 0;
	  break;
	  case 0x00200182: // Kontrolzameni
      c = (*(a+1) == 0x00200104 ? prer : prer - 7);
	  PR[c] = 22;PR[c+2] = 0;
	  PR[c+1] = 0;PR[c+3] = 0;PR[c+4] = 0;
	  PR[c+5] = 0;
	  break;
	 case 0x00200196: // chislo
     c = (*(a+2) == 0x00200104 ? prer : prer - 7);
	  b = *(a+1);
	  if(b & 0x00200000)
	  j = b - 0x00200104;
	  else
	  {b += 2;j = 0;
		while(!(Z[b] & 0x80000000))
		{j *= 10;j += (Z[b] - 0x00200104);b += 2;}
	  }
     if(j > step)
      {PR[c] = 11;
	    PR[c+1] = 0;PR[c+2] = 0;PR[c+3] = 0;
	    PR[c+4] = 0;*((UINT64*)(PR+c+5)) = j;
      }
	  break;
	  case 0x002001A2: // velichina
	  j = step;d = st;
	  if(j == 0)c = L0;
	  else
	  {while(j != 0)
		{*st = (j % 10) + L0;j /= 10;st++;}
		if(st == d+1)
		 {st = d;c = *st;}
		else c = text2(d);
	  }
	  if (ind == 4){ist = 0;st = a;return;}
	  opr(*(a+1),c);
	  break;
     case 0x00200071: // zapisb
     b = *(a+1);
     step = convchisl(b);
     break;
	  case 0x002000B2: // fail
	  d = P[*(a+1) & 0x0000FFFF];
     b = d[(*(a+2) & 0x0000FFFF) + 2];
	  opr(*(a+3),((b >> 15) & 0x0000FFFF) + 0x00200001);
	  opr(*(a+4),(b & 0x00007FFF) + 0x00200001);
	  break;
	  case 0x00200144: // zona
	  d = P[*(a+1) & 0x0000FFFF] + (*(a+2) & 0x0000FFFF);
	  if(FR1 != d)dekonvert(d);
     if(ind == 4){st++;return;}
	  b = *(a+5);
	  if(FR2 != *(a+3))
	  {c = FR2 + (*(a+4)-*(a+3));
		e = *(a+5) - Z[*(a+4)];
		b = Z[c] + e;
	  }
	  c = *d;
	  for(e = 4;e < c;e++)
	  {if(FR[e] == b)
		{opr(*(a+6),(0x00200000 | (*(a+2) & 0x0000FFFF) + e));st = a;return;
		}
	  }
	  ist = 0;
	  break;
	  case 0x00200104: // nolb
      if(proghndl != 0)Nclose(proghndl);
      if(infhndl != 0)Nclose(infhndl);
      nachl = 1;
	  initsolv();
	  a = T;
	  break;
	  case 0x00200105: // odin
      if(proghndl != 0)Nclose(proghndl);
      if(infhndl != 0)Nclose(infhndl);
      nachl = 1;
	  reprogram();
	  initsolv();
	  a = T;
	  break;
	  case 0x002000C2: // tip
	  opr(*(a+1),0x00200104 + tipprer);
	  break;
	  case 0x00200273: // tekzadacha
	  b = lcadr;
	  while(S[b+2] != 1)b = S[b+1];
	  opr(*(a+1),0x00200000 | b);
	  break;
	  case 0x002000A8: // ichodnajazadacha
     c = prer - 7;
	  if(PR[c] == 2)opr(*(a+1),0x00200000 + PR[c+1]);
	  else ist = 0;
     break;
     case 0x00200038: // spravka
     c= prer - 7;
     opr(*(a+1),0x00200104 + PR[c]);
     opr(*(a+2),0x00200000 + PR[c+1]);
     b = 0x00400001;
	 if(PR[c] == 17 && !(PR[c+2] == 0))
	 {b = 0x00200000 + PR[c+2];}
	 opr(*(a+3),b);
	 break;
     case 0x00200314: // Sm
     opr(*(a+1),0x00200104 + PR[prer]);
     opr(*(a+2),0x00200000 + PR[prer+1]);
     break;
     case 0x002000BF: // rezultat
	  if(otvet != 0)opr(*(a+1),otvet);
	  else ist = 0;
     break;
	  case 0x002002C3: // passiv
	  ndelta++; delta = 0;
	  break;
	  case 0x002002BE: // aktiv
	  if(ndelta != 0)
      {ndelta--;}
     if(ndelta == 0)delta = 1;
	  break;
	  case 0x0020009E: // klaviatura
	  if(NGetInputState() != 0)ist = 0;
     break;
     case 0x002000BA: // nabor
     b = SP[stp-9];d = st;
     c = (b == 0 ? 0x0020040C : b);*st = c;st++;
     *st = SP[stp-8];st++;*st = SP[stp-5];st++;
     *st = SP[stp-3] | 0x00200000;st++;
     *st = SP[stp-2] | 0x00200000;st++;
     *st = SP[stp-6] + 0x00200104;st++;
     c = SP[stp-1];
     *st = (c == 0 ? 0x0020040C : (c & 0x0000FFFF) | 0x00200000);st++;
     b = text1(d);opr(*(a+1),b);
     break;
     case 0x00200190: // znachenie
     b = *(a+1) & 0x0000FFFF;
     c = T[b];
     if(c == 0)c = 0x0020040C;
     opr(*(a+2),c);
     break;
     case 0x0020005A: // kljuch
     b = PR[prer - 7];
     c = (b == 0 ? 0x0020040C : 0x00200104 + b);
     opr(*(a+1),c);
     break;
     case 0x00200059: // zamena
     c = (*(a+3) == 0x00200104 ? prer : prer - 7);
     PR[c] = 14;PR[c+1] = *(a+1) & 0x0000FFFF;
     PR[c+4] = 0;
     PR[c+2] = *(a+2) & 0x0000FFFF;
     PR[c+3] = 0;
     PR[c+5] = 0;
     PR[c+6] = 0;
     break;
	 case 0x002018C8: // Kadr
     b = *(a+1) - T3;
	 b <<= 2;
	 q1 = (UINT64)b;
	 q1 += reinterpret_cast<UINT64>(S);
	 c = loschisl(q1);
	 opr(*(a+2),c);
     break;
	 case 0x002003C2: // znach
     b = convchisl(*(a+1));
     f = (UINT*)b;
	 b = *f;
	 c = loschisl(b);
	 opr(*(a+2),c);
     break;
	 case 0x00200EB1: // Znachenija
	 q1 = reinterpret_cast<UINT64>(T);
	 q2 = reinterpret_cast<UINT64>(st);
	 b = los64(q1);
	 c = los64(q2);
     q1 = reinterpret_cast<UINT64>(S);
     g = los64(q1);
     i = S[lcadr];
	 i--;
	 i <<= 2;
	 q1 = reinterpret_cast<UINT64>(S);
	 q1 += i;
	 h = los64(q1);
	 opr(*(a+1),b);
	 opr(*(a+2),c);
	 opr(*(a+3),g);
	 opr(*(a+4),h);
     break;
	 case 0x002012EC: // nachotrezok
	 q1 = reinterpret_cast<UINT64>(Z);
	 b = loschisl(q1);
	 opr(*(a+1),b);
     break;
     case 0x00200024: // procedura
     c = (*(a+2) == 0x00200104 ? prer : prer - 7);
     PR[c] = 17;PR[c+1] = *(a+1) & 0x0000FFFF;
     PR[c+2] = 0;
     PR[c+3] = 0;
     PR[c+4] = 0;
     PR[c+5] = 0;
	 PR[c+6] = 0;
     break;
     case 0x00200060: // izmenenie
     c = (*(a+2) == 0x00200104 ? prer : prer - 7);
     PR[c] = 15;PR[c+1] = 0;
     PR[c+4] = 0;
     PR[c+2] = *(a+1);
     PR[c+3] = 0;
	  PR[c+5] = 0;
	  break;
     case 0x0020001A: // kontrol
     if(*(a+1) == 0x00200105)kontrhol = 1;
	 else
	  {if(*(a+1) == 0x00200106)kontrhol = 2;
       else kontrhol = 0;
	  }
     break;
	 case 0x0020089B: // parallel
     c= *(a+1) - 0x00200104;
	 switch(c)
	  {case 0:
	   indparal = 0;
	   break;
	   case 1:
       if(indparal == 0)
	    {indparal = 1;
	     ist = 1;
	    }
	   else
		{ist = 0;}
	   break;
	   case 2:
       indparal = 1;
	   break;
	   case 3:
	   if(indparal == 0)
	    {ist = 0;}
	   else
	    {ist = 1;}
	   break;
	  }
	 break;
     case 0x002002B4: // filtr
     switch(*(a+1))
     {case 0x00200104: // sbros bufera
      if(filtrblok == 0)
	   {FBUF[0] = 0;}
      break;
      case 0x00200105: // vkluchenie regima filtracii
      filtpr = 1;
      break;
      case 0x00200106: // vikljuchenie regima filtracii
      if(filtrblok == 0)
	   {filtpr = 0;}
      break;
      case 0x00200107: // proverka regima filtracii
      if(filtpr == 0)ist = 0;
      break;
      case 0x00200108:  // registracija novoj ssilki na
                        // uzel teoremi priema.
      if(filtrblok == 0)
	   {b = *(a+2) << 16;
        c = convchisl(*(a+3));
        b |= c;
        e = 1; g = FBUF[0]; // e,g - granici promegutka
	    while (e <= g)
	     {h = (e + g)/2;
		  p = FBUF[h];
          if(p < b)e = h+1;
          else
           {if(b < p)g = h-1;
            else
			 {st=a;
		      return;
		     }
           }
         }
		i = FBUF[0];
        while(e <= i)
         {FBUF[i+1]=FBUF[i];
          i--;
         }
        FBUF[e] = b;
        FBUF[0] += 1;
        if(FBUF[0] == 2490)
         {tipprer = 7;st++;initprer(1);return;}
	   }
	  break;
	  case 0x00200109: // vkljuchenie blokirovki
      filtrblok = 1;
	  break;
	  case 0x0020010A: // vikljuchenie blokirovki
      filtrblok = 0;
	  break;
	  case 0x0020010B: // razblokirovka teoremi priema
      b = *(a+2) << 16;
      c = convchisl(*(a+3));
      b |= c;
      g = FBUF[0];
	  for(e = 1; e <= g; e++)
	   {if(FBUF[e] == b)
	     {while(e < g)
	       {FBUF[e] = FBUF[e+1];
	        e++;
	       }
	      g--;
          FBUF[0] = g;
		 }
	   }
	  st = a; return;
	  break;
	 }
     break;
	 case 0x00200087: // okonchanie
     ind = 3;
	 break;
     case 0x00200027: // vneshkadr
     b = *(a+1) - 0x00200104;
     c = cadr;
     while(b != 0)
      {b--;
       c = S[c+3];
      }
     opr(*(a+2), 0x00200000 | c);
     break;
     case 0x0020000F: // summavseh
     if(*(a+1) != 0x00200104)
      {g = dlinazoni(*(a+1),1);
       g = loschisl(g);
       opr(*(a+2),g);
       dlinazoni(*(a+1),0);
      }
     else
      {g = 0;
       for(e = 0;e <= lcadr;e = S[e])
		  {h = S[e];
         if(S[e+2] != 4 || S[e+8] != 1)
          {for(c = e + 9;c < h;c++)
		      {b = S[c] & 0xBFFFFFFF;
		       if(b != 0 && !(b & T6))
              {i = dlinazoni(b,1);g += i;}
		      }
          }
		  }
       for(e = 0;e <= lcadr;e = S[e])
		  {h = S[e];
         for(c = e + 9;c < h;c++)
		   {b = S[c] & 0xBFFFFFFF;
		    if(b != 0 && !(b & T6))
          dlinazoni(b,0);
		   }
		  }
       g = loschisl(g);
       opr(*(a+2), g);
      }
     break;
     case 0x00200068:
     if(nachl == 1)ist=0;
     break;
     case 0x0020002D: // smistochnik
     b = *(a+1);
     if(b & 0x00400000)
      BT[0] = 1;
     else
      {c = BT[0];
       BT[c] = b;
       BT[c+1] = convchisl(*(a+2));
       BT[0] += 2;
      }
     break;
     case 0x0020001B: // povtorenie
     b = lcadr;
     c = *(a+1);
     c -= 0x00200000;
     while(b > c)
      {if((S[b+2] == 3) && S[b+3] > 0x5FFFFFFF)
        {stp -= 10; prer -= 7; b = S[b+1];}
       else b = S[b+3];
      }
     for(b = 0;b < 7;b++)PR[prer+b]=0;
     for(b = c+9; b < S[c];b++)S[b]=0;
     S[c+8]=9;
     e = SP[stp-2];
     st = T + e;
     lcadr = c;
     cadr = lcadr;
     tec = 0; symbol = 0x0020040D;
     ind = 1;otvet = 0;peresm = 0;
     level = 0;ist = 1;uroven = 0; return;
     case 0x0020002B: // smotvet
     opr(*(a+1),0x00200000 | smotvet);
     break;
     case 0x002000E1: // ktp
     opr(*(a+1), istprer + L0);
     break;
     case 0x002000E2: // perem
     d = st;
     for(b = 0; b < lbufper; b++,st++)
      *st = bufperem[b];
     c = text1(d);
     opr(*(a+1),c);
     break;
     case 0x00201073: // reshenie
     b = *(a+1) & 0x0000FFFF;
     if(*(a+2) == L0)
      {c = SD[b+2];
       if(c == 0)
        {ist = 0;st = a; return;}
       opr(*(a+3),c);
      }
     else
      {c = *(a+3);
       SD[b+2] = c;
      }
     break;
     case 0x002009B7: // smpriem
     b = *(a+1) & 0x0000FFFF;
     c = SD[b];
     g = losint(c);
     opr(*(a+3),g);
     c = SD[b+1];
     if(c == 0)
      {opr(*(a+2),L0);}
     else
      {g = SD[b+3];
       g |= 0x00200000;
       c |= 0x00200000;
       f = st;
       *st = c; st++;
       *st = g; st++;
       c = text1(f);
       opr(*(a+2),c);
      }
     break;
    }
	 st = a;
	}

	void F168()  //  ISHODNAJAZADACHA

	{opr(*(st-1),S[9]);st--;}

	void F169()  // PROGFAIL

	{UINT *a,b,c,d,*e,f,g,h,i,j,k,p,q,r,u,l,tt,y,z,*m,*n;
	 unsigned char *t,*s,w;
	 char *hh;
	 HANDLE khndl;
     st--;a = st - (*st - L0);
	 switch(*a)
	 {case 0x00200069: // logsimvol
	  b = *(a+1);
     if(!(b & 0x00200000))
      {tipprer = 7;st++;initprer(1);return;}
     b &= T11;
	  if(ralt == 1)
	  {khndl = Nopen(pathaltkat);
		Npointer(khndl,4*(b-1),0);
		Nread(khndl,(char*)&c,4);
		Nclose(khndl);ralt = 0;
      if(c == 0){ist = 0;st =a;return;}
	  }
	  else
	  {c = K[b - 1];
		if(c == 0){ist = 0;st = a;return;}
		if(!(c & T1))
		{e = P[(c >> 19)-1];c = e[(c & T11) + 2];
		}
	  }
	  d = (c >> 15) & T4;opr(*(a+2),0x00200001 + d);
	  c &= 0x00007FFF;opr(*(a+3),0x00200001 + c);
	  break;
	  case 0x00201EE5: // si
      doploshndl = Nopen(pathdoplos);
      g = Npointer(doploshndl,0,1);
	  Npointer(doploshndl,0,0);
      Nread(doploshndl,C,g);
	  Nclose(doploshndl);
      g--;
	  while(C[g] == 0x0d || C[g] == 0x20)
	   {g--;}
	  g++;
	  vichproghndl = CreateFileA(pathvichprog, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
		NULL, CREATE_ALWAYS,
	  FILE_ATTRIBUTE_NORMAL, NULL);
      Npointer(vichproghndl,0,1);
	  Nwrite(vichproghndl,C,g);
      Nclose(vichproghndl);
      break;
	  case 0x00201EE8: // Si
      p = *(a+1) - L0;
	  j = *(a+2) - L0;
	  for(k = 0,i = p; i <= j; i++,k++)
	   {w = (unsigned char)B[i];
	    C[k] = w;
	   }
      vichproghndl = Nopen(pathvichprog);
      Npointer(vichproghndl,0,1);
	  Nwrite(vichproghndl,C,k);
      Nclose(vichproghndl);
      break;
	  case 0x00200AE8: // dopkontekst
      if(dophndl !=0)
      Nclose(dophndl);
      dophndl = CreateFileA(pathdop, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
		 NULL, CREATE_ALWAYS,
		 FILE_ATTRIBUTE_NORMAL, NULL);
	  for(i = 0; i < 262144; i++)
      C[i] = 0;
	  for(i = 0; i < 8; i++)
	   {Npointer(dophndl,0,1);
	    Nwrite(dophndl,C,262144);
	   }
	  Nclose(dophndl);
      break;
	  case 0x00201076: // dopkadr
      dophndl = Nopen(pathdop);
	  b = *(a+1) - 0x00200001;
      b *=4;
	  d = *(a+2) - L0;
	  R[0] = d;
	  Npointer(dophndl,b,0);
	  Nwrite(dophndl,(char*)R,4);
	  Nclose(dophndl);
      break;
	 case 0x00200190: // znachenie
      b = ((*(a+1) & T4) - 1) << 15;b |= T1;
	  b |= ((*(a+2) & T4) - 1) & 0x00007FFF;
	  if(ralt == 1)ralt = 2;
	  c = fragment(b);
     if(c == 0)
      {tipprer = 7;st++;initprer(1);return;}
     e = P[(c >> 19)-1];e += (c & T11);
     *(e+3)=0;
	  d = dekonvert(e);
     if(ind == 4){tipprer = 7;st++;initprer(1);return;}
     opr(*(a+3),d);
	  if(ralt == 2){ralt = 0;FR1 = 0;FR2 = 0;}
	  break;
	  case 0x00200071: // zapisb
	  b = *(a+1);l = 0;
     if( b != L0 && b != 0x00200105)
      {tipprer = 7;st++;initprer(1);return;}
     d = *(a+4);
     if(d & T6 || !(Z[d+1] & T1))
      {tipprer = 7;st++;initprer(1);return;}
     h = d+2;
     while(!(Z[h] & T1))
      {g = Z[h];
       if(g & T6 || !(Z[g+1] & T1) || Z[g+2] == 0)
       {tipprer = 7;st++;initprer(1);return;}
       h += 2;
      }
	  if(b == L0)    // kornevoj fragment
	  {h = (*(a+2) & T11) - 1;d = K[h];
		if(d == 0)  // programmi log.simvola ne bilo
      {l = 1;i = *(a+4)+2;f = 0;  // ili ona bila otkljuchena
       while(j = Z[i],!(j & T1))
        {k = Z[j + 2];
         if((k == 0x002000F1 || k == 0x002000F2) &&
             Z[j] == 10)
          {f = ((Z[j + 4] - 1) << 15) & 0xFFC00000;
           f |= T1;tekprog(f);break;
          }
         i += 2;
        }
       if(f == 0)f = novprog();
      }
		else
		{if(!(d & T1))  // programma log.simvola uge estb
		 {e = P[(d >> 19)-1];d = e[(d & T11) + 2];
		 }
		 tekprog(d);smfail(d,0);f = d & 0xFFC00000;
       c =  Npointer(proghndl,d & 0x003FFFFF,0);//
       if(c == 0xFFFFFFFF)                  //
       {tipprer = 7;st++;initprer(1);return;} // kontrol
		 Nread(proghndl,(char*)F,7);       //korrektnosti
       g = F[1] & 0x00FFFFFF;             //
       if(g != (*(a+2) & T4))             //
       {tipprer = 7;st++;initprer(1);return;} //
      }
	  }
	  else    // nekornevoj fragment
	  {g = *(a+2);
      if(g & T6 || !(Z[g+1] & T1) || Z[g] != 8 ||
         !(*(a+3) & 0x00200000))
       {tipprer = 7;st++;initprer(1);return;}
		d = (Z[g + 2] - 1) << 15;
      d |= ((Z[g + 4] - 1) & 0x00007FFF);d |= T1;
		tekprog(d);smfail(d,0);f = d & 0xFFC00000;
      r = d & 0x003FFFFF;                     //
      c =  Npointer(proghndl,r,0);    // proverka
      if(c == 0xFFFFFFFF)                   // korrektnosti
      {tipprer = 7;st++;initprer(1);return;}  //
		Nread(proghndl,(char*)F,2);           //
		g = F[0] & 0x00003FFF;g += r;          //
		g += 3*(*(a+3) - 0x00200105);          //
		c =  Npointer(proghndl,g,0);    //
      if(c == 0xFFFFFFFF)                   //
      {tipprer = 7;st++;initprer(1);return;}  //
		Nread(proghndl,(char*)F,3);           //
      p = F[0] & 0x00FFFFFF;
                                              //
      if(p & 0x00800000)
       {if(p & 0x00740000)                    //
         {tipprer = 7;st++;initprer(1);return;}  //
       }
      else
      {c = Npointer(proghndl,p,0);    //
       if(c == 0xFFFFFFFF)                   //
       {tipprer = 7;st++;initprer(1);return;}  //
       Nread(proghndl,(char*)R,7);           //
       c = R[1] & 0x00FFFFFF;                 //
       if(c != r)                             //
       {tipprer = 7;st++;initprer(1);return;}  //
      }
     }       // f - shablon adresa dlja tek.prog.faila
	  konvert(*(a+4));c = fragfile(); tt = R[0];z = R[1];
	  g = F[1] & 0xFF000000;
	  if(b == L0)
	  {F[0] |= 0x00004000;F[1] = (*(a+2) & T4) | g; // ssilka na vneshnij
																	// fragment
	  }
	  else F[1] = g | r;
	  g = Npointer(proghndl,0,1);
	  Nwrite(proghndl,(char*)F,c);  // fragment zapisan
     if(4000000 < g+c)
	  {polnij = 1;Polnij = 1;}
	 f |= g;
	  if(tt != z) // korrekcia vozvratnih ssilok is
							 // podfragmentov novogo fragmenta
	  {p = tt;
		while(p != z)
		{if((R[p] & 0xFFC00000) != 0xFFC00000)
        {q = (R[p] & 0x003FFFFF);
         Npointer(proghndl,q,0);
         Nread(proghndl,(char*)F,7);
         F[0] &= 0xFFFFBFFF;
         F[1] = g;
          Npointer(proghndl,q,0);
		   Nwrite(proghndl,(char*)F,7);
        }
		 p++;
		}
	  }
	  if(b == L0)  // registracija v kataloge
	  {g = K[h];K[h] = f;
		if(g != 0)
		{if(!(g & T1)) // zanulenie vneshnej ssilki na starij kornevoj
							// fragment v zone programm
		 {e = P[(g >> 19)-1];e[(g & T11) + 3] = 0;}
        g = d & 0x003FFFFF;
		 Npointer(proghndl,g,0); // vicherkivanie
		 Nread(proghndl,(char*)F,2);    // starogo fragmenta
		 F[0] |= 0x00008000;
		 Npointer(proghndl,g,0);
		 Nwrite(proghndl,(char*)F,2);
		}
		khndl = Nopen(pathkat);
		Npointer(khndl,4*h,0);
		Nwrite(khndl,(char*)&f,4);
		Nclose(khndl);
	  }
	  else  // registracija vo vneshnem fragmente
	   {Npointer(proghndl,r,0);
		Nread(proghndl,(char*)F,2);
		g = F[0] & 0x00003FFF;g += r;
		g += 3*(*(a+3) - 0x00200105);
		Npointer(proghndl,g,0);
		Nread(proghndl,(char*)F,3); // v F[0] - staraja ssilka
		R[0] = f & 0x003FFFFF;
		Npointer(proghndl,g,0);
		Nwrite(proghndl,(char*)R,3); // zapisali ssilku na novij fragment
		g = F[0] & 0x00FFFFFF;
		if(!(g & 0x00800000))  // vicherkivanie starogo fragmenta
		{Npointer(proghndl,g,0);
		 Nread(proghndl,(char*)F,2);
		 F[0] |= 0x00008000;
		 Npointer(proghndl,g,0);
		 Nwrite(proghndl,(char*)F,2);
		}
	  }
     if(!(g & 0x00800000) && l == 0)
     {Npointer(proghndl,g,0);  // iskluchenie vetvej
      Nread(proghndl,(char*)F,4);  // starogo fragmenta,
      p = F[0] & 0x00003FFF;  // ne voshedshih v novij
      q = F[0] >> 16;
      if(p < q)
      {Npointer(proghndl,g + p,0);
       Nread(proghndl,(char*)F,q-p);
       i = 0;q -= p;p = 0;
       m = (UINT*)C;t = (unsigned char*)F;
       while(p < q)
       {y = (UINT)t[p] | ((UINT)t[p+1] << 8) |
        ((UINT)t[p+2] << 16);
        if(!( y & 0x00800000))
         {for(j = tt;j < z;j++)
          if((R[j] & 0xFFC00000) != 0xFFC00000 &&
            ((R[j] & 0x003FFFFF) == y))y = 0xFFFFFFFF;
          if(y != 0xFFFFFFFF)
           {m[i] = y;i++;}
         }
        p += 3;
       }
       if(i != 0)
       for(j = 0;j < i;j++)
       {isklprog((f & 0xFFC00000) | m[j]);
        if(ind == 4)return;
       }
      }
     }
     c = (f >> 15) & T4;opr(*(a+5),0x00200001 + c);
	  opr(*(a+6),(f & 0x00007FFF) + 0x00200001);
	  break;
	  case 0x00200067: // iskluchenie
	  b = *(a+1);c = *(a+2);
     if(!(b & 0x00200000) || !(c & 0x00200000))
     {tipprer = 7;st++;initprer(1);return;}
	  d = ((b - 1) << 15) | ((c - 1) & 0x00007FFF) | T1;
	  isklprog(d);smfail(d,0);
	  break;
	  case 0x00200004: // sbros
	  b = (*(a+1) & T11) - 1;
	  c = K[b];
	  if(c != 0)
	  {K[b] = 0;isklprog(c);smfail(c,0);f = 0;
		khndl = Nopen(pathkat);
		Npointer(khndl,4*b,0);
		Nwrite(khndl,(char*)&f,4);
		Nclose(khndl);
	  }
	  break;
	  case 0x0020007D: // korenb
	  b = (*(a+1) & T11) - 1;
	  c = K[b];
	  d = ((*(a+2) - 1) << 15) | ((*(a+3) - 1) & 0x00007FFF) | T1;
	  if(c != 0)
	  {isklprog(c);smfail(c,0);}
	  smfail(d,0);
	  K[b] = d;
	  khndl = Nopen(pathkat);
	  Npointer(khndl,4*b,0);
	  Nwrite(khndl,(char*)&d,4);
	  Nclose(khndl);
	  tekprog(d);
	  Npointer(proghndl,d & 0x003FFFFF,0);
	  Nread(proghndl,(char*)F,7);
	  F[0] |= 0x00004000;F[1] = *(a+1) & 0x0000FFFF;
	  Npointer(proghndl,d & 0x003FFFFF,0);
	  Nwrite(proghndl,(char*)F,7);
	  break;
	  case 0x00200036: // vicherkivanie
	  if(*(a+1) == 0x00200104) // kornevoj fragment
	  {b = (*(a+2) & T11) - 1;c = K[b];
		if(c != 0)
		{K[b] = 0;
       if(!(c & T1))
        {m = P[(c >> 19)-1];c &= T11;
         m[c + 3] = 0;c = m[c+2];
        }
       smfail(c,0);d = 0;
		 khndl = Nopen(pathkat);
		 Npointer(khndl,4*b,0);
		 Nwrite(khndl,(char*)&d,4);
		 Nclose(khndl);
		}
	  }
	  else
	  {b = *(a+2);
      if(b & T6 || !(Z[b+1] & T1) || Z[b] != 8)
      {tipprer = 7;st++;initprer(1);return;}
		c = ((Z[b + 2] - 1) << 15) | ((Z[b + 4] - 1) & 0x00007FFF) | T1;
		smfail(c,0);tekprog(c);d = c & 0x003FFFFF;
		r =  Npointer(proghndl,d,0);
      if(r == 0xFFFFFFFF)
      {tipprer = 7;st++;initprer(1);return;}
		Nread(proghndl,(char*)F,2);
		d += (F[0] & 0x00003FFF);d += ((*(a+3) - 0x00200105) * 3);
		b = (*(a+4) & T11)| 0x00800000;
      r =  Npointer(proghndl,d,0);
      if(r == 0xFFFFFFFF)
      {tipprer = 7;st++;initprer(1);return;}
      Nread(proghndl,(char*)&y,3);
      y &= 0x00FFFFFF;
      if(!(y & 0x00800000))
       {r =  Npointer(proghndl,y,0);
        if(r == 0xFFFFFFFF)
        {tipprer = 7;st++;initprer(1);return;}
        Nread(proghndl,(char*)R,7);
        if((R[1] & 0x00FFFFFF) != (c & 0x003FFFFF))
        {tipprer = 7;st++;initprer(1);return;}
       }
		 Npointer(proghndl,d,0);
		Nwrite(proghndl,(char*)&b,3);
	  }
	  break;
	  case 0x00200037: // pozicia
	  b = mem(8);if(b == 0)return;
	  Z[b+2] = *(a+1);
      Z[b+3] = 0;
      Z[b+4] = *(a+2);
      Z[b+5] = 0;
	  c = 0x00200105;d = *(a+3) + 2;f = *(a+4);
	  while(d < f)
	  {g = Z[Z[d] + 2];
      if(g == 0x002000F1 || g == 0x002000F2)c++;
      d += 2;
	  }
	  opr(*(a+5),b);opr(*(a+6),c);
	  break;
	  case 0x00200377: // normarksinus (uplotnenie bloka programm)
	  uplotnhndl = Nopen(pathuplotn);
	   if(uplotnhndl == INVALID_HANDLE_VALUE){st = a;ist = 0;return;}
      c =  Npointer(uplotnhndl,0,1);
      if(c > 28000)c = 28000;
	  Npointer(uplotnhndl,0,0);
	  Nread(uplotnhndl,(char*)UPL,c);
      Nclose(uplotnhndl); uplotnhndl = 0;
      tekup = 0;
       c /= 4;
		l= 0; // indikator korrekcii kataloga
		for(u = 0;u < c;u++)
		 {if((UPL[u] & T4) == 0)
		  {g = UPL[u] & 0xFFC00000;r = 0;
			for(i = 0;i < u;i++)
			if((UPL[i] & 0x003FFFFF) == 0 && (UPL[i] & 0xFFC00000) == g)r = 1;
			if(r == 0)
			 {g |= T1;
              r = contprog((g & 0x7FC00000) >> 22);
              if(r != 0){st = a;ist = 1;return;}
			  if(l == 0)
			  {l = 1;
			   khndl = Nopen(pathkat);
			   Npointer(khndl,0,0);
			   Nread(khndl,(char*)K,2097152);
			   Nclose(khndl);
			  }
			  tekprog(g);
			  r =  Npointer(proghndl,0,1);
              if(r == 0xFFFFFFFF){ind = 4;st = a;return;}
			  U2 = (UINT*)calloc(r,1);
			  Npointer(proghndl,0,0);
			  Nread(proghndl,(char*)U2,r);
			  r = uplotnprog(r,g);
			  if(r > 4000000)
			   {                 //razrezanie bolshogo faila
				U3 = (UINT*)calloc(r,1);
				 t = (unsigned char*)U2; // d
				  s = (unsigned char*)U3; // q
				  for(b = 0;b < r;b++)s[b] = t[b];
				  i=0;
				  while(pathprog[i] != 0)
                   {C[i] = pathprog[i];i++;};
				    C[i] = 0;i++;k = 1;
				    while(k != 0xFFFFFFFF)
				     {j = Dlinpath;
					  while(j > dLinpath)
					   {w = C[j];
                        if(w == '7')
                         {C[j] = '0';j--;}
					    else
                         {C[j] = (char)(w + 1);break;}
					   }
					  k = NGetFileAttributesA(C);
				     }
				    for(f = 0;f < c;f++)
				    if((UPL[f] & 0x003FFFFF) == 0 &&
                        UPL[f] > UPL[u])UPL[f] += 0x00400000;
				    hh = C + i;f = 0;  // sdvig nomerov failov,idushih posle
				    while(f == 0)     // razrezaemogo
				     {for(b = 0;b < i;b++)hh[b] = C[b];
					  j = Dlinpath;
					  while(j > dLinpath)
					   {w = C[j];
					    if(w == '0'){C[j] = '7';j--;}
						else {C[j] = (char)(w - 1);break;}
					   }
					  f = 1;
					  for(j = dLinpath + 1;j <= Dlinpath;j++)
					   if(C[j] > pathprog[j]){f = 0;break;}
					  if(f == 0)MoveFileA(C,hh);
				     }
				    for(f = 0;f < 524288;f++)
				     {k = K[f] & 0xFFC00000;if(k > g)K[f] += 0x00400000;}
				      k = 0; // k - chislo bait,otnesennih k pervoj polovine
				      i = 0; //i - tek.smeshenie v K
				      while(k < 2000000 && i < 524288)
				       {if((K[i] & 0xFFC00000) != g)i++;
				        else
				         {tt = k;j = 1;
					      F[1] = K[i] & 0x003FFFFF; // j - tek.smeshenie v bufere
					      t = (unsigned char*)U3;i++;
					      while(j != 0)
					       {b = F[j];y = ((UINT)t[b+2] | ((UINT)t[b+3] << 8));
					        k += y;
					        t[b+1] |= 0x80;j--;
					        z = b + (((UINT)t[b] | ((UINT)t[b+1] << 8)) & 0x00003FFF);
					        b += y;
					        while(z != b)
					          {y = (UINT)t[z] | ((UINT)t[z+1] << 8) |
							    ((UINT)t[z+2] << 16);
					           j++;F[j] = y;z += 3;
					          }
					       }
				         }
				       }
                      if(3500000 < k && 300000 < tt)  // otkat na edinicu po i
                                          // v sluchae bolshogo
                                          // poslednego fragmenta
                       {i--; j = 1;
					    F[1] = K[i] & 0x003FFFFF; // j - tek.smeshenie v bufere
					    t = (unsigned char*)U3;
					    while(j != 0)
					     {b = F[j];y = ((UINT)t[b+2] | ((UINT)t[b+3] << 8));
					      t[b+1] &= 0x7F;j--;
					      z = b + (((UINT)t[b] | ((UINT)t[b+1] << 8)) & 0x00003FFF);
					      b += y;
					      while(z != b)
					       {y = (UINT)t[z] | ((UINT)t[z+1] << 8) |
							 ((UINT)t[z+2] << 16);
					        j++;F[j] = y;z += 3;
					       }
					     }

                       }
				      while(i < 524288)// uvelichenie na 1 nomera faila dlja vtoroj
				       {if((K[i] & 0xFFC00000) == g)K[i] += 0x00400000; // polovini
				        i++;
				       }
				      t = (unsigned char*)U2; s = (unsigned char*)U3;
				      i = 0;
				      while(i < r)  // vicherkivanie iz pervoj polovini ob'ektov,
				       {j = ((UINT)t[i+2] | ((UINT)t[i+3] << 8)); // otnesennih ko
				        if(!(s[i+1] & 0x80))t[i+1] |= 0x80;  // vtoroj polovine
				        i += j;
				       }
				      e = U2;U2 = U3;f = g + 0x00400000;
                      tt = uplotnprog(r,f);
				      tekprog(f);U2 = e;
                      if(proghndl != 0 && proghndl != INVALID_HANDLE_VALUE)
						Nclose(proghndl);
                      proghndl = Ncreat(pathprog);
				      Nwrite(proghndl,(char*)U3,tt);
				      r = uplotnprog(r,g);
				      free(U3);
				      tekprog(g);

			  }
			  Nclose(proghndl);
              proghndl = Ncreat(pathprog);
			  Nwrite(proghndl,(char*)U2,r);
			  free(U2);
			  khndl = Nopen(pathkat);
			  Npointer(khndl,0,0);
			  Nwrite(khndl,(char*)K,2097152);
		      Nclose(khndl);
			 }
		  }
		 }
		for(f = 0,g = 0;f < c;f++)
		 if((UPL[f] & 0x003FFFFF) != 0)
		  {UPL[g] = UPL[f];g++;}
		uplotnhndl = Ncreat(pathuplotn);
		if(g != 0)Nwrite(uplotnhndl,(char*)UPL,g*4);
		Nclose(uplotnhndl);uplotnhndl = 0;
		for(f = 0;f < NP;f++)
         {m = P[f];m[1] = 0;}
        khndl = Nopen(pathkat);
	    Npointer(khndl,0,0);
	    Nread(khndl,(char*)K,2097152);
	    Nclose(khndl);
        ind = 0;
        if(proghndl != 0)Nclose(proghndl);
        if(infhndl != 0)Nclose(infhndl);
        initsolv();svobprog = 0;svobfrag = 0;
	  break;
	  case 0x00200014: // prodolgenie
	  b = *(a+1) & T11;c = K[b - 1];
	  if(c == 0){ist = 0;st =a;return;}
	  if(!(c & T1))
	  {e = P[(c >> 19)-1];c = e[(c & T11) + 2];
	  }
	  d = 1; // d - smeshenie poslednej zanjatoj jachejki bufera F.
				// V etom bufere pered kagdoj gruppoj ssilok idet 0
	  F[1] = c & 0x003FFFFF;tekprog(c);
      c &= 0xFFC00000;
	  while(d != 0)
	  {f = F[d];
	   Npointer(proghndl,f,0);
	   Nread(proghndl,(char*)R,4);
	   g = R[0] & 0x00003FFF;h = R[0] >> 16;
	   if(g < h)
		{d++;F[d] = 0;
		 f += g;j = h - g;
	     Npointer(proghndl,f,0);
		 Nread(proghndl,(char*)R,j);
		 t = (unsigned char*)R;
		 i = 0;
		 while(i < j)
		  {p = (UINT)t[i] | ((UINT)t[i+1] << 8) | ((UINT)t[i+2] << 16);
		   if(p & 0x00800000)
		    {l = 0x00200000 | (p & 0x0007FFFF);
             opr(*(a+2),l);
			 e = st;
			 while(d != 0)
			  {if(F[d] != 0)d--;
			   else
			    {d--;y = mem(8);l = F[d]; l |= c;
			     if(y == 0){ist = 0;st = a;return;}
			     Z[y+2] = 0x00200000 | (((l >> 15) & 0x0000FFFF) + 1);
                 Z[y+3] = 0;
			     Z[y+4] = 0x00200000 | ((l & 0x00007FFF) + 1);
                 Z[y+5] = 0;
			     *st = y;st++;d--;
			    }
			  }
			 y = text1(e);if(y == 0){ist = 0;st = a;return;}
			 opr(*(a+3),y);st = a;
			 return;
		    }
		   d++;F[d] = p;i += 3;
		  }
		}
	   else
		{d--; while(d != 0 && F[d] == 0)d -= 2;
		}
	  }
	  ist = 0;
	  break;
	  case 0x002000FB: // polnij
      if(Polnij == 0)
	   {ist = 0;}
      break;
	  case 0x00200161: // imja
	  b = *(a+1) & T11;c = K[b - 1];
	  if(c == 0){ist = 0;return;}
	  if(!(c & T1))
	  {e = P[(c >> 19)-1];c = e[(c & T11) + 2];
	  }
	  d = 1; // d - smeshenie poslednej zanjatoj jachejki bufera e.
				// V etom bufere pered kagdoj gruppoj ssilok idet 0
	  e = (UINT*)C;
	  e[1] = c;
	  while(d != 0)
	  {f = e[d];g = fragment(f);
      if(g == 0)
       {tipprer = 7;st++;initprer(1);return;}
      svobfrag = g & T11; svobfrag--;
      svobprog = (g >> 19)-1;
	  m = P[svobprog] + svobfrag; m++;
	  h = dekonvert(m);
      if(ind == 4)
	   {tipprer = 7;st++;initprer(1);return;}
      h += 2;q = *(a+2);
	  while(!(Z[h] & 0x80000000))
	   {r = Z[h];
	    if(Z[r] == Z[q])
	     {u = r + Z[r] - 2;z = 0;
	      for(i = r + 2,j = q + 2;i < u;i++,j++)
		   if(Z[i] != Z[j]){z = 1;break;}
		  if(z == 0)
		   {n = st;
		    do
			 {y = mem(8);l = e[d];
			  if(y == 0){ist = 0;st = a;return;}
			  Z[y+2] = 0x00200000 | (((l >> 15) & 0x0000FFFF) + 1);
              Z[y+3] = 0;
			  Z[y+4] = 0x00200000 | ((l & 0x00007FFF) + 1);
              Z[y+5] = 0;
			  *st = y;st++;
			  while((e[d] != 0)&& d != 1)d--;
			  d--;
			 }
			while(d != 0);
			y = text1(n);if(y == 0){ist = 0;st = a;return;}
			opr(*(a+3),y);st = a;
			return;
		   }
		 }
		h += 2;
	   }
	  i = *m;j = *(m+1);
	  if(i < j)
	   {d++;e[d] = 0;
	    while(i < j)
	     {p = m[i];
	      if((p & 0x7FC00000)^0x7FC00000)
		   {d++;e[d] = p;}
		  i++;
		 }
	   }
      else
	   {d--;
        while(d != 0 && e[d] == 0)d -= 2;
	   }
	  }
	  ist = 0;
	  break;
	  case 0x00200009: // alternativa
	  ralt = 1;
	  break;
	  case 0x0020012F: // komponenta
	  b = *(a+1) - 0x00200001;
	  khndl = Nopen(pathkat);
      c = K[b];
      if(c != 0 && !(c & T1))
       {m = P[(c >> 19)-1];
        m += (c & T11);
        m[3] = 0;
       }
	  Npointer(khndl,4*b,0);
      m = K + b;
	  Nread(khndl,(char*)m,4);
	  Nclose(khndl);
	  break;
      case 0x0020001A: // kontrol
      m = st;b = 0;i=1;d = 0;
      while(b == 0)
       {c = contprog(i);
        if(c == 0xFFFFFFFF)b = 1;
        else
         {if(c != 0)
           {for(p = 0;p < c;p += 2)
             {f = mem(12);Z[f+2] = L0 + i;Z[f+3] = 0;
              Z[f+4] = L0 + CONTR[p];Z[f + 5] = 0;
              q = CONTR[p+1] | (i << 22);
              Z[f + 6] = 0x00200001 + (q >> 15);
              Z[f + 7] = 0;
              Z[f + 8] = 0x00200001 + (q & 0x00007FFF);
              Z[f + 9] = 0;
              *st = f;st++;d++;
              if(d == 12)
               {b = 1;break;}
             }
           }
         }
        i++;
       }
      opr(*(a+1),text1(m));
      break;
      case 0x00200060: // izmemenie
      b = ((*(a+1) & T4) - 1) << 15;b |= T1;
	  b |= ((*(a+2) & T4) - 1) & 0x00007FFF;
      d = *(a+3);
      if(d & T6 || !(Z[d+1] & T1))
       {tipprer = 7;st++;initprer(1);return;}
      tekprog(b);smfail(b,0);r = b & 0x003FFFFF;                     //
      c =  Npointer(proghndl,r,0);
      if(c == 0xFFFFFFFF)
       {tipprer = 7;st++;initprer(1);return;}
	  Nread(proghndl,(char*)F,4);
      f = F[0] & 0x00003FFF; g = F[0] >> 16;
      h = (g - f) % 3;
      if(g < f || h != 0 || g > f + 240)
       {tipprer = 7;st++;initprer(1);return;}
      konvert(*(a+3));p = fragfile();
      q = F[0] & 0x00003FFF;
      if(q != f || g != p)
       {tipprer = 7;st++;initprer(1);return;}
      Npointer(proghndl,r+7,0);
      f -= 7;
      hh = (char*)F;hh += 7;
      Nwrite(proghndl,hh,f);
      break;
      case 0x002000B0: // simvnomer
      b = *(a+1);
      b &= 0x0007FFFF;
      b -=1;
      c = K[b];
      c &= 0x7FFFFFFF;
      c >>= 22;
      c += 0x00200104;
      opr(*(a+2),c);
      break;
     }
	st = a;
	}

   void F170()  // VREMJA

   {UINT a,b,c,d;
    GetSystemTime(&time);
    a = time.wHour;
    b = time.wMinute;
    c = time.wSecond;
    d = time.wMilliseconds;
    opr(*(st-4),a + 0x00200104);
    opr(*(st-3),b + 0x00200104);
    opr(*(st-2),c + 0x00200104);
    opr(*(st-1),(d/10) + 0x00200104);
    st -= 4;
   }

	void F171()  // IKS

	{UINT a;
    a = *(st-1);
    if(!(a & 0x00200000) || a < 0x00200104)
    {tipprer = 7;initprer(1);return;}
    *(st-1) = T7 | (a - L0);
   }

   void F172()  // VNESHSLOVAR

  	{UINT *a,b,c,d,g,h,i,j,m,r,s,t;
    unsigned char p,q,*f;
    st--;a = st - (*st - L0);
	 switch(*a)
	 {case 0x00200071: // zapisb
     b = *(a+1); s = *(a+2)- 0x00200104;
     t = *(a+3)-0x00200104;
     b &= 0x0007FFFF;
     f = (unsigned char*)SL;
     for(i = 0; i < 524288; i++)
      {r = SL[i];
       if(r == 0)break;
       if(r == b)
        {for(j = i; j < 524287; j++)
          {SL[j] = SL[j+1];}
         SL[j] = 0;
		 break;
        }
      }
     c = 0;d = 524287; // c,d - granici promegutka
	 while (c <= d && d < 524288)
	  {g = ((c + d)>> 1);
	   r = SL[g];
	   if(r == 0)
        {if(d == g)break;
         else d = g;
        }
	   else
		{h = (r - 1)*24;h += 2097152;
		 j = 0; //j - indikator okonchanija cicla sravnenija
		 i = s; m = 0;
		 while(j == 0)
		 {p = (unsigned char)B[i];q = f[h];
		  if(p == 0 || p == 0x20)
			{d = g - 1;j = 1;}
		  else
			{if(q == 0){c = g + 1;j = 1;}
			 else
			 {if(p < q){d = g - 1;j = 1;}
			  else
				{if(p > q){c = g + 1;j = 1;}
				 else
				  {if(m == 23)
					 {d = g - 1;j = 1;}
					else{i++;h++;m++;}
				  }
				}
			 }
			}
		 }
		}
	  }
     for(j = 524287; c < j; j--)SL[j] = SL[j-1];
     SL[c] = b;
	 h = (b - 1)*24;h += 2097152;j = 0;
     for(i = s,m = 0; m < 24; i++,m++)
      {p = (j == 0 ? (unsigned char)B[i] : 0);
       if(p == 0 || p == 0x20 || i == t)j = 1;
       f[h] = p;h++;
      }
     slovout(pathslv,SL);
	 break;
     case 0x00200190: // znachenie
     b = *(a+1); c = *(a+2);
     d = *(a+3)- 0x00200105;d <<= 12; // cvet fona
     r = *(a+4)- 0x00200105;r <<= 8; // cvet simvolov
     d |=r; // maska cvetnosti
     s = *(a+5);
     b &= 0x0007FFFF;
     f = (unsigned char*)SL;
     c -= 0x00200104;
     h = (b - 1)*24; h += 2097152;
     p = f[h];
     if(p == 0)
     {ist = 0;return;}
     for(m = 0; m < 24;m++)
      {p = f[h];h++;
       if(p == 0)break;
       else
        {B[c] = d | (UINT)p;
         c++;
        }
      }
     opr(s,(0x00200104 + c));
     break;
     case 0x00200067: // iskljuchenie
     b = *(a+1);
     b &= 0x0007FFFF;
     f = (unsigned char*)SL;
     for(i = 0; i < 524288; i++)
      {r = SL[i];
       if(r == 0)break;
       if(r == b)
        {for(j = i; j < 524287; j++)SL[j] = SL[j+1];
         SL[j] = 0;
		 break;
        }
      }
     h = (b - 1)*24; h += 2097152;
     for(m = 0; m < 24;m++)
      {f[h] = 0;h++;}
     slovout(pathslv,SL);
	 break;
	 case 0x0020024D: // dlina
     b = *(a+1);
	 b &= 0x0007FFFF;
     f = (unsigned char*)SL;
	 h = (b-1)*24; h += 2097152;
	 m = 0;
	 while(f[h] != 0 && m < 25)
	  {m++; h++;}
	 m += 0x00200104;
	 opr(*(a+2),m);
	 break;
    }
    st = a;
   }

	void F173()  // NOMERSIMV

	{UINT a;
    a = *(st-1);
    if(!(a & 0x00200000))
    {tipprer = 7;initprer(1);return;}
    *(st-1) = nomer(a);
   }

   void F174() // SLEDOPERAND

   {UINT a,b,c;
    a = *(st-1);
    if((a & T6) || (Z[a+1] & T1) || Z[a+1] == 0 ||
        (Z[a+1] >> 16) == 3)
     {tipprer = 7;initprer(1);return;}
    b = a - (Z[a+1] >> 16);
    c = a + (Z[a+1] & 0x0000FFFF);
    if(!(c & T1) && c - (Z[c+1] >> 16) == b)
     *(st-1) = c;
   }

   void F175()  // NOMERPEREMENNOJ

   {UINT a;
    a = *(st-1) & 0x0000FFFF; a += 0x00200104;
    *(st-1) = a;
   }

	void F176()  // SIMVNOMER

	{UINT a,b,c;
     c = *(st-1);
	 if(c & T6){*(st-1) -= 0x00000104;return;}
	 else
      {a = 0;
       if(!(Z[c+1] & T1) || Z[c+3] != 0)
        {tipprer = 7;initprer(1);return;}
	   for(b = c+2;!(Z[b] & T1);b += 2)
		 a = (10*a) + (Z[b] - L0);
       *(st-1) = T3 + a;
	  }
	}

	void F177()  // UROVENOBRASHENIJA

	{if( !(*(st-1) & 0x00200000))
    {tipprer = 7;initprer(1);return;}
    uroven = *(st-1); st--;
   }

	void F178()  // FAIL

	{UINT *a,b,c,e,f,g,r,i,j,k,*p,m,n,t,u,v,y;
	 unsigned char *d,s,*q;
	 char *h,*z,w;
    HANDLE hndl;
    st--;a = st - (*st - L0);
	switch(*a)
    {case 0x002002be: // aktiv
	 b = *(a+1) - L0;
     if(b > 17)
      {tipprer = 7;st++;initprer(1);return;}
	 if(nominf != b)
      {if(infhndl != 0){Nclose(infhndl);infhndl = 0;}
	   nominf = b;
	  }
	 break;
	 case 0x0020009F: // video
	 b = adrcod(*(a+1));
     if(b == 0)
      {tipprer = 7;st++;initprer(1);return;}
	 tekfail(b);
     if(infhndl == 0){ind = 4;st = a;return;};
	 Npointer(infhndl,(b & 0x003FFFFF) + 4,0);
     Nread(infhndl,FONT,4864);
	 for(c = 4864;c != 0;c--)
	  {FONT[2*c-1] = 0xFF;FONT[2*c-2] = ~FONT[c-1];}
	 break;
	 case 0x002000BA: // nabor
	 b = adrcod(*(a+1));
     if(b == 0)
      {tipprer = 7;st++;initprer(1);return;}
	 tekfail(b);
     if(infhndl == 0){ind = 4;st = a;return;};
	 c = readinf(b);
     if(c == 0 || ((R[0] & 0xF0000000) != 0x80000000))
      {tipprer = 7;st++;initprer(1);return;}
	 d =(unsigned char*) R;
	 c = (((*(a+2) - L7) & 0x0000000F) << 12) | (((*(a+3) - L7) &
			0x0000000F) << 8); //  maska cvetnosti
	 f = R[0] & T4;
	 for(g = *(a+4) - L0,e = 4;
         (e < f && g < 48000 && d[e] != 0);e++,g++)
	  B[g] = (c | (UINT)d[e]);
     B[g] = 0;
	 opr(*(a+5),0x00200103 + g);
	 break;
	 case 0x0020023F: // slovo
	  b = adrcod(*(a+1));
      if(b == 0)
       {tipprer = 7;st++;initprer(1);return;}
	  tekfail(b);
      if(infhndl == 0){ind = 4;st = a;return;};
	  c = readinf(b);
      if(c == 0 || ((R[0] & 0xF0000000) != 0x80000000))
       {tipprer = 7;st++;initprer(1);return;}
	  d =(unsigned char*) R;
	  f = R[0] & T4;
	  for(g = *(a+2) - L0,e = 4;
           (e+1 < f && g < 15999 &&(d[e] != 0 || d[e+1] != 0));
          e += 2,g++)
	   B[g] = (((UINT)d[e]) << 8) | (UINT)d[e+1];
      B[g] = 0;
	  opr(*(a+3),0x00200103 + g);
      break;
      case 0x00200A47: // bitmap
	  b = adrcod(*(a+1));
      if(b == 0)
       {tipprer = 7;st++;initprer(1);return;}
	  tekfail(b);
      if(infhndl == 0){ind = 4;st = a;return;};
	  c = readinf(b);
      if(c == 0 || ((R[0] & 0xF0000000) != 0x80000000))
       {tipprer = 7;st++;initprer(1);return;}
	  d =(unsigned char*) R;
	  f = 0; e = 4;
      g = R[0] & T4;
      g -= 4;
	  while(f < g)
       {RS[f] = d[e]; e++; f++;}
	  break;
      case 0x0020016D: // proverka
	  b = *(a+1) - L0;
      if(b > 17)
       {tipprer = 7;st++;initprer(1);return;}
	  h = path[b - 1];
	  if(infhndl != 0){Nclose(infhndl); infhndl = 0;}
	  for(c = Dlinpath; c > dLinpath; c--)h[c] = '0';
	  e = NGetFileAttributesA(h);
	  if(e == 0xFFFFFFFF)ist = 0;
	  break;
	  case 0x00200012: // stop
      if(proghndl != 0)Nclose(proghndl);
	  proghndl = 0;
      if(infhndl != 0)Nclose(infhndl);
	  infhndl = 0;
      break;
	  case 0x00201E10: // prokrutka
      pathprokr[2] = (*(a+1) == L0 ? 'L' : 'M');
	  hndl = Ncreat(pathprokr);
      Nclose(hndl);
      break;
	  case 0x002004D2: // signum
      hndl = Ncreat(pathsignum);
	  Nclose(hndl);
      break;
	  case 0x00200071: // zapisb
	  switch(*(a+1))
	   {case 0x0020023D: // term
	    R[0] = 0xA0010000;
        b = *(a+2);
        if(b & T6 || !(Z[b+1] & T1))
         {tipprer = 7;st++;initprer(1);return;}
        c = b+2;
        while(!(Z[c] & T1))
         {e = Z[c];
          if(!(e & T6) && (!(Z[e+1] & T1) || Z[e+3] == 0))
          {tipprer = 7;st++;initprer(1);return;}
          c += 2;
         }
        b += 2;c = 4;d = (unsigned char*)R;
		while(!(Z[b] & T1)){c = infterm(Z[b],c);b += 2;}
		while(c < 7){d[c] = 0;c++;}
		R[0] |= c;
		break;
	   	case 0x0020023F: // slovo
		R[0] = 0x80010000;
		d = (unsigned char*)R;
		c = 4;b = 0;
		while(B[b] != 0 && b < 16000)
		 {d[c] = (unsigned char)(B[b] >> 8);
		  d[c+1] = (unsigned char)(B[b] & 0x000000FF);
		  c += 2;b++;
		 }
	    while(c < 7){d[c] = 0;c++;}
		R[0] |= c;
		break;
		case 0x002000BA: // nabor
		R[0] = 0x80010000;
		d = (unsigned char*)R;
		c = 4;b = 0;
		if(*(a+2) == 0x00200104)
		 while(B[b] != 0 &&  b < 16000)
		  {d[c] = (unsigned char)(B[b] & 0x000000FF);
		   c++;b++;
		  }
	    else
		 {b = *(a+2);e = Z[b+2] - L0;f = Z[b+4] - L0;
		  while(e <= f)
		   {s = (unsigned char)(B[e] & 0x000000FF);
			if(s == 0)s = 0x20;
		 	d[c] = s;
			c++;e++;
		   }
		 }
		while(c < 7){d[c] = 0x20;c++;}
		R[0] |= c;
		break;
        case 0x00200A47: // bitmap
        R[0] = 0x80010000;
	    d = (unsigned char*)R;
	    c = 4;b = 0;
        e = *(a+2);
        e = convchisl(e);
        e *= 2;
        while(b < e){d[c] = RS[b];b++;c++;}
        R[0] |= c;
        break;
        case 0x0020009F: // video
		R[0] = 0x80010000;
		d = (unsigned char*)R;
		for(e = 9728,c = 4867;e!= 0;e -= 2,c--)
		d[c] = ~(FONT[e - 2]);
		R[0] |= 4868;
		break;
	   }
	  f = adrcod(*(a+3));
      if(f == 0)
       {tipprer = 7;st++;initprer(1);return;}
	  if((f & 0x7FC00000) == 0 && nominf != 1 &&
          nominf != 4)
	   {f = T1;e = poslednijfail();}
	  else {e = f & 0xFFC00000;tekfail(f);}
	  Npointer(infhndl,0,1);
      Nwrite(infhndl,nuli,3);
	  g =  Npointer(infhndl,0,1);
      Nwrite(infhndl,(char*)R,c);
      if(4000000 < g + c)polnij = 1;
	  g |= e;
	  registracia(f,*(a+4),g);
      smfail(f,nominf);
      if(ind == 4)return;
	  opr(*(a+5),codadr(g));
	  break;
	  case 0x00200060: // izmenenie
	  f = adrcod(*(a+3));
      if(f == 0)
       {tipprer = 7;st++;initprer(1);return;}
      tekfail(f);
	  f = readinf(f);
      if(f == 0 || !(R[0] & T1))
       {tipprer = 7;st++;initprer(1);return;}
      R[0] &= 0x0FFFFFFF;
	  switch(*(a+1))
	   {case 0x0020023D: // term
	    R[0] |= 0xA0000000;
	    b = *(a+2);
        if(b & T6 || !(Z[b+1] & T1))
         {tipprer = 7;st++;initprer(1);return;}
        c = b+2;
        while(!(Z[c] & T1))
         {e = Z[c];
          if(!(e & T6) && (!(Z[e+1] & T1) || Z[e+3] == 0))
           {tipprer = 7;st++;initprer(1);return;}
          c += 2;
         }
        b += 2;c = 4;
		d = (unsigned char*)R;
		while(!(Z[b] & T1))
		 {c = infterm(Z[b],c);b += 2;}
		while(c < 7)
		 {d[c] = 0;c++;}
		break;
		case 0x0020023F: // slovo
		R[0] |= 0x80000000;
		d = (unsigned char*)R;
		c = 4;b = 0;
		while(B[b] != 0 && b < 16000)
		 {d[c] = (unsigned char)(B[b] >> 8);
		  d[c+1] = (unsigned char)(B[b] & 0x000000FF);
		  c += 2;b++;
		 }
	    while(c < 7){d[c] = 0;c++;}
		break;
		case 0x002000BA: // nabor
		R[0] |= 0x80000000;
		d = (unsigned char*)R;
		c = 4;b = 0;
		if(*(a+2) == 0x00200104)
		 while(B[b] != 0 &&  b < 16000)
		  {d[c] = (unsigned char)(B[b] & 0x000000FF);
		   c++;b++;
		  }
	    else
		 {b = *(a+2);e = Z[b+2] - L0;y = Z[b+4] - L0;
		  while(e <= y)
		   {s = (unsigned char)(B[e] & 0x000000FF);
			if(s == 0)s = 0x20;
		 	d[c] = s;
			c++;e++;
		   }
	     }
		while(c < 7){d[c] = 0x20;c++;}
		break;
        case 0X00200A47: // bitmap
        R[0] |= 0x80000000;
		d = (unsigned char*)R;
		c = 4;b = 0;
        e = *(a+2);
        e = convchisl(e);
        e *= 2;
        while(b < e)
		 {d[c] = RS[b];b++;c++;}
        while(c < 7)
		 {d[c] = 0;c++;}
		break;
        case 0x0020009F: // video
		R[0] |= 0x80000000;
		d = (unsigned char*)R;
		for(e = 9728,c = 4867;e!= 0;e -= 2,c--)
		d[c] = ~FONT[e - 2];
        c = 4868;
		break;
	   }
	  g = izmenenie(f,c);
      if(g == 0 || ind == 4)
       {tipprer = 7;st++;initprer(1);return;}
      opr(*(a+4),codadr(g));
	  break;
	  case 0x0020023D: // term
	  f = adrcod(*(a+1));
      if(f == 0)
       {tipprer = 7;st++;initprer(1);return;}
      tekfail(f);
	  b = readinf(f);
      if(b == 0 || (R[0]&0xF0000000) != 0xA0000000)
       {tipprer = 7;st++;initprer(1);return;}
      p = st;
	  b = 4;d = (unsigned char*)R;
	  e = R[0] & 0x0000FFFF;
	  while(b + 3 <= e && (d[b] != 0 || d[b+1] != 0 ||
            d[b+2] != 0))
	  b = tekstmetki(b,1);
      if(b == 0)
       {ind = 4;st = a;return;}
	  b = text1(p);
      if(b == 0)
       {ind = 4;st = a;return;}
	  opr(*(a+2),b);
	  break;
	  case 0x002002C3: // passiv
	  if(infhndl != 0){Nclose(infhndl);infhndl = 0;};
	  break;
	  case 0x00200196: // chislo
	  opr(*(a+1),L0 + nominf);
	  break;
      case 0x00200067: // iskljuchenie
      b = *(a+1) - L0;
      if(b < 10){st = a; return;}
      if(b == nominf && infhndl != 0){Nclose(infhndl);
      infhndl = 0; nominf = 1;};
      h = path[b - 1];
	  for(c = Dlinpath; c > dLinpath; c--)h[c] = '0';
      e = DeleteFileA(h);
      if(e == 0){st = a; return;}
      while(e != 0)
       {c = Dlinpath;
        while(c > dLinpath)
         {w = h[c];
          if(w == '7')
		   {h[c] = '0'; c--;}
          else
		   {h[c] = w + 1; break;}
         }
        e = DeleteFileA(h);
       }
      uplotnhndl = Nopen(pathuplotn);
	  if(uplotnhndl == INVALID_HANDLE_VALUE){st = a;return;}
	  c =  Npointer(uplotnhndl,0,1);
      if(c > 28000)c = 28000;
	  Npointer(uplotnhndl,0,0);
	  Nread(uplotnhndl,(char*)UPL,c);
      Nclose(uplotnhndl);uplotnhndl = 0;tekup = 0;
      c /= 4;
  	  for(f = 0,g = 0;f < c;f++)
	   if((UPL[f] & 0x003FFFFF) != b)
		{if(g != f)UPL[g] = UPL[f];g++;}
	  uplotnhndl = Ncreat(pathuplotn);
	  if(g != 0)Nwrite(uplotnhndl,(char*)UPL,g*4);
	  Nclose(uplotnhndl);uplotnhndl = 0;
	  break;
	  case 0x002002DA: // ssilka
	  b = adrcod(*(a+1));
      if(b == 0)
       {tipprer = 7;st++;initprer(1);return;}
	  tekfail(b);f = readinf(b);
      if(f == 0)
       {tipprer = 7;st++;initprer(1);return;}
	  opr(*(a+2),codadr(f));
	  break;
      case 0x00200009: // alternativa
      if(*(a+1) == 0x00200105)ialt = 1;
      else ialt = 0;
	  if(infhndl != 0){Nclose(infhndl);infhndl = 0;}
	  break;
	  case 0x0020043A: // altoperand
      if(infhndl != 0){Nclose(infhndl);infhndl = 0;}
	  b = *(a+1);
	  c = *(a+2);
	  if(b == 0x00200104)
	   {ialt = 0;
	    iialt = 0;
	   }
	  else
	   {ialt = 1;
	    if(c == 0x00200104)
		 {iialt = 19;}
		else
		 {iialt = 23;}
	   }
	  for(i = 0; i < 16; i++)
	   {pereklput(b,c,i);
	   }
	  break;
	  case 0x00200649: // Alternativa
      b = *(a+1) - L0;
	  if(b == 0)
	   {ialt = 0;
		for(i = 0; i < 16;i++)
		 {h = altpath[i];
		  j = dlinpath + 1;
		  h[j] = 'A';
		  h[j+1] = 'L';
		  h[j+2] = 'T';
		 }
	   }
	  else
	   {if(b > 24)
	     {tipprer = 7;st++;initprer(1);return;}
	    else
		 {ialt = 1; w = '0';
	      if(b >= 10)
		   {w = 'a';
		    b -= 10;
		   }
		  w += (char)b;
	      for(i = 0; i < 17; i++)
		   {h = altpath[i];
		    j = dlinpath + 1;
			h[j] = 'E';
			h[j+1] = 'X';
			h[j+2] = w;
		   }
	     }
       }
      if(infhndl != 0){Nclose(infhndl);infhndl = 0;}
	  break;
 	  case 0x00200377: // normarksinus (uplotnenie)
      polnij = 0;
	  uplotnhndl = Nopen(pathuplotn);
	  if(uplotnhndl == INVALID_HANDLE_VALUE)
	   {st = a;return;}
	  c = Npointer(uplotnhndl,0,1);
      if(c > 28000)c = 28000;
	  Npointer(uplotnhndl,0,0);
	  Nread(uplotnhndl,(char*)UPL,c);
      Nclose(uplotnhndl);uplotnhndl = 0;tekup = 0;
      c /= 4;
	  for(u = 0;u < c;u++)
	   {if((UPL[u] & 0x003FFFFF) == nominf)
		 {g = UPL[u] & 0xFFC00000;r = 0;
		  for(i = 0;i < u;i++)
		   if((UPL[i] & 0x003FFFFF) == nominf && (UPL[i] & 0xFFC00000) == g)r = 1;
		  if(r == 0)
		   {g |= T1;
            r = continf(nominf,((g & 0x7FC00000) >> 22));
            if(r != 0 && r != 0xFFFFFFFF){st = a;ist = 0;return;}
			if(nominf != 1 && nominf != 4)
			 {U1 = (UINT*)calloc(2097152,1);
			  tekfail(0x80000000);
			  Npointer(infhndl,0,0);
			  Nread(infhndl,(char*)U1,2097152);
			 }
			tekfail(g);
			r =  Npointer(infhndl,0,1);
			U2 = (UINT*)calloc(r,1);
			Npointer(infhndl,0,0);
			Nread(infhndl,(char*)U2,r);
			r = uplotninf(r,g);
			if(r > 4000000 && nominf != 1 && nominf != 4)
             {j = 0; e = 0; // proverka,chto k failu otnositsja bolee odnogo
              for(i = 0;i < 524288;i++) // log.simvola
               {if((U1[i] & 0xFFC00000) == g)
                 {e = i;j++;}
               }
              if(j > 1)
			   {U3 = (UINT*)calloc(r,1);
				  d = (unsigned char*)U2;
				  q = (unsigned char*)U3;
				  for(b = 0;b < r;b++)q[b] = d[b];
				  z = path[nominf - 1];i=0;
				  while(z[i] != 0)
                   {C[i] = z[i];i++;};
                    C[i] = 0;i++;k = 1;
				    while(k != 0xFFFFFFFF)
				     {j = Dlinpath;
					  while(j > dLinpath)
					   {w = C[j];
					    if(w == '7'){C[j] = '0';j--;}
						else {C[j] = (char)(w + 1);break;}
					   }
					  k = NGetFileAttributesA(C);
				     }
				    for(f = 0;f < c;f++)
				    if((UPL[f] & 0x003FFFFF) == nominf &&
                        UPL[f] > UPL[u])
					 UPL[f] += 0x00400000;
				    h = C + i;f = 0;  // sdvig nomerov failov,idushih posle
				    while(f == 0)     // razrezaemogo
				     {for(b = 0;b < i;b++)h[b] = C[b];
					  j = Dlinpath;
					  while(j > dLinpath)
					   {w = C[j];
					    if(w == '0')
						 {C[j] = '7';j--;}
						else
						 {C[j] = (char)(w - 1);break;}
					   }
					  f = 1;
					  for(j = dLinpath+1;j <= Dlinpath;j++)
					   if(C[j] > z[j])
					    {f = 0;break;}
					  if(f == 0)MoveFileA(C,h);
				     }
				    for(f = 0;f < 524288;f++)
				     {k = U1[f] & 0xFFC00000;if(k > g)U1[f] += 0x00400000;
					 }
				    k = 0; // k - chislo bait,otnesennih k pervoj polovine
				    i = 0; //i - tek.smeshenie v U1
				    while(k < 2000000 && i < 524288)
				     {if((U1[i] & 0xFFC00000) != g)i++;
				      else
				       {for(j = i+1;j < 524288;j++) // proverka,chto simvol -
                         {if((U1[j] & 0xFFC00000) == g)break;} // ne poslednij
                        if(j == e)break;
                        j = 1;F[1] = U1[i] & 0x003FFFFF; // j - tek.smeshenie v bufere
					    d = (unsigned char*)U3;i++;
					    while(j != 0)
					     {b = F[j];k += ((UINT)d[b] | ((UINT)d[b+1] << 8));
					      k += 3;d[b+3] |= 0x40;j--;
					      if(!(d[b+3] & 0x80))// ukazatel - spisok
					       {p = R; // sohranjaetsja znachenie R
					        R = (UINT*)(d + b);
					        y = (UINT)d[b+2] | ((UINT)d[b+3] << 8);y &= 0x00000FFF;
					        m = 4;
					        while(m < y + 4) //cicle prosmotra metok
					         {n = (UINT)d[b + m] | ((UINT)d[b + m + 1] << 8);
						      n += (m + 2); // n - smeshenie polja sled.metki
						      t = tekstmetki(m + 2,0);
						      while(t < n)
						       {v = (UINT)d[b + t] | ((UINT)d[b + t + 1] << 8) |
						         ((UINT)d[b + t + 2] << 16);
						        j++;F[j] = v;t+= 3;
						       }
						      m = n;
					         }
					        R = p;
					       }
					     }
				       }
				     }
				    while(i < 524288)  // uvelichenie na 1 nomera faila dlja vtoroj
				     {if((U1[i] & 0xFFC00000) == g)U1[i] += 0x00400000;// polovini
				      i++;
				     }
				    d = (unsigned char*)U2; q = (unsigned char*)U3;
				    i = 3;
				    while(i < r)  // vicherkivanie iz pervoj polovini ob'ektov,
				     {j = ((UINT)d[i] | ((UINT)d[i+1] << 8)); // otnesennih ko
				      if(!(q[i+3] & 0x40))d[i+3] |= 0x40;  // vtoroj polovine
				      i += j;i += 3;
				     }
 				    p = U2;U2 = U3;f = g + 0x00400000;t = uplotninf(r,f);
				    tekfail(f);U2 = p;
				    Nwrite(infhndl,(char*)U3,t);
				    r = uplotninf(r,g);
				    free(U3);
				    tekfail(g);

			   }
             }
			Nclose(infhndl);
			infhndl = Ncreat(path[nominf - 1]);
			Nwrite(infhndl,(char*)U2,r);
			free(U2);
			if(nominf != 1 && nominf != 4)
			 {tekfail(0x80000000);
			  Npointer(infhndl,0,0);
			  Nwrite(infhndl,(char*)U1,2097152);
              free(U1);
             }
		    }
		 }
	   }
      for(f = 0,g = 0;f < c;f++)
	   if((UPL[f] & 0x003FFFFF) != nominf)
		{if(g != f)UPL[g] = UPL[f];g++;}
	  uplotnhndl = Ncreat(pathuplotn);
	  if(g != 0)Nwrite(uplotnhndl,(char*)UPL,g*4);
	  Nclose(uplotnhndl);uplotnhndl = 0;
	  break;
      case 0x00200011: // vihod
      i = 0;f = 0;
      while(f != 0xFFFFFFFF)
       {f = contprog(i);
        if(f != 0 && f != 0xFFFFFFFF)
         {ist = 0;st = a;return;}
        i++;
       }
      for(j = 2;j < 10;j++)
       {i = 1;f = 0;
        while(f != 0xFFFFFFFF)
         {f = continf(j,i);
          if(f != 0 && f != 0xFFFFFFFF)
           {ist = 0;
		    st = a;return;}
          i++;
         }
       }
      for(i = 1;i < 26;i++)
       {switch(i)
         {case 1: h = pathkat;
          break;
          case 2: h = pathuplotn;
          break;
          case 3: h = pathprog;
		  if(proghndl != 0)
           {Nclose(proghndl);proghndl = 0;}
          break;
          case 4: h = path1;
          break;
          case 5: h = path2;
          break;
          case 6: h = path3;
          break;
          case 7: h = path4;
          break;
          case 8: h = path5;
          break;
          case 9: h = path6;
          break;
          case 10: h = path7;
          break;
          case 11: h = path8;
          break;
          case 12: h = path9;
          break;
          case 13: h = path10;
          break;
          case 14: h = path11;
          break;
          case 15: h = pathvoc;
          break;
          case 16: h = pathslv;
          break;
          case 17: h = path12;
          break;
          case 18: h = path13;
          break;
          case 19: h = path14;
          break;
		  case 20: h = path15;
          break;
		  case 21: h = path16;
		  break;
		  case 22: h = path17;
		  break;
		  case 23: h = pathcvet;
		  break;
		  case 24: h = pathcvgr;
		  break;
		  case 25: h = pathcvpr;
         }
	    if(3 <= i && i != 15 && i != 16 && i != 23 && i != 24 && i != 25)
         {h[Dlinpath - 2] = '0';
          h[Dlinpath - 1] = '0'; h[Dlinpath] = '0';
          if(infhndl != 0)
           {Nclose(infhndl);infhndl = 0;}
         }
        b = 0;
        while(b == 0)
         {hndl = Nopen(h);
          if(hndl == INVALID_HANDLE_VALUE)b = 1;
          else
           {c =  Npointer(hndl,0,1);
            U1 = (UINT*)calloc(c,1);
            Npointer(hndl,0,0);
            Nread(hndl,(char*)U1,c);
            Nclose(hndl);
            j = 0;
            while(h[j] != 0)j++;
            j--;
            while(j >= dlinpath)
             {h[j+5] = h[j]; j--;}
            h[dlinpath] = '\\';
            h[dlinpath + 1] = 'c';
            h[dlinpath + 2] = 'o';
            h[dlinpath + 3] = 'p';
            h[dlinpath + 4] = 'y';
            hndl = Ncreat(h);
            Nwrite(hndl,(char*)U1,c);
            Nclose(hndl);
            free(U1);
            j = dlinpath;
            while(h[j] != 0)
             {h[j] = h[j+5]; j++;}
              if(i < 3 || i == 15 || i == 16 || i == 23 || i ==24 || i == 25)b = 1;
              else
               {j = Dlinpath;
		        while(j > dLinpath)
		         {w = h[j];
                  if(w == '7')
				   {h[j] = '0';j--;}
				  else
				   {h[j] = (char)(w + 1);break;}
		         }
               }
           }
         }
       }
      break;
      case 0x00200010: // vipiska
      uplotnhndl = Nopen(pathuplotn);
	  if(uplotnhndl == INVALID_HANDLE_VALUE){st = a;return;}
	  c =  Npointer(uplotnhndl,0,1);
      if(c > 28000)c = 28000;
	  Npointer(uplotnhndl,0,0);
	  Nread(uplotnhndl,(char*)UPL,c);c /= 4;
      Nclose(uplotnhndl);uplotnhndl = 0;
      i = 0;
	  for(u = 0;u < c;u++)
       {k = UPL[u]& 0x003FFFFF;
        if(k != 0)
         {for(j = 0;j < i;j++)
           {if(R[j] == k)break;}
          if(j == i)
           {R[i] = k;i++;}
         }
       }
      p = st;
      for(j = 0;j < i;j++,st++)*st = L0+R[j];
      k = text1(p);
      opr(*(a+1),k);
      break;
      case 0x00200061: // nachalo
      b = *(a+1) - L0;
      c = dlinpath + 5;
      if(inphndl != 0)
       {Nclose(inphndl);inphndl = 0;}
      for(i = 0; i < b; i++,c++)
        pathinput[c] = (char)(B[i] & 0x000000FF);
      pathinput[c] = 0;
      inphndl = Nopen(pathinput);
      break;
      case 0x00200062: // konec
      if(inphndl != 0)Nclose(inphndl);
      inphndl = 0;
      break;
	  case 0x0020024D: // dlina
      b = Npointer(inphndl,0,1);
      c = loschisl(b);
	  opr(*(a+1),c);
	  break;
      case 0x002002A9: // otrezok
      b = convchisl(*(a+1));
      c = convchisl(*(a+2));
      if(c > 2000)
      {tipprer = 7;st++;initprer(1);return;}
      h = (char*)R;
      Npointer(inphndl,b,0);
      m = Nread(inphndl,h,c);
      e = (((*(a+4) - L7) & 0x0000000F) << 12) | (((*(a+5) - L7) &
			0x0000000F) << 8); //  maska cvetnosti
      f = *(a+3) - L0; // nachalo v bufere
      for(i = 0; i < c; i++,f++)
       {g = (UINT)h[i];
        if(i >= m)g = 0;
        B[f] = g | e;
       }
      break;
	  case 0x00200059: // zamena
      b = Npointer(inphndl,0,1);
	  c = *(a+3) - L0;
	  e = *(a+4) - L0;
	  f = b + 1;
	  if(e > c) f += (e - c);
      J1 = (unsigned char*)calloc(b,1);
	  J2 = (unsigned char*)calloc(f,1);
      Npointer(inphndl,0,0);
      m = Nread(inphndl,J1,b);
      g = convchisl(*(a+1));
	  r = convchisl(*(a+2));
      for(i = 0; i < g; i++)
       J2[i] = J1[i];
	  for(j = c; j <= e; i++,j++)
       J2[i] = (unsigned char)(B[j] & 0x000000FF);
      for(j = r+1; j < b; j++,i++)
       J2[i] = J1[j];
      Nclose(inphndl);
      inphndl = Ncreat(pathinput);
	  Nwrite(inphndl,(char*)J2,i);
	  free(J1);
	  free(J2);
	  break;
      case 0x002001A8: // zameshenie
      c = *(a+2) - *(a+1); c++;
      if(c > 2000)
       {tipprer = 7;st++;initprer(1);return;}
      if(*(a+3) == 0x00200062)
       {Npointer(inphndl,0,1);}
      else
       {b = convchisl(*(a+3));
        Npointer(inphndl,b,0);
       }
      h = (char*)R;
      e = *(a+1) - L0;
      if(e >= 16000)
       {tipprer = 7;st++;initprer(1);return;}
      for(i = 0;i < c && e < 16000;i++,e++)
       {h[i] = (char)(B[e] & 0x000000FF);}
      Nwrite(inphndl,h,c);
      break;
      case 0x002004FB: // udalenie
      b = *(a+1) - L0;
      if(b == 0)
       {ist = 0; st = a; return;}
      c = dlinpath + 5;
      for(i = 0; i < b; i++,c++)
       {pathinput[c] = (char)(B[i] & 0x000000FF);
       }
      pathinput[c] = 0;
      c = NGetFileAttributesA(pathinput);
      if(c == FILE_ATTRIBUTE_DIRECTORY)
       {f = RemoveDirectoryA(pathinput);
        if(f == 0)
         {ist = 0; pathinput[subdir]=0; st = a; return;}
       }
      else
       {f = DeleteFileA(pathinput);
        if(f == 0)
         {ist = 0; pathinput[subdir]=0; st = a; return;}
       }
      pathinput[subdir]=0;
      break;
      case 0x0020001E: // novij
      b = *(a+1) - L0;
      if(b == 0)
       {ist = 0; st = a; return;}
      c = dlinpath + 5;
      for(i = 0; i < b; i++,c++)
       {pathinput[c] = (char)(B[i] & 0x000000FF);
       }
      pathinput[c] = 0;
      if(*(a+2) == L0)
       {Ncreat(pathinput);
       }
      else
       {CreateDirectoryA(pathinput,NULL);
       }
      pathinput[subdir] = 0;
      break;
      case 0x00201039: //pereimenovanie
      b = *(a+1) - L0;
      if(b == 0)
       {ist = 0; st = a; return;}
      c = dlinpath + 5;
      for(i = 0; i < b; i++,c++)
       {pathinput[c] = (char)(B[i] & 0x000000FF);
       }
      pathinput[c] = 0;
      c = dlinpath + 5;
      for(i = 0; i < c; i++)
       {C[i] = pathinput[i];}
      f = *(a+2) - L0;
      if(f <= b)
       {ist = 0; st = a; return;}
      for(i = b; i < f; i++,c++)
       {C[c] = (char)(B[i] & 0x000000FF);
       }
      C[c] = 0;
      MoveFileA(pathinput,C);
      pathinput[subdir] = 0;
      break;
      case 0x00200150: // svertka
      b = *(a+1) - L0;
      if(proghndl != 0)
       {Nclose(proghndl);
        proghndl = 0;
       }
      if(infhndl != 0)
       {Nclose(infhndl);
        infhndl = 0;
       }
      if(b == 1)h = pathprog;
      else h = path[nominf-1];
      for(i = dLinpath + 1; i <= Dlinpath; i++)
       h[i] = '0';
      c = 0; r = 0; s = 0; t = 0;
      while(c == 0)
       {f = Dlinpath; s++;
        while(f > dLinpath)
         {w = h[f];
          if(w == '7'){h[f] = '0'; f--;}
          else {h[f] = w + 1; break;}
         }
        k = NGetFileAttributesA(h);
        if(k == 0xFFFFFFFF)c = k;
        else
         {infhndl = Nopen(h);
          f = Npointer(infhndl,0,1);
          Nclose(infhndl);
          infhndl = 0;
          if(f == 0 && t == 0)
           {if(r == 0)r = s;
            DeleteFileA(h);
           }
          else
           {if(r != 0)
             {if(t == 0)t = s-r;
              for(i = 0; i < 60; i++)
               C[i] = h[i];
              m = t;
              while(m != 0)
               {f = Dlinpath;
                while(f > dLinpath)
                 {w = C[f];
                  if(w == '0'){C[f] = '7'; f--;}
                  else {C[f] = w - 1; break;}
                 }
                m--;
               }
              MoveFileA(h,C);
             }
           }
         }
       }
      if(t != 0)
       {t <<= 22; r <<= 22;
        for(i = dLinpath + 1; i <= Dlinpath; i++)
         h[i] = '0';
        U1 = (UINT*)calloc(2097152,1);
        infhndl = Nopen(h);
        Npointer(infhndl,0,0);
        Nread(infhndl,(char*)U1,2097152);
        for(i = 0; i < 524288; i++)
         {m = U1[i];
          n = m & 0x7FC00000;
          if(r <= n)U1[i] -= t;
         }
        Npointer(infhndl,0,0);
		Nwrite(infhndl,(char*)U1,2097152);
        free(U1);
       }
	  break;
      case 0x002006A7: // tekst
      if(inphndl == 0)
       {ist = 0; st = a; return;}
      b = convchisl(*(a+1));
      Npointer(inphndl,b,0);
      d = (unsigned char*)C;
      u = Nread(inphndl,d,3002);
      if(u > 3000)u = 3000;
      c = *(a+2) - L0; // smeshenie nachala v stroke
      p = st;
      *st = *(a+1); st++;
      i = 0; // i - nachalo v C dlja schitivanija
            // ocherednogo fragmenta
      k = *(a+3) - L0; // chislo simvolov v stroke
      m = *(a+4) - L0; // chislo ostavshihsja strok
      j = *(a+5) - L0; // tek. pozicija v bufere tekstov
      while(m != 0)
       {e = i + k;
        t = j + k;
        f = 0xFFFFFFFF; // 0xFFFFFFFF libo smeshenie v
                       // C simvola 0x0A,
                       // zavershivshego stroku
        for(n = i,r = i+c; n < e; n++)
         {if(n < u)
           {g = (UINT)d[n];}
          else
           {g = 0;}
          if(g == 0x0D && f == 0xFFFFFFFF)
           {f = n;
            n++;
            g = (UINT)d[n];
            if(g == 0x0A)f = n;
            break;
           }
          g |= 0x0000F000;
          if(n >= r)
           {B[j] = g; j++;
           }
         }
        while(j < t)
         {B[j] = 0x0000F000;
          j++;
         }
        m--;
        if(m != 0)
         {if(f == 0xFFFFFFFF)
           {v = 0;
            while(v == 0)
             {while(e <= u)
               {g = (UINT)d[e];
                if(g == 0x0D)
                 {f = e;
                  e++;
                  g = (UINT)d[e];
                  if(g == 0x0A)f = e;
                  v = 1;
                  break;
                 }
                e++;
               }
              if(f == 0xFFFFFFFF && u == 3000)
               {b += u;
                Npointer(inphndl,b,0);
                u = Nread(inphndl,d,3002);
                if(u > 3000)u = 3000;
                if(u == 0)
                 {v = 1;}
               }
              else
               {v = 1;}
             }
           }
          if(f != 0xFFFFFFFF)
           {f++;
            if(f + k >= u)
             {b += f;
              Npointer(inphndl,b,0);
              u = Nread(inphndl,d,3002);
              if(u > 3000)u = 3000;
              f = 0;
             }
            i = f;
            r = b + i;
            r = loschisl(r);
            *st = r; st++;
           }
          else
           {i = 0; u = 0;}
         }
       }
      b = text1(p);
      opr(*(a+6),b);
      break;
      case 0x002008F4: // stroki
      if(inphndl == 0)
       {ist = 0; st = a; return;}
      b = convchisl(*(a+1));
      Npointer(inphndl,0,0);
      d = (unsigned char*)IZ;
      u = Nread(inphndl,d,b);
      if(b != 0)
       {d[u] = 0x0D; d[u+1] = 0x0A;
        u += 2;
       }
      j = *(a+2) - L0; // ishodnaja pozicija v
                      // bufere tekstov
      k = *(a+3) - L0; // chislo strok
      m = *(a+4) - L0; // chislo simvolov v stroke
      for(i = 1; i <= k; i++)
       {n = j; v = j + m; v--;
        while(((B[v]& 0x000000FF) == 0x20) && v >= j)
         {v--;}
        while(n <= v)
         {d[u] = (char)(B[n] & 0x000000FF);
          u++; n++;
         }
        d[u] = 0x0D; d[u+1] = 0x0A;
        u += 2;
        j += m;
       }
      h = (char*)d; h += u;
      r = 1480000 - u;
      Npointer(inphndl,b,0);
      v = Nread(inphndl,h,r);
      v += u;
      i = u;
      if(b != 0)k += 1;
      while(k != 0 && i < v)
       {if(d[i] == 0x0D && d[i+1] == 0x0A)
         {k--; i += 2;}
        else
         {i++;}
       }
      while(i < v)
       {d[u] = d[i];
        u++; i++;
       }
      Nclose(inphndl);
      inphndl = Ncreat(pathinput);
      Nwrite(inphndl,reinterpret_cast<LPCCH>(d),u);
      break;
      case 0x002000FB: // polnij
      if(polnij == 0)ist = 0;
      break;
      case 0x0020000E: // perechislenie
      b = *(a+1) - L0;
      c = dlinpath + 5;
      for(i = 0; i < b; i++,c++)
       {pathinput[c] = (char)(B[i] & 0x000000FF);
       }
	  pathinput[c] = '*';
      pathinput[c+1] = 0;
      subdir = c;
	  smdir = INVALID_HANDLE_VALUE;
      break;
      case 0x0020085F: // sm
      b = *(a+1) - L0; g = 0;
      while(g == 0)
	   {if(smdir == INVALID_HANDLE_VALUE)
	     {smdir = FindFirstFileA(pathinput,&files);
	      if(smdir == INVALID_HANDLE_VALUE)
           {ist = 0; st = a; return;}
	     }
	    else
	     {nextfile = FindNextFileA(smdir,&files);
	      if(nextfile == 0)
		   {ist = 0; FindClose(smdir); smdir = INVALID_HANDLE_VALUE;
		    st = a; return;}
	     }
        h = files.cFileName;
        if(!((h[0] == '.' && h[1] == 0) ||
          (h[0] == '.' && h[1] == '.' && h[2] == 0)))g=1;

	   }
	  c = 1; i = 0; f = subdir;
      while(c != 0)
       {w = h[i]; i++;
        pathinput[f] = w; f++;
        if(w == 0)
         {c = 0;}
        else
         {B[b] = (UINT)(w) | 0x0000F000;
          b++;
         }
       }
     b += L0;
     opr(*(a+2),b);
     b = L0;
     c = NGetFileAttributesA(pathinput);
     if(c == FILE_ATTRIBUTE_DIRECTORY)
     b = 0x00200105;
     pathinput[subdir] = 0;
     opr(*(a+3),b);
     break;
     case 0x0020079A: // exempljar
     y = *(a+1);
	 y -= 0x00200104;
	 if(y < 10)
	  {s = '0',
	   s += (unsigned char)y;
	  }
	 else
	  {s = 'a';
	   y -= 10;
	   s += (unsigned char)y;
	  }
     for(i = 1;i < 22;i++)
      {switch(i)
        {case 1: h = pathkat;
         break;
         case 2: h = pathuplotn;
         break;
         case 3: h = pathprog;
	     if(proghndl != 0)
          {Nclose(proghndl);proghndl = 0;}
         break;
         case 4: h = path1;
         break;
         case 5: h = path2;
         break;
         case 6: h = path3;
         break;
         case 7: h = path4;
         break;
         case 8: h = path5;
         break;
         case 9: h = path6;
         break;
         case 10: h = path7;
         break;
         case 11: h = path8;
         break;
         case 12: h = path9;
         break;
         case 13: h = path10;
         break;
         case 14: h = path11;
         break;
         case 15: h = pathvoc;
         break;
         case 16: h = pathslv;
         break;
         case 17: h = path12;
         break;
         case 18: h = path13;
         break;
         case 19: h = path14;
         break;
		 case 20: h = path15;
         break;
		 case 21: h = path16;
		}
	   if(3 <= i && i != 15 && i != 16)
         {h[Dlinpath - 2] = '0';
          h[Dlinpath - 1] = '0'; h[Dlinpath] = '0';
          if(infhndl != 0)
           {Nclose(infhndl);infhndl = 0;}
         }
       b = 0;
       while(b == 0)
        {hndl = Nopen(h);
         if(hndl == INVALID_HANDLE_VALUE)b = 1;
         else
          {c =  Npointer(hndl,0,1);
           U1 = (UINT*)calloc(c,1);
           Npointer(hndl,0,0);
           Nread(hndl,(char*)U1,c);
           Nclose(hndl);
           j = 0;
           while(h[j] != 0)j++;
            j--;
           while(j >= dlinpath)
            {h[j+4] = h[j]; j--;}
             h[dlinpath] = '\\';
             h[dlinpath + 1] = 'e';
             h[dlinpath + 2] = 'x';
             h[dlinpath + 3] = s;
             hndl = Ncreat(h);
             Nwrite(hndl,(char*)U1,c);
             Nclose(hndl);
             free(U1);
             j = dlinpath;
             while(h[j] != 0)
              {h[j] = h[j+4]; j++;}
             if(i < 3 || i == 15 || i == 16)b = 1;
             else
              {j = Dlinpath;
		       while(j > dLinpath)
		        {w = h[j];
                 if(w == '7')
			      {h[j] = '0';j--;}
			     else
			      {h[j] = (char)(w + 1);break;}
		        }
              }
          }
        }
      }
     b = 1;
     while(b != 0)
      {b = NPeekMessage();
       if(b != 0)
        {DefWindowProc(hhwnd,kmsg.message, kmsg.wParam, kmsg.lParam);
	    }
      }
	 break;
	 case 0x00200795: // ishodnij
     if(proghndl != 0)
	  {Nclose(proghndl); proghndl = 0;}
     if(infhndl != 0)
	  {Nclose(infhndl); infhndl = 0;}
     nachl = 1;
	 for(i = 1;i < 23;i++)
      {switch(i)
        {case 1: h = pathkat;
         break;
         case 2: h = pathuplotn;
         break;
         case 3: h = pathprog;
	     break;
         case 4: h = path1;
         break;
         case 5: h = path2;
         break;
         case 6: h = path3;
         break;
         case 7: h = path4;
         break;
         case 8: h = path5;
         break;
         case 9: h = path6;
         break;
         case 10: h = path7;
         break;
         case 11: h = path8;
         break;
         case 12: h = path9;
         break;
         case 13: h = path10;
         break;
         case 14: h = path11;
         break;
         case 15: h = pathvoc;
         break;
         case 16: h = pathslv;
         break;
         case 17: h = path12;
         break;
         case 18: h = path13;
         break;
         case 19: h = path14;
         break;
		 case 20: h = path15;
         break;
		 case 21: h = path16;
		 break;
		 case 22: h = path17;
        }
	   if(3 <= i && i != 15 && i != 16)
        {h[Dlinpath - 2] = '0';
         h[Dlinpath - 1] = '0'; h[Dlinpath] = '0';
        }
       b = DeleteFileA(h);
	   b = 1;
       while(b != 0)
	    {if(i < 3 || i == 15 || i == 16)b = 0;
         else
          {j = Dlinpath;
		   while(j > dLinpath)
		    {w = h[j];
             if(w == '7')
		      {h[j] = '0';j--;}
		     else
		      {h[j] = (char)(w + 1);break;}
		    }
           b = DeleteFileA(h);
          }
        }
	  }
     for(i = 1;i < 23;i++)
      {switch(i)
        {case 1: h = pathkat;
         break;
         case 2: h = pathuplotn;
         break;
         case 3: h = pathprog;
	     break;
         case 4: h = path1;
         break;
         case 5: h = path2;
         break;
         case 6: h = path3;
         break;
         case 7: h = path4;
         break;
         case 8: h = path5;
         break;
         case 9: h = path6;
         break;
         case 10: h = path7;
         break;
         case 11: h = path8;
         break;
         case 12: h = path9;
         break;
         case 13: h = path10;
         break;
         case 14: h = path11;
         break;
         case 15: h = pathvoc;
         break;
         case 16: h = pathslv;
         break;
         case 17: h = path12;
         break;
         case 18: h = path13;
         break;
         case 19: h = path14;
         break;
		 case 20: h = path15;
         break;
		 case 21: h = path16;
		 break;
		 case 22: h = path17;
        }
	   if(3 <= i && i != 15 && i != 16)
        {h[Dlinpath - 2] = '0';
         h[Dlinpath - 1] = '0'; h[Dlinpath] = '0';
        }
       b = 0;
       while(b == 0)
        {j = 0;
         while(h[j] != 0)j++;
         j--;
         while(j >= dlinpath)
          {h[j+5] = h[j]; j--;}
         h[dlinpath] = '\\';
         h[dlinpath + 1] = 'c';
         h[dlinpath + 2] = 'o';
         h[dlinpath + 3] = 'p';
         h[dlinpath + 4] = 'y';
         hndl = Nopen(h);
		 j = dlinpath;
         while(h[j] != 0)
          {h[j] = h[j+5]; j++;}
         if(hndl == INVALID_HANDLE_VALUE)b = 1;
		 else
		  {c =  Npointer(hndl,0,1);
           U1 = (UINT*)calloc(c,1);
           Npointer(hndl,0,0);
           Nread(hndl,(char*)U1,c);
           Nclose(hndl);
           hndl = Ncreat(h);
           Nwrite(hndl,(char*)U1,c);
           Nclose(hndl);
           free(U1);
           if(i < 3 || i == 15 || i == 16)b = 1;
           else
            {j = Dlinpath;
		     while(j > dLinpath)
		      {w = h[j];
               if(w == '7')
		        {h[j] = '0';j--;}
		       else
		        {h[j] = (char)(w + 1);break;}
		      }
		    }
		  }
	    }
      }
	 hndl = Nopen(pathkat);
     Npointer(hndl,0,0);
     Nread(hndl,(char*)K,2097152);
     Nclose(hndl);
	 slovin(0);
     slovin(1);
   	 initsolv();
     break;
     case 0x002012F5: // vlevo
     for(i = 1;i < 26;i++)
      {switch(i)
        {case 1: h = pathkat;
         break;
         case 2: h = pathuplotn;
         break;
         case 3: h = pathprog;
	     if(proghndl != 0)
          {Nclose(proghndl);proghndl = 0;}
         break;
         case 4: h = path1;
         break;
         case 5: h = path2;
         break;
         case 6: h = path3;
         break;
         case 7: h = path4;
         break;
         case 8: h = path5;
         break;
         case 9: h = path6;
         break;
         case 10: h = path7;
         break;
         case 11: h = path8;
         break;
         case 12: h = path9;
         break;
         case 13: h = path10;
         break;
         case 14: h = path11;
         break;
         case 15: h = pathvoc;
         break;
         case 16: h = pathslv;
         break;
         case 17: h = path12;
         break;
         case 18: h = path13;
         break;
         case 19: h = path14;
         break;
		 case 20: h = path15;
         break;
		 case 21: h = path16;
		 break;
		 case 22: h = path17;
		 break;
		 case 23: h = pathcvet;
		 break;
		 case 24: h = pathcvgr;
		 break;
		 case 25: h = pathcvpr;
        }
	   if(3 <= i && i != 15 && i != 16 && i != 23 && i != 24 && i!= 25 && i!= 26)
         {h[Dlinpath - 2] = '0';
          h[Dlinpath - 1] = '0'; h[Dlinpath] = '0';
          if(infhndl != 0)
           {Nclose(infhndl);infhndl = 0;}
         }
       b = 0;
       while(b == 0)
        {hndl = Nopen(h);
         if(hndl == INVALID_HANDLE_VALUE)b = 1;
         else
          {c =  Npointer(hndl,0,1);
           U1 = (UINT*)calloc(c,1);
           Npointer(hndl,0,0);
           Nread(hndl,(char*)U1,c);
           Nclose(hndl);
		   j = 2;
           while(h[j] != 0)
		    {C[j+1] = h[j]; j++;}
           C[j+1] = 0;
		   C[0] = '\\';
		   C[1] = '\\';
		   C[2] = (*(a+1) == L0 ? 'L' : 'M');
		   hndl = Ncreat(C);
           j = Nwrite(hndl,(char*)U1,c);
           Nclose(hndl);
		   free(U1);
           j = dlinpath;
           if(i < 3 || i == 15 || i == 16 || i == 23 || i == 24 || i == 25)b = 1;
           else
            {j = Dlinpath;
		     while(j > dLinpath)
		      {w = h[j];
               if(w == '7')
		        {h[j] = '0';j--;}
		       else
			    {h[j] = (char)(w + 1);break;}
		      }
            }
          }
        }
      }
     break;

	};
    st = a;
    }

   void F179() // PREDOPERAND

   {UINT a,b,c,d;
    a = *(st-1);
    if((a & T6) || (Z[a+1] & T1) || Z[a+1] == 0 ||
        (Z[a+1] >> 16) == 3)
     {tipprer = 7;initprer(1);return;}
    b = a - (Z[a+1] >> 16);
    c = b + 2;d = a;
    while(c < a)
     {d = c;c += (Z[c+1] & 0x0000FFFF);}
    *(st-1) = d;
   }

	void F180()  // RAZRJAD

	{UINT a,b,c;
	  st -= 3;tec++;c = *st;if(c == L3){ist = 0;return;}
     a = *(st+1);
     if(c & T6 || !(Z[c+1] & T1) ||
        (!(a & T6) && (Z[a] & T1)) || !(*(st+2)&T1))
      {tipprer = 7;st += 3;tec--;initprer(1);return;}
	  for(b = *st + 2;!(Z[b] & T1);b += 2)
		 {if(Z[b] == a)
			{cadrprod(13);opr(*(st+2),b);
          if(ind == 4)return;
			 S[lcadr + 9] = b;S[lcadr + 10] = *st;
			 S[lcadr + 11] = *(st+2);S[lcadr + 12] = a;return;
			}
		 }
		ist = 0;
	}

   void F181()  // KLUCH

   {UINT a,b,c,d,e;
	 st -= 3;tec++;e = *st;a = *(st+1);
    if(e == L3){ist = 0;return;}
    if(e & T6 || !(Z[e+1] & T1))
     {tipprer = 7;st += 3;initprer(1);return;}
    for(b = (e + 2),c = Z[b];!(c & T1);b += 2,c = Z[b])
	  {if (!(c & T6) && (Z[c+1] & T1) && sravn(Z[c+2],a))
		 {d = *(st+2);cadrprod(13);opr(d,c);
        if(ind == 4)return;
		  S[lcadr + 9] = b;S[lcadr + 10] = e;
        S[lcadr + 11] = a;
		  S[lcadr + 12] = d;
        return;
		 }
	  }
	 ist = 0;
	}


	void F182()  // POSILKA

	{UINT a,b;
	 st -= 3;tec++;
    b = *(st+2);
    if(b & T6 || !(Z[b+1] & T1) || Z[b+2] < 0x002000F3 ||
       Z[b+2] > 0x002000F6)
     {tipprer = 7;st += 3;tec--;initprer(1);return;}
	 if(!(*st & T1))
		{for(a = Z[b + 4] + 2;!(Z[a] & T1);a += 2)
		   {if((Z[a] == *st) || ravntext(Z[a],*st))
		  	 {opr(*(st+1),a);return;}
			}
       ist = 0;return;
	   }
	 else
     {if(!(*(st+1) & T1))
      {tipprer = 7;st += 3;tec--;initprer(1);return;}
      a = Z[b + 4] + 2;
		cadrprod(13);opr(*st,Z[a]);opr(*(st+1),a);
      if(ind == 4)return;S[lcadr + 9] = a;
		S[lcadr + 10] = a - 2;S[lcadr + 11] = *st;
		S[lcadr + 12] = *(st+1);
	  }
	}

	void F183()  // USLOVIE

	{UINT a,b,c;
	 st -= 3;tec++;c = *(st+2);
    if(c & T6 || !(Z[c+1] & T1) || Z[c+2] < 0x002000F3 ||
       Z[c+2] > 0x002000F5)
     {tipprer = 7;st += 3;tec--;initprer(1);return;}
	 a = Z[c + 2];
	  if(!(*st & T1))
		 {if(a == L5)
		   {for(b = Z[c + 10] + 2;!(Z[b] & T1);b += 2)
			  {if((Z[b] == *st) || ravntext(Z[b],*st))
			 	 {opr(*(st+1),b);return;}
			  } ist = 0;return;
		   }
		  else {b = c + 10;
					 if((Z[b] == *st) || ravntext(Z[b],*st))
						{opr(*(st+1),b);return;}
					 else {ist = 0;return;}
				 }
		 }
	  else
      {if(!(*(st+1) & T1))
        {tipprer = 7;st += 3;tec--;initprer(1);return;}
       if(a == L5)
		  {b = Z[c + 10] + 2;
			cadrprod(13);opr(*st,Z[b]);opr(*(st+1),b);
         if(ind == 4)return; S[lcadr + 9] = b;
			S[lcadr + 10] = b - 2;S[lcadr + 11] = *st;
			S[lcadr + 12] = *(st+1);
		  }
		 else {b = c + 10;opr(*st,Z[b]);opr(*(st+1),b);}
		}
	}

	void F184()  // BIKLUCH

	{UINT a,b,c,d,e,f;
	 st -= 4;tec++;f = *st;
    if(f == L3){ist = 0;return;}
    a = *(st+1);
	 b = *(st+2);
    if(f & T6 || !(Z[f+1] & T1) || !(a & T6) ||
       !(*(st+3) & T1))
    {tipprer = 7;st += 4;tec--;initprer(1);return;}
	 for(c = (f+2),d = Z[c]; !(d & T1);c += 2,d = Z[c])
	   {if(!(d & T6) && Z[d+2] == a && sravn(Z[d+4],b))
		  {e = *(st+3);cadrprod(14);opr(e,d);
         if(ind == 4)return;
			S[lcadr + 9] = c;S[lcadr + 10] = *st;S[lcadr + 11] = a;
			S[lcadr + 12] = b;S[lcadr + 13] = e;return;
		  }
	   }
	 ist = 0;
	}

	void F185()  // PODTERM

	{UINT a,b,c,d;
    b = *(st-1);
    if(b & T6 || Z[b+1] & T1 || Z[b+1] == 0)
     {tipprer = 7;initprer(1);return;}
	 a = mem((Z[b+1] & T4) + 4);
    if(a == 0)return;
	 d = a + Z[a] - 2;
	 for(b = a + 2,c = *(st - 1); b != d;b += 2,c += 2)
	  {Z[b] = Z[c];Z[b+1] = Z[c+1];}
	 Z[a+3] = (Z[a+3] & T4) | 0x00030000; *(st-1) = a;
   }

	void F186()  //  NABOR

	{UINT a,*b,c;
	 st--;a = *st - L0;b  = st - a;
     c = text1(b);
     *st = c;
     st++;
	}

	void F187()  //  RAVNO

	{if(*(st-1) & T1)
    {tipprer = 7;initprer(1);return;}
    st -= 2;if(*st & T1){opr(*st,*(st+1));return;}
	 if(*st == *(st+1))return;
	 if(*st & T6 || *(st+1)&T6 || !(Z[*st+1] & T1) ||
		  !(Z[*(st+1)+1] & T1)) {ist = 0;return;}
	  ist = ravntext(*st,*(st+1));
	}

	void F188() //NOVAJAPOSILKA

	{UINT a,b,c,d;
	 st -= 4;tec++;d = *(st+2);
    if(d & T6 || !(Z[d+1] & T1) || Z[d+2] < 0x002000F3 ||
       Z[d+2] > 0x002000F6 || !(*(st+3) & T6) ||
       !(*(st+1) & T1) || !(*st & T1))
     {tipprer = 7;st += 3;tec--;initprer(1);return;}
    a = Z[d + 6] + 2;
	 for(b = a;!(Z[b] & T1);b += 2)
	  if(Z[b] == *(st+3))
		{c = Z[*(st+2) + 4] + 2 + b - a;
		 cadrprod(15);opr(*st,Z[c]);opr(*(st+1),c);
       if(ind == 4)return;S[lcadr + 9] = c;
		 S[lcadr +10] = b;S[lcadr + 11] = Z[d + 4];
		 S[lcadr + 12] = *st;S[lcadr + 13] = *(st+1);
		 S[lcadr + 14] = *(st+3);return;
	   }
	 ist = 0;
	}

	void F189() // NOVOEUSLOVIE

	{UINT a,b,c,d;
	 st -= 4;tec++;d = *(st+2);
    if(d & T6 || !(Z[d+1] & T1) || Z[d+2] != 0x002000F4 ||
       !(*(st+3) & 0x00200000) || !(*st & T1) ||
       !(*(st+1) & T1))
     {tipprer = 7;st += 3;tec--;initprer(1);return;}
	 a = Z[d + 12] + 2;
	 for(b = a;!(Z[b] & T1);b += 2)
		if(Z[b] == *(st+3))
		  {c = Z[d + 10] + 2 + b - a;
			cadrprod(15);opr(*st,Z[c]);opr(*(st+1),c);
         if(ind == 4)return;
			S[lcadr + 9] = c;S[lcadr + 10] = b;
			S[lcadr + 11] = Z[d + 10];S[lcadr + 12] = *st;
			S[lcadr + 13] = *(st+1);S[lcadr + 14] = *(st+3);
			return;
		  }
	 ist = 0;
	}

	void F190() // OTVET


	{UINT b,c,*d,e,f,g;
	 UINT64 i;
    if(PR[prer] == 19 && blokprer == 0)
     {tipprer = 11; initprer(2);return;}
    if(S[cadr + 2] == 1)
     {if((PR[prer] == 1 || PR[prer] == 2) &&
          PR[prer+1] == cadr && blokprer == 0)
       {tipprer = 9;initprer(2);return;}
      else
      {st--;otvet = *st;ind = 0;tec = 0;}
     }
    else
     {if(PR[prer] == 17 && PR[prer+1] == cadr &&
         blokprer == 0)
       {tipprer = 9;initprer(2);return;}
	  if(PR[prer] == 23 && S[cadr+2] == 3 && S[cadr+6] == 0x002006B7 && blokprer == 0)
	   {tipprer = 9;initprer(2);return;}
      if(smotvet == cadr)
       {smotvet = 3;tipprer = 9;initprer(2);return;}
      if((PR[prer] == 2 || PR[prer] == 17)
          && PR[prer+1] == S[cadr+3])
       {b = S[9]; b = Z[b+8]; b += (Z[b] - 4);
        b = Z[b] + 2;
	     for(c = Z[b];!(c & T1);b += 2,c = Z[b])
	      {if(!(c & T6))
          {if(Z[c+2] == 0x0020038D)
           {e = Z[c+4];
            if(!(e & T6))
             {g = e + Z[e] - 4;
              g = Z[g];
              if(Z[g + 10] == 0x00200104)
               {Z[g+10] = *(st-1);
                 i = step;d = st;
	              if(i == 0)f = L0;
	              else
	               {while(i != 0)
		              {*st = (i % 10) + L0;i /= 10;st++;}
		             if(st == d+1)
		              {st = d;f = *st;}
		             else f = text2(d);

                  }
                Z[g+8] = f;
               }
             }
            break;
           }
          }
         }
       }
      contin();
     }
   }
	void F191() // REZULTAT

	{UINT a,b,*c,d,e,f,g,*p;
	 UINT64 i;
    if(PR[prer] == 17 && PR[prer+1] == cadr &&
       blokprer == 0)
     {tipprer = 9;initprer(2);return;}
    c = st;
	 st--;a = *st - L0;
    if(*tec == 0x00100011)lcadr = S[cadr + 1];
	 b = S[cadr + 4];
	 nomprog = b & T4;A = P[nomprog];
	 fragm = b >> 16;b = S[cadr + 5];
	 tec = A + (b & T4); level = b >> 16;
    suff = A + fragm + A[fragm];
    cadr = S[cadr + 3];
    if((PR[prer] == 2 || PR[prer] == 17)
        && PR[prer+1] == cadr)
     {b = S[9]; b = Z[b+8]; b += (Z[b] - 4);
      b = Z[b] + 2;
	   for(d = Z[b];!(d & T1);b += 2,d = Z[b])
	    {if(!(d & T6))
        {if(Z[d+2] == 0x0020038D)
         {e = Z[d+4];
          if(!(e & T6))
           {g = e + Z[e] - 4;
            g = Z[g];
            if(Z[g + 10] == 0x00200104)
             {p = st-1; b = a; c = st;
              while(b != 0)
               {*st = *p; p -= 2; st++; b -= 2;}
              b = text2(c);
              Z[g+10] = b;
              i = step;c = st;
	           if(i == 0)f = L0;
	            else
	             {while(i != 0)
		            {*st = (i % 10) + L0;i /= 10;st++;}
		           if(st == c+1)
		            {st = c;f = *st;}
		           else f = text2(c);

                }
                Z[g+8] = f;
             }
           }
          break;
         }
        }
       }
     }
    if(a == 2 && *(st-2) == 0x00200104)
     {st -= 2;return;}
	 while(a != 0)
     {st -= 2;
      if(!(*st & 0xC0000000))
       {tipprer = 7;st = c;initprer(1);return;}
      if(*st & T1)
       opr(*st,*(st+1));
      else
       {b = *st & 0x001FFFFF;
        if(Z[b] != 0x0020045B) // log.simvol "neopred"
         {tipprer = 7;st = c;initprer(1);return;}
        Z[b] = *(st+1);
       }
      a -= 2;
     }
	}

	void F193()  //NEIZVESTNAJA

	{UINT a,b,c,d,e;
    e = *(st-1);
    if(e & T6 || !(Z[e+1] & T1) || Z[e+2] < 0x002000F4 ||
       Z[e+2] > 0x002000F6)
    {tipprer = 7;initprer(1);return;}
	  st -= 2; tec++;a = Z[e + 2];
	  b = ((a == L1)? Z[e + 10] : Z[e + 16]);
	  if(b == L3)
      {ist = 0;return;}
	  for(c = b + 2;!(Z[c] & T1);c += 2)
		 if(!(Z[c] & T6) && (d = Z[c] + 2,Z[d] == L12))
		   {if(Z[d+2] & T1)
           {ist = 0;return;}
			 if(*st & T1)
			  {cadrprod(12);opr(*st,Z[d+2]);
            if(ind == 4)return;
				S[lcadr + 9] = d + 2;S[lcadr + 10] = d - 2;
				S[lcadr + 11] = *st;return;
			  }
			 else
           {d += 2;
				while(!(Z[d] & T1))
				 {if(Z[d] == *st)return;d += 2;}
				ist = 0;return;
			  }
		   }
	  ist = 0;
	}

	void F194()  // TIP

	{UINT a;
    a = *(st-2);
    if(a & T6 || !(Z[a+1] & T1) || Z[a+2] < 0x002000F3 ||
        Z[a+2] > 0x002000F6)
     {tipprer = 7;st++;initprer(1);return;}
    if(*(st-1) & T1){opr(*(st-1),Z[a+2]);st -= 2;return;}
	  else
		 if(*(st-1) != Z[a+2])ist = 0;
	  st -= 2;
	}

	void F195()  //  KOMMENT

	{UINT a,*b,c,*d,e;
    d = st;a = *(st-1) - L0;b = st - a;
    st--;e = *(b-1);
    if(e & T6 || !(Z[e+1] & T1) || Z[e+2] < 0x002000F3 ||
       Z[e+2] > 0x002000F5)
     {tipprer = 7;st = d;initprer(1);return;}
    c = Z[e+14];
	  if(Z[e+2] == L5)c = Z[c + (Z[c]-4)];
    ist = cmntr(c,b);st = b-1;
	}

	void F196()  // KOMMENTUSLOVIJA

	{UINT a,*b,c,*d,e,f;
    d = st;a = *(st-1) - L0;b = st - (a-1);
    st--;e = *(b-2);
    if(e & T6 || !(Z[e+1] & T1) || Z[e+2] != 0x002000F4)
     {tipprer = 7;st = d;initprer(1);return;}
    f = Z[e+10];
    c = *(b-1) - f;
    if(c >= Z[f]-2)
     {tipprer = 7;st = d;initprer(1);return;}
	 c += Z[e+14];ist = cmntr(Z[c],b);st = b-2;
	}

	void F197()  // KOMMENTPOSILKI

	{UINT a,*b,c,*d,e,f;
    d = st;a = *(st-1) - L0;b = st - (a-1);
    st--;e = *(b-2);
    if(e & T6 || !(Z[e+1] & T1) || Z[e+2] < 0x002000F3 ||
       Z[e+2] > 0x002000F6)
     {tipprer = 7;st = d;initprer(1);return;}
    f = Z[e+4];
    c = *(b-1) - f;
    if(c >= Z[f]-2)
     {tipprer = 7;st = d;initprer(1);return;}
	 c += Z[e+8];ist = cmntr(Z[c],b);st = b-2;
	}

	void F198()  // VHODIT

	{UINT a;
	 st -= 2; tec++; a = *(st+1);
	 if(a == L3){ist = 0;return;}
    if(a & T6 || !(Z[a+1] & T1))
     {tipprer = 7;st += 2;tec--;initprer(1);return;}
    a += 2;
	 if(*st & T1)
		{cadrprod(12);opr(*st,Z[a]);
       if(ind == 4)return;
		 S[lcadr + 9] = a;S[lcadr + 10] = a - 2;
		 S[lcadr + 11] = *st;
	   }
	 else
     {while(!(Z[a] & T1))
		 {if(sravn(Z[a],*st))return;a += 2;}
		ist = 0;
	  }
	}

	void F199()  //  VKLUCHAETSJA

	{UINT a,b,c;
	 st -= 2;if(*st == L3)return;
    if(*(st+1) == L3)
     {ist = 0;return;}
    if(*st & T6 || !(Z[*st + 1] & T1) || *(st+1) & T6 ||
       !(Z[*(st+1) + 1] & T1))
     {tipprer = 7;st += 2;initprer(1);return;}
	 for(a = *(st+1)+2,b = 0; !(Z[a] & T1);a += 2,b++)
		R[b] = Z[a];
	 for(a = *st + 2;!(Z[a] & T1);a += 2)
		{for(c = 0;c < b;c++)
		 if(R[c] != 0 && sravn(R[c],Z[a]))
        {R[c] = 0;break;}
		 if(c == b)
        {ist = 0;return;}
		}
	}

	void F200()  //  OTVETZADACHI

	{UINT a,b,c,d,e;
    if(blokprer == 0)
    {e = *(st-1);
     if(e & T6 || !(Z[e+1] & T1) || Z[e+2] < 0x002000F3 ||
		 Z[e+2] > 0x002000F6 || Z[e+4] == L3)
     {tipprer = 7;initprer(1);return;}
     a = (uroven == 0 ? tekur() : uroven);b = S[lcadr];
	  if(delta == 1 && b > 14500)
      {ind = 4;tipprer = 2;return;}
     S[b+1] = lcadr;
	  S[b+2] = 1;S[b+3] = cadr;S[b] = b+59;
	  S[b+4] = nomprog | (fragm << 16);
     S[b+5] = (tec - A)|(level << 16);
	  S[b+6] = 0;
     S[b+7] = (((st - T - 1) << 16) | (0x0000FFFF & a));
     uroven = 0;S[b+8] = 14;
     st --;S[b+9] = *st;
	  S[b+10] = 0;S[b+11] = 0;S[b+12] = 0;
     S[b+13] = L0;c = S[b];
	  for(a = b+14;a < c;a++)S[a] = 0;
     d = lcadr;
     while(S[d+2] != 1 && PR[prer+1] != d)d = S[d+1];
     cadr = b;lcadr = b;
     SD[b] = 0;SD[b+1] = 0;SD[b+2] = 0;SD[b+3] = 0;
     if((PR[prer] == 2 || PR[prer] == 17)
        && PR[prer+1] == d)
      {tipprer = 9;st++;initprer(2);return;}
     if(PR[prer] == 19)
      {tipprer = 11;st++;initprer(2);return;}
    }
    else st--;
    ind = 0;
   }

	void F201()  // BLANK

	{UINT a,b,c,d;
    c = *(st-3);
    if((c & T6 && c != L3) || !(*(st-1) & 0x00200000) ||
       (!(c & T6) && !(Z[c+1] & T1)))
     {tipprer = 7;initprer(1);return;}
	 a = (c == L3 ? 4 : Z[c]);
	 a += 2*(*(st-1) - L0);
	 if(a == 4){st -= 2;return;}
	 b = mem(a);if(b == 0)return;c = b + (Z[b] - 2);
	 for(d = b + 2;d < c;d += 2)
	  {Z[d] = *(st-2);Z[d+1] = 0;}
    if(a == 6 && Z[b+2] & T6 && *(st-2) != 0x00200372)Z[b+3] = 0x00030002;
	 *(st-3) = b;st -= 2;
	}

	void F202()  // SPISOKPOSILOK

	{UINT a;
    a = *(st-1);
    if(a & T6 || !(Z[a+1] & T1) || Z[a+2] < 0x002000F3 ||
        Z[a+2] > 0x002000F6)
     {tipprer = 7;initprer(1);return;}
    *(st-1) = Z[a + 4];}

	void F203()  // UDALENIEZAMECHUSLOVIJA

	{UINT a,b,c;
    if(PR[prer] == 2 && S[PR[prer+1]+9] == *(st-3) &&
       blokprer == 0)
      {tipprer = 9;initprer(2);return;}
    else
     {c = *(st-3);
      if(c & T6 || !(Z[c+1] & T1) || Z[c+2] != 0x002000F4)
        {tipprer = 7;initprer(1);return;}
      a = *(st-2) - Z[c+10];
      if(a >= Z[Z[c+10]] - 2)
       {tipprer = 7;initprer(1);return;}
      a += Z[c+14];
		if(Z[a] == L3){st -= 3;return;}*st = a;st++;
		for(b = Z[a] + 2;!(Z[b] & T1);b += 2)
		  {if(sravn(Z[b],*(st-2)))
			  {Z[*(st - 1)] = isklch(Z[*(st - 1)],b);
            st -= 4;return;
           }
		  }
		st -= 4;
     }
	}

	void F204()  // PARAMETRI

	{UINT a,b,c,d;
    b = *(st-1);
	 if(b == L3)return;
    if(b & T6 || !(Z[b+1] & T1))
     {tipprer = 7;initprer(1);return;}
    for(a = 0;a < 16;a++)R[a] = 0;
	 a = Z[b+2];
	 if(a & T6)
     {if(Z[b+3] == 0)
       {tipprer = 7;initprer(1);return;}
      prmter(b);
     }
	 else
    {for(c = b+2;!(Z[c] & T1);c += 2)
      {d = Z[c];
       if(d & T6 || !(Z[d+1] & T1) || Z[d+3] == 0)
        {tipprer = 7;initprer(1);return;}
       prmter(Z[c]);
      }
    }
	 *(st-1) = spskprm();
	}


	void F205()  // KORTEGPEREMENNIH

	{UINT a,b,c,d,e,p,*f;
    e = *(st-1);
	 if(e == L3)
     {st--; *(st-1) = L3; return;}
    if(e & T6 || !(Z[e+1] & T1))
     {tipprer = 7;initprer(1);return;}
	 for(a = 0;a < 16;a++)R[a] = 0;
    f = st;b = Z[e]-4;e = *(st-2);
	 if(e != L3)
	  {if(e & T6 || !(Z[e+1] & T1) || !(Z[e+2] & 0x00400000))
       {tipprer = 7;initprer(1);return;}
      for(c = e+2;!(Z[c] & T1);c += 2)
		if(Z[c] & T7)
		 {d = Z[c] - T8;R[d >> 5] |= (1 << (d & T9));}
     }
	 for(c = 0;c < 16;c++)
	  {if(R[c] != T10)
		 for(d = 1,e = 1; e < 33;d <<= 1,e++)
		   if(!(R[c] & d))
			 {*st = T7 | ((c << 5) + e);st++;b -= 2;
			  if(b == 0)
				{p = text1(f);
				 *(st-2) = p;
				 st--;
				 return;
				}
			 }
	  }
	 ind = 4;tipprer = 4;
	}

	void F206()  // SPISOKPEREMENNIH

	{UINT a,b,c,d;
    c = *(st-1);
    if(c == L3) return;
    if(c & T6 || !(Z[c+1] & T1))
     {tipprer = 7;initprer(1);return;}
	 for(a = 0;a < 16;a++)R[a] = 0;
     a = Z[c+2];
	 if(a & T6)
     {for(a = c+2; !(Z[a] & T1);a += 2)
	     {if(Z[a] & T7)
          {b = Z[a] - T8;R[b >> 5] |= (1 << (b & T9));}
        }
     }
	 else
     {for(d = c+2;!(Z[d] & T1);d += 2)
       {c = Z[d];
        if(!(c & T6))
         {for(a = c+2; !(Z[a] & T1);a += 2)
	        {if(Z[a] & T7)
            {b = Z[a] - T8;R[b >> 5] |= (1 << (b & T9));}
	        }
         }
       }
     }
	 *(st-1) = spskprm();
	}

	void F207()  // SVOBVHOGDENIE

	{UINT a;
    a = *(st-1);
    if(a & T6 || Z[a+1] & T1 || Z[a+1] == 0)
     {tipprer = 7;initprer(1);return;}
    ist = svbvhg(a);st--;
   }


	void F208()  // NABOROPERANDOV

	{UINT *a,b,c,d,e,f,g;
    g = *(st-1);
    if(g & T6 || Z[g+1] & T1 || Z[g+1] == 0)
     {tipprer = 7;initprer(1);return;}
	 if((Z[g+1] & T4) == 2)
     {*(st-1) = L3;return;}
	 a = st;b = g;
	 for(c = b + 2;c - (Z[c+1] >> 16) == b;c += (Z[c+1] & T4))
	   {d = Z[c+1] & T4;e = mem(d + 4);
       if(e == 0)return;
       d += c;
		 for(f = c,g = e + 2; f < d;f++,g++)Z[g] = Z[f];
		 Z[e+3] = (0x00030000 | (Z[e+3] & T4));
       *st = e;st++;
	  }
	 *(a-1) = text1(a);
	}

   void F209() // MASSIV
    {opr(*(st-1),jMT + L0); st--;}

	void F210()  // MINUS

	{UINT *a,b,c,d;
	 a = st;
    b = *(st-1);
	 if((b & T6 && (b < 0x00200104 || b > 0x0020010D))||
       (!(b & T6) && (!(Z[b+1] & T1) ||
        ((Z[b+2] != 0x002000D2 && (Z[b+2] < 0x00200104 ||
        Z[b+2] >0x0020010D))))))
     {tipprer = 7;initprer(1);return;}
    if(b & T6)
		{if(b == L0)
		  {*(st-1) = L0;return;}
		 *a = L8;*(a+1) = b;st += 2;
		  d = text1(a);
         *(st-1) = d;return;
		}
	 else
		{if(Z[b+2] == L8)c = b + 4;
		 else {*st = L8;c = b + 2;st++;}
		 while(!(Z[c] & T1))
		  {*st = Z[c];
		    st++;
		    c += 2;}
		 if(st-1 == a){st--;
		 *(st-1) = *st;}
		 else
         {d = text1(a);
          *(st-1) = d;
         }
		}
	}

	void F211()  // MENSHE

	{UINT a,b,c,d;
     a = *(st-2);b = *(st-1);
	  if((a & T6 && (a < 0x00200104 || a > 0x0020010D))||
       (!(a & T6) && (!(Z[a+1] & T1) ||
        ((Z[a+2] != 0x002000D2 && (Z[a+2] < 0x00200104 ||
        Z[a+2] >0x0020010D)))))||
        (b & T6 && (b < 0x00200104 || b > 0x0020010D))||
       (!(b & T6) && (!(Z[b+1] & T1) ||
        ((Z[b+2] != 0x002000D2 && (Z[b+2] < 0x00200104 ||
        Z[b+2] >0x0020010D))))))
      {tipprer = 7;initprer(1);return;}
     c = ((!(a & T6) && Z[a + 2] == L8)? 1 : 0);
	  d = ((!(b & T6) && Z[b + 2] == L8)? 1 : 0);
	  if(c < d)
      {ist = 0;st -= 2;return;}
	  if(c > d)
      {st -= 2;return;}
	  if(c == 0)
      {ist = sravnmod(a,b);st -= 2;return;}
	  ist = sravnmod(b,a);st -= 2;
	}

	void F212() // BLOCKDELENIJA

	{UINT a,b,c,d,e,f;
	 st -= 4;a = *st;
	 if(a & T6)
    {b = a - L0;
     if(b > 9)
      {tipprer = 7;st += 4;initprer(1);return;}
    }
	 else
     {if(!(Z[a+1] & T1) || Z[a+3] != 0)
       {tipprer = 7;st += 4;initprer(1);return;}
      b = 0;a += 2;
		while(!(Z[a] & T1))
		 {b = (10*b + (Z[a] - L0));a += 2;
		  if(b > 65530)
         {ist = 0;return;}
		 }
	  }
	 a = *(st+1);
	 if(a & T6)
     {c = a - L0;
      if(c == 0)
       {tipprer = 7;st += 4;initprer(1);return;}
     }
	 else
     {if(!(Z[a+1] & T1) || Z[a+3] != 0)
       {tipprer = 7;st += 4;initprer(1);return;}
      c = 0;a += 2;
		while(!(Z[a] & T1))
		 {c = (10*c + (Z[a] - L0));a += 2;
		  if(c > 65530)
         {ist = 0;return;}
		 }
	  }
	 a = *(st+2);d = *(st+3);e = b/c;f = b%c;
	 e = nomer(e);f = nomer(f);
	 opr(a,e);opr(d,f);
	}

	void F213()  // TIPDANNIH

	{UINT a;
	 a = *(st - 1);
	 if(a & T6)
     {*(st - 1) = L0;return;}
	 if(Z[a+1] & T1)
	  {if(Z[a+2] & 0x40000000)
       {*(st - 1) = 0x00200109; return;}
      else
       {if(Z[a+3] == 0)
         {*(st - 1) = 0x00200108;return;}
        else
         {*(st - 1) = L7;return;}
       }
	  }
	 if(Z[a] == 0)
     {*(st - 1) = 0x00200107;return;}
	 *(st - 1) = 0x00200106;
	}

	void F214() // TEST

	{st--;
     }

   void F215()  // FORMBLOK

   {UINT *a,b,c,d,e,f,g,h,p,q,i,r,s;
    st--;a = st - (*st - L0);
	 switch(*a)
	 {case 0x00200105: // 1 - poisk nignej stroki
     b = *(a+1);
     c = Z[b+8]; // nakopitel nomera nignej stroki
     R[1] = b;d = 1;
     while(d != 0)
      {b = R[d];
       if(b != *(a+2))
        {e = Z[b+8];f = Z[b+10];
         if(f != 0x00200104)
          {g = Z[f+2] - L0;
           e += g;
           h = Z[f+4];
           if(h != 0x00200104)e = Z[h+4] + g;
          }
         if(e > c)c = e;
         switch(Z[b+2])
          {case 0x00200106:
           e = Z[b+12]+2;
           while(f = Z[e],!(f & T1))
            {if(f != 0x00200104)
              {g = Z[f+4];if(g > c)c = g;}
             e += 2;
            }
           break;
           case 0x00200105:
           e = Z[b+12];f = Z[e+2];g = Z[f+4];
           if(g > c) c = g;
           break;
           case 0x00200107:
           e = Z[b+12];
           if(e != L3)
            {f = Z[e+4];if(f > c)c = f;}
           break;
          }
         e = Z[b+14];
         if(e == L3)d--;
         else
          {e += 2;
           while(f = Z[e],!(f & T1))
            {R[d] = f;e += 2;d++;}
           d--;
          }
        }
       else d--;
      }
     opr(*(a+3),c);
     break;
     case 0x00200106: // 2 - sdvig formuli
     b = *(a+1);
     if(Z[b+2] != 0x00200104)
      c = Z[b+4] - L0;
     else c = L0 - Z[b+4];
     b = *(a+2);
     if(Z[b+2] != 0x00200104)
      d = Z[b+4] - L0;
     else d = L0 - Z[b+4];
     e = 1;R[1] = *(a+4);
     while(e != 0)
      {f = R[e];Z[f+6] += c;g = Z[f+8] + d;
       if(g > *(a+3)){st = a;ist = 0;return;}
       Z[f+8] = g;
       g = Z[f+10];
       if(g != 0x00200104 && (h = Z[g+4],h != 0x00200104))
        {Z[h+2] += c;p = Z[h+4] + d;
         if(p > *(a+3)) {st = a;ist = 0;return;}
         Z[h+4] = p;
        }
       switch(Z[f+2])
       {case 0x00200106:
        g = Z[f+12]+2;
         while(p = Z[g],!(p & T1))
          {if(p != 0x00200104)
            {Z[p+2] += c;q = Z[p+4] + d;
             if(q > *(a+3)){st = a;ist = 0;return;}
             Z[p+4] = q;
            }
           g += 2;
          }
        break;
        case 0x00200105:
        g = Z[Z[f+12]+2];
        Z[g+2] += c;p = Z[g+4] + d;
        if(p > *(a+3)) {st = a;ist = 0;return;}
        Z[g+4] = p;
        break;
        case 0x00200107:
        g = Z[f+12];
        if(g != L3)
        {Z[g + 2] += c;p = Z[g+4] + d;
         if(p > *(a+3)) {st = a;ist = 0;return;}
         Z[g+4] = p;
        }
        break;
       }
       g = Z[f+14];
        if(g == L3)e--;
        else
         {g += 2;
          while(p = Z[g],!(p & T1))
           {R[e] = p;g += 2;e++;}
          e--;
         }
      }
     break;
     case 0x00200107: // 3 - poisk verhnej stroki
     b = *(a+1);
     c = Z[b+8];
     d = 1;R[1] = b;
     while(d != 0)
     {b = R[d];e = Z[b+8];f = Z[b+10];
      if(f != 0x00200104){g = Z[f+2] - L0;e -= g;}
      else
       {if(Z[b+2] == 0x00200105 &&
         (Z[b+4] == 0x0020007D || Z[b+4] == 0x00200400))
             //  korenb                kvadrkorenb
         {g = Z[b+12];h = Z[Z[g+4]+2];e -= (h - L0);}
       }
      if(e < c)
      c = e;
      g = Z[b+14];
      if(g == L3)d--;
      else
       {g += 2;
        while(p = Z[g],!(p & T1))
         {R[d] = p;g += 2;d++;}
        d--;
       }
     }
     opr(*(a+2),c);
     break;
     case 0x00200108: // 4 - udlinenie cepi ukazatelej
                      // dlja infiksnoj operacii
     b = *(a+1);*st = b;st++;
     g = *(a+2);
     r = Z[g+4];s = Z[g+8];
     if(Z[b] != 6 && *(a+5) == 0x00200105)
      {c = Z[b+4];*st = c;st++;d = Z[c+4];
       if((s == 0x00200194 &&
          (d == 0x0020016C || d == 0x002000BA))||
          (s != 0x002000D2 && s == d) ||
          (s == 0x002000D2 && d == 0x00200099) ||
          (s == 0x0020018E &&
          (d == 0x0020018E || d == 0x0020000A)))
       {f = mem(8);if(ind == 4){st = a;return;}
        Z[f+2] = *(a+3) - 8*(r - L0);
        Z[f+3] = 0;
        Z[f+4] = *(a+4);
        Z[f+5] = 0;
        g = sffx(Z[*(st-1)+12],f);
        if(ind == 4){st = a;return;}
        Z[*(st-1)+12] = g;
        f = mem(18);if(ind == 4){st = a;return;}
        Z[f+2] = 0x00200104;
        Z[f+3] = 0;
        Z[f+4] = 0x00200104;
        Z[f+5] = 0;
        Z[f+6] = *(a+3);
        Z[f+7] = 0;
        Z[f+8] = *(a+4);
        Z[f+9] = 0;
        Z[f+10] = 0x00200104;
        Z[f+11] = 0;
        Z[f+12] = L3;
        Z[f+13] = 0;
        Z[f+14] = L3;
        Z[f+15] = 0;
        *st = f;st++;
        if(s == 0x002000D2) // minus
         {g = mem(8);if(ind == 4){st = a;return;}
          Z[g+2] = *(a+3) - 8;
          Z[g+3] = 0;
          Z[g+4] = *(a+4);
          Z[g+5] = 0;
          *st = g;st++;
          g = mem(8);if(ind == 4){st = a;return;}
          Z[g+2] = *(st-1);
          Z[g+3] = 0;
          st--;Z[g+4] = 0x00200104;
          Z[g+5] = 0;
          *st = g;st++;
          g = mem(6);if(ind == 4){st = a;return;}
          Z[g+2] = *(st-2);Z[g+3] = 0;
          *st = g;st++;
          g = mem(18);if(ind == 4){st = a;return;}
          st--;
          Z[g+2] = 0x00200105;
          Z[g+3] = 0;
          Z[g+4] = 0x002000D2;
          Z[g+5] = 0;
          Z[g+6] = *(a+3) - 8;
          Z[g+7] = 0;
          Z[g+8] = *(a+4);
          Z[g+9] = 0;
          Z[g+10] = 0x00200104;
          Z[g+11] = 0;
          Z[g+12] = *(st-1);
          Z[g+13] = 0;
          Z[g+14] = *st;
          Z[g+15] = 0;
          st--;*(st-1) = g;
         }
        f = sffx(Z[*(st-2)+14],*(st-1));
        if(ind == 4){st = a;return;}
        Z[*(st-2)+14] = f;
        g = *(st-3);Z[g+2] = *(st-1);
        if(ind == 4){st = a;return;}
        if(s == 0x002000D2)
        {h = Z[*(st-1)+14];
         g = prfx(Z[h+2],g);
         if(ind == 4){st = a;return;}
        }
        opr(*(a+6),0x00200104);
        opr(*(a+7),g);st = a;return;
       }
       st--;
      }
     if(s == 0x002001e1 || s == 0x002001B5 ||
        s == 0x0020043C || s == 0x0020015D ||
        s == 0x00200196 || s == 0x002002A4 ||
        s == 0x0020019C || s == 0x002004EC ||
        s == 0x002001DD || s == 0x00200187 ||
        s == 0x0020023F || s == 0x00200165 ||
        s == 0x002008FB
        )
      {i = 0x00200107;*st = 0;st++;}
     else
      {i = 0x00200106;
       f = mem(18);if(ind == 4){st = a;return;}
       Z[f+2] = 0x00200104;
       Z[f+3] = 0;
       Z[f+4] = 0x00200104;
       Z[f+5] = 0;
       Z[f+6] = *(a+3);
       Z[f+7] = 0;
       Z[f+8] = *(a+4);
       Z[f+9] = 0;
       Z[f+10] = 0x00200104;
       Z[f+11] = 0;
       Z[f+12] = L3;
       Z[f+13] = 0;
       Z[f+14] = L3;
       Z[f+15] = 0;
       *st = f;st++;
      }
     if(s == 0x002000D2) // minus
      {g = mem(8);if(ind == 4){st = a;return;}
       Z[g+2] = *(a+3) - 8;
       Z[g+3] = 0;
       Z[g+4] = *(a+4);
       Z[g+5] = 0;
       *st = g;st++;
       g = mem(8);if(ind == 4){st = a;return;}
       Z[g+2] = *(st-1);
       Z[g+3] = 0;
       st--;Z[g+4] = 0x00200104;
       Z[g+5] = 0;
       *st = g;st++;
       g = mem(6);if(ind == 4){st = a;return;}
       Z[g+2] = *(st-2);
       Z[g+3] = 0;
       *st = g;st++;
       g = mem(18);if(ind == 4){st = a;return;}
       st--;
       Z[g+2] = 0x00200105;
       Z[g+3] = 0;
       Z[g+4] = 0x002000D2;
       Z[g+5] = 0;
       Z[g+6] = *(a+3) - 8;
       Z[g+7] = 0;
       Z[g+8] = *(a+4);
       Z[g+9] = 0;
       Z[g+10] = 0x00200104;
       Z[g+11] = 0;
       Z[g+12] = *(st-1);
       Z[g+13] = 0;
       Z[g+14] = *st;
       Z[g+15] = 0;
       st--;*(st-1) = g;
      }
     if(s == 0x0020009B)
      {f = Z[*(st-2)+2];g = Z[f+4];
       if(g == 0x002000D2 && Z[f+10] == 0x00200104)
        {g = Z[f+14];
         f = prfx(Z[g+2],*(st-2));
         if(ind == 4){st = a;return;}
         *(st-2) = f;
        }
      }
     f = mem(8);if(ind == 4){st = a;return;}
     Z[f+2] = *(a+3) - 8*(r - L0);
     Z[f+3] = 0;
     Z[f+4] = *(a+4);
     Z[f+5] = 0;
     *st = f;st++;
     if(*(st-2) != 0)
      {f = mem(8);if(ind == 4){st = a;return;}
       Z[f+2] = 0x00200104;
       Z[f+3] = 0;
       Z[f+4] = *(st-1);
       Z[f+5] = 0;
       *(st-1) = f;
      }
     if(*(st-2) == 0)
      {g = mem(6);if(ind == 4){st = a;return;}
       Z[g+2] = Z[*(st-3)+2];Z[g+3] = 0;
       *st = g;st++;
      }
     else
      {g = mem(8);if(ind == 4){st = a;return;}
       Z[g+2] = Z[*(st-3)+2];
       Z[g+3] = 0;
       Z[g+4] = *(st-2);
       Z[g+5] = 0;
       *st = g;st++;
      }
     g = mem(18);if(ind == 4){st = a;return;}
     Z[g+2] = i;
     Z[g+3] = 0;
     Z[g+4] = (s == 0x002000D2 ? 0x00200099 :
              (s == 0x00200194 ? 0x002000BA : s));
     Z[g+5] = 0;
     h = Z[*(st-4)+2];
     Z[g+6] = Z[h+6];
     Z[g+7] = 0;
     Z[g+8] = Z[h+8];
     Z[g+9] = 0;
     Z[g+10] = 0x00200104;
     Z[g+11] = 0;
     Z[g+12] = *(st-2);
     Z[g+13] = 0;
     Z[g+14] = *(st-1);
     Z[g+15] = 0;
     if(Z[*(st-4)] != 6)
      {h = Z[*(st-4)+4];
       h = Z[h+14];
       Z[h + (Z[h] - 4)] = g;
      }
     *(st-3) = g;st -= 2;
     f = *(st-2);Z[f+2] = g;
     if(ind == 4){st = a;return;}
     if(i == 0x00200106)
      {g = Z[*(st-1)+14];
       g = Z[g + (Z[g] - 4)];
       f = prfx(g,*(st-2));
       if(ind == 4){st = a;return;}
       *(st-2) = f;
       if(s == 0x002000D2)
        {g = Z[*(st-2)+2];
         g = Z[g+14];
         f = prfx(Z[g+2],*(st-2));
         if(ind == 4){st = a;return;}
         *(st-2) = f;
        }
      }
     opr(*(a+7),*(st-2));
     opr(*(a+6),(i == 0x00200107 ?
                 0x00200105 : 0x00200104));
     break;
     case 0x00200109: // 5 - udlinenie cepi ukazatelej dlja
                      // prefiksnoj operacii
     c = *(a+2);s = Z[c+8];
     d = Z[*(a+1)+2];*st = d;st++;
     Z[d+4] = s;Z[d+2] = 0x00200105;
     e = *(a+4) + (*(a+5) - L0);
     f = mem(8);if(ind == 4){st = a;return;}
     Z[f+2] = *(a+7);
     Z[f+3] = 0;
     Z[f+4] = e;
     Z[f+5] = 0;
     *st = f;st++;
     f = mem(8);if(ind == 4){st = a;return;}
     Z[f+2] = *(st-1);
     Z[f+3] = 0;
     st--;Z[f+4] = *(a+6);
     Z[f+5] = 0;
     d = *(st-1);Z[d+12] = f;Z[d+6] = *(a+7);
     Z[d+8] = e;
     f = mem(18);if(ind == 4){st = a;return;}
     Z[f+2] = 0x00200104;
     Z[f+3] = 0;
     Z[f+4] = 0x00200104;
     Z[f+5] = 0;
     Z[f+6] = *(a+3);
     Z[f+7] = 0;
     Z[f+8] = *(a+4);
     Z[f+9] = 0;
     Z[f+10] = 0x00200104;
     Z[f+11] = 0;
     Z[f+12] = L3;
     Z[f+13] = 0;
     Z[f+14] = L3;
     Z[f+15] = 0;
     *st = f;st++;
     f = mem(6);if(ind == 4){st = a;return;}
     Z[f+2] = *(st-1);Z[f+3] = 0;
     Z[*(st-2) + 14] = f;
     f = prfx(*(st-1),*(a+1));
     if(ind == 4){st = a;return;}
     opr(*(a+8),f);
     break;
     case 0x0020010A: // 6 - peremennaja
     if(*(a+2) == 0x00200104 || Z[*(a+2)+2] == 0x0020010D)
      Z[*(a+3)+2] = 0x0020010A;
     else Z[*(a+3)+2] = 0x00200105;
     if(*(a+2) == 0x00200104)
      {Z[*(a+3)+4] = *(a+1);
       Z[*(a+3)+6] = *(a+4) - 8;
      }
     else
      {Z[*(a+3)+4] = Z[*(a+2)+8];
       Z[*(a+3)+6] = *(a+4) - 8*(Z[*(a+2)+4] - L0);
      }
     Z[*(a+3)+8] = *(a+5);
     if(Z[*(a+3)+2] != 0x0020010A)
      {d = mem(8);if(ind == 4){st = a;return;}
       Z[d+2] = Z[*(a+3)+6];
       Z[d+3] = 0;
       Z[d+4] = *(a+5);
       Z[d+5] = 0;
       *st = d;st++;
       d = mem(8);if(ind == 4){st = a;return;}
       Z[d+2] = *(st-1);
       Z[d+3] = 0;
       st--;Z[d+4] = 0x00200104;
       Z[d+5] = 0;
       Z[*(a+3)+12] = d;
      }
     break;
     case 0x0020010B: // 7 - dorisovka goriz.otrezkov
     b = 0x00200104;
     *st = L3;st++;
     if(*(a+3) != 0x00200241)
      {c = *(a+1) + 4;
       while(!(Z[c] & T1))
       {d = Z[c];
        if(Z[d+2] != 0x0020010A)
        switch(Z[d+4])
         {case 0x00200199: // drob
          e = Z[d+12];g = Z[e+4];
          q = Z[d+6] + (Z[g+2] - L0);
          if(q >= *(a+4))
          {opr(*(a+2),*(st-1));opr(*(a+5),b);
           st = a;return;
          }
          Z[g+2] += (*(a+4) - q);*st = c;st++;
          f = mem(12);if(ind == 4){st = a;return;}
          Z[f+2] = q-1;
          Z[f+3] = 0;
          Z[f+4] = Z[d+8]+8;
          Z[f+5] = 0;
          Z[f+6] = *(a+4)-1;
          Z[f+7] = 0;
          Z[f+8] = Z[d+8]+8;
          Z[f+9] = 0;
          g = sffx(*(st-2),f);
          if(ind == 4){st = a;return;}
          c = *(st-1);st--;
          *(st-1) = g;
          break;
          case 0x0020007D: //koren
          case 0x00200400: //kvadrkoren
          e = Z[d+12];g = Z[e+4];
          h = (Z[g+8] - L0) + 8;
          p = Z[g+2] - L0;
          if(Z[d+4] == 0x0020007D) h += 8;
          q = Z[d+6] + h;
          if(q >= *(a+4))break;
          Z[g+8] += (*(a+4) - q);
          *st = c;st++;
          f = mem(12);if(ind == 4){st = a;return;}
          Z[f+2] = q;
          Z[f+3] = 0;
          Z[f+4] = Z[d+8] - p;
          Z[f+5] = 0;
          Z[f+6] = *(a+4);
          Z[f+7] = 0;
          Z[f+8] = Z[d+8] - p;
          Z[f+9] = 0;
          g = sffx(*(st-2),f);
          if(ind == 4){st = a;return;}
          c = *(st-1);st--;
          *(st-1) = g;
          break;
          case 0x0020000F: // summavseh
          case 0x002004EA: // proizvedenievseh
          case 0x00200284: // ob'edinenievseh
          case 0x00200280: // peresechenievseh
          case 0x002004F7: // konjunkcijavseh
          case 0x002004F8: // dizjunkcijavseh
          b = 0x00200105;
          break;
         }
        c += 2;
       }
      }
     opr(*(a+2),*(st-1));opr(*(a+5),b);
     break;
     case 0x0020010E: // десять
     b = Z[*(a+2)+8];
     Z[*(a+1)+2] = 0x00200105;
     Z[*(a+1)+4] = b;
     Z[*(a+1)+6] = *(a+4) - 8;
     Z[*(a+1)+8] = *(a+3);
     f = mem(8);if(ind == 4){st = a;return;}
     Z[f+2] = *(a+4) - 8;
     Z[f+3] = 0;
     Z[f+4] = *(a+3);
     Z[f+5] = 0;
     *st = f;st++;
     g = mem(8);if(ind == 4){st = a;return;}
     Z[g+2] = *(st-1);
     Z[g+3] = 0;
     Z[g+4] = 0x00200104;
     Z[g+5] = 0;
     Z[*(a+1)+12] = g;
     break;
    }
    st = a;
   }

	void F216()  // KOMMENTPOSILOK

	{UINT a,*b,c,e;
	 a = *(st-1) - L0;b = st - a;
    st--;e = *(b-1);
    if(e & T6 || !(Z[e+1] & T1) || Z[e+2] < 0x002000F3 ||
       Z[e+2] > 0x002000F6)
     {tipprer = 7;st ++;initprer(1);return;}
    c = Z[e+8];c += (Z[c]-4);
	 ist = cmntr(Z[c],b);st = b-1;
	}

   void F217() // SMPRER

  	{if((PR[prer] == 2 || PR[prer] == 17) &&
        PR[prer+1] == S[cadr+3]&&
        blokprer == 0)
      {tipprer = 9;initprer(2);return;}
   }

   void F218()  // POISKSLOVA

   {UINT b,c;
    st -= 3;tec++;
    b = (*st) - 0x00200104;
    B1 = 0;B2 = 524287;B3 = 1;B7 = 24;
	c = sledslovo(b);
    if(c == 0)
     {ist = 0;return;}
    opr(*(st+1),c);
    opr(*(st+2),B5 + 0x00200104);
    cadrprod(17);
    S[lcadr + 9] = (*st); // ishodnaja pozicia v bufere
                            // tekstov
    S[lcadr + 10] = 0x00200000 | B1; // nachalo otrezka
    S[lcadr + 11] = 0x00200000 | B2; // konec otrezka
	S[lcadr + 12] = 0x00200000 | B3; // nignjaja granica
                                      // prodolgenija
    S[lcadr + 13] = 0x00200000 | B4; // chislo sravni-
                                      // vaemih pri prodol-
                                      // genii razrjadov
    S[lcadr + 14] = *(st+1); // vihodnaja peremennaja
    S[lcadr + 15] = *(st+2); // vihodnaja peremennaja
    S[lcadr + 16] = 0x00200000 | B7; // chislo sravnivaemih
                            // razrjadov dlja tek.otrezka
    return;
   }

   void F219()  // OBRIVZADACHI

   {UINT a,b,c,d;
    a = *(st-1);
    b = cadr;
    while(S[b+2] != 1 || (S[b + 9] != a && b != 0))
     b = S[b+1];
    if(b != 0)
     {cadr = b;
      b = prer;
      c = 0;
      while(c == 0)
       {if(PR[b+1] >= cadr)
         {for(d = b;d < prer + 7;d++)PR[d] = 0;
          prer = (b == 0 ? 0 : b - 6);
         }
        if(b == 0)c = 1;
        else b -= 7;
       }
      st =  T + (S[cadr+7] >> 16);
      otvet = L6;ind = 0;tec = 0;
     }

   }

   void F220()  // KARANDASH
    {UINT a;
     st -= 3; a = *st;
     ris1 = Z[a+2];ris2 = Z[a+4];
     ris3 = Z[a+6];ris4 = Z[a+8];
     ris5 = *(st+1);
     ris6 = *(st+2);
     input = 3;
     risx = mousex;
     risy = mousey;
     ind =2;
    }

   void F221() // VNESHOTVET

   {UINT a;
    a = cadr;
	while(S[a+2] != 3)
     {a = S[a+3];}
	*st = S[a+9]; st++;
	cadr = a;
	contin();
   }

  void F222() // IZOBRAGENIE

   {UINT *a,b,d,i,j,k,n,*f,*f1,*f2,*f3,h,p,q1,q2,q3,q4,q5,q6,q7,r,t,t1,t2,t3;
    char c,*g;
    unsigned char s;
    int m;
	HANDLE e;
	 st--; a = st - (*st - L0);
	 switch(*a)
	{case 0x00200339: // prjamougolnik
     b = *(a+1);
     b = convchisl(b);
     for(i = Dlinpath + 2; Dlinpath - 1 < i; i--)
      {d = b%10;
       b /= 10;
       c = (char)d;
       c += '0';
       izobrag[i] = c;
      }
     e = Nopen(izobrag);
      Npointer(e,0,0);
	  Nread(e,C,60);
     g = C + 18;
     f = (UINT*)g;
     p = f[0]; // p - shirina bitmap'a
     q3 = p;
	 p *= 3;
	 h = f[1]; // h - visota bitmap'a
     g = C + 10;
     f = (UINT*)g;
     i = f[0]; // i - smeshenie nachala bitmap'a v faile
     q1 = h-1;
	 q4 = p % 4;
	 q5 = p;
	 if(q4 != 0)
	  {q5 += 4; q5 -= q4;}
	 q2 = q1*q5;
	 q2 += i;
	 g = IZ;
     for(i = 0; i < h; i++)
     {Npointer(e,q2,0);
      Nread(e,g,p);
      g += p;
      q2 -= q5;
     }
     Nclose(e);
     i = q3 * h;
     j = 3*i; i *= 4;
     while(i != 0)
     {i -= 4;j -= 3;
      IZ[i] = IZ[j];
      IZ[i+1] = IZ[j+1];
      IZ[i+2] = IZ[j+2];
      s = (unsigned char)IZ[i];
      t1 = (UINT)s;
      s = (unsigned char)IZ[i+1];
      t2 = (UINT)s;
      s = (unsigned char)IZ[i+2];
	  t3 = (UINT)s;
	  t = (114 * t1) + (587 * t2) + (299 * t3);
	  t /= 1000;
      IZ[i+3] = (unsigned char)t;
     }
     q1 = L0+q3;
	 opr(*(a+2),q1);
	 q2 = L0+h;
	 opr(*(a+3),q2);
	 oblshirina = q3;
	 oblvisota = h;
     break;
     case 0x0020009F: // video
     q1 = *(a+1);
     q2 = *(a+2);
     q3 = *(a+3);
     q4 = *(a+4);
     q3 -= q1;
     q3++;
     q4 -= q2;
     q4++;
     q1 -= L0;
     q2 -= L0;
	 if(indparal == 0)
	  {hdc = NGetDC(hhwnd);hdcm = NCreateCompatibleDC(hdc);
	   hbmp = NCreateBitmap(q3,q4,1,32,IZ);
       hbmpold = (HBITMAP)NSelectObject(hdcm,hbmp);
	   NBitBlt(hdc,q1,q2,q3,q4,hdcm,0,0,0);
	   NSelectObject(hdcm,hbmpold);
	   NDeleteObject(hbmp);
	   NDeleteDC(hdcm);
	   NReleaseDC(hhwnd,hdc);
	  }
     break;
	 case 0x0020085F: // sm
     q1 = *(a+1);
     q2 = *(a+2);
     q3 = *(a+3);
     q4 = *(a+4);
	 q5 = *(a+5);
	 g = (q5 == 0x00200105 ? (char*)OBL1 : (char*)OBL2);
	 q3 -= q1;
     q3++;
     q4 -= q2;
     q4++;
     q1 -= L0;
     q2 -= L0;
	 if(indparal == 0)
	  {hdc = NGetDC(hhwnd);hdcm = NCreateCompatibleDC(hdc);
	   hbmp = NCreateBitmap(q3,q4,1,32,g);
       hbmpold = (HBITMAP)NSelectObject(hdcm,hbmp);
	   NBitBlt(hdc,q1,q2,q3,q4,hdcm,0,0,0);
	   NSelectObject(hdcm,hbmpold);
	   NDeleteObject(hbmp);
	   NDeleteDC(hdcm);
	   NReleaseDC(hhwnd,hdc);
	  }
     break;
	 case 0x002002FD: // kvadrat
     q1 = *(a+1);
     q2 = *(a+2);
     q3 = *(a+3);
     q4 = *(a+4); q4 -= L0;
	 q5 = *(a+5); q5 -= L0;
	 q6 = *(a+6); q6 -= L0;
	 g = (char*)R;
	 q1 -= L0;
	 q2 -= L0; q2 <<= 8;
	 q3 -= L0; q3 <<= 16;
	 t = q1 | q2;
	 t |= q3;
	 t1 = (q6 *q6);
	 for(i = 0; i < t1; i++)
	  {R[i] = t;}
     if(indparal == 0)
	  {hdc = NGetDC(hhwnd);hdcm = NCreateCompatibleDC(hdc);
	   hbmp = NCreateBitmap(q6,q6,1,32,g);
       hbmpold = (HBITMAP)NSelectObject(hdcm,hbmp);
	   NBitBlt(hdc,q4,q5,q6,q6,hdcm,0,0,0);
	   NSelectObject(hdcm,hbmpold);
	   NDeleteObject(hbmp);
	   NDeleteDC(hdcm);
	   NReleaseDC(hhwnd,hdc);
	  }
     break;
     case 0x00202098: // cvotrezki
     q1 = *(a+1);
     q1 -= L0;
     q1 <<= 2;
     q1 += PTNBGN;
     q2 = CVOTR[q1];
     f = st;
     q2 = OBL4[q2+4];
     if(q2 != 0)
      {q3 = CVOTR[q2];
       q2++;
       while(q2 < q3)
        {q4 = CVOTR[q2];
         q4 = loschisl(q4);
         *st = q4;
         st++;
         q2++;
        }
      }
     q2 = text1(f);
     opr(*(a+2),q2);
     break;
	 case 0x00200873: // tchk
     q1 = *(a+1);
	 q1 -= L0;
	 q2 = *(a+2);
	 q2 -= L0;
     q3 = (q2*oblshirina) + q1; // smeshenie
	 q4 = OBL2[q3];
	 q4 &= 0x3FFFFFFF;
	 q5 = 100;
	 q4 |= 0x00200000;
	 opr(*(a+3),q4);
	 q4 = loschisl(q5);
	 opr(*(a+4),q4);
	 q4 = OBL1[q3];
	 q5 = q4;
	 q5 &= 0xFF;
	 t1 = q5;
	 q5 = loschisl(q5);
	 opr(*(a+5),q5);
     q5 = q4;
	 q5 >>= 8;
	 q5 &= 0xFF;
	 t2 = q5;
	 q5 = loschisl(q5);
	 opr(*(a+6),q5);
     q5 = q4;
	 q5 >>= 16;
	 q5 &= 0xFF;
	 t3 = q5;
	 q5 = loschisl(q5);
	 opr(*(a+7),q5);
     t = (114 * t1) + (587 * t2) + (299 * t3);
	 t /= 1000;
     q5 = loschisl(t);
	 opr(*(a+8),q5);
	 break;
     case 0x002002A4: // tochka
     q1 = *(a+1);
     q2 = *(a+2);
     q3 = *(a+3);
     q1 -= L0;
     q2 -= L0;
     q3 -= L0;
     q3 *= 4;
     q1 *= 4;
     q4 = (q3*q2) + q1;
     c = IZ[q4];
     s = (unsigned char)c;
     d = (UINT)s;
     d += L0;
     opr(*(a+4),d);
     c = IZ[q4+1];
     s = (unsigned char)c;
     d = (UINT)s;
     d += L0;
     opr(*(a+5),d);
     c = IZ[q4+2];
     s = (unsigned char)c;
     d = (UINT)s;
     d += L0;
     opr(*(a+6),d);
     c = IZ[q4+3];
     s = (unsigned char)c;
     d = (UINT)s;
     d += L0;
     opr(*(a+7),d);
     break;
     case 0x002003C2: // znach
     q1 = *(a+1);
	 q1 -= L0;
	 q2 = *(a+2);
     q2 -= L0;
	 q1 += (q2 * oblshirina);
	 q3 = *(a+3);
	 if(q3 == 0x00200105)
      {q4 = OBL1[q1];}
     else
      {if(q3 == 0x00200106)
        {q4 = OBL2[q1];
        }
       else
        {q4 = OBL3[q1];
        }
      }

     q4 = loschisl(q4);
     opr(*(a+4),q4);
     break;
     case 0x002007C6: // nomer
     q1 = *(a+1);
     q1 = convchisl(q1);
     q2 = *(a+2);
     q2 = convchisl(q2);
     q3 = *(a+3);
     q3 = convchisl(q3);
     q4 = diskr(q1,q2,q3);
     q4 = loschisl(q4);
     opr(*(a+4),q4);
     break;
     case 0x00200440: // soderganie
     q1 = *(a+1);
     q1 -= L0;
     q1 <<= 2;
     q1 += OBJBGN;
     f = st;
     q2 = CVOBJ[q1+2];
     while(q2 != 0)
      {q3 = CVOBJ[q2];
       q4 = CVOTR[q3];
       if(OBL4[q4+3] != 0)
        {q3 -= PTNBGN;
         q3 >>= 2;
         q3 += L0;
         *st = q3;
         st++;
        }
       q2 = CVOBJ[q2+1];
      }
     q3 = text1(f);
     opr(*(a+2), q3);
     break;
     case 0x002018DE: // ob
     q1 = *(a+1);
     q1 -= L0;
     q1 *= 4;
     q1 += PTNBGN;
     q2 = CVOTR[q1];
     q2 = OBL4[q2 + 3];
     if(q2 == 0)
      {opr(*(a+2), 0x00200104);}
     else
      {f = st;
       q3 = q2 - OBJBGN;
       q3 >>= 2;
       q3 += L0;
       *st = q3; st++;
       q3 = CVOBJ[q2];
       q3 = loschisl(q3);
       *st = q3; st++;
       q3 = CVOBJ[q2+1];
       q3 = loschisl(q3);
       *st = q3; st++;
       q3 = CVOBJ[q2+3];
       if(q3 == 0)
        {*st = 0x00200119; st++;}
       else
        {q3 = CVOBJ[q3]; // spisok cvetov v CVOTR
         q4 = CVOTR[q3];
         q3++;
         f1 = st;
         while(q3 < q4)
          {q5 = CVOTR[q3];
           q5 = loschisl(q5);
           *st = q5; st++;
           q3++;
          }
         q3 = text1(f1);
         *st = q3; st++;
        }
       q3 = text1(f);
       opr(*(a+2), q3);
      }
     break;
     case 0x00200169: // prinadlegit
     q1 = *(a+1);
     q1 = convchisl(q1);
     q2 = *(a+2);
     q2 = convchisl(q2);
     q3 = *(a+3);
     q3 = convchisl(q3);
     q4 = *(a+4);
     q4 = convchisl(q4);
     R[1] = q1; R[2] = q2; R[3] = q3;
     ist = 0;
     i = 4097;
     j = TCV[4096];
     while(TCV[i+1] != q4 && i < j)
      {i = TCV[i];}
     if(i >= j)
      {break;}
     q2 = TCV[i]; // konec gruppi
     k = i+2; // tekushaja chetverka;
     q3 = 0; // indikator obriva;
     while(q3 == 0 && k < q2)
      {q4 = TCV[k];  // znachenija i1,i2
       q5 = TCV[k+1];
       t1 = TCV[k+2];// znachenija a1,a2
       t2 = TCV[k+3];
       if(q5 == 0)
        {q6 = R[q4];
         if(t2 == 0)
          {if(t1 > q6)
           {q3 = 1;
           }
          }
         else
          {if(q6 > t1)
            {q3 = 1;}
          }
        }
       else
        {q6 = R[q4];
         q7 = R[q5];
         if((t1 * q6) > (t2 * q7))
          {q3 = 1;
          }
        }
       k += 4;
      }
     if(q3 == 0)
      {ist = 1;}
     break;
     case 0x0020024D: // dlina
     for(i = PTNBGN; i < 5900000; i+= 4)
      {h = 0;
       q1 = CVOTR[i+2];
       q2 = CVOTR[q1];
       q1++;
       while(q1 < q2)
        {q4 = CVOTR[q1];
         q3 = CVOTR[q4+2] - CVOTR[q4+3];
         q3 /= 2;
         h += q3;
         q1 += 2;
        }
       q1 = CVOTR[i];
       OBL4[q1+2] = h;
      }
     break;
     case 0x00200F09: // CHislo
     i = 5900000 - PTNBGN;
     i /= 4;
     i += L0;
     opr(*(a+1),i);
     break;
     case 0x00200FA2: // stroka
     i = *(a+1);
     i -= L0;
     b = CVSTR[i]; // tekushaja pozicija v stroke
     d = 0; // indikator konca stroki
     p = oblshirina - 1;
     f = st;
     while(d == 0)
      {f1 = st;
       q1 = CVOTR[b];
       q2 = CVOTR[b+1];
       f2 = st;
       q1 = loschisl(q1);
       *st = q1; st++;
       q2 = loschisl(q2);
       *st = q2; st++;
       q1 = text1(f2);
       *st = q1; st++;
       q1 = CVOTR[b+2];
       q2 = (q1 & 0x80000000 ? 0x00200104 : loschisl(q1));
       *st = q2; st++;
       q1 = CVOTR[b+3];
       q2 = q1 - PTNBGN;
       q2 >>= 2;
       q2 = loschisl(q2);
       *st = q2; st++;
       q2 = CVOTR[q1+1];
       q2 = loschisl(q2);
       *st = q2; st++;
       q1 = text1(f1);
       *st = q1; st++;
       if(CVOTR[b+1] == p)
        {d = 1;}
       else
        {b += 6;}
      }
     q1 = text1(f);
     opr(*(a+2),q1);
     break;
     case 0x00201A10: // sokrashlin
     cvsokrash();
     break;
     case 0x00200257: // gruppirovki
     pjatngrup();
     break;
     case 0x00200CB9: // objekti
     cvobjekti();
     break;
     case 0x0020006F: // razlichni
     linrazlichni();
     break;
     case 0x00201562: // sokrash
     sokrazv(a);
     break;
     case 0x00200071: // zapis
     q1 = *(a+1);
     q2 = *(a+2);
     q3 = *(a+3);
     q1 -= L0;
     q2 -= L0;
     q3 -= L0;
     q3 *= 4;
     q1 *= 4;
     q4 = (q3*q2) + q1;
     t1 = *(a+4); t1 -= L0;
     s = (unsigned char)t1;
     IZ[q4] = s;
     t2 = *(a+5); t2 -= L0;
     s = (unsigned char)t2;
     IZ[q4+1] = s;
     t3 = *(a+6); t3 -= L0;
     s = (unsigned char)t3;
     IZ[q4+2] = s;
     t = (114 * t1) + (587 * t2) + (299 * t3);
	 t /= 1000;
	 s = (unsigned char)t;
	 IZ[q4+3] = s;
     break;
	 case 0x002002BE: // aktiv
	 if(*(a+3) == 0x00200105){indobl1 = 1;}
	 else {indobl2 = 1;};
	 q1 = *(a+1);
	 q1 -= L0;
	 q2 = *(a+2);
	 q2 -= L0;
	 oblshirina = q1;
     oblvisota = q2;
	 q3 = q1 * q2;
	 if(*(a+3) == 0x00200105)
	  {for(i = 0; i < q3; i++)
	    {OBL1[i] = L0;}
	  }
	 else
	  {for(i = 0; i < q3; i++)
	    {OBL2[i] = L0;}
	  }
	 break;
	 case 0x00200CCF:
	 cvlinsist(a);
     break;
	 case 0x00201C49: // kartina
	 b = oblshirina+1;
	 d = oblvisota+1;
	 h = b*d;
	 for(i = 0; i < h; i++)
      {OBL3[i] = 0;}
     for(i = LINEND; i < UZLEND; i++)
      {q1 = OBL4[i];
       q2 = CVOTR[q1];
       q3 = CVOTR[q1+1];
       q4 = (q3 * b) + q2;
       OBL3[q4] = 0x80000000 | q1;
      }
     for(i = 0; i < LINEND; i++)
      {q1 = OBL4[i];
       q2 = CVOTR[q1+2];
       q3 = CVOTR[q1+3];
       q3 += 2;
       q2 -= 2;
       while(q3 < q2)
        {q4 = CVOTR[q3];
         q5 = CVOTR[q3+1];
         q6 = (q5 * b) + q4;
         OBL3[q6] = q1;
         q3 += 2;
        }
      }
     break;
	 case 0x002002C3: // passiv
     if(*(a+1) == 0x00200105)
	  {indobl1 = 0;}
	 else
	  {indobl2 = 0;}
	 break;
	 case 0x00200104:  // nolb
     oblshirina = *(a+1) - L0;
     oblvisota = *(a+2) - L0;
	 extrnol(a);
	 break;
	 case 0x00200167: // raznost
	 q1 = *(a+1);
	 q2 = Z[q1+2];
     q3 = Z[q1+4];
     q2 -= 0x00200104;
     q3 -= 0x00200104;
     q2 <<= 16;
     q2 |= q3;
     q3 = CVOTR[q2];
     q4 = CVOTR[q2+1];
     if(q3 == 0 || q4 == 0)
      {q5 = 1000000;
       q6 = loschisl(q5);
       opr(*(a+2),q6);
      }
     else
      {q3 = CVOTR[q3];
       q3 = OBL4[q3+1];
       q4 = CVOTR[q4];
       q4 = OBL4[q4+1];
       q5 = (q3 < q4 ? q4 - q3 : q3 - q4);
       q6 = loschisl(q5);
       opr(*(a+2),q6);
      }
     break;
	 case 0x00200190: // znachenie
	 q1 = *(a+1);
	 q1 -= L0;
	 q2 = *(a+2);
     q2 -= L0;
	 q1 += (q2 * oblshirina);
	 q3 = *(a+3);
	 if(q3 == 0x00200105)
      {q4 = OBL1[q1];}
     else
      {if(q3 == 0x00200106)
        {q4 = OBL2[q1];
        }
       else
        {q4 = OBL4[q1];
        }
      }
     q5 = q4 & 0xFF;
     q5 += 0x00200104;
     q4 >>= 8;
     q6 = q4 & 0xFF;
     q6 += 0x00200104;
     q4 >>= 8;
     q7 = q4 & 0xFF;
     q7 += 0x00200104;
     opr(*(a+4),q7);
     opr(*(a+5),q6);
     opr(*(a+6),q5);
     break;
     case 0x00201A4F: // jarkobl
     q7 = 4*oblshirina;
     p = oblshirina - 1;
     for(i = 0,k=0; i < oblvisota; i++, k += q7) // cicle prosmotra grafa otrezkov
      {n = CVSTR[i]; // tekushaja pozicija v stroke
       d = 0; // indikator konca stroki
       q1 = k;
       while(d == 0)
        {h = 0;
         for(j = CVOTR[n]; j <= CVOTR[n+1]; j++,q1 += 4)
          {s = (unsigned char)IZ[q1+3];
           q3 = (UINT)s;
           h += q3;
          }
         q4 = CVOTR[n+3];
         q2 = CVOTR[q4];
         OBL4[q2+1] += h;
         if(CVOTR[n+1] == p)
          {d = 1;}
         else
          {n += 6;}
        }
      }
     for(i = PTNBGN; i < 5900000; i += 4)
      {q1 = CVOTR[i];
       q2 = OBL4[q1+1];
       q3 = CVOTR[i+1];
       q2 /= q3;
       OBL4[q1+1] = q2;
      }
     break;
     case 0x00201008: // linkoord
     q1 = *(a+1);
     q2 = Z[q1+2];
     q3 = Z[q1+4];
     q2 -= 0x00200104;
     q3 -= 0x00200104;
     q2 <<= 16;
     q2 |= q3;
     p = CVOTR[q2+3];
     q1 = CVOTR[q2+2];
     q1 -= p;
     q1 /= 4;
     q1 *= 2;
     p += q1;
     q2 = CVOTR[p];
     q2 += 0x00200104;
     opr(*(a+2),q2);
     q2 = CVOTR[p+1];
     q2 += 0x00200104;
     opr(*(a+3),q2);
     break;
     case 0x00201609: // vlogotrezki
     i = *(a+1);
     i -= L0;
     b = CVSTR[i]; // tekushaja pozicija v stroke
     d = 0; // indikator konca stroki
     p = oblshirina - 1;
     f = st;
     while(d == 0)
      {if(!(CVOTR[b+2] & 0x80000000))
        {f1 = st;
         q1 = CVOTR[b];
         q1= loschisl(q1);
         *st = q1;
         st++;
         q1 = CVOTR[b+1];
         q1 = loschisl(q1);
         *st = q1;
         st++;
         q1 = CVOTR[b+2];
         q1 = loschisl(q1);
         *st = q1;
         st++;
         q1= CVOTR[b+3];
         q1 = CVOTR[q1+1];
         q1 = loschisl(q1);
         *st = q1;
         st++;
         q1 = text1(f1);
         *st = q1;
         st++;
        }
       if(CVOTR[b+1] == p)
        {d = 1;}
       else
        {b += 6;}
      }
     q1 = text1(f);
     opr(*(a+2),q1);
     break;
     case 0x002004F0: // raschistka
     for(q1 = 0; q1 <4096; q1++)
      {TCV[q1]=0;
      }
     TCV[4096] = 4097;
     for(q1 = 0; q1 < 1000; q1++)
      {ZCV[q1] = 0;
      }
     itcv = 0;
     break;
     case 0x00200124: // obl
     q1 = *(a+1);
     q1 -= L0;
     q2 = *(a+2);
     q2 -= L0;
     q3 = *(a+3);
     q3 -= L0;
     q4 = *(a+4);
     q4 -= L0;
     f = st;
     for(i = PTNBGN; i < 5900000; i+= 4)
      {b = CVOTR[i+2];
       d = CVOTR[b];
       b++;
       while(b < d)
        {t = CVOTR[b]; // ssilka na liniju
         t1 = CVOTR[t+3]; // nachalo massiva pikselej
         t2 = CVOTR[t+2]; // konec massiva pikselej
         while(t1 < t2)
          {q5 = CVOTR[t1];
           if(q1 <= q5 && q5 <= q3+1)
            {q5 = CVOTR[t1+1];
             if(q2 <= q5 && q5 <= q4+1)
              {q6 = t1; n = 0;
               while(q6 < t2 && n == 0)
                {q5 = CVOTR[q6];
                 if(q1 <= q5 && q5 <= q3+1)
                  {q5 = CVOTR[q6+1];
                   if(q2 <= q5 && q5 <= q4+1)
                    {q6 += 2;}
                   else
                    {n = 1;}
                  }
                 else
                  {n = 1;}
                }
               if(n == 1)
                {q6 -= 2;}
               if(t1 < q6 && t1 < t2-2)
                {f1 = st;
                 j = vnutrlin(t);
                 k = j + 0x00200104;
                 *st = k; st++;
                 while(t1 <= q6 && t1< t2)
                  {f2 = st;
                   q7 = CVOTR[t1];
                   q7 = loschisl(q7);
                   *st = q7; st++;
                   q7 = CVOTR[t1+1];
                   q7 = loschisl(q7);
                   *st = q7; st++;
                   q7 = text1(f2);
                   *st = q7; st++;
                   t1 += 2;
                  }
                 q7 = text1(f1);
                 *st = q7; st++;
                 t1 = q6;
                }

              }
            }
           t1 += 2;
          }
         b += 2;
        }
      }
     q2 = text1(f);
     opr(*(a+5),q2);
     break;
     case 0x00201578: // Linii
     q1 = PTNBGN;
     n = 0;
     q5 = *(a+1);
     q5 -= L0;
     while(q1 < 5900000)
      {q2 = CVOTR[q1+2];
       q3 = CVOTR[q2];
       q2++;
       while(q2 < q3)
        {q4 = CVOTR[q2];
         if(CVOTR[q2+1]== 0 || CVOTR[q4] == 0 || CVOTR[q4+1]== 0)
          {OBL4[n] = q4; n++;
          }
         q2 += 2;
        }
       q2 = CVOTR[q1+3];
       if(q2 != 0)
        {q3 = CVOTR[q2];
         q2++;
         while(q2 < q3)
          {q4 = CVOTR[q2];
           q6 = CVOTR[q4];
           q4++;
           while(q4 < q6)
            {i = CVOTR[q4];
             if(CVOTR[q4+1]== 0)
              {OBL4[n] = i; n++;}
             q4 += 2;
            }
           q2++;
          }
        }
       q1 += 4;
      }
     LINEND = n;
     for(i = 0; i < LINEND; i++)
      {q1 = OBL4[i];
       for(j = 4; j < 6; j++)
        {q2 = CVOTR[q1+j];
         if(CVOTR[q2+2] == q1)
          {OBL4[n] = q2; n++;}
        }
      }
     UZLEND = n;
     for(i = 0; i < LINEND; i++)
      {q2 = OBL4[i];
       CVOTR[q2+6] = n;
       for(j = 0; j < q5; j++,n++)
        {OBL4[n] = 0;
        }
      }
     CHAREND = n;
     break;
     case 0x00201745: // harakt
     q1 = PTNBGN;
     q5 = *(a+1);
     q5 -= L0;
     while(q1 < 5900000)
      {q2 = CVOTR[q1];
       CVOTR[q1] = CHAREND;
       OBL4[CHAREND] = q2;
       CHAREND ++;
       for(i = 1; i < q5; i++,CHAREND ++)
        {OBL4[CHAREND] = 0;
        }
       q1 += 4;
      }
     break;
     case 0x00200F58: // bolee
     q1 = *(a+1);
     q1 = convchisl(q1);
     f = st;
     for(i = OBJBGN; i < 3900000; i += 4)
      {q2 = CVOBJ[i+1];
       if(CVOBJ[i] != 0 && q2 >= q1)
        {q3 = (i - OBJBGN);
         q3 /= 4;
         q3 += L0;
         *st = q3;
         st++;
        }
      }
     q2 = text1(f);
     opr(*(a+2),q2);
     break;
     case 0x002007AD: // granica
     q1 = *(a+1);
     q1 -= L0;
     q1 *= 4;
     q1 += OBJBGN;
     f = st;
     q2 = CVOBJ[q1+2];
     while(q2 != 0)
      {q3 = CVOBJ[q2];
       q4 = CVOTR[q3+2];
       q5 = CVOTR[q4];
       q4++;
       while(q4 < q5)
        {q6 = CVOTR[q4];
         j = vnutrlin(q6);
         if(j == 0)
          {f1 = st;
           h = (q6 >> 16);
           h += L0;
           *st = h;
           st++;
           h = (q6 & 0xFFFF);
           h += L0;
           *st = h;
           st++;
           h = text1(f1);
           *st = h;
           st++;
          }
         q4 += 2;
        }
       q2 = CVOBJ[q2+1];
      }
     h = text1(f);
     opr(*(a+2),h);
     break;
     case 0x00202079: // diskr
     q1 = TCV[4096];
     q2 = *(a+1);
     q2 = convchisl(q2);
     TCV[q1+1] = q2;
     q6 = q1;
     q3 = *(a+2);
     q4 = Z[q3+6];
     q4 = convchisl(q4);
     q4 <<= 16;
     q5 = Z[q3+4];
     q5 = convchisl(q5);
     q5 <<= 8;
     q4 |= q5;
     q5 = Z[q3+2];
     q5 = convchisl(q5);
     q4 |= q5;
     ZCV[q2-1] = q4;
     q3 = *(a+3);
     q3 += 2;
     q1 += 2;
     while(!(Z[q3] & T1))
      {q4 = Z[q3]+2; q3 += 2;
       while(!(Z[q4] & T1))
        {q5= Z[q4]; q4+= 2;
         q5 = convchisl(q5);
         TCV[q1] = q5;
         q1++;
        }
      }
     TCV[q6] = q1;
     TCV[4096] = q1;
     break;
     case 0x00202077: // diskrcvet
     p = TCV[4096]; // pervaja svobodnaja jachejka v TCV
     h = p; // nachalo 3-j zoni
     for(i = 0; i < 4096; i++) // smeshenie v pervoj zone TCV
      {q1 = (i >> 8);
       q1 <<= 4;
       R[1] = q1; // znachenie B
       q2 = (i >> 4) & 0xF;
       q2 <<= 4;
       R[2] = q2; // znachenie G
       q3 = i & 0xF;
       q3 <<= 4;
       R[3] = q3; // znachenie R
       R[4] = q1+15; // verhnie granici cvetov dlja kletki
       R[5] = q2+15;
       R[6] = q3+15;
       b = i; // adres v TCV dlja prodolgenija cepochki ssilok
       j = 4097; // nachalo tekushej gruppi vo 2 zone
       while(j < h)
       {d = TCV[j]; // konec gruppi
        k = j + 2;
        t = 0;
        while(k < d && t == 0)
         {q4 = TCV[k];  // znachenija i1,i2
          q5 = TCV[k+1];
          t1 = TCV[k+2];// znachenija a1,a2
          t2 = TCV[k+3];
          if(q5 == 0)
           {q6 = R[q4];
            q7 = R[q4+3];
            if(t2 == 0)
             {if(t1 > q7)
               {t = 1;
               }
             }
            else
             {if(q6 > t1)
               {t = 1;}
             }
           }
          else
           {q6 = R[q4];
            q7 = R[q5+3];
            if((t1 * q6) > (t2 * q7))
             {t = 1;
             }
           }
          k += 4;
         }
        if(t == 0)
         {TCV[p] = j;
          TCV[p+1] = 0;
          TCV[b] = p;
          b = p+1;
          p += 2;
         }
        j = d;
       }
      }
     OBL2[0] = 4*p;
     for(i = 0; i < p; i++)
      {OBL2[i+1] = TCV[i];
      }
     for(i = 0,j = p; i < 1000; i++,j++)
      {OBL2[j] = ZCV[i];
      }
     hcvet = Ncreat(pathcvet);
     k = j*4;
     g = (char*)OBL2;
     Nwrite(hcvet,g,k);
     Nclose(hcvet);
     itcv = 1;
     break;
     case 0x00202095: // cvetnabor
     rcvet();
     q1 = *(a+1);
     q1 = convchisl(q1);
     q2 = ZCV[q1-1];
     q3 = (q2 >> 16);
     q4 = (q2 >> 8) & 0xFF;
     q5 = q2 & 0xFF;
     q3 += L0;
     q4 += L0;
     q5 += L0;
     opr(*(a+2),q3);
     opr(*(a+3),q4);
     opr(*(a+4),q5);
     break;
     case 0x00200166: // peresechenie
     rcvet();
     for(i = 1; i < 1000; i++)
      {OBL4[i] = 0;} // rschistka nakopitelja cepochek
     h = 1000; // pervaja svobodhanaj jachejka
     for(i = 0; i < 4095; i++)
      {q1 = TCV[i];
       if(q1 != 0 && TCV[q1+1]!= 0)
        {q2 = q1;
         while(q2 != 0)
          {t1 = TCV[q2];
           q3 = TCV[t1+1];
           q4 = q1;
           while(q4 != 0)
            {if(q4 != q2)
              {t2 = TCV[q4];
               q5 = TCV[t2+1];
               q6 = OBL4[q3];
               p = 0;
               while(q6 != 0)
                {if(OBL4[q6] == q5)
                  {p = 1; break;}
                 q6 = OBL4[q6+1];
                }
               if(p == 0)
                {k = cvnerav(t1,t2);
                 if(k == 1)
                  {OBL4[h] = q5;
                   OBL4[h+1] = OBL4[q3];
                   OBL4[q3] = h;
                   h += 2;
                  }
                }
              }
             q4 = TCV[q4+1];
            }
           q2 = TCV[q2+1];
          }
        }
      }
     f = st;
     for(i = 1; i < 1000; i++)
      {q1 = OBL4[i];
       if(q1 != 0)
        {f1 = st;
         q2 = loschisl(i);
         *st = q2; st++;
         while(q1 != 0)
          {q3 = OBL4[q1];
           q3 = loschisl(q3);
           *st = q3; st++;
           q1 = OBL4[q1+1];
          }
         q4 = text1(f1);
         *st = q4; st++;
        }
      }
     q4 = text1(f);
     opr(*(a+1),q4);
     break;
     case 0x00201D9D: // cvet
     rcvet();
     q1 = oblshirina*oblvisota;
     q1 *= 4;
     j = 0;
     for(i = 0; i < q1; i += 4, j++)
      {s = IZ[i];
       q2 = (UINT)s; // B
       s = IZ[i+1];
       q3 = (UINT)s; // G
       s = IZ[i+2];
       q4 = (UINT)s; // R
       q5 = diskr(q2,q3,q4);
       if(q5 == 0)
        {q6 = (q3 << 8);
         q2 |= q6;
         q6 = (q4 << 16);
         q2 |= q6;
        }
       else
        {q2 = ZCV[q5-1];
        }
       OBL1[j] = q2;
       OBL2[j] = q5;
      }
     break;
     case 0x00201353: // otrezki
     j = 0; // smeshenie v OBL2 nachala ocherednogo pikselja
     q1 = 1; // pervaja svobodnaja jachejka v CVOTR
     for(i = 0; i< oblvisota; i++) // pervichnoe formirovanie otrezkov
      {CVSTR[i]= q1;
       q2 = 0xFFFFFFFF; // predidushij cvet
       q4 = 0xFFFFFFFF; // abscissa ego pervogo pikselja
       for(n = 0; n < oblshirina; n++,j++)
         {q3 = OBL2[j];
          if(q3 == 0)
           {q3 = OBL1[j] | 0x80000000;} // tekushij cvet
          if(q3 != q2)
           {if(q2 != 0xFFFFFFFF)
             {CVOTR[q1] = q4;
              CVOTR[q1+1] = n-1;
              CVOTR[q1+2] = q2;
              CVOTR[q1+3] = 0;
              CVOTR[q1+4] = 0;
              CVOTR[q1+5] = 0;
              CVOTR[q1+6] = 0;
              CVOTR[q1+7] = 0;
              CVOTR[q1+8] = 0;
              q1 += 9;
             }
            q2 = q3; q4 = n;
           }
         }
       CVOTR[q1] = q4;
       CVOTR[q1+1] = oblshirina - 1;
       CVOTR[q1+2] = q2;
       CVOTR[q1+3] = 0;
       CVOTR[q1+4] = 0;
       CVOTR[q1+5] = 0;
       CVOTR[q1+6] = 0;
       CVOTR[q1+7] = 0;
       CVOTR[q1+8] = 0;
       q1 += 9;
      }
     CVOTREND = q1;
     CVEND = q1;
     cvsvjazi();
     break;
     case 0x00201907: // izolir
     q1 = *(a+1);
     q1 = convchisl(q1);
     q2 = *(a+2);
     q2 = convchisl(q2);
     cvizolir(q1,q2);
     break;
     case 0x0020128E: // gruppi
     i = *(a+1);
     i = convchisl(i);
     cvgruppi(i);
     break;
     case 0x00200EC9: // iskljuch
     i = *(a+1);
     i = convchisl(i);
     cviskljuch(i);
     break;
     case 0x0020209D: // cvpjatna
     cvpjatna();
     break;
     case 0x002001DC: // bolshe
     q1 = *(a+1);
     q1 = convchisl(q1);
     f = st;
     for(i = PTNBGN; i < 5900000; i+= 4)
      {if(q1 <= CVOTR[i+1])
        {q2 = i - PTNBGN;
         q2 >>= 2;
         q2 += 0x00200104;
         *st = q2; st++;
        }
      }
     q2 = text1(f);
     opr(*(a+2),q2);
     break;
     case 0x00200196: // chislo
     q1 = *(a+1);
     q1 -= 0x00200104;
     q1 <<= 2;
     q1 += PTNBGN;
     q2 = CVOTR[q1+1];
     q2 = loschisl(q2);
     opr(*(a+2),q2);
     break;
     case 0x0020095C: // linii
     q1 = *(a+1);
     q1 = convchisl(q1);
  	 q2 = *(a+2); q2 -= L7;
  	 i = *(a+3);
  	 i -= L0;
  	 hdc = NGetDC(hhwnd);
     hpen = NCreatePen(1,red[q2],green[q2],blue[q2]);
     hpenold = (HPEN)NSelectObject(hdc,hpen);
     for(q3 = 0; q3 < LINEND; q3++)
      {q6 = OBL4[q3];
       q4 = CVOTR[q6];
       q5 = CVOTR[q6+1];
       j = vnutrlin(q6);
       if((CVOTR[q4+1]>= q1 || CVOTR[q5+1] >= q1) &&
         (i == 0 || j == 0))
        {q7 = CVOTR[q6+3];
         q6 = CVOTR[q6+2];
         while(q7 < q6-2)
          {t1 = CVOTR[q7];
           t2 = CVOTR[q7+1];
           t = NMoveToEx(hdc,t1,t2+3);
           t1 = CVOTR[q7+2];
           t2 = CVOTR[q7+3];
           t = NLineTo(hdc,t1,t2+3);
           q7 += 2;
          }
        }
      }
     NSelectObject(hdc,hpenold);
     NReleaseDC(hhwnd,hdc);
     hpenold = (HPEN)NSelectObject(hsdc,hpen);
     for(q3 = 0; q3 < LINEND; q3++)
      {q6 = OBL4[q3];
       q4 = CVOTR[q6];
       q5 = CVOTR[q6+1];
       j = vnutrlin(q6);
       if((CVOTR[q4+1]>= q1 || CVOTR[q5+1] >= q1) &&
         (i == 0 || j == 0))
        {q7 = CVOTR[q6+3];
         q6 = CVOTR[q6+2];
         while(q7 < q6-2)
          {t1 = CVOTR[q7];
           t2 = CVOTR[q7+1];
           t = NMoveToEx(hdc,t1,t2+3);
           t1 = CVOTR[q7+2];
           t2 = CVOTR[q7+3];
           t = NLineTo(hdc,t1,t2+3);
           q7 += 2;
          }
        }
      }
     NSelectObject(hsdc,hpenold);
	 NDeleteObject(hpen);
     break;
     case 0x00200F07: // Oblast
     q1 = *(a+1);
     q1 = convchisl(q1);
     q2 = *(a+2);
     q2 = convchisl(q2);
     q3 = CVSTR[q2];
     while(CVOTR[q3+1]< q1)
      {q3 += 6;}
     q4 = CVOTR[q3+3];
     q4 -= PTNBGN;
     q4 >>= 2;
     q4 += 0x00200104;
     opr(*(a+3),q4);
     break;
     case 0x002000CC: // parametri
     q1 = *(a+1);
     q1 -= 0x00200104;
     q1 <<= 2;
     q1 += PTNBGN;
     q2 = CVOTR[q1+1];
     q3 = loschisl(q2);
     opr(*(a+2),q3);
     q2 = CVOTR[q1];
     q2 = OBL4[q2];
     if(q2 & 0x80000000)
      {q3 = q2 & 0x7FFFFFFF;
       q2 = 0;
      }
     else
      {q3 = ZCV[q2-1];}
     q4 = (q3 >> 16); //R
     q5 = (q3 >> 8) & (0xFF); //G
     q6 = q3 & 0xFF; //B
     f = st;
     q6 = loschisl(q6);
     *st = q6; st++;
     q5 = loschisl(q5);
     *st = q5; st++;
     q4 = loschisl(q4);
     *st = q4; st++;
     q4 = text1(f);
     opr(*(a+3),q4);
     q4 = loschisl(q2);
     opr(*(a+4),q4);
     break;
     case 0x0020057D: // smegni
     q1 = *(a+1);
     q1 -= 0x00200104;
     q1 *= 4;
     q1 += PTNBGN;
     q2 = *(a+2);
     q3 = Z[q2+2];
     q4 = Z[q2+4];
     q3 -= 0x00200104;
     q4 -= 0x00200104;
     q3 <<= 16;
     q3 |= q4;
     q4 = (CVOTR[q3] == q1 ? CVOTR[q3+1] : CVOTR[q3]);
     q4 -= PTNBGN;
     q4 /= 4;
     q4 += 0x00200104;
     opr(*(a+3),q4);
     break;
     case 0x002019AC: // dlingranici
     q1 = *(a+1);
     q3 = Z[q1+2];
     q4 = Z[q1+4];
     q3 -= 0x00200104;
     q4 -= 0x00200104;
     q3 <<= 16;
     q3 |= q4;
     q2 = CVOTR[q3+2] - CVOTR[q3+3];
     q2 >>= 1;
     q2 = loschisl(q2);
     opr(*(a+2),q2);
     break;
     case 0x00201816: // otdeleni
     q1 = *(a+1);
     q3 = Z[q1+2];
     q4 = Z[q1+4];
     q3 -= 0x00200104;
     q4 -= 0x00200104;
     q3 <<= 16;
     q3 |= q4;
     q4 = CVOTR[q3+6];
     q4 = OBL4[q4];
     if(q4 != 1)
      {ist = 0;}
     break;
     case 0x0020134E: // chislolin
     q1 = *(a+1);
     q1 -= 0x00200104;
     q1 *= 4;
     q1 += PTNBGN;
     q2 = CVOTR[q1+2];
     q3 = CVOTR[q2];
     q2 ++;
     q3 -= q2;
     q3 >>= 1;
     q3 += 0x00200104;
     opr(*(a+2),q3);
     break;
     case 0x00200C25: // linhod
     q1 = *(a+1);
     q1 -= 0x00200104;
     q1 *= 4;
     q1 += PTNBGN;
     q2 = *(a+2);
     q2 -= 0x00200105;
     q2 <<= 1;
     q3 = CVOTR[q1+2];
     q3++;
     q3 += q2;
     q6 = CVOTR[q3+1];
     q3 = CVOTR[q3];
     q5 = (q3 >> 16);
     q5 += 0x00200104;
     q3 &= 0xFFFF;
     q3 += 0x00200104;
     f1 = st;
     *st = q5; st++;
     *st = q3; st++;
     q4 = text1(f1);
     opr(*(a+3),q4);
     q6 += 0x00200104;
     opr(*(a+4),q6);
     break;
     case 0x0020070D: // delta
     q1 = *(a+1);
     q2 = Z[q1+2];
     q3 = Z[q1+4];
     q2 -= 0x00200104;
     q3 -= 0x00200104;
     q2 <<= 16;
     q2 |= q3;
     q4 = lindelta(q2);
     q4 = loschisl(q4);
     opr(*(a+2),q4);
     break;
     case 0x002013B0: // blignij
     q1 = *(a+1);
     q1 = convchisl(q1);
     q2 = *(a+2);
     q2 = convchisl(q2);
     t = 0; t1 = 1000000;
     for(i = 0; i < LINEND; i++)
      {q3 = OBL4[i];
       q4 = CVOTR[q3+2];
       q5 = CVOTR[q3+3];
       while(q5 < q4)
        {q6 = (q1 < CVOTR[q5] ? CVOTR[q5]- q1 : q1 - CVOTR[q5]);
         q7 = (q2 < CVOTR[q5+1] ? CVOTR[q5+1]- q2 : q2 - CVOTR[q5+1]);
         q6 += q7;
         if(q6 < t1)
          {t1 = q6; t = q3;
          }
         q5 += 2;
        }
      }
     if(t != 0)
      {q5 = (t >> 16);
       q5 += 0x00200104;
       t &= 0xFFFF;
       t += 0x00200104;
       f1 = st;
       *st = q5; st++;
       *st = t; st++;
       q4 = text1(f1);
       opr(*(a+3),q4);
      }
     break;
     case 0x00200D4F: // protokol
     izobrprot(a);
     break;
     case 0x00201324: // klass
     oprgrup(a);
     break;
     case 0x002019A4: // vosstanovl
     izobrvosst();
     break;
     case 0x00200696: // linija
     q1 = *(a+1);
     q2 = Z[q1+2];
     q3 = Z[q1+4];
     q2 -= 0x00200104;
     q3 -= 0x00200104;
     q2 <<= 16;
     q2 |= q3;
     q3 = CVOTR[q2+2];
     q4 = CVOTR[q2+3];
     f = st;
     while(q4 < q3)
      {f1 = st;
       q5 = CVOTR[q4];
       q5 = loschisl(q5);
       *st = q5; st++;
       q5 = CVOTR[q4+1];
       q5 = loschisl(q5);
       *st = q5; st++;
       q5 = text1(f1);
       *st = q5; st++;
       q4 += 2;
      }
     q2 = text1(f);
     opr(*(a+2),q2);
     break;
	 case 0x0020018F: // oblast
     q1 = *(a+2);
	 q1 -= L0;
	 q2 = *(a+3);
     q2 -= L0;
	 q1 += (q2 * oblshirina);
	 q3 = *(a+4);
	 q3 -= 0x00200104;
	 q4 = *(a+5);
	 q4 -= 0x00200104;
	 q5 = *(a+6);
	 q5 -= 0x00200104;
	 q3 <<= 16;
	 q4 <<= 8;
	 q3 |= q4;
	 q3 |= q5;
	 if(*(a+1) == 0x00200105)
	  {OBL1[q1] = q3;}
	 else
     {if(*(a+1)== 0x00200106)
       {OBL2[q1] = q3;}
	  else
       {OBL4[q1] = q3;}
	 }
	 break;
	}
    st = a;
   }

   void F223()  // perechislcelie

  	{UINT a,b,c;
    int d,e;
    st -= 3; tec++; a = *st + 2; b = *(st+1) + 2;
    if(Z[a] != 0x60200001)
     {tipprer = 7; st += 3; tec--; initprer(1);return;}
    if(Z[b] != 0x60200001)
     {tipprer = 7; st += 3; tec--; initprer(1);return;}
    d = Z[a+1]; e = Z[b+1];
    if(d <= e)
     {c = mem(4);
      if(ind == 4)return;
      Z[c+2] = 0x60200001;
      Z[c+3] = d;
      cadrprod(12);
      opr(*(st+2),c);
      if(ind == 4)return;
		S[lcadr + 9] = c;
      S[lcadr + 10] = *(st+1);
      S[lcadr + 11] = *(st+2);
      return;
	  }
	 ist = 0;
	}

   void F224() // sluchznach

    {int a;
     UINT b,c;
     a = rand();
	 a %= 10000;
     b = (UINT)a;
     c = loschisl(b);
     opr(*(st-1),c);
     st--;
     return;
    }

   void F225()  // KTP

    {UINT a;
     istprer = 0;
     a = *(tec+1); a &= 0x0000FFFF;
     if(a == 0x11)istprer = 1;
     if(PR[prer] == 19 && blokprer == 0)
      {tipprer = 11; initprer(2);}
     return;
    }

   void F226()  // PEREM

    {UINT a,*b,*d;
     a = *(st-1) - L0; b = st - a;
     st--; lbufper = 0;
     d = b-1;
     while(d != st)
      {bufperem[lbufper] = *d;
       d++; lbufper++;
      }
     st = b-1;
     return;
    }

   void F227()   // SHAHMBLOCK
    {UINT *a,b,c,d,e,f,g,k;
     st--;a = st - (*st - L0);
	  switch(*a)
	   {case 0x00200AD4: // smataka
       smataka(a);
       break;
       case 0x00200B1B: // dopusthod
       b = *(a+1);
       c = *(a+2);
       d = Z[c+2] - 0x00200104; d <<= 1;
       e = Z[c+4] - 0x00200104; e <<= 1;
       c = *(a+3);
       f = Z[c+2] - 0x00200104; f <<= 1;
       g = Z[c+4] - 0x00200104; g <<= 1;
       k = dopusthod(b,d,e,f,g,0);
       if(k == 1)ist = 0;
       break;
       case 0x00200B31: // oprhod
       b = *(a+1); c = *(a+2); d = *(a+3);
       e = oprhod(b,c,d);
       opr(*(a+4),e);
       break;
	   case 0x002000E3: // shahmblok
       b = *(a+1);
	   if(b == 0x00200105)
	    {dpusthod = 1;}
	   else
	    {dpusthod = 0;}
	   break;
       case 0x00200B26: // smhod
       smhod(a);
       break;
	   case 0x002015DD: // skvoznhod
       skvoznhod(a);
	   break;
	   case 0x00200A8E:  // Hod
       smHod(a);
	   break;
	   case 0x00200B0D: // smnapadenie
       smnapadenie(a);
	   break;
	   case 0x00200AC6: // smzashita
       smzashita(a);
	   break;
	   case 0x002014B4: // shahmotdeljaet
       shahmotdeljaet(a);
	   break;
	   case 0x00200FD8: // shahpomeha
       shahpomeha(a);
	   break;
	   case 0x00201A1E: // shahblock
       shahblock(a);
	   break;
	   case 0x00200FB1: // shahsvjazka
       shahsvjazka(a);
	   break;
	   case 0x00201540: // blokataki
       blokataki(a);
	   break;
	   case 0x002013F2:  // kontrpolja
       kontrpolja(a);
	   break;
      }
     st = a;
    }
   void F228()   // RISUNOK

    {UINT *a,b,c,d,d1,*h;
     int n1,n2,n3,n4;

     st--; a = st - (*st - L0);
     switch(*a)
      {case 0x0020095C: // linii
        linfragm(a);
       break;
       case 0x00200A47: //bitmap
        Bitmap(a);
       break;
       case 0x0020024D: // dlina
        b = *(a+1); b &= 0x001FFFFF;
        c = LL[b]; c -= 3; c >>= 1;
        c = loschisl(c);
	     if (ind == 4){ist = 0;st = a;return;}
	     opr(*(a+2),c);
       break;
       case 0x002018C7: // kletki
       c = *(a+1); d = *(a+2);
	   initsetka(c,d);
	   break;
	   case 0x0020015E: // pusto
       SE[0] = 0;
	   break;
	   case 0x00201A22: // Linija
       b = *(a+1); c = *(a+2);
	   linsetka(b,c);
	   break;
	   case 0x00200695: // lomanaja
       lomanaja(a);
	   break;
	   case 0x00201353: // otrezki
       risotrezki(a);
       break;
	   case 0x00200873: // tchk
       b = *(a+1); c = *(a+2);
       b -= 0x00200104;
	   c -= 0x00200104;
	   b -= SE[1];
	   c -= SE[2];
	   b /= SE[5];
       c /= SE[6];
       b += 0x00200104;
	   c += 0x00200104;
	   opr(*(a+3),b);
	   opr(*(a+4),c);
	   break;
	   case 0x002002FD: // kvadrat
       b = *(a+1); c = *(a+2);
	   b -= 0x00200104;
	   c -= 0x00200104;
	   c *= SE[7]; b += c;
	   b <<= 4; b += 9;
	   c = b + 16;
       h = st;
	   while(SE[b] != 0 && b < c)
	    {*st = SE[b]; st++; b++;
	    }
       d = text1(h);
       opr(*(a+3),d);
	   break;
	   case 0x002012B3: // prodolg
       b = *(a+1); c = *(a+2);
	   b -= 0x00200104;
	   c -= 0x00200104;
	   n1 = (int)b;
	   n2 = (int)c;
	   n3 = intchisl(*(a+3));
       n4 = intchisl(*(a+4));
	   d = convchisl(*(a+5));
       d1 = naprkletki(n1,n2,n3,n4,d);
	   opr(*(a+6),d1);
	   break;
	   case 0x002000E5: // razmer
       b = SE[7]; b += 0x00200104;
	   c = SE[8]; c += 0x00200104;
	   opr(*(a+1),b);
	   opr(*(a+2),c);
	   break;
      }
     st = a;
    }

   void F229()  // RAZMER
   {UINT a,b;
    HWND hrwd;
    RECT r;
	st--; a = *st;
	if(a < 0x00200106)
	 {GetClientRect(hhwnd,&r);
      if(a == 0x00200104)
	   {b = r.bottom + 0x00200104;
	    if(indparal != 0)
		 {b = 0x0020035B;}
	   }
	  else
	   {b = r.right + 0x00200103;
	    if(indparal != 0)
		 {b = 0x00200423;}
	  }
	 }
	else
	 {hrwd = GetDesktopWindow();
      GetWindowRect(hrwd,&r);
      if(a == 0x00200106)
	   {b = r.bottom + 0x00200104;}
	  else
	   {b = r.right + 0x00200104;}
	 }
    *st = b; st++;
   }

   void F230() //NOVPOSILKA

	{UINT a,b,c,d;
	 st -= 4;tec++;d = *(st+2);
    if(d & T6 || !(Z[d+1] & T1) || Z[d+2] < 0x002000F3 ||
       Z[d+2] > 0x002000F6 || !(*(st+3) & T6) ||
       !(*(st+1) & T1) || !(*st & T1))
     {tipprer = 7;st += 3;tec--;initprer(1);return;}
    a = Z[d + 6] + 2;
	 for(b = a;!(Z[b] & T1);b += 2)
	  if(Z[b] <= *(st+3))
		{c = Z[*(st+2) + 4] + 2 + b - a;
		 cadrprod(15);opr(*st,Z[c]);opr(*(st+1),c);
       if(ind == 4)return;S[lcadr + 9] = c;
		 S[lcadr +10] = b;S[lcadr + 11] = Z[d + 4];
		 S[lcadr + 12] = *st;S[lcadr + 13] = *(st+1);
		 S[lcadr + 14] = *(st+3);return;
	   }
	 ist = 0;
	}


  void konvpath(char* a) // a - ukazatel na put k konvertiruemomu failu.
                    	 // Sozdaet v "pathconv" put k novoj versii
 {UINT i,j;
  for(i = 0; i < dlinpath; i++)
   {pathconv[i] = a[i];
   }
  pathconv[i] = '\\';
  pathconv[i+1] = 'C';
  pathconv[i+2] = 'O';
  pathconv[i+3] = 'N';
  pathconv[i+4] = 'V';
  j = i+5; i += 4;
  while(a[i] != 0)
   {pathconv[j] = a[i];
    i++; j++;
   }
  pathconv[j] = 0;
  return;
 }

  void F231() // KPP
  {return;
  }

   void F243()  // OTKAT,ESLI LOGNO

	{if(ist == 0) otkat();}

	// F244 = F247 -  VVOD KADRA PRODOLGENIJA DLJA I

	void F245()  // ZAVERSHENIJE I PO ISTINA

	{level --;tec++;
    if(S[lcadr + 2] == 4 &&
       S[lcadr + 3] == cadr &&
       S[lcadr + 7] == level)
	  lcadr = S[lcadr + 1];
	}


	void F246()  // UDALENIJE POSLEDNEGO KADRA PRODOLGENIJA,ESLI LOGNO

	{level --;lcadr = S[lcadr + 1];ist = 0;}

	void F247()  // VVOD KADRA PRODOLGENIJA DLJA ILI

	{UINT a,b;
	 a = S[lcadr];
     if(delta == 1 && a > 14500)
     {ind = 4;tipprer = 2;return;}
	 S[a+1] = lcadr;
	 S[a+2] = 4;
	 S[a] = a+9;
	 S[a+3] = cadr;
	 S[a+4] = nomprog | (fragm << 16);
	 st--;
	 S[a+7] = level;
	 level ++;
	 b = *st;
	 b -= 0x00200106;
	 S[a+5] = ((tec - A)+b) | (level << 16);
	 S[a+6] = S[cadr + 8];
	 S[a+8]=0;
	 lcadr = a;
	}

	void F248()  //VIHOD IZ DIZJUNKTIVNOGO CHLENA ZA KONEC ILI

	{st--;
    if(ist == 0){otkat();return;}
	 else
     {level --;
      tec += (*st-L7);
	  if(S[lcadr + 2] == 4 && S[lcadr + 7] == level
	  && S[lcadr + 3] == cadr &&
      S[lcadr + 6] == S[cadr + 8])
      lcadr = S[lcadr + 1];
	  }
	}
	void F249()  // PEREHOD K SLEDUJUSHEMU DIZJUNKT.CHLENU

	{UINT a;
	 st--;
	 a = *st;
	 a -= L0;
	 S[lcadr + 5] += a;
	}

	void F250()  // VVOD KADRA PRODOLGENIJA DLJA DLJALUBOGO

	{UINT a; a = S[lcadr];
    if(delta == 1 && a > 14500){ind = 4;tipprer = 2;return;}
	 S[a+1] = lcadr;S[a+2] = 4;S[a] = a+9;S[a+3] = cadr;
	 S[a+4] = nomprog | (fragm << 16);st--;S[a+7] = level;
	 level ++;S[a+5] = ((tec - A)+(*st - 0x00200106)) | (level << 16);
	 S[a+6] = S[cadr + 8];S[a+8] = 0;lcadr = a;tec += 2;
	}


	void F251()  // ZAVERSHENIJE DLJALUBOGO PO ISTINE

	{level --;lcadr = S[lcadr + 1];}

	// F252 = F250 - VVOD KADRA PRODOLGENIJA DLJA SUSHESTVUET

	// F253 = F246 - ZAVERSHENIJE SUSHESTVUET PO LGI

	void F254()  // ZAVERSHENIJE SUSHESTVUET PO ISTINE

	{if (ist == 0) {otkat();return;}
	  else {level --;tec++;
		 while((S[lcadr + 2] != 4 && S[lcadr + 2] != 2)||
              S[lcadr + 3] != cadr ||
              S[lcadr + 7] != level)
			 lcadr = S[lcadr + 1];raschist();
			 }
	}

	// F255 = F247 - VVOD KADRA PRODOLGENIJA DLJA ALTERNATIVA

	void F256()  // VIHOD NA KONEC ALTERNATIVI PO ISTINE

	{st--;
    if(ist == 0){otkat();return;}
	 else
     {level --;tec += (*st-0x00200106);
		if (S[lcadr + 2] == 4 && S[lcadr + 7] == level
          && S[lcadr+3] == cadr)
		 lcadr = S[lcadr + 1];
	  }
	}

	void F257()  //  PEREHOD NA KONEC V VARIANTE POSLE PERVOGO SLUCHAJA

	{st--;tec += (*st-0x00200106);}

	void F258()  // INICIALIZACIJA NAKOPITELJA DLJA PERECHISLENIJA / VIPISKI

	{*st = L3;st++;}

	void F259()  // VVOD KADRA PRODOLGENIJA DLJA PERECHISLENIJA

	{UINT a; a = S[lcadr];S[a+1] = lcadr;
    S[a+2] = 4;S[a] = a + 11;
	 S[a+3] = cadr;S[a+4] = nomprog | (fragm << 16);st--;
	 S[a+7] = level;level ++;
	 S[a+5] = ((tec - A)+(*st - 0x00200106))|(level << 16);
	 S[a+6] = S[cadr + 8];lcadr = a;st--;
    S[a+8] = 4;
	 S[a+9] = *st;
	 S[a+10]=0;tec += 2;
	}

	// F260 =  F259 - VVOD KADRA PRODOLGENIJA DLJA VIPISKI

	void F261()  // KORREKCIJA NAKOPITELJA DLJA PERECHISLENIJA

	{UINT a,b,c;
	 a = lcadr;
    while(S[a+2] != 4 || S[a+7] >= level ||
           S[a+3] != cadr)a = S[a+1];
	 st--;
    if(S[a+9] == L3)
	  {b = mem(24);if(b == 0)return;
      for(c = 2;c < 22;c++)Z[b+c] = 0;
      S[a+9] = b;S[a+10] = b+2;
     }
	 else
     {b = S[a+9]+2;
      while (!(Z[b] & T1))
		{if(sravn(Z[b],*st) == 1){otkat();return;}
		 b +=2;
		}
	  }
	 if(Z[S[a+10]] & T1)udlin(a);
    if(ind == 4)return;
    b = S[a+10];
	 Z[b] = *st;Z[b+1] = 0;
    S[a+10] = b+2;otkat();
	}


	void F262()  // KORREKCIJA NAKOPITELJA DLJA VIPISKI

	{UINT a,b,c;
	  a = lcadr;
     while(S[a+2] != 4 || S[a+7] >= level ||
           S[a+3] != cadr)a = S[a+1];
	  if(S[a+9] == L3)
      {b = mem(24);if(b == 0)return;
       for(c = 2;c < 22;c++)Z[b+c] = 0;
       S[a+9] = b;
	    S[a+10] = b+2;
      }
	  if(Z[S[a+10]] & T1)udlin(a);
	  if(ind == 4) return;
	  st--;b = S[a+10];
     Z[b] = *st;Z[b+1] = 0;S[a+10] = b+2;
	  otkat();
	}

	void F263()  // OBRABOTKA NAKOPITELJA DLJA PERECHISLENIJA / VIPISKI

	{UINT a,b,c;
	 a = S[lcadr + 9];
	 if(a != L3)
     {b = S[lcadr + 10];c = a + Z[a] -2;
		if(c > b)
       {Z[b]=T1;Z[b+1]=0;Z[b+2] = c - b;
		  Z[b+3] = tact;Z[a] = b + 2 - a;
		 }
      if(Z[a] == 6 && Z[a+2] & T6)Z[a+3] = 0x00030002;
	  }
	 *st = a;st++;level --;lcadr = S[lcadr + 1];
	}

	void F264()  // INICIALIZACIJA NAKOPITELJA DLJA SUMMAVSEH

	{*st = L0;st++;}

	void F265()  // KORREKCIJA NAKOPITELJA DLJA SUMMAVSEH

	{UINT a,b;
	 a = lcadr;
    while(S[a+2] != 4 || S[a+7] >= level ||
          S[a+3] != cadr)a = S[a+1];
	 st--;
	 if(S[a+9] & T6)
	  {if(*st & T6)
		 {b = S[a+9]+(*st - L0);
		  if(b < 0x0002FFFF)S[a+9] = b;
		  else S[a+9] = summa(nomer(S[a+9] - 0x00000104),*st);
		 }
		else S[a+9] = summa(nomer(S[a+9] - 0x00000104),*st);
	  }
	 else S[a+9] = summa(S[a+9],*st);otkat();
	}

	void F266()  // OBRABOTKA NAKOPITELJA DLJA SUMMAVSEH

	{UINT a;
	  a = S[lcadr + 9];
     if(a & T6 && a > 0x0020010D)
		a = nomer(a - 0x00000104);
     *st = a;st++;
	  level --;lcadr = S[lcadr + 1];
	}

	//F267 = F259 - VVOD KADRA PRODOLGENIJA DLJA SUMMAVSEH

	void F268() // SHAG POZICII

	{UINT a;
	  a = S[lcadr + 10] + 2;
	  if(Z[a] & T1)
     {S[cadr+8] = S[lcadr+6];
      lcadr = S[lcadr + 1];ist = 0;
     }
	  else {S[lcadr + 10] = a;opr(S[lcadr + 11],a);}
	}

	void F269() // SHAG PODCHINENO

	{UINT a,b;
	  if(S[lcadr + 9] == 0x00200001)
		 {S[lcadr + 10] += 2;
			if(S[lcadr + 10] == S[lcadr + 11])
			  {S[cadr+8] = S[lcadr+6];
            lcadr = S[lcadr + 1];ist = 0;
           }
			else opr(S[lcadr + 12],S[lcadr + 10]);
		 }
	  else {a = S[lcadr + 10];b = Z[a+1] >> 16;
				if(b == 3){lcadr = S[lcadr + 1];ist = 0;}
				else
             {a -= b;S[lcadr + 10] = a;
              opr(S[lcadr + 11],a);
             }
			 }
	}

	void F270() // SHAG OPERANDA

	{UINT a;
	  a = S[lcadr + 9];
     a += (Z[a+1] & T4);
     if(a != S[lcadr + 10])
      {S[lcadr + 9] = a;
       opr(S[lcadr + 11],a);
      }
	  else
      {S[cadr+8] = S[lcadr+6];
       lcadr = S[lcadr + 1];ist = 0;
      }
	}

	void F271() // SHAG ANTECEDENTA

	{UINT a;
	 a = S[lcadr + 9];a += (Z[a+1] & T4);
	 if(Z[a] == L11)
	  {S[cadr+8] = S[lcadr+6];lcadr = S[lcadr + 1];ist = 0;}
	 else {S[lcadr + 9] = a;opr(S[lcadr + 10],a);}
	}

	void F272() // SHAG kluch'a (simvolnij kluch)

	{UINT a,b,c;
	  c = S[lcadr + 11];
	  for(a = S[lcadr + 9] + 2,b = Z[a]; !(b & T1);
     a += 2,b = Z[a])
		 {if(((b & T6)? b : Z[b+2]) == c)
			{opr(S[lcadr + 12],b);S[lcadr + 9] = a;return;}
		 }
     S[cadr+8] = S[lcadr+6];
	  lcadr = S[lcadr + 1];ist = 0;
	}

	void F273() // SHAG CELI

	{UINT a,b;
	 a = S[lcadr + 9] + 2;b = Z[a];
	 if(b & T1)
     {S[cadr+8] = S[lcadr+6];lcadr = S[lcadr + 1];ist = 0;}
	 else {S[lcadr + 9] = a;opr(S[lcadr + 11],b);}
	}

	void F274() // SHAG VHOGDENIETERMA

	{UINT a,b,c,d,e;
	 a = S[lcadr + 11] + 2;
    b = S[lcadr + 11] + Z[S[lcadr + 11]] - 2;
	 for(c = S[lcadr + 9] + 2; !(Z[c] & T1); c += 2)
	  {for(d = a,e = c; d < b; d += 2,e += 2)
	    {if(Z[d] != Z[e] || ((Z[d+1]^Z[e+1]) & T4))break;
	    }
	   if(d == b)
	    {opr(S[lcadr + 12],c);S[lcadr + 9] = c;return;}
	  }
    S[cadr+8] = S[lcadr+6];
	 lcadr = S[lcadr + 1];ist = 0;
	}

	void F275() // SHAG SERII

	{UINT a,b;
	 for(a = lcadr + 9;a != S[lcadr];a += 3)
	  {b = S[a] + 2;
      if(Z[b] & T1)
       {S[cadr+8] = S[lcadr+6];
        lcadr = S[lcadr + 1];ist = 0;return;
       }
	   S[a] = b;
	  }
	 for(a = lcadr + 9;a != S[lcadr];a += 3)opr(S[a+2],S[a]);
	}

	void F276() // SHAG POSTPOZICIJA

	{UINT a;
	 a = S[lcadr + 9] + 2;
	 if(Z[a] & T1)
     {S[cadr+8] = S[lcadr+6];lcadr = S[lcadr + 1];ist =0;}
	 else {S[lcadr + 9] = a;opr(S[lcadr + 10],a);}
	}

	void F277() // SHAG NADZADACHI

	{UINT a;
	  a = lcadr;
	  while(S[a+2] != 1 || S[a+9] != S[lcadr + 9])a = S[a+1];
	  do{a = S[a+1];
		  if((S[a+2] == 1) && (S[a+9] != S[lcadr + 9]) &&
           (S[lcadr + 10] == L0 ||
			   S[lcadr + 10] == Z[S[a+9]+2]))
			{opr(S[lcadr + 11],S[a+9]);S[lcadr + 9] = S[a+9];return;
			}
		 }
	  while(a != 0);
     S[cadr+8] = S[lcadr+6];
	  lcadr = S[lcadr + 1];ist = 0;
	}

	//  F278 = F276 - SHAG NOVPOZICII

	void F279() // SHAG KONTRSERII

	{UINT a,b;
	 for(a = lcadr + 9;a != S[lcadr];a += 2)
	  {b = S[a] - 2;
	   if(Z[b+1] & T1)
       {S[cadr+8] = S[lcadr+6];lcadr = S[lcadr + 1];
        ist = 0;return;
       }
	   S[a] = b;
	  }
	 for(a = lcadr + 9;a != S[lcadr];a += 2)opr(S[a+1],S[a]);
	}

	void F280() // SHAG RAZRJADA

	{UINT a,b;
	 b = S[lcadr + 12];
	 for(a = S[lcadr + 9] + 2; !(Z[a] & T1); a += 2)
	  {if(Z[a] == b)
	   {opr(S[lcadr + 11],a);S[lcadr + 9] = a; return;
	   }
	  }
    S[cadr+8] = S[lcadr+6];
	 lcadr = S[lcadr + 1];ist = 0;
	}

	void F281()  // SHAG POSILKI

	{UINT a; a = S[lcadr + 9] + 2;
	 if(Z[a] & T1)
     {S[cadr+8] = S[lcadr+6];lcadr = S[lcadr + 1];ist = 0;}
	 else
     {S[lcadr + 9] = a;opr(S[lcadr + 11],Z[a]);
		opr(S[lcadr + 12],a);
	  }
	}

	// F282 = F281 - SHAG USLOVIJA

	void F283() // SHAG BIKLUCH

	{UINT a,b,c,d;
		a = S[lcadr + 11];b = S[lcadr + 12];
		for(c = S[lcadr + 9] + 2,d = Z[c]; !(d & T1); c += 2,d = Z[c])
		  {if(!(d & T6) && Z[d+2] == a && sravn(Z[d+4],b))
			  {opr(S[lcadr + 13],d);S[lcadr + 9] = c;return;
			  }
		  }
      S[cadr+8] = S[lcadr+6];
		lcadr = S[lcadr + 1];ist =0;
	}

	void F286() // SHAG NOVAJAPOSILKA

	{UINT a,b;
	  for(a = S[lcadr + 9] + 2,b = S[lcadr + 10] + 2; !(Z[b] & T1);
			 a += 2,b += 2)
		 if(Z[b] == S[lcadr +14])
			{opr(S[lcadr + 12],Z[a]);opr(S[lcadr + 13],a);S[lcadr + 9] = a;
			  S[lcadr + 10] = b;return;
			}
      S[cadr+8] = S[lcadr+6];
		lcadr = S[lcadr + 1];ist = 0;
	}

	// F287 = F286 - SHAG NOVOEUSLOVIE

	// F288 = F273 - SHAG NEIZVESTNIE

	// F289 = F273 - SHAG VHODIT


	void F290() // OBRABOTKA VETVI

	{ UINT a;a = S[lcadr];S[a+1] = lcadr;
     S[a+2] = 4;S[a] = a + 9;
	  S[a+3] = cadr;S[a+4] = nomprog | (fragm << 16);
     S[a+5] = (tec - A);
	  S[a+6] = S[cadr + 8];S[a+7] = 0;S[a+8] = 0;
     lcadr = a;tec += 2;
	}

	void F291()  //  PEREHOD NA NOVIJ FRAGMENT PO VETVI

	{if(blokprer == 0)
    {lcadr = S[lcadr + 1];}
    st--;perehod(*st);
   }

	void F292()  // OBRASHENIJE K PROGRAMME OPERATORA

	{UINT a,b,c,e,g,h,p,m;
    if(lcadr > 13000 && Scontr == 0)
     {Scontr = 1;tipprer = 10;initprer(1);return;}
    if(Scontr == 1 && lcadr < 13000)
     Scontr = 0;
	m = *(st-2);
	m -= 0x00200001;
	p = KC[m];
	if(p != 0)
	 {h = *(st-1);
	  h -= L0;
      h += 2;
	  vdannie = st - h;
	  fiksr = 0;
	  inter2[p-1]();
	  st = vdannie;
	  return;
	 }
    if(*(st-2) == 0x00200191)
       {if(PR[prer] == 19)
       {m = intchisl(*(st-4));
        SD[cadr] = m;
        m = *(st-5); m &= 0x0007FFFF;
        p = *(st-3);
        if( !(p & 0x00200000))
         {p = Z[p+2];}
        p &= 0x0007FFFF;
        SD[cadr+1] = m;
		SD[cadr+3] = p;
       }
      if((kontrhol == 1 || kontrhol == 2) && kontrpr == 0)
       {a = S[lcadr];
     	S[a+1] = lcadr; S[a+2] = 4; S[a] = a + 14;
        S[a+3] = cadr; S[a+4] = 0; S[a+5] =  0;
        S[a+6] = S[cadr+8]; S[a+7] = 0xFFFFFFFF;
        S[a+8] = 3; lcadr = a; S[a+9] = *(st-5);
        S[a+10] = *(st-4); S[a+11] = *(st-3);
        *((UINT64*)(S+a+12)) = step;
		}
      if(kontrpr == 0 && PR[prer] == 16 &&
         (PR[prer+1] == cadr || PR[prer+1] == 0xFFFFFFFF)
         && PR[prer+2] == *(st-5) && sravn(PR[prer+3],
         *(st-4)) && sravn(PR[prer+5],*(st-3)))
       {PR[prer] = 8;PR[prer+1] = cadr;
        PR[prer+2] = 0;PR[prer+3] = 0;
        PR[prer+4] = 0;PR[prer+5] = 0;
		PR[prer+6] = 0;
       }
      if(BT[0] != 1 && (*(st-3) == 0x00200207 ||
         *(st-3) == 0x00200283))
       {b = *(st-5);
        c = convchisl(*(st-4));
        e = 0;
        for(g = 1; g < BT[0]; g += 2)
         {if(BT[g] == b && BT[g+1] == c)
           {e = 1; break;
           }
         }
        if(e == 0)
         {ist = 0; st -= 5; return;}
       }
      if(filtpr == 1)
       {b = *(st-5) << 16;
        c = convchisl(*(st-4));
        b |= c;
        e = 1; g = FBUF[0]; // e,g - granici promegutka
	     while (e <= g)
	      {h = (e + g)/2;
		    p = FBUF[h];
          if(p < b)e = h+1;
          else
           {if(b < p)g = h-1;
            else
             {m = *(st-3);
              if(!(m & 0x00200000))m = Z[m+2];
              if(m != 0x002002C2 && m != 0x00200195 &&
                 m != 0x0020018F && m != 0x00200102)
               {ist = 0; st -= 5; return;}
              else break;
             }
           }
         }
       }
      else
       {if(kontrpr == 0)
         {st -= 5; return;}
       }
     }

    if(blokprer == 0)
     {novcadr(2,S[cadr + 8]);
      S[lcadr+7] = level;
      level = 0; nachprog();
      if((PR[prer] == 2 || PR[prer] == 17) &&
         (symbol == 0x00200414 || symbol == 0x00200528
         || symbol == 0x00200349 || symbol == 0x002001B3
		 || symbol == 0x002002EC || symbol == 0x00200EB7
         || symbol == 0x00200ED1 || symbol == 0x00200ED2
         || symbol == 0x00200F19 || symbol == 0x00200F69
         || symbol == 0x00200FD7 || symbol == 0x002012A5
		 || symbol == 0x002012A6 || symbol == 0x00201298
		 || symbol == 0x002012E2 || symbol == 0x0020129B
		 || symbol == 0x002012A4 || symbol == 0x0020051B
		 || symbol == 0x00201368
		 )
          && S[S[cadr + 3] + 3] == PR[prer + 1])
       {tipprer = 9;tec++;initprer(2);return;}
	  if(PR[prer] == 22 && symbol == 0x00200182)
	   {tipprer = 9;tec++;initprer(2);return;}
	  if((symbol == 0x002001E7 || symbol == 0x002005FA
         ||symbol == 0x0020044B)
       && PR[prer] == 17 && PR[prer +1] == S[cadr+3])
       {tipprer = 9;tec++;initprer(2);return;}
      if(PR[prer] == 19 && (symbol == 0x00200142 || symbol
         == 0x0020014B || symbol == 0x00200341 || symbol
         == 0x002001A5 || symbol == 0x002003DA || symbol
         == 0x00200559 || symbol == 0x002001E7 || symbol
         == 0x002005FA || symbol == 0x00200414 || symbol
         == 0x00200528 || symbol
		 == 0x0020051B))
       {tipprer = 11;tec++;initprer(2);return;}
     }
   }

	void F293()  // OBRASHENIJE K PROGRAMME OPERATORNOGO VIRAGENIJA

   {UINT h,m,n;
    if(lcadr > 13000 && Scontr == 0)
     {Scontr = 1;tipprer = 10;initprer(1);return;}
    if(Scontr == 1 && lcadr < 13000)
     Scontr = 0;
    m = *(st-2);
  	m -= 0x00200001;
  	n = KC[m];
	if(n != 0)
	 {h = *(st-1);
	  h -= L0;
      h += 2;
      vdannie = st - h;
      fiksr = 0;
      inter2[n-1]();
      return;
     }
    if(blokprer == 0)
    {novcadr(3,L0);S[lcadr+7] = symbol;
     nachprog();level = 0;
    }
   }

	void F294()  // PEREKLJUCHATEL V DLJALUBOGO

	{if (ist == 1){otkat();return;}
	 else{level --;tec++;
	  while ((S[lcadr + 2] != 4 && S[lcadr + 2] != 2)||
             S[lcadr + 7] != level ||
             S[lcadr + 3] != cadr)
     lcadr = S[lcadr + 1];
	  raschist();}
	}

	void F295()  //  PEREKLJUCHATEL V ALTERNATIVE

	{st--;if(ist == 0){ist = 1;tec += (*st-0x00200106);}
	}

	// F296 = F295 - PEREKLUCHATEL V VARIANTE

	void F297()  // PEREKLUCHATEL DLJA INACHE

	{if(ist == 1) {tec++;return;}
	 else perehod(*tec);
	}
	void F298() // IZMENENIE ZNACHENIJA IST NA PROTIVOPOLOGNOE

	{ist = 1 - ist;
   }

   void F299() // metka

   {st--; return;}

   void F300() // priem

   {UINT a,b,c,*d,n,m;
    st--;
    a = (*st - L0);m = a;
    priem[a] = 0;
    while(a > 0)
     {st--; a--; b = *st; priem[a] = b;
     }
    n = 0;
    for(a = 0; a < m; a++)
     {b = priem[a]-L0;
      n *= 10; n += b;
     }
    SD[cadr] = n; SD[cadr+1] = 0; SD[cadr+3] = 0;
     if(PR[prer] == 18)
      {b = PR[prer+3] + 2;a = 0;c = 0;
       while(c == 0 && priem[a] != 0 && !(Z[b] & T1))
        {if(Z[b] != priem[a])c = 1;
         a++; b += 2;
        }
       if(c == 0 && priem[a] == 0 && (Z[b] & T1))
        {b = fragm;d = A;
         while(a = d[b+3],a & 0xFFFF0000)
		    {b = a & T11;d = P[(a >> 19) - 1];
		    }
         a |= 0x00200000;
         if(a == PR[prer+2])
          {PR[prer] = 8;PR[prer+1] = cadr;
           PR[prer+2] = 0;PR[prer+3] = 0;
           PR[prer+4] = 0;PR[prer+5] = 0;
		   PR[prer+6] = 0;
          }
        }
      }
    return;
   }

   void F301() // shag limita

   {lcadr = S[lcadr+1];ist = 0;}

   void F302() // shag Kluch'a (nesimvolnij kluch)

   {UINT a,b,c;
	  c = S[lcadr + 11];
	  for(a = S[lcadr + 9] + 2,b = Z[a]; !(b & T1);a += 2,b = Z[a])
		 {if( !(b & T6) &&  (Z[b+1] & T1) && sravn(Z[b+2],c))
       	{opr(S[lcadr + 12],b);S[lcadr + 9] = a;return;}
		 }
     S[cadr+8] = S[lcadr+6];
	  lcadr = S[lcadr + 1];ist = 0;
	}

   void F303()  // shag kluchpodobija

   {UINT a,b,c,d;
     c = S[lcadr + 11]; d = kodpodobija(c);
  	  for(a = S[lcadr + 9] + 2,b = Z[a]; !(b & T1);
       a += 2,b = Z[a])
	   {if(!(b & T6) && Z[b] == Z[c] && Z[b+2] == Z[c+2]
       && kodpodobija(b) == d)
       {opr(S[lcadr + 12],a);S[lcadr + 9] = a;return;}
	   }
     S[cadr+8] = S[lcadr+6];
	  lcadr = S[lcadr + 1];ist = 0;
   }

   void F304() // shag videokljuch'a

	{UINT a,b,c,d,e;
	  a = S[lcadr + 9] - L0; a++;
     b = S[lcadr + 10] - L0;
     c = S[lcadr + 11];
	  for(d = a; d <= b;d++)
      {e = MT[d] & 0x000000FF; e += L0;
       if(e == c)
        {d += L0; opr(S[lcadr + 12],d);
         S[lcadr + 9] = d;return;
        }
		}
     S[cadr+8] = S[lcadr+6];
	  lcadr = S[lcadr + 1];ist = 0;
	}

   void F305() // shag tablznachenija perechisljajushego

   {UINT a,b,c,d;
    a = S[lcadr + 11];
    b = S[lcadr + 12];
    for(c = b + 2;!(Z[c] & T1);c += 2)
		 {if(sravn(Z[c],a))
          {d = c - S[lcadr + 9];
           d += S[lcadr + 10];
           opr(S[lcadr + 13],Z[d]);
           if(ind == 4)return;
			  S[lcadr + 12]= c;
           return;
			 }
       }
    S[cadr+8] = S[lcadr+6];
	 lcadr = S[lcadr + 1];ist = 0;
   }

   void F306() // shag SMISTOCHNIK

   {UINT a,b,c,d,*f,g,e;
    a = S[lcadr+9] & 0x0000FFFF;
    d = a;
    a = S[a + 3];
	 if(a == 0 || a >= 0x5FFFFFFF)
     {S[cadr+8] = S[lcadr+6];
	   lcadr = S[lcadr + 1];
      ist = 0;return;
     }
    b = S[a+2];
     if(b == 1)
      {c = S[a+9];c = Z[c+2];
       opr(S[lcadr+10],c);
       opr(S[lcadr+11],0x00200105);
      }
     if(b == 2)
      {f = P[S[d+4] & 0x0000FFFF];e = S[d+4] >> 16;
       while(g = f[e+3],g & 0xFFFF0000)
		 {e = g & T11;f = P[(g >> 19) - 1];
		 }
		 opr(S[lcadr+10], 0x00200000 | g);
       opr(S[lcadr+11], 0x00200106);
      }
     if(b == 3)
      {opr(S[lcadr+10], S[a+7]);
       opr(S[lcadr+11], 0x00200107);
      }
     if(b == 4)
      {opr(S[lcadr+10], 0x00200104);
       opr(S[lcadr+11], 0x00200108);
      }
    opr(S[lcadr+12], 0x00200000 | a);
	 S[lcadr+9] = (0x00200000 | a);
    return;
   }

   void F307()  // shag POISKSLOVA

   {UINT a,d;
    a = S[lcadr + 9] - 0x00200104;
    B1 = S[lcadr + 10] & 0x0007FFFF;
    B2 = S[lcadr + 11] & 0x0007FFFF;
    B4 = S[lcadr + 13] & 0x0007FFFF;
    B3 = S[lcadr + 12] & 0x0007FFFF;
    B7 = S[lcadr + 16] & 0x0007FFFF;
    d = sledslovo(a);
    if(d == 0)
     {S[cadr+8] = S[lcadr+6];
	   lcadr = S[lcadr + 1];
      ist = 0; return;
     }
    opr(S[lcadr + 14],d | 0x00200000);
    opr(S[lcadr + 15],B5 + 0x00200104);
    S[lcadr + 10] = 0x00200000 | B1; // nachalo otrezka
    S[lcadr + 11] = 0x00200000 | B2; // konec otrezka
	S[lcadr + 12] = 0x00200000 | B3; // nignjaja granica
                                      // prodolgenija
    S[lcadr + 13] = 0x00200000 | B4; // chislo sravni-
                                      // vaemih pri prodol-
                                      // genii razrjadov
    S[lcadr + 16] = 0x00200000 | B7;  // chislo sravnivaemih
                      // razrjadov dlja tek. otrezka.
    return;
   }

   void F308() // shag TEKSLOVO

   {UINT a,b;
    a = S[lcadr+9];
    b = shagslova();
    if(b == 0)
     {S[cadr+8] = S[lcadr+6];
	   lcadr = S[lcadr + 1];
      ist = 0;return;
     }
    else opr(a,b);
    return;
   }

   void F309() // perekljuchatel KONTROLPRIEMA.

   {st--;
    if(kontrpr == 0 && PR[prer] != 16 && PR[prer] != 19
       && filtpr == 0 && kontrhol == 0 && BT[0] == 1)
     {tec += (*st - 0x00200106);
     }
   }

   void F310() // shag perechislcelie

	{UINT a,c;
    int d,e;
    a = S[lcadr + 9]; d = Z[a+3];
    c = S[lcadr + 10];
    e = Z[c+3];
    if(d < e)
     {Z[a+3] = (d+1); opr(S[lcadr + 11],a); return;
     }
	 S[cadr+8] = S[lcadr+6];
	 lcadr = S[lcadr + 1];ist = 0;
	}

  void F311() // SHAG NOVPOSILKA

	{UINT a,b;
	  for(a = S[lcadr + 9] + 2,b = S[lcadr + 10] + 2; !(Z[b] & T1);
			 a += 2,b += 2)
		 if(Z[b] <= S[lcadr +14])
			{opr(S[lcadr + 12],Z[a]);opr(S[lcadr + 13],a);S[lcadr + 9] = a;
			  S[lcadr + 10] = b;return;
			}
      S[cadr+8] = S[lcadr+6];
		lcadr = S[lcadr + 1];ist = 0;
	}

   UINT K1(UINT a,UINT b,UINT c)
	{return 0;
	}

	UINT K2(UINT a,UINT b,UINT c)  // transljacia operandov + zagolovok

	{UINT d,e,f,g;
    f = 0xFFFFFFFF;
    g = Z[b];
    if(g == 0x00200001 && Z[b+2] == 0x00200061)
    {f = c; R[c] = 0x00200104;
     R[c+1] = 0x00100135;
     c += 2;
    }
	 d = b + (Z[b+1] & T4);e = b + 2;
	 while(e < d)
	 {c = konvoper(a,e,c);
     e += (Z[e + 1] & T4);}
	 R[c] = (0x00100000 | (Z[b] & T4));c++;
    if(f != 0xFFFFFFFF)
     {R[f] += (c - f);
     }
	 return c;
	}

	UINT K3(UINT a,UINT b,UINT c) // ne

	{c = konvoper(a,b+2,c);R[c] = 0x0010012A;c++;return c;}

	UINT K4(UINT a,UINT b,UINT c) // null-mestnie operatori

	{R[c] = (0x00100000 | (Z[b] & T4));c++;return c;}

	UINT K5(UINT a,UINT b,UINT c) // prisvoenie znachenija peremennoj

	{R[c] = Z[b+2] & T4;
    c++;R[c] = (0x00100000 | (Z[b] & T4));
	 c++;return c;
	}

	UINT K6(UINT a,UINT b,UINT c) // i

	{UINT d,e,f;
	 d = c;c++;R[c] = 0x001000F4;c++;
    e = b + (Z[b+1] & T4);f = b + 2;
	 while(f < e)
	 {c = konvoper(a,f,c);R[c] = 0x001000F3;c++;
	  f += (Z[f+1] & T4);
	 }
	 R[c] = 0x001000F5;c++;R[c] = 0x001000F6;
	 e = c - d;c++;R[d] = 0x00200104 + e;
	 return c;
	}

	UINT K7(UINT a,UINT b,UINT c) // plavajushee chislo operandov

	{UINT d,e,f;
	 d = 0x00200104;e = b + (Z[b+1] & T4);f = b + 2;
	 while(f < e)
	 {c = konvoper(a,f,c);d++;f += (Z[f+1] & T4);}
	 R[c] = d;c++;R[c] = 0x00100000 | (Z[b] & T4);
	 c++;
	 return c;
	}

	UINT K8(UINT a,UINT b,UINT c) // pozicia

	{return konvperechisl(a,b,c,0x0010010C);
	}

	UINT K9(UINT a,UINT b,UINT c) // spravka

	{UINT d,e,f;
	 d = 0x00200102;e = b + (Z[b+1] & T4);f = b + 2;
	 while(f < e)
	 {c = konvoper(a,f,c);d++;f += (Z[f+1] & T4);}
	 R[c] = d;c++;R[c] = 0x00100000 | (Z[b] & T4);
	 c++;
	 return c;
	}

	UINT K10(UINT a,UINT b,UINT c) // podchineno

	{return konvperechisl(a,b,c,0x0010010D);
	}

	UINT K11(UINT a,UINT b,UINT c) // operand

	{return konvperechisl(a,b,c,0x0010010E);
	}

	UINT K12(UINT a,UINT b,UINT c) // ili

	{UINT d,*e,f,g,*h;
	 d = c;c++;e = st;
	 R[c] = 0x001000F7;c++;
	 f = b + (Z[b+1] & T4);g = b + 2;
	 while (g < f)
	 {c = konvoper(a,g,c);*st = c;c++;st++;
	  R[c] = 0x001000F8;c++;
	  R[c] = 0x001000F6;
	  R[d] = (0x00200104 + (c - d));
	  d = c;c++;
	  if(g + (Z[g+1] & T4) != f)
	  {R[c] = 0x001000F9;c++;}
	  g += (Z[g+1] & T4);
	 }
	 c--;
	 for(h = e;h < st;h++)
	 {g = *h;R[g] = (0x00200104 + (c - g));}
	 st = e;
	 c++;
	 return c;
	}

	UINT K13(UINT a,UINT b,UINT c) // dljaljubogo

	{UINT d,f;
	 d = c;c++;R[c] = 0x001000FA;c++;
	 f = b + 2;R[c] = Z[f] & T4;c++;
	 while(Z[f] != 0x00200136){R[c] = Z[f] & T4;f += (Z[f+1] & T4);}
	 c++;f += 2;
	 while(Z[f] != 0x00200137)
	 {c = konvoper(a,f,c);R[c] = 0x001000F3;c++;
	  f += (Z[f+1] & T4);
	 }
	 f += 2;
	 c = konvoper(a,f,c);R[c] = 0x00100126;c++;
	 R[c] = 0x001000FB;
	 R[d] = 0x00200104 + (c - d);c++;
	 return c;
	}

	UINT K14(UINT a,UINT b,UINT c) // sushestvuet

	{UINT d,e,f,g;
	 d = c;c++;R[c] = 0x001000FC;c++;
	 e = b + (Z[b+1] & T4); f = b + 2;R[c] = Z[f] & T4;c++;
	 while((g = f + (Z[f+1] & T4),g != e)){R[c] = Z[f] & T4;f = g;}
	 c++;
	 if(Z[f] == 0x00200005)f += 2;
	 while(f < e)
	 {c = konvoper(a,f,c);R[c] = 0x001000F3;c++;
	  f += (Z[f+1] & T4);
	 }
	 R[c] = 0x001000FE;c++;
	 R[c] = 0x001000FD;
	 R[d] = 0x00200104 + (c - d);c++;
	 return c;
	}

	UINT K15(UINT a,UINT b,UINT c) // alternativa

	{UINT d,e;
	 b += 2;c = konvoper(a,b,c);d = c;c++;
	 R[c] = 0x00100127;c += 2;
	 R[c] = 0x001000FF;c++;b += (Z[b+1] & T4);
	 c = konvoper(a,b,c);e = c;c++;
	 R[c] = 0x00100100;c++;
	 R[d] = 0x00200104 + (c - d);c++;
	 R[c] = 0x001000FF;c++;b += (Z[b+1] & T4);
	 c = konvoper(a,b,c);R[c] = 0x00200107;c++;
	 R[c] = 0x00100100;c++;
	 R[c] = 0x001000F6;R[d+2] = 0x00200102 + (c - d);
	 R[e] = 0x00200105 + (c - e);
	 R[e + 2] = 0x00200102 + (c - e);
	 c++;
	 return c;
	}

	UINT K16(UINT a,UINT b,UINT c) // variant

	{UINT d,e;
	 b += 2;c = konvoper(a,b,c);d = c;c++;
	 R[c] = 0x00100128;c++;b += (Z[b+1] & T4);
	 c = konvoper(a,b,c);e = c;c++;
	 R[c] = 0x00100101; R[d] = 0x00200105 + (c - d);
	 c++;b += (Z[b+1] & T4);
	 c = konvoper(a,b,c);R[e] = 0x00200104 + (c - e);
	 return c;
	}

	UINT K17(UINT a,UINT b,UINT c) // perechislenie

	{UINT e,f,g;
	 R[c] = 0x00100102;c++;e = c;c++;
	 R[c] = 0x00100103;c++;
	 f = b + 2;R[c] = Z[f] & T4;c++;
	 while(Z[f] & 0x00400000){R[c] = Z[f] & T4;f += 2;}
	 c++;
	 g = f + (Z[f+1] & T4);if(Z[f] == 0x00200005)f += 2;
	 while(f < g)
	 {c = konvoper(a,f,c);f += (Z[f+1] & T4);
	  R[c] = 0x001000F3;c++;
	 }
	 c = konvoper(a,g,c);R[c] = 0x00100105;c++;
	 R[c] = 0x00100107;R[e] = 0x00200104 + (c-e);
	 c++;
	 return c;
	}

	UINT K18(UINT a,UINT b,UINT c) // summavseh

	{UINT e,f,g;
	 R[c] = 0x00100108;c++;e = c;c++;
	 R[c] = 0x0010010B;c++;
	 f = b + 2;R[c] = Z[f] & T4;c++;
	 while(Z[f] & 0x00400000){R[c] = Z[f] & T4;f += 2;}
	 c++;
	 g = f + (Z[f+1] & T4);if(Z[f] == 0x00200005)f += 2;
	 while(f < g)
	 {c = konvoper(a,f,c);f += (Z[f+1] & T4);
	  R[c] = 0x001000F3;c++;
	 }
	 c = konvoper(a,g,c);R[c] = 0x00100109;c++;
	 R[c] = 0x0010010A;R[e] = 0x00200104 + (c-e);
	 c++;
	 return c;
	}

	UINT K19(UINT a,UINT b,UINT c) // vipiska

	{UINT e,f,g;
	 R[c] = 0x00100102;c++;e = c;c++;
	 R[c] = 0x00100104;c++;
	 f = b + 2;R[c] = Z[f] & T4;c++;
	 while(Z[f] & 0x00400000){R[c] = Z[f] & T4;f += 2;}
	 c++;
	 g = f + (Z[f+1] & T4);if(Z[f] == 0x00200005)f += 2;
	 while(f < g)
	 {c = konvoper(a,f,c);f += (Z[f+1] & T4);
	  R[c] = 0x001000F3;c++;
	 }
	 c = konvoper(a,g,c);R[c] = 0x00100106;c++;
	 R[c] = 0x00100107;R[e] = 0x00200104 + (c-e);
	 c++;
	 return c;
	}

	UINT K20(UINT a,UINT b,UINT c) // antecedent

	{return konvperechisl(a,b,c,0x0010010F);
	}

	UINT K21(UINT a,UINT b,UINT c) // kluch

	{return konvperechisl(a,b,c,0x00100110);
	}

	UINT K22(UINT a,UINT b,UINT c) // celb

	{return konvperechisl(a,b,c,0x00100111);
	}

	UINT K23(UINT a,UINT b,UINT c) // vhogdenieterma

	{return konvperechisl(a,b,c,0x00100112);
	}

	UINT K24(UINT a,UINT b,UINT c) // serija

	{UINT d,e,f;
	 d = 0x00200104;e = b + (Z[b+1] & T4);f = b + 2;
	 while(f < e)
	 {c = konvoper(a,f,c);d++;f += (Z[f+1] & T4);}
	 R[c] = d;c++;R[c] = 0x00100000 | (Z[b] & T4);
	 c++;R[c] = 0x00100113;c++;
	 return c;
	}

	UINT K25(UINT a,UINT b,UINT c) // postpozicija

	{return konvperechisl(a,b,c,0x00100114);
	}

	UINT K26(UINT a,UINT b,UINT c) // nadzadacha

	{return konvperechisl(a,b,c,0x00100115);
	}

	UINT K27(UINT a,UINT b,UINT c) // novpozicija

	{return konvperechisl(a,b,c,0x00100116);
	}

	UINT K28(UINT a,UINT b,UINT c) // kontrserija

	{UINT d,e,f;
	 d = 0x00200104;e = b + (Z[b+1] & T4);f = b + 2;
	 while(f < e)
	 {c = konvoper(a,f,c);d++;f += (Z[f+1] & T4);}
	 R[c] = d;c++;R[c] = 0x00100000 | (Z[b] & T4);
	 c++;R[c] = 0x00100117;c++;
	 return c;
	}

	UINT K29(UINT a,UINT b,UINT c) // razrjad

	{return konvperechisl(a,b,c,0x00100118);
	}

	UINT K30(UINT a,UINT b,UINT c) // posilka

	{return konvperechisl(a,b,c,0x00100119);
	}

	UINT K31(UINT a,UINT b,UINT c) // uslovie

	{return konvperechisl(a,b,c,0x0010011A);
	}

	UINT K32(UINT a,UINT b,UINT c) // bikluch

	{return konvperechisl(a,b,c,0x0010011B);
	}

	UINT K33(UINT a,UINT b,UINT c) // novajaposilka

	{return konvperechisl(a,b,c,0x0010011E);
	}

	UINT K34(UINT a,UINT b,UINT c) // novoeuslovie

	{return konvperechisl(a,b,c,0x0010011F);
	}

	UINT K35(UINT a,UINT b,UINT c) // neizvestnaja

	{return konvperechisl(a,b,c,0x00100120);
	}

	UINT K36(UINT a,UINT b,UINT c) // vhodit

	{return konvperechisl(a,b,c,0x00100121);
	}

	UINT K37(UINT a,UINT b,UINT c) // vetvb

	{UINT d,e,f;
	 d = 0x00200104;
	 while(!(Z[a+1] & T1))
	 {e = Z[a];f = Z[e + 2];
	  if(f == 0x002000F1 || f == 0x002000F2)d++;
	  a -= 2;
	 }
	 R[c] = 0x00100122;c++;
	 R[c] = d;c++;
	 R[c] = 0x00100123;c++;
	 konvssilka(b);
	 return c;
	}

	UINT K38(UINT a,UINT b,UINT c) // inache

	{UINT d,e,f;
	 d = 0x00200104;
	 while(!(Z[a+1] & T1))
	 {e = Z[a];f = Z[e + 2];
	  if(f == 0x002000F1 || f == 0x002000F2)d++;
	  a -= 2;
	 }
	 R[c] = 0x00100129;c++;
	 R[c] = d;c++;
	 konvssilka(b);
	 return c;
	}

	UINT K39(UINT a,UINT b,UINT c) // perestanovka

	{R[c] = (Z[b+2] & T4) + L0;
	 R[c+1] = (Z[b+4] & T4) + L0;
	 R[c+2] = 0x0010001C;c += 3;
	 return c;
	}

  	UINT K40(UINT a,UINT b,UINT c) // limit

   {return konvperechisl(a,b,c,0x0010012D);
	}

  	UINT K41(UINT a,UINT b,UINT c) // kluch nesimvolnij

	{return konvperechisl(a,b,c,0x0010012E);
	}

   UINT K42(UINT a,UINT b,UINT c) // kluchpodobija

   {return konvperechisl(a,b,c,0x0010012F);
   }

   UINT K43(UINT a,UINT b,UINT c) // videokljuch

   {return konvperechisl(a,b,c,0x00100130);
   }

   UINT K44(UINT a,UINT b,UINT c) // tablznachenie perechisl.

   {return konvperechisl(a,b,c,0x00100131);
   }

   UINT K45(UINT a,UINT b,UINT c) // smistochnik

   {return konvperechisl(a,b,c,0x00100132);
   }

   UINT K46(UINT a,UINT b,UINT c) // poiskslova

   {return konvperechisl(a,b,c,0x00100133);
   }

	UINT K47(UINT a,UINT b,UINT c) // tekslovo

   {return konvperechisl(a,b,c,0x00100134);
   }

   UINT K48(UINT a,UINT b,UINT c) // perechislceloe

	{return konvperechisl(a,b,c,0x00100136);
	}


   UINT K49(UINT a,UINT b,UINT c) // novposilka

	{return konvperechisl(a,b,c,0x00100137);
	}


   UINT D1(UINT *a,UINT b) // placeholder dekonvertora.a - ukazatel na
						  // nachalo fragmenta programmi.b - smeshenie tek.
						  // pozicii fragmenta programmi.Vozvrashaet smeshenie
						  // novoj tek.pozicii fragmenta programmi.V B1 zanosit
						  // smeshenie v R poslednej zanjatoj posle obrabotki
						  // otrezka jachejki.

	{b++;
	 return b;}

	UINT D2(UINT *a,UINT b) // odnomestnaja operacija

	{R[B1 + 2] = a[b] + 0x00100000;
	 R[B1+1] = (b << 16) +  (R[B1 - 1] & T4) + 2;
	 B1 += 2;b++;
	 return b;
	}

	UINT D3(UINT *a,UINT b) // ne

	{R[B1 + 2] = 0x00200002;
	 R[B1+1] = (b << 16) +  (R[B1 - 1] & T4) + 2;
	 B1 += 2;b++;
	 return b;
	}

	UINT D4(UINT *a,UINT b) // nul-mestnaja operacija

	{R[B1 + 2] = a[b] + 0x00100000;
	 R[B1+1] = (b << 16) + 2;
	 B1 += 2;b++;
	 return b;
	}

	UINT D5(UINT *a,UINT b) // operacija plavajushej
                           // arnosti

	{UINT c,d;
	 c = R[B1] - 0x00200104;d = B1 - 2;
	 while(c != 0)
	 {d -= (R[d - 1] & T4);c--;}
	 R[B1] = a[b] + 0x00100000;
	 R[B1 - 1] = (b << 16) +  (B1 - d);
	 b++;
	 return b;
	}

	UINT D6(UINT *a,UINT b) // perestanovka

	{UINT c;
	 c = (R[B1] - L0) | 0x00400000;R[B1] = c;
	 c = (R[B1 - 2] - L0) | 0x00400000;R[B1 - 2] = c;
	 B1 += 2;
	 R[B1] = 0x0020001C;
	 R[B1 - 1] = (b << 16) + 6;
	 b++;
	 return b;
	}

	UINT D7(UINT *a,UINT b) // dvumestnaja operacija

	{UINT c;
	 c = B1 - (R[B1-1] & T4);
	 c -= (R[c-1] & T4);
	 B1 += 2;
	 R[B1] = a[b] + 0x00100000;
	 R[B1-1] = (b << 16) +  (B1 - c);
	 b++;
	 return b;
	}

	UINT D8(UINT *a,UINT b) // dvumestnoe perechislenie

	{UINT c;
	 c = B1 - (R[B1-1] & T4);
	 c -= (R[c-1] & T4);
	 B1 += 2;
	 R[B1] = a[b] + 0x00100000;
	 R[B1-1] = (b << 16) +  (B1 - c);
	 b += 2;
	 return b;
	}

	UINT D9(UINT *a,UINT b) // spravka

	{UINT c,d;
	 c = R[B1] - 0x00200102;d = B1 - 2;
	 while(c != 0)
	 {d -= (R[d - 1] & T4);c--;}
	 R[B1] = a[b] + 0x00100000;
	 R[B1 - 1] = (b << 16) +  (B1 - d);
	 b++;
	 return b;
	}

	UINT D10(UINT *a,UINT b) // trehmestnaja operacija

	{UINT c;
	 c = B1 - (R[B1-1] & T4);
	 c -= (R[c-1] & T4);
	 c -= (R[c-1] & T4);
	 B1 += 2;
	 R[B1] = a[b] + 0x00100000;
	 R[B1-1] = (b << 16) +  (B1 - c);
	 b++;
	 return b;
	}

	UINT D11(UINT *a,UINT b) // trehmestnoe perechislenie

	{UINT c;
	 c = B1 - (R[B1-1] & T4);
	 c -= (R[c-1] & T4);
	 c -= (R[c-1] & T4);
	 B1 += 2;
	 R[B1] = a[b] + 0x00100000;
	 R[B1-1] = (b << 16) +  (B1 - c);
	 b += 2;
	 return b;
	}

	UINT D12(UINT *a,UINT b) // chetirehmestnaja operacija

	{UINT c;
	 c = B1 - (R[B1-1] & T4);
	 c -= (R[c-1] & T4);
	 c -= (R[c-1] & T4);
	 c -= (R[c-1] & T4);
	 B1 += 2;
	 R[B1] = a[b] + 0x00100000;
	 R[B1-1] = (b << 16) +  (B1 - c);
	 b++;
	 return b;
	}

	UINT D13(UINT *a,UINT b) // perechislenie plavajushej arnosti

	{UINT c,d;
	 c = R[B1] - 0x00200104;d = B1 - 2;
	 while(c != 0)
	 {d -= (R[d - 1] & T4);c--;}
	 R[B1] = a[b] + 0x00100000;
	 R[B1 - 1] = (b << 16) +  (B1 - d);
	 b += 2;
	 return b;
	}

	UINT D14(UINT *a,UINT b) // chetirehmestnoe perechislenie

	{UINT c;
	 c = B1 - (R[B1-1] & T4);
	 c -= (R[c-1] & T4);
	 c -= (R[c-1] & T4);
	 c -= (R[c-1] & T4);
	 B1 += 2;
	 R[B1] = a[b] + 0x00100000;
	 R[B1-1] = (b << 16) +  (B1 - c);
	 b += 2;
	 return b;
	}

	UINT D15(UINT *a,UINT b) // i

	{UINT c,p;
	 p = R[B1] - L0;p += b;
	 B1 -= 2;c = B1;
	 dekop(a,(b + 1),p);
	 B1 += 2;
	 R[B1] = 0x00200005;
	 R[B1 - 1] = (b << 16) + (B1 - c);
	 return p;
	}

	UINT D16(UINT *a,UINT b) // ili

	{UINT c,d,e,f;
	 c = R[B1] - L0;c += (b - 3);B1 -= 2;e = B1;f = b;
	 d = 0; // indikator okonchanija
	 while(d == 0)
	 {dekop(a,(b+1),c);b = c + 3;
	  if(a[c+2] == 0x001000F6)d = 1;
	  else
	  {c = a[c+2] - L0;c += (b - 3);
	  }
	 }
	 B1 += 2;
	 R[B1] = 0x00200006;
	 R[B1-1] = (f << 16) + (B1 - e);
	 return b;
	}

	UINT D17(UINT *a,UINT b) // alternativa

	{UINT c,d,e;
	 d = R[B1] - L0;d += (b - 3);B1 -= 2;e = b;
	 c = B1 - (R[B1-1] & T4);
	 dekop(a,(b+3),d);b = d + 4;
	 d += (a[d] - L0);
	 dekop(a,b,(d - 3));
	 B1 += 2;
	 R[B1] = 0x00200009;
	 R[B1-1] = (e << 16) + (B1 - c);
	 return d;
	}

	UINT D18(UINT *a,UINT b) // variant

	{UINT c,d,e;
	 d = R[B1] - L0;d += (b - 3);B1 -= 2;e = b;
	 c = B1 - (R[B1-1] & T4);
	 dekop(a,(b+1),d);b = d + 2;
	 d += (a[d] - L0);
	 dekop(a,b,d);
	 B1 += 2;
	 R[B1] = 0x0020000A;
	 R[B1-1] = (e << 16) + (B1 - c);
	 return d;
	}

	UINT D19(UINT *a,UINT b) // dljalubogo

	{UINT c,e,f,g;
	 c = R[B1] - L0;c += (b-2);B1 -= 2;g = B1;
	 e = a[b+1];f = a[b+2];
	 while(e <= f)
	 {B1 += 2;R[B1] = e | 0x00400000;R[B1-1] = 2;e++;
	 }
	 B1 += 2;R[B1] = 0x00200136;R[B1-1] = 2;
	 dekop(a,b+3,c);e = B1 - (R[B1-1] & T4);
	 for(f = B1;e < f;f--)R[f+2] = R[f];
	 R[e+2] = 0x00200137;R[e+1] = 2;
	 B1 += 4;
	 R[B1] = 0x00200007;R[B1-1] = (b << 16) + (B1 - g);
	 return(c+2);
	}

	UINT D20(UINT *a,UINT b) // sushestvuet

	{UINT c,d,e,f,g;
	 c = R[B1] - L0;c += (b-2);B1 -= 2;g = B1;
	 e = a[b+1];f = a[b+2];
	 while(e <= f)
	 {B1 += 2;R[B1] = e | 0x00400000;R[B1-1] = 2;e++;
	 }
	 d = B1;
	 dekop(a,b+3,c);
	 if((B1 - (R[B1-1]&T4)) != d)
	 {B1 += 2;R[B1] = 0x00200005;R[B1-1] = (B1 - d);
	 }
	 B1 += 2;
	 R[B1] = 0x00200008;R[B1-1] = (b << 16) + (B1 - g);
	 return(c+2);
	}

	UINT D21(UINT *a,UINT b) //vipiska

	{UINT c,e,f,g,h;
	 c = R[B1] - L0;c += (b-2);B1 -= 2;g = B1;
	 e = a[b+1];f = a[b+2];
	 while(e <= f)
	 {B1 += 2;R[B1] = e | 0x00400000;R[B1-1] = 2;e++;
	 }
	 h = B1;
	 dekop(a,b+3,c);e = B1 - (R[B1-1] & T4);
	 if(e - (R[e-1] & T4) != h)
	 {for(f = B1;e < f;f--)R[f+2] = R[f];
	  R[e+2] = 0x00200005;R[e+1] = (e + 2 - h);B1 += 2;
	 }
	 B1 += 2;
	 R[B1] = 0x00200010;R[B1-1] = (b << 16) + (B1 - g);
	 return(c+2);
	}


	UINT D22(UINT *a,UINT b) //perechislenie

	{UINT c,e,f,g,h;
	 c = R[B1] - L0;c += (b-2);B1 -= 2;g = B1;
	 e = a[b+1];f = a[b+2];
	 while(e <= f)
	 {B1 += 2;R[B1] = e | 0x00400000;R[B1-1] = 2;e++;
	 }
	 h = B1;
	 dekop(a,b+3,c);e = B1 - (R[B1-1] & T4);
	 if(e - (R[e-1] & T4) != h)
	 {for(f = B1;e < f;f--)R[f+2] = R[f];
	  R[e+2] = 0x00200005;R[e+1] = (e + 2 - h);B1 += 2;
	 }
	 B1 += 2;
	 R[B1] = 0x0020000E;R[B1-1] = (b << 16) + (B1 - g);
	 return(c+2);
	}

	UINT D23(UINT *a,UINT b) //summavseh

	{UINT c,e,f,g,h;
	 c = R[B1] - L0;c += (b-2);B1 -= 2;g = B1;
	 e = a[b+1];f = a[b+2];
	 while(e <= f)
	 {B1 += 2;R[B1] = e | 0x00400000;R[B1-1] = 2;e++;
	 }
	 h = B1;
	 dekop(a,b+3,c);e = B1 - (R[B1-1] & T4);
	 if(e - (R[e-1] & T4) != h)
	 {for(f = B1;e < f;f--)R[f+2] = R[f];
	  R[e+2] = 0x00200005;R[e+1] = (e + 2 - h);B1 += 2;
	 }
	 B1 += 2;
	 R[B1] = 0x0020000F;R[B1-1] = (b << 16) + (B1 - g);
	 return(c+2);
	}

	UINT D24(UINT *a,UINT b) // obrashenie k programmiruemomu operatoru

	{UINT c,d;
	 c = R[B1] - 0x00200104;d = B1 - 4;B1 -= 2;
	 while(c != 0)
	 {d -= (R[d - 1] & T4);c--;}
	 R[B1 - 1] = (b << 16) +  (B1 - d);
	 b++;
	 return b;
	}

	UINT D25(UINT *a,UINT b) // vetvb,inache

	{UINT c,d,e,f,*g;
	 c = a[b+1] - 0x00200105;
	 d = a[(*a) + c];
	 if((d & 0xFFC00000) == 0xFFC00000)
	  {R[B1 + 2] = 0x00200000 | (d & T4);R[B1 + 1] = 2;
		R[B1 + 3] = (b << 16) + 4;B1 += 4;
	  }
	 else
	 {if(!(d & T1))
	  {g = P[(d >> 19)-1];g += (d & T11);d = *(g + 2);}
	  e = 0x00200000 | (((d >> 15) & 0x0000FFFF) + 1);
	  f = 0x00200000 | ((d & 0x00007FFF) + 1);
	  R[B1 + 2] = e;R[B1 + 1] = 2;
	  R[B1 + 4] = f;R[B1 + 3] = 2;
	  R[B1 + 5] = (b << 16) + 6;
	  B1 += 6;
	 }
	 if(a[b] == 0x00100122)
	  {R[B1] = 0x002000F1;b += 3;}
	 else
	  {R[B1] = 0x002000F2;b += 2;}
	 return b;
	}

  	UINT D26(UINT *a,UINT b) // odnomestnoe perechislenie

  	{UINT c;
	 c = B1 - (R[B1-1] & T4);
	 B1 += 2;
	 R[B1] = a[b] + 0x00100000;
	 R[B1-1] = (b << 16) +  (B1 - c);
	 b += 2;
	 return b;
	}


   void remove(void) // osvobogdenie pamjati

   {UINT R3;
    free(Z);
    free(S);
    free(SD);
    free(T);
    free(R);
    free(IZ);
    free(F);
    free(B);
    free(C);
    free(RS);
    free(RSA);
    free(LL);
    free(TT);
    free(bufisi);
    free(FR);
    free(PROT);
	free(CVOTR);
	free(CVOBJ);
	free(PR);
	free(MSV);
	free(SP);
	free(LN);
	free(SE);
	free(STK);
	free(FBUF);
	free(CVSTR);
	free(K);
	free(KC);
	free(TCV);
	free(ZCV);
	free(OBL1);
	free(OBL2);
	free(OBL3);
	free(OBL4);
	free(CLIN);
	free(CONTR);
	free(UPL);
    if(iMT != 0)
    {free(MT);
    }
    for(R3 = 0;R3 < NP;R3++)
     {free(P[R3]);}
	DeleteFileA(pathvkl);
    slovout(pathvoc,V);
	slovout(pathslv,SL);
	free(V);
	free(SL);
	NSelectObject(hsdc,hsmpold);
	NDeleteDC(hsdc);
	NDeleteObject(hsmp);
	KillTimer(hwnd,timer);
   }

   void (* inter[])() =
	  {F299,F2,F300,F4,F1,F1,F1,F1,F1,F1,
		F11,F12,F13,F1,F1,F1,F17,F18,F19,F20,
	 	F21,F22,F23,F24,F25,F26,F27,F28,F29,F30,
		F31,F32,F33,F34,F35,F36,F37,F38,F39,F40,
		F41,F42,F43,F44,F45,F46,F47,F48,F49,F50,
		F51,F52,F53,F54,F55,F56,F57,F58,F59,F60,
		F61,F62,F63,F64,F65,F66,F67,F68,F69,F70,
		F71,F72,F73,F74,F75,F76,F77,F78,F79,F80,
		F81,F82,F83,F84,F85,F86,F87,F88,F89,F90,
		F91,F92,F93,F94,F95,F96,F97,F98,F99,F100,
		F101,F102,F103,F1,F105,F106,F107,F108,F109,F110,
		F111,F112,F113,F114,F115,F116,F1,F118,F119,F120,
		F121,F122,F123,F124,F125,F126,F127,F128,F129,F130,
		F131,F132,F133,F134,F135,F136,F137,F138,F139,F140,
		F141,F142,F143,F144,F145,F146,F147,F148,F149,F150,
		F151,F152,F153,F154,F155,F156,F157,F158,F159,F160,
		F161,F162,F163,F164,F165,F166,F167,F168,F169,F170,
		F171,F172,F173,F174,F175,F176,F177,F178,F179,F180,
		F181,F182,F183,F184,F185,F186,F187,F188,F189,F190,
		F191,F1,F193,F194,F195,F196,F197,F198,F199,F200,
		F201,F202,F203,F204,F205,F206,F207,F208,F209,F210,
		F211,F212,F213,F214,F215,F216,F217,F218,F219,F220,
		F221,F222,F223,F224,F225,F226,F227,F228,F229,F230,
		F231,F1,F1,F1,F1,F1,F1,F1,F1,F1,
		F1,F1,F243,F247,F245,F246,F247,F248,F249,F250,
		F251,F250,F246,F254,F247,F256,F257,F258,F259,F259,
		F261,F262,F263,F264,F265,F266,F259,F268,F269,F270,
		F271,F272,F273,F274,F275,F276,F277,F276,F279,F280,
		F281,F281,F283,F1,F1,F286,F286,F273,F273,F290,
		F291,F292,F293,F294,F295,F295,F297,F298,F299,F300,
      F301,F302,F303,F304,F305,F306,F307,F308,F309,F310,F311
	  };
UINT (*konv[])(UINT,UINT,UINT)=
	  {K2,K3,K7,K2,K6,K12,K13,K14,K15,K16, //10
		K4,K7,K5,K17,K18,K19,K4,K4,K4,K4,   //20
		K7,K7,K2,K2,K2,K4,K4,K39,K4,K4,  //30
		K5,K4,K4,K2,K11,K2,K43,K4,K2,K2,  //40
		K42,K2,K2,K44,K45,K2,K2,K4,K47,K7,  //50
		K7,K5,K7,K2,K8,K9,K2,K2,K2,K10, //60
		K11,K7,K7,K7,K2,K40,K2,K2,K2,K2, //70
		K2,K20,K2,K2,K2,K2,K2,K2,K2,K2, //80
		K2,K2,K2,K2,K2,K2,K2,K2,K2,K21, //90
		K22,K2,K2,K2,K2,K2,K2,K2,K2,K2, //100
		K2,K2,K2,K2,K2,K2,K2,K2,K2,K2,  //110
		K2,K2,K7,K2,K2,K2,K2,K2,K2,K2,  //120
		K2,K2,K2,K2,K2,K2,K2,K23,K2,K2, //130
		K2,K2,K2,K24,K2,K2,K2,K2,K2,K2, //140
		K25,K26,K2,K7,K2,K2,K2,K2,K27,K2, //150
		K2,K28,K2,K2,K2,K2,K2,K2,K7,K2, //160
		K2,K2,K2,K2,K7,K7,K7,K2,K7,K2, //170
		K2,K7,K2,K2,K2,K2,K2,K7,K2,K29, //180
		K41,K30,K31,K32,K2,K7,K2,K33,K34,K2, //190
		K7,K7,K35,K2,K7,K7,K7,K36,K2,K2,  //200
		K2,K2,K2,K2,K2,K2,K2,K2,K5,K2, //210
		K2,K2,K2,K2,K7,K7,K4,K46,K2,K2, // 220
		K4,K7,K48,K2,K4,K7,K7,K7,K2,K49, // 230
		K4,K1,K1,K1,K1,K1,K1,K1,K1,K1, // 240
		K37,K38,K1,K1,K1,K1,K1,K1,K1,K1,
		K1,K1,K1,K1,K1,K1,K1,K1,K1,K1,
	  };
  UINT (*dekonv[])(UINT*,UINT)=
	  {D2,D3,D5,D2,D1,D1,D1,D1,D1,D1,   //10
		D4,D5,D2,D1,D1,D1,D4,D4,D4,D4,   //20
		D5,D5,D10,D2,D2,D4,D4,D6,D4,D4,   //30
		D2,D4,D4,D10,D8,D10,D14,D4,D7,D7,   //40
		D11,D2,D2,D14,D11,D7,D10,D4,D11,D5,   //50
		D5,D2,D5,D7,D8,D9,D2,D7,D2,D8,   //60
		D8,D5,D5,D5,D2,D26,D7,D7,D7,D7,   //70
		D7,D8,D2,D2,D7,D2,D2,D7,D2,D2,   //80
		D7,D2,D2,D7,D2,D2,D10,D10,D7,D11,   //90
		D8,D2,D7,D7,D7,D7,D2,D2,D7,D2,   //100
		D7,D2,D7,D2,D2,D7,D7,D7,D7,D10,   //110
		D2,D10,D5,D12,D2,D10,D2,D7,D7,D7,   //120
		D2,D7,D10,D2,D2,D7,D7,D11,D7,D7,   //130
		D2,D7,D2,D13,D2,D10,D7,D2,D7,D7,   //140
		D8,D8,D2,D5,D2,D2,D7,D10,D8,D2,   //150
		D2,D13,D7,D7,D7,D10,D7,D2,D5,D7,   //160
		D7,D7,D12,D10,D5,D5,D5,D2,D5,D12,   //170
		D2,D5,D2,D2,D2,D2,D2,D5,D2,D11,   //180
		D11,D11,D11,D14,D2,D5,D7,D14,D14,D2,   //190
		D5,D1,D8,D7,D5,D5,D5,D8,D7,D2,   //200
		D10,D2,D10,D2,D7,D2,D2,D2,D2,D2,   //210
		D7,D12,D2,D2,D5,D5,D4,D11,D2,D10,   //220
		D4,D5,D11,D2,D4,D5,D5,D5,D2,D14,   //230
		D4,D1,D1,D1,D1,D1,D1,D1,D1,D1,   //240
		D1,D1,D1,D15,D1,D1,D16,D1,D1,D19,   //250
		D1,D20,D1,D1,D1,D1,D1,D1,D22,D21,   //260
		D1,D1,D1,D1,D1,D1,D23,D1,D1,D1,   //270
		D1,D1,D1,D1,D1,D1,D1,D1,D1,D1,   //280
		D1,D1,D1,D1,D1,D1,D1,D1,D1,D25,   //290
		D1,D24,D24,D1,D17,D18,D25,D3,D1,D1,   //300
      D1,D1,D1,D1,D1,D1,D1,D1,D1,D1, // 310
	  };


// Global Variables:
HINSTANCE hInst;								// current instance
TCHAR szTitle[MAX_LOADSTRING];					// The title bar text
TCHAR szWindowClass[MAX_LOADSTRING];			// the main window class name

// Forward declarations of functions included in this code module:
LRESULT CALLBACK	WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
   UNREFERENCED_PARAMETER(hPrevInstance);
   UNREFERENCED_PARAMETER(lpCmdLine);
   static char szAppName[] = "logsyst" ;
   MSG         msg ;
   WNDCLASSA    wndclass ;
   HWND        hwnd;
   PROCESSENTRY32 infproc;
   HWND        hdwnd;
   RECT      rrect;
   LPTSTR    cmndstr;
   char titleish[60] = "Логическая Система Искра";
   char nomex,*ggg;
   dlinpath = GetCurrentDirectoryA(120,pathbuf);
   sdvigpath(pathico);
   UINT i,j,k,p;
   if (!hPrevInstance)
	{wndclass.style         = 0;
     wndclass.lpfnWndProc   = (WNDPROC)WndProc ;
	 wndclass.cbClsExtra    = 0 ;
	 wndclass.cbWndExtra    = 0 ;
	 wndclass.hInstance     = hInstance ;
	 wndclass.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
	 wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
	 wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
	 wndclass.lpszMenuName  = NULL;
	 wndclass.lpszClassName = szAppName ;
     RegisterClassA (&wndclass) ;
    }
   cmndstr = GetCommandLine();
   i=0;
   while(cmndstr[i] != 0)
    {i++;}
   i = i-7;
   nomex = cmndstr[i];
   if(nomex != 0x74)
   titleish[25] = nomex;
   titleish[26] = 0;
   hmenu = CreateMenu();
   hdwnd = GetDesktopWindow();
   GetWindowRect(hdwnd,&rrect);
   j = rrect.right;
   k = rrect.bottom;
   hwnd = CreateWindowA(szAppName,
	 titleish,
	 WS_OVERLAPPEDWINDOW,
	 0,
	 0,
	 j,
	 k,
    NULL,
	 hmenu,
	 hInstance,
	 NULL) ;
   ShowWindow (hwnd, nCmdShow) ;
   Z = (UINT*)calloc(2097152,4);
   S = (UINT*)calloc(17500,4);
   SD = (UINT*)calloc(17500,4);
   T = (UINT*)calloc(10000,4);
   R = (UINT*)calloc(15000,4);
   F = (UINT*)calloc(15000,4);
   B = (UINT*)calloc(64001,4);
   C = (char*)calloc(4000000,1);
   ZP = (UINT*)calloc(500,4);
   IZ = (char*)calloc(4000000,1);
   TCV = (UINT*)calloc(100000,4);
   ZCV = (UINT*)calloc(1000,4);
   OBL1 = (UINT*)calloc(1000000,4);
   OBL2 = (UINT*)calloc(1000000,4);
   OBL3 = (UINT*)calloc(1000000,4);
   OBL4 = (UINT*)calloc(1000000,4);
   PROT = (UINT*)calloc(1000000,4);
   CLIN = (UINT*)calloc(200000,4);
   CVOTR = (UINT*)calloc(6000000,4);
   CVOBJ = (UINT*)calloc(5000000,4);
   CVSTR = (UINT*)calloc(2000,4);
   RS = (char*)calloc(40000,1);
   RSA = (char*)calloc(40000,1);
   fiksir = (UINT*)calloc(10000,4);
   SE = (UINT*)calloc(20000,4);
   STK = (UINT*)calloc(20000,4);
   LN = (UINT*)calloc(12500,4);
   LL = (UINT*)calloc(125000,4);
   TT = (UINT*)calloc(5000,4);
   U = (UINT*)calloc(500,4);
   FR = (UINT*)calloc(2500,4);
   FBUF = (UINT*)calloc(2500,4);
   PR = (UINT*)calloc(120,4);
   bufisi = (UINT*)calloc(10000,4);
   MSV = (UINT*)calloc(2000,4);
   SP = (UINT*)calloc(200,4);
   CONTR = (UINT*)calloc(100,4);
   UPL = (UINT*)calloc(7000,4);
   for (i=0;i<NP;i++)
    {P[i] = (UINT*)calloc(65536,4);
    };
  V = (UINT*)calloc(3670016,4);
  SL = (UINT*)calloc(3670016,4);
  K = (UINT*)calloc(524288,4);
  KC = (UINT*)calloc(524288,4);
   p = 0;
  // dlinpath = GetCurrentDirectoryA(120,pathbuf);
   if(pathbuf[dlinpath - 2] != 'X')
    {HANDLE hsnap = CreateToolhelp32Snapshot(
	   TH32CS_SNAPPROCESS,0);
     infproc.dwSize = sizeof(PROCESSENTRY32);
     i = Process32First(hsnap, &infproc);
     while(Process32Next(hsnap, &infproc))
      {ggg = infproc.szExeFile;
       if(ggg[0] == 'f' && ggg[1] == 'e' &&
		   ggg[2] == 'n' && ggg[3] == 'i' &&
		   ggg[4] == 'x')
	    {p = 1; break;}
      }
    }
   if(p == 0)
    {SecureZeroMemory(&ciff,sizeof(ciff));
	 ciff.cb = sizeof(ciff);
	 CreateProcessA(pathfnx,NULL,NULL,NULL,FALSE,NULL,NULL,pathbuf,&ciff,&pif);
	}
   sdvigpath(pathkat); sdvigpath(pathvoc);
   sdvigpath(pathslv); sdvigpath(pathuplotn);
   sdvigpath(pathcvet); sdvigpath(pathcvgr);
   sdvigpath(pathcvpr);
   sdvigpath(pathprog); sdvigpath(pathaltkat);
   sdvigpath(pathaltprog); sdvigpath(pathinput);
   sdvigpath(pathaltvoc); sdvigpath(pathaltslv);
   sdvigpath(pathex1); sdvigpath(pathex2);
   sdvigpath(pathfnx); sdvigpath(pathvkl);
   sdvigpath(pathvklex); sdvigpath(pathstart);
   sdvigpath(pathsignum); sdvigpath(pathfin);
   sdvigpath(pathfinex); sdvigpath(pathdoplos);
   sdvigpath(pathvichprog); sdvigpath(pathdop);
   kthndl = CreateFileA(pathvkl, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
		NULL, CREATE_NEW,
	FILE_ATTRIBUTE_NORMAL, NULL);
   if(kthndl != INVALID_HANDLE_VALUE)
    {Nclose(kthndl);
    }
   for(i = 0; i < 17; i++)
    {sdvigpath(path[i]); sdvigpath(altpath[i]);
    }
   sdvigpath(izobrag);
   kthndl = Nopen(pathkat);
   Npointer(kthndl,0,0);
   Nread(kthndl,(char*)K,2097152);
   Nclose(kthndl);
   kthndl = Nopen(pathdop);
   Npointer(kthndl,0,0);
   Nread(kthndl,(char*)KC,2097152);
   Nclose(kthndl);
   slovin(0);
   slovin(1);
   GetClientRect(hwnd,&rect);
   TL.x = rect.left;
   TL.y = rect.top;
   RB.x = rect.right;
   RB.y = rect.bottom;
   ClientToScreen(hwnd,&TL);
   ClientToScreen(hwnd,&RB);
   rus = 0;
   svobprog = 0;svobfrag = 0;
   nachl = 0;
   hdc = NGetDC(hwnd);
   j = rect.right;
   k = rect.bottom;
   hsmp = NCreateCompatibleBitmap(hdc,j,k);
   hsdc = NCreateCompatibleDC(hdc);
   hsmpold = (HBITMAP)NSelectObject(hsdc,hsmp);
   NReleaseDC(hwnd,hdc);
   timer = SetTimer(hwnd,0,200,NULL);
   initsolv();hhwnd = hwnd;
   maincycle();
   if(ind == 3)
    {remove();
	 NDestroyWindow(hwnd);
    }
   while (GetMessage (&msg, NULL, 0, 0))
	 {TranslateMessage (&msg) ;
	  DispatchMessage (&msg) ;
  	 }
   return (int) msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{UINT R1,R2,R3,R4,R5,R6,R7,R8,R9;
 unsigned char R10;
 int R11;
 HDC hdc;
 switch (message)
  {case WM_KEYDOWN:
       R1 = wParam;R2 = lParam;
       if(alt == 1)break;
       switch (R1)
		{case VK_F11: rus = 1;
         break;
         case VK_F12: rus = 0;
         break;
         case VK_SHIFT:
		 shift = 1;
         break;
		 case VK_CONTROL:
		 if(R2 & 0x01000000)ctrr = 1;
		 else ctrl = 1;
		 break;
		 case VK_CAPITAL:
		 break;
		 default:
         R5 = GetKeyState(VK_CAPITAL) & 0x1;
         if(shift == 1)R5 = 1 - R5;
		 R3 = numkey(R1);
		 if(R3 == 100)break;
         if(ctrl == 1)R4 = DK1[R3];
		 else
		  {if (ctrr == 1)R4 = DK2[R3];
		   else
		    {if(rus == 0)
		      {if(R5 == 0)R4 = DK3[R3];
			   else R4 = DK4[R3];
			  }
			 else
			  {if(R5 == 0)R4 = DK5[R3];
			   else R4 = DK6[R3];
			  }
			}
		  }
		 if(input == 1)
          {R4 += L0;st--;
           opr(*st,R4);ind = 1;
           maincycle();
		   if(ind == 3)
		    {remove();
		     NDestroyWindow(hwnd);
		    }
          }
		 break;
		}
	break;
    case WM_KEYUP:
		 R1 = wParam;
		 if(alt == 1) break;
		 switch(R1)
		 {case VK_SHIFT:
			shift = 0;
			break;
		  case VK_CONTROL:
			ctrr = 0;ctrl = 0;
			break;
		 }
		 break;
    case WM_MOUSEMOVE:
       R2 = lParam;mousex = L0 + (R2 & 0x0000FFFF);
       mousey = L0 + (R2 >> 16);
       if(input == 3)
       {if(ris5 == L0)
        {hdc = NGetDC(hhwnd);
         R8 = ris6 - 0x00200105;
         if(mousex < risx){R1 = risx - mousex;R2 = -1;}
          else {R1 = mousex - risx; R2 =1;}
         if(mousey < risy){R3 = risy - mousey;R4 = -1;}
          else {R3 = mousey - risy; R4 =1;}
         if(R3 < R1)
          {for(R5 = risx, R6 = 0; R6 <= R1;
               R5 += R2, R6 ++)
            {R7 = R3 * R6;
             R7 /= R1;
			 R11 = R7;
             if(R4 != 1)R11 = -R11;
             R11 += risy;
             tchk(ris1,ris2,ris3,R5,R11);
             R9 = R5 - L0; R11 -= L0;
             NSetPixel(hdc,R9,R11,R8);
            }
          }
         else
		  {if(0 < R3)
           {for(R5 = risy, R6 = 0; R6 <= R3;
               R5 += R4, R6 ++)
            {R7 = R1 * R6;
             R7 /= R3;
			 R11 = R7;
             if(R2 != 1)R11 = -R11;
             R11 += risx;
             tchk(ris1,ris2,ris3,R11,R5);
             R9 = R5 - L0; R11 -= L0;
             NSetPixel(hdc,R11,R9,R8);
            }
           }
		  }
         risx = mousex;
         risy = mousey;
         NReleaseDC(hhwnd,hdc);
        }
        else
        {R1 = ris5 - L0;
         R3 = mousex - L0; R2 = R3 - R1;
         R3 += R1;
         R4 = mousey - L0;
         R5 = R4 - R1;
         R4 += R1;
         R6 = ris6 - 0x00200105;
         hdc = NGetDC(hhwnd);
		   hbr = NCreateSolidBrush(red[R6],green[R6],blue[R6]);
		   hbrold = (HBRUSH)NSelectObject(hdc,hbr);
		   hpen = NCreatePen(0,red[R6],green[R6],blue[R6]);
		   hpenold = (HPEN)NSelectObject(hdc,hpen);
         Points[0].x = R2;
		   Points[0].y = R5;
		   Points[1].x = R3;
		   Points[1].y = R5;
         Points[2].x = R3;
         Points[2].y = R4;
         Points[3].x = R2;
         Points[3].y = R4;
		   NPolygon(hdc,Points,4);
           NRectangle(hdc,R2,R5,R3,R4);
		   NSelectObject(hdc,hbrold);
		   NSelectObject(hdc,hpenold);
		   NDeleteObject(hpen);
		   NDeleteObject(hbr);
		   NReleaseDC(hhwnd,hdc);
         R1 = ris3 - ris1; R1++;
         R1 /= 8; // chislo bit v stroke bufera
         R8 = ris2 - L0;
         R6 = R5 - R8;
         R7 = R4 - R8;
         R8 = ris1 - L0;
         R2 -= R8;
         R3 -= R8;
         while(R6 <= R7)
          {R4 = R1 * R6;
           for(R5 = R2; R5 <= R3; R5++)
            {R9 = R5/8;
             R9 += R4;
             R10 = 0x80;
             R8 = R5%8;
             if(R8 != 0){R10 >>= R8;}
             RS[R9]|= R10;
            }
           R6++;
          }

        }
       }
       break;
    case WM_LBUTTONDOWN:
       R2 = lParam;mousex = L0+(R2 & 0x0000FFFF);
       mousey = L0 + (R2 >> 16);
       mouse = 0;
       if(input == 1)
        {st--;opr(*st,0x00200017);
         ind = 1;
         maincycle();
		   if(ind == 3)
		    {remove();
			  NDestroyWindow(hwnd);
		    }
        }
		break;
    case WM_LBUTTONUP:
      if(input == 3)
       {ind = 1;
        maincycle();
        if(ind == 3)
         {remove();
          NDestroyWindow(hwnd);
         }
       }
      break;
    case WM_RBUTTONUP:
      if(input == 3)
       {ind = 1;
        maincycle();
        if(ind == 3)
         {remove();
          NDestroyWindow(hwnd);
         }
       }
      break;
    case WM_LBUTTONDBLCLK:
       R2 = lParam;mousex = L0+(R2 & 0x0000FFFF);
       mousey = L0 + (R2 >> 16);
       mouse = 1;
       if(input == 1)
        {st--;opr(*st,0x00200017);
         ind = 1;
         maincycle();
		   if(ind == 3)
		    {remove();
			  NDestroyWindow(hwnd);
		    }
        }
		break;
   case WM_RBUTTONDOWN:
       R2 = lParam;mousex = L0+(R2 & 0x0000FFFF);
       mousey = L0 + (R2 >> 16);
       mouse = 2;
       if(input == 1)
        {st--;opr(*st,0x00200017);
         ind = 1;
         maincycle();
		   if(ind == 3)
		    {remove();
			  NDestroyWindow(hwnd);
		    }
        }
		break;
   case WM_RBUTTONDBLCLK:
       R2 = lParam;mousex = L0+(R2 & 0x0000FFFF);
       mousey = L0 + (R2 >> 16);
       mouse = 3;
       if(input == 1)
        {st--;opr(*st,0x00200017);
         ind = 1;
         maincycle();
		   if(ind == 3)
		    {remove();
			  NDestroyWindow(hwnd);
		    }
        }
		break;
   case WM_MOUSEWHEEL:
     R11 = (int)GET_WHEEL_DELTA_WPARAM(wParam);
	 if(input == 1)
	  {zDelta += R11;
	   R1 = 0;
       if(zDelta >= 120)
	    {zDelta -= 120;
	     R1 = 0x00200250;
	    }
	   else
	    {if(zDelta <= -120)
	      {zDelta += 120;
	       R1 = 0x00200258;
	      }
	    }
	   if(R1 != 0)
	    {st--;
         opr(*st,R1);ind = 1;
         maincycle();
		 if(ind == 3)
		  {remove();
		   NDestroyWindow(hwnd);
		  }
	    }
	  }
   break;
   case WM_TIMER:
   R1 = NGetFileAttributesA(pathstart);
   if(R1 != 0xFFFFFFFF)
    {DeleteFileA(pathstart);
     reprogram();
     initsolv();
	 prokrutka = 1;
     maincycle();
     if(ind == 3)
      {remove();
	   NDestroyWindow(hwnd);
      }
    }
   break;
   case WM_PAINT:
      BeginPaint(hhwnd,&pst);
      hdc = pst.hdc;
      rect = pst.rcPaint;
      R1 = rect.left;R2 = rect.top;
      R3 = rect.right;R4 = rect.bottom;
      NBitBlt(hdc,R1,R2,R3 - R1 + 1,R4 - R2 + 1,hsdc,
             R1,R2,0);
      EndPaint(hhwnd,&pst);
	  break;
   case WM_SYSKEYDOWN:
		 alt = 1;
		 break;
   case WM_KILLFOCUS:
   case WM_SYSKEYUP:
		 alt = 0;
		 break;
    case WM_CLOSE:
       remove();
       NDestroyWindow(hwnd);
       break;
    case WM_DESTROY:
        PostQuitMessage (0);
	    return 0;
       break;
 	default:
	 return DefWindowProc(hwnd, message, wParam, lParam);
	}
	return 0;
}

