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


void script_9355(int a0,int a1,int a2) {
	if (a1 == -1 || a0 == -1 || a2 == -1) {
		return;
	}
	cs2method_20348(new function<script_3915>(int a0,int a1,int a2) {
		script_9355(a2, a0, a1);
		return;
	}, new WidgetPointer(a1), a0, a2, 3814, 1, "IJJY", new WidgetPointer(a1));
	int v3 = idx22mapAttribute(a0, 3797);
	int v6 = idx22mapAttribute(a0, 4358);
	if (v6 != -1) {
		a0 = v6;
	}
	int v7 = script_3898(a0, v3);
	int v10 = idx22mapAttribute(v7, 3909);
	int v2 = idx22mapAttribute(v7, 3808);
	int v9 = idx22mapAttribute(v7, 3807);
	int v5 = idx22mapAttribute(a2, 3910);
	int v0 = idx22mapAttribute(a2, 3915);
	int v1 = idx22mapAttribute(a2, 3916);
	int v4 = 0;
	int v8 = 0;
	switch (v3) {
		case 2:
			cs2method_20680(new function<script_8087>(int a0,int a1) {
				script_8222(a0, a1);
				return;
			}, 0, new WidgetPointer(-32768,3), "1I", new WidgetPointer(a1));
			cs2method_20750(new function<script_8087>(int a0,int a1) {
				script_8222(a0, a1);
				return;
			}, 1, new WidgetPointer(-32768,3), "1I", new WidgetPointer(a1));
			v4 = 1;
			v5 = idx22mapAttribute(a2, 3911);
			break;
		case 3:
			cs2method_20390(new function<script_8087>(int a0,int a1) {
				script_8222(a1, a0);
				return;
			}, 0, new WidgetPointer(-32768,3), "1I", new WidgetPointer(a1));
			cs2method_21103(new function<script_8087>(int a0,int a1) {
				script_8222(a0, a1);
				return;
			}, 1, new WidgetPointer(-32768,3), "1I", new WidgetPointer(a1));
			cs2method_20750(new function<script_8087>(int a0,int a1) {
				script_8222(a1, a0);
				return;
			}, 1, new WidgetPointer(-32768,3), "1I", new WidgetPointer(a1));
			v4 = 1;
			v5 = idx22mapAttribute(a2, 3912);
			break;
		case 4:
			v8 = 1;
			v5 = idx22mapAttribute(a2, 3913);
			break;
		case 5:
			cs2method_10565(1, a1);
			v8 = 1;
			v5 = idx22mapAttribute(a2, 3914);
	}
	cs2method_10273(a1);
	cs2method_10606(a1, 5, cs2method_10163(a1));
	cs2method_10063(0, 0, 1, 1);
	cs2method_10013(v2, v9, 0, 0);
	cs2method_10310(v10);
	cs2method_10269(v4);
	cs2method_10606(a1, 5, cs2method_10163(a1));
	cs2method_10063(0, 0, 1, 1);
	cs2method_10013(v0, v1, 0, 0);
	cs2method_10310(v5);
	cs2method_10269(v4);
	cs2method_10467(v8, a1);
	return;
}
