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


void script_4051(int a0,int a1) {
	cs2method_10467(0, a0);
	cs2method_10704(0, a0);
	if (a1 == 1) {
		cs2method_10758(489, a0);
		cs2method_10112(0, 22, 2, 0, a0);
	} else {
		cs2method_10758(534, a0);
		cs2method_10112(0, cs2method_10461(1, cs2method_10823(a0)), 2, 0, a0);
	}
	cs2method_20162(new function<script_4052>(int a0,int a1) {
		if (a1 == 1) {
			if (cs2method_10152(a0) < cs2method_10461(1, cs2method_10823(a0))) {
				cs2method_20162(new function<none>() {
				}, "", new WidgetPointer(a0));
				cs2method_10467(1, a0);
			} else {
				cs2method_10112(0, cs2method_10461(cs2method_10152(a0), 1), 2, 0, a0);
				if (cs2method_10690(a0) < 245) {
					cs2method_10704(cs2method_10060(cs2method_10690(a0), 10), a0);
				}
			}
		} else if (cs2method_10152(a0) > 30) {
			cs2method_20162(new function<none>() {
			}, "", new WidgetPointer(a0));
			cs2method_10467(1, a0);
		} else {
			cs2method_10112(0, cs2method_10060(cs2method_10152(a0), 1), 2, 0, a0);
			if (cs2method_10690(a0) < 245) {
				cs2method_10704(cs2method_10060(cs2method_10690(a0), 10), a0);
			}
		}
		return;
	}, new WidgetPointer(a0), a1, "Ii", new WidgetPointer(a0));
	return;
}
