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


void script_5655(int a0,int a1,int a2,int a3) {
	if (a2 < 5) {
		int v3 = cs2method_10060(a2, 1);
		cs2method_20162(load function<5655>, new WidgetPointer(a1), new WidgetPointer(a0), a3, v3, "IIii", new WidgetPointer(a1));
		return;
	}
	int v0 = 0;
	cs2method_20162(load function<5655>, new WidgetPointer(a1), new WidgetPointer(a0), a3, v0, "IIii", new WidgetPointer(a1));
	int v2 = cs2method_10122(cs2method_10823(a1), 45, 100);
	int v1 = cs2method_10122(cs2method_10823(a0), 45, 100);
	if (a3 <= 50) {
		cs2method_10283(cs2method_10236(a0), 0, 0, 0, a0);
		int v3 = cs2method_10051(a3, 2);
		if (v2 < v3) {
			cs2method_10283(cs2method_10236(a1), cs2method_10872(cs2method_10060(cs2method_10823(a1), 1), 45), 0, 0, a1);
		} else {
			cs2method_20162(new function<none>() {
			}, "", new WidgetPointer(a1));
		}
	} else if (v2 < 100) {
		cs2method_10283(cs2method_10236(a1), cs2method_10872(cs2method_10060(cs2method_10823(a1), 1), 45), 0, 0, a1);
	} else {
		if (v1 < cs2method_10051(cs2method_10461(a3, 50), 2)) {
			cs2method_10283(cs2method_10236(a0), cs2method_10872(cs2method_10060(cs2method_10823(a0), 1), 45), 0, 0, a0);
		}
		if (v1 >= cs2method_10051(cs2method_10461(a3, 50), 2)) {
			cs2method_20162(new function<none>() {
			}, "", new WidgetPointer(a1));
		}
	}
	return;
}
