int main()
{
	TEST1();
	TEST2();
	TEST2();
	TEST3();
	TEST4();
	TEST5();
	TEST6();
	TEST7();
	TEST8();
	TEST9();

	TEST10();
	TEST11();
	TEST12();
	TEST12();
	TEST13();
	TEST14();
	TEST15();
	TEST16();
	TEST17();
	TEST18();
	TEST19();

	TEST20();
	TEST21();
	TEST22();
	TEST22();
	TEST23();
	TEST24();
	TEST25();
	TEST26();
	TEST27();
	TEST28();
	TEST29();

	TEST30();
	TEST31();
	TEST32();
	TEST32();
	TEST33();
	TEST34();
	TEST35();
	TEST36();
	TEST37();
	TEST38();
	TEST39();

	return 0;
}
int main()
{
   logical_op op;
   int i;
   init_reg_val2();
   for (op = AND; op <= XORI; op++) {
      for (i = 0; i < N; i++) {
         switch (op) {
            case AND:
               /* No Integer Overflow exception occurs under any
                  circumstances. */
               TEST1("and $t0, $t1, $t2", reg_val1[i], reg_val1[N-i-1],
                                          t0, t1, t2);
               TEST1("and $s0, $s1, $s2", reg_val2[i], reg_val2[N-i-1],
                                          s0, s1, s2);
               break;

            case ANDI:
               /* No Integer Overflow exception occurs under any
                  circumstances. */
               TEST2("andi $t0, $t1, 0xff",   reg_val1[i], 0xff,   t0, t1);
               TEST2("andi $t2, $t3, 0xffff", reg_val1[i], 0xffff, t2, t3);
               TEST2("andi $a0, $a1, 0x0",    reg_val1[i], 0x0,    a0, a1);
               TEST2("andi $s0, $s1, 0x23",   reg_val1[i], 0x23,   s0, s1);
               TEST2("andi $t0, $t1, 0xff",   reg_val2[i], 0xff,   t0, t1);
               TEST2("andi $t2, $t3, 0xffff", reg_val2[i], 0xffff, t2, t3);
               TEST2("andi $a0, $a1, 0x0",    reg_val2[i], 0x0,    a0, a1);
               TEST2("andi $s0, $s1, 0x23",   reg_val2[i], 0x23,   s0, s1);
               break;

            case LUI:
               /* No Integer Overflow exception occurs under any
                  circumstances. */
               if (i == 0) {
                  TEST6("lui $t0, 0xffff", 0xffff, t0);
                  TEST6("lui $a0, 0x0",    0x0,    a0);
                  TEST6("lui $t9, 0xff",   0xff,   t9);
                  TEST6("lui $v0, 0xfff",  0xfff,  v0);
                  TEST6("lui $s0, 0x2",    0x2,    s0);
               }
               break;

            case NOR:
               /* No arithmetic exception occurs under any circumstances. */
               TEST1("nor $t0, $t1, $t2", reg_val1[i], reg_val1[N-i-1],
                                          t0, t1, t2);
               TEST1("nor $s0, $s1, $s2", reg_val2[i], reg_val2[N-i-1],
                                          s0, s1, s2);
               break;

            case OR:
               /* No arithmetic exception occurs under any circumstances. */
               TEST1("or $t0, $t1, $t2", reg_val1[i], reg_val1[N-i-1],
                                         t0, t1, t2);
               TEST1("or $s0, $s1, $s2", reg_val2[i], reg_val2[N-i-1],
                                         s0, s1, s2);
               break;

            case ORI:
               /* No arithmetic exception occurs under any circumstances. */
               TEST2("ori $t0, $t1, 0xff",   reg_val1[i], 0xff,   t0, t1);
               TEST2("ori $t2, $t3, 0xffff", reg_val1[i], 0xffff, t2, t3);
               TEST2("ori $a0, $a1, 0x0",    reg_val1[i], 0x0,    a0, a1);
               TEST2("ori $s0, $s1, 0x23",   reg_val1[i], 0x23,   s0, s1);
               TEST2("ori $t0, $t1, 0xff",   reg_val2[i], 0xff,   t0, t1);
               TEST2("ori $t2, $t3, 0xffff", reg_val2[i], 0xffff, t2, t3);
               TEST2("ori $a0, $a1, 0x0",    reg_val2[i], 0x0,    a0, a1);
               TEST2("ori $s0, $s1, 0x23",   reg_val2[i], 0x23,   s0, s1);
               break;

            case XOR:
               /* No arithmetic exception occurs under any circumstances. */
               TEST1("xor $t0, $t1, $t2", reg_val1[i], reg_val1[N-i-1],
                                          t0, t1, t2);
               TEST1("xor $s0, $s1, $s2", reg_val2[i], reg_val2[N-i-1],
                                          s0, s1, s2);
               break;

            case XORI:
               /* No arithmetic exception occurs under any circumstances. */
               TEST2("xori $t0, $t1, 0xff",   reg_val1[i], 0xff,   t0, t1);
               TEST2("xori $t2, $t3, 0xffff", reg_val1[i], 0xffff, t2, t3);
               TEST2("xori $a0, $a1, 0x0",    reg_val1[i], 0x0,    a0, a1);
               TEST2("xori $s0, $s1, 0x23",   reg_val1[i], 0x23,   s0, s1);
               TEST2("xori $t0, $t1, 0xff",   reg_val2[i], 0xff,   t0, t1);
               TEST2("xori $t2, $t3, 0xffff", reg_val2[i], 0xffff, t2, t3);
               TEST2("xori $a0, $a1, 0x0",    reg_val2[i], 0x0,    a0, a1);
               TEST2("xori $s0, $s1, 0x23",   reg_val2[i], 0x23,   s0, s1);
               break;
         }
      }
   }
   return 0;
}