import java.io.File;
import java.io.IOException;
import java.io.OutputStream;

public class Class233 implements Runnable {

   Thread aThread2674;
   IOException anIOException2675;
   int anInt2676;
   byte[] aByteArray2677;
   int anInt2678 = 0;
   int anInt2679 = 0;
   boolean aBool2680;
   OutputStream anOutputStream2681;
   static Class117 aClass117_2682;


   public void run() {
      do {
         int var2;
         synchronized(this) {
            while(true) {
               if(this.anIOException2675 != null) {
                  return;
               }

               if(this.anInt2678 * 790860467 <= -1172691841 * this.anInt2679) {
                  var2 = -1172691841 * this.anInt2679 - 790860467 * this.anInt2678;
               } else {
                  var2 = -466347091 * this.anInt2676 - 790860467 * this.anInt2678 + -1172691841 * this.anInt2679;
               }

               if(var2 > 0) {
                  break;
               }

               try {
                  this.anOutputStream2681.flush();
               } catch (IOException var10) {
                  this.anIOException2675 = var10;
                  return;
               }

               if(this.method4023(1828843566)) {
                  return;
               }

               try {
                  this.wait();
               } catch (InterruptedException var11) {
                  ;
               }
            }
         }

         try {
            if(var2 + 790860467 * this.anInt2678 <= -466347091 * this.anInt2676) {
               this.anOutputStream2681.write(this.aByteArray2677, 790860467 * this.anInt2678, var2);
            } else {
               int var13 = -466347091 * this.anInt2676 - 790860467 * this.anInt2678;
               this.anOutputStream2681.write(this.aByteArray2677, 790860467 * this.anInt2678, var13);
               this.anOutputStream2681.write(this.aByteArray2677, 0, var2 - var13);
            }
         } catch (IOException var9) {
            IOException var1 = var9;
            synchronized(this) {
               this.anIOException2675 = var1;
               return;
            }
         }

         synchronized(this) {
            this.anInt2678 = 1718054011 * ((var2 + this.anInt2678 * 790860467) % (this.anInt2676 * -466347091));
         }
      } while(!this.method4023(1609285117));

   }

   boolean method4023(int var1) {
      if(this.aBool2680) {
         try {
            this.anOutputStream2681.close();
            if(null == this.anIOException2675) {
               this.anIOException2675 = new IOException("");
            }
         } catch (IOException var3) {
            if(this.anIOException2675 == null) {
               this.anIOException2675 = new IOException(var3);
            }
         }

         return true;
      } else {
         return false;
      }
   }

   void method4024(byte[] var1, int var2, int var3) throws IOException {
      if(var3 >= 0 && var2 >= 0 && var2 + var3 <= var1.length) {
         synchronized(this) {
            if(null != this.anIOException2675) {
               throw new IOException(this.anIOException2675.toString());
            } else {
               int var5;
               if(790860467 * this.anInt2678 <= this.anInt2679 * -1172691841) {
                  var5 = this.anInt2676 * -466347091 - -1172691841 * this.anInt2679 + this.anInt2678 * 790860467 - 1;
               } else {
                  var5 = this.anInt2678 * 790860467 - this.anInt2679 * -1172691841 - 1;
               }

               if(var5 < var3) {
                  throw new IOException("");
               } else {
                  if(-1172691841 * this.anInt2679 + var3 <= -466347091 * this.anInt2676) {
                     System.arraycopy(var1, var2, this.aByteArray2677, -1172691841 * this.anInt2679, var3);
                  } else {
                     int var6 = -466347091 * this.anInt2676 - -1172691841 * this.anInt2679;
                     System.arraycopy(var1, var2, this.aByteArray2677, this.anInt2679 * -1172691841, var6);
                     System.arraycopy(var1, var6 + var2, this.aByteArray2677, 0, var3 - var6);
                  }

                  this.anInt2679 = (-1172691841 * this.anInt2679 + var3) % (this.anInt2676 * -466347091) * 1402051455;
                  this.notifyAll();
               }
            }
         }
      } else {
         throw new IOException();
      }
   }

