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


void script_2801(int a0,int a1,int a2) {
	cs2method_10520(a2, a0);
	if (cs2_configs['cfg3696'] == 1 && a1 > 0) {
		cs2_configs['cfg3696'] = 0;
	} else {
		if (cs2_configs['cfg3696'] == 2 && a1 < 0) {
			cs2_configs['cfg3696'] = 0;
		}
	}
	if (a1 > 0) {
		cs2method_11015(1);
	}
	if (cs2_configs['cfg3696'] <= 0) {
		cs2method_20162(new function<script_2802>(int a0,int a1) {
			int v1 = cs2method_10690(a1);
			int v0 = cs2method_10872(cs2method_11048(cs2method_10060(v1, a0), 0), 255);
			cs2method_10704(v0, a1);
			if (v0 == 0 || v0 == 255) {
				cs2method_20162(new function<none>() {
				}, "", new WidgetPointer(a1));
				cs2_configs['cfg3694'] = 0;
			}
			return;
		}, a1, new WidgetPointer(a0), "iI", new WidgetPointer(a0));
		if (a1 > 0) {
			cs2method_10704(0, a0);
		} else {
			cs2method_10704(255, a0);
		}
	} else {
		cs2method_20162(new function<none>() {
		}, "", new WidgetPointer(a0));
		if (cs2_configs['cfg3696'] == 1) {
			cs2method_10704(0, a0);
		} else {
			cs2method_10704(255, a0);
			cs2method_11015(1);
		}
		cs2_configs['cfg3696'] = 0;
	}
	return;
}
