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


void script_8007(int a0,int a1,int a2,int a3,int a4,int a5,int a6,int a7) {
	int v7 = cs2method_10461(a4, a1);
	int v11 = cs2method_10461(a0, a6);
	int v4 = 1;
	int v1 = 1;
	int v3 = 0;
	int v8 = 0;
	int v6 = 0;
	int v9 = 0;
	if (v7 < 0) {
		v7 = cs2method_10461(0, v7);
		v4 = -1;
	}
	if (v11 < 0) {
		v11 = cs2method_10461(0, v11);
		v1 = -1;
	}
	int v2 = cs2method_10968(v7, a2);
	int v5 = cs2method_10968(v11, a2);
	int v0 = cs2method_10038(v7, a2);
	int v10 = cs2method_10038(v11, a2);
	if (v0 != 0) {
		v2 = cs2method_10060(v2, 1);
	}
	if (v10 != 0) {
		v5 = cs2method_10060(v5, 1);
	}
	cs2method_20162(new function<script_8008>(int a0,int a1,int a2,int a3,int a4,int a5,int a6,int a7,int a8,int a9,int a10) {
		if (a4 == 0) {
			cs2method_10467(0, a1);
		}
		if (a4 < a3) {
			cs2method_10112(cs2method_10060(a9, cs2method_10051(a8, a4)), cs2method_10060(a10, cs2method_10051(a5, a4)), 0, 0, a1);
			cs2method_20162(load function<8008>, new WidgetPointer(a1), new WidgetPointer(a0), new WidgetPointer(a7), a3, cs2method_10060(a4, 1), a9, a10, a8, a5, a6, a2, "IIIiiiiiiii", new WidgetPointer(a7));
		} else {
			cs2method_10112(cs2method_10060(cs2method_10060(a9, cs2method_10051(a8, cs2method_10461(a4, 1))), a6), cs2method_10060(cs2method_10060(a10, cs2method_10051(a5, cs2method_10461(a4, 1))), a2), 0, 0, a1);
			if (a0 != -1) {
				cs2method_10467(0, a0);
			}
			cs2method_20162(load function<8008>, new WidgetPointer(a1), new WidgetPointer(a0), new WidgetPointer(a7), a3, 0, a9, a10, a8, a5, a6, a2, "IIIiiiiiiii", new WidgetPointer(a7));
			cs2method_10467(1, a1);
			cs2method_10467(1, a7);
		}
		return;
	}, new WidgetPointer(a7), new WidgetPointer(a5), new WidgetPointer(a3), a2, 0, a1, a6, cs2method_10051(v2, v4), cs2method_10051(v5, v1), cs2method_10051(v0, v4), cs2method_10051(v10, v1), "IIIiiiiiiii", new WidgetPointer(a3));
	return;
}
