bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GCC -O2 COMPILES FOREVER


From: Mario Stipcevic
Subject: GCC -O2 COMPILES FOREVER
Date: Sun, 01 Apr 2001 16:45:55 +0200

Hi !


Something VERY BAD happened to the gnu C in transition from the old one
to the new one,
the latter being known as gnulib2 ( or 2.1 ?). Ecxcept for the big
confusion with the naming
(what to hell is gcc, pgcc and egcs and relation to lib5, gnulib2,
gnulib2.1 ????), PLEASE WRITE A NOTE
ABOUT THAT !)

 A very gfew people seem to have niticed this: OIF A BIG ENOUGH file is
being COMPILED WITH
OPTION -O2 THEN COMPILATION LASTS VIRTYUALLY   -   F O R E V E R. At
least
 on Linux whare I am using it.

 Please work a little on that or the new glib2 will not survive for
long.

 Can you give me some explanation or a way out ?

 In attachment I send you one from the zillion examples which do not
compile in normal  time
when -O2 opitin is used, with:

 gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

 but WILL compile in a few seconds with

 gcc version 2.7.2.3

 By the way, the resulting code with  the   egcs-1.1.2 is BIGGER and
runs no faster than the code
gotten with the 2.7.2.3 IF I compile in both cases using the following
statement:

 gcc -ansi -O2  -o qb2c qb2c.c -lm

 So don't tell me that the optimisation of the new compiler is better -
it only works worse
 (much worse...).

 An example: on my Pentium 200 MMX, compilation with gcc 2.7.2.3 without
the O2
 takes 5 seconds, with O2 10 seconds. Using egcs112 it takes 5 seconds
without O2
 and 20 MINUTES !!!! with the O2 , for the program I am sending to you.

  In short, I do not use egcs, and I advise anybody not to use
it........

  Please give me some hope that egcs will eventually overcone this BUG
or MISFEATURE.

Thank you anyway for your enormous work and great you that programming
with gcc on Linux
offers.

Cheers,
Mario Stipcevic
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
#include <setjmp.h>
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <ctype.h>

/* This file was generated by QuasiBASIC to C translator */
/* qb2c  ver.4.49 07.Jan 2001                            */

#define LMAX 1025 /* Max strig length */
#define NSMX 72   /* Max no of SUBroutines */
#define NTKM 30   /* Max no of lines per phys. line */
#define GMAX 16   /* Max level of nesting GOSUBs */
#define NCMX 20   /* Max number of CONSTants */
#define CMAX 15   /* Max number of CH and CM lines (-C flag on) */
#define TMAX 120   /* Max dimension of tmp$() */
static int jrplc_int = 14, jnfun_int = 28, NFUN = 31, log_1, log_2;
static char *rplc_S[] = {"CINT",   "INT",    "ABS", "ATN", "SQR",
                         "LOG",    "SIN",    "COS",    "TAN",   "EXP",
                         "DATE$",  "TIME$",  "TIMER", "RND",
                         "INKEY$",
                         "SPACE$", "RIGHT$", "LEFT$",  "MID$",
                         "STR$",   "CHR$",   "ASC",    "VAL",
                         "MIN", "MAX",
                         "LEN",    "SGN",    "EOF", "EXISTS",
                         "RANDOMIZE", "SHELL",  "COMMAND$"};

/* Function declarations */
extern char  *SPACE_S(int);
extern char  *MID_S(char *, int, int);
extern char  *LEFT_S(char *, int);
extern char  *RIGHT_S(char *, int);
extern char  *STR_S(double);
extern char  *CHR_S(int);
extern long   ASC(char *);
extern double VAL(char *);
extern int    LEN(char *);
extern int    eof(FILE *);
extern char  *COMMAND_S(int, char *argv_S[]);
extern void    RANDOMIZE(long);
extern double  TIMER(void);
extern double DBL(double);
extern char  *TIME_S(int);

/* Shared variables and arrays declarations */
static jmp_buf j__buf[ 16 ];
static int  j__lev=0;
static char  tmp_S[TMAX+1][LMAX];
static int   statfl_int[NSMX+1];
static char  atmp_S[51][80+1];
static char  tcnst_S[NCMX+1][80+1];
static char   w__S[32][LMAX];
static int    j__S = 0, j__Stmp;
static int    w__s[32];
static int    i__s = 0, i__stmp;
static long   w__l[32];
static int    i__l = 0, i__ltmp;
static double w__d[32];
static int    i__d = 0, i__dtmp;
static char tws__S[LMAX];
static int  isub_int, ni_int, nl_int, mathfl_int, mflg_int, expflg_int;
static int  extrnfl_int, vdblff_int, nptk_int, spacff_int, midff_int;
static int  leftff_int, rightff_int, strff_int, chrff_int, ascff_int;
static int  valff_int, lenff_int, sgnff_int, intff_int, nintff_int;
static int  eofff_int, commff_int, rndff_int, srndff_int, timerff_int;
static int  dateff_int, timeff_int, inkeyff_int, inputff_int, colorff_int;
static int  clsff_int, tflg_int, existff_int, natmp_int, stripff_int;
static int  intflg_int, Dflg_int, doblflg_int, longflg_int, constfl_int;
static int  ncnst_int;
static char spc_S[LMAX];

/* Open files pointers */
FILE *fp_2, *fp_1, *fp_3;
char fn2__S[160], fn1__S[160], fn3__S[160];

main(int n_arg_int, char *argv_S[])
{
 static int  nfuncs_int, nSHRDtk_int, lspac_int, nsub_int, jopn_int;
 static int  nlopen_int, endmain_int, usersub_int, initline_int;
 static int  chartfl_int, longtfl_int, floattfl_int, inttfl_int, byttfl_int;
 static int  ncg_int, ncm_int, nlmax_int, tmpfl_int, i_int, itok_int;
 static int  commfl_int, nopen_int, g_int, n_int, j_int, funcflag_int;
 static int  timefl_int, pausefl_int, twsflg_int, sigiff_int, xwflag_int;
 static int  minff_int, maxff_int, grafflg_int, lleng_int, nvar_int;
 static int  retrnfl_int, xtmpfl_int, ii_int, k_int, jflg_int, endline_int;
 static int  typ_int, leng_int, L_int, brcnt_int, jsub_int, ifsub_int;
 static int  narr_int, alis_int, ntok_int, lremfl_int, thnfl_int, togfl_int;
 static int  jj_int, i1_int, i2_int, nflag_int, tmp1_int, tmp2_int;
 static int  tmp3_int, tmp4_int, tmp8_int, tip_int, ix0_int, fcond_int;
 static int  flag_int, lbfl_int, lz_int, c64flg_int, postflg_int, cflag_int;
 static int  bcppflg_int, ansiflg_int, noshell_int, updateff_int, nctok_int;
 static int  rflag_int;
 static float tttt, x, rflag;
 static char c_S[LMAX], Version_S[LMAX], fff_S[LMAX], shred_S[LMAX];
 static char b_S[LMAX], tmpfile_S[LMAX], int_S[LMAX], float_S[LMAX];
 static char line_S[LMAX], a_S[LMAX], mode_S[LMAX], d_S[LMAX], n_S[LMAX];
 static char funcnam_S[LMAX], shtmp_S[LMAX], e_S[LMAX], fime_S[LMAX];
 static char z_S[LMAX], rea_S[LMAX], sss_S[LMAX], lon_S[LMAX], dbl_S[LMAX];
 static char byt_S[LMAX], varlist_S[LMAX], sint_S[LMAX], srea_S[LMAX];
 static char ssss_S[LMAX], slin_S[LMAX], sdbl_S[LMAX], t_S[LMAX], f_S[LMAX];
 static char prtf_S[LMAX], formt_S[LMAX], prt_S[LMAX], labl_S[LMAX];
 static char inpf_S[LMAX], outf_S[LMAX], bcp_S[LMAX];
 static long g_long;
 static char c;

 /*  qb2c-3.2k QuickBASIC to C converter version 04/04/1996 rev XX.XX.XXXX */
 /*  Cast by Mario Stipcevic, Rudjer Boskovic Institute, Zagreb, Croatia */
 /*  E-mail: address@hidden URL: http://faust.irb.hr/~stipy */
 /*  This is (itself !) a QB2C code. Translate it with: qb2c -c -t qb2c */


 static int   tmp_int[17];   /* for various temporary use (eg. 600,...) */
 static char  temp_S[11][LMAX];   /* another temporary use */
 static int   tok_int[NTKM+1];   /* Used in (spliter 900) */
 static char  ctok_S[13][LMAX];   /* COMMAND$ tokens */
 static char  shrd_S[201][80+1];   /* contains list of all SHARED variables and 
arrays */
 static char  shtok_S[NSMX+1][TMAX+1][80+1];   /* SHARED variables and arrays 
storage */
 static int   nshtok_int[NSMX+1];   /* Max second index in shtok$(,) and 
statfl%() */
 static char  linetok_S[NTKM+1][LMAX];   /* Line tokens (spliter 900) */
 static char  cnst_S[NCMX+1][80+1];   /* global CONST-ant declarations */
 static char  vari_S[NSMX+1][LMAX];   /* Declaration strings. Toliko subrutina 
max. */
 static char  varr_S[NSMX+1][LMAX];
 static char  vars_S[NSMX+1][LMAX];
 static char  varl_S[NSMX+1][LMAX];
 static char  vard_S[NSMX+1][LMAX];
 static char  varb_S[NSMX+1][LMAX];
 static int   fopen_int[21];   /* (max No of SUBs, max No open files) */
 static char  lfopen_S[22][LMAX];
 static int   lfopen_int[22];
 static char  subvar_S[NSMX+1][22][255+1];   /* Lists of arguments of all SUBs 
*/
 static int   nsubvar_int[NSMX+1];
 static char  subname_S[NSMX+1][LMAX];   /* user SUB names */
 static char  vlist_S[NSMX+1][201][80+1];   /* List of local variables */
 static int   nvlist_int[NSMX+1];
 static char  funames_S[NSMX+1][80+1];   /* Names of user FUNCTIONs */
 static char  funtyl_S[NSMX+1][LMAX];   /* variable type lists for FUNCTION 
declaration */
 static int   funcfl_int[NSMX+1];   /* funcfl%(i) set to 1 if i-th sub is a 
FUNCTION */
 static char  darr_S[81][80+1];   /* list of SHARED arrays which are used in 
MAIN */
 static int   alist_int[31];   /* list of SHARED arrays which are used in MAIN 
*/
 static char  atyp_S[9][LMAX];
 static char  cg_S[CMAX+1][LMAX];   /* global and MAIN declarations */
 static char  cm_S[CMAX+1][LMAX];   /* global and MAIN declarations */
 n_arg_int--;

 strcpy(c_S,COMMAND_S(n_arg_int, argv_S));
 tttt = TIMER();
 strcpy(Version_S,"3.2k 29.Mar.1999 Free version.");
 strcpy(fff_S,"");   /* contains *fp pointers of all SUBs and MAIN */
 statfl_int[0] = 1;   /* variables in MAIN are always static */
 nfuncs_int = 0;   /* Number of user FUNCTIONs */
 nSHRDtk_int = 0;   /* Number of global SHARED variables */
 strcpy(shred_S,"");   /* all shared variables string */
 lspac_int = 1;   /* Left margin level counter */
 strcpy(spc_S,SPACE_S(lspac_int));
 nsub_int = 0;   /* Number of subroutines */
 jopn_int = 0;   /* translation-time 'OPEN' counter */
 nlopen_int = 0;   /* dynamic last-OPEN-file counter */
 expflg_int = 0;   /* Pure expression ( x = ... ) flag ( for -m, see mathexp ) 
*/
 endmain_int = 0;
 usersub_int = 0;   /* User SUB or FUNCTION usage flag */
 initline_int = 0;   /* for initialization commands which appear in MAIN */
 ni_int = 0;
 chartfl_int = 0;
 longtfl_int = 0;
 floattfl_int = 0;
 inttfl_int = 0;
 byttfl_int = 0;
 ncg_int = 0;   /* number of global and MAIN declarations */
 ncm_int = 0;
 strcpy(b_S,TIME_S(0));
 sprintf(tmpfile_S,"%s%s%s","tmp",MID_S(b_S, 3, LMAX),".b2c");
  tmpfile_S[3]='-';
  tmpfile_S[6]='-';
 strcpy(atyp_S[0],"short ");
 strcpy(atyp_S[1],"int   ");
 strcpy(atyp_S[2],"long  ");
 strcpy(atyp_S[3],"float ");
 strcpy(atyp_S[4],"double ");
 strcpy(atyp_S[5],"char  ");
 strcpy(atyp_S[8],"unsigned char ");

 system("rm -f tmp-??-??.b2c");
 /* GOSUB Lab_50000 */    /* tokenization of command$ */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_50000;
 /* Order of the two below is IMPORTANT */
 /* PRINT "entering 800: ", TIMER */
 /* GOSUB Lab_800 */    /* preprocessing global SHARED variables */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_800;
 /* PRINT "entering 700: ", TIMER */
 /* GOSUB Lab_700 */    /* preprocessing for variable types in SUB's */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_700;
 /* PRINT "entering 600: ", TIMER */
 /* GOSUB Lab_600 */    /* preprocessing for file OPEN */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_600;
 /* PRINT "entering 650: ", TIMER */
 /* GOSUB Lab_650 */    /* Reseting different flags, COMMAND$ */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_650;
 /* PRINT "Exiting pp : ", TIMER */
 if((fp_2 = fopen(strcpy(fn2__S,outf_S), "w")) == NULL)
 {
  fprintf(stderr,"Can't open file %s\n",fn2__S); exit(1);
 }
 if(commff_int == 1)
 {
  fprintf(fp_2,"%s\n","main(int n__arg, char *argv[])");
 }
 else
 {
  fprintf(fp_2,"%s\n","main()");
 }
 fprintf(fp_2,"%s\n","{");
 ni_int = 2;
 nl_int = 0;
 isub_int = 0;
 statfl_int[0] = 1;
 nlmax_int = 32767;
 /* lista varijabli: */
 tmpfl_int = 0;
 strcpy(int_S," int  ");
 strcpy(float_S," float ");
 if(longflg_int == 1)
 {
  strcpy(int_S," long ");
 }
 if(doblflg_int == 1)
 {
  strcpy(float_S," double ");
 }
 if(strcmp(vari_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 3;
  i__s = (i__s + 0 ) % 32;
  declarix(int_S, vari_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 if(strcmp(varr_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 0;
  i__s = (i__s + 0 ) % 32;
  declarix(float_S, varr_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 if(strcmp(vars_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 1;
  i__s = (i__s + 0 ) % 32;
  declarix(" char ", vars_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 if(strcmp(varl_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 4;
  i__s = (i__s + 0 ) % 32;
  declarix(" long ", varl_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 if(strcmp(vard_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 0;
  i__s = (i__s + 0 ) % 32;
  declarix(" double ", vard_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 if(strcmp(varb_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 0;
  i__s = (i__s + 0 ) % 32;
  declarix(" unsigned char ", varb_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 /* Explicit declarations with CM */
 if(ncm_int > 0)
 {
  for(i_int = 1; i_int <= ncm_int; i_int++)
  {
   fprintf(fp_2,"%s%s\n"," ",cm_S[i_int]);
  }
  tmpfl_int = 1;
  ni_int = ni_int + ncm_int;
 }
 if(tmpfl_int == 1)
 {
  fprintf(fp_2,"\n");
  ni_int = ni_int + 1;
 }
 initline_int = ni_int;
 /* GOSUB Lab_31000 */    /* Make a list of possibly used arrays in MAIN */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_31000;
 /* Main processor: */
 if((fp_1 = fopen(strcpy(fn1__S,tmpfile_S), "r")) == NULL)
 {
  fprintf(stderr,"Can't open file %s\n",fn1__S); exit(1);
 }
 while(! eof(fp_1))
 {
  fgets(line_S, LMAX, fp_1);
  line_S[strlen(line_S) - 1] = '\0';
  nl_int = nl_int + 1;
  if(nl_int >= nlmax_int)
  {
   printf("%s% d %s\n","Max. number of input lines",nlmax_int," reached, 
aborting.");
   exit(1);
  }
  /* croff: */
  if (line_S[strlen(line_S)-1] == 13) line_S[strlen(line_S)-1]='\0';
  /* C text lines: */
  if(cflag_int == 1)
  {
   if (memcmp(line_S,"C ",2) == 0)
   {
   fprintf(fp_2,"%s\n",line_S);
   if(isub_int == 0)
   {
    ni_int = ni_int + 1;
   }
   goto Lab_90;
   }
   if (memcmp(line_S,"CG ",3) == 0 || memcmp(line_S,"CH ",3) == 0 || 
memcmp(line_S,"CM ",3) == 0)
   {
   if(isub_int == 0)
   {
    ni_int = ni_int + 1;
   }
   goto Lab_90;
   }
  }
  /* GOSUB Lab_900 */    /* line splitter */
  if (setjmp(j__buf[j__lev++])==0) goto Lab_900;
  if(ntok_int > 0)
  {
   itok_int = 1;
   while(itok_int <= ntok_int)
   {
    /* GOSUB Lab_30000 */    /* a nicer 'REM' preprocessor */
    if (setjmp(j__buf[j__lev++])==0) goto Lab_30000;
    strcpy(a_S,linetok_S[itok_int]);
    if(strcmp(a_S, "") == 0)
    {
     if(ntok_int == 1)
     {
      fprintf(fp_2,"\n");
      if(isub_int == 0)
      {
       ni_int = ni_int + 1;
      }
     }
    }
    else
    {
     /* GOSUB Lab_500 */    /* Translator */
     if (setjmp(j__buf[j__lev++])==0) goto Lab_500;
    }
    itok_int = itok_int + 1;
   }
  }
  else
  {
   /* GOSUB Lab_1500 */    /* Check if end of main */
   if (setjmp(j__buf[j__lev++])==0) goto Lab_1500;
   fprintf(fp_2,"\n");
   if(isub_int == 0)
   {
    ni_int = ni_int + 1;
   }
  }
Lab_90:
 ;}
 if (fp_1) fclose(fp_1); fp_1=NULL;
 if(endmain_int == 0)
 {
  /* GOSUB Lab_1501 */ 
  if (setjmp(j__buf[j__lev++])==0) goto Lab_1501;
 }
 if(usersub_int == 1)
 {
  fprintf(fp_2,"%s\n","/*- User SUBs--End -*/");
 }
 if(extrnfl_int == 1)
 {
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","/* Translates of used QB's intrinsic functions: */");
  qbfunc();   /* Writing out C translates of intrinsic QB functions used */
 }
 if (fp_2) fclose(fp_2); fp_2=NULL;
 /* Add pointer prefixes to variables in SUBs */
 /* GOSUB Lab_45000 */ 
 if (setjmp(j__buf[j__lev++])==0) goto Lab_45000;
 /* changing original QB variable names to suit C gramar, default = yes */
 if(postflg_int == 1)
 {
  /* GOSUB Lab_40000 */ 
  if (setjmp(j__buf[j__lev++])==0) goto Lab_40000;
 }
 goto Lab_9999;


Lab_500:   /* Translator */
 commfl_int = 0;
  if ( memcmp(a_S,"REM",3)==0 ) {
 /* GOSUB Lab_2000 */    /* REM */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_2000;
  }
 /* GOSUB Lab_1500 */    /* END */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_1500;
    if ( commfl_int==1 ) goto Lab_509;
 /* GOSUB Lab_1000 */    /* SUB, FUNCTION */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_1000;
    if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"SHARED",6)==0 ) {
 /* GOSUB Lab_1250 */    /* SHARED */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_1250;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"DECLARE",7)==0 ) {
 /* GOSUB Lab_2500 */    /* DECLARE */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_2500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"CONST",5)==0 ) {
 /* GOSUB Lab_2600 */    /* CONST */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_2600;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"DIM ",4)==0 ) {
 /* GOSUB Lab_2750 */    /* DIM */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_2750;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"IF ",3)==0 ) {
 /* GOSUB Lab_3000 */    /* IF */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_3000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"ELSE",4)==0 ) {
 /* GOSUB Lab_3250 */    /* ELSE */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_3250;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"END IF",6)==0 ) {
 /* GOSUB Lab_3500 */    /* END IF */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_3500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"DO WHILE",8)==0 || memcmp(a_S,"WHILE",5)==0 || 
memcmp(a_S,"DO UNTIL",8)==0 ) {
 /* GOSUB Lab_3750 */    /* DO WHILE or WHILE */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_3750;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"LOOP",4)==0 || memcmp(a_S,"WEND",4)==0 ) {
 /* GOSUB Lab_3900 */    /* LOOP     or WEND */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_3900;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"PRINT #",7)==0 ) {
 /* GOSUB Lab_4000 */    /* PRINT # */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_4000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"LINE INPUT #",12)==0 ) {
 /* GOSUB Lab_4500 */    /* LINE INPUT # */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_4500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"PRINT",5)==0 || memcmp(a_S,"EPRINT",6)==0 ) {
 /* GOSUB Lab_5000 */    /* PRINT, EPRINT */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_5000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"LOCATE ",7)==0 ) {
 /* GOSUB Lab_5100 */    /* LOCATE */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_5100;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"COLOR",5)==0 ) {
 /* GOSUB Lab_5200 */    /* COLOR */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_5200;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"CLS",3)==0 ) {
 /* GOSUB Lab_5300 */    /* CLS */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_5300;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"INPUT #",7)==0 ) {
 /* GOSUB Lab_5500 */    /* INPUT # */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_5500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"INPUT",5)==0 ) {
 /* GOSUB Lab_5750 */    /* INPUT */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_5750;
  } if ( commfl_int==1 ) goto Lab_509;
 /* GOSUB Lab_6000 */    /* Labels */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_6000;
    if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"GOTO ",5)==0 ) {
 /* GOSUB Lab_6500 */    /* GOTO */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_6500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"CALL",4)==0 ) {
 /* GOSUB Lab_7000 */    /* CALL */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_7000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"LET",3)==0 ) {
 /* GOSUB Lab_7500 */    /* LET */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_7500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"FOR ",4)==0 ) {
 /* GOSUB Lab_8000 */    /* FOR..TO..STEP */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_8000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"NEXT",4)==0 ) {
 /* GOSUB Lab_8500 */    /* NEXT */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_8500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"OPEN",4)==0 ) {
 /* GOSUB Lab_9000 */    /* OPEN */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_9000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"CLOSE",5)==0 ) {
 /* GOSUB Lab_9500 */    /* CLOSE */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_9500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"GOSUB ",6)==0 ) {
 /* GOSUB Lab_11000 */    /* GOSUB */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_11000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"RETURN",6)==0 ) {
 /* GOSUB Lab_11500 */    /* RETURN */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_11500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"RANDOMIZE",9)==0 ) {
 /* GOSUB Lab_12000 */    /* RANDOMIZE */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_12000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"PAUSE ",6)==0 ) {
 /* GOSUB Lab_12200 */    /* PAUSE */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_12200;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"SHELL",5)==0 ) {
 /* GOSUB Lab_17000 */    /* SHELL */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_17000;
  } if ( commfl_int==1 ) goto Lab_509;
 /* GOSUB Lab_18000 */    /* expressions */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_18000;
    if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"END SUB",7)==0 || memcmp(a_S,"END FUNCTION",12)==0 ) {
 /* GOSUB Lab_19000 */    /* END SUB, END FUNCTION */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_19000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"EXIT SUB",8)==0 ) {
 /* GOSUB Lab_19100 */    /* EXIT SUB */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_19100;
  } if ( commfl_int==1 ) goto Lab_509;

 /*   G R A P H I C S */
  if ( memcmp(a_S,"LINE (",6)==0 ) {
 /* GOSUB Lab_20000 */    /* LINE (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_20000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"MARKER ",7)==0 ) {
 /* GOSUB Lab_24000 */    /* MARKER (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_24000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"PLINE ",6)==0 ) {
 /* GOSUB Lab_24500 */    /* PLINE (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_24500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"PMARKER ",8)==0 ) {
 /* GOSUB Lab_25000 */    /* PMARKER (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_25000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"PSET ",5)==0 ) {
 /* GOSUB Lab_20500 */    /* PSET (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_20500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"XUPDATE",7)==0 ) {
 /* GOSUB Lab_23000 */    /* XUPDATE (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_23000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"XCLS",4)==0 ) {
 /* GOSUB Lab_23200 */    /* XCLS (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_23200;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"XSELWI",6)==0 || memcmp(a_S,"XCLOSE",6)==0 || 
memcmp(a_S,"XCURSOR",7)==0) {
 /* GOSUB Lab_23400 */    /* "XSELWI" and/or "XCLOSE" and/or "XCURSOR" 
(graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_23400;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"PALETTE ",8)==0 ) {
 /* GOSUB Lab_23500 */    /* PALETTE (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_23500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"GETCOL ",7)==0 ) {
 /* GOSUB Lab_23300 */    /* GETCOL (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_23300;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"SCREEN ",7)==0 || memcmp(a_S,"XWINDOW ",8)==0) {
 /* GOSUB Lab_21000 */    /* "SCREEN " and/or "XWINDOW " (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_21000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"SET ",4)==0 ) {
 /* GOSUB Lab_21500 */    /* SET  (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_21500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"SAVEGIF ",8)==0 ) {
 /* GOSUB Lab_22000 */    /* SAVEGIF (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_22000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"LOADGIF ",8)==0 ) {
 /* GOSUB Lab_22500 */    /* LOADGIF (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_22500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"GIFINFO ",8)==0 ) {
 /* GOSUB Lab_22600 */    /* GIFINFO (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_22600;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"XTEXT ",6)==0 ) {
 /* GOSUB Lab_25500 */    /* XTEXT (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_25500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"FAREA ",6)==0 ) {
 /* GOSUB Lab_26000 */    /* FAREA (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_26000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"CIRCLE ",7)==0 ) {
 /* GOSUB Lab_26500 */    /* CIRCLE (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_26500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"GCGET ",6)==0 ) {
 /* GOSUB Lab_27000 */    /* GCGET (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_27000;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"XPOINTER ",9)==0 ) {
 /* GOSUB Lab_27500 */    /* XPOINTER (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_27500;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"XTITLE ",7)==0 ) {
 /* GOSUB Lab_23600 */    /* XTITLE (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_23600;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"XREQST ",7)==0 ) {
 /* GOSUB Lab_23700 */    /* XREQST (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_23700;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"XCLIP ",6)==0 ) {
 /* GOSUB Lab_23800 */    /* XCLIP (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_23800;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"XNOCLI ",7)==0 ) {
 /* GOSUB Lab_23900 */    /* XNOCLI (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_23900;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"XWARP ",6)==0 ) {
 /* GOSUB Lab_23950 */    /* XWARP (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_23950;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"GET ",4)==0 || memcmp(a_S,"XGETGE ",7)==0 ) {
 /* GOSUB Lab_22100 */    /* GET (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_22100;
  } if ( commfl_int==1 ) goto Lab_509;
  if ( memcmp(a_S,"PUT ",4)==0 || memcmp(a_S,"XANIM ",6)==0 ) {
 /* GOSUB Lab_22200 */    /* PUT and/or XANIM (graphics) */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_22200;
  } if ( commfl_int==1 ) goto Lab_509;

 /* In 650 defined: SPACE$, MID$, LEFT$, RIGHT$, STR$, CHR$, ASC, VAL, LEN, */
 /*                 SGN, INT, CINT, EOF, COMMAND$, CONST */
 /* GOSUB Lab_29000 */    /* anything else */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_29000;
Lab_509:   /* End Translator */
 /* RETURN */
 longjmp(j__buf[--j__lev],1);