   void method4025(byte[] var1, int var2, int var3, short var4) throws IOException {
      if(var3 >= 0 && var2 >= 0 && var2 + var3 <= var1.length) {
         synchronized(this) {
            if(null != this.anIOException2675) {
               throw new IOException(this.anIOException2675.toString());
            } else {
               int var6;
               if(790860467 * this.anInt2678 <= this.anInt2679 * -1172691841) {
                  var6 = this.anInt2676 * -466347091 - -1172691841 * this.anInt2679 + this.anInt2678 * 790860467 - 1;
               } else {
                  var6 = this.anInt2678 * 790860467 - this.anInt2679 * -1172691841 - 1;
               }

               if(var6 < var3) {
                  throw new IOException("");
               } else {
                  if(-1172691841 * this.anInt2679 + var3 <= -466347091 * this.anInt2676) {
                     System.arraycopy(var1, var2, this.aByteArray2677, -1172691841 * this.anInt2679, var3);
                  } else {
                     int var7 = -466347091 * this.anInt2676 - -1172691841 * this.anInt2679;
                     System.arraycopy(var1, var2, this.aByteArray2677, this.anInt2679 * -1172691841, var7);
                     System.arraycopy(var1, var7 + var2, this.aByteArray2677, 0, var3 - var7);
                  }

                  this.anInt2679 = (-1172691841 * this.anInt2679 + var3) % (this.anInt2676 * -466347091) * 1402051455;
                  this.notifyAll();
               }
            }
         }
      } else {
         throw new IOException();
      }
   }

   void method4026(int var1) {
      synchronized(this) {
         this.aBool2680 = true;
         this.notifyAll();
      }

      try {
         this.aThread2674.join();
      } catch (InterruptedException var4) {
         ;
      }

   }

   void method4027() {
      this.anOutputStream2681 = new OutputStream_Sub1();
   }

   public void method4028() {
      do {
         int var2;
         synchronized(this) {
            while(true) {
               if(this.anIOException2675 != null) {
                  return;
               }

               if(this.anInt2678 * 790860467 <= -1172691841 * this.anInt2679) {
                  var2 = -1172691841 * this.anInt2679 - 790860467 * this.anInt2678;
               } else {
                  var2 = -466347091 * this.anInt2676 - 790860467 * this.anInt2678 + -1172691841 * this.anInt2679;
               }

               if(var2 > 0) {
                  break;
               }

               try {
                  this.anOutputStream2681.flush();
               } catch (IOException var10) {
                  this.anIOException2675 = var10;
                  return;
               }

               if(this.method4023(1361440817)) {
                  return;
               }

               try {
                  this.wait();
               } catch (InterruptedException var11) {
                  ;
               }
            }
         }

         try {
            if(var2 + 790860467 * this.anInt2678 <= -466347091 * this.anInt2676) {
               this.anOutputStream2681.write(this.aByteArray2677, 790860467 * this.anInt2678, var2);
            } else {
               int var13 = -466347091 * this.anInt2676 - 790860467 * this.anInt2678;
               this.anOutputStream2681.write(this.aByteArray2677, 790860467 * this.anInt2678, var13);
               this.anOutputStream2681.write(this.aByteArray2677, 0, var2 - var13);
            }
         } catch (IOException var9) {
            IOException var1 = var9;
            synchronized(this) {
               this.anIOException2675 = var1;
               return;
            }
         }

         synchronized(this) {
            this.anInt2678 = 1718054011 * ((var2 + this.anInt2678 * 790860467) % (this.anInt2676 * -466347091));
         }
      } while(!this.method4023(1389917000));

   }

   public void method4029() {
      do {
         int var2;
         synchronized(this) {
            while(true) {
               if(this.anIOException2675 != null) {
                  return;
               }

               if(this.anInt2678 * 790860467 <= -1172691841 * this.anInt2679) {
                  var2 = -1172691841 * this.anInt2679 - 790860467 * this.anInt2678;
               } else {
                  var2 = -466347091 * this.anInt2676 - 790860467 * this.anInt2678 + -1172691841 * this.anInt2679;
               }

               if(var2 > 0) {
                  break;
               }

               try {
                  this.anOutputStream2681.flush();
               } catch (IOException var10) {
                  this.anIOException2675 = var10;
                  return;
               }

               if(this.method4023(1312188681)) {
                  return;
               }

               try {
                  this.wait();
               } catch (InterruptedException var11) {
                  ;
               }
            }
         }

         try {
            if(var2 + 790860467 * this.anInt2678 <= -466347091 * this.anInt2676) {
               this.anOutputStream2681.write(this.aByteArray2677, 790860467 * this.anInt2678, var2);
            } else {
               int var13 = -466347091 * this.anInt2676 - 790860467 * this.anInt2678;
               this.anOutputStream2681.write(this.aByteArray2677, 790860467 * this.anInt2678, var13);
               this.anOutputStream2681.write(this.aByteArray2677, 0, var2 - var13);
            }
         } catch (IOException var9) {
            IOException var1 = var9;
            synchronized(this) {
               this.anIOException2675 = var1;
               return;
            }
         }

         synchronized(this) {
            this.anInt2678 = 1718054011 * ((var2 + this.anInt2678 * 790860467) % (this.anInt2676 * -466347091));
         }
      } while(!this.method4023(1218110150));

   }

   void method4030() {
      synchronized(this) {
         this.aBool2680 = true;
         this.notifyAll();
      }

      try {
         this.aThread2674.join();
      } catch (InterruptedException var3) {
         ;
      }

   }

