/* Class8 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Random;

public class Class8 {
	static final int anInt39 = 7;
	static final int anInt40 = 6;
	static final String aString41 = "passwordchoice.ws";
	static final int anInt42 = 1000;
	static BigInteger aBigInteger43 = (new BigInteger("80782894952180643741752986186714059433953886149239752893425047584684715842049"));
	static BigInteger aBigInteger44 = (new BigInteger("7237300117305667488707183861728052766358166655052137727439795191253340127955075499635575104901523446809299097934591732635674173519120047404024393881551683"));
	static final String aString45 = "services";
	static final int anInt46 = 3;
	static final int anInt47 = 4;
	public static final int anInt48 = 5;
	static final int anInt49 = 2;
	static final String aString50 = "m=accountappeal/login.ws";
	static final int anInt51 = 2;
	static int anInt52;

	public static long method504() {
		long l;
		try {
			URL url = new URL(new StringBuilder().append(Class358.method6856("services", false, (byte) 78)).append("m=accountappeal/login.ws").toString());
			URLConnection urlconnection = url.openConnection();
			urlconnection.setRequestProperty("connection", "close");
			urlconnection.setDoInput(true);
			urlconnection.setDoOutput(true);
			urlconnection.setConnectTimeout(5000);
			OutputStreamWriter outputstreamwriter = new OutputStreamWriter(urlconnection.getOutputStream());
			outputstreamwriter.write("data1=req");
			outputstreamwriter.flush();
			InputStream inputstream = urlconnection.getInputStream();
			Class587_Sub4 class587_sub4 = new Class587_Sub4(new byte[1000]);
			for (;;) {
				int i = inputstream.read(class587_sub4.aByteArray8460, class587_sub4.anInt8458 * -1961774223, 1000 - (class587_sub4.anInt8458 * -1961774223));
				if (i == -1)
					break;
				class587_sub4.anInt8458 += -384389743 * i;
				if (class587_sub4.anInt8458 * -1961774223 >= 1000)
					return 0L;
			}
			class587_sub4.anInt8458 = 0;
			long l_0_ = class587_sub4.method14204(-632719445);
			l = l_0_;
		} catch (Exception exception) {
			return 0L;
		}
		return l;
	}

	public static final int method505(long l, String string) {
		Random random = new Random();
		Class587_Sub4 class587_sub4 = new Class587_Sub4(128);
		Class587_Sub4 class587_sub4_1_ = new Class587_Sub4(128);
		int[] is = new int[4];
		is[0] = random.nextInt();
		is[1] = random.nextInt();
		is[2] = (int) (l >> 32);
		is[3] = (int) l;
		class587_sub4.method14416(10, 1302373931);
		for (int i = 0; i < 4; i++)
			class587_sub4.method14181(random.nextInt(), (byte) 85);
		class587_sub4.method14181(is[0], (byte) 74);
		class587_sub4.method14181(is[1], (byte) 85);
		class587_sub4.method14185(l);
		class587_sub4.method14185(0L);
		for (int i = 0; i < 4; i++)
			class587_sub4.method14181(random.nextInt(), (byte) 20);
		class587_sub4.method14224(aBigInteger43, aBigInteger44, (short) 8554);
		class587_sub4_1_.method14416(10, 1302373931);
		for (int i = 0; i < 3; i++)
			class587_sub4_1_.method14181(random.nextInt(), (byte) 28);
		class587_sub4_1_.method14185(random.nextLong());
		class587_sub4_1_.method14236(random.nextLong());
		Class103.method2514(class587_sub4_1_, -947414581);
		class587_sub4_1_.method14185(random.nextLong());
		class587_sub4_1_.method14224(aBigInteger43, aBigInteger44, (short) -9611);
		int i = Class580.method12558(string, (byte) -126);
		if (i % 8 != 0)
			i += 8 - i % 8;
		Class587_Sub4 class587_sub4_2_ = new Class587_Sub4(i);
		class587_sub4_2_.method14382(string, -1282205601);
		class587_sub4_2_.anInt8458 = i * -384389743;
		class587_sub4_2_.method14334(is, -1229383276);
		Class587_Sub4 class587_sub4_3_ = new Class587_Sub4(-1961774223 * class587_sub4_2_.anInt8458 + (class587_sub4.anInt8458 * -1961774223 + 5 + (class587_sub4_1_.anInt8458 * -1961774223)));
		class587_sub4_3_.method14416(2, 1302373931);
		class587_sub4_3_.method14416(class587_sub4.anInt8458 * -1961774223, 1302373931);
		class587_sub4_3_.method14189(class587_sub4.aByteArray8460, 0, -1961774223 * class587_sub4.anInt8458, 1452312306);
		class587_sub4_3_.method14416(-1961774223 * class587_sub4_1_.anInt8458, 1302373931);
		class587_sub4_3_.method14189(class587_sub4_1_.aByteArray8460, 0, class587_sub4_1_.anInt8458 * -1961774223, 1568335230);
		class587_sub4_3_.method14178(class587_sub4_2_.anInt8458 * -1961774223, 160785505);
		class587_sub4_3_.method14189(class587_sub4_2_.aByteArray8460, 0, -1961774223 * class587_sub4_2_.anInt8458, 1793265554);
		String string_4_ = Class563.method12214(class587_sub4_3_.aByteArray8460, -1640531527);
		int i_5_;
		try {
			URL url = new URL(new StringBuilder().append(Class358.method6856("services", false, (byte) 28)).append("m=accountappeal/login.ws").toString());
			URLConnection urlconnection = url.openConnection();
			urlconnection.setDoInput(true);
			urlconnection.setDoOutput(true);
			urlconnection.setConnectTimeout(5000);
			OutputStreamWriter outputstreamwriter = new OutputStreamWriter(urlconnection.getOutputStream());
			outputstreamwriter.write(new StringBuilder().append("data2=").append(Class506.method11465(string_4_, 632627067)).append("&dest=").append(Class506.method11465("passwordchoice.ws", 632627067)).toString());
			outputstreamwriter.flush();
			InputStream inputstream = urlconnection.getInputStream();
			class587_sub4_3_ = new Class587_Sub4(new byte[1000]);
			for (;;) {
				int i_6_ = inputstream.read(class587_sub4_3_.aByteArray8460, (class587_sub4_3_.anInt8458 * -1961774223), 1000 - (class587_sub4_3_.anInt8458 * -1961774223));
				if (-1 == i_6_)
					break;
				class587_sub4_3_.anInt8458 += -384389743 * i_6_;
				if (-1961774223 * class587_sub4_3_.anInt8458 >= 1000)
					return 5;
			}
			outputstreamwriter.close();
			inputstream.close();
			String string_7_ = new String(class587_sub4_3_.aByteArray8460);
			if (string_7_.startsWith("OFFLINE"))
				return 4;
			if (string_7_.startsWith("WRONG"))
				return 7;
			if (string_7_.startsWith("RELOAD"))
				return 3;
			if (string_7_.startsWith("Not permitted for social network accounts."))
				return 6;
			class587_sub4_3_.method14310(is, 426069009);
			for (/**/; (-1961774223 * class587_sub4_3_.anInt8458 > 0 && 0 == (class587_sub4_3_.aByteArray8460[-1961774223 * class587_sub4_3_.anInt8458 - 1])); class587_sub4_3_.anInt8458 -= -384389743) {
				/* empty */
			}
			string_7_ = new String(class587_sub4_3_.aByteArray8460, 0, class587_sub4_3_.anInt8458 * -1961774223);
			if (Class34.method1005(string_7_, 1675066463)) {
				Class234.method4657(string_7_, true, client.aBool8006, (byte) -15);
				return 2;
			}
			i_5_ = 5;
		} catch (Throwable throwable) {
			throwable.printStackTrace();
			return 5;
		}
		return i_5_;
	}

	public static long method506() {
		long l;
		try {
			URL url = new URL(new StringBuilder().append(Class358.method6856("services", false, (byte) -12)).append("m=accountappeal/login.ws").toString());
			URLConnection urlconnection = url.openConnection();
			urlconnection.setRequestProperty("connection", "close");
			urlconnection.setDoInput(true);
			urlconnection.setDoOutput(true);
			urlconnection.setConnectTimeout(5000);
			OutputStreamWriter outputstreamwriter = new OutputStreamWriter(urlconnection.getOutputStream());
			outputstreamwriter.write("data1=req");
			outputstreamwriter.flush();
			InputStream inputstream = urlconnection.getInputStream();
			Class587_Sub4 class587_sub4 = new Class587_Sub4(new byte[1000]);
			for (;;) {
				int i = inputstream.read(class587_sub4.aByteArray8460, class587_sub4.anInt8458 * -1961774223, 1000 - (class587_sub4.anInt8458 * -1961774223));
				if (i == -1)
					break;
				class587_sub4.anInt8458 += -384389743 * i;
				if (class587_sub4.anInt8458 * -1961774223 >= 1000)
					return 0L;
			}
			class587_sub4.anInt8458 = 0;
			long l_8_ = class587_sub4.method14204(-632719445);
			l = l_8_;
		} catch (Exception exception) {
			return 0L;
		}
		return l;
	}

	public static final int method507(long l, String string) {
		Random random = new Random();
		Class587_Sub4 class587_sub4 = new Class587_Sub4(128);
		Class587_Sub4 class587_sub4_9_ = new Class587_Sub4(128);
		int[] is = new int[4];
		is[0] = random.nextInt();
		is[1] = random.nextInt();
		is[2] = (int) (l >> 32);
		is[3] = (int) l;
		class587_sub4.method14416(10, 1302373931);
		for (int i = 0; i < 4; i++)
			class587_sub4.method14181(random.nextInt(), (byte) 54);
		class587_sub4.method14181(is[0], (byte) 25);
		class587_sub4.method14181(is[1], (byte) 87);
		class587_sub4.method14185(l);
		class587_sub4.method14185(0L);
		for (int i = 0; i < 4; i++)
			class587_sub4.method14181(random.nextInt(), (byte) 84);
		class587_sub4.method14224(aBigInteger43, aBigInteger44, (short) -468);
		class587_sub4_9_.method14416(10, 1302373931);
		for (int i = 0; i < 3; i++)
			class587_sub4_9_.method14181(random.nextInt(), (byte) 3);
		class587_sub4_9_.method14185(random.nextLong());
		class587_sub4_9_.method14236(random.nextLong());
		Class103.method2514(class587_sub4_9_, -947414581);
		class587_sub4_9_.method14185(random.nextLong());
		class587_sub4_9_.method14224(aBigInteger43, aBigInteger44, (short) -22720);
		int i = Class580.method12558(string, (byte) -99);
		if (i % 8 != 0)
			i += 8 - i % 8;
		Class587_Sub4 class587_sub4_10_ = new Class587_Sub4(i);
		class587_sub4_10_.method14382(string, -1640947473);
		class587_sub4_10_.anInt8458 = i * -384389743;
		class587_sub4_10_.method14334(is, -1761778754);
		Class587_Sub4 class587_sub4_11_ = new Class587_Sub4(-1961774223 * class587_sub4_10_.anInt8458 + (class587_sub4.anInt8458 * -1961774223 + 5 + (class587_sub4_9_.anInt8458 * -1961774223)));
		class587_sub4_11_.method14416(2, 1302373931);
		class587_sub4_11_.method14416(class587_sub4.anInt8458 * -1961774223, 1302373931);
		class587_sub4_11_.method14189(class587_sub4.aByteArray8460, 0, -1961774223 * class587_sub4.anInt8458, 535860113);
		class587_sub4_11_.method14416(-1961774223 * class587_sub4_9_.anInt8458, 1302373931);
		class587_sub4_11_.method14189(class587_sub4_9_.aByteArray8460, 0, class587_sub4_9_.anInt8458 * -1961774223, 1837127460);
		class587_sub4_11_.method14178((class587_sub4_10_.anInt8458 * -1961774223), 1062243266);
		class587_sub4_11_.method14189(class587_sub4_10_.aByteArray8460, 0, (-1961774223 * class587_sub4_10_.anInt8458), 814965018);
		String string_12_ = Class563.method12214(class587_sub4_11_.aByteArray8460, -1640531527);
		int i_13_;
		try {
			URL url = new URL(new StringBuilder().append(Class358.method6856("services", false, (byte) 4)).append("m=accountappeal/login.ws").toString());
			URLConnection urlconnection = url.openConnection();
			urlconnection.setDoInput(true);
			urlconnection.setDoOutput(true);
			urlconnection.setConnectTimeout(5000);
			OutputStreamWriter outputstreamwriter = new OutputStreamWriter(urlconnection.getOutputStream());
			outputstreamwriter.write(new StringBuilder().append("data2=").append(Class506.method11465(string_12_, 632627067)).append("&dest=").append(Class506.method11465("passwordchoice.ws", 632627067)).toString());
			outputstreamwriter.flush();
			InputStream inputstream = urlconnection.getInputStream();
			class587_sub4_11_ = new Class587_Sub4(new byte[1000]);
			for (;;) {
				int i_14_ = inputstream.read(class587_sub4_11_.aByteArray8460, (class587_sub4_11_.anInt8458 * -1961774223), 1000 - (class587_sub4_11_.anInt8458 * -1961774223));
				if (-1 == i_14_)
					break;
				class587_sub4_11_.anInt8458 += -384389743 * i_14_;
				if (-1961774223 * class587_sub4_11_.anInt8458 >= 1000)
					return 5;
			}
			outputstreamwriter.close();
			inputstream.close();
			String string_15_ = new String(class587_sub4_11_.aByteArray8460);
			if (string_15_.startsWith("OFFLINE"))
				return 4;
			if (string_15_.startsWith("WRONG"))
				return 7;
			if (string_15_.startsWith("RELOAD"))
				return 3;
			if (string_15_.startsWith("Not permitted for social network accounts."))
				return 6;
			class587_sub4_11_.method14310(is, -1995729566);
			for (/**/; (-1961774223 * class587_sub4_11_.anInt8458 > 0 && 0 == (class587_sub4_11_.aByteArray8460[-1961774223 * class587_sub4_11_.anInt8458 - 1])); class587_sub4_11_.anInt8458 -= -384389743) {
				/* empty */
			}
			string_15_ = new String(class587_sub4_11_.aByteArray8460, 0, class587_sub4_11_.anInt8458 * -1961774223);
			if (Class34.method1005(string_15_, 1393231180)) {
				Class234.method4657(string_15_, true, client.aBool8006, (byte) -1);
				return 2;
			}
			i_13_ = 5;
		} catch (Throwable throwable) {
			throwable.printStackTrace();
			return 5;
		}
		return i_13_;
	}

	static boolean method508(String string) {
		if (null == string)
			return false;
		try {
			new URL(string);
		} catch (MalformedURLException malformedurlexception) {
			return false;
		}
		return true;
	}

	static boolean method509(String string) {
		if (null == string)
			return false;
		try {
			new URL(string);
		} catch (MalformedURLException malformedurlexception) {
			return false;
		}
		return true;
	}

	Class8() throws Throwable {
		throw new Error();
	}

	public static int method510(Class279 class279, byte i) {
		int i_16_ = 0;
		if (class279.method5582(Class3.anInt24 * -336773991, (byte) 108))
			i_16_++;
		if (class279.method5582(-117860973 * Class66.anInt1040, (byte) 42))
			i_16_++;
		if (class279.method5582(Class92_Sub19.anInt8771 * 65676813, (byte) 85))
			i_16_++;
		if (class279.method5582(Class348_Sub1.anInt10087 * -223886147, (byte) 59))
			i_16_++;
		if (class279.method5582(408080371 * Class3.anInt25, (byte) 107))
			i_16_++;
		if (class279.method5582(-1285557947 * Class3.anInt31, (byte) 11))
			i_16_++;
		if (class279.method5582(-1777571891 * Class243_Sub2.anInt9821, (byte) 70))
			i_16_++;
		if (class279.method5582(Class587_Sub13_Sub12.anInt10799 * 1443603699, (byte) 83))
			i_16_++;
		if (class279.method5582(814795505 * Class112.anInt1558, (byte) 30))
			i_16_++;
		if (class279.method5582(1390994005 * Class118.anInt1645, (byte) 1))
			i_16_++;
		if (class279.method5582(Class3.anInt27 * -2095372127, (byte) 4))
			i_16_++;
		if (class279.method5582(-1930624091 * Class577.anInt7385, (byte) 78))
			i_16_++;
		return i_16_;
	}

	static final void method511(Class35 class35, Class477 class477, byte i) {
		Class611 class611 = class35.method1011(Class587_Sub8.aClass347_8588, client.anInterface36_8052, (short) 1041);
		int i_17_ = (((Class477) class477).anIntArray6497[(((Class477) class477).anInt6498 -= 1577301031) * 2028895127]);
		int i_18_ = (((Class477) class477).anIntArray6497[(((Class477) class477).anInt6498 -= 1577301031) * 2028895127]);
		int i_19_ = class611.method13038(class35.aString472, class35.anInt557 * 566760625, class35.anInt520 * -1644016869, i_18_, i_17_, Class3.aClass135Array32, 259633404);
		((Class477) class477).anIntArray6497[(((Class477) class477).anInt6498 += 1577301031) * 2028895127 - 1] = i_19_;
	}

	static final void method512(Class35 class35, Class477 class477, short i) {
		int i_20_ = (((Class477) class477).anIntArray6497[(((Class477) class477).anInt6498 -= 1577301031) * 2028895127]);
		int i_21_ = ((((Class477) class477).anIntArray6497[(((Class477) class477).anInt6498 -= 1577301031) * 2028895127]) - 1);
		if (-1812766933 * class35.anInt624 != 6)
			throw new RuntimeException("");
		Class619 class619 = Class211.aClass599_2552.method12905(class35.anInt503 * -1496457985, -71513830);
		if (class35.aClass598_585 == null)
			class35.aClass598_585 = new Class598(class619, true);
		class35.aClass598_585.aLong7764 = Class554.method12075(-1860178765) * -5388388126814432033L;
		if (i_21_ < 0 || i_21_ >= class619.anIntArray7874.length)
			throw new RuntimeException(new StringBuilder().append("").append(i_21_).toString());
		class35.aClass598_585.anIntArray7765[i_21_] = i_20_;
		Class423.method7674(class35, -1934935355);
	}

	static final void method513(Class477 class477, byte i) {
		((Class477) class477).anInt6498 -= -1140365234;
		int i_22_ = (((Class477) class477).anIntArray6497[2028895127 * ((Class477) class477).anInt6498]);
		int i_23_ = (((Class477) class477).anIntArray6497[1 + 2028895127 * ((Class477) class477).anInt6498]);
		if (i_23_ == -1)
			((Class477) class477).anIntArray6497[((((Class477) class477).anInt6498 += 1577301031) * 2028895127 - 1)] = -1;
		else
			((Class477) class477).anIntArray6497[((((Class477) class477).anInt6498 += 1577301031) * 2028895127 - 1)] = Class478.aClass210_6524.method4424(i_22_, 644331312).method17098((char) i_23_, 904567118);
	}

	static final void method514(Class477 class477, int i) {
		((Class477) class477).anInt6498 -= -1140365234;
		int i_24_ = (((Class477) class477).anIntArray6497[2028895127 * ((Class477) class477).anInt6498]);
		boolean bool = ((((Class477) class477).anIntArray6497[1 + ((Class477) class477).anInt6498 * 2028895127]) == 1);
		if (!Class543.method11885(i_24_, bool, (byte) -5))
			throw new RuntimeException();
	}
}