Lab_600:   /* preprocessing the whole file for OPEN files and for QB functions 
*/
 /* information on OPEN must be saved only cumulative (for all modules) */
 nopen_int = 0;
 nl_int = 0;
 if((fp_1 = fopen(strcpy(fn1__S,inpf_S), "r")) == NULL)
 {
  fprintf(stderr,"Can't open file %s\n",fn1__S); exit(1);
 }
 while(! eof(fp_1))
 {
  fgets(line_S, LMAX, fp_1);
  line_S[strlen(line_S) - 1] = '\0';
  nl_int = nl_int + 1;
      if (line_S[0] == 'C' && cflag_int)
      {
      if (memcmp(line_S,"C ",2)==0 || memcmp(line_S,"CG ",3)==0 || 
memcmp(line_S,"CH ",3)==0 || memcmp(line_S,"CM ",3)==0) goto Lab_609;
      }
  /* GOSUB Lab_900 */    /* spliter */
  if (setjmp(j__buf[j__lev++])==0) goto Lab_900;
  for(g_int = 1; g_int <= ntok_int; g_int++)
  {
   strcpy(line_S,linetok_S[g_int]);
       if (memcmp(line_S, "OPEN ", 5)==0)
       {
   i_int = 5;
   strcpy(mode_S,"");
        while (line_S[i_int-1] != '#') i_int++;
   if(strcmp(mode_S, "") == 0)
   {
    strcpy(mode_S,"r+");
   }
   if(nopen_int == 0)
   {
    nopen_int = 1;
    fopen_int[nopen_int] = VAL(MID_S(line_S, i_int + 1, LEN(line_S) - i_int));
   }
   else
   {
    tmpfl_int = 1;
    n_int = VAL(MID_S(line_S, i_int + 1, LEN(line_S) - i_int));
    for(j_int = 1; j_int <= nopen_int; j_int++)
    {
     if(fopen_int[j_int] == n_int)
     {
      tmpfl_int = 0;
     }
    }
    if(tmpfl_int == 1)
    {
     nopen_int = nopen_int + 1;
     fopen_int[nopen_int] = n_int;
    }
   }
       }
  }
Lab_609:
 ;}
 if (fp_1) fclose(fp_1); fp_1=NULL;
 strcpy(fff_S,"");
 if(nopen_int > 0)
 {
  strcpy(d_S,"");
  for(i_int = 1; i_int <= nopen_int; i_int++)
  {
   strcpy(n_S,STR_S(fopen_int[i_int]));
   strcpy(n_S,MID_S(n_S, 2, LEN(n_S) - 1));
   sprintf(tws__S,"%s%s%s%s",d_S,"*fp_",n_S,", ");
   strcpy(d_S,tws__S);
  }
  strcpy(fff_S,LEFT_S(d_S, LEN(d_S) - 2));
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_650:   /* Check for use of QB functions and fill flags used in */
 /* mathexp, qbdecl, qbfunx and 41000 (=hederix) */
 /* Preprocessing intrinsic QB functions. */
 /* Important part is declaring functions in the preamble and */
 /* appending C subroutines at the end of file. */
 /* Here are gathered functions whose names or varlists need not to */
 /* be changed beyond what QB2C normaly does + COMMAND$ and CONST. */
 /* Others that need to be changed are implemented elsewhere (mathexp..) */
 /* Also, stores all global and MAIN explicit declarations (headers) */
 extrnfl_int = 0;   /* Set to 1 if ANY translated function is used */
 mathfl_int = 0;   /* Set to 1 if any <math.h> function is used */
 /* retrnfl% 'RETURN' usage flag, filled in 700 */
 funcflag_int = 0;   /* =1 while main processor is in a FUNCTION */
 strcpy(funcnam_S,"");
 timefl_int = 0;   /* Set to 1 if <time.h> needed */
 pausefl_int = 0;   /* Set to 1 if include files for 'select' needed */
 twsflg_int = 0;   /* Need for temporary storage string */
 sigiff_int = 0;   /* For complicated FOR loops */
 xwflag_int = 0;   /* If XWINDOW used on the right side */
 spacff_int = 0;
 midff_int = 0;
 leftff_int = 0;
 rightff_int = 0;
 strff_int = 0;
 chrff_int = 0;
 ascff_int = 0;
 valff_int = 0;
 lenff_int = 0;
 sgnff_int = 0;
 intff_int = 0;
 nintff_int = 0;
 eofff_int = 0;
 commff_int = 0;
 ncnst_int = 0;
 existff_int = 0;
 vdblff_int = 0;
 rndff_int = 0;
 srndff_int = 0;
 dateff_int = 0;
 timeff_int = 0;
 timerff_int = 0;
 inputff_int = 0;
 inkeyff_int = 0;
 colorff_int = 0;
 clsff_int = 0;
 minff_int = 0;
 maxff_int = 0;
 grafflg_int = 0;
 /* SPACE$ -> SPACE_S */
 /* MID$   -> MID_S */
 /* LEFT$  -> LEFT_S */
 /* RIGHT$ -> RIGHT_S */
 /* STR$   -> STR_S */
 /* CHR$   -> CHR_S */
 /* INKEY$ -> INKEY_S() */
 /* DATE$  -> DATE_S */
 /* TIME$  -> TIME_S */
 /* TIMER  -> TIMER() */
 /* RND    -> RND(1), except if RND( then leave as is, but set rndff% */
 /* ASC    -> ASC */
 /* VAL    -> VAL */
 /* LEN    -> LEN */
 /* INT    -> Int */
 /* ABS    -> fabs */
 /* SGN    -> SGN */
 /* CINT   -> Nint */
 /* EOF(n) -> eof(fp_n) */
 /* CONST -> #define */
 /* MIN   -> #define */
 /* MAX   -> #define */
 if((fp_1 = fopen(strcpy(fn1__S,inpf_S), "r")) == NULL)
 {
  fprintf(stderr,"Can't open file %s\n",fn1__S); exit(1);
 }
 if((fp_2 = fopen(strcpy(fn2__S,tmpfile_S), "w")) == NULL)
 {
  fprintf(stderr,"Can't open file %s\n",fn2__S); exit(1);
 }
 nl_int = 0;
 while(! eof(fp_1))
 {
  fgets(line_S, LMAX, fp_1);
  line_S[strlen(line_S) - 1] = '\0';
  gulix(line_S);
  lleng_int = LEN(line_S);
  nl_int = nl_int + 1;
  if (memcmp(line_S,"REM ",4) == 0)
  {
  fprintf(fp_2,"%s\n",line_S);
  goto Lab_659;
  }
  /* C text lines: */
  if (cflag_int == 1 && line_S[0] == 'C')
  {
   if (memcmp(line_S,"C ",2) == 0)
   {
  fprintf(fp_2,"%s\n",line_S);
  goto Lab_659;
   }
   if (memcmp(line_S,"CG ",3) == 0 || memcmp(line_S,"CH ",3) == 0)
   {
    if (++ncg_int > CMAX) {
    printf("qb2c: Max number of CH lines reached !\n");
    printf("qb2c: Enlarge constant CMAX in qb2c and recompile it.\n"); exit(0);}
  strcpy(cg_S[ncg_int],MID_S(line_S, 4, LMAX));
  fprintf(fp_2,"%s\n",line_S);
  goto Lab_659;
   }
   if (memcmp(line_S,"CM ",3) == 0)
   {
    if (++ncm_int > CMAX) {
    printf("qb2c: Max number of CM lines reached !\n");
    printf("qb2c: Enlarge constant CMAX in qb2c and recompile it.\n"); exit(0);}
  strcpy(cm_S[ncm_int],MID_S(line_S, 4, LMAX));
  fprintf(fp_2,"%s\n",line_S);
  goto Lab_659;
   }
  }
  /* jrplc% je zadnji redni broj imena (funkcije) koje treba mijenjati (od 0) */
  /* jnfun% je zadnji redni broj funkcije */
  /* NFUN   je zadnji redni broj */
      lleng_int = strlen(line_S);
      for(i_int=0; i_int <= NFUN; ++i_int)
      {
       n_int = strlen(strcpy(b_S, rplc_S[i_int]));
       togfl_int = 0;
       for(j_int=0; j_int <= lleng_int - n_int + 1; j_int++)
       {
        if (line_S[j_int] == 34) togfl_int = 1 - togfl_int;
        if (togfl_int == 1) goto Lab_658;
        if (memcmp(b_S,&line_S[j_int],n_int) == 0)
        {
         c=0; if(j_int > 0) c=line_S[j_int-1];
         log_1=!(c>='a' && c<='z' || c>='A' && c<='Z' || c=='_');
         c=line_S[j_int+n_int];
         log_2=!(c>='a' && c<='z' || c>='A' && c<='Z' || c=='_');
         if(log_1 && log_2)
         {
          if(i_int<=jrplc_int)
          {
            if(i_int==0) strcpy(e_S,"Nint");
            if(i_int==1) strcpy(e_S,"Int");
            if(i_int==2) strcpy(e_S,"fabs");
            if(i_int==3) strcpy(e_S,"atan");
            if(i_int==4) strcpy(e_S,"sqrt");
            if(i_int==5) strcpy(e_S,"log");
            if(i_int==6) strcpy(e_S,"sin");
            if(i_int==7) strcpy(e_S,"cos");
            if(i_int==8) strcpy(e_S,"tan");
            if(i_int==9) strcpy(e_S,"exp");
           if(c!='(') {
            if(i_int==10) strcpy(e_S,"DATE$(0)");
            if(i_int==11) strcpy(e_S,"TIME$(0)");
            if(i_int==12) strcpy(e_S,"TIMER()");
            if(i_int==13) strcpy(e_S,"RND(1)");
            if(i_int==14) strcpy(e_S,"INKEY$()");
           }
           if(c=='(' && (i_int==10 || i_int==11 || i_int==13)) strcpy(e_S, b_S);
           strcpy(d_S,line_S);
           line_S[j_int]='\0'; strcat(line_S,e_S);
           strcat(line_S,&d_S[j_int+n_int]);
           j_int=j_int+strlen(e_S)-1;
           lleng_int=strlen(line_S);
          }
    switch(i_int) {
          case  0: nintff_int =1; mathfl_int =1; extrnfl_int=1;
                   break;
          case  1: intff_int  =1; mathfl_int =1; extrnfl_int=1;
                   break;
          case  2: mathfl_int =1;
                   break;
          case  3: mathfl_int =1;
                   break;
          case  4: mathfl_int =1;
                   break;
          case  5: mathfl_int =1;
                   break;
          case  6: mathfl_int =1;
                   break;
          case  7: mathfl_int =1;
                   break;
          case  8: mathfl_int =1;
                   break;
          case  9: mathfl_int =1;
                   break;
          case 10: dateff_int=1; extrnfl_int=1; timefl_int=1; chartfl_int=1;
                   break;
          case 11: timeff_int=1; extrnfl_int=1; timefl_int=1; chartfl_int=1;
                   break;
          case 12: timerff_int=1; extrnfl_int=1; timefl_int=1;
                   break;
          case 13: rndff_int=1; extrnfl_int=1;
                   break;
          case 14: inkeyff_int=1; extrnfl_int=1; chartfl_int=1;
                   break;
          case 15: spacff_int =1; extrnfl_int=1; chartfl_int=1;
                   break;
          case 16: rightff_int=1; extrnfl_int=1; chartfl_int=1;
                   break;
          case 17: leftff_int =1; extrnfl_int=1; chartfl_int=1;
                   break;
          case 18: midff_int  =1; extrnfl_int=1; chartfl_int=1;
                   break;
          case 19: strff_int  =1; extrnfl_int=1; chartfl_int=1;
                   break;
          case 20: chrff_int  =1; extrnfl_int=1; chartfl_int=1;
                   break;
          case 21: ascff_int  =1; extrnfl_int=1; longtfl_int =1;
                   break;
          case 22: valff_int  =1; extrnfl_int=1; vdblff_int =1;
                   break;
          case 23: minff_int  =1;
                   break;
          case 24: maxff_int  =1;
                   break;
          case 25: lenff_int  =1; extrnfl_int=1; vdblff_int =1;
                   break;
          case 26: sgnff_int  =1; extrnfl_int=1; vdblff_int =1;
                   break;
          case 27: eofff_int  =1; extrnfl_int=1;
                   break;
          case 28: existff_int  =1; extrnfl_int=1;
                   break;
          case 29: srndff_int =1; extrnfl_int=1;
                   break;
          case 30: twsflg_int=1;
                   break;
          case 31: commff_int=1; extrnfl_int=1; chartfl_int=1;
                   break;
                  }
         }
Lab_657:
        c=0;
        }
Lab_658:
       c=0;
       }
      }
      /* printf("%s\n",line_S); */
      fprintf(fp_2,"%s\n",line_S);
Lab_659:
 ;}
 if (fp_1) fclose(fp_1); fp_1=NULL;
 if (fp_2) fclose(fp_2); fp_2=NULL;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_700:   /* preprocessing the whole file for variables in MAIN & SUB's */
 /* for a SUB do not save variables found in respective SHARED */
 /* 'Variables' can also be multidimensional arrays */
 /* Lists of variables of all SUBs: subvar$(isub%, i%), nsubvar%(isub%) */
 nsub_int = 0;
 nvar_int = 0;
 strcpy(shtmp_S,"");
 nl_int = 0;
 retrnfl_int = 0;
 strcpy(e_S,CHR_S(34));
 xtmpfl_int = 0;
 strcpy(fime_S,"");
 if((fp_1 = fopen(strcpy(fn1__S,inpf_S), "r")) == NULL)
 {
  fprintf(stderr,"Can't open file %s\n",fn1__S); exit(1);
 }
 while(! eof(fp_1))
 {
  fgets(line_S, LMAX, fp_1);
  line_S[strlen(line_S) - 1] = '\0';
  nl_int = nl_int + 1;
  gulix(line_S);
      if (memcmp(line_S, "FUNCTION ", 9) == 0) xtmpfl_int = 1;
  while(! (strcmp(LEFT_S(line_S, 4), "SUB ") == 0 || xtmpfl_int == 1))
  {
   if(strcmp(line_S, "") != 0)
   {
        if (line_S[0] == 'C' && cflag_int)
        {
        if (memcmp(line_S,"C ",2)==0 || memcmp(line_S,"CG ",3)==0 || 
memcmp(line_S,"CH ",3)==0 || memcmp(line_S,"CM ",3)==0) goto Lab_709;
        }
        if (memcmp(line_S,"REM ",4)==0) goto Lab_709;
    /* GOSUB Lab_900 */    /* line splitting */
    if (setjmp(j__buf[j__lev++])==0) goto Lab_900;
    for(ii_int = 1; ii_int <= ntok_int; ii_int++)
    {
     strcpy(line_S,linetok_S[ii_int]);
     gulix(line_S);
         if (memcmp(line_S, "RETURN", 6) == 0) retrnfl_int = 1;
     /* check for "FOR": */
         if (memcmp(line_S, "FOR", 3) == 0)
         {
     strcpy(line_S,MID_S(line_S, 4, LMAX));
     gulix(line_S);
     goto Lab_704;
         }
     /* check for "GIFINFO ": */
         if (memcmp(line_S, "GIFINFO ", 8) == 0)
         {
          /* Find the second argument */
          k_int=8; while(line_S[k_int] != ',' && line_S[k_int] !='\0') k_int++;
          strcpy(tws__S, &line_S[++k_int]); strcpy(line_S, tws__S);
     /* GOSUB Lab_735 */    /* Tokenize line and save variables */
     if (setjmp(j__buf[j__lev++])==0) goto Lab_735;
     goto Lab_706;
         }
     /* check for "GCGET ": */
         if (memcmp(line_S, "GCGET ", 6) == 0)
         {
     tokenix(MID_S(line_S, 7, LMAX), &k_int, ",", "");
          strcpy(line_S, &tmp_S[1][1]); line_S[(c=strlen(line_S))]='\0';
          line_S[c-1]=','; strcat(line_S, tmp_S[2]);
     /* GOSUB Lab_735 */    /* Tokenize line and save variables */
     if (setjmp(j__buf[j__lev++])==0) goto Lab_735;
     goto Lab_706;
         }
     /* check for "XPOINTER " or "XGETGE ": */
         if (memcmp(line_S,"XPOINTER ",9)==0 || memcmp(line_S,"XGETGE ",7)==0)
         {
          i_int = 10; if (line_S[1] == 'G') i_int = 8;
     strcpy(line_S,MID_S(line_S, i_int, LMAX));
     lleng_int = LEN(line_S);
     i_int = 0;
          while(line_S[i_int] != '(' && i_int < lleng_int) i_int++;
          line_S[i_int] = ' '; c = 1;
          while(i_int < lleng_int) {
           if (line_S[i_int] == '(') c++; if (line_S[i_int] == ')') c--;
           if (c == 0) break;
           i_int++;
          }
          line_S[i_int] = ' ';
          /* Make sure there is no more than 4 parameters in the list: */
          i_int = 0; k_int = 0;
          while ((c=line_S[i_int]) != 0) {
           if (c == ',') k_int++;
           if (k_int >= 4) { line_S[i_int] = '\0'; i_int--; }
           i_int++;
          }
     /* GOSUB Lab_735 */    /* Tokenize line and save variables */
     if (setjmp(j__buf[j__lev++])==0) goto Lab_735;
     goto Lab_706;
         }
     /* check for "XREQST ": */
         if (memcmp(line_S, "XREQST ", 7) == 0)
         {
     tokenix(MID_S(line_S, 7, LMAX), &k_int, ",", "");
          strcpy(line_S, tmp_S[2]); strcat(line_S, ", ");
          strcat(line_S, tmp_S[3]);
     /* GOSUB Lab_735 */    /* Tokenize line and save variables */
     if (setjmp(j__buf[j__lev++])==0) goto Lab_735;
     goto Lab_706;
         }
     jflg_int = 0;   /* check 'LINE INPUT #','INPUT #' and 'INPUT' */
     /* GOSUB Lab_730 */ 
     if (setjmp(j__buf[j__lev++])==0) goto Lab_730;
     if(jflg_int == 1)
     {
      goto Lab_706;
     }
     jflg_int = 0;   /* variables among SUB arguments, check 'CALLs' */
     /* GOSUB Lab_750 */ 
     if (setjmp(j__buf[j__lev++])==0) goto Lab_750;
     if(jflg_int == 1)
     {
      goto Lab_706;
     }
Lab_704:
     jflg_int = 0;
     lleng_int = LEN(line_S);
     for(k_int = 1; k_int <= lleng_int; k_int++)
     {
          if (line_S[k_int-1] == '=') { jflg_int = 1; goto Lab_705; }
     }
Lab_705:
     if(jflg_int == 1)
     {
      for(j_int = 0; j_int <= k_int - 3; j_int++)
      {
           if (line_S[j_int] == ' ') { jflg_int = 0; goto Lab_708; }
      }
     }
Lab_708:
     if(jflg_int == 1)
     {
      strcpy(z_S,LEFT_S(line_S, k_int - 2));
          if (z_S[strlen(z_S)-1] == ')')
          {
      j_int = 0;
           while (z_S[j_int] != '(') j_int++;
           j_int++;
           z_S[j_int  ] = ')';
           z_S[j_int+1] = '\0';
          }
      /* GOSUB Lab_790 */    /* Memorizing z$ */
      if (setjmp(j__buf[j__lev++])==0) goto Lab_790;
     }
Lab_706:
    ;}
   }
   if(eof(fp_1))
   {
    goto Lab_707;
   }
   fgets(line_S, LMAX, fp_1);
   line_S[strlen(line_S) - 1] = '\0';
   nl_int = nl_int + 1;
   gulix(line_S);
   if(strcmp(LEFT_S(line_S, 9), "FUNCTION ") == 0)
   {
    xtmpfl_int = 1;
   }
  }
Lab_707:   /* Get FUNCTION name */
  if(xtmpfl_int == 1)
  {
   xtmpfl_int = 0;
   /* GOSUB Lab_715 */ 
   if (setjmp(j__buf[j__lev++])==0) goto Lab_715;
  }
  nvlist_int[nsub_int] = nvar_int;
  /* Sorting variables */
  strcpy(int_S,"");
  strcpy(rea_S,"");
  strcpy(sss_S,"");
  strcpy(lon_S,"");
  strcpy(dbl_S,"");
  strcpy(byt_S,"");
  if(nvar_int > 0)
  {
   /* GOSUB Lab_710 */ 
   if (setjmp(j__buf[j__lev++])==0) goto Lab_710;
   if(strcmp(int_S, "") != 0)
   {
    strcpy(int_S,LEFT_S(int_S, LEN(int_S) - 2));
   }
   if(strcmp(rea_S, "") != 0)
   {
    strcpy(rea_S,LEFT_S(rea_S, LEN(rea_S) - 2));
   }
   if(strcmp(sss_S, "") != 0)
   {
    strcpy(sss_S,LEFT_S(sss_S, LEN(sss_S) - 2));
   }
   if(strcmp(lon_S, "") != 0)
   {
    strcpy(lon_S,LEFT_S(lon_S, LEN(lon_S) - 2));
   }
   if(strcmp(dbl_S, "") != 0)
   {
    strcpy(dbl_S,LEFT_S(dbl_S, LEN(dbl_S) - 2));
   }
   if(strcmp(byt_S, "") != 0)
   {
    strcpy(byt_S,LEFT_S(byt_S, LEN(byt_S) - 2));
   }
  }
  strcpy(vari_S[nsub_int],int_S);
  strcpy(varr_S[nsub_int],rea_S);
  strcpy(vars_S[nsub_int],sss_S);
  strcpy(varl_S[nsub_int],lon_S);
  strcpy(vard_S[nsub_int],dbl_S);
  strcpy(varb_S[nsub_int],byt_S);
  if(! eof(fp_1))
  {
   nvar_int = 0;
   nsub_int = nsub_int + 1;
   strcpy(shtmp_S,"");
   /* Extraction of varlist at the beginning nsub%-th SUB */
   /* GOSUB Lab_780 */ 
   if (setjmp(j__buf[j__lev++])==0) goto Lab_780;
  }
Lab_709:
 ;}
 if (fp_1) fclose(fp_1); fp_1=NULL;
 nsubvar_int[nsub_int + 1] = 0;   /* Ensure this is 0 (important in 45000) */
 if(ifsub_int == 0)
 {
  endline_int = nl_int;
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_710:   /* sorting variable types */
 for(i_int = 1; i_int <= nvar_int; i_int++)
 {
  strcpy(d_S,vlist_S[nsub_int][i_int]);
  vartyp(d_S, &typ_int);
  if(typ_int == 0)
  {
   printf("%s%s%s% d \n","ERROR can't determine vartyp of: ",d_S," in line 
No",nl_int);
        exit(1);
  }
  if(typ_int < 10)
  {
   if(typ_int == 1)
   {
    sprintf(tws__S,"%s%s%s",int_S,d_S,", ");
    strcpy(int_S,tws__S);
   }
   else
   {
    if(typ_int == 5)
    {
     sprintf(tws__S,"%s%s%s",sss_S,d_S,"[LMAX], ");
     strcpy(sss_S,tws__S);
    }
    else
    {
     if(typ_int == 2)
     {
      sprintf(tws__S,"%s%s%s",lon_S,d_S,", ");
      strcpy(lon_S,tws__S);
     }
     else
     {
      if(typ_int == 4)
      {
       sprintf(tws__S,"%s%s%s",dbl_S,d_S,", ");
       strcpy(dbl_S,tws__S);
      }
      else
      {
       if(typ_int == 3)
       {
        sprintf(tws__S,"%s%s%s",rea_S,d_S,", ");
        strcpy(rea_S,tws__S);
       }
       else
       {
        if(typ_int == 8)
        {
         sprintf(tws__S,"%s%s%s",byt_S,d_S,", ");
         strcpy(byt_S,tws__S);
        }
       }
      }
     }
    }
   }
  }
  else
  {
  }
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_715:   /* Getting FUNCTION name, "" if not a FUNCTION */
 /* This name is then forbidden in variable list */
 strcpy(fime_S,"");
 g_int = 10;
 while(strcmp(MID_S(line_S, g_int, 1), "(") != 0)
 {
  g_int = g_int + 1;
 }
 strcpy(fime_S,MID_S(line_S, 10, g_int - 10));
 gulix(fime_S);
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_720:   /* Unused */
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_730:   /* Checking variable declarations in "LINE INPUT #n," statements */
 gulix(line_S);
 leng_int = LEN(line_S);
 if(strcmp(LEFT_S(line_S, 12), "LINE INPUT #") == 0 || strcmp(LEFT_S(line_S, 
7), "INPUT #") == 0)
 {
  g_int = 8;
  jflg_int = 1;
  while(strcmp(MID_S(line_S, g_int, 1), ",") != 0 && g_int < leng_int)
  {
   g_int = g_int + 1;
  }
  if(g_int == leng_int)
  {
   printf("%s% d %s%s\n","SYNTAX ERROR in line No",nl_int,":",line_S);
       exit(1);
  }
  else
  {
   strcpy(line_S,MID_S(line_S, g_int + 1, leng_int - g_int));
   /* GOSUB Lab_735 */ 
   if (setjmp(j__buf[j__lev++])==0) goto Lab_735;
   /* RETURN */
   longjmp(j__buf[--j__lev],1);
  }
 }
 else
 {
  /*  Checking variable declarations in "INPUT" statements */
  if(strcmp(LEFT_S(line_S, 5), "INPUT") == 0)
  {
   jflg_int = 1;
   if(leng_int == 5)
   {
    printf("%s% d %s%s\n","SYNTAX ERROR in line No",nl_int,":",line_S);
        exit(1);
   }
   else
   {
    strcpy(line_S,MID_S(line_S, 6, leng_int - 5));
    /* GOSUB Lab_735 */ 
    if (setjmp(j__buf[j__lev++])==0) goto Lab_735;
    /* RETURN */
    longjmp(j__buf[--j__lev],1);
   }
  }
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_735:   /* Tokenizator varijabli u INPUT, GIFINFO ... linijama */
 tokenix(line_S, &L_int, ",", ";");
 for(g_int = 1; g_int <= L_int; g_int++)
 {
  strcpy(z_S,tmp_S[g_int]);   /* Memorizing variable z$ */
  /* GOSUB Lab_790 */ 
  if (setjmp(j__buf[j__lev++])==0) goto Lab_790;
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_750:   /* Potraga za varijablama argumentima user SUBroutina i FUNCTIONa */
 /* WHOLE arrays cannot be passed at the moment !!!! */
 /* Array names (when possible) passed as bare names (no brackets). */
 /* Element of an array can be passed as a single number or string, */
 /* however, they are not stored here (for simplicity). */
 if(strcmp(LEFT_S(line_S, 4), "CALL") == 0)
 {
  g_int = 5;
  leng_int = LEN(line_S);
  while(! strcmp(MID_S(line_S, g_int, 1), "(") == 0 && g_int < leng_int)
  {
   g_int = g_int + 1;
  }
  if(g_int == leng_int)
  {
   /* RETURN */
   longjmp(j__buf[--j__lev],1);
  }
  j_int = leng_int;
  while(! strcmp(MID_S(line_S, j_int, 1), ")") == 0 && j_int > g_int)
  {
   j_int = j_int - 1;
  }
  if(strcmp(MID_S(line_S, j_int, 1), ")") != 0)
  {
   printf("%s% d %s%s\n","SYNTAX ERROR in line No",nl_int,":",line_S);
       exit(1);
  }
  strcpy(d_S,MID_S(line_S, g_int + 1, j_int - g_int - 1));
  gulix(d_S);
  /* tokenization of the CALLed SUBroutine argument list */
  tokenix(d_S, &L_int, ",", "");
  for(g_int = 1; g_int <= L_int; g_int++)
  {
   strcpy(z_S,tmp_S[g_int]);
   /* Check whether z$ is a var (rather than funct. or express.) */
   /* GOSUB Lab_755 */ 
   if (setjmp(j__buf[j__lev++])==0) goto Lab_755;
   if(tmpfl_int == 0)
   {
    if(VAL(z_S) == 0 && strcmp(LEFT_S(z_S, 1), "0") != 0)   /* Memorizing 
variable z$ */
    {
     /* GOSUB Lab_790 */ 
     if (setjmp(j__buf[j__lev++])==0) goto Lab_790;
    }
   }
  }
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);
Lab_755:   /* Check whether z$ is a var (not array, funct. or expr.) */
 tmpfl_int = 0;
 if(strcmp(LEFT_S(z_S, 1), e_S) == 0)
 {
  tmpfl_int = 1;
  goto Lab_756;
 }
 for(j_int = 1; j_int <= LEN(z_S); j_int++)
 {
  strcpy(b_S,MID_S(z_S, j_int, 1));
  if(strcmp(b_S, " ") == 0 || strcmp(b_S, "(") == 0)
  {
   tmpfl_int = 1;
   goto Lab_756;
  }
 }
Lab_756:
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_780:   /* Storing argumentlist of the SUB or FUNCTION */
 /* and storing of the SUB name */
 strcpy(a_S,line_S);
 j_int = 0;
 k_int = 0;
 leng_int = LEN(a_S);
 brcnt_int = 0;
 for(i_int = 4; i_int <= leng_int; i_int++)
 {
      c=a_S[i_int-1];
      if (c=='(') { if (brcnt_int++ == 0)   j_int = i_int + 1; }
      if (c==')') { if (--brcnt_int == 0) { k_int = i_int - 1; goto Lab_781; }}
 }
Lab_781:
     if(memcmp(a_S,"SUB ",4) == 0) {strcpy(b_S, &a_S[4]), b_S[j_int-6]='\0';}
     if(memcmp(a_S,"FUNC",4) == 0) {strcpy(b_S, &a_S[9]), b_S[j_int-11]='\0';}
 gulix(b_S);
 strcpy(subname_S[nsub_int],b_S);
 if(j_int == 0)
 {
  nsubvar_int[nsub_int] = 0;
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 strcpy(varlist_S,MID_S(a_S, j_int, k_int - j_int + 1));
 gulix(varlist_S);   /* varlist -> tmp$(), n% */
 tokenix(varlist_S, &n_int, ",", "");
 nsubvar_int[nsub_int] = n_int;
 if(n_int > 0)
 {
  for(g_int = 1; g_int <= n_int; g_int++)
  {
   strcpy(subvar_S[nsub_int][g_int],tmp_S[g_int]);
  }
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_790:   /* Spremanje jedne varijable z$, za deklaraciju ako je NOVA */
 /* i ako nije u SHARED i ako nije parametar doticne SUBroutine */
 /* i ako nije char konstanta "..." ili brojna konstanta eg. 3 */
 if(strcmp(z_S, fime_S) == 0)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 j_int = ASC(LEFT_S(z_S, 1));
 if((97 <= j_int && j_int <= 122 || 65 <= j_int && j_int <= 90 || 48 <= j_int 
&& j_int <= 57))
 {
  /*       IF LEFT$(z$, 1) = e$ THEN RETURN */
          if (z_S[0] == '"') /* RETURN */ longjmp(j__buf[--j__lev],1);
  /* GOSUB Lab_795 */ 
  if (setjmp(j__buf[j__lev++])==0) goto Lab_795;
  if(nvar_int == 0 && nshtok_int[nsub_int] == 0 && nsubvar_int[nsub_int] == 0)
  {
   nvar_int = 1;
   strcpy(vlist_S[nsub_int][1],z_S);
  }
  else
  {
   for(j_int = 1; j_int <= nvar_int; j_int++)
   {
    if(strcmp(vlist_S[nsub_int][j_int], z_S) == 0)
    {
     /* RETURN */
     longjmp(j__buf[--j__lev],1);
    }
   }
   if(nsub_int == 0)
   {
    for(j_int = 1; j_int <= nSHRDtk_int; j_int++)
    {
     if(strcmp(shrd_S[j_int], z_S) == 0)
     {
      /* RETURN */
      longjmp(j__buf[--j__lev],1);
     }
    }
   }
   else
   {
    for(j_int = 1; j_int <= nshtok_int[nsub_int]; j_int++)
    {
     if(strcmp(shtok_S[nsub_int][j_int], z_S) == 0)
     {
      /* RETURN */
      longjmp(j__buf[--j__lev],1);
     }
    }
    for(j_int = 1; j_int <= nsubvar_int[nsub_int]; j_int++)
    {
     if(strcmp(subvar_S[nsub_int][j_int], z_S) == 0)
     {
      /* RETURN */
      longjmp(j__buf[--j__lev],1);
     }
    }
   }
   nvar_int = nvar_int + 1;
   strcpy(vlist_S[nsub_int][nvar_int],z_S);
  }
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_795:   /* x(...)  -->  x() */
     if (z_S[strlen(z_S)-1] == ')')
     {
      jj_int=0; while( z_S[jj_int] != '(' ) jj_int++;
      z_S[++jj_int] = ')'; z_S[++jj_int] = '\0';
     }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_800:   /* preprocessing the whole file for SHARED variables and arrays and 
*/
 /* storing all SHARED token lists for every SUB in shtok$(jsub%,i%) */
 nSHRDtk_int = 0;
 jsub_int = 0;
 ifsub_int = 0;
 endline_int = 0;
 narr_int = 0;
 alis_int = 0;
 nl_int = 0;
 g_int = 0;
 if((fp_1 = fopen(strcpy(fn1__S,inpf_S), "r")) == NULL)
 {
  fprintf(stderr,"Can't open file %s\n",fn1__S); exit(1);
 }
 while(! eof(fp_1))
 {
  fgets(line_S, LMAX, fp_1);
  line_S[strlen(line_S) - 1] = '\0';
  nl_int = nl_int + 1;
  gulix(line_S);
  lleng_int = LEN(line_S);
  if(lleng_int == 0)
  {
   goto Lab_809;
  }
  if(strcmp(LEFT_S(line_S, 4), "SUB ") == 0 || strcmp(LEFT_S(line_S, 9), 
"FUNCTION ") == 0)
  {
   jsub_int = jsub_int + 1;
   g_int = 0;
   if(ifsub_int == 0)
   {
    ifsub_int = 1;
    endline_int = nl_int - 1;
   }
  }
  if(jsub_int > NSMX)
  {
   printf("%s\n","Max. number of SUBroutines and FUNCTIONs reached !");
   printf("%s\n","Enlarge the NSMX parameter in QB2C, and recompile it !");
       exit(-1);
  }
  /* List of dimensioned arrays in MAIN: */
  /* (Those which are shared shall be declared in the preamble.) */
  if(jsub_int == 0 && strcmp(LEFT_S(line_S, 4), "DIM ") == 0)
  {
   i_int = 8;
   while(strcmp(MID_S(line_S, i_int, 1), ":") != 0 && i_int <= lleng_int)
   {
    i_int = i_int + 1;
   }
   strcpy(b_S,MID_S(line_S, 4, i_int - 4));
   gulix(b_S);
   tokenix(b_S, &ntok_int, ",", "");
   for(i_int = 1; i_int <= ntok_int; i_int++)
   {
    strcpy(temp_S[i_int],tmp_S[i_int]);
   }
   if(ntok_int > 0)
   {
    for(i_int = 1; i_int <= ntok_int; i_int++)
    {
     strcpy(d_S,temp_S[i_int]);
     arraydim(d_S);
     narr_int = narr_int + 1;
     strcpy(darr_S[narr_int],d_S);
    }
   }
  }
  if(strcmp(MID_S(line_S, 1, 6), "SHARED") == 0)
  {
   strcpy(d_S,MID_S(line_S, 8, lleng_int - 7));
   /* GOSUB Lab_805 */ 
   if (setjmp(j__buf[j__lev++])==0) goto Lab_805;
  }
Lab_809:
 ;}
 if (fp_1) fclose(fp_1); fp_1=NULL;
 /* Sorting variables */
 if(nSHRDtk_int > 0)
 {
  strcpy(sint_S,"");
  strcpy(srea_S,"");
  strcpy(ssss_S,"");
  strcpy(slin_S,"");
  strcpy(sdbl_S,"");
  for(i_int = 1; i_int <= nSHRDtk_int; i_int++)
  {
   strcpy(d_S,shrd_S[i_int]);
   strcpy(z_S,RIGHT_S(d_S, 1));
   if(strcmp(z_S, ")") != 0)
   {
    vartyp(d_S, &typ_int);
    if(typ_int == 1)
    {
     sprintf(tws__S,"%s%s%s",sint_S,d_S,", ");
     strcpy(sint_S,tws__S);
    }
    else
    {
     if(typ_int == 5)
     {
      sprintf(tws__S,"%s%s%s",ssss_S,d_S,"[LMAX], ");
      strcpy(ssss_S,tws__S);
     }
     else
     {
      if(typ_int == 2)
      {
       sprintf(tws__S,"%s%s%s",slin_S,d_S,", ");
       strcpy(slin_S,tws__S);
      }
      else
      {
       if(typ_int == 4)
       {
        sprintf(tws__S,"%s%s%s",sdbl_S,d_S,", ");
        strcpy(sdbl_S,tws__S);
       }
       else
       {
        sprintf(tws__S,"%s%s%s",srea_S,d_S,", ");
        strcpy(srea_S,tws__S);
       }
      }
     }
    }
   }
   else
   {
    for(j_int = 1; j_int <= narr_int; j_int++)
    {
     g_int = LEN(d_S) - 1;
     if(strcmp(LEFT_S(d_S, g_int), LEFT_S(darr_S[j_int], g_int)) == 0)
     {
      alis_int = alis_int + 1;
      alist_int[alis_int] = j_int;
     }
    }
   }
  }
  /* Bare variables: */
  if(strcmp(sint_S, "") != 0)
  {
   strcpy(sint_S,LEFT_S(sint_S, LEN(sint_S) - 2));
  }
  if(strcmp(srea_S, "") != 0)
  {
   strcpy(srea_S,LEFT_S(srea_S, LEN(srea_S) - 2));
  }
  if(strcmp(ssss_S, "") != 0)
  {
   strcpy(ssss_S,LEFT_S(ssss_S, LEN(ssss_S) - 2));
  }
  if(strcmp(slin_S, "") != 0)
  {
   strcpy(slin_S,LEFT_S(slin_S, LEN(slin_S) - 2));
  }
  if(strcmp(sdbl_S, "") != 0)
  {
   strcpy(sdbl_S,LEFT_S(sdbl_S, LEN(sdbl_S) - 2));
  }
 }
 if(nSHRDtk_int > TMAX)
 {
  printf("%s\n","qb2c: MAIN (800): Dimension of tmp$() too small. Enlarge TMAX 
and recompile qb2c!");
      exit(1);
 }
 for(i_int = 1; i_int <= nSHRDtk_int; i_int++)
 {
  strcpy(shtok_S[0][i_int],shrd_S[i_int]);
 }
 nshtok_int[0] = nSHRDtk_int;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_805:   /* tokenization of SHARED variables */
 leng_int = LEN(d_S);
 i_int = 1;   /* g% = 0, this is set at the beginning of a SUB */
 while(i_int <= leng_int)
 {
  if(strcmp(MID_S(d_S, i_int, 1), ",") != 0 && strcmp(MID_S(d_S, i_int, 1), " 
") != 0)
  {
   j_int = i_int;
   i_int = i_int + 1;
   while(! (strcmp(MID_S(d_S, i_int, 1), ",") == 0 || strcmp(MID_S(d_S, i_int, 
1), "  ") == 0 || i_int > leng_int))
   {
    i_int = i_int + 1;
   }
   strcpy(z_S,MID_S(d_S, j_int, i_int - j_int));
   g_int = g_int + 1;
   if(g_int > TMAX)
   {
    printf("%s\n","qb2c: MAIN (805): Dimension of tmp$() too small. Enlarge 
TMAX and recompile qb2c!");
         exit(1);
   }
   strcpy(shtok_S[jsub_int][g_int],z_S);
   if(nSHRDtk_int == 0)
   {
    nSHRDtk_int = 1;
    strcpy(shrd_S[1],z_S);
   }
   else
   {
    tmpfl_int = 0;
    for(L_int = 1; L_int <= nSHRDtk_int; L_int++)
    {
     if(strcmp(shrd_S[L_int], z_S) == 0)
     {
      tmpfl_int = 1;
     }
    }
    if(tmpfl_int == 0)
    {
     nSHRDtk_int = nSHRDtk_int + 1;
     strcpy(shrd_S[nSHRDtk_int],z_S);
    }
   }
  }
  i_int = i_int + 1;
 }
 nshtok_int[jsub_int] = g_int;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_900:   /* spliting one physical line line$ into ':' pieces, line spliter */
 /* Split IF lines if something after THEN and add END IF */
 /* Force spliting if line labeled */
 /* Returns (bare, gulix!) linetok$(), ntok% */
 gulix(line_S);
 lleng_int = LEN(line_S);
 if(lleng_int == 0)
 {
  ntok_int = 0;
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 ntok_int = 0;
 tok_int[0] = 0;
 lremfl_int = 0;
 thnfl_int = 0;
 strcpy(t_S,"");
     if (strncmp(line_S,"REM",3)==0)
     {
 ntok_int = 1;
 strcpy(linetok_S[1],line_S);
 /* RETURN */
 longjmp(j__buf[--j__lev],1);
     }
 i_int = 1;
 togfl_int = 0;
 g_long = VAL(line_S);
 if(g_long != 0)
 {
  strcpy(b_S,STR_S(g_long));
  sprintf(line_S,"%s%s%s",b_S,": ",MID_S(line_S, LEN(b_S), LMAX));
  lleng_int = LEN(line_S);
 }
 while(i_int <= lleng_int - 3)
 {
      c = line_S[i_int-1];
      if (c == 34) togfl_int = 1 - togfl_int;
      if (c == ':' && togfl_int == 0)
      {
  ntok_int = ntok_int + 1;
  tok_int[ntok_int] = i_int;
      }
  strcpy(d_S,MID_S(line_S, i_int, 4));
  if(strcmp(d_S, "THEN") == 0 && togfl_int == 0)
  {
   strcpy(f_S,MID_S(line_S, i_int + 4, LMAX));
   gulix(f_S);
   if(strcmp(f_S, "") == 0)
   {
    goto Lab_902;
   }
   if(VAL(f_S) == 0)
   {
    sprintf(line_S,"%s%s%s",LEFT_S(line_S, i_int + 3),": ",MID_S(line_S, i_int 
+ 4, LMAX));
    lleng_int = lleng_int + 2;
   }
   else
   {
    sprintf(line_S,"%s%s%s",LEFT_S(line_S, i_int + 3),": GOTO",MID_S(line_S, 
i_int + 4, LMAX));
    lleng_int = lleng_int + 6;
   }
       thnfl_int++;
   i_int = i_int + 3;
  }
  if(strcmp(d_S, "REM ") == 0 && togfl_int == 0)
  {
   lremfl_int = 1;
   goto Lab_902;
  }
  i_int = i_int + 1;
 }
Lab_901:   /* split the line in tokens separated by ":" */
Lab_902:
 ntok_int = ntok_int + 1;
Lab_903:
 tok_int[ntok_int] = lleng_int + 1;
 if(lremfl_int == 1)
 {
  ntok_int = ntok_int - 1;
  strcpy(t_S,MID_S(line_S, tok_int[ntok_int] + 1, LMAX));
  gulix(t_S);
  strcpy(t_S,MID_S(t_S, 5, LMAX));
 }
 tmpfl_int = 0;
 for(i_int = 1; i_int <= ntok_int; i_int++)
 {
  strcpy(b_S,MID_S(line_S, tok_int[i_int - 1] + 1, tok_int[i_int] - 
tok_int[i_int - 1] - 1));
  gulix(b_S);
  strcpy(linetok_S[i_int + tmpfl_int],b_S);
      if (strncmp(b_S,"IF ",3)==0)
      {
       j_int = 0; g_int = strlen(b_S); tmpfl_int = 0;
       while (!(tmpfl_int==0 && (memcmp(&b_S[j_int],"GOTO",4) == 0 || 
memcmp(&b_S[j_int],"GOSUB",5) == 0)) && j_int < g_int)
       { if (b_S[j_int] == '"') tmpfl_int = 1 - tmpfl_int; j_int++; }
       if (j_int != g_int)
       {
        if(memcmp(&b_S[j_int],"GOTO",4) == 0) { strcpy(d_S, &b_S[j_int]); 
b_S[j_int] = '\0'; }
        else
        {
        if(memcmp(&b_S[j_int],"GOSUB",5) == 0) { strcpy(d_S, &b_S[j_int]); 
b_S[j_int] = '\0'; }
        }
  sprintf(linetok_S[i_int + tmpfl_int],"%s%s",b_S," THEN");
        tmpfl_int++; thnfl_int = 1;
  strcpy(linetok_S[i_int + tmpfl_int],d_S);
       }
      }
 }
 ntok_int = ntok_int + tmpfl_int;
 for(i_int = 1; i_int <= thnfl_int; i_int++)
 {
  ntok_int = ntok_int + 1;
  strcpy(linetok_S[ntok_int],"END IF");
 }
 /*     PRINT line$ */
 /*     FOR i% = 1 TO ntok% */
 /*      PRINT linetok$(i%) */
 /*     NEXT i% */
 /*     PRINT t$ */
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_1000:   /* "SUB name(varlist...)", "FUNCTION name(varlist...)" */
 if(commfl_int == 1)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 if(strcmp(LEFT_S(a_S, 4), "SUB ") == 0)
 {
  xtmpfl_int = 0;
  goto Lab_1001;
 }
 if(strcmp(LEFT_S(a_S, 9), "FUNCTION ") == 0)
 {
  xtmpfl_int = 1;
  funcflag_int = 1;
  nfuncs_int = nfuncs_int + 1;
  goto Lab_1001;
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);
Lab_1001:
 isub_int = isub_int + 1;
 jopn_int = 0;
 lspac_int = 1;
 strcpy(spc_S,SPACE_S(lspac_int));
 statfl_int[isub_int] = 0;
 funcfl_int[isub_int] = xtmpfl_int;
 /* GOSUB Lab_31000 */    /* Make a list of possibly used arrays in the current 
sub */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_31000;
 leng_int = LEN(a_S);
 for(i_int = 4; i_int <= leng_int; i_int++)
 {
  if(strcmp(RIGHT_S(a_S, 7), " STATIC") == 0)
  {
   strcpy(a_S,LEFT_S(a_S, leng_int - 7));
   gulix(a_S);
   leng_int = LEN(a_S);
   statfl_int[isub_int] = 1;   /* Static variables flag */
  }
 }
 for(i_int = 4; i_int <= leng_int; i_int++)
 {
  strcpy(b_S,MID_S(a_S, i_int, 1));
  if(strcmp(b_S, "(") == 0)
  {
   j_int = i_int + 1;
  }
  if(strcmp(b_S, ")") == 0)
  {
   k_int = i_int - 1;
  }
 }
 if(nsubvar_int[isub_int] == 0)
 {
  strcpy(prtf_S,MID_S(a_S, 4, leng_int - 3));
  gulix(prtf_S);
  sprintf(tws__S,"%s%s%s","int ",prtf_S,"(, ");
  strcpy(prtf_S,tws__S);
  strcpy(varlist_S,"");
 }
 else
 {
  if(funcfl_int[isub_int] == 0)
  {
   strcpy(prtf_S,MID_S(a_S, 4, j_int - 5));
   gulix(prtf_S);
  }
  else
  {
   strcpy(prtf_S,MID_S(a_S, 9, j_int - 10));
   gulix(prtf_S);
   strcpy(funames_S[nfuncs_int],prtf_S);
   strcpy(funcnam_S,prtf_S);
  }
  if(xtmpfl_int == 0)
  {
   sprintf(tws__S,"%s%s%s","int ",prtf_S,"(");
   strcpy(prtf_S,tws__S);
  }
  else
  {
   vartyp(prtf_S, &typ_int);
   strcpy(z_S,"");
   if(typ_int == 5)
   {
    strcpy(z_S,"*");
   }
   sprintf(tws__S,"%s%s%s%s%s","extern ",atyp_S[typ_int],z_S,prtf_S,"(");
   strcpy(prtf_S,tws__S);
  }
  strcpy(varlist_S,MID_S(a_S, j_int, k_int - j_int + 1));
 }
 tokenix(varlist_S, &n_int, ",", "");
 strcpy(c_S,"");
 strcpy(b_S,"");
 if(funcfl_int[isub_int] == 0)
 {
  strcpy(b_S,"*");
 }
 for(i_int = 1; i_int <= n_int; i_int++)
 {
  strcpy(d_S,tmp_S[i_int]);   /* type determination */
  /* GOSUB Lab_1010 */ 
  if (setjmp(j__buf[j__lev++])==0) goto Lab_1010;
  sprintf(tws__S,"%s%s%s%s%s",prtf_S,e_S,b_S,tmp_S[i_int],", ");
  strcpy(prtf_S,tws__S);
  gulix(e_S);
  sprintf(tws__S,"%s%s%s",c_S,e_S,", ");
  strcpy(c_S,tws__S);
 }
 strcpy(prtf_S,LEFT_S(prtf_S, LEN(prtf_S) - 2));
 if(xtmpfl_int == 1)
 {
  if(strcmp(c_S, "") != 0)
  {
   strcpy(c_S,LEFT_S(c_S, LEN(c_S) - 2));
  }
  strcpy(funtyl_S[nfuncs_int],c_S);
 }
 fprintf(fp_2,"\n");
 fprintf(fp_2,"%s\n","/*- User SUB--Start -*/");   /* Do not change, used in 
post. 45000 */
 fprintf(fp_2,"%s%s%s\n",prtf_S,")",t_S);
 fprintf(fp_2,"%s\n","{");
 commfl_int = 1;
 usersub_int = 1;
 if(nshtok_int[isub_int] > 0)
 {
  /* comment on shared variables */
  strcpy(b_S,"");
  for(j_int = 1; j_int <= nshtok_int[isub_int]; j_int++)
  {
   sprintf(tws__S,"%s%s%s",b_S,shtok_S[isub_int][j_int],", ");
   strcpy(b_S,tws__S);
  }
  strcpy(b_S,LEFT_S(b_S, LEN(b_S) - 2));
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 3;
  i__s = (i__s + 0 ) % 32;
  splitdec(b_S, &n_int, &w__s[(i__stmp+0)%32]);
  for(j_int = 1; j_int <= n_int; j_int++)
  {
   fprintf(fp_2,"%s%s%s\n","/* SHARED: ",tmp_S[j_int]," */");
  }
  fprintf(fp_2,"\n");
 }
 /* lista varijabli: */
 tmpfl_int = 0;
 strcpy(int_S," int  ");
 strcpy(float_S," float ");
 if(longflg_int == 1)
 {
  strcpy(int_S," long ");
 }
 if(doblflg_int == 1)
 {
  strcpy(float_S," double ");
 }
 if(strcmp(vari_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 3;
  i__s = (i__s + 0 ) % 32;
  declarix(int_S, vari_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 if(strcmp(varr_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 0;
  i__s = (i__s + 0 ) % 32;
  declarix(float_S, varr_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 if(strcmp(vars_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 1;
  i__s = (i__s + 0 ) % 32;
  declarix(" char ", vars_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 if(strcmp(varl_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 4;
  i__s = (i__s + 0 ) % 32;
  declarix(" long ", varl_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 if(strcmp(vard_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 0;
  i__s = (i__s + 0 ) % 32;
  declarix(" double ", vard_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 if(strcmp(varb_S[isub_int], "") != 0)
 {
  i__stmp = ++i__s % 32;
  w__s[(i__stmp + 0 ) % 32] = 0;
  i__s = (i__s + 0 ) % 32;
  declarix(" unsigned char ", varb_S[isub_int], &w__s[(i__stmp+0)%32]);
  tmpfl_int = 1;
 }
 if(tmpfl_int == 1)
 {
  fprintf(fp_2,"\n");
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_1010:   /* sorting variable types (default) */
 vartyp(d_S, &typ_int);
 if((typ_int == 0 || typ_int > 5) && typ_int != 8)
 {
  printf("%s%s%s% d %s\n","Error at label 1010 of QB2C: vartyp of ",d_S," 
is",typ_int,"...");
  printf("%s% d %s%s\n","...in line No",nl_int,": ",a_S);
  exit(0);
 }
 else
 {
  strcpy(e_S,atyp_S[typ_int]);
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_1250:   /* "SHARED" - this is already taken care of, just skip */
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_1500:   /* "END" (main) */
 /* END    -> exit(0);  done here */
 if(nl_int == endline_int + 1)
 {
Lab_1501:
  fprintf(fp_2,"%s\n","} /* End of MAIN */");
  endmain_int = 1;
  lspac_int = lspac_int - 1;
  strcpy(spc_S,SPACE_S(lspac_int));
  if(lspac_int < 0)
  {
   printf("%s% d %s% d %s%s\n","WARNING! Braces count = ",lspac_int," at line: 
",nl_int,":",line_S);
  }
  if(lspac_int != 0)
  {
       fprintf(stderr,"ERROR: Misscount at the 'End of MAIN' brace: %d\n", 
lspac_int); exit(1);
  }
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 if(commfl_int == 1)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 if(strcmp(a_S, "END") == 0)
 {
  fprintf(fp_2,"%s%s%s\n",spc_S,"exit(0);",t_S);
  commfl_int = 1;
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_2000:   /* "REM" */
 if(commfl_int == 1)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 if(strcmp(LEFT_S(a_S, 3), "REM") == 0)
 {
  if(LEN(a_S) == 3)
  {
   goto Lab_2001;
  }
  sprintf(prtf_S,"%s%s%s","/*",MID_S(a_S, 4, LMAX)," */");
  fprintf(fp_2,"%s%s\n",spc_S,prtf_S);
  if(isub_int == 0)
  {
   ni_int = ni_int + 1;
  }
Lab_2001:
  commfl_int = 1;
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_2500:   /* "DECLARE" */
 commfl_int = 1;
 if(isub_int == 0)
 {
  initline_int = ni_int;
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_2600:   /* "CONST", this has been taken care of in pp 650 */
 ncnst_int = ncnst_int + 1;
 strcpy(b_S,MID_S(a_S, 6, LMAX));
 tokenix(b_S, &n_int, "=", "");
 if(n_int != 2)
 {
  printf("%s% d %s%s\n","Preprocessor 650 ERROR in line No",nl_int,":",line_S);
  printf("%s\n","Please define one constant per line.");
        exit(1);
 }
 if(ncnst_int > NCMX)
 {
  printf("%s\n","Maximum number of CONStant declarations reached.");
  printf("%s\n","Enlarge parameter NCMX in qb2c, compile it and restart !");
  exit(0);
 }
 sprintf(cnst_S[ncnst_int],"%s%s%s%s%s","#define ",tmp_S[1]," ",tmp_S[2],t_S);
 strcpy(tcnst_S[ncnst_int],tmp_S[1]);
 commfl_int = 1;
 if(isub_int == 0)
 {
  initline_int = ni_int;
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_2750:   /* "DIM " */
 commfl_int = 1;
 strcpy(b_S,MID_S(a_S, 4, LMAX));
 gulix(b_S);
 tokenix(b_S, &n_int, ",", "");
 if(n_int == 0)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 for(i_int = 1; i_int <= n_int; i_int++)
 {
  strcpy(temp_S[i_int],tmp_S[i_int]);
 }
 for(i_int = 1; i_int <= n_int; i_int++)
 {
  strcpy(d_S,temp_S[i_int]);
  arraydim(d_S);
  if(isub_int == 0)
  {
   for(j_int = 1; j_int <= alis_int; j_int++)
   {
    if(strcmp(d_S, darr_S[alist_int[j_int]]) == 0)
    {
     goto Lab_2755;
    }
   }
  }
  else
  {
   /* Tu nesto fali ????? */
  }
  vartyp(d_S, &typ_int);
  /* GOSUB Lab_2760 */    /* Get rid of dimensions & memorize arr. to atmp$() */
  if (setjmp(j__buf[j__lev++])==0) goto Lab_2760;
  brackets(d_S);
  sprintf(prtf_S,"%s%s%s%s%s"," static ",atyp_S[typ_int - 10],d_S,";",t_S);
  fprintf(fp_2,"%s\n",prtf_S);
  if(isub_int == 0)
  {
   ni_int = ni_int + 1;
  }
Lab_2755:
 ;}
 if(isub_int == 0)
 {
  initline_int = ni_int;
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_2760:   /* Get rid of dimensions & memorize arrayname to atmp$() if new */
 /* don't change the d$ */
 /* This dynamically fills atmp$() for a current SUB or MAIN */
 strcpy(z_S,d_S);
 jj_int = 1;
 while(strcmp(MID_S(z_S, jj_int, 1), "(") != 0)
 {
  jj_int = jj_int + 1;
 }
 strcpy(z_S,LEFT_S(z_S, jj_int));
 tmpfl_int = 1;
 for(j_int = 1; j_int <= natmp_int; j_int++)
 {
  if(strcmp(z_S, atmp_S[j_int]) == 0)
  {
   tmpfl_int = 0;
   goto Lab_2761;
  }
 }
Lab_2761:
 if(tmpfl_int == 1)
 {
  natmp_int = natmp_int + 1;
  strcpy(atmp_S[natmp_int],z_S);
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_3000:   /* "IF ... THEN ... ELSE ...END IF" */
 stringx(a_S);   /* String constant preprocessor */
 strcpy(e_S,CHR_S(34));
 togfl_int = 0;
 leng_int = LEN(a_S);
 i1_int = 4;
 i2_int = 0;
 for(j_int = 5; j_int <= leng_int - 3; j_int++)
 {
       if(a_S[j_int-1] == 34) togfl_int = 1 - togfl_int;
       if((memcmp(&a_S[j_int-1],"THEN",4)==0 || 
memcmp(&a_S[j_int-1],"GOTO",4)==0) && !togfl_int)
       { i2_int=j_int-2; goto Lab_3005; }
 }
 printf("%s% d %s%s\n","qb2c: SYNTAX ERROR in line No",nl_int,":",a_S);
 printf("%s\n","qb2c: Missing keyword: THEN or GOTO");
      exit(1);
Lab_3005:
 if(i2_int != 0)
 {
  strcpy(b_S,MID_S(a_S, i1_int, i2_int - i1_int + 1));
  gulix(b_S);
  mathexp(b_S);
  logix(b_S);
  quadrix(b_S);
  sprintf(prtf_S,"%s%s%s","if(",b_S,")");
  fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
  fprintf(fp_2,"%s%s\n",spc_S,"{");
  lspac_int = lspac_int + 1;
  strcpy(spc_S,SPACE_S(lspac_int));
  commfl_int = 1;
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_3250:   /* "ELSE" */
 fprintf(fp_2,"%s%s\n",SPACE_S(lspac_int - 1),"}");
 fprintf(fp_2,"%s%s%s\n",SPACE_S(lspac_int - 1),"else",t_S);
 fprintf(fp_2,"%s%s\n",SPACE_S(lspac_int - 1),"{");
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_3500:   /* "END IF" */
 fprintf(fp_2,"%s%s\n",SPACE_S(lspac_int - 1),"}");
 lspac_int = lspac_int - 1;
 strcpy(spc_S,SPACE_S(lspac_int));
 if(lspac_int < 0)
 {
  printf("%s% d %s% d %s%s\n","WARNING! Braces count = ",lspac_int," at line: 
",nl_int,":",line_S);
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_3750:   /* "DO WHILE" or "WHILE" */
 stringx(a_S);   /* String constant pretprocessor */
      if( memcmp(a_S,"DO WHILE",8)==0 ) { strcpy(b_S,&a_S[8]); goto Lab_3751; }
      if( memcmp(a_S,"WHILE",5)==0 )    { strcpy(b_S,&a_S[5]); goto Lab_3751; }
      if( memcmp(a_S,"DO UNTIL",8)==0 )
      { strcpy(b_S,"NOT ("); strcat(b_S,&a_S[9]); strcat(b_S,")"); }
Lab_3751:
 gulix(b_S);
 mathexp(b_S);
 logix(b_S);
 quadrix(b_S);
 sprintf(prtf_S,"%s%s%s","while(",b_S,")");
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 fprintf(fp_2,"%s%s\n",spc_S,"{");
 lspac_int = lspac_int + 1;
 strcpy(spc_S,SPACE_S(lspac_int));
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_3900:   /* "LOOP" or "WEND" */
 fprintf(fp_2,"%s%s\n",SPACE_S(lspac_int - 1),"}");
 lspac_int = lspac_int - 1;
 strcpy(spc_S,SPACE_S(lspac_int));
 if(lspac_int < 0)
 {
  printf("%s% d %s% d %s%s\n","WARNING! Braces count = ",lspac_int," at line: 
",nl_int,":",line_S);
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_4000:   /* "PRINT #" */
 stringx(a_S);   /* String constant pretprocessor */
 leng_int = LEN(a_S);
 commfl_int = 1;
 i_int = 1;
 while(! strcmp(MID_S(a_S, i_int, 1), "#") == 0 && i_int < leng_int)
 {
  i_int = i_int + 1;
 }
 j_int = i_int + 1;
 while(! strcmp(MID_S(a_S, j_int, 1), ",") == 0 && j_int <= leng_int)
 {
  j_int = j_int + 1;
 }
 strcpy(b_S,MID_S(a_S, i_int + 1, j_int - i_int - 1));
 gulix(b_S);
 strcpy(d_S,MID_S(a_S, j_int + 1, leng_int - j_int));
 gulix(d_S);
 if(strcmp(d_S, "") == 0)
 {
  
sprintf(prtf_S,"%s%s%s%s%s%s%s","fprintf(fp_",b_S,",",CHR_S(34),"\\n",CHR_S(34),");");
 }
 else
 {
  printfmt(d_S, formt_S, prt_S, &nflag_int);
  quadrix(prt_S);
  if(nflag_int == 1)
  {
   sprintf(tws__S,"%s%s",formt_S,"\\n");
   strcpy(formt_S,tws__S);
  }
  
sprintf(prtf_S,"%s%s%s%s%s%s%s%s","fprintf(fp_",b_S,",",CHR_S(34),formt_S,CHR_S(34),prt_S,");");
 }
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 /* RETURN */
 longjmp(j__buf[--j__lev],1);



Lab_4500:   /* "LINE INPUT #" */
 leng_int = LEN(a_S);
 commfl_int = 1;
 i_int = 12;
 strcpy(prtf_S,"fgets(");
 j_int = i_int + 1;
 while(! strcmp(MID_S(a_S, j_int, 1), ",") == 0 && j_int <= leng_int)
 {
  j_int = j_int + 1;
 }
 if(j_int >= leng_int)
 {
  printf("%s% d %s%s\n","ERROR in line No",nl_int,":",a_S);
       exit(1);
 }
 strcpy(b_S,MID_S(a_S, i_int + 1, j_int - i_int - 1));
 gulix(b_S);
 strcpy(d_S,MID_S(a_S, j_int + 1, leng_int - j_int));
 gulix(d_S);
 quadrix(d_S);
 sprintf(tws__S,"%s%s%s%s%s",prtf_S,d_S,", LMAX, fp_",b_S,");");
 strcpy(prtf_S,tws__S);
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 fprintf(fp_2,"%s%s%s%s%s\n",spc_S,d_S,"[strlen(",d_S,") - 1] = '\\0';");
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_5000:   /* "PRINT" */
      if( a_S[0] == 'E' ) {
 strcpy(prtf_S,"fprintf(stderr,");
      } else {
 strcpy(prtf_S,"printf(");
      }
 if(strcmp(a_S, "PRINT") == 0 || strcmp(a_S, "EPRINT") == 0)
 {
  strcpy(formt_S,"\\n");
  strcpy(prt_S,"");
  goto Lab_5001;
 }
 stringx(a_S);   /* String constant pretprocessor */
 strcpy(a_S,MID_S(a_S, 7, LMAX));
 gulix(a_S);
 printfmt(a_S, formt_S, prt_S, &nflag_int);   /* tokenizacija list varijabli 
itd. => formt$ */
 quadrix(prt_S);
 if(nflag_int == 1)
 {
  sprintf(tws__S,"%s%s",formt_S,"\\n");
  strcpy(formt_S,tws__S);
 }
Lab_5001:
 sprintf(tws__S,"%s%s%s%s%s%s",prtf_S,CHR_S(34),formt_S,CHR_S(34),prt_S,");");
 strcpy(prtf_S,tws__S);
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_5100:   /* "LOCATE " */
 strcpy(d_S,MID_S(a_S, 8, LMAX));
 tokenix(d_S, &n_int, ",", "");
 if(n_int != 2)
 {
  printf("%s% d %s%s\n","qb2c: SYNTAX ERROR in line No",nl_int,":",a_S);
  printf("%s\n","qb2c: Must be two arguments to LOCATE!");
       exit(1);
 }
 strcpy(b_S,tmp_S[1]);
 strcpy(d_S,tmp_S[2]);
 mathexp(b_S);
 mathexp(d_S);
 quadrix(b_S);
 
sprintf(prtf_S,"%s%s%s%s%s%s%s%s%s","printf(",CHR_S(34),"\\033[%d;%d;f",CHR_S(34),",(int)(",b_S,"),(int)(",d_S,"));");
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_5200:   /* "COLOR" */
 strcpy(d_S,MID_S(a_S, 6, LMAX));
 gulix(d_S);
 if(strcmp(d_S, "") == 0)
 {
  
fprintf(fp_2,"%s%s%s%s%s%s%s\n",spc_S,"printf(",CHR_S(34),"\\033[0m",CHR_S(34),");",t_S);
  goto Lab_5201;
 }
 tokenix(d_S, &n_int, ",", "");
 if(n_int > 2)
 {
  printf("%s% d %s%s\n","qb2c: SYNTAX ERROR in line No",nl_int,":",a_S);
  printf("%s\n","qb2c: Must be one or two arguments to COLOR!");
       exit(1);
 }
 strcpy(b_S,tmp_S[1]);
 mathexp(b_S);
 quadrix(b_S);
 if(n_int == 1)
 {
  fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"COLOR((int)(",b_S,"), -1);",t_S);
 }
 else
 {
  strcpy(d_S,tmp_S[2]);
  mathexp(d_S);
  quadrix(b_S);
  fprintf(fp_2,"%s%s%s%s%s%s%s\n",spc_S,"COLOR((int)(",b_S,"), 
(int)(",d_S,"));",t_S);
 }
 colorff_int = 1;
 extrnfl_int = 1;
Lab_5201:
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_5300:   /* "CLS" */
 strcpy(b_S,MID_S(a_S, 4, LMAX));
 gulix(b_S);
 if(strcmp(b_S, "") == 0)
 {
  
sprintf(prtf_S,"%s%s%s%s%s","printf(",CHR_S(34),"\\033[2J\\033[H",CHR_S(34),");");
 }
 else
 {
  mathexp(b_S);
  quadrix(b_S);
  sprintf(prtf_S,"%s%s%s","CLS((int)(",b_S,"));");
  clsff_int = 1;
  extrnfl_int = 1;
 }
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_5500:   /* "INPUT #" */
 leng_int = LEN(a_S);
 commfl_int = 1;
 i_int = 8;
 strcpy(e_S,CHR_S(34));
 while(! strcmp(MID_S(a_S, i_int, 1), ",") == 0 && i_int < leng_int)
 {
  i_int = i_int + 1;
 }
 if(i_int >= leng_int)
 {
  printf("%s% d %s%s\n","ERROR in line No",nl_int,":",a_S);
       exit(1);
 }
 strcpy(b_S,MID_S(a_S, 8, i_int - 8));
 gulix(b_S);
 L_int = VAL(b_S);
 strcpy(d_S,MID_S(a_S, i_int + 1, LMAX));
 gulix(d_S);
 if(strcmp(t_S, "") != 0)
 {
  fprintf(fp_2,"%s%s\n",spc_S,t_S);
 }
 i__stmp = ++i__s % 32;
 w__s[(i__stmp + 0 ) % 32] = 0;
 i__s = (i__s + 0 ) % 32;
 inputfmt(d_S, formt_S, prt_S, &n_int, &w__s[(i__stmp+0)%32]);
 quadrix(prt_S);
 /* GOSUB Lab_5505 */    /* get filename */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_5505;
 if(n_int == -1)
 {
  fprintf(fp_2,"%s%s%s%s%s%s\n",spc_S,"while(fgets(",d_S,", LMAX, 
fp_",b_S,")==NULL)");
  fprintf(fp_2,"%s%s%s%s%s%s%s%s\n",spc_S,"{ printf(",e_S,"Error in reading 
(probably EOF) file: %s\\n",e_S,",",f_S,"); exit(0);}");
  fprintf(fp_2,"%s%s%s%s%s\n",spc_S,d_S,"[strlen(",d_S,") - 1] = '\\0';");
 }
 else
 {
  
fprintf(fp_2,"%s%s%s%s%s%s%s%s%s%s%s%s\n",spc_S,"if(fscanf(fp_",b_S,",",e_S,formt_S,"
 ",e_S,prt_S,") !=",STR_S(n_int),")");
  fprintf(fp_2,"%s%s%s%s%s%s%s%s\n",spc_S,"{ printf(",e_S,"Error in reading 
file: %s\\n",e_S,",",f_S,"); }");
 }
 chartfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_5505:   /* get filename */
 i_int = 1;
 while(lfopen_int[i_int] != L_int && i_int <= nlopen_int)
 {
  i_int = i_int + 1;
 }
 if(i_int > nlopen_int)
 {
  sprintf(f_S,"%s%s",e_S,e_S);
 }
 else
 {
  strcpy(f_S,lfopen_S[i_int]);
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);



Lab_5750:   /* "INPUT" */
 if(strcmp(t_S, "") != 0)
 {
  fprintf(fp_2,"%s%s\n",spc_S,t_S);
 }
 leng_int = LEN(a_S);
 strcpy(d_S,CHR_S(34));
 if(leng_int == 5)
 {
  fprintf(fp_2,"%s%s%s%s%s%s\n",spc_S,"INPUT(",d_S,d_S,",1)",t_S);
 }
 i_int = 6;
 g_int = 6;
 while(strcmp(MID_S(a_S, i_int, 1), d_S) != 0 && i_int < leng_int)
 {
  i_int = i_int + 1;
 }
 if(i_int < leng_int)
 {
  j_int = i_int + 1;
  while(strcmp(MID_S(a_S, j_int, 1), d_S) != 0 && j_int < leng_int)
  {
   j_int = j_int + 1;
  }
  strcpy(b_S,MID_S(a_S, i_int, j_int - i_int + 1));
  stringx(b_S);   /* String constant preprocessor */
  g_int = j_int;
 }
 else
 {
  sprintf(b_S,"%s%s",d_S,d_S);
 }
 i_int = g_int + 1;
 strcpy(z_S,MID_S(a_S, i_int, 1));
 strcpy(e_S,",1");
 if(strcmp(z_S, ",") == 0)
 {
  strcpy(e_S,",0");
 }
 while((strcmp(z_S, " ") == 0 || strcmp(z_S, ",") == 0 || strcmp(z_S, ";") == 
0) && i_int < leng_int)
 {
  i_int = i_int + 1;
  strcpy(z_S,MID_S(a_S, i_int, 1));
  if(strcmp(z_S, ";") == 0)
  {
   strcpy(e_S,",1");
  }
 }
 strcpy(a_S,RIGHT_S(a_S, leng_int - i_int + 1));   /* CALL gulix(a$) */
 i__stmp = ++i__s % 32;
 w__s[(i__stmp + 0 ) % 32] = 1;
 i__s = (i__s + 0 ) % 32;
 inputfmt(a_S, formt_S, prt_S, &n_int, &w__s[(i__stmp+0)%32]);
 quadrix(prt_S);
 if(n_int == -1)
 {
  sprintf(prtf_S,"%s%s%s%s%s%s%s%s","while(INPUT(",b_S,e_S,") == NULL) 
printf(",d_S,"Redo from start:\\n",d_S,");");
  fprintf(fp_2,"%s%s\n",spc_S,prtf_S);
  fprintf(fp_2,"%s%s%s%s\n",spc_S,"strcpy(",prt_S,",tws__S);");
 }
 else
 {
  
sprintf(prtf_S,"%s%s%s%s%s%s%s%s%s%s%s","while(sscanf(INPUT(",b_S,e_S,"),",d_S,formt_S,d_S,prt_S,")
 !=",STR_S(n_int)," && tws__S[0] != '\\n')");
  fprintf(fp_2,"%s%s\n",spc_S,prtf_S);
  fprintf(fp_2,"%s%s%s%s%s%s\n",spc_S,"{ printf(",d_S,"Redo from 
start:\\n",d_S,"); }");
 }
 commfl_int = 1;
 inputff_int = 1;
 extrnfl_int = 1;
 twsflg_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_6000:   /* Labels */
 i_int = ASC(LEFT_S(a_S, 1));
 if(i_int >= 48 && i_int <= 57)
 {
  strcpy(labl_S,STR_S(VAL(a_S)));
  sprintf(labl_S,"%s%s",MID_S(labl_S, 2, LEN(labl_S) - 1),":");
  fprintf(fp_2,"%s%s%s\n","Lab_",labl_S,t_S);
  commfl_int = 1;
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_6500:   /* "GOTO" */
 leng_int = LEN(a_S);
 strcpy(b_S,MID_S(a_S, 5, leng_int - 4));
 gulix(b_S);
 fprintf(fp_2,"%s%s%s%s%s%s\n",spc_S,"goto ","Lab_",b_S,";",t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_7000:   /* "CALL" */
 commfl_int = 1;
 strcpy(e_S,CHR_S(34));
 leng_int = LEN(a_S);
 j_int = 0;
 for(i_int = 5; i_int <= leng_int; i_int++)
 {
  strcpy(b_S,MID_S(a_S, i_int, 1));
  if(strcmp(b_S, "(") == 0)
  {
   j_int = i_int;
   goto Lab_7001;
  }
 }
Lab_7003:
 strcpy(prtf_S,MID_S(a_S, 5, leng_int - 4));
 gulix(prtf_S);
 fprintf(fp_2,"%s%s%s%s\n",spc_S,prtf_S,"();",t_S);
 /* RETURN */
 longjmp(j__buf[--j__lev],1);
Lab_7001:
 strcpy(prtf_S,MID_S(a_S, 5, j_int - 5));
 gulix(prtf_S);
 for(k_int = 1; k_int <= nsub_int; k_int++)
 {
  if(strcmp(prtf_S, subname_S[k_int]) == 0)
  {
   goto Lab_7004;
  }
 }
 printf("%s%s%s\n","WARNING: ",prtf_S," is not a user defined SUBroutine or 
FUNCTION");
 goto Lab_7003;
Lab_7004:
 strcpy(varlist_S,MID_S(a_S, j_int + 1, leng_int - j_int - 1));
 tokenix(varlist_S, &n_int, ",", "");
 strcpy(varlist_S,"");
 tmp1_int = 0;
 tmp2_int = 0;
 tmp3_int = 0;
 tmp4_int = 0;
 tmp8_int = 0;
 for(i_int = 1; i_int <= n_int; i_int++)
 {
  strcpy(d_S,tmp_S[i_int]);
  vartyp(d_S, &typ_int);
  if(typ_int == 7)
  {
   printf("%s% d %s\n","ERROR: String expressions not allowed as function 
parameters in line",nl_int,":");
   printf("%s\n",line_S);
       exit(1);
  }
  if(constfl_int == 1 || typ_int == 6)
  {
   tip_int = 0;
   strcpy(b_S,subvar_S[k_int][i_int]);
   vartyp(b_S, &tip_int);
   if(tip_int == 1 || tip_int == 6)
   {
    if(tmp1_int == 0)
    {
     fprintf(fp_2,"%s%s\n",spc_S,"i__stmp = ++i__s % 16;");
    }
    fprintf(fp_2,"%s%s% d %s%s%s\n",spc_S,"w__s[(i__stmp +",tmp1_int,") % 16] = 
",d_S,";");
     sprintf(tws__S,"%s%s%d%s",varlist_S,"&w__s[(i__stmp+",tmp1_int,")%16], ");
     strcpy(varlist_S,tws__S);
        tmp1_int++;
    inttfl_int = 1;
   }
   else
   {
    if(tip_int == 2)
    {
     if(tmp2_int == 0)
     {
      fprintf(fp_2,"%s%s\n",spc_S,"i__ltmp = ++i__l % 16;");
     }
     fprintf(fp_2,"%s%s% d %s%s%s\n",spc_S,"w__l[(i__ltmp +",tmp2_int,") % 16] 
= ",d_S,";");
     sprintf(tws__S,"%s%s%d%s",varlist_S,"&w__l[(i__ltmp+",tmp2_int,")%16], ");
     strcpy(varlist_S,tws__S);
         tmp2_int++;
     longtfl_int = 1;
    }
    else
    {
     if(tip_int == 3)
     {
      if(tmp3_int == 0)
      {
       fprintf(fp_2,"%s%s\n",spc_S,"i__ftmp = ++i__f % 16;");
      }
      fprintf(fp_2,"%s%s% d %s%s%s\n",spc_S,"w__f[(i__ftmp +",tmp3_int,") % 16] 
= ",d_S,";");
     sprintf(tws__S,"%s%s%d%s",varlist_S,"&w__f[(i__ftmp+",tmp3_int,")%16], ");
     strcpy(varlist_S,tws__S);
          tmp3_int++;
      floattfl_int = 1;
     }
     else
     {
      if(tip_int == 4)
      {
       if(tmp4_int == 0)
       {
        fprintf(fp_2,"%s%s\n",spc_S,"i__dtmp = ++i__d % 16;");
       }
       fprintf(fp_2,"%s%s% d %s%s%s\n",spc_S,"w__d[(i__dtmp +",tmp4_int,") % 
16] = ",d_S,";");
     sprintf(tws__S,"%s%s%d%s",varlist_S,"&w__d[(i__dtmp+",tmp4_int,")%16], ");
     strcpy(varlist_S,tws__S);
           tmp4_int++;
       vdblff_int = 1;
      }
      else
      {
       if(tip_int == 5)
       {
        /*         PRINT #2, spc$ + "if(++j__S == 16) j__S=0;" */
        /*         PRINT #2, spc$ + "strcpy(w__S[j__S], " + d$ + ");" */
        /*         varlist$ = varlist$ + "w__S[j__S], " */
        /*         chartfl% = 1 */
        sprintf(tws__S,"%s%s%s",varlist_S,d_S,", ");
        strcpy(varlist_S,tws__S);
       }
       else
       {
        if(tip_int == 8)
        {
         if(tmp8_int == 0)
         {
          fprintf(fp_2,"%s%s\n",spc_S,"i__btmp = ++i__b % 16;");
         }
         fprintf(fp_2,"%s%s% d %s%s%s\n",spc_S,"w__b[(i__btmp +",tmp8_int,") % 
16] = ",d_S,";");
     sprintf(tws__S,"%s%s%d%s",varlist_S,"&w__b[(i__btmp+",tmp8_int,")%16], ");
     strcpy(varlist_S,tws__S);
             tmp8_int++;
         byttfl_int = 1;
        }
        else
        {
         printf("%s%s%s%s\n","ERROR: Unrecognized argument: ",d_S," in 
subroutine: ",subname_S[k_int]);
         printf("%s%s%s% d \n","when calling: ",line_S," in line No: ",nl_int);
             exit(1);
        }
       }
      }
     }
    }
   }
  }
  else
  {
   if(typ_int == 5 || typ_int == 15)
   {
    sprintf(tws__S,"%s%s%s",varlist_S,d_S,", ");
    strcpy(varlist_S,tws__S);
   }
   else
   {
    sprintf(tws__S,"%s%s%s%s",varlist_S,"&",d_S,", ");
    strcpy(varlist_S,tws__S);
   }
  }
 }
 strcpy(varlist_S,LEFT_S(varlist_S, LEN(varlist_S) - 2));
 quadrix(varlist_S);
 sprintf(tws__S,"%s%s%s%s",prtf_S,"(",varlist_S,");");
 strcpy(prtf_S,tws__S);
 if(tmp1_int)
 {
  fprintf(fp_2,"%s%s% .7G %s\n",spc_S,"i__s = (i__s +",(double)(tmp1_int - 
1),") % 16;");
 }
 if(tmp2_int)
 {
  fprintf(fp_2,"%s%s% .7G %s\n",spc_S,"i__l = (i__l +",(double)(tmp2_int - 
1),") % 16;");
 }
 if(tmp3_int)
 {
  fprintf(fp_2,"%s%s% .7G %s\n",spc_S,"i__f = (i__f +",(double)(tmp3_int - 
1),") % 16;");
 }
 if(tmp4_int)
 {
  fprintf(fp_2,"%s%s% .7G %s\n",spc_S,"i__d = (i__d +",(double)(tmp4_int - 
1),") % 16;");
 }
 if(tmp8_int)
 {
  fprintf(fp_2,"%s%s% .7G %s\n",spc_S,"i__b = (i__b +",(double)(tmp8_int - 
1),") % 16;");
 }
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_7500:   /* "LET" */
 strcpy(a_S,MID_S(a_S, 4, LMAX));   /* expression */
 goto Lab_18000;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_8000:   /* "FOR " */
 leng_int = LEN(a_S);
 ix0_int = 5;
 j_int = ix0_int;
 while(strcmp(MID_S(a_S, j_int, 3), "TO ") != 0 && j_int < leng_int)
 {
  j_int = j_int + 1;
 }
 if(j_int == leng_int)
 {
  printf("%s% d %s%s\n","ERROR: missing TO in line No",nl_int,":",line_S);
       exit(1);
 }
 strcpy(b_S,MID_S(a_S, ix0_int, j_int - ix0_int - 1));
 gulix(b_S);
 mathexp(b_S);
 quadrix(b_S);
 k_int = 1;
 while(strcmp(MID_S(b_S, k_int, 1), "=") != 0)
 {
  k_int = k_int + 1;
 }
 strcpy(e_S,MID_S(b_S, 1, k_int - 2));
 strcpy(c_S,MID_S(b_S, k_int + 2, LMAX));
 gulix(c_S);
 L_int = j_int + 3;
 while(strcmp(MID_S(a_S, L_int, 4), "STEP") != 0 && L_int <= leng_int)
 {
  L_int = L_int + 1;
 }
 strcpy(d_S,MID_S(a_S, j_int + 3, L_int - j_int - 3));
 gulix(d_S);
 mathexp(d_S);
 quadrix(d_S);
 if(leng_int - L_int - 3 >= 0)
 {
  strcpy(f_S,RIGHT_S(a_S, leng_int - L_int - 3));
  gulix(f_S);
  x = VAL(f_S);
  if((x > 0.))
  {
   sprintf(prtf_S,"%s%s%s%s%s%s%s%s%s%s%s%s%s%s",spc_S,"for(",b_S,"; ",e_S," <= 
",d_S,"; ",e_S," = ",e_S," + ",f_S,")");
  }
  else
  {
   if((x < 0.))
   {
    sprintf(prtf_S,"%s%s%s%s%s%s%s%s%s%s%s%s%s",spc_S,"for(",b_S,"; ",e_S," >= 
",d_S,"; ",e_S," = ",e_S,f_S,")");
   }
   else
   {
    mathexp(f_S);
    quadrix(f_S);
    fprintf(fp_2,"%s%s%s\n",spc_S,"if(++j__sig == 16) j__sig=0;",t_S);
    strcpy(t_S,"");
    sigiff_int = 1;
    fprintf(fp_2,"%s%s%s%s\n",spc_S,"sig__i[j__sig] = 1; if(",f_S," < 0) 
sig__i[j__sig] = -1;");
    sprintf(prtf_S,"%s%s%s%s%s%s%s%s%s%s%s%s%s%s",spc_S,"for(",b_S,"; 
sig__i[j__sig]*",e_S," <= sig__i[j__sig]*",d_S,"; ",e_S," = ",e_S," + 
",f_S,")");
   }
  }
 }
 else
 {
  sprintf(prtf_S,"%s%s%s%s%s%s%s%s%s%s",spc_S,"for(",b_S,"; ",e_S," <= ",d_S,"; 
",e_S,"++)");
 }
 fprintf(fp_2,"%s%s\n",prtf_S,t_S);
 fprintf(fp_2,"%s%s\n",spc_S,"{");
 lspac_int = lspac_int + 1;
 strcpy(spc_S,SPACE_S(lspac_int));
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_8500:   /* "NEXT" */
 fprintf(fp_2,"%s%s\n",SPACE_S(lspac_int - 1),"}");
 lspac_int = lspac_int - 1;
 strcpy(spc_S,SPACE_S(lspac_int));
 if(lspac_int < 0)
 {
  printf("%s% d %s% d %s%s\n","WARNING! Braces count = ",lspac_int," at line: 
",nl_int,":",line_S);
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_9000:   /* "OPEN..." */
 leng_int = LEN(a_S);
 jopn_int = jopn_int + 1;
 i_int = 4;
 j_int = 0;
 while(i_int < leng_int && strcmp(MID_S(a_S, i_int, 1), "#") != 0)
 {
  if(strcmp(MID_S(a_S, i_int, 3), "FOR") == 0)
  {
   j_int = i_int;
  }
  strcpy(d_S,MID_S(a_S, i_int, 6));
  if(strcmp(d_S, "INPUT ") == 0)
  {
   strcpy(mode_S,"r");
  }
  if(strcmp(d_S, "OUTPUT") == 0)
  {
   strcpy(mode_S,"w");
  }
  if(strcmp(d_S, "APPEND") == 0)
  {
   strcpy(mode_S,"a");
  }
  /*    IF d$ = "RANDOM" THEN mode$ = "r+" */
  /*    IF d$ = "BINARY" THEN mode$ = "??" */
  i_int = i_int + 1;
 }
 if(strcmp(mode_S, "") == 0)
 {
  strcpy(mode_S,"r+");
 }
 if(j_int == 0)
 {
  printf("%s% d %s%s\n","ERROR missing FOR in line No",nl_int,":",line_S);
       exit(1);
 }
 else
 {
  strcpy(f_S,MID_S(a_S, 5, j_int - 5));
  quadrix(f_S);
  tokenix(f_S, &n_int, "+", "");
  if(n_int > 1)
  {
   printfmt(f_S, formt_S, prt_S, &nflag_int);
   
sprintf(prtf_S,"%s%s%s%s%s%s","sprintf(tws__S,",CHR_S(34),formt_S,CHR_S(34),prt_S,");");
   fprintf(fp_2,"%s%s\n",spc_S,prtf_S);
   strcpy(f_S,"tws__S");
   twsflg_int = 1;
  }
 }
 gulix(f_S);
 n_int = VAL(MID_S(a_S, i_int + 1, LMAX));
 strcpy(d_S,STR_S(n_int));
 strcpy(n_S,MID_S(d_S, 2, LMAX));
 sprintf(prtf_S,"%s%s%s%s%s%s%s%s%s","if((fp_",n_S," = fopen(",f_S,", 
",CHR_S(34),mode_S,CHR_S(34),")) == NULL)");
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 fprintf(fp_2,"%s%s\n",spc_S,"{");
 fprintf(fp_2,"%s%s%s%s%s%s%s%s\n",SPACE_S(lspac_int + 
1),"fprintf(stderr,",CHR_S(34),"Can't open file %s\\n",CHR_S(34),",",f_S,"); 
exit(1);");
 fprintf(fp_2,"%s%s\n",spc_S,"}");
 commfl_int = 1;
 i_int = 1;
 while(lfopen_int[i_int] != n_int && i_int <= nlopen_int)
 {
  i_int = i_int + 1;
 }
 if(i_int <= nlopen_int)
 {
  lfopen_int[i_int] = n_int;
  strcpy(lfopen_S[i_int],f_S);
 }
 else
 {
  nlopen_int = nlopen_int + 1;
  lfopen_int[nlopen_int] = n_int;
  strcpy(lfopen_S[nlopen_int],f_S);
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_9500:   /* "CLOSE" */
 leng_int = LEN(a_S);
 i_int = 6;
 while(i_int < leng_int && strcmp(MID_S(a_S, i_int, 1), "#") != 0)
 {
  i_int = i_int + 1;
 }
 if(i_int == leng_int)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 g_long = VAL(MID_S(a_S, i_int + 1, leng_int - i_int));
 strcpy(n_S,STR_S(g_long));
 strcpy(n_S,MID_S(n_S, 2, LEN(n_S) - 1));
 fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"fclose(fp_",n_S,");",t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_11000:   /* "GOSUB " */
 leng_int = LEN(a_S);
 strcpy(b_S,MID_S(a_S, 6, leng_int - 5));
 gulix(b_S);
 sprintf(prtf_S,"%s%s%s","if (setjmp(j__buf[j__lev++])==0) goto Lab_",b_S,";");
 fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"/* GOSUB Lab_",b_S," */ ",t_S);
 fprintf(fp_2,"%s%s\n",spc_S,prtf_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_11500:   /* "RETURN" */
 strcpy(prtf_S,"longjmp(j__buf[--j__lev],1);");
 fprintf(fp_2,"%s%s\n",spc_S,"/* RETURN */");
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_12000:   /* "RANDOMIZE" */
 strcpy(b_S,MID_S(a_S, 10, LMAX));
 gulix(b_S);
 quadrix(b_S);
       if (strlen(b_S)==0) {
 strcpy(prtf_S,"RANDOMIZE(32767);");
       } else {
 sprintf(prtf_S,"%s%s%s","RANDOMIZE((long)",b_S,");");
       }
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_12200:   /* "PAUSE " */
 strcpy(b_S,MID_S(a_S, 7, LMAX));
 gulix(b_S);
 if(strcmp(b_S, "") == 0)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 quadrix(b_S);
 fprintf(fp_2,"%s%s%s%s\n",spc_S,"t__.tv_sec = floor(",b_S,");");
 fprintf(fp_2,"%s%s%s%s\n",spc_S,"t__.tv_usec= 1000000*(",b_S,"-t__.tv_sec);");
 fprintf(fp_2,"%s%s%s\n",spc_S,"select(0, (void *)0, (void *)0, (void *)0, 
&t__);",t_S);
 mathfl_int = 1;
 pausefl_int = 1;
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_17000:   /* "SHELL"  Only explicite form "..." of shell commands is 
suported. */
 /* eg. "del " + name$ */
 commfl_int = 1;
 if(strcmp(a_S, "SHELL") == 0)
 {
  strcpy(a_S,"");
  goto Lab_17030;
 }
 strcpy(a_S,MID_S(a_S, 6, LMAX));
 stringx(a_S);
 gulix(a_S);
 leng_int = LEN(a_S);
 if(noshell_int == 1)
 {
  goto Lab_17015;
 }
 ii_int = 1;
 togfl_int = 0;
 while(ii_int < leng_int)
 {
  if(ASC(MID_S(a_S, ii_int, 1)) == 34)
  {
   togfl_int = 1 - togfl_int;
  }
  if(togfl_int == 0)
  {
   goto Lab_17010;
  }
  strcpy(b_S,MID_S(a_S, ii_int, 3));
  strcpy(d_S,MID_S(a_S, ii_int, 4));
  strcpy(e_S,MID_S(a_S, ii_int, 6));
       if (ii_int == 1)
       { i1_int=32; }
       else
       { i1_int=a_S[ii_int-2]; }
  if(i1_int != 32 && i1_int != 34)
  {
   goto Lab_17010;
  }
  if(strcmp(d_S, "copy") == 0)
  {
        i2_int=a_S[ii_int-1+4];
        if (i2_int!=32 && i2_int!=34) goto Lab_17010;
   sprintf(a_S,"%s%s%s",LEFT_S(a_S, ii_int - 1),"cp",RIGHT_S(a_S, leng_int - 
ii_int - 3));
   leng_int = leng_int - 2;
   ii_int = ii_int + 2;
   goto Lab_17010;
  }
  if(strcmp(e_S, "rename") == 0)
  {
        i2_int=a_S[ii_int-1+6];
        if (i2_int!=32 && i2_int!=34) goto Lab_17010;
   sprintf(a_S,"%s%s%s",LEFT_S(a_S, ii_int - 1),"mv",RIGHT_S(a_S, leng_int - 
ii_int - 5));
   leng_int = leng_int - 4;
   ii_int = ii_int + 2;
   goto Lab_17010;
  }
  if(strcmp(b_S, "del") == 0)
  {
        i2_int=a_S[ii_int-1+3];
        if (i2_int!=32 && i2_int!=34) goto Lab_17010;
   sprintf(a_S,"%s%s%s",LEFT_S(a_S, ii_int - 1),"rm -f",RIGHT_S(a_S, leng_int - 
ii_int - 2));
   leng_int = leng_int + 2;
   ii_int = ii_int + 5;
   goto Lab_17010;
  }
  if(strcmp(b_S, "dir") == 0)
  {
        i2_int=a_S[ii_int-1+3];
        if (i2_int!=32 && i2_int!=34) goto Lab_17010;
   sprintf(a_S,"%s%s%s",LEFT_S(a_S, ii_int - 1),"ls -l",RIGHT_S(a_S, leng_int - 
ii_int - 2));
   leng_int = leng_int + 2;
   ii_int = ii_int + 5;
   goto Lab_17010;
  }
  if(strcmp(b_S, "cls") == 0)
  {
        i2_int=a_S[ii_int-1+3];
        if (i2_int!=32 && i2_int!=34) goto Lab_17010;
   sprintf(a_S,"%s%s%s",LEFT_S(a_S, ii_int - 1),"clear",RIGHT_S(a_S, leng_int - 
ii_int - 2));
   leng_int = leng_int + 2;
   ii_int = ii_int + 5;
   goto Lab_17010;
  }
Lab_17010:
  ii_int = ii_int + 1;
 }
Lab_17015:
 gulix(a_S);
 tokenix(a_S, &n_int, "+", "");
 if(n_int > 1)
 {
  printfmt(a_S, formt_S, prt_S, &nflag_int);
  quadrix(prt_S);
  
sprintf(prtf_S,"%s%s%s%s%s%s","sprintf(tws__S,",CHR_S(34),formt_S,CHR_S(34),prt_S,");");
  fprintf(fp_2,"%s%s\n",spc_S,prtf_S);
  strcpy(a_S,"tws__S");
  twsflg_int = 1;
 }
Lab_17030:
 quadrix(a_S);
 sprintf(prtf_S,"%s%s%s","system(",a_S,");");
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_18000:   /* numerical and string expressions */
 if(commfl_int == 1)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 leng_int = LEN(a_S);
 togfl_int = 0;
 i_int = 1;
      while (! (togfl_int == 0 && a_S[i_int-1] == '=') && i_int < leng_int) {
       if (a_S[i_int-1] == '"') togfl_int = 1 - togfl_int;
       i_int++;
      }
 if(i_int == leng_int)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 commfl_int = 1;
 tmpfl_int = 0;
 expflg_int = 1;
 fcond_int = 0;
 togfl_int = 0;
 strcpy(e_S,LEFT_S(a_S, i_int - 1));
 gulix(e_S);
 vartyp(e_S, &typ_int);
 if(funcflag_int == 1)
 {
  if(strcmp(e_S, funcnam_S) == 0)   /* Function assignment line */
  {
   fcond_int = 1;
  }
 }
 if(typ_int == 5 || typ_int == 15)
 {
  strcpy(a_S,MID_S(a_S, i_int + 1, LMAX));
  gulix(a_S);
  stringx(a_S);   /* String constant pretprocessor */
  vartyp(a_S, &typ_int);
  printfmt(a_S, formt_S, prt_S, &nflag_int);   /* string expression processing 
*/
  if(typ_int == 7)
  {
   for(j_int = 1; j_int <= nptk_int; j_int++)
   {
    if(strcmp(e_S, tmp_S[j_int]) == 0)
    {
     tmpfl_int = 1;
     goto Lab_18001;
    }
   }
Lab_18001:
   if(tmpfl_int == 1 && fcond_int == 1)
   {
    printf("%s% d %s%s\n","SYNTAX ERROR in line No",nl_int,":",line_S);
    printf("%s\n","Function name must be on the left side only");
         exit(1);
   }
   if(tmpfl_int == 1 || fcond_int == 1)
   {
    
sprintf(prtf_S,"%s%s%s%s%s%s","sprintf(tws__S,",CHR_S(34),formt_S,CHR_S(34),prt_S,");");
    twsflg_int = 1;
    if(fcond_int == 1)
    {
     togfl_int = 1;
    }
   }
   else
   {
    quadrix(e_S);
    
sprintf(prtf_S,"%s%s%s%s%s%s%s%s","sprintf(",e_S,",",CHR_S(34),formt_S,CHR_S(34),prt_S,");");
   }
  }
  else
  {
   if(fcond_int == 1)
   {
    sprintf(prtf_S,"%s%s%s","return ",MID_S(prt_S, 2, LMAX),";");
   }
   else
   {
    quadrix(e_S);
    sprintf(prtf_S,"%s%s%s%s","strcpy(",e_S,prt_S,");");
   }
  }
 }
 else
 {
       strcpy(b_S, &a_S[i_int]);
  gulix(b_S);
  if(strcmp(LEFT_S(b_S, 8), "XWINDOW ") == 0)
  {
   xwflag_int = 1;
   strcpy(f_S,e_S);
   quadrix(f_S);
   strcpy(a_S,b_S);
   goto Lab_21000;
  }
  mathexp(a_S);   /* Translating math. functions */
  if(fcond_int == 1)
  {
   sprintf(prtf_S,"%s%s%s","return ",MID_S(a_S, i_int + 1, LMAX),";");
  }
  else
  {
   sprintf(prtf_S,"%s%s",a_S,";");
  }
  expflg_int = 0;
 }
 quadrix(prtf_S);
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 if(tmpfl_int == 1)
 {
  if(! fcond_int)
  {
   quadrix(e_S);
  }
  fprintf(fp_2,"%s%s%s%s\n",spc_S,"strcpy(",e_S,",tws__S);");
 }
 if(togfl_int == 1)
 {
  fprintf(fp_2,"%s%s\n",spc_S,"return tws__S;");
 }
 expflg_int = 0;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_19000:   /* "END SUB"  and "END FUNCTION" */
 fprintf(fp_2,"%s\n","}");
 if(lspac_int != 1)
 {
  if(funcflag_int == 1)
  {
        fprintf(stderr,"ERROR: Brace misscount of %d occured at the end of 
FUNCTION: %s\n",lspac_int-1, subname_S[isub_int]); exit(1);
  }
  else
  {
        fprintf(stderr,"ERROR: Brace misscount of %d occured at the end of 
SUBroutine: %s\n",lspac_int-1, subname_S[isub_int]); exit(1);
  }
 }
 commfl_int = 1;
 funcflag_int = 0;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);



Lab_19100:   /* "EXIT SUB" */
 strcpy(prtf_S,"return;");
 fprintf(fp_2,"%s%s%s\n",spc_S,prtf_S,t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_20000:   /* "LINE " (graphics) statement */
 /* Draws a line and sets the new current position x=xy(0,0), y=xy(0,1) */
 strcpy(b_S,MID_S(a_S, 5, LMAX));
 quadrix(b_S);
 tokenix(b_S, &k_int, "-", ",");
        strcpy(b_S,tmp_S[1]+1); b_S[strlen(b_S)-1]='\0';
        strcpy(d_S,tmp_S[2]+1); d_S[strlen(d_S)-1]='\0';
 tokenix(b_S, &n_int, ",", "");
 strcpy(temp_S[1],tmp_S[1]);
 strcpy(temp_S[2],tmp_S[2]);
 tokenix(d_S, &n_int, ",", "");
 strcpy(temp_S[3],tmp_S[1]);
 strcpy(temp_S[4],tmp_S[2]);
 tmpfl_int = 0;
 /* GOSUB Lab_20050 */ 
 if (setjmp(j__buf[j__lev++])==0) goto Lab_20050;
 if(tmpfl_int == 1)
 {
  goto Lab_20009;
 }
 fprintf(fp_2,"%s%s%s%s%s%s%s\n",spc_S,"xy__pos[1][0]=",temp_S[1],"; 
xy__pos[1][1]=",temp_S[2],";",t_S);
 fprintf(fp_2,"%s%s%s%s%s%s\n",spc_S,"xy__pos[0][0]=",temp_S[3],"; 
xy__pos[0][1]=",temp_S[4],";");
 fprintf(fp_2,"%s%s\n",spc_S,"ixline(2,xy__pos);");
Lab_20009:
 if(updateff_int == 1)
 {
  fprintf(fp_2,"%s%s\n",spc_S,"ixupdwi(0);");
 }
 grafflg_int = 1;
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_20050:   /* options handling (color, B[F], style) */
 if(k_int >= 3)
 {
  strcpy(b_S,tmp_S[3]);
  quadrix(b_S);
  fprintf(fp_2,"%s%s%s%s\n",spc_S,"ixsetlc((int)",b_S,");");
 }
 if(k_int >= 5)
 {
  /* PRINT #2, spc$ + "" */
  printf("%s\n","WARNING: dashing style is not supported in LINE command ! 
Ignored.");
  printf("%s% d \n","Set the dashing style with SET DMOD in line No.",nl_int);
 }
 if(k_int >= 4)
 {
       if (tmp_S[4][0]=='\0')
       {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
       }
  if(strcmp(tmp_S[4], "BF") == 0)
  {
   fprintf(fp_2,"%s%s%s%s\n",spc_S,"ixsetfc((int)",b_S,"); ixsetfs(1, 1);");
   strcpy(e_S,"),1);");
  }
  else
  {
   strcpy(e_S,"),2);");
  }
  
fprintf(fp_2,"%s%s%s%s%s%s%s%s%s%s%s\n",spc_S,"ixbox((int)(",temp_S[1],"),(int)(",temp_S[3],"),(int)(",temp_S[2],"),(int)(",temp_S[4],e_S,t_S);
  tmpfl_int = 1;
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_20500:   /* "PSET " (graphics) statement */
 /* Draws a point and sets the new current position x=xy(0,0), y=xy(0,1) */
 strcpy(b_S,MID_S(a_S, 5, LMAX));
 gulix(b_S);
      if (b_S[0] != '(') goto Lab_20509;
 quadrix(b_S);
 tokenix(b_S, &k_int, ",", "");
 if(k_int > 2)
 {
  goto Lab_29000;
 }
 if(k_int == 2)
 {
  sprintf(d_S,"%s%s%s","),(int)(",tmp_S[2],")");
 }
 else
 {
  strcpy(d_S,"),-1");
 }
      strcpy(b_S,tmp_S[1]+1); b_S[strlen(b_S)-1]='\0';
 tokenix(b_S, &n_int, ",", "");
 
fprintf(fp_2,"%s%s%s%s%s%s%s%s\n",spc_S,"ixpset((int)(",tmp_S[1],"),(int)(",tmp_S[2],d_S,");",t_S);
 /*   IF updateff% = 1 THEN */
 /*    PRINT #2, spc$ + "ixupdwi(0);" */
 /*   END IF */
 grafflg_int = 1;
 commfl_int = 1;
Lab_20509:
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_21000:   /* "SCREEN " and/or "XWINDOW " (graphics) */
 /* SCREEN: Initialize graphics and open an X-window */
 /* Original syntax:   SCREEN mode */
 /* Additional syntax: SCREEN (x, y)[, w, h[, title$[, Xfont_name$]]] */
 /* XWINDOW: Open a new X-window. SCREEN opens window with ID=0, whereas */
 /* XWINDOW opens ID=1, 2, ... 20. It is NOT a BASIC command. */
 /* Syntax: XWINDOW (x, y)[, w, h[, title$]] */
 /* (x, y)=position, (w, h)=size in pixels */
 /* 819x484 -misc-fixed-medium-r-normal-*-20-140-*-100-c-100-iso8859-1 */
 strcpy(e_S,CHR_S(34));
 twsflg_int = 1;
      if ( memcmp(a_S,"SCREEN ",7)==0 ) {
 fprintf(fp_2,"%s%s\n",spc_S,"/* SCREEN initializations */");
 fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"if (ixopnds(",e_S,e_S,")==-1) exit(0);");
      }
 strcpy(b_S,MID_S(a_S, 8, LMAX));
 gulix(b_S);
 if(strcmp(b_S, "") == 0)
 {
  goto Lab_29000;
 }
 typ_int = 0;   /* Used as a flag */
      c = b_S[0];
 tokenix(b_S, &k_int, ",", "");
      if (c == '(')
      {
       k_int++;
 strcpy(temp_S[6],tmp_S[5]);
 strcpy(temp_S[5],tmp_S[4]);
 strcpy(temp_S[4],tmp_S[3]);
 strcpy(temp_S[3],tmp_S[2]);
       strcpy(b_S,tmp_S[1]+1); b_S[strlen(b_S)-1]='\0';
 tokenix(b_S, &n_int, ",", "");
 if(n_int != 2)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 strcpy(temp_S[2],tmp_S[2]);
 strcpy(temp_S[1],tmp_S[1]);

 vartyp(temp_S[5], &typ_int);
 if(typ_int == 7)
 {
  printfmt(temp_S[5], formt_S, prt_S, &nflag_int);
  
sprintf(prtf_S,"%s%s%s%s%s%s","sprintf(tws__S,",CHR_S(34),formt_S,CHR_S(34),prt_S,");");
  /*     PRINT #2, spc$ + prtf$ */
  strcpy(temp_S[5],"tws__S");
  twsflg_int = 1;
 }
      }
 sprintf(b_S,"%s%s%s",e_S,"QB2C",e_S);
 strcpy(d_S,"-misc-fixed-medium-r-normal-*-20-140-*-100-c-100-iso8859-1");
 sprintf(tws__S,"%s%s%s",e_S,d_S,e_S);
 strcpy(d_S,tws__S);
 if(k_int > 4)   /* title */
 {
  strcpy(b_S,temp_S[5]);
 }
 if(k_int > 5)   /* font */
 {
  strcpy(d_S,temp_S[6]);
 }
      if (k_int == 1 && c != '(')
      {
 if(strcmp(tmp_S[1], "10") == 0)
 {
  sprintf(prt_S,"%s%s%s%s%s",spc_S,"ixopnwi(100,100,819,484,",b_S,",0);",t_S);
  commfl_int = 1;
 }
 else
 {
  if(strcmp(tmp_S[1], "0") == 0)
  {
   printf("%s\n","WARNING! SCREEN 0 is obsolete, ignored since");
   printf("%s\n","there is no need to switch to tty mode.");
   commfl_int = 1;
   /* RETURN */
   longjmp(j__buf[--j__lev],1);
  }
  else
  {
   printf("%s%s\n",a_S," not supported! Mode must be 0 or 10");
  }
 }
      }
      else
      {
 if(k_int == 2)
 {
  strcpy(temp_S[3],"819");
  strcpy(temp_S[4],"484");
 }
 else
 {
  if(k_int < 4)
  {
   /* RETURN */
   longjmp(j__buf[--j__lev],1);
  }
 }
 
sprintf(prt_S,"%s%s%s%s%s%s%s%s%s%s%s%s","ixopnwi((int)",temp_S[1],",(int)",temp_S[2],",(int)",temp_S[3],",(int)",temp_S[4],",",b_S,",0);",t_S);
      }
      if ( memcmp(a_S,"SCREEN ",7)==0 ) {
 fprintf(fp_2,"%s%s\n",spc_S,"ixsetfs(0,0); ixsetfc(1); ixsettc(1); 
ixsetta(0,0); ixsetms(0,5,xy__pos);");
 fprintf(fp_2,"%s%s%s%s\n",spc_S,"strcpy(tws__S,",d_S,");");
 fprintf(fp_2,"%s%s\n",spc_S,"if(ixsettf(1,tws__S)==1)");
 fprintf(fp_2,"%s%s%s%s%s%s\n",spc_S,"{ fprintf(stderr,",e_S,"Requested Xfont 
not found: %s\\n",e_S,",tws__S); }");
      }
 if(typ_int == 7)
 {
  fprintf(fp_2,"%s%s\n",spc_S,prtf_S);
 }
 if(xwflag_int)
 {
  fprintf(fp_2,"%s%s%s%s\n",spc_S,f_S,"=",prt_S);
  xwflag_int = 0;
 }
 else
 {
  fprintf(fp_2,"%s%s\n",spc_S,prt_S);
 }
 grafflg_int = 1;
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_21500:   /* "SET " (graphics) statement */
 strcpy(e_S,CHR_S(34));
 j_int = LEN(a_S);
      i_int = 4; while(a_S[i_int] != ' ' && i_int < j_int) i_int++;
 if(i_int == j_int)
 {
  printf("%s% d %s%s\n","ERROR: Syntax error in line No",nl_int,": ",a_S);
       exit(1);
 }
 strcpy(d_S,MID_S(a_S, 5, i_int - 4));   /* Opcija od SET */
 strcpy(b_S,MID_S(a_S, i_int + 2, LMAX));
 quadrix(b_S);
 tokenix(b_S, &k_int, ",", "");
 if(k_int == 1)
 {
  sprintf(prt_S,"%s%s%s%s","((int)(",tmp_S[1],")); ",t_S);
 }
 else
 {
  if(k_int == 2)
  {
   sprintf(prt_S,"%s%s%s%s%s%s","((int)(",tmp_S[1],") 
,(int)(",tmp_S[2],"));",t_S);
  }
 }
 if(strcmp(d_S, "PLCI") == 0 || strcmp(d_S, "LCOL") == 0)
 {
  if(k_int != 1)
  {
   goto Lab_29000;
  }
  fprintf(fp_2,"%s%s%s\n",spc_S,"ixsetlc",prt_S);
  commfl_int = 1;
 }
 else
 {
  if(strcmp(d_S, "LWID") == 0)
  {
   if(k_int != 1)
   {
    goto Lab_29000;
   }
   fprintf(fp_2,"%s%s%s\n",spc_S,"ixsetln",prt_S);
   commfl_int = 1;
  }
  else
  {
   if(strcmp(d_S, "PMTS") == 0)
   {
    if(k_int != 2)
    {
     goto Lab_29000;
    }
    fprintf(fp_2,"%s%s%s\n",spc_S,"ixsetmts",prt_S);
    commfl_int = 1;
   }
   else
   {
    if(strcmp(d_S, "PMCI") == 0)
    {
     if(k_int != 1)
     {
      goto Lab_29000;
     }
     fprintf(fp_2,"%s%s%s\n",spc_S,"ixsetmc",prt_S);
     commfl_int = 1;
    }
    else
    {
     if(strcmp(d_S, "FASI") == 0)
     {
      if(k_int != 2)
      {
       goto Lab_29000;
      }
      fprintf(fp_2,"%s%s%s\n",spc_S,"ixsetfs",prt_S);
      commfl_int = 1;
     }
     else
     {
      if(strcmp(d_S, "FACI") == 0)
      {
       if(k_int != 1)
       {
        goto Lab_29000;
       }
       fprintf(fp_2,"%s%s%s\n",spc_S,"ixsetfc",prt_S);
       commfl_int = 1;
      }
      else
      {
       if(strcmp(d_S, "TXCI") == 0)
       {
        if(k_int != 1)
        {
         goto Lab_29000;
        }
        fprintf(fp_2,"%s%s%s\n",spc_S,"ixsettc",prt_S);
        commfl_int = 1;
       }
       else
       {
        if(strcmp(d_S, "TFON") == 0)
        {
         
fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"if(ixsettf(1,",tmp_S[1],")==1)",t_S);
         fprintf(fp_2,"%s%s%s%s%s%s\n",spc_S,"{ fprintf(stderr,",e_S,"Requested 
Xfont not found: %s\\n",e_S,",tws__S); }");
         commfl_int = 1;
        }
        else
        {
         if(strcmp(d_S, "TXAL") == 0)
         {
          if(k_int != 2)
          {
           goto Lab_29000;
          }
          fprintf(fp_2,"%s%s%s\n",spc_S,"ixsetta",prt_S);
          commfl_int = 1;
         }
         else
         {
          if(strcmp(d_S, "BG") == 0)
          {
           fprintf(fp_2,"%s%s%s\n",spc_S,"ixsetbg",prt_S);
           commfl_int = 1;
          }
          else
          {
           if(strcmp(d_S, "DRMD") == 0)
           {
            if(k_int != 1)
            {
             goto Lab_29000;
            }
            fprintf(fp_2,"%s%s%s\n",spc_S,"ixdrmde",prt_S);
            commfl_int = 1;
           }
           else
           {
            if(strcmp(d_S, "DMOD") == 0)
            {
             if(k_int > 10)
             {
                   fprintf(stderr,"Too many arguments to DMOD (>10)\n");exit(1);
             }
             if(k_int == 1)
             {
              fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"D__[0] = ",tmp_S[1],";",t_S);
              fprintf(fp_2,"%s%s\n",spc_S,"ixsetls(1, D__);");
             }
             else
             {
              if(k_int >= 2)
              {
                    strcpy(b_S,"D__[0]=");
                    strcat(b_S,tmp_S[1]); strcat(b_S,"; ");
               for(i_int = 2; i_int <= k_int; i_int++)
               {
                     strcat(b_S,"D__["); c='0'+i_int-1; strcat(b_S,&c);
                     strcat(b_S,"]="); strcat(b_S,tmp_S[i_int]);
                     strcat(b_S,"; ");
               }
               fprintf(fp_2,"%s%s%s\n",spc_S,b_S,t_S);
               fprintf(fp_2,"%s%s%s%s\n",spc_S,"ixsetls((int)",STR_S(k_int),", 
D__);");
              }
              else
              {
               fprintf(fp_2,"%s%s%s\n",spc_S,"ixsetls(0, D__);",t_S);
              }
             }
             grafflg_int = 1;
             commfl_int = 1;
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_22000:   /* "SAVEGIF " (graphics) statement */
 /* save the picture into the file */
 /* Syntax: SAVEGIF filename$ */
 strcpy(b_S,MID_S(a_S, 8, LMAX));
 gulix(b_S);
 stringx(b_S);
 vartyp(b_S, &typ_int);
 if(typ_int == 7)
 {
  printfmt(b_S, formt_S, prt_S, &nflag_int);
  
sprintf(prtf_S,"%s%s%s%s%s%s","sprintf(tws__S,",CHR_S(34),formt_S,CHR_S(34),prt_S,");");
  fprintf(fp_2,"%s%s\n",spc_S,prtf_S);
  strcpy(b_S,"tws__S");
  twsflg_int = 1;
 }
 fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"ixdogif(",b_S,");",t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_22500:   /* "LOADGIF " (graphics) statement */
 /* load a picture from the file */
 /* Syntax: LOADGIF (x%, y%), filename$[, ipal%], bgcolor%] */
 strcpy(b_S,MID_S(a_S, 8, LMAX));
 gulix(b_S);
      if (b_S[0] != '(') goto Lab_22509;
 quadrix(b_S);
 tokenix(b_S, &k_int, ",", "");
 if(k_int < 2)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 strcpy(b_S,tmp_S[1]);
 strcpy(d_S,tmp_S[2]);
 stringx(d_S);
 quadrix(d_S);
      strcpy(b_S,tmp_S[1]+1); b_S[strlen(b_S)-1]='\0';
 tokenix(b_S, &n_int, ",", "");
 if(k_int >= 3)
 {
  strcpy(b_S,tmp_S[3]);
  quadrix(b_S);
 }
 else
 {
  strcpy(b_S,"0");   /* default for ipal */
 }
 if(k_int >= 4)
 {
  strcpy(f_S,tmp_S[4]);
  quadrix(f_S);
 }
 else
 {
  strcpy(f_S,"-1");   /* default for bgcolor */
 }
 strcpy(temp_S[1],tmp_S[1]);
 strcpy(temp_S[2],tmp_S[2]);

 tokenix(d_S, &n_int, "+", "");
 if(n_int > 1)
 {
  printfmt(d_S, formt_S, prt_S, &nflag_int);
  
sprintf(prtf_S,"%s%s%s%s%s%s","sprintf(tws__S,",CHR_S(34),formt_S,CHR_S(34),prt_S,");");
  fprintf(fp_2,"%s%s\n",spc_S,prtf_S);
  strcpy(d_S,"tws__S");
  twsflg_int = 1;
 }

 
fprintf(fp_2,"%s%s%s%s%s%s%s%s%s%s%s%s%s\n",spc_S,"ixldgif((int)(",temp_S[1],"),(int)(",temp_S[2],"),",d_S,",(int)(",b_S,"),(int)(",f_S,"));",t_S);
 grafflg_int = 1;
 commfl_int = 1;
 if(updateff_int == 1)
 {
  fprintf(fp_2,"%s%s\n",spc_S,"ixupdwi(0);");
 }
Lab_22509:
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_22600:   /* "GIFINFO " (graphics) statement */
 /* Obtain width, height and ncol of a GIF */
 /* Syntax: GIFINFO file$, width[, height[, ncol]] */
 strcpy(b_S,MID_S(a_S, 8, LMAX));
 gulix(b_S);
 quadrix(b_S);
 tokenix(b_S, &k_int, ",", "");
 if(k_int < 2)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 sprintf(prt_S,"%s%s%s",spc_S,tmp_S[2]," = GInf__[0]; ");
 if(k_int >= 3)
 {
  sprintf(tws__S,"%s%s%s",prt_S,tmp_S[3]," = GInf__[1]; ");
  strcpy(prt_S,tws__S);
 }
 if(k_int >= 4)
 {
  sprintf(tws__S,"%s%s%s",prt_S,tmp_S[4]," = GInf__[2];");
  strcpy(prt_S,tws__S);
 }
 fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"gifinfo(",tmp_S[1],", GInf__);",t_S);
 fprintf(fp_2,"%s\n",prt_S);
 grafflg_int = 1;
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_22100:   /* "GET " OR "XGETGE " (graphics) statements */
 /* GET: get image in an array of pixels */
 /* Syntax: GET (x%, y%), w%, h%, array? */
 /* XGETGE: get window (win% >= 0) or the root window (win% < 0) geometry */
 /* Syntax: XGETGE (x%, y%), w%, h%, win% */
 tmpfl_int = 0;
      if (a_S[0] == 'G') tmpfl_int = 1;
 if(tmpfl_int)
 {
  strcpy(b_S,MID_S(a_S, 4, LMAX));
  gulix(b_S);
 }
 if(! tmpfl_int)
 {
  strcpy(b_S,MID_S(a_S, 7, LMAX));
  gulix(b_S);
 }
 quadrix(b_S);
 tokenix(b_S, &k_int, ",", "");
      if (b_S[0] != '(' || k_int != 4) {
 printf("%s%s%s\n","ERROR in line",STR_S(nl_int)," probably wrong number of 
arguments:");
 printf("%s\n",line_S);
       exit(1);
      }
 strcpy(b_S,tmp_S[1]);
 strcpy(d_S,tmp_S[2]);
      strcpy(b_S,tmp_S[1]+1); b_S[strlen(b_S)-1]='\0';
 tokenix(b_S, &n_int, ",", "");
 if(n_int != 2)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 if(tmpfl_int)
 {
  
fprintf(fp_2,"%s%s%s%s%s%s%s%s%s%s%s%s%s\n",spc_S,"ixpicget((int)(",tmp_S[1],"),(int)(",tmp_S[2],"),(int)(",d_S,"),(int)(",tmp_S[3],"),",tmp_S[4],");",t_S);
 }
 else
 {
  
fprintf(fp_2,"%s%s%s%s%s%s%s%s%s%s%s%s%s\n",spc_S,"ixgetge(",tmp_S[4],",&",tmp_S[1],",&",tmp_S[2],",&",d_S,",&",tmp_S[3],");",t_S);
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_22200:   /* "PUT " and/or "XANIM "(graphics) statement */
 /* Put array of pixels on window: */
 /* Syntax: PUT (x%, y%), array?, w%, h%[, (xs%, ys%)[, sw%, sh%]] */
 /* Animate series of arrays: */
 /* Syntax: XANIM (x%, y%), array?, w%, h%[, (xs%, ys%)[, sw%, sh%]] */
 flag_int = 1;
      if (memcmp(a_S,"XANIM ",6)==0) flag_int = 0;
 if(flag_int)
 {
  strcpy(b_S,MID_S(a_S, 4, LMAX));
 }
 else
 {
  strcpy(b_S,MID_S(a_S, 6, LMAX));
 }
 gulix(b_S);
 quadrix(b_S);
 tokenix(b_S, &k_int, ",", "");
      if (b_S[0] != '(' || (k_int != 4 && k_int != 5 && k_int != 7)) {
 goto Lab_29500;   /* Error message on No of args and exit */
      }
 strcpy(d_S,tmp_S[2]);
 strcpy(b_S,tmp_S[1]);
      strcpy(b_S,tmp_S[1]+1); b_S[strlen(b_S)-1]='\0';
 tokenix(b_S, &n_int, ",", "");
 if(n_int != 2)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 strcpy(temp_S[1],tmp_S[1]);
 strcpy(temp_S[2],tmp_S[2]);
 if(k_int > 4)
 {
  strcpy(b_S,tmp_S[5]);
       strcpy(b_S,tmp_S[5]+1); b_S[strlen(b_S)-1]='\0';
  tokenix(b_S, &n_int, ",", "");
  if(n_int != 2)
  {
   /* RETURN */
   longjmp(j__buf[--j__lev],1);
  }
 }
 if(k_int == 5)
 {
  sprintf(tmp_S[6],"%s%s%s",tmp_S[3],"-",tmp_S[1]);
  sprintf(tmp_S[7],"%s%s%s",tmp_S[4],"-",tmp_S[2]);
 }
 if(k_int == 4)
 {
  strcpy(tmp_S[1],"0");
  strcpy(tmp_S[2],"0");
  strcpy(tmp_S[6],tmp_S[3]);
  strcpy(tmp_S[7],tmp_S[4]);
 }
 
sprintf(prt_S,"%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s","((int)(",temp_S[1],"),(int)(",temp_S[2],"),",d_S,",(int)(",tmp_S[3],"),(int)(",tmp_S[4],"),(int)(",tmp_S[1],"),(int)(",tmp_S[2],"),(int)(",tmp_S[6],"),(int)(",tmp_S[7],"));");
 if(flag_int)
 {
  fprintf(fp_2,"%s%s%s%s\n",spc_S,"ixpicput",prt_S,t_S);
 }
 else
 {
  fprintf(fp_2,"%s%s%s%s\n",spc_S,"ixpicanim",prt_S,t_S);
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_23000:   /* "XUPDATE" (graphics) statement */
 /* update (refresh) the X-window */
 fprintf(fp_2,"%s%s%s\n",spc_S,"ixupdwi(0); ",t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_23200:   /* "XCLS" (graphics) statement */
 /* Clear the current window according to the current background or */
 /* change background color and then clear. */
 strcpy(b_S,MID_S(a_S, 6, LMAX));
 gulix(b_S);
 quadrix(b_S);
 if(strcmp(b_S, "") == 0)
 {
  fprintf(fp_2,"%s%s%s\n",spc_S,"ixclrwi(); ",t_S);
 }
 else
 {
  fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"ixsetbg((int)",b_S,"); ixclrwi();",t_S);
 }
 commfl_int = 1;
 if(updateff_int == 1)
 {
  fprintf(fp_2,"%s%s\n",spc_S,"ixupdwi(0);");
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_23300:   /* "GETCOL " (graphics) statement */
 /* get color components */
 /* getcol index%, r%, g%, b%  Input: index%, Output r%,g%,b%<=255 */
 strcpy(b_S,MID_S(a_S, 7, LMAX));
 tokenix(b_S, &n_int, ",", "");
 if(n_int == 4)
 {
  
sprintf(prt_S,"%s%s%s%s%s%s%s",tmp_S[1],"),",tmp_S[2],",",tmp_S[3],",",tmp_S[4]);
  fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"ixgetcol((int)(",prt_S,");",t_S);
 }
 else
 {
  goto Lab_29500;   /* Error message on No of args and exit */
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_23400:   /* "XSELWI" and/or "XCLOSE" and/or "XCURSOR" (graphics) statement 
*/
 /* select and raise window to which subseq. output is sent D=current */
 strcpy(b_S,MID_S(a_S, 8, LMAX));
 gulix(b_S);
 quadrix(b_S);
 if(strcmp(b_S, "") == 0)
 {
  strcpy(prt_S,"(-1); ");
 }
 else
 {
  sprintf(prt_S,"%s%s%s","((int)(",b_S,")); ");
 }
       if ( memcmp(a_S,"XSELWI",6)==0 ) {
 strcpy(d_S,"ixselwi");
       } else {
        if ( memcmp(a_S,"XCLOSE",6)==0 ) {
 strcpy(d_S,"ixclswi");
        } else {
 strcpy(d_S,"ixcursor");
        }
       }
 fprintf(fp_2,"%s%s%s%s\n",spc_S,d_S,prt_S,t_S);
 commfl_int = 1;
 grafflg_int = 1;
 if(updateff_int == 1)
 {
  fprintf(fp_2,"%s%s\n",spc_S,"ixupdwi(0);");
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_23500:   /* "PALETTE " (graphics) statement */
 /* palette index,#hex_color   or */
 /* palette index,r,g,b  where r,g,b<=255 */
 strcpy(b_S,MID_S(a_S, 9, LMAX));
 tokenix(b_S, &n_int, ",", "");
 if(n_int == 4)
 {
  
sprintf(prt_S,"%s%s%s%s%s%s%s",tmp_S[1],"),",tmp_S[2],",",tmp_S[3],",",tmp_S[4]);
  fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"ixsetco((int)(",prt_S,");",t_S);
 }
 else
 {
  goto Lab_29500;   /* Error message on No of args and exit */
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_23600:   /* "XTITLE " (graphics) statement */
 /* xtitle title$[, win%]  Set window title */
 strcpy(b_S,MID_S(a_S, 7, LMAX));
 tokenix(b_S, &n_int, ",", "");
 if(n_int == 1)
 {
  strcpy(d_S,"-1");
 }
 else
 {
  if(n_int == 2)
  {
   sprintf(d_S,"%s%s%s","(int)(",tmp_S[2],")");
  }
  else
  {
   goto Lab_29500;   /* Error message on No of args and exit */
  }
 }
 fprintf(fp_2,"%s%s%s%s%s%s%s\n",spc_S,"ixtitle(",tmp_S[1],",",d_S,");",t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_23700:   /* "XREQST " (graphics) statement */
 /* xreqst (x%, y%), test$, status% - request string at the postition */
 /* and return status 0 = <Esc>, 1 = <Return> */
 strcpy(b_S,MID_S(a_S, 7, LMAX));
 quadrix(b_S);
 tokenix(b_S, &n_int, ",", "");
 if(n_int != 3)
 {
  goto Lab_29500;   /* Error message on No of args and exit */
 }
 strcpy(temp_S[2],tmp_S[2]);
       strcpy(d_S,tmp_S[1]+1); d_S[strlen(d_S)-1]='\0';
 tokenix(d_S, &n_int, ",", "");
 fprintf(fp_2,"%s%s%s%s%s%s%s%s%s%s\n",spc_S,tmp_S[3]," = 
ixreqst((int)(",tmp_S[1],"),(int)(",tmp_S[2],"),",temp_S[2],");",t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_23800:   /* "XCLIP " (graphics) statement */
 /* xclip (x1%, y1%)-(x2%, y2%), win% - set clipping rectangle in */
 /* the window win% */
 strcpy(b_S,MID_S(a_S, 6, LMAX));
 quadrix(b_S);
 tokenix(b_S, &k_int, "-", ",");
 if(k_int != 3)
 {
  goto Lab_29500;   /* Error message on No of args and exit */
 }
       strcpy(b_S,tmp_S[1]+1); b_S[strlen(b_S)-1]='\0';
       strcpy(d_S,tmp_S[2]+1); d_S[strlen(d_S)-1]='\0';
 tokenix(b_S, &n_int, ",", "");
 strcpy(temp_S[1],tmp_S[1]);
 strcpy(temp_S[2],tmp_S[2]);
 tokenix(d_S, &n_int, ",", "");
 strcpy(temp_S[3],tmp_S[1]);
 strcpy(temp_S[4],tmp_S[2]);
 
fprintf(fp_2,"%s%s%s%s%s%s%s%s%s%s%s%s%s\n",spc_S,"ixclip1((int)(",tmp_S[3],"),(int)(",temp_S[1],"),(int)(",temp_S[2],"),(int)(",temp_S[3],"),(int)(",temp_S[4],"));",t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_23900:   /* "XNOCLI " (graphics) statement */
 /* xnocli win% - set no clipping for win% */
 strcpy(b_S,MID_S(a_S, 7, LMAX));
 quadrix(b_S);
 fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"ixnocli((int)(",b_S,"));",t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_23950:   /* "XWARP " (graphics) statement */
 /* xwarp (x%, y%) - move graphical cursor (pointer) to the position */
 /* (x%, y%) in the current window */
 strcpy(b_S,MID_S(a_S, 6, LMAX));
 quadrix(b_S);
       b_S[0]=' '; b_S[strlen(b_S)-1]='\0';
 tokenix(b_S, &n_int, ",", "");
 if(n_int != 2)
 {
  goto Lab_29500;   /* Error message on No of args and exit */
 }
 
fprintf(fp_2,"%s%s%s%s%s%s%s\n",spc_S,"ixwarp((int)(",tmp_S[1],"),(int)(",tmp_S[2],"));",t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_24000:   /* "MARKER " (graphics) statement */
 strcpy(b_S,MID_S(a_S, 8, LMAX));
 gulix(b_S);
       if (b_S[0] != '(') goto Lab_24009;
 quadrix(b_S);
 tokenix(b_S, &k_int, ",", "");
 if(k_int >= 2)
 {
  fprintf(fp_2,"%s%s%s%s\n",spc_S,"ixsetmc(",tmp_S[2],");");
 }
       strcpy(b_S,tmp_S[1]+1); b_S[strlen(b_S)-1]='\0';
 tokenix(b_S, &n_int, ",", "");
 fprintf(fp_2,"%s%s%s%s%s%s%s\n",spc_S,"xy__pos[0][0]=",tmp_S[1],"; 
xy__pos[0][1]=",tmp_S[2],";",t_S);
 fprintf(fp_2,"%s%s\n",spc_S,"ixmarke(1,xy__pos);");
 if(updateff_int == 1)
 {
  fprintf(fp_2,"%s%s\n",spc_S,"ixupdwi(0);");
 }
 grafflg_int = 1;
 commfl_int = 1;
Lab_24009:
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_24500:   /* "PLINE " (graphics) statement */
 strcpy(b_S,MID_S(a_S, 7, LMAX));
 tokenix(b_S, &n_int, ",", "");
 quadrix(tmp_S[1]);
 quadrix(tmp_S[2]);
 if(n_int > 2)
 {
  quadrix(tmp_S[3]);
  fprintf(fp_2,"%s%s%s%s\n",spc_S,"ixsetlc(",tmp_S[3],");");
 }
 
fprintf(fp_2,"%s%s%s%s%s%s%s\n",spc_S,"ixline(",tmp_S[1],",",tmp_S[2],");",t_S);
 if(updateff_int == 1)
 {
  fprintf(fp_2,"%s%s\n",spc_S,"ixupdwi(0);");
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_25000:   /* "PMARKER " (graphics) statement */
 strcpy(b_S,MID_S(a_S, 9, LMAX));
 tokenix(b_S, &n_int, ",", "");
 quadrix(tmp_S[1]);
 quadrix(tmp_S[2]);
 if(n_int > 2)
 {
  quadrix(tmp_S[3]);
  fprintf(fp_2,"%s%s%s%s\n",spc_S,"ixsetmc(",tmp_S[3],");");
 }
 
fprintf(fp_2,"%s%s%s%s%s%s%s\n",spc_S,"ixmarke(",tmp_S[1],",",tmp_S[2],");",t_S);
 if(updateff_int == 1)
 {
  fprintf(fp_2,"%s%s\n",spc_S,"ixupdwi(0);");
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_25500:   /* "XTEXT " (graphics) statement */
 strcpy(b_S,MID_S(a_S, 7, LMAX));
 quadrix(b_S);
 tokenix(b_S, &k_int, ",", "");
 strcpy(b_S,tmp_S[2]);   /* CALL stringix(d$) */
 strcpy(temp_S[5],tmp_S[4]);
 strcpy(temp_S[4],tmp_S[3]);
       strcpy(d_S,tmp_S[1]+1); d_S[strlen(d_S)-1]='\0';
 tokenix(d_S, &n_int, ",", "");
 strcpy(temp_S[2],tmp_S[2]);
 strcpy(temp_S[1],tmp_S[1]);
 if(k_int  == 2)
 {
  strcpy(temp_S[4],"0.");
 }
 if(k_int <= 3)
 {
  strcpy(temp_S[5],"1.");
 }
 vartyp(b_S, &typ_int);
 if(typ_int == 7)
 {
  printfmt(b_S, formt_S, prt_S, &nflag_int);
  
sprintf(prtf_S,"%s%s%s%s%s%s","sprintf(tws__S,",CHR_S(34),formt_S,CHR_S(34),prt_S,");");
  fprintf(fp_2,"%s%s\n",spc_S,prtf_S);
  strcpy(b_S,"tws__S");
  twsflg_int = 1;
 }
 
fprintf(fp_2,"%s%s%s%s%s%s%s%s%s%s%s%s%s\n",spc_S,"ixtext(0,(int)(",temp_S[1],"),(int)(",temp_S[2],"),(float)(",temp_S[4],"),(float)(",temp_S[5],"),",b_S,");",t_S);
 if(updateff_int == 1)
 {
  fprintf(fp_2,"%s%s\n",spc_S,"ixupdwi(0);");
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_26000:   /* "FAREA " (graphics) statement */
 strcpy(b_S,MID_S(a_S, 7, LMAX));
 quadrix(b_S);
 tokenix(b_S, &n_int, ",", "");
 if(n_int > 2)
 {
  quadrix(tmp_S[3]);
  fprintf(fp_2,"%s%s%s%s\n",spc_S,"ixsetfc(",tmp_S[3],");");
 }
 
fprintf(fp_2,"%s%s%s%s%s%s%s\n",spc_S,"ixflare(",tmp_S[1],",",tmp_S[2],");",t_S);
 if(updateff_int == 1)
 {
  fprintf(fp_2,"%s%s\n",spc_S,"ixupdwi(0);");
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_26500:   /* "CIRCLE " (graphics) statement */
 strcpy(b_S,MID_S(a_S, 8, LMAX));
 quadrix(b_S);
       tmp_S[3][0] = '\0';
       tmp_S[4][0] = '\0';
       tmp_S[5][0] = '\0';
       tmp_S[6][0] = '\0';
 tokenix(b_S, &k_int, ",", "");
 strcpy(tmp_S[0],tmp_S[2]);
       strcpy(d_S,tmp_S[1]+1); d_S[strlen(d_S)-1]='\0';
 tokenix(d_S, &n_int, ",", "");
 
sprintf(prt_S,"%s%s%s%s%s%s","ixcirc((int)(",tmp_S[1],"),(int)(",tmp_S[2],"),(int)(",tmp_S[0]);
       if (tmp_S[3][0]!='\0')
       {
 fprintf(fp_2,"%s%s%s%s\n",spc_S,"ixsetlc(",tmp_S[3],");");
       }
       if (tmp_S[4][0]=='\0')
       {
 strcpy(tmp_S[4],"0.");
       }
       if (tmp_S[5][0]=='\0')
       {
 strcpy(tmp_S[5],"6.2832");
       }
       if (tmp_S[6][0]=='\0')
       {
 strcpy(tmp_S[6],"1.");
       }
 
sprintf(tws__S,"%s%s%s%s%s%s%s%s",prt_S,"),",tmp_S[4],",",tmp_S[5],",",tmp_S[6],");");
 strcpy(prt_S,tws__S);
 fprintf(fp_2,"%s%s%s\n",spc_S,prt_S,t_S);
 if(updateff_int == 1)
 {
  fprintf(fp_2,"%s%s\n",spc_S,"ixupdwi(0);");
 }
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_27000:   /* "GCGET " (graphics) statement */
 /* Request mouse position: gcget (x%, y%), answ%[, typ%[, mode%]] */
 strcpy(b_S,MID_S(a_S, 7, LMAX));
 gulix(b_S);
 quadrix(b_S);
 tokenix(b_S, &k_int, ",", "");
 if(k_int < 2 || k_int > 4)
 {
  goto Lab_29000;
 }
 if(k_int < 3)   /* Default ityp */
 {
  strcpy(tmp_S[3],"0");
 }
 if(k_int < 4)   /* Default mode */
 {
  strcpy(tmp_S[4],"1");
 }
 strcpy(tmp_S[0],tmp_S[2]);
 strcpy(d_S,tmp_S[1]);
       strcpy(d_S,tmp_S[1]+1); d_S[strlen(d_S)-1]='\0';
 tokenix(d_S, &n_int, ",", "");
 if(n_int != 2)
 {
  goto Lab_29000;
 }
 
fprintf(fp_2,"%s%s%s%s%s%s%s%s%s%s%s%s\n",spc_S,tmp_S[0],"=ixreqlo((int)",tmp_S[4],",(int)",tmp_S[3],",&",tmp_S[1],",&",tmp_S[2],");",t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_27500:   /* "XPOINTER " (graphics) statement */
 /* Request mouse position:xpointer (x%, y%), win%, answ%[, typ%[, mode%]] */
 strcpy(b_S,MID_S(a_S, 10, LMAX));
 gulix(b_S);
 quadrix(b_S);
 tokenix(b_S, &k_int, ",", "");
 if(k_int < 3 || k_int > 5)
 {
  goto Lab_29000;
 }
 if(k_int < 4)   /* Default ityp */
 {
  strcpy(tmp_S[4],"1");
 }
 if(k_int < 5)   /* Default mode */
 {
  strcpy(tmp_S[5],"1");
 }
 strcpy(tmp_S[0],tmp_S[2]);
 strcpy(d_S,tmp_S[1]);
       strcpy(d_S,tmp_S[1]+1); d_S[strlen(d_S)-1]='\0';
 tokenix(d_S, &n_int, ",", "");
 if(n_int != 2)
 {
  goto Lab_29000;
 }
 
fprintf(fp_2,"%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",spc_S,tmp_S[3],"=ixwptrq(&",tmp_S[1],",&",tmp_S[2],",&",tmp_S[0],",(int)",tmp_S[4],",(int)",tmp_S[5],");",t_S);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_29000:   /* Anything else not covered yet */
 if(commfl_int == 1)
 {
  /* RETURN */
  longjmp(j__buf[--j__lev],1);
 }
 printf("%s%s%s%s\n","ERROR in line",STR_S(nl_int),": ",line_S);
 printf("%s%s%s%s\n","'",a_S,"'"," cannot be translated ! Please see the 
manual.");
      exit(1);
 commfl_int = 1;
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_29500:   /* Error message on number of arguments */
 printf("%s%s%s\n","ERROR on line",STR_S(nl_int)," probably wrong number of 
arguments in:");
 printf("%s\n",a_S);
      exit(1);


Lab_30000:   /* for nicer 'REM' placements */
 /* input: lremfl%, itok%, ntok% */
 if(lremfl_int == 1 && itok_int == 1)
 {
  sprintf(tws__S,"%s%s%s%s",SPACE_S(3),"/* ",t_S," */");
  strcpy(t_S,tws__S);
  lremfl_int = 0;
 }
 else
 {
  strcpy(t_S,"");
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_31000:   /* Called before every sub (and MAIN) makes a list of possibly 
used */
 /*   arrays "name(" which are converted to C format in 28000 */
 /* Inputs: */
 /* 1) list of shared     vars. & arrs. shtok$(isub%,i%), nsthok%(isub%) */
 /* 2) list of used local vars. & arrs. vlist$(isub%,i%), nvlist%(isub%) */
 /* 3) list of SUB arguments (NOT YET ! arrays cannot be passed yet) */
 /* Outputs: */
 /* atmp$(), natmp% */
 natmp_int = 0;   /* Extracting all array names */
 for(i_int = 1; i_int <= nshtok_int[isub_int]; i_int++)
 {
  strcpy(z_S,shtok_S[isub_int][i_int]);
  if(strcmp(RIGHT_S(z_S, 1), ")") == 0)
  {
   natmp_int = natmp_int + 1;
   strcpy(atmp_S[natmp_int],LEFT_S(z_S, LEN(z_S) - 1));
  }
 }
 /*   Not needed since DIM fills dynamycally arrays of this class */
 /*   FOR i% = 1 TO nvlist%(isub%) */
 /*    z$ = vlist$(isub%, i%) */
 /*    IF RIGHT$(z$, 1) = ")" THEN */
 /*      natmp% = natmp% + 1 */
 /*      atmp$(natmp%) = LEFT$(z$, LEN(z$) - 1) */
 /*    END IF */
 /*   NEXT i% */
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_40000:   /* postprocessing i% -> i_int, i& -> i_long, c$ -> c_S */
 /* and array brackets (except in declarations which is done). */
 /* Also handles MID$(a$,i%) -> MID_S(a_S,i_int,LMAX) */
 if((fp_3 = fopen(strcpy(fn3__S,outf_S), "r")) == NULL)
 {
  fprintf(stderr,"Can't open file %s\n",fn3__S); exit(1);
 }
 if((fp_2 = fopen(strcpy(fn2__S,tmpfile_S), "w")) == NULL)
 {
  fprintf(stderr,"Can't open file %s\n",fn2__S); exit(1);
 }
 /* GOSUB Lab_41000 */    /* Writing out headers and global declarations */
 if (setjmp(j__buf[j__lev++])==0) goto Lab_41000;
 strcpy(e_S,CHR_S(34));
 togfl_int = 0;
 while(! eof(fp_3))
 {
  fgets(line_S, LMAX, fp_3);
  line_S[strlen(line_S) - 1] = '\0';
       if (togfl_int == 1) goto Lab_40001;
       if (strncmp(line_S,"/* Trans",8) == 0)
       { if (strncmp(line_S,"/* Translates of used QB's intrinsic functions: 
*/",50) == 0)
         togfl_int = 1; goto Lab_40001; }
       if (cflag_int==1 && strncmp(line_S,"C ",2)==0)
       {
        line_S[0] = ' ';
       }
       else
       {
  varpost(line_S);   /* Postprocessing variable names */
       }
Lab_40001:
  fprintf(fp_2,"%s\n",line_S);
 }
 if (fp_3) fclose(fp_3); fp_3=NULL;
 if (fp_2) fclose(fp_2); fp_2=NULL;
 /* Cleanup: */
 sprintf(tws__S,"%s%s%s%s","mv -f ",tmpfile_S," ",outf_S);
 system(tws__S);
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_41000:   /* Writes out headers: #include files and global declarations */
 /* before the 'main(...)' */
 lspac_int = 0;   /* dirty... */
 isub_int = 0;
 statfl_int[isub_int] = 1;
 strcpy(spc_S,SPACE_S(lspac_int));
 fprintf(fp_2,"%s\n","#include <stdio.h>");
 fprintf(fp_2,"%s\n","#include <string.h>");
 fprintf(fp_2,"%s\n","#include <stddef.h>");
 fprintf(fp_2,"%s\n","#include <stdlib.h>");
 if(retrnfl_int == 1)
 {
  fprintf(fp_2,"%s\n","#include <setjmp.h>");
 }
 if(timefl_int == 1)
 {
  fprintf(fp_2,"%s\n","#include <time.h>");
 }
 if(mathfl_int == 1)
 {
  fprintf(fp_2,"%s\n","#include <math.h>");
 }
 if(grafflg_int == 1)
 {
  fprintf(fp_2,"%s\n","#include <X11/cursorfont.h>");
 }
 fprintf(fp_2,"%s\n","#include <ctype.h>");
 if(inkeyff_int == 1 && tflg_int == 0)
 {
  fprintf(fp_2,"%s\n","#include <unistd.h>");
  fprintf(fp_2,"%s\n","#include <fcntl.h>");
  fprintf(fp_2,"%s\n","#include <sys/ioctl.h>");
  fprintf(fp_2,"%s\n","#include <termio.h>");
  fprintf(fp_2,"%s\n","#include <termios.h>");
 }
 if(pausefl_int)
 {
  fprintf(fp_2,"%s\n","#include <sys/types.h>");
  fprintf(fp_2,"%s\n","#include <sys/time.h>");
 }
 fprintf(fp_2,"\n");
 fprintf(fp_2,"%s\n","/* This file was generated by QuickBasic to C translator 
*/");
 fprintf(fp_2,"%s%s%s\n","/* qb2c  ver.",Version_S,"                            
*/");
 fprintf(fp_2,"\n");
 /* Global constants: */
 /* PRINT #2, "#define LMAX 32767" */
 fprintf(fp_2,"%s\n","#define LMAX 1024");   /* Max. in/out line length (max 
32767) */
 if(minff_int == 1)
 {
  fprintf(fp_2,"%s\n","#define MIN(a,b) ((a) < (b) ? (a) : (b))");
 }
 if(maxff_int == 1)
 {
  fprintf(fp_2,"%s\n","#define MAX(a,b) ((a) > (b) ? (a) : (b))");
 }
 if(ncnst_int > 0)
 {
  for(i_int = 1; i_int <= ncnst_int; i_int++)
  {
   strcpy(prtf_S,cnst_S[i_int]);
   varpost(prtf_S);
   fprintf(fp_2,"%s\n",prtf_S);
  }
 }
 if(ncg_int > 0)
 {
  for(i_int = 1; i_int <= ncg_int; i_int++)
  {
   fprintf(fp_2,"%s\n",cg_S[i_int]);
  }
 }
 fprintf(fp_2,"\n");
 fprintf(fp_2,"%s\n","/* Function declarations */");
 if(extrnfl_int == 1)
 {
  qbfdecl();
 }
 for(i_int = 1; i_int <= nfuncs_int; i_int++)
 {
  strcpy(b_S,funames_S[i_int]);
  vartyp(b_S, &typ_int);
  varpost(b_S);
  strcpy(z_S,"");
  if(typ_int == 5)
  {
   strcpy(z_S,"*");
  }
  fprintf(fp_2,"%s%s%s%s%s%s%s\n","extern 
",atyp_S[typ_int],z_S,b_S,"(",funtyl_S[i_int],");");
 }
 fprintf(fp_2,"\n");
 tmpfl_int = 0;
 fprintf(fp_2,"%s\n","/* Shared variables and arrays declarations */");
 if(retrnfl_int == 1)
 {
  fprintf(fp_2,"%s% .7G %s\n","static jmp_buf j__buf[",(double)(GMAX),"];");
  fprintf(fp_2,"%s\n","static int  j__lev=0;");
  tmpfl_int = 1;
 }
 if(grafflg_int == 1)
 {
  fprintf(fp_2,"%s\n","static short xy__pos[3][2], D__[10], GInf__[3];");
  tmpfl_int = 1;
 }
 if(inkeyff_int == 1 && tflg_int == 0)
 {
  fprintf(fp_2,"%s\n","static struct termio term_orig;");
  fprintf(fp_2,"%s\n","static int  kbdflgs;");
  fprintf(fp_2,"%s\n","static char keyb__S[30][9], keyq__S[30][4];");
  tmpfl_int = 1;
 }
 if(pausefl_int)
 {
  fprintf(fp_2,"%s\n","static struct timeval t__;");
 }
 /* Declaring arrays in MAIN */
 if(alis_int > 0)
 {
  for(i_int = 1; i_int <= alis_int; i_int++)
  {
   strcpy(d_S,darr_S[alist_int[i_int]]);
   vartyp(d_S, &typ_int);
   brackets(d_S);
   sprintf(prtf_S,"%s%s%s",atyp_S[typ_int - 10],d_S,";");
   varpost(prtf_S);
   fprintf(fp_2,"%s%s\n","static ",prtf_S);
   tmpfl_int = 1;
  }
 }
 if(chartfl_int == 1)
 {
  fprintf(fp_2,"%s\n","static char   w__S[16][LMAX];");
  fprintf(fp_2,"%s\n","static int    j__S = 0, j__Stmp;");
  tmpfl_int = 1;
 }
 if(inttfl_int == 1)
 {
  fprintf(fp_2,"%s\n","static int    w__s[16];");
  fprintf(fp_2,"%s\n","static int    i__s = 0, i__stmp;");
  tmpfl_int = 1;
 }
 if(longtfl_int == 1)
 {
  fprintf(fp_2,"%s\n","static long   w__l[16];");
  fprintf(fp_2,"%s\n","static int    i__l = 0, i__ltmp;");
  tmpfl_int = 1;
 }
 if(floattfl_int == 1)
 {
  fprintf(fp_2,"%s\n","static float  w__f[16];");
  fprintf(fp_2,"%s\n","static int    i__f = 0, i__ftmp;");
  tmpfl_int = 1;
 }
 if(vdblff_int == 1)
 {
  fprintf(fp_2,"%s\n","static double w__d[16];");
  fprintf(fp_2,"%s\n","static int    i__d = 0, i__dtmp;");
  tmpfl_int = 1;
 }
 if(byttfl_int == 1)
 {
  fprintf(fp_2,"%s\n","static unsigned char w__b[16];");
  fprintf(fp_2,"%s\n","static int    i__b = 0, i__btmp;");
  tmpfl_int = 1;
 }
 if(sigiff_int == 1)
 {
  fprintf(fp_2,"%s\n","static int  sig__i[16];");
  fprintf(fp_2,"%s\n","static int  j__sig = 0;");
  tmpfl_int = 1;
 }
 if(twsflg_int == 1)
 {
  tmpfl_int = 1;
  fprintf(fp_2,"%s\n","static char tws__S[LMAX];");
 }
 if(nSHRDtk_int > 0)
 {
  strcpy(int_S," int  ");
  strcpy(float_S," float ");
  if(longflg_int == 1)
  {
   strcpy(int_S," long ");
  }
  if(doblflg_int == 1)
  {
   strcpy(float_S," double ");
  }
  if(strcmp(sint_S, "") != 0)
  {
   i__stmp = ++i__s % 32;
   w__s[(i__stmp + 0 ) % 32] = 3;
   i__s = (i__s + 0 ) % 32;
   declarix(int_S, sint_S, &w__s[(i__stmp+0)%32]);
   tmpfl_int = 1;
  }
  if(strcmp(srea_S, "") != 0)
  {
   i__stmp = ++i__s % 32;
   w__s[(i__stmp + 0 ) % 32] = 0;
   i__s = (i__s + 0 ) % 32;
   declarix(float_S, srea_S, &w__s[(i__stmp+0)%32]);
   tmpfl_int = 1;
  }
  if(strcmp(ssss_S, "") != 0)
  {
   i__stmp = ++i__s % 32;
   w__s[(i__stmp + 0 ) % 32] = 1;
   i__s = (i__s + 0 ) % 32;
   declarix(" char ", ssss_S, &w__s[(i__stmp+0)%32]);
   tmpfl_int = 1;
  }
  if(strcmp(slin_S, "") != 0)
  {
   i__stmp = ++i__s % 32;
   w__s[(i__stmp + 0 ) % 32] = 4;
   i__s = (i__s + 0 ) % 32;
   declarix(" long ", slin_S, &w__s[(i__stmp+0)%32]);
   tmpfl_int = 1;
  }
  if(strcmp(sdbl_S, "") != 0)
  {
   i__stmp = ++i__s % 32;
   w__s[(i__stmp + 0 ) % 32] = 0;
   i__s = (i__s + 0 ) % 32;
   declarix(" double ", sdbl_S, &w__s[(i__stmp+0)%32]);
   tmpfl_int = 1;
  }
 }
 fprintf(fp_2,"\n");
 fprintf(fp_2,"%s\n","/* Open files pointers */");
 if(nopen_int > 0)
 {
  fprintf(fp_2,"%s%s%s\n","FILE ",fff_S,";");
  tmpfl_int = 1;
 }
 if(tmpfl_int == 1)
 {
  fprintf(fp_2,"\n");
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);



Lab_45000:   /* Adding pointer prefixes '*' to variables in SUBs (postprocess) 
*/
 /* except in FUNCTIONs */
 /* Also handles Labels to override HP compiler problem */
 /* Must be done *before* 40000 post. */
 /* Does not change comment lines ???? */
 /* writes out initializations in MAIN that appear after declarations */
 isub_int = 0;
 lbfl_int = 0;
 nl_int = 0;
 tmpfl_int = 0;
 if((fp_2 = fopen(strcpy(fn2__S,outf_S), "r")) == NULL)
 {
  fprintf(stderr,"Can't open file %s\n",fn2__S); exit(1);
 }
 if((fp_3 = fopen(strcpy(fn3__S,tmpfile_S), "w")) == NULL)
 {
  fprintf(stderr,"Can't open file %s\n",fn3__S); exit(1);
 }
 while(! eof(fp_2))
 {
  fgets(line_S, LMAX, fp_2);
  line_S[strlen(line_S) - 1] = '\0';
  nl_int = nl_int + 1;
  if(tmpfl_int == 1)
  {
   goto Lab_45010;
  }
  /* GOSUB Lab_45050 */ 
  if (setjmp(j__buf[j__lev++])==0) goto Lab_45050;
  if(lbfl_int == 1)
  {
   goto Lab_45011;
  }
  lleng_int = LEN(line_S);
  togfl_int = 0;
  if(lleng_int <= 2)
  {
   goto Lab_45010;
  }
  strcpy(b_S,LEFT_S(line_S, 18));
  if(strcmp(b_S, "/*- User SUBs--End") == 0)
  {
   tmpfl_int = 1;
   goto Lab_45010;
  }
  if(strcmp(b_S, "/*- User SUB--Star") == 0)
  {
   isub_int = isub_int + 1;
   fprintf(fp_3,"%s\n",line_S);
   fgets(line_S, LMAX, fp_2);
   line_S[strlen(line_S) - 1] = '\0';
   fprintf(fp_3,"%s\n",line_S);
   goto Lab_45015;
  }
  if(funcfl_int[isub_int] == 1)
  {
   goto Lab_45010;
  }
  if(isub_int > 0)
  {
   /*     Processing will pass here only for all non-empty lines within a SUB */
        if (cflag_int==1 && strncmp(line_S,"C ",2)==0) goto Lab_45010;
   if(nsubvar_int[isub_int] > 0)
   {
    for(i_int = 1; i_int <= nsubvar_int[isub_int]; i_int++)
    {
     strcpy(z_S,subvar_S[isub_int][i_int]);
     vartyp(z_S, &typ_int);
     if(typ_int == 5 || typ_int == 15)
     {
      goto Lab_45005;
     }
     j_int = 0;
     lz_int = LEN(z_S);
     togfl_int = 0;
     flag_int = 0;
     leng_int = LEN(line_S);
     g_int = 0;
Lab_45001:
     flag_int = 0;
     while((! flag_int) && j_int <= leng_int)
     {
           if (line_S[j_int] == '"') togfl_int = 1 - togfl_int;
           if (!togfl_int) {
            if (memcmp(&line_S[j_int], "/* ", 3) == 0) flag_int=1;
            if (memcmp(&line_S[j_int], z_S, lz_int) == 0) flag_int = 2;
           }
      j_int = j_int + 1;
     }
     if(flag_int == 1)
     {
      goto Lab_45005;
     }
     if(flag_int == 2)
     {
           c = line_S[j_int + lz_int - 1];
      if (c==' ' || c==',' || c==')' || c==';' || c==']') {;
      if(j_int > 1)
      {
       g_int = ASC(MID_S(line_S, j_int - 1, 1));
      }
      if(j_int == 1 || ! (g_int > 96 && g_int < 123 || g_int > 64 && g_int < 
91))
      {
       sprintf(line_S,"%s%s%s",LEFT_S(line_S, j_int - 1),"*",MID_S(line_S, 
j_int, LMAX));
       leng_int = 1 + leng_int;
       j_int = j_int + lz_int;
      }
           }
     }
     j_int = j_int + 1;
     if(j_int < leng_int)
     {
      goto Lab_45001;
     }
Lab_45005:
    ;}
   }
  }
Lab_45010:
  fprintf(fp_3,"%s\n",line_S);
Lab_45011:
  if(nl_int == initline_int)
  {
   if(inkeyff_int == 1 && tflg_int == 0)
   {
    fprintf(fp_3,"%s\n"," keybd__init();");
   }
  }
Lab_45015:
 ;}
 if (fp_3) fclose(fp_3); fp_3=NULL;
 if (fp_2) fclose(fp_2); fp_2=NULL;
 sprintf(tws__S,"%s%s%s%s","mv -f ",tmpfile_S," ",outf_S);
 system(tws__S);
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_45050:
      if (memcmp(line_S, "Lab_", 4) == 0)
      {
 lbfl_int = 1;
 strcpy(e_S,line_S);
      }
      else
      {
 if(lbfl_int == 1)
 {
  strcpy(t_S,line_S);
  gulix(t_S);
        if (memcmp(t_S, "/*", 2) == 0) goto Lab_45051;
        if (t_S[0] == '}')
        {
         c=0;
         while (e_S[c] != ':' && c <= strlen(e_S)) c++;
         strcpy(tws__S, e_S); tws__S[c+1] = ';';
         strcpy(&tws__S[c+2], &e_S[c+1]); strcpy(e_S, tws__S);
        }
  fprintf(fp_3,"%s\n",e_S);
  lbfl_int = 0;
 }
      }
Lab_45051:
 /* RETURN */
 longjmp(j__buf[--j__lev],1);


Lab_50000:   /* COMMAND$ line tokenization and options handling */
 /* -i or -int => implicit integers i*,j*,k*,l*,m*,n* or upper case */
 /* -d or -double => all floats -> double */
 /* -c64 or -C64 => C-64 specific syntax, switches on -b flag also */
 /* -p or -post => do not perform postprocessing varnames */
 /* -l or -long => all integers (except short)-> long */
 /* -b or -bcpp => insensitive to case & spacing in QBASIC text */
 /* -a or -ansi => OBSOLETE and NOT USED */
 /* -c or -C    => allows C text lines commented with 'C ' */
 /* -m or -M    => disallow logical expr. in math. expression */
 /* -t or -T    => INKEY_S is dead (<termios.h> etc. not specified) */
 /* -n or -N    => To supress SHELL command interpreter: all cmds literal */
 /* -u          => Do not update SCREEN after every LINE, PSET, etc. */
 /* -s          => Strip type sufixes from variable and function names */
 /* -D          => implicit doubles d*, D* */
 /* -r          => integer fractions became double: '/' -> '/ (double)' */
 /* -v          => print version and exit */
 intflg_int = 0;
 c64flg_int = 0;
 postflg_int = 1;
 longflg_int = 0;
 cflag_int = 0;
 Dflg_int = 0;
 doblflg_int = 0;
 bcppflg_int = 0;
 ansiflg_int = 0;
 mflg_int = 1;
 rflag_int=0;
 tflg_int = 0;   /* default flags */
 noshell_int = 0;
 updateff_int = 1;
 stripff_int = 0;
 leng_int = LEN(c_S);
 nctok_int = 0;
 i_int = 1;
 for(k_int = 1; k_int <= 12; k_int++)
 {
  while(strcmp(MID_S(c_S, i_int, 1), " ") == 0 && i_int <= leng_int)
  {
   i_int = i_int + 1;
  }
  j_int = i_int + 1;
  while(strcmp(MID_S(c_S, j_int, 1), " ") != 0 && j_int <= leng_int)
  {
   j_int = j_int + 1;
  }
  strcpy(ctok_S[k_int],MID_S(c_S, i_int, j_int - i_int));
  if(strcmp(ctok_S[k_int], "") == 0)
  {
   goto Lab_50005;
  }
  i_int = j_int + 1;
 }
Lab_50005:
 nctok_int = k_int - 1;
 j_int = 0;
 for(i_int = 1; i_int <= nctok_int; i_int++)
 {
  strcpy(d_S,ctok_S[i_int]);
  if(strcmp(d_S, "-v") == 0 || strcmp(d_S, "-V") == 0)
  {
   fprintf(stderr,"%s%s\n","Version: ",Version_S);
   exit(0);
  }
  if(strcmp(d_S, "-i") == 0 || strcmp(d_S, "-int") == 0)
  {
   intflg_int = 1;
  }
  else
  {
   if(strcmp(d_S, "-C64") == 0 || strcmp(d_S, "-c64") == 0)
   {
    c64flg_int = 1;
    bcppflg_int = 1;
   }
   else
   {
    if(strcmp(d_S, "-p") == 0 || strcmp(d_S, "-post") == 0)
    {
     postflg_int = 0;
    }
    else
    {
     if(strcmp(d_S, "-l") == 0 || strcmp(d_S, "-long") == 0)
     {
      longflg_int = 1;
     }
     else
     {
      if(strcmp(d_S, "-d") == 0 || strcmp(d_S, "-double") == 0)
      {
       doblflg_int = 1;
      }
      else
      {
       if(strcmp(d_S, "-b") == 0 || strcmp(d_S, "-bcpp") == 0)
       {
        bcppflg_int = 1;
       }
       else
       {
        if(strcmp(d_S, "-a") == 0 || strcmp(d_S, "-ansi") == 0)
        {
         ansiflg_int = 1;
        }
        else
        {
         if(strcmp(d_S, "-c") == 0 || strcmp(d_S, "-C") == 0)
         {
          cflag_int = 1;
         }
         else
         {
          if(strcmp(d_S, "-m") == 0 || strcmp(d_S, "-M") == 0)
          {
           mflg_int = 0;
          }
          else
          {
           if(strcmp(d_S, "-t") == 0 || strcmp(d_S, "-T") == 0)
           {
            tflg_int = 1;
           }
           else
           {
            if(strcmp(d_S, "-n") == 0 || strcmp(d_S, "-N") == 0)
            {
             noshell_int = 1;
            }
            else
            {
             if(strcmp(d_S, "-u") == 0)
             {
              updateff_int = 0;
             }
             else
             {
              if(strcmp(d_S, "-s") == 0)
              {
               stripff_int = 1;
              }
              else
              {
               if(strcmp(d_S, "-D") == 0)
               {
                Dflg_int = 1;
               }
               else
               {
                if(strcmp(d_S, "-r") == 0)
                {
                 rflag_int = 1;
                }
                else
                {
                 if(strcmp(MID_S(d_S, 1, 1), "-") == 0)
                 {
                  printf("%s%s\n","qb2c: Unrecognized option, ignored: ",d_S);
                 }
                 else
                 {
                  j_int = j_int + 1;
                  strcpy(ctok_S[j_int],d_S);
                 }
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
 nctok_int = j_int;
 if(nctok_int == 0 || nctok_int > 2)
 {
  printf("%s\n","Usage: qb2c [-option [...]] input_file[.bas] [output_file]");
        exit(1);
 }
 else
 {
  strcpy(inpf_S,ctok_S[1]);
  if(nctok_int >= 1)
  {
   strcpy(b_S,inpf_S);
   if(LEN(inpf_S) > 4)
   {
    if(strcmp(RIGHT_S(inpf_S, 4), ".bas") == 0)
    {
     strcpy(b_S,LEFT_S(inpf_S, LEN(inpf_S) - 4));
    }
   }
   sprintf(inpf_S,"%s%s",b_S,".bas");
   sprintf(outf_S,"%s%s",b_S,".c");
  }
  if(nctok_int == 2)
  {
   strcpy(outf_S,ctok_S[2]);
  }
 }
 printf("%s%s%s%s\n","qb2c: translating  ",inpf_S,"  -->  ",outf_S);
 if(bcppflg_int == 1)
 {
  strcpy(z_S,"");
  if(c64flg_int == 1)
  {
   sprintf(tws__S,"%s%s",z_S," -C64");
   strcpy(z_S,tws__S);
  }
  if(cflag_int == 1)
  {
   sprintf(tws__S,"%s%s",z_S," -C");
   strcpy(z_S,tws__S);
  }
  if(rflag_int == 1)
  {
   sprintf(tws__S,"%s%s",z_S," -r");
   strcpy(z_S,tws__S);
  }
  sprintf(tws__S,"%s%s%s%s","bcpp",z_S," -q ",inpf_S);
  system(tws__S);
  sprintf(inpf_S,"%s%s",b_S,".bcp");
  strcpy(bcp_S,inpf_S);
 }
 /* RETURN */
 longjmp(j__buf[--j__lev],1);

Lab_9999:   /* End Main */
 /* Cleanup */
 if(bcppflg_int == 1)
 {
  sprintf(tws__S,"%s%s","rm -f ",bcp_S);
  system(tws__S);
 }
 printf("%s% .7G %s\n","Translation done in",(double)(TIMER() - tttt),"sec.");
 exit(0);

} /* End of MAIN */

/*- User SUB--Start -*/
int arraydim(char  *h_S)
{
/* SHARED: tmp$() */

  int  i_int, ntok_int, itok_int;
  char b_S[LMAX], d_S[LMAX], e_S[LMAX];
  long j_long;

 /*  Translates array dimensions from QB to C standard (partly, see 800) */
 /*  h$ mora biti 'oguljen' (gulix) */
 i_int = 1;
     while (h_S[i_int] != '(') i_int++;
 strcpy(b_S,MID_S(h_S, i_int + 2, LEN(h_S) - i_int - 2));
 tokenix(b_S, &ntok_int, ",", "");
 strcpy(d_S,"");
 for(itok_int = 1; itok_int <= ntok_int; itok_int++)
 {
  j_long = VAL(tmp_S[itok_int]);
  if(j_long > 0)
  {
   strcpy(e_S,STR_S(j_long + 1));
   sprintf(tws__S,"%s%s%s",d_S,RIGHT_S(e_S, LEN(e_S) - 1),", ");
   strcpy(d_S,tws__S);
  }
  else
  {
   sprintf(tws__S,"%s%s%s",d_S,tmp_S[itok_int],"+1, ");
   strcpy(d_S,tws__S);
  }
 }
 sprintf(h_S,"%s%s%s",LEFT_S(h_S, i_int + 1),LEFT_S(d_S, LEN(d_S) - 2),")");
}


/*- User SUB--Start -*/
int brackets(char  *h_S)
{
/* SHARED: tmp$() */

  int  i_int, n_int;
  char a_S[LMAX];

    char b, c;
 /* Converts array brackets from QB to C standard in DIM statement */
 /* Eg. a(10) -> a[10], b(10, 15) -> b[10][15] */
 /* Assumes that the last char is ")" eg. xxxx(...) */
 i_int = 1;
    while (h_S[i_int] != '(') i_int++;
    b=h_S[i_int-1];
 strcpy(a_S,MID_S(h_S, i_int + 2, LEN(h_S) - i_int - 2));
 tokenix(a_S, &n_int, ",", "");
 strcpy(h_S,LEFT_S(h_S, i_int));
    c = 0;
 for(i_int = 1; i_int <= n_int; i_int++)
 {
     if(tmp_S[i_int][0]=='|')
     { c = 1; }
     else
     {
  sprintf(tws__S,"%s%s%s%s",h_S,"[",tmp_S[i_int],"]");
  strcpy(h_S,tws__S);
     }
 }
    if (b=='$')
    {
     if (!c)
     { strcat(h_S, "[LMAX]"); }
     else
     { strcat(h_S, "["); strcat(h_S, &tmp_S[n_int][1]); strcat(h_S, "]"); }
    }
}


/*- User SUB--Start -*/
int declarix(char  *typ_S, char  *varlist_S, int   *dn_int)
{
/* SHARED: tmp$(), isub%, ni%, spc$, statfl%() */

  int  ntok_int, i_int;
  char prtf_S[LMAX];

 /* Declares variables (+ splits long lines with splitdec) */
 /* Variable names ran through varpost() name postprocessor */
 splitdec(varlist_S, &ntok_int, &*dn_int);
 for(i_int = 1; i_int <= ntok_int; i_int++)
 {
  strcpy(prtf_S,tmp_S[i_int]);
  varpost(prtf_S);
  if(statfl_int[isub_int] == 1)
  {
   fprintf(fp_2,"%s%s%s%s%s\n",spc_S,"static",typ_S,prtf_S,";");
  }
  else
  {
   fprintf(fp_2,"%s%s%s%s\n",spc_S,typ_S,prtf_S,";");
  }
  if(isub_int == 0)
  {
   ni_int = ni_int + 1;
  }
 }
}


/*- User SUB--Start -*/
int gulix(char  *h_S)
{
  int  leng_int, i_int, j_int;

 /* Strip off leading and trailing spaces */
 leng_int = LEN(h_S);
 if(leng_int != 0)
 {
  i_int = 0;
   while(h_S[i_int] == ' ' && i_int < leng_int) ++i_int;
  if(i_int == leng_int)
  {
   strcpy(h_S,"");
   goto Lab_99;
  }
  j_int = leng_int - 1;
   while(h_S[j_int] == ' ' && j_int > 0) --j_int;
   memmove(h_S,&h_S[i_int],(leng_int=j_int-i_int+1)); h_S[leng_int]='\0';
 }
Lab_99:
;}


/*- User SUB--Start -*/
int inputfmt(char  *list_S, char  *formt_S, char  *prt_S, int   *ntok_int, int  
 *flag_int)
{
/* SHARED: tmp$(), nl% */

  int  ltyp_int, typ_int, i_int;
  char b_S[LMAX], z_S[LMAX];

 /* Solves argument lists in "INPUT #" and "INPUT" input statements */
 /* 'list$' is the input list and is not changed. */
 /* 'formt$' is format string and 'prt$' is complete argument list */
 /* to sscanf at the output. */
 strcpy(formt_S,"");
 strcpy(prt_S,"");
 ltyp_int = 0;
 tokenix(list_S, &*ntok_int, ",", ";");
 if(*ntok_int == 1)
 {
  strcpy(b_S,tmp_S[1]);
  vartyp(b_S, &typ_int);
  if(typ_int == 5 || typ_int == 15)
  {
   strcpy(prt_S,list_S);
   *ntok_int = -1;
   goto Lab_315;
  }
 }
 for(i_int = 1; i_int <= *ntok_int; i_int++)
 {
  strcpy(b_S,tmp_S[i_int]);
  vartyp(b_S, &typ_int);
  if(typ_int == 0)
  {
   printf("%s%s%s% d \n","qb2c: inputfmt: Error in input format of ",b_S,"in 
line No",nl_int);
  }
  if(typ_int > 10)
  {
   typ_int = typ_int - 10;
  }
  if(typ_int <= 2)
  {
   strcpy(z_S,"%d");
  }
  else
  {
   if(typ_int == 3)
   {
    strcpy(z_S,"%f");
   }
   else
   {
    if(typ_int == 4)
    {
     strcpy(z_S,"%le");
    }
    else
    {
     if(typ_int == 5)
     {
      strcpy(z_S,"%s");
     }
     else
     {
      printf("%s%s%s% d \n","qb2c: inputfmt: Error in input format of ",b_S,"in 
line No",nl_int);
     }
    }
   }
  }
  if(*flag_int == 1)
  {
   sprintf(tws__S,"%s%s%s",formt_S," ,",z_S);
   strcpy(formt_S,tws__S);
  }
  else
  {
   sprintf(tws__S,"%s%s%s",formt_S,"  ",z_S);
   strcpy(formt_S,tws__S);
  }
  if(typ_int != 5)
  {
   sprintf(tws__S,"%s%s%s",prt_S,",&",b_S);
   strcpy(prt_S,tws__S);
  }
  else
  {
   sprintf(tws__S,"%s%s%s",prt_S,",",b_S);
   strcpy(prt_S,tws__S);
  }
  ltyp_int = typ_int;
 }
 strcpy(formt_S,MID_S(formt_S, 3, LMAX));
Lab_315:
;}


/*- User SUB--Start -*/
int logix(char  *h_S)
{
  int  leng_int, i_int, j_int;
  char z_S[LMAX];

 /* Handles logical expressions */
  char c, k, flagc, flagk, a3_S[4];
 leng_int = LEN(h_S);
 i_int = 1;
 while(i_int <= leng_int)
 {
  strncpy(a3_S, &h_S[i_int-1], 3); a3_S[3]='\0';
  if (a3_S[0] == '=') {
  if(strcmp(MID_S(h_S, i_int - 1, 1), " ") != 0)
  {
   goto Lab_115;
  }
  sparser(h_S, &i_int, "=");   /* String logical expression handler */
  leng_int = LEN(h_S);
  goto Lab_115;
  }
  if (memcmp(a3_S, "<>", 2) == 0) {
  sparser(h_S, &i_int, "<>");   /* String logical expression handler */
  leng_int = LEN(h_S);
  goto Lab_115;
  }
  c = ' '; if (i_int > 1) c = tolower(h_S[i_int-2]);
  if (c<'a' || c>'z') { flagc = 1; } else { flagc = 0; }
  k = ' '; if (i_int+1 < leng_int) k = tolower(h_S[i_int+1]);
  if (k<'a' || k>'z') { flagk = 1; } else { flagk = 0; }
  if ( memcmp(a3_S, "OR", 2) == 0 && flagc && flagk) {
  sprintf(h_S,"%s%s%s",MID_S(h_S, 1, i_int - 1),"||",MID_S(h_S, i_int + 2, 
leng_int - i_int - 1));
  leng_int = LEN(h_S);
  i_int = i_int + 1;
  goto Lab_115;
  }
  k = ' '; if (i_int+2 < leng_int) k = tolower(h_S[i_int+2]);
  if (k<'a' || k>'z') { flagk = 1; } else { flagk = 0; }
  if ( memcmp(a3_S, "AND", 3) == 0 && flagc && flagk) {
  sprintf(h_S,"%s%s%s",MID_S(h_S, 1, i_int - 1),"&&",MID_S(h_S, i_int + 3, 
leng_int - i_int - 1));
  leng_int = leng_int - 1;
  i_int = i_int + 1;
  goto Lab_115;
  }
  if ( memcmp(a3_S, "NOT", 3) == 0 && flagc && flagk) {
  sprintf(h_S,"%s%s%s",MID_S(h_S, 1, i_int - 1),"!",MID_S(h_S, i_int + 3, 
leng_int - i_int - 1));
  leng_int = leng_int - 2;
  goto Lab_115;
  }
  if ( memcmp(a3_S, "EOF", 3) == 0 && flagc && flagk) {
  j_int = i_int + 4;
  while(strcmp(MID_S(h_S, j_int, 1), ")") != 0 && j_int < leng_int)
  {
   j_int = j_int + 1;
  }
  strcpy(z_S,MID_S(h_S, i_int + 4, j_int - i_int - 4));
  gulix(z_S);
  sprintf(h_S,"%s%s%s%s",MID_S(h_S, 1, i_int - 1),"eof(fp_",z_S,MID_S(h_S, 
j_int, leng_int - j_int + 1));
  leng_int = LEN(h_S);
  goto Lab_115;
  }
Lab_115:
  i_int = i_int + 1;
 }
}


/*- User SUB--Start -*/
int mathexp(char  *h_S)
{
/* SHARED: mathfl%, mflg%, expflg%, extrnfl% */

  int  leng_int, i_int, togfl_int;
  char b_S[LMAX];

    char d;
 /* Translates mathematical and logical expressions, including math. functions: 
*/
 /* ^ -> pow(,), MOD */

 sprintf(tws__S,"%s%s"," ",h_S);
 strcpy(h_S,tws__S);
 leng_int = LEN(h_S);
 i_int = 1;
 togfl_int = 0;
 while(i_int <= leng_int)
 {
     d = h_S[i_int-1];
     if (d == 34) togfl_int = 1 - togfl_int;
  if(togfl_int == 1)
  {
   goto Lab_114;
  }
     if (d == '!') h_S[i_int-1] = '.';
  if(i_int > leng_int - 2)
  {
   goto Lab_114;
  }
     if (h_S[i_int-1] == '^')
     {
  sparser(h_S, &i_int, "^");   /* Finds left and right operands in binary ops. 
*/
  leng_int = LEN(h_S);   /* Caution both h$ and i% are changed */
  mathfl_int = 1;
  goto Lab_114;
     }
     if (memcmp(&h_S[i_int-1], " MOD ", 5)==0) {
  i_int = 1 + i_int;
  sparser(h_S, &i_int, "MOD");
  goto Lab_114;
     }
Lab_114:
  i_int = i_int + 1;
 }
 strcpy(h_S,MID_S(h_S, 2, LMAX));
 if(mflg_int == 1 && expflg_int == 1)
 {
  i_int = 1;
  leng_int = LEN(h_S);
      while (h_S[i_int-1] != '=' && i_int != leng_int) i_int++;
  if(i_int == leng_int)
  {
   logix(h_S);
  }
  else
  {
   strcpy(b_S,MID_S(h_S, i_int + 2, LMAX));
   logix(b_S);
   sprintf(h_S,"%s%s",LEFT_S(h_S, i_int + 1),b_S);
  }
 }
}


/*- User SUB--Start -*/
int printfmt(char  *h_S, char  *formt_S, char  *prt_S, int   *nflag_int)
{
/* SHARED: tmp$(), isub%, vdblff%, nptk%, extrnfl% */

  int  zarfl_int, tzarfl_int, leng_int, togfl_int, brfl_int, i_int, j_int, 
typ_int, g_int;
  char d_S[LMAX], z_S[LMAX];

 /* Solves argument lists in "PRINT #" and "PRINT" output statements */
 /* 'h$' is the input expression and is not changed. */
 /* 'formt$' is format string and 'prt$' is complete argument list */
 /* to sprintf or printf at the output. */
  char b;
 /* tokenizacija list varijabli itd. => formt$ */
 *nflag_int = 1;
 strcpy(prt_S,"");
 zarfl_int = 0;
 tzarfl_int = 0;
 if(strcmp(RIGHT_S(h_S, 1), ";") == 0)
 {
  *nflag_int = 0;
 }
 if(*nflag_int == 1)
 {
  sprintf(tws__S,"%s%s",h_S,";");
  strcpy(h_S,tws__S);
 }
 leng_int = LEN(h_S);
 togfl_int = 0;
 brfl_int = 0;
 i_int = 1;
 j_int = 1;
 strcpy(formt_S,"");
 while(j_int <= leng_int)
 {
        b = h_S[j_int - 1];
        if (b == 34) togfl_int = 1 - togfl_int;
  if(togfl_int == 0)
  {
         if (b == '(') brfl_int++;
         if (b == ')') brfl_int--;
  }
        if (!togfl_int && !brfl_int && (b == ';' || b == ',')) {
         zarfl_int = 0; if (b == ',') zarfl_int = 1;
         tzarfl_int = 0; if (b == ';') tzarfl_int = 1;
  strcpy(d_S,MID_S(h_S, i_int, j_int - i_int));
  gulix(d_S);
  vartyp(d_S, &typ_int);
  if(typ_int == 1 || typ_int == 2 || typ_int == 8 || typ_int == 10 || typ_int 
== 11 || typ_int == 12)
  {
   strcpy(z_S,"% d");
   if(zarfl_int == 1)
   {
    strcpy(z_S," %-14d");
   }
   if(tzarfl_int == 1)
   {
    strcpy(z_S,"% d ");
   }
   sprintf(tws__S,"%s%s",formt_S,z_S);
   strcpy(formt_S,tws__S);
   goto Lab_195;
  }
  if(typ_int != 5 && typ_int != 7 && typ_int != 15)
  {
   if(zarfl_int == 1)
   {
    strcpy(z_S," %-14G");
   }
   else
   {
    if(typ_int == 14)
    {
     strcpy(z_S,"% .16G");
     if(tzarfl_int == 1)
     {
      strcpy(z_S,"% .16G ");
     }
    }
    else
    {
     strcpy(z_S,"% .7G");
     if(tzarfl_int == 1)
     {
      strcpy(z_S,"% .7G ");
     }
    }
   }
   sprintf(tws__S,"%s%s",formt_S,z_S);
   strcpy(formt_S,tws__S);
   if(typ_int == 6 || 11 <= typ_int && typ_int <= 14)
   {
    mathexp(d_S);
    if(typ_int <= 12)
    {
     sprintf(tws__S,"%s%s%s","DBL(",d_S,")");
     strcpy(d_S,tws__S);
     vdblff_int = 1;
     extrnfl_int = 1;
    }
   }
   else
   {
    if(typ_int == 20)
    {
     sprintf(tws__S,"%s%s%s","DBL(",d_S,")");
     strcpy(d_S,tws__S);
     vdblff_int = 1;
     extrnfl_int = 1;
    }
   }
  }
  else
  {
   strcpy(z_S,"%s");
   if(zarfl_int == 1)
   {
    strcpy(z_S,"%-14s");
   }
   if(typ_int == 7)
   {
    tokenix(d_S, &nptk_int, "+", "");
    strcpy(d_S,"");
    for(g_int = 1; g_int <= nptk_int; g_int++)
    {
     if(isub_int == 0)
     {
      if(strcmp(tmp_S[g_int], "COMMAND$") == 0)
      {
       strcpy(tmp_S[g_int],"COMMAND$(n__arg, argv)");
      }
     }
     sprintf(tws__S,"%s%s%s",d_S,tmp_S[g_int],",");
     strcpy(d_S,tws__S);
     sprintf(tws__S,"%s%s",formt_S,"%s");
     strcpy(formt_S,tws__S);
    }
    strcpy(d_S,LEFT_S(d_S, LEN(d_S) - 1));
   }
   else
   {
    if(isub_int == 0)
    {
     if(strcmp(d_S, "COMMAND$") == 0)
     {
      strcpy(d_S,"COMMAND$(n__arg, argv)");
     }
    }
    sprintf(tws__S,"%s%s",formt_S,z_S);
    strcpy(formt_S,tws__S);
   }
  }
Lab_195:
  sprintf(tws__S,"%s%s%s",prt_S,",",d_S);
  strcpy(prt_S,tws__S);
  i_int = j_int + 1;
        }
  j_int = j_int + 1;
 }
}


/*- User SUB--Start -*/
int qbfdecl()
{
/* SHARED: spacff%, midff%, leftff%, rightff%, strff% */
/* SHARED: chrff%, ascff%, valff%, lenff%, sgnff% */
/* SHARED: intff%, nintff%, eofff%, commff%, vdblff% */
/* SHARED: rndff%, srndff%, timerff%, dateff%, timeff% */
/* SHARED: inkeyff%, inputff%, colorff%, clsff% */


 if(spacff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern char  *SPACE_S(int);");
 }
 if(midff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern char  *MID_S(char *, int, int);");
 }
 if(leftff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern char  *LEFT_S(char *, int);");
 }
 if(rightff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern char  *RIGHT_S(char *, int);");
 }
 if(strff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern char  *STR_S(double);");
 }
 if(chrff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern char  *CHR_S(int);");
 }
 if(ascff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern long   ASC(char *);");
 }
 if(valff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern double VAL(char *);");
 }
 if(lenff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern int    LEN(char *);");
 }
 if(sgnff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern double SGN(double);");
 }
 if(intff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern long   Int(double);");
 }
 if(nintff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern long   Nint(double);");
 }
 if(eofff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern int    eof(FILE *);");
 }
 if(commff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern char  *COMMAND_S(int, char *argv[]);");
 }
 if(rndff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern double  RND(double);");
 }
 if(srndff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern void    RANDOMIZE(long);");
 }
 if(timerff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern float  TIMER(void);");
 }
 if(vdblff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern double DBL(double);");
 }
 if(dateff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern char  *DATE_S(int);");
 }
 if(timeff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern char  *TIME_S(int);");
 }
 if(inkeyff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern char  *INKEY_S(void);");
 }
 if(inputff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern char  *INPUT(const char*, int);");
 }
 if(colorff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern int    COLOR(int fg, int bg);");
 }
 if(clsff_int == 1)
 {
  fprintf(fp_2,"%s\n","extern int    CLS(int n_int);");
 }
}


/*- User SUB--Start -*/
int qbfunc()
{
/* SHARED: spacff%, midff%, leftff%, rightff%, strff% */
/* SHARED: chrff%, ascff%, valff%, lenff%, sgnff% */
/* SHARED: intff%, nintff%, eofff%, commff%, vdblff% */
/* SHARED: rndff%, srndff%, timerff%, dateff%, timeff% */
/* SHARED: inkeyff%, inputff%, tflg%, colorff%, clsff% */
/* SHARED: existff% */

  char d_S[LMAX];


 strcpy(d_S,CHR_S(34));   /* Quotes */
 if(spacff_int == 1)
 {
  /*  Calls: SPACE_S(j), SPACE_S(2) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern char *SPACE_S(int n)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," int i;");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," if (++j__S == 16) j__S=0;");
  fprintf(fp_2,"%s\n"," if (n < 0) n = 0;");
  fprintf(fp_2,"%s%s%s%s\n"," strcpy(w__S[j__S],",CHR_S(34),CHR_S(34),");");
  fprintf(fp_2,"%s\n"," for(i = 1; i <= n; i++)");
  fprintf(fp_2,"%s\n"," {");
  fprintf(fp_2,"%s%s%s%s%s\n","  strcat(w__S[j__S],",d_S," ",d_S,");");
  fprintf(fp_2,"%s\n"," }");
  fprintf(fp_2,"%s\n"," return w__S[j__S];");
  fprintf(fp_2,"%s\n","}");
 }
 if(midff_int == 1)
 {
  /*  Calls: eg. MID_S(a_S,2,j) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern char *MID_S(char *a_S, int start, int length)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," if (++j__S == 16) j__S=0;");
  fprintf(fp_2,"%s\n"," if(length < 0) { ");
  fprintf(fp_2,"%s%s%s%s%s\n","  printf(",CHR_S(34),"Error: in MID_S: length < 
0\\n",CHR_S(34),");");
  fprintf(fp_2,"%s\n","  exit(0); }");
  fprintf(fp_2,"%s\n"," if(start  < 0) {");
  fprintf(fp_2,"%s%s%s%s%s\n","  printf(",CHR_S(34),"Error: in MID_S: start < 
1\\n",CHR_S(34),");");
  fprintf(fp_2,"%s\n","  exit(0); }");
  fprintf(fp_2,"%s\n"," if(start > strlen(a_S)) ");
  fprintf(fp_2,"%s\n"," { w__S[j__S][0]='\\0'; }");
  fprintf(fp_2,"%s\n"," else");
  fprintf(fp_2,"%s\n"," { strncpy(w__S[j__S], &a_S[start-1], length);");
  fprintf(fp_2,"%s\n","   w__S[j__S][length]='\\0'; }");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," return w__S[j__S];");
  fprintf(fp_2,"%s\n","}");
 }
 if(leftff_int == 1)
 {
  /* Calls:  LEFT_S(a_S,j), LEFT_S(a_S,3) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern char *LEFT_S(char *a_S, int length)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," if (++j__S == 16) j__S=0;");
  fprintf(fp_2,"%s\n"," if(length < 0) { ");
  fprintf(fp_2,"%s%s%s%s%s\n","  printf(",CHR_S(34),"Error: in LEFT_S: length < 
0\\n",CHR_S(34),");");
  fprintf(fp_2,"%s\n","  exit(0); }");
  fprintf(fp_2,"%s\n"," strncpy(w__S[j__S], a_S, length);");
  fprintf(fp_2,"%s\n"," w__S[j__S][length]='\\0';");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," return w__S[j__S];");
  fprintf(fp_2,"%s\n","}");
 }
 if(rightff_int == 1)
 {
  /* Calls:  RIGHT_S(a_S,j), RIGHT_S(a_S,3) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern char *RIGHT_S(char *a_S, int length)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," int  start;");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," if (++j__S == 16) j__S=0;");
  fprintf(fp_2,"%s\n"," if ((start = strlen(a_S) - length) < 0) start = 0;");
  fprintf(fp_2,"%s\n"," if (length < 0) {");
  fprintf(fp_2,"%s%s%s%s%s\n","  printf(",CHR_S(34),"Error: in RIGHT_S: length 
< 0\\n",CHR_S(34),");");
  fprintf(fp_2,"%s\n","  exit(0); }");
  fprintf(fp_2,"%s\n"," strncpy(w__S[j__S], &a_S[start], length);");
  fprintf(fp_2,"%s\n"," w__S[j__S][length]='\\0';");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," return w__S[j__S];");
  fprintf(fp_2,"%s\n","}");
 }
 if(strff_int == 1)
 {
  /* Calls: STR_S(j), STR_S(123.5) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern char *STR_S(double d)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," if (++j__S == 16) j__S=0;");
  fprintf(fp_2,"%s%s%s%s%s\n"," sprintf(w__S[j__S],",d_S,"% G",d_S,",d);");
  fprintf(fp_2,"%s\n"," return w__S[j__S];");
  fprintf(fp_2,"%s\n","}");
 }
 if(chrff_int == 1)
 {
  /* Calls: CHR_S(j), CHR_S(65) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern char *CHR_S(int i)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," if (++j__S == 16) j__S=0;");
  fprintf(fp_2,"%s\n"," w__S[j__S][0]=i;");
  fprintf(fp_2,"%s\n"," w__S[j__S][1]='\\0';");
  fprintf(fp_2,"%s\n"," return w__S[j__S];");
  fprintf(fp_2,"%s\n","}");
 }
 if(ascff_int == 1)
 {
  /* Calls: i=ASC(a_S), i=ASC("ABCD") */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern long ASC(char *c_S)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," if (++i__l == 16) i__l=0;");
  fprintf(fp_2,"%s\n"," if((w__l[i__l]=c_S[0]) < 0) 
w__l[i__l]=256+w__l[i__l];");
  fprintf(fp_2,"%s\n"," return w__l[i__l];");
  fprintf(fp_2,"%s\n","}");
 }
 if(valff_int == 1)
 {
  /*  Calls: VAL(a_S), VAL("1234.5abcd") */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern double VAL(char *a_S)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," if (++i__d == 16) i__d = 0;");
  fprintf(fp_2,"%s\n"," w__d[i__d] = atof(a_S);");
  fprintf(fp_2,"%s\n"," return w__d[i__d];");
  fprintf(fp_2,"%s\n","}");
 }
 if(lenff_int == 1)
 {
  /*  Calls: LEN(a_S), LEN("1234.5abcd") */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern int LEN(char *a_S)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," if (++i__d == 16) i__d = 0;");
  fprintf(fp_2,"%s\n"," w__d[i__d] = strlen(a_S);");
  fprintf(fp_2,"%s\n"," return w__d[i__d];");
  fprintf(fp_2,"%s\n","}");
 }
 if(sgnff_int == 1)
 {
  /*  Calls: SGN(x), SGN(-123.4) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern double SGN(double x)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," if (++i__d == 16) i__d = 0;");
  fprintf(fp_2,"%s\n"," if(x == (double) 0) {");
  fprintf(fp_2,"%s\n","  w__d[i__d] = 0.; }");
  fprintf(fp_2,"%s\n"," else {");
  fprintf(fp_2,"%s\n","  w__d[i__d] = x / fabs(x); }");
  fprintf(fp_2,"%s\n"," return w__d[i__d];");
  fprintf(fp_2,"%s\n","}");
 }
 if(intff_int == 1)
 {
  /*  Calls: Int(x), Int(-123.4) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern long Int(double x)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," return floor(x);");
  fprintf(fp_2,"%s\n","}");
 }
 if(nintff_int == 1)
 {
  /*  Calls: Nint(x), Nint(-123.4) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern long Nint(double x)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," return floor(0.5 + x); ");
  fprintf(fp_2,"%s\n","}");
 }
 if(eofff_int == 1)
 {
  /*  Calls:  while ( ! eof(fp_n) ) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern int eof(FILE *stream)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," static int c, istat;");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," istat=((c=fgetc(stream))==EOF);");
  fprintf(fp_2,"%s\n"," ungetc(c,stream);");
  fprintf(fp_2,"%s\n"," return istat; ");
  fprintf(fp_2,"%s\n","}");
 }
 if(commff_int == 1)
 {
  /*  Calls:  COMMAND_S(n__arg, argv); */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern char *COMMAND_S(int n__arg, char *argv[])");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," int i;");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," if (++j__S == 16) j__S=0;");
  fprintf(fp_2,"%s\n"," for(i = 1; i < n__arg; i++)");
  fprintf(fp_2,"%s\n"," {");
  fprintf(fp_2,"%s\n","  strcat(w__S[j__S],argv[i]);");
  fprintf(fp_2,"%s%s%s%s%s\n","  strcat(w__S[j__S],",d_S," ",d_S,");");
  fprintf(fp_2,"%s\n"," }");
  fprintf(fp_2,"%s\n"," w__S[j__S][strlen(w__S[j__S])-1]='\\0';");
  fprintf(fp_2,"%s\n"," return w__S[j__S];");
  fprintf(fp_2,"%s\n","}");
 }
 if(vdblff_int == 1)
 {
  /*  Calls: DBL(num_expression) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern double DBL(double d)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," if (++i__d == 16) i__d = 0;");
  fprintf(fp_2,"%s\n"," w__d[i__d] = d;");
  fprintf(fp_2,"%s\n"," return w__d[i__d];");
  fprintf(fp_2,"%s\n","}");
 }
 if(rndff_int == 1)
 {
  /*  Calls: RND(num_expression) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern double RND(double d)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," static double y;");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," if(d == 0) {");
  fprintf(fp_2,"%s\n","  return y;");
  fprintf(fp_2,"%s\n"," }");
  fprintf(fp_2,"%s\n"," else {");
  fprintf(fp_2,"%s\n","  return (y = rand()/((double) RAND_MAX));");
  fprintf(fp_2,"%s\n"," }");
  fprintf(fp_2,"%s\n","}");
 }
 if(srndff_int == 1)
 {
  /*  Calls: RANDOMIZE(num_expression) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern void RANDOMIZE(long n)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," srand(n % 65536);");
  fprintf(fp_2,"%s\n","}");
 }
 if(timerff_int == 1)
 {
  /*  Calls: x = TIMER() */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern float TIMER()");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," time_t etime;");
  fprintf(fp_2,"%s\n"," char w_S[12];");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," time(&etime);");
  fprintf(fp_2,"%s%s%s%s%s\n"," 
strftime(w_S,10,",d_S,"%S:%M:%H",d_S,",localtime(&etime));");
  fprintf(fp_2,"%s\n"," return 
(atof(&w_S[0])+60*(atof(&w_S[3])+60*atof(&w_S[6])));");
  fprintf(fp_2,"%s\n","}");
 }
 if(dateff_int == 1)
 {
  /*  Calls: a_S = DATE_S[(i)] */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern char *DATE_S(int i)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," static struct tm *tp;");
  fprintf(fp_2,"%s\n"," long elapse_time;");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," if (++j__S == 16) j__S=0;");
  fprintf(fp_2,"%s\n"," time(&elapse_time);");
  fprintf(fp_2,"%s\n"," tp=localtime(&elapse_time);");
  fprintf(fp_2,"%s\n"," switch (i) {");
  fprintf(fp_2,"%s%s%s%s%s\n","  case 1:  
strftime(w__S[j__S],LMAX,",d_S,"%d.%m.%Y",d_S,",tp);");
  fprintf(fp_2,"%s\n","  break;");
  fprintf(fp_2,"%s%s%s%s%s\n","  case 2:  
strftime(w__S[j__S],LMAX,",d_S,"%d/%m/%Y",d_S,",tp);");
  fprintf(fp_2,"%s\n","  break;");
  fprintf(fp_2,"%s%s%s%s%s\n","  case 3:  
strftime(w__S[j__S],LMAX,",d_S,"%d-%b-%Y",d_S,",tp);");
  fprintf(fp_2,"%s\n","  break;");
  fprintf(fp_2,"%s\n","  case 4:  strcpy(w__S[j__S],asctime(tp));");
  fprintf(fp_2,"%s\n","           w__S[j__S][strlen(w__S[j__S])-1]='\\0';");
  fprintf(fp_2,"%s\n","  break;");
  fprintf(fp_2,"%s%s%s%s%s\n","  default: 
strftime(w__S[j__S],LMAX,",d_S,"%m-%d-%Y",d_S,",tp);");
  fprintf(fp_2,"%s\n","  break;");
  fprintf(fp_2,"%s\n"," }");
  fprintf(fp_2,"%s\n"," return w__S[j__S];");
  fprintf(fp_2,"%s\n","}");
 }
 if(timeff_int == 1)
 {
  /*  Calls: a_S = TIME_S[(i)] */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern char *TIME_S(int i)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," static struct tm *tp;");
  fprintf(fp_2,"%s\n"," long elapse_time;");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," if (++j__S == 16) j__S=0;");
  fprintf(fp_2,"%s\n"," time(&elapse_time);");
  fprintf(fp_2,"%s\n"," tp=localtime(&elapse_time);");
  fprintf(fp_2,"%s%s%s%s%s\n"," 
strftime(w__S[j__S],LMAX,",d_S,"%H:%M:%S",d_S,",tp);");
  fprintf(fp_2,"%s\n"," return w__S[j__S];");
  fprintf(fp_2,"%s\n","}");
 }
 if(inkeyff_int == 1 && tflg_int == 0)
 {
  /*  Calls:  INKEY_S() */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern char  *INKEY_S(void)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," int  i, len;");
  fprintf(fp_2,"%s\n"," static char b[33];");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," input_mode();");
  fprintf(fp_2,"%s\n"," while((len=read(0,b,32)) < 1);");
  fprintf(fp_2,"%s\n"," b[len]='\\0';");
  fprintf(fp_2,"%s\n"," system_mode();");
  fprintf(fp_2,"%s\n"," if(b[0] == 3) exit(0);");
  fprintf(fp_2,"%s\n"," i = 1;");
  fprintf(fp_2,"%s\n"," while (b[i] != 27 && b[i] != '\\0' && i < len) i++;");
  fprintf(fp_2,"%s\n"," if (b[i] == 27) len = i;");
  fprintf(fp_2,"%s\n"," b[len]='\\0';");
  fprintf(fp_2,"%s\n"," for(i = 0; i <= 21; i++)");
  fprintf(fp_2,"%s\n"," if(memcmp(b, keyb__S[i], len) == 0) return 
(keyq__S[i]);");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n"," return (b);");
  fprintf(fp_2,"%s\n","}");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","int system_mode(void)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n","    if (ioctl(0, TCSETA, &term_orig) == -1) {");
  fprintf(fp_2,"%s\n","        return (0);");
  fprintf(fp_2,"%s\n","    }");
  fprintf(fp_2,"%s\n","    fcntl(0, F_SETFL, kbdflgs);");
  fprintf(fp_2,"%s\n","}");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","int input_mode(void)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n","    static struct termio term;");
  fprintf(fp_2,"%s\n","    static int flags;");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","    if (ioctl(0, TCGETA, &term) == -1) {");
  fprintf(fp_2,"%s\n","        return (-1);");
  fprintf(fp_2,"%s\n","    }");
  fprintf(fp_2,"%s\n","    (void) ioctl(0, TCGETA, &term_orig);");
  fprintf(fp_2,"%s\n","    term.c_iflag = 0;");
  fprintf(fp_2,"%s\n","    term.c_oflag = 0;");
  fprintf(fp_2,"%s\n","    term.c_lflag = 0;");
  fprintf(fp_2,"%s\n","    term.c_cc[VMIN] = 1;");
  fprintf(fp_2,"%s\n","    term.c_cc[VTIME] = 0;");
  fprintf(fp_2,"%s\n","    if (ioctl(0, TCSETA, &term) == -1) {");
  fprintf(fp_2,"%s\n","        return (-1);");
  fprintf(fp_2,"%s\n","    }");
  fprintf(fp_2,"%s\n","    kbdflgs = fcntl(0, F_GETFL, 0);");
  fprintf(fp_2,"%s\n","    flags = fcntl(0, F_GETFL);");
  fprintf(fp_2,"%s\n","    flags &= ~O_NDELAY;");
  fprintf(fp_2,"%s\n","    fcntl(0, F_SETFL, flags);");
  fprintf(fp_2,"%s\n","    return (0);");
  fprintf(fp_2,"%s\n","}");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","int keybd__init(void)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," FILE *filep;");
  fprintf(fp_2,"%s\n"," int i;");
  fprintf(fp_2,"%s\n"," char w_S[LMAX];");
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s%s%s%s%s\n"," strcpy(w_S,getenv(",d_S,"HOME",d_S,"));");
  fprintf(fp_2,"%s%s%s%s%s\n"," strcat(w_S,",d_S,"/.kbcalib",d_S,");");
  fprintf(fp_2,"%s%s%s%s%s\n"," if((filep=fopen(w_S, ",d_S,"r",d_S,")) == 
NULL)");
  fprintf(fp_2,"%s%s%s%s%s\n"," { printf(",d_S,"Cant open file %s ! No default 
!\\n",d_S,", w_S);");
  fprintf(fp_2,"%s\n","   return -1; }");
  fprintf(fp_2,"%s\n"," for(i = 0; i <= 21; i++) {");
  fprintf(fp_2,"%s\n","  fgets(keyb__S[i], 8, filep);");
  fprintf(fp_2,"%s\n","  keyb__S[i][strlen(keyb__S[i])-1]='\\0';");
  fprintf(fp_2,"%s\n","  keyq__S[i][0]=1; }");
  fprintf(fp_2,"%s\n"," for(i = 0; i <= 9; i++) {");
  fprintf(fp_2,"%s\n","  keyq__S[i][1]=59+i; }");
  fprintf(fp_2,"%s\n"," keyq__S[10][1]=133; keyq__S[11][1]=134; 
keyq__S[12][1]=82;");
  fprintf(fp_2,"%s\n"," keyq__S[13][1]=71;  keyq__S[14][1]=73;  
keyq__S[15][1]=83;");
  fprintf(fp_2,"%s\n"," keyq__S[16][1]=79;  keyq__S[17][1]=81;  
keyq__S[18][1]=72;");
  fprintf(fp_2,"%s\n"," keyq__S[19][1]=75;  keyq__S[20][1]=80;  
keyq__S[21][1]=77;");
  fprintf(fp_2,"%s\n"," return fclose(filep);");
  fprintf(fp_2,"%s\n","}");
 }
 if(inputff_int == 1)
 {
  /*  Calls: a_S = INPUT("Prompt...",0) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern char *INPUT(const char *a_S, int i)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s%s%s%s%s\n"," if(i == 0) printf(",d_S,"%s",d_S,",a_S);");
  fprintf(fp_2,"%s%s%s%s%s\n"," if(i == 1) printf(",d_S,"%s? ",d_S,",a_S);");
  fprintf(fp_2,"%s\n"," fgets(tws__S,255,stdin);");
  fprintf(fp_2,"%s\n"," tws__S[strlen(tws__S)-1]='\\0';");
  fprintf(fp_2,"%s\n"," return tws__S;");
  fprintf(fp_2,"%s\n","}");
 }
 if(colorff_int == 1)
 {
  /*  Calls: COLOR((int) fg, (int) bg) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern int COLOR(int fg, int bg)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," int col, att;");
  fprintf(fp_2,"%s\n"," char a_S[32];");
  fprintf(fp_2,"%s%s%s%s%s\n"," if (bg>=0) { 
printf(",d_S,"\\033[0;%dm",d_S,",40+(bg % 8));}");
  fprintf(fp_2,"%s%s%s%s%s\n"," else { printf(",d_S,"\\033[0m",d_S,");}");
  fprintf(fp_2,"%s\n"," fg = fg % 32;");
  fprintf(fp_2,"%s%s%s%s%s\n"," if (fg <= 7) { 
printf(",d_S,"\\033[%dm",d_S,",30+fg); }");
  fprintf(fp_2,"%s%s%s%s%s\n"," if ( 7 < fg && fg <= 15) { 
printf(",d_S,"\\033[1;%dm",d_S,",22+fg); }");
  fprintf(fp_2,"%s%s%s%s%s\n"," if (15 < fg && fg <= 23) { 
printf(",d_S,"\\033[5;%dm",d_S,",14+fg); }");
  fprintf(fp_2,"%s%s%s%s%s\n"," if (23 < fg) { 
printf(",d_S,"\\033[1;5;%dm",d_S,",6+fg); }");
  fprintf(fp_2,"%s\n","}");
 }
 if(clsff_int == 1)
 {
  /*  Calls: CLS((int) n_int) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern int CLS(int n)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s\n"," int i;");
  fprintf(fp_2,"%s%s%s%s%s\n"," if (n == 0) 
printf(",d_S,"\\033[2J\\033[H",d_S,");");
  fprintf(fp_2,"%s\n"," if (n == 2)");
  fprintf(fp_2,"%s%s%s%s%s\n"," { printf(",d_S,"\\033[H",d_S,");");
  fprintf(fp_2,"%s%s%s%s%s\n","   for (i=1; i<=24; i++) 
printf(",d_S,"\\033[%d;0;f\\033[K",d_S,",i);");
  fprintf(fp_2,"%s\n"," }");
  fprintf(fp_2,"%s\n","}");
 }
 if(existff_int == 1)
 {
  /*  Calls: EXISTS( file$ ) */
  fprintf(fp_2,"\n");
  fprintf(fp_2,"%s\n","extern int EXISTS(char *file_S)");
  fprintf(fp_2,"%s\n","{");
  fprintf(fp_2,"%s%s%s%s%s\n"," if(fopen(file_S, ",d_S,"r",d_S,") == NULL) 
return 0;");
  fprintf(fp_2,"%s\n"," return 1;");
  fprintf(fp_2,"%s\n","}");
 }

}


/*- User SUB--Start -*/
int quadrix(char  *h_S)
{
/* SHARED: atmp$(), natmp% */

  int  i_int, togfl_int, c_int, L_int, g_int, j_int, k_int, brfl_int;
  char z_S[LMAX], e_S[LMAX];

 /* Converts brackets in used arrays to square brackets. */
 /* Input string h$ is changed at the exit. */
Lab_175:   /* changes Array variable brackets from QB to C convention */
 /* 31000 must be called before, once per SUB (or MAIN) */
 /* hmm.... SUB and SHARED must be executed before; most of the others after */
 /* Improved - it will not change exp( if an array xp( is declared ! */
 sprintf(tws__S,"%s%s"," ",h_S);
 strcpy(h_S,tws__S);
 i_int = 1;
 togfl_int = 0;
 c_int = 0;
 L_int = 0;
 g_int = 0;
      while (i_int < strlen(h_S))
      {
       if (h_S[i_int-1] == 34) togfl_int=1-togfl_int;
       if ((c_int=h_S[i_int-1]) == '(' && togfl_int == 0)
       {
 for(j_int = 1; j_int <= natmp_int; j_int++)
 {
  strcpy(z_S,atmp_S[j_int]);
         L_int = strlen(z_S);
  if(i_int > L_int)
  {
   k_int = i_int - L_int + 1;
   if(strcmp(MID_S(h_S, k_int, L_int), z_S) == 0)
   {
           g_int=0; if(k_int >= 2) g_int = h_S[k_int - 2];
    if(! (g_int > 96 && g_int < 123 || g_int > 64 && g_int < 91))
    {
     /* GOSUB Lab_176 */ 
     if (setjmp(j__buf[j__lev++])==0) goto Lab_176;
    }
   }
  }
 }
       }
       ++i_int;
      }
 gulix(h_S);
 return;

Lab_176:   /* Ugradnja kvadratnih zagrada u polja u izrazima (ne u DIM) */
 /* Ulaz: h$, i%, Izlaz: izmijenjena linija h$ i (eventualno) novi i% */
 sprintf(h_S,"%s%s%s",LEFT_S(h_S, i_int - 1),"[",MID_S(h_S, i_int + 1, LMAX));
 g_int = i_int + 1;
 brfl_int = 1;
 strcpy(e_S,MID_S(h_S, g_int, 1));
 while(brfl_int != 0)
 {
  if(strcmp(e_S, ",") == 0)
  {
   sprintf(h_S,"%s%s%s",LEFT_S(h_S, g_int - 1),"][",MID_S(h_S, g_int + 2, 
LMAX));
   g_int = g_int + 2;
  }
  g_int = g_int + 1;
  strcpy(e_S,MID_S(h_S, g_int, 1));
  if(strcmp(e_S, "(") == 0)
  {
   brfl_int = brfl_int + 1;
  }
  if(strcmp(e_S, ")") == 0)
  {
   brfl_int = brfl_int - 1;
  }
 }
 sprintf(h_S,"%s%s%s",LEFT_S(h_S, g_int - 1),"]",MID_S(h_S, g_int + 1, LMAX));
 /* RETURN */
 longjmp(j__buf[--j__lev],1);
}


/*- User SUB--Start -*/
int sparser(char  *h_S, int   *z_int, char  *bin_S)
{
/* SHARED: nl% */

  int  leng_int, olen_int, i_int, bcnt_int, togfl_int, j_int, j0_int, j1_int, 
typ_int;
  char L_S[LMAX], R_S[LMAX], prt_S[LMAX];

  char c;
 /* finds left and right operands of binary operation 'bin$': */
 /* eg. (a + b) ^ ((a - 1) * 2) */
 /* On input z% is the position where the leftmost character of operator */
 /* appears in h$. Both h$ and z% are changed at the exit, according to bin$. */

 strcpy(L_S,"");
 strcpy(R_S,"");
 strcpy(prt_S,"");
 leng_int = LEN(h_S);
 olen_int = LEN(bin_S);
 /* Left: */
 i_int = *z_int - 1;   /* Bracket & quotes counters */
 bcnt_int = 0;
 togfl_int = 0;
 while(strcmp(MID_S(h_S, i_int, 1), " ") == 0 && i_int >= 1)
 {
  i_int = i_int - 1;
 }
 if(i_int <= 0)
 {
  printf("%s%s%s% d \n","ERROR in parsing math expression: ",h_S," in line 
No",nl_int);
      exit(1);
 }
 j_int = i_int;
     c = h_S[j_int-1];
     if (c == '"') togfl_int = 1 - togfl_int;
     if (c == ')' && togfl_int == 0) bcnt_int++;
     while ((!(c==' ' && bcnt_int==0 || c=='(' && bcnt_int<0) || togfl_int==1) 
&& j_int<=leng_int) {
 j_int = j_int - 1;
 if(j_int == 0)
 {
  goto Lab_197;
 }
      c = h_S[j_int-1];
      if (c == '"') togfl_int = 1 - togfl_int;
 if(togfl_int == 0)
 {
       if (c == ')') bcnt_int++;
       if (c == '(') bcnt_int--;
 }
     }
Lab_197:
 strcpy(L_S,MID_S(h_S, j_int + 1, i_int - j_int));
 j0_int = j_int;
 /* Right: */
 i_int = *z_int + olen_int;   /* Bracket & quotes counters */
 bcnt_int = 0;
 togfl_int = 0;
 while(strcmp(MID_S(h_S, i_int, 1), " ") == 0 && i_int < leng_int)
 {
  i_int = i_int + 1;
 }
 j_int = i_int;
     c = h_S[j_int-1];
     if (c == '"') togfl_int = 1 - togfl_int;
     if (c == '(') bcnt_int++;
     while ((!(c==' ' && bcnt_int==0 || c==')' && bcnt_int<0) || togfl_int==1) 
&& j_int<=leng_int) {
 j_int = j_int + 1;
      c = h_S[j_int-1];
      if (c == '"') togfl_int = 1 - togfl_int;
 if(togfl_int == 0)
 {
       if (c == '(') bcnt_int++;
       if (c == ')') bcnt_int--;
 }
     }
 strcpy(R_S,MID_S(h_S, i_int, j_int - i_int));
 j1_int = j_int;

 /* math ^ */
 if(strcmp(bin_S, "^") == 0)
 {
  sprintf(prt_S,"%s%s%s%s%s","pow(",L_S,",",R_S,")");
  sprintf(h_S,"%s%s%s",LEFT_S(h_S, j0_int),prt_S,RIGHT_S(h_S, leng_int - j1_int 
+ 1));
  *z_int = j0_int + LEN(prt_S);
  goto Lab_199;
 }

 /* logical = */
 if(strcmp(bin_S, "=") == 0)
 {
  vartyp(L_S, &typ_int);
  if(typ_int == 7)
  {
   printf("%s% d \n","ERROR in line No",nl_int);
   printf("%s%s\n","string expressions not (yet) allowed in logical: ",h_S);
       exit(1);
  }
  if(typ_int == 5 || typ_int == 15)
  {
   sprintf(h_S,"%s%s%s%s%s%s%s",LEFT_S(h_S, j0_int),"strcmp(",L_S,", ",R_S,") 
== 0",RIGHT_S(h_S, leng_int - j1_int + 1));
   *z_int = *z_int + 14 + LEN(R_S);
  }
  else
  {
   sprintf(h_S,"%s%s%s",LEFT_S(h_S, *z_int - 1),"==",RIGHT_S(h_S, leng_int - 
*z_int));
   *z_int = *z_int + 1;
  }
  goto Lab_199;
 }

 /* logical <> */
 if(strcmp(bin_S, "<>") == 0)
 {
  vartyp(L_S, &typ_int);
  if(typ_int == 7)
  {
   printf("%s% d \n","ERROR in line No",nl_int);
   printf("%s%s\n","string expressions not (yet) allowed in logical: ",h_S);
       exit(1);
  }
  if(typ_int == 5 || typ_int == 15)
  {
   sprintf(h_S,"%s%s%s%s%s%s%s",LEFT_S(h_S, j0_int),"strcmp(",L_S,", ",R_S,") 
!= 0",RIGHT_S(h_S, leng_int - j1_int + 1));
   *z_int = *z_int + 14 + LEN(R_S);
  }
  else
  {
   sprintf(h_S,"%s%s%s",LEFT_S(h_S, *z_int - 1),"!=",RIGHT_S(h_S, leng_int - 
*z_int - 1));
   *z_int = *z_int + 1;
  }
  goto Lab_199;
 }

 if(strcmp(bin_S, "MOD") == 0)
 {
  sprintf(prt_S,"%s%s%s%s%s","((int)(.5+",L_S,")) % ((int)(.5+",R_S,"))");
  sprintf(h_S,"%s%s%s",LEFT_S(h_S, j0_int),prt_S,RIGHT_S(h_S, leng_int - j1_int 
+ 1));
  *z_int = j0_int + LEN(prt_S);
  goto Lab_199;
 }

Lab_199:   /* End sparser */
;}


/*- User SUB--Start -*/
int splitdec(char  *varlist_S, int   *ntok_int, int   *dn_int)
{
/* SHARED: tmp$() */

  int  maxl_int, i_int, n_int, lb_int;
  char b_S[LMAX];

 /* Split too long declaration lines into pieces not longer than maxl% chars */
 /* Declaration lines are strings of tokens delimited by "," */
 maxl_int = 64;
 i_int = 1;
 *ntok_int = 0;
 *dn_int = *dn_int + 2;
 if(LEN(varlist_S) > maxl_int)
 {
  tokenix(varlist_S, &n_int, ",", "");
Lab_119:
  strcpy(b_S,"");
  lb_int = *dn_int;
  while(lb_int + LEN(tmp_S[i_int]) <= maxl_int && i_int <= n_int)
  {
   sprintf(tws__S,"%s%s%s",b_S,", ",tmp_S[i_int]);
   strcpy(b_S,tws__S);
   lb_int = lb_int + LEN(tmp_S[i_int]) + *dn_int;
   i_int = i_int + 1;
  }
  *ntok_int = *ntok_int + 1;
  strcpy(tmp_S[*ntok_int],MID_S(b_S, 3, LEN(b_S) - 2));
  if(i_int <= n_int)
  {
   goto Lab_119;
  }
 }
 else
 {
  *ntok_int = 1;
  strcpy(tmp_S[1],varlist_S);
 }
}


/*- User SUB--Start -*/
int stringx(char  *h_S)
{
  int  i_int, togfl_int, leng_int;
  char b_S[LMAX];

 /* String constants pretprocessor "...\.." --> "...\\..." */
 /* Called from the following processors/translators: */
 /* DO WHILE, WHILE, IF.., PRINT, PRINT #, INPUT, exp */
 i_int = 1;
 togfl_int = 0;
 leng_int = LEN(h_S);
 while(i_int <= leng_int - 1)
 {
  strcpy(b_S,MID_S(h_S, i_int, 1));
  if(ASC(b_S) == 34)
  {
   togfl_int = 1 - togfl_int;
   goto Lab_191;
  }
  if(strcmp(b_S, "\\") == 0)
  {
   sprintf(h_S,"%s%s%s",LEFT_S(h_S, i_int),"\\",RIGHT_S(h_S, leng_int - i_int));
   leng_int = 1 + leng_int;
   i_int = 1 + i_int;
  }
Lab_191:
  i_int = 1 + i_int;
 }
}


/*- User SUB--Start -*/
int tokenix(char  *h_S, int   *ntok_int, char  *sep_S, char  *sep2_S)
{
/* SHARED: tmp$() */

  int  brfl_int, togfl_int, leng_int, i_int, j_int;
  char z_S[LMAX], b_S[LMAX];

      char b;
 /*   Tokenizes h$ with respect to separators sep$, sep2$. */
 /*   Returns list of ntok% bare (gulix !) tokens in tmp$(), h$ unchanged. */
 *ntok_int = 0;
 brfl_int = 0;
 togfl_int = 0;
 sprintf(z_S,"%s%s",h_S,sep_S);
 leng_int = LEN(z_S);
 strcpy(b_S,"");
 if(strcmp(h_S, "") == 0)
 {
  goto Lab_169;
 }
 i_int = 0;
 j_int = 1;
      while (i_int < leng_int)
      {
       b = z_S[i_int];
       if (b == 34) { togfl_int = 1 - togfl_int; goto Lab_168; }
       if (! togfl_int)
       {
        if (b == '(') { brfl_int++; goto Lab_168; }
        if (b == ')') { brfl_int--; goto Lab_168; }
       }
       if((b==sep_S[0] || b==sep2_S[0]) && !brfl_int && !togfl_int)
       {
 if(i_int + 1 - j_int > 0)
 {
  strcpy(b_S,MID_S(z_S, j_int, i_int + 1 - j_int));
  gulix(b_S);
  *ntok_int = *ntok_int + 1;
  strcpy(tmp_S[*ntok_int],b_S);
  if(*ntok_int > TMAX)
  {
   printf("%s\n","qb2c: tokenix: Dimension of tmp$() too small. Enlarge TMAX 
and recompile qb2c!");
          exit(1);
  }
 }
 j_int = i_int + 2;
       }
Lab_168:
 i_int = i_int + 1;
      }
Lab_169:
;}


/*- User SUB--Start -*/
int varpost(char  *line_S)
{
/* SHARED: stripff% */

  int  lleng_int, i_int, togfl_int, tmpfl_int, g_int, brcnt_int, n_int;
  char z_S[LMAX], d_S[LMAX];

   char b_S[10], b, c, t;
 /* (post)processing i% -> i_int, i& -> i_long, c$ -> c_S */
 /* and array brackets (except in declarations which is done). */
 /* Also handles MID$(a$,i%) -> MID_S(a_S,i_int,LMAX) */
 /* This works a line at the time: line$ is input and output */
       t = 32;
 lleng_int = LEN(line_S);
 i_int = 1;
 togfl_int = 0;
 tmpfl_int = 0;
 while(i_int <= lleng_int)
 {
  strcpy(z_S,MID_S(line_S, i_int, 2));
        b = line_S[i_int-1];
        if (b == 34) togfl_int = 1 - togfl_int;
  if(togfl_int == 0)
  {
         if (strncmp(&line_S[i_int-1],"/*",2)==0) { tmpfl_int=1; goto Lab_205;}
         if (strncmp(&line_S[i_int-1],"*/",2)==0) { tmpfl_int=0; goto Lab_205;}
  }
  if(togfl_int == 0 && tmpfl_int == 0)
  {
         if (b=='$')
         {
          if (i_int >= 4)
          {
   if(strcmp(MID_S(line_S, i_int - 3, 4), "MID$") == 0)
   {
    g_int = i_int + 2;
    brcnt_int = 1;
            while (brcnt_int > 0)
            {
             c = line_S[g_int];
             g_int++;
             if (c == '(') brcnt_int++;
             if (c == ')') brcnt_int--;
            }
    strcpy(d_S,MID_S(line_S, i_int + 2, g_int - i_int - 2));
    tokenix(d_S, &n_int, ",", "");
    if(n_int == 2)
    {
     sprintf(line_S,"%s%s%s%s%s",LEFT_S(line_S, i_int - 1),"_S(",d_S,", 
LMAX",MID_S(line_S, g_int, LMAX));
     lleng_int = lleng_int + 7;
     i_int = i_int + 1;
     goto Lab_205;
    }
    else
    {
     sprintf(line_S,"%s%s%s",LEFT_S(line_S, i_int - 1),"_S",MID_S(line_S, i_int 
+ 1, LMAX));
     lleng_int = lleng_int + 1;
     i_int = i_int + 1;
     goto Lab_205;
    }
   }
   else
   {
    sprintf(line_S,"%s%s%s",LEFT_S(line_S, i_int - 1),"_S",MID_S(line_S, i_int 
+ 1, LMAX));
    lleng_int = lleng_int + 1;
    i_int = i_int + 1;
    goto Lab_205;
   }
          }
          else
          {
   sprintf(line_S,"%s%s%s",LEFT_S(line_S, i_int - 1),"_S",MID_S(line_S, i_int + 
1, LMAX));
   lleng_int = lleng_int + 1;
   i_int = i_int + 1;
   goto Lab_205;
          }
         }
         if( 95<=t && t<=122 || 65<=t && t<=90 || 48<=t && t<=57)
         {
          if (b=='%')
          {
           b_S[0]='\0'; c=-1; if(stripff_int==0) {strcpy(b_S,"_int"); c=3;}
           line_S[i_int-1]='\0'; strcpy(tws__S, line_S); strcat(tws__S, b_S);
           strcat(tws__S, &line_S[i_int]); strcpy(line_S, tws__S);
           lleng_int = lleng_int + c; i_int = i_int + c;
   goto Lab_205;
          }
          else
          {
           if ( b=='&' )
           {
            b_S[0]='\0'; c=-1; if(stripff_int==0) {strcpy(b_S,"_long"); c=4;}
   sprintf(line_S,"%s%s%s",LEFT_S(line_S, i_int - 1),b_S,MID_S(line_S, i_int + 
1, LMAX));
            lleng_int = lleng_int + c; i_int = i_int + c;
   goto Lab_205;
           }
           else
           {
            if ( b=='#' )
            {
             b_S[0]='\0'; c=-1; if(stripff_int==0) {strcpy(b_S,"_double"); c=6;}
   sprintf(line_S,"%s%s%s",LEFT_S(line_S, i_int - 1),b_S,MID_S(line_S, i_int + 
1, LMAX));
             lleng_int = lleng_int + c; i_int = i_int + c;
   goto Lab_205;
            }
            else
            {
             if ( b=='?' )
             {
              b_S[0]='\0'; c=-1; if(stripff_int==0) {strcpy(b_S,"_byte"); c=4;}
   sprintf(line_S,"%s%s%s",LEFT_S(line_S, i_int - 1),b_S,MID_S(line_S, i_int + 
1, LMAX));
              lleng_int = lleng_int + c; i_int = i_int + c;
   goto Lab_205;
             }
            }
           }
          }
         }
  }
Lab_205:
       t = b; i_int++;
 }
}


/*- User SUB--Start -*/
int vartyp(char  *tok_S, int   *ttyp_int)
{
/* SHARED: intflg%, Dflg%, doblflg%, longflg%, constfl%, tcnst$(), ncnst% */

  int  ad_int, leng_int, ilog_int, jlog_int, i_int, expf_int, strf_int, 
brfl_int, togfl_int;

   static char cx, b;
 /* Determins the type 'ttyp%' of the token being variable or array: */
 /* Takes into account 'intflg%' and 'longflg%' flags. */
 /* Constants (eg 321.) are either typ%=2 (no decimal dot) or typ%=4. */
 /* constfl% = 1 => it is a constant of a given type. */
 /* ttyp% = 0 => undecided. */
 /* tok$ must be ran through 'gulix'. */
 /*         1 => int */
 /*         2 => long */
 /*         3 => float */
 /*         4 => double */
 /*         5 => string */
 /*         6 => numerical expression */
 /*         7 => string expression */
 /*         8 => byte (unsigned char) */
 /*        10 => array of short int (2 byte) or function */
 /*        11 => array of int     or function */
 /*        12 => array of long    or function */
 /*        13 => array of float   or function */
 /*        14 => array of double  or function */
 /*        15 => array of strings or function */
 /*        18 => array of bytes (unsigned chars) */
 /*        20 => declared CONSTant number */
 /*        25 => declared CONSTant string  NOT YET */
 /* variable types when intflg% or Dflg% flag set */
 /* -i: i,j,k,l,m,n  (upper or lower case, if not $) are implicit 'int' type */
 /* -d: d (upper or lower case, if not $) are implicit 'double' type */
 /* sorting variable types (default): */
 *ttyp_int = 0;
 constfl_int = 0;
 ad_int = 0;
 leng_int = LEN(tok_S);
 ilog_int = 0;   /* For -c or -d flags set */
 jlog_int = 0;
 if(leng_int == 0)
 {
  goto Lab_149;
 }
 for(i_int = 1; i_int <= ncnst_int; i_int++)
 {
  if(strcmp(tok_S, tcnst_S[i_int]) == 0)
  {
   *ttyp_int = 20;
   goto Lab_149;
  }
 }
 /* Test for expression: */
 expf_int = 0;
 strf_int = 0;
 brfl_int = 0;
 togfl_int = 0;
 if(leng_int == 1)
 {
  goto Lab_147;
 }
 for(i_int = 1; i_int <= leng_int; i_int++)
 {
      cx = tok_S[i_int - 1];
      if (cx == 34) togfl_int = 1 - togfl_int;
  if(togfl_int == 0)
  {
       if ( cx == '(' ) brfl_int = brfl_int + 1;
       if ( cx == ')' ) brfl_int = brfl_int - 1;
  }
  if(brfl_int == 0 && togfl_int == 0)
  {
       if (cx == '$') strf_int = 1;
       if ( cx == 34 ) { strf_int = 1; constfl_int = 1; }
       if ( cx == 32 ) expf_int =1;
       if ( cx == '+') expf_int =1;
  }
 }
 if(expf_int == 1 && strf_int == 0)
 {
  *ttyp_int = 6;
  goto Lab_149;
 }
 if(expf_int == 1 && strf_int == 1)
 {
  *ttyp_int = 7;
  goto Lab_149;
 }
Lab_147:
 if(VAL(tok_S) != 0 || strcmp(LEFT_S(tok_S, 1), "0") == 0)
 {
  constfl_int = 1;
  i_int = 1;
     cx = tok_S[0];
     while ( cx != '.' && cx != '!' && i_int < leng_int )
     {
      i_int++;
      cx = tok_S[i_int - 1];
     }
     if (cx == '.')
     {
       *ttyp_int = 3;
     }
     else
     {
      if (cx == '!')
      {
       *ttyp_int = 3;
       tok_S[i_int - 1] = '.';
      }
      else
      {
       *ttyp_int = 1;
      }
     }
  goto Lab_149;
 }
Lab_146:
    cx = tok_S[leng_int-1];
    if (cx == ')')
    {
 i_int = 1;
 ad_int = 10;
     while (tok_S[i_int] != '(') i_int++;
     cx = tok_S[i_int - 1];
    }
 if(intflg_int == 1)
 {
     b = tok_S[0];
     if((b >= 105 && b <= 110 || b >= 73 && b <= 78) && cx != '&' && cx != '$')
     {
  ilog_int = 1;
     }
 }
 if(Dflg_int == 1)
 {
     if (tok_S[0] == 68 || tok_S[0] == 100)
     {
  jlog_int = 1;
     }
 }
    if (cx == '%' || ilog_int == 1)
    {
 *ttyp_int = 1;
     if (ad_int == 10 && i_int >= 2 && tok_S[i_int-2] == '_') *ttyp_int = 0;
    }
    else
    {
     if (cx == '$' || cx == 34)
     {
 *ttyp_int = 5;
     }
     else
     {
      if (cx == '&')
      {
 *ttyp_int = 2;
      }
      else
      {
       if (cx == '?')
       {
 *ttyp_int = 8;
       }
       else
       {
        if (cx == '#' || jlog_int == 1)
        {
 *ttyp_int = 4;
        }
        else
        {
 *ttyp_int = 3;
        }
       }
      }
     }
    }
 *ttyp_int = *ttyp_int + ad_int;
 if(*ttyp_int == 13)
 {
     if (strncmp(tok_S,"LEN(",4)==0 || strncmp(tok_S,"ASC(",4)==0 || 
strncmp(tok_S,"EOF(",4)==0) *ttyp_int=11;
     if (strncmp(tok_S,"Int(",4)==0 || strncmp(tok_S,"Nint(",5)==0) 
*ttyp_int=12;
 }
 if(*ttyp_int == 3)
 {
  /*  IF tok$ = "TIMER" THEN ttyp% = 13: Sredjeno u 650 */
  if(strcmp(tok_S, "RND") == 0)
  {
   *ttyp_int = 14;
  }
 }
 if(longflg_int == 1)
 {
     switch(*ttyp_int) {
          case  1: *ttyp_int = 2;
                   break;
          case 11: *ttyp_int =12;
                   break;
     }
 }
 if(doblflg_int == 1)
 {
     switch(*ttyp_int) {
          case  3: *ttyp_int = 4;
                   break;
          case 13: *ttyp_int =14;
                   break;
     }
 }
Lab_149:   /* End vartyp */
;}
/*- User SUBs--End -*/

/* Translates of used QB's intrinsic functions: */

extern char *SPACE_S(int n)
{
 int i;

 if (++j__S == 32) j__S=0;
 if (n < 0) n = 0;
 strcpy(w__S[j__S],"");
 for(i = 1; i <= n; i++)
 {
  strcat(w__S[j__S]," ");
 }
 return w__S[j__S];
}

extern char *MID_S(char *a_S, int start, int length)
{

 if (++j__S == 32) j__S=0;
 if(length < 0) { 
  printf("Error: in MID_S: length < 0\n");
  exit(0); }
 if(start  < 0) {
  printf("Error: in MID_S: start < 1\n");
  exit(0); }
 if(start > strlen(a_S)) 
 { w__S[j__S][0]='\0'; }
 else
 { strncpy(w__S[j__S], &a_S[start-1], length);
   w__S[j__S][length]='\0'; }

 return w__S[j__S];
}

extern char *LEFT_S(char *a_S, int length)
{

 if (++j__S == 32) j__S=0;
 if(length < 0) { 
  printf("Error in LEFT$: length < 0 string=%s length=%d\n", a_S, length); 
length=0;
 }
 strncpy(w__S[j__S], a_S, length);
 w__S[j__S][length]='\0';

 return w__S[j__S];
}

extern char *RIGHT_S(char *a_S, int length)
{
 int  start;

 if (++j__S == 32) j__S=0;
 if ((start = strlen(a_S) - length) < 0) start = 0;
 if (length < 0) {
  printf("Error in LEFT$: length < 0 string=%s length=%d\n", a_S, length); 
length=0;
 }
 strncpy(w__S[j__S], &a_S[start], length);
 w__S[j__S][length]='\0';

 return w__S[j__S];
}

extern char *STR_S(double d)
{

 if (++j__S == 32) j__S=0;
 sprintf(w__S[j__S],"% G",d);
 return w__S[j__S];
}

extern char *CHR_S(int i)
{

 if (++j__S == 32) j__S=0;
 w__S[j__S][0]=i;
 w__S[j__S][1]='\0';
 return w__S[j__S];
}

extern long ASC(char *c_S)
{
 if (++i__l == 32) i__l=0;
 if((w__l[i__l]=c_S[0]) < 0) w__l[i__l]=256+w__l[i__l];
 return w__l[i__l];
}

extern double VAL(char *a_S)
{
 if (++i__d == 32) i__d = 0;
 w__d[i__d] = atof(a_S);
 return w__d[i__d];
}

extern int LEN(char *a_S)
{
 if (++i__d == 32) i__d = 0;
 w__d[i__d] = strlen(a_S);
 return w__d[i__d];
}

extern int eof(FILE *stream)
{
 static int c, istat;

 istat=((c=fgetc(stream))==EOF);
 ungetc(c,stream);
 return istat; 
}

extern char *COMMAND_S(int n_arg_int, char *argv_S[])
{
 int i;

 if (++j__S == 32) j__S=0;
 for(i = 1; i <= n_arg_int; i++)
 {
  strcat(w__S[j__S],argv_S[i]);
  strcat(w__S[j__S]," ");
 }
 w__S[j__S][strlen(w__S[j__S])-1]='\0';
 return w__S[j__S];
}

extern double DBL(double d)
{
 if (++i__d == 32) i__d = 0;
 w__d[i__d] = d;
 return w__d[i__d];
}

extern void RANDOMIZE(long n)
{
 srand(n % 65536);
}

extern double TIMER()
{
 struct timeval tv;
 struct timezone tz;

 gettimeofday(&tv, &tz);
 return ((tv.tv_sec % 86400)+tv.tv_usec/(double)1000000);
}

extern char *TIME_S(int i)
{
 static struct tm *tp;
 long elapse_time;

 if (++j__S == 32) j__S=0;
 time(&elapse_time);
 tp=localtime(&elapse_time);
 strftime(w__S[j__S],LMAX,"%H:%M:%S",tp);
 return w__S[j__S];
}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]