   void method4031() {
      this.anOutputStream2681 = new OutputStream_Sub1();
   }

   void method4032(byte[] var1, int var2, int var3) throws IOException {
      if(var3 >= 0 && var2 >= 0 && var2 + var3 <= var1.length) {
         synchronized(this) {
            if(null != this.anIOException2675) {
               throw new IOException(this.anIOException2675.toString());
            } else {
               int var5;
               if(790860467 * this.anInt2678 <= this.anInt2679 * -1172691841) {
                  var5 = this.anInt2676 * -466347091 - -1172691841 * this.anInt2679 + this.anInt2678 * 790860467 - 1;
               } else {
                  var5 = this.anInt2678 * 790860467 - this.anInt2679 * -1172691841 - 1;
               }

               if(var5 < var3) {
                  throw new IOException("");
               } else {
                  if(-1172691841 * this.anInt2679 + var3 <= -466347091 * this.anInt2676) {
                     System.arraycopy(var1, var2, this.aByteArray2677, -1172691841 * this.anInt2679, var3);
                  } else {
                     int var6 = -466347091 * this.anInt2676 - -1172691841 * this.anInt2679;
                     System.arraycopy(var1, var2, this.aByteArray2677, this.anInt2679 * -1172691841, var6);
                     System.arraycopy(var1, var6 + var2, this.aByteArray2677, 0, var3 - var6);
                  }

                  this.anInt2679 = (-1172691841 * this.anInt2679 + var3) % (this.anInt2676 * -466347091) * 1402051455;
                  this.notifyAll();
               }
            }
         }
      } else {
         throw new IOException();
      }
   }

   public void method4033() {
      do {
         int var2;
         synchronized(this) {
            while(true) {
               if(this.anIOException2675 != null) {
                  return;
               }

               if(this.anInt2678 * 790860467 <= -1172691841 * this.anInt2679) {
                  var2 = -1172691841 * this.anInt2679 - 790860467 * this.anInt2678;
               } else {
                  var2 = -466347091 * this.anInt2676 - 790860467 * this.anInt2678 + -1172691841 * this.anInt2679;
               }

               if(var2 > 0) {
                  break;
               }

               try {
                  this.anOutputStream2681.flush();
               } catch (IOException var10) {
                  this.anIOException2675 = var10;
                  return;
               }

               if(this.method4023(2008707230)) {
                  return;
               }

               try {
                  this.wait();
               } catch (InterruptedException var11) {
                  ;
               }
            }
         }

         try {
            if(var2 + 790860467 * this.anInt2678 <= -466347091 * this.anInt2676) {
               this.anOutputStream2681.write(this.aByteArray2677, 790860467 * this.anInt2678, var2);
            } else {
               int var13 = -466347091 * this.anInt2676 - 790860467 * this.anInt2678;
               this.anOutputStream2681.write(this.aByteArray2677, 790860467 * this.anInt2678, var13);
               this.anOutputStream2681.write(this.aByteArray2677, 0, var2 - var13);
            }
         } catch (IOException var9) {
            IOException var1 = var9;
            synchronized(this) {
               this.anIOException2675 = var1;
               return;
            }
         }

         synchronized(this) {
            this.anInt2678 = 1718054011 * ((var2 + this.anInt2678 * 790860467) % (this.anInt2676 * -466347091));
         }
      } while(!this.method4023(479064755));

   }

   Class233(OutputStream var1, int var2) {
      this.anOutputStream2681 = var1;
      this.anInt2676 = (1 + var2) * -1520959451;
      this.aByteArray2677 = new byte[-466347091 * this.anInt2676];
      this.aThread2674 = new Thread(this);
      this.aThread2674.setDaemon(true);
      this.aThread2674.start();
   }

   void method4034() {
      synchronized(this) {
         this.aBool2680 = true;
         this.notifyAll();
      }

      try {
         this.aThread2674.join();
      } catch (InterruptedException var3) {
         ;
      }

   }

   void method4035() {
      synchronized(this) {
         this.aBool2680 = true;
         this.notifyAll();
      }

      try {
         this.aThread2674.join();
      } catch (InterruptedException var3) {
         ;
      }

   }

