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


void script_8126(int a0,int a1,int a2,int a3,int a4,int a5) {
	int v0;
	object v6;
	object v2;
	int v4 = cs2method_11048(0, a3);
	int v3 = cs2method_11048(1, a4);
	object v1 = "";
	if (cs2method_11038(a0, 7) == 1) {
		if (a2 == 1 || client_configs['cfg3680'].bitcfg22315 == 1) {
			if (client_configs['cfg3680'].bitcfg22315 == 0) {
				cs2method_10797("");
			} else {
				cs2method_10797(cs2method_10379(v4));
				cs2method_10811(script_805(cs2method_10122(v4, v3, 100)));
			}
			if (a1 == 1) {
				v2 = (string)cs2method_10379(v4) + "%";
			} else {
				v2 = (string)cs2method_10379(v4) + "/" + (string)cs2method_10379(v3);
			}
			cs2method_21121(new function<script_8799>(object a0,int a1,int a2) {
				script_8800(a1, a2, a0);
				return;
			}, (string)v2, new WidgetPointer(-32768,3), -1, "sIi", new WidgetPointer(a0));
			cs2method_20750(new function<script_8805>() {
				script_8808();
				return;
			}, "", new WidgetPointer(a0));
		} else {
			if (a1 == 1) {
				v6 = (string)cs2method_10379(v4) + "%";
			} else {
				v6 = (string)cs2method_10379(v4) + "/" + (string)cs2method_10379(v3);
			}
			cs2method_10797(v6);
			cs2method_21121(new function<none>() {
			}, "", new WidgetPointer(a0));
			cs2method_20750(new function<none>() {
			}, "", new WidgetPointer(a0));
		}
	}
	if (client_configs['cfg3680'].bitcfg22315 == 1) {
		v4 = cs2method_10461(v3, v4);
	}
	int v5 = cs2method_10872(v4, v3);
	if (cs2method_11038(a0, 3) == 1) {
		if (a2 == 1 || client_configs['cfg3680'].bitcfg22315 == 1) {
			if (client_configs['cfg3680'].bitcfg22315 != 1) {
				v0 = cs2method_11048(1, cs2method_10122(v5, v3, cs2method_10461(cs2method_10823(a0), 4)));
				if (cs2method_10038(v0, 2) != 0) {
					v0 = cs2method_10060(v0, 1);
				}
			} else {
				v0 = cs2method_11048(1, cs2method_10122(v5, v3, cs2method_10823(a0)));
			}
		} else {
			v0 = cs2method_11048(1, cs2method_10122(v5, v3, cs2method_10461(cs2method_10236(a0), 4)));
		}
		if (a5 == 1) {
			cs2method_20061(new function<script_8127>(int a0,int a1,int a2,int a3) {
				int v0 = 0;
				int v1 = 0;
				if (cs2method_11038(a0, a2) == 1) {
					if (client_configs['cfg3680'].bitcfg22315 == 0) {
						if (a1 < cs2method_10488()) {
							v0 = cs2method_11048(a1, cs2method_10461(cs2method_10488(), 2));
						} else {
							if (a1 >= cs2method_10488()) {
								v0 = cs2method_10872(a1, cs2method_10060(cs2method_10488(), 2));
							}
						}
					} else if (a1 < cs2method_10664()) {
						v0 = cs2method_11048(a1, cs2method_10461(cs2method_10664(), 2));
					} else {
						if (a1 >= cs2method_10664()) {
							v0 = cs2method_10872(a1, cs2method_10060(cs2method_10664(), 2));
						}
					}
					script_8128(a0, v0, a3);
					if (v0 == a1) {
						cs2method_20061(new function<none>() {
						}, "");
					}
				}
				return;
			}, new WidgetPointer(-32768,3), -2147483643, v0, a2, "Iii1");
		} else {
			script_8128(a0, v0, a2);
			cs2method_20061(new function<none>() {
			}, "");
		}
	}
	return;
}
