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


void script_9643(int a0,int a1,int a2,int a3,int a4,int a5,int a6,int a7) {
	int v13 = script_8101();
	if (cs2method_11088() == 0) {
		return;
	}
	int v9 = 0;
	int v6 = 0;
	int v10 = 0;
	int v8 = 0;
	int v14 = 0;
	int v2 = 0;
	int v7 = 0;
	int v11 = 0;
	int v12 = 0;
	int v3 = 0;
	if (cs2method_10580() == 0) {
		opc_struct10574(2,0,0) v16 = cs2method_10574();
		int v4 = v16.intpart_1;
		int v0 = v16.intpart_0;
		if (a2 == v0 && a5 == v4 && a1 == 1) {
			cs2method_20162(new function<none>() {
			}, "", new WidgetPointer(a4));
			return;
		}
		if (a2 == v0 && a5 == v4) {
			cs2method_20162(load function<9643>, new WidgetPointer(a4), a6, a3, a7, a0, v0, v4, 1, "Iiiiiiii", new WidgetPointer(a4));
			return;
		}
		cs2method_20162(load function<9643>, new WidgetPointer(a4), a6, a3, a7, a0, v0, v4, 0, "Iiiiiiii", new WidgetPointer(a4));
		int v15 = cs2method_10236(v13);
		int v1 = cs2method_10823(v13);
		int v5 = v15;
		if (v0 > 0 && v4 > 0) {
			opc_struct10071(2,0,0) v21 = cs2method_10071();
			int v17 = v21.intpart_1;
			int v18 = v21.intpart_0;
			int v16 = cs2method_10122(v0, v5, a6);
			int v15 = cs2method_10122(v4, v1, a3);
			int v19 = v16;
			int v22 = cs2method_10461(a7, v19);
			int v20 = cs2method_10060(a0, v15);
			if (v22 < 0) {
				v22 = 0;
			}
			if (v20 < 0) {
				v20 = 0;
			}
			cs2method_10491(cs2method_10327(0, v22, 0, v20));
		}
	}
	return;
}