   void method4036(byte[] var1, int var2, int var3) throws IOException {
      if(var3 >= 0 && var2 >= 0 && var2 + var3 <= var1.length) {
         synchronized(this) {
            if(null != this.anIOException2675) {
               throw new IOException(this.anIOException2675.toString());
            } else {
               int var5;
               if(790860467 * this.anInt2678 <= this.anInt2679 * -1172691841) {
                  var5 = this.anInt2676 * -466347091 - -1172691841 * this.anInt2679 + this.anInt2678 * 790860467 - 1;
               } else {
                  var5 = this.anInt2678 * 790860467 - this.anInt2679 * -1172691841 - 1;
               }

               if(var5 < var3) {
                  throw new IOException("");
               } else {
                  if(-1172691841 * this.anInt2679 + var3 <= -466347091 * this.anInt2676) {
                     System.arraycopy(var1, var2, this.aByteArray2677, -1172691841 * this.anInt2679, var3);
                  } else {
                     int var6 = -466347091 * this.anInt2676 - -1172691841 * this.anInt2679;
                     System.arraycopy(var1, var2, this.aByteArray2677, this.anInt2679 * -1172691841, var6);
                     System.arraycopy(var1, var6 + var2, this.aByteArray2677, 0, var3 - var6);
                  }

                  this.anInt2679 = (-1172691841 * this.anInt2679 + var3) % (this.anInt2676 * -466347091) * 1402051455;
                  this.notifyAll();
               }
            }
         }
      } else {
         throw new IOException();
      }
   }

   void method4037(byte var1) {
      this.anOutputStream2681 = new OutputStream_Sub1();
   }

   void method4038() {
      synchronized(this) {
         this.aBool2680 = true;
         this.notifyAll();
      }

      try {
         this.aThread2674.join();
      } catch (InterruptedException var3) {
         ;
      }

   }

   static final void method4039(Class508 var0, int var1) {
      int var2 = var0.anIntArray6027[(var0.anInt6003 -= 98312473) * -937710807];
      Class124 var3 = Class97.method1903(var2, -1519365556);
      Class121 var4 = Class18.aClass121Array188[var2 >> 16];
      Class119.method2326(var3, var4, true, 0, var0, (byte)21);
   }

   static final void method4040(Class508 var0, int var1) {
      Class185.method3251(var0.anIntArray6027[(var0.anInt6003 -= 98312473) * -937710807], 1691738786);
   }

   static final void method4041(Class508 var0, int var1) {
      String var2 = (String)var0.anObjectArray6004[(var0.anInt6005 -= -46848683) * 639741949];
      boolean var3 = Class391.aclient4857.method5079(new File(var2), 716290724);
      int[] var10000 = var0.anIntArray6027;
      int var10001 = (var0.anInt6003 += 98312473) * -937710807 - 1;
      byte var10002;
      if(var3) {
         if(var1 == -247906890) {
            ;
         }

         var10002 = 1;
      } else {
         var10002 = 0;
      }

      var10000[var10001] = var10002;
   }

   public static void method4042(int var0) {
      for(Class225_Sub2 var1 = (Class225_Sub2)Class489.aClass423_5910.method7208(-405853513); null != var1; var1 = (Class225_Sub2)Class489.aClass423_5910.method7226(1819882835)) {
         if(var1.aClass221_Sub1_8365.method3796(420633111)) {
            IncommingOpcode.method5362(776858865 * var1.anInt8363, (byte)108);
         } else {
            var1.aClass221_Sub1_8365.method13234(-1067035128);

            try {
               var1.aClass221_Sub1_8365.method3788(1778069987);
            } catch (Exception var4) {
               Class109.method2190("" + var1.anInt8363 * 776858865, var4, 260696231);
               IncommingOpcode.method5362(var1.anInt8363 * 776858865, (byte)103);
            }

            if(!var1.aBool8367 && !var1.aBool8366) {
               Class225_Sub45_Sub1 var2 = var1.aClass221_Sub1_8365.method3794(36374905);
               if(var2 != null) {
                  Class225_Sub12_Sub4 var3 = var2.method15586((byte)22);
                  if(null != var3) {
                     var3.method16228(-1932717245 * var1.anInt8364, -75038081);
                     Class118_Sub3.aClass225_Sub12_Sub5_8217.method16281(var3);
                     var1.aBool8367 = true;
                  }
               }
            }
         }
      }

   }

   static void method4043(Class545 var0, Class124 var1, int var2) {
      boolean var3 = Class277.aClass410_3220.method7008(var0, 961358561 * var1.anInt1444, var1.anInt1508 * -1195349685, 327835587 * var1.anInt1404, -16777216 | 284299703 * var1.anInt1491, -227244071 * var1.anInt1427, var1.aBool1510?Class5.aClass515_Sub1_Sub4_Sub4_Sub1_113.aClass540_10860:null, 1753738169) == null;
      if(var3) {
         Class192.aClass456_2282.method7712(new Class225_Sub34(var1.anInt1444 * 961358561, -1195349685 * var1.anInt1508, var1.anInt1404 * 327835587, -16777216 | 284299703 * var1.anInt1491, var1.anInt1427 * -227244071, var1.aBool1510), (byte)103);
         Class460.method7767(var1, -1198602188);
      }

   }
}
