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


script_9832_struct(2,0,0) script_9832(int a0,int a1,int a2,int a3,int a4) {
	if (a0 == -1 || a1 < 1) {
		return new script_9832_struct(a1, a1);
	}
	if (script_9225(cs2method_10480(a0), 1) == 1) {
		return new script_9832_struct(a1, a1);
	}
	int v2 = script_6969(a0, a3);
	if (cs2method_10936(a2, a0) < a1) {
		a1 = cs2method_10936(a2, a0);
	}
	int v0 = 0;
	int v1 = cs2method_10461(a3, script_6971());
	if (script_9827(a0) == 0) {
		if (cs2method_10936(95, cs2method_10480(a0)) == 0) {
			v1 = cs2method_10872(1, v1);
		} else {
			v1 = 0;
		}
	}
	int v3 = script_7594(cs2method_10480(a0), cs2method_11048(0, cs2method_10461(a1, v1)), v2);
	if (v3 >= a1) {
		return new script_9832_struct(a1, a1);
	}
	return new script_9832_struct(a1, v3);
}
