/* 
 * Script decompiled by jagdecs2 v3.2
 * Decompiler opts:
 * --------------
 * t1LocalAnalyzer:true
 * t2LocalAnalyzer:true
 * beautifier:true
 * --------------
 * Made by mgi125 ;)
 */


void script_7676(int a0,int a1) {
	if (a0 == -1 || a1 == -1) {
		return;
	}
	cs2method_20348(new function<script_3899>(int a0,int a1) {
		script_7676(a0, a1);
		return;
	}, new WidgetPointer(a0), a1, 3814, 1, "IJY", new WidgetPointer(a0));
	int v6 = idx22mapAttribute(a1, 3797);
	int v2 = idx22mapAttribute(a1, 4358);
	if (v2 != -1) {
		a1 = v2;
	}
	int v3 = script_3898(a1, v6);
	int v4 = idx22mapAttribute(v3, 3801);
	int v5 = idx22mapAttribute(v3, 3802);
	int v7 = idx22mapAttribute(v3, 3803);
	int v1 = idx22mapAttribute(v3, 3808);
	int v9 = idx22mapAttribute(v3, 3807);
	int v8 = 0;
	int v0 = 0;
	switch (v6) {
		case 2:
			cs2method_20680(new function<script_8087>(int a0,int a1) {
				script_8222(a1, a0);
				return;
			}, 0, new WidgetPointer(-32768,3), "1I", new WidgetPointer(a0));
			cs2method_20750(new function<script_8087>(int a0,int a1) {
				script_8222(a0, a1);
				return;
			}, 1, new WidgetPointer(-32768,3), "1I", new WidgetPointer(a0));
			v8 = 1;
			break;
		case 3:
			cs2method_20390(new function<script_8087>(int a0,int a1) {
				script_8222(a1, a0);
				return;
			}, 0, new WidgetPointer(-32768,3), "1I", new WidgetPointer(a0));
			cs2method_21103(new function<script_8087>(int a0,int a1) {
				script_8222(a0, a1);
				return;
			}, 1, new WidgetPointer(-32768,3), "1I", new WidgetPointer(a0));
			cs2method_20750(new function<script_8087>(int a0,int a1) {
				script_8222(a1, a0);
				return;
			}, 1, new WidgetPointer(-32768,3), "1I", new WidgetPointer(a0));
			v8 = 1;
			break;
		case 4:
			v0 = 1;
			break;
		case 5:
			cs2method_10565(1, a0);
			v0 = 1;
	}
	cs2method_10273(a0);
	cs2method_10606(a0, 5, cs2method_10163(a0));
	cs2method_10063(0, 0, 1, 1);
	cs2method_10013(cs2method_10051(2, v1), v9, 1, 0);
	cs2method_10310(v5);
	cs2method_10269(v8);
	cs2method_10577(1);
	cs2method_10606(a0, 5, cs2method_10163(a0));
	cs2method_10063(0, 0, 0, 1);
	cs2method_10013(v1, v9, 0, 0);
	cs2method_10310(v4);
	cs2method_10269(v8);
	cs2method_10606(a0, 5, cs2method_10163(a0));
	cs2method_10063(0, 0, 2, 1);
	cs2method_10013(v1, v9, 0, 0);
	cs2method_10310(v7);
	cs2method_10269(v8);
	cs2method_10467(v0, a0);
	return;
}
