/* Class545 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.util.LinkedList;

public class Class545
{
    static long aLong7361;
    static final int anInt7362 = 0;
    static boolean[] aBoolArray7363;
    static final int anInt7364 = 2;
    static final int anInt7365 = 1;
    static LinkedList aLinkedList7366;
    static boolean aBool7367 = false;
    static final int anInt7368 = 3;
    static float aFloat7369 = 0.2F;
    static long aLong7370;
    static int anInt7371;
    static final int anInt7372 = 1;
    static int anInt7373;
    static final int anInt7374 = 2;
    static int anInt7375;
    static int anInt7376;
    static String[] aStringArray7377;
    static boolean aBool7378;
    static int anInt7379;
    static long aLong7380;
    static long aLong7381;
    static int anInt7382;
    static final int anInt7383 = 0;
    static boolean aBool7384;
    static boolean aBool7385;
    static TwitchWebcamFrameData aTwitchWebcamFrameData7386;
    static LinkedList aLinkedList7387;
    static int anInt7388 = 1106496705;
    static int anInt7389;
    static TwitchWebcamDevice[] aTwitchWebcamDeviceArray7390;
    static long aLong7391;
    static Class114 aClass114_7392;
    static boolean aBool7393;
    static boolean aBool7394;
    static final int anInt7395 = 2000;
    
    static {
	anInt7371 = 1710639200;
	anInt7376 = 0;
	anInt7373 = 1158786416;
	anInt7382 = 0;
	anInt7375 = 0;
	aBoolArray7363 = null;
	aStringArray7377 = null;
	aBool7378 = false;
	aLong7361 = 0L;
	aLong7381 = 0L;
	aLong7380 = 0L;
	anInt7379 = 0;
	aBool7384 = false;
	aBool7385 = false;
	aTwitchWebcamFrameData7386 = null;
	aLinkedList7387 = new LinkedList();
	aLinkedList7366 = new LinkedList();
	anInt7389 = -1572326989;
	aTwitchWebcamDeviceArray7390 = null;
	aLong7391 = 0L;
	aClass114_7392 = null;
	aBool7393 = false;
	aBool7394 = false;
    }
    
    public static void method6634(boolean bool) {
	/* empty */
    }
    
    public static int method6635() {
	return Class68.aTwitchTV970.GetChatState();
    }
    
    public static void method6636() {
	aClass114_7392 = null;
    }
    
    public static int method6637() {
	if (3 == anInt7382 * -1061949987)
	    return -1;
	if (-1061949987 * anInt7382 != 0)
	    return 930415373 * anInt7375;
	if (aStringArray7377 == null) {
	    if (Class470.aString5331.startsWith("mac ")) {
		if (Class470.aString5332.startsWith("ppc")) {
		    anInt7382 = 473790303;
		    return -1;
		}
		aStringArray7377 = new String[3];
		aStringArray7377[0] = "sdk-mac-dynamic";
		aStringArray7377[1] = "twitchsdk";
		aStringArray7377[2] = "twitchtv";
		aBoolArray7363 = new boolean[3];
		aBoolArray7363[0] = false;
		aBoolArray7363[1] = false;
		aBoolArray7363[2] = true;
	    } else if (Class470.aString5331.startsWith("win")) {
		aStringArray7377 = new String[6];
		aStringArray7377[0] = "avutil-ttv-51";
		aStringArray7377[1] = "libmp3lame-ttv";
		aStringArray7377[2] = "swresample-ttv-0";
		aStringArray7377[5] = "twitchtv";
		if (Class470.aString5332.startsWith("amd64")
		    || Class470.aString5332.startsWith("x86_64")) {
		    aStringArray7377[3] = "libmfxsw64";
		    aStringArray7377[4] = "twitchsdk_64_release";
		} else if (Class470.aString5332.startsWith("i386")
			   || Class470.aString5332.startsWith("i486")
			   || Class470.aString5332.startsWith("i586")
			   || Class470.aString5332.startsWith("x86")) {
		    aStringArray7377[3] = "libmfxsw32";
		    aStringArray7377[4] = "twitchsdk_32_release";
		} else {
		    anInt7382 = 473790303;
		    return -1;
		}
		aBoolArray7363 = new boolean[6];
		aBoolArray7363[0] = true;
		aBoolArray7363[1] = true;
		aBoolArray7363[2] = true;
		aBoolArray7363[3] = false;
		aBoolArray7363[4] = true;
		aBoolArray7363[5] = true;
	    } else {
		anInt7382 = 473790303;
		return -1;
	    }
	}
	anInt7382 = 157930101;
	return 0;
    }
    
    public static int method6638() {
	if (3 == anInt7382 * -1061949987)
	    return -1;
	if (-1061949987 * anInt7382 != 0)
	    return 930415373 * anInt7375;
	if (aStringArray7377 == null) {
	    if (Class470.aString5331.startsWith("mac ")) {
		if (Class470.aString5332.startsWith("ppc")) {
		    anInt7382 = 473790303;
		    return -1;
		}
		aStringArray7377 = new String[3];
		aStringArray7377[0] = "sdk-mac-dynamic";
		aStringArray7377[1] = "twitchsdk";
		aStringArray7377[2] = "twitchtv";
		aBoolArray7363 = new boolean[3];
		aBoolArray7363[0] = false;
		aBoolArray7363[1] = false;
		aBoolArray7363[2] = true;
	    } else if (Class470.aString5331.startsWith("win")) {
		aStringArray7377 = new String[6];
		aStringArray7377[0] = "avutil-ttv-51";
		aStringArray7377[1] = "libmp3lame-ttv";
		aStringArray7377[2] = "swresample-ttv-0";
		aStringArray7377[5] = "twitchtv";
		if (Class470.aString5332.startsWith("amd64")
		    || Class470.aString5332.startsWith("x86_64")) {
		    aStringArray7377[3] = "libmfxsw64";
		    aStringArray7377[4] = "twitchsdk_64_release";
		} else if (Class470.aString5332.startsWith("i386")
			   || Class470.aString5332.startsWith("i486")
			   || Class470.aString5332.startsWith("i586")
			   || Class470.aString5332.startsWith("x86")) {
		    aStringArray7377[3] = "libmfxsw32";
		    aStringArray7377[4] = "twitchsdk_32_release";
		} else {
		    anInt7382 = 473790303;
		    return -1;
		}
		aBoolArray7363 = new boolean[6];
		aBoolArray7363[0] = true;
		aBoolArray7363[1] = true;
		aBoolArray7363[2] = true;
		aBoolArray7363[3] = false;
		aBoolArray7363[4] = true;
		aBoolArray7363[5] = true;
	    } else {
		anInt7382 = 473790303;
		return -1;
	    }
	}
	anInt7382 = 157930101;
	return 0;
    }
    
    public static void method6639() {
	if (aBool7378) {
	    int i = Class68.aTwitchTV970.ShutdownTTV();
	    if (0 == i) {
		Class68.aTwitchTV970 = null;
		aBool7378 = false;
	    }
	}
    }
    
    public static int method6640() {
	return Class68.aTwitchTV970.GetLoginState();
    }
    
    static void method6641() {
	aTwitchWebcamDeviceArray7390 = Class68.aTwitchTV970.GetWebcamDevices();
    }
    
    public static int method6642() {
	if (!aBool7378)
	    return 12;
	Class258.method3634(Class463.aClass151_5283, (byte) 4);
	return Class68.aTwitchTV970.Logout();
    }
    
    public static int method6643() {
	if (!aBool7378)
	    return 12;
	Class258.method3634(Class463.aClass151_5283, (byte) 4);
	return Class68.aTwitchTV970.Logout();
    }
    
    public static int method6644() {
	return Class68.aTwitchTV970.GetChatState();
    }
    
    public static int method6645() {
	if (!Class158.method2532(-1980757211))
	    return 0;
	return -505042757 * anInt7379;
    }
    
    public static boolean method6646() {
	if (Class470.aString5331.startsWith("win")) {
	    String string = "msvcr110.dll";
	    String string_0_ = "msvcp110.dll";
	    String[] strings = { string, string_0_ };
	    String string_1_ = System.getenv("WINDIR");
	    if (string_1_ == "")
		return false;
	    for (int i = 0; i < strings.length; i++) {
		File file
		    = new File(new StringBuilder().append(string_1_).append
				   ("\\system32\\").append
				   (strings[i]).toString());
		if (!file.exists() || file.isDirectory())
		    return false;
	    }
	    return true;
	}
	if (Class470.aString5331.startsWith("mac")) {
	    boolean bool;
	    try {
		Process process = Runtime.getRuntime().exec("ps -few");
		BufferedReader bufferedreader
		    = (new BufferedReader
		       (new InputStreamReader(process.getInputStream())));
		do {
		    boolean bool_2_;
		    try {
			int i = process.waitFor();
			if (0 == i)
			    break;
			bool_2_ = false;
		    } catch (InterruptedException interruptedexception) {
			return false;
		    }
		    return bool_2_;
		} while (false);
		boolean bool_3_ = false;
	    while_0_:
		do {
		    String string;
		    do {
			if ((string = bufferedreader.readLine()) == null)
			    break while_0_;
		    } while (string.toLowerCase().indexOf("soundflowerbed")
			     == -1);
		    bool_3_ = true;
		} while (false);
		bufferedreader.close();
		bool = bool_3_;
	    } catch (Exception exception) {
		return false;
	    }
	    return bool;
	}
	return false;
    }
    
    public static int method6647(int i, int i_4_) {
	aTwitchWebcamFrameData7386 = new TwitchWebcamFrameData();
	if (i < 0 || i >= aTwitchWebcamDeviceArray7390.length)
	    return -1;
	return (Class68.aTwitchTV970.StartWebcamDevice
		(-564726579 * aTwitchWebcamDeviceArray7390[i].anInt910, i_4_));
    }
    
    static void method6648() {
	aTwitchWebcamDeviceArray7390 = Class68.aTwitchTV970.GetWebcamDevices();
    }
    
    static void method6649() {
	aTwitchWebcamDeviceArray7390 = Class68.aTwitchTV970.GetWebcamDevices();
    }
    
    public static int method6650() {
	if (!aBool7378)
	    return 12;
	Class258.method3634(Class463.aClass151_5283, (byte) 4);
	return Class68.aTwitchTV970.Logout();
    }
    
    static void method6651() {
	aTwitchWebcamDeviceArray7390 = Class68.aTwitchTV970.GetWebcamDevices();
    }
    
    Class545() throws Throwable {
	throw new Error();
    }
    
    public static int method6652() {
	Class341.aTwitchEventLiveStreams3639 = null;
	int i = Class68.aTwitchTV970
		    .RequestLiveStreams(client.aClass616_10944.aString8060);
	return i;
    }
    
    static void method6653() {
	if (aClass114_7392 == null
	    || aClass114_7392.method1491() != aTwitchWebcamFrameData7386.width
	    || (aClass114_7392.method1493()
		!= aTwitchWebcamFrameData7386.height))
	    aClass114_7392 = (Class463.aClass151_5283.method2066
			      (aTwitchWebcamFrameData7386.buffer, 0,
			       aTwitchWebcamFrameData7386.width,
			       aTwitchWebcamFrameData7386.width,
			       aTwitchWebcamFrameData7386.height, false));
	else
	    aClass114_7392.method1495(0, 0, aTwitchWebcamFrameData7386.width,
				      aTwitchWebcamFrameData7386.height,
				      aTwitchWebcamFrameData7386.buffer, 0,
				      aTwitchWebcamFrameData7386.width);
    }
    
    public static void method6654() {
	if (aBool7378) {
	    int i = Class68.aTwitchTV970.ShutdownTTV();
	    if (0 == i) {
		Class68.aTwitchTV970 = null;
		aBool7378 = false;
	    }
	}
    }
    
    public static boolean method6655() {
	return aBool7384;
    }
    
    static final void method6656(Class612 class612, byte i) {
	int i_5_
	    = (((Class612) class612).anIntArray8021
	       [(((Class612) class612).anInt8022 -= 201091009) * -40654783]);
	if (Class450.aClass83Array5164 != null
	    && i_5_ < Class249.anInt2949 * -1336745599
	    && (Class450.aClass83Array5164[i_5_].aString1187.equalsIgnoreCase
		(Class54.aClass590_Sub1_Sub5_Sub1_Sub2_626.aString11865)))
	    ((Class612) class612).anIntArray8021
		[((((Class612) class612).anInt8022 += 201091009) * -40654783
		  - 1)]
		= 1;
	else
	    ((Class612) class612).anIntArray8021
		[((((Class612) class612).anInt8022 += 201091009) * -40654783
		  - 1)]
		= 0;
    }
    
    static final void method6657(Class612 class612, int i) {
	Class487_Sub38.method9463((((Class612) class612).anIntArray8021
				   [(((Class612) class612).anInt8022
				     -= 201091009) * -40654783]),
				  -1305808135);
    }
    
    static Class669[] method6658(int i) {
	return (new Class669[]
		{ Class669.aClass669_8477, Class669.aClass669_8479,
		  Class669.aClass669_8470, Class669.aClass669_8499,
		  Class669.aClass669_8472, Class669.aClass669_8494,
		  Class669.aClass669_8475, Class669.aClass669_8487,
		  Class669.aClass669_8481, Class669.aClass669_8462,
		  Class669.aClass669_8467, Class669.aClass669_8464,
		  Class669.aClass669_8466, Class669.aClass669_8469,
		  Class669.aClass669_8485, Class669.aClass669_8474,
		  Class669.aClass669_8491, Class669.aClass669_8498,
		  Class669.aClass669_8488, Class669.aClass669_8490,
		  Class669.aClass669_8486, Class669.aClass669_8480,
		  Class669.aClass669_8476, Class669.aClass669_8483,
		  Class669.aClass669_8492, Class669.aClass669_8473,
		  Class669.aClass669_8471, Class669.aClass669_8463,
		  Class669.aClass669_8495, Class669.aClass669_8484,
		  Class669.aClass669_8482, Class669.aClass669_8468,
		  Class669.aClass669_8478, Class669.aClass669_8465,
		  Class669.aClass669_8493, Class669.aClass669_8497,
		  Class669.aClass669_8500, Class669.aClass669_8489 });
    }
}
