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


int script_9251(int a0,int a1,int a2) {
	if (a1 == -1) {
		return -1;
	}
	int v0 = cs2method_10894(a1);
	while (cs2method_10640(a1, a2) != a0 && a2 < v0) {
		a2 = cs2method_10060(a2, 1);
	}
	if (a2 >= v0) {
		return -1;
	}
	return a2;
}
