#include <perms.h>

//          Edinburgh IMP77 Compiler - Version 8.4
//
//     1  %begin

int main(int argc, char **argv) { /*%begin*/
  _imp_initialise(argc, argv);

  //     2    %byteinteger bi1

  unsigned char BI1;

  //     3    %shortinteger si1

  short int SI1;

  //     4    %integer i1

  int I1;

  //     5    %longinteger li1

  long int LI1;

  //     6    %real r1

  float R1;

  //     7    %longreal lr1

  double LR1;

  //     8    %string (15) s15 1

  _imp_string15 S151;

  //     9    %string (255) s255 1

  _imp_string255 S2551;

  //    10
  //    11    %byteinteger bi

  unsigned char BI;

  //    12    %shortinteger si

  short int SI;

  //    13    %integer i

  int I;

  //    14    %longinteger li

  long int LI;

  //    15    %real r

  float R;

  //    16    %longreal lr

  double LR;

  //    17    %string (15) s15

  _imp_string15 S15;

  //    18    %string (255) s255

  _imp_string255 S255;

  //    19
  //    20    %byteinteger bi2

  unsigned char BI2;

  //    21    %shortinteger si2

  short int SI2;

  //    22    %integer i2

  int I2;

  //    23    %longinteger li2

  long int LI2;

  //    24    %real r2

  float R2;

  //    25    %longreal lr2

  double LR2;

  //    26    %string (15) s15 2

  _imp_string15 S152;

  //    27    %string (255) s255 2

  _imp_string255 S2552;

  //    28
  //    29    ! First set of tests are where all 3 values are of the same type.
  //    30
  //    31    %if bi1 <= bi <= bi2 %start

  {
// Double-sided test on BI (Part I)
    unsigned char tmp;
    if (BI1 > (tmp = BI)) goto L_0001;
// Double-sided test on BI (Part II)
    if (tmp > BI2) goto L_0001;
  }

  //    32    %else %if si1 <= si <= si2

  goto L_0002;
L_0001:;
  {
// Double-sided test on SI (Part I)
    short int tmp;
    if (SI1 > (tmp = SI)) goto L_0003;
// Double-sided test on SI (Part II)
    if (tmp > SI2) goto L_0003;
  }

  //    33    %else %if i1 <= i <= i2

  goto L_0002;
L_0003:;
  {
// Double-sided test on I (Part I)
    int tmp;
    if (I1 > (tmp = I)) goto L_0004;
// Double-sided test on I (Part II)
    if (tmp > I2) goto L_0004;
  }

  //    34    %else %if li1 <= li <= li2

  goto L_0002;
L_0004:;
  {
// Double-sided test on LI (Part I)
    long long int tmp;
    if (LI1 > (tmp = LI)) goto L_0005;
// Double-sided test on LI (Part II)
    if (tmp > LI2) goto L_0005;
  }

  //    35    %else %if r1 <= r <= r2

  goto L_0002;
L_0005:;
  {
// Double-sided test on R (Part I)
    float tmp;
    if (R1 > (tmp = R)) goto L_0006;
// Double-sided test on R (Part II)
    if (tmp > R2) goto L_0006;
  }

  //    36    %else %if lr1 <= lr <= lr2

  goto L_0002;
L_0006:;
  {
// Double-sided test on LR (Part I)
    double tmp;
    if (LR1 > (tmp = LR)) goto L_0007;
// Double-sided test on LR (Part II)
    if (tmp > LR2) goto L_0007;
  }

  //    37    %else %if s15 1 <= s15 <= s15 2

  goto L_0002;
L_0007:;
  {
// Double-sided test on S15 (Part I)
    _imp_string15 *tmp;

    if (_imp_strcmp((_imp_string *)/*?*/ &S151, (_imp_string *)(tmp = /*?*/ &S15)) > 0) goto L_0008;

// Double-sided test on S15 (Part II)
    if (_imp_strcmp((_imp_string *)tmp, (_imp_string *)/*?*/ &S152) > 0) goto L_0008;
  }

  //    38    %else %if s255 1 <= s255 <= s255 2

  goto L_0002;
L_0008:;
  {
// Double-sided test on S255 (Part I)
    _imp_string255 *tmp;

    if (_imp_strcmp((_imp_string *)/*?*/ &S2551, (_imp_string *)(tmp = /*?*/ &S255)) > 0) goto L_0009;

// Double-sided test on S255 (Part II)
    if (_imp_strcmp((_imp_string *)tmp, (_imp_string *)/*?*/ &S2552) > 0) goto L_0009;
  }

  //    39    %else %if s255 1 <= s15 <= s255 2

  goto L_0002;
L_0009:;
  {
// Double-sided test on S15 (Part I)
    _imp_string15 *tmp;

    if (_imp_strcmp((_imp_string *)/*?*/ &S2551, (_imp_string *)(tmp = /*?*/ &S15)) > 0) goto L_000A;

// Double-sided test on S15 (Part II)
    if (_imp_strcmp((_imp_string *)tmp, (_imp_string *)/*?*/ &S2552) > 0) goto L_000A;
  }

  //    40    %else

  goto L_0002;
L_000A:;

//    41    %finish

L_0002:;

//    42
//    43  %endofprogram

  _imp_stop(0);
  return 0;
end_0:;
}