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


void script_8009(int a0,int a1,int a2) {
	if (a0 == -1) {
		a0 = a1;
	}
	if (cs2method_10324(a1) == 1) {
		cs2method_10002(255);
		int v0 = cs2method_10872(a2, 250);
		cs2method_20162(new function<script_8011>(int a0,int a1,int a2) {
			int v0 = 0;
			if (cs2method_10324(a1) == 1) {
				int v1 = cs2method_10461(a2, cs2method_10133());
				if (v1 <= 0) {
					cs2method_10002(0);
					cs2method_20162(new function<none>() {
					}, "", new WidgetPointer(a0));
					return;
				}
				cs2method_10002(cs2method_11048(cs2method_10461(cs2method_10699(), cs2method_10968(cs2method_10699(), v1)), 1));
			}
			return;
		}, cs2method_10060(cs2method_10133(), v0), new WidgetPointer(a1), new WidgetPointer(a0), "iII", new WidgetPointer(a0));
	}
	return;
}
