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


void script_1612(int a0,int a1) {
	int v2 = cs2method_10640(94, a1);
	if (v2 == -1) {
		cs2method_10039(-1, 0, a0);
		cs2method_10283(32, 32, 0, 0, a0);
		cs2method_10112(0, 0, 1, 1, a0);
		cs2method_10758(idx17mapData('i', 'd', 796, a1), a0);
		cs2method_10832(0, a0);
		cs2method_10807(0, a0);
		cs2method_20486(new function<none>() {
		}, "", new WidgetPointer(a0));
		cs2method_10495(a0);
		return;
	}
	cs2method_10283(36, 32, 0, 0, a0);
	cs2method_10112(2, 0, 0, 1, a0);
	cs2method_10039(v2, cs2method_11065(94, a1), a0);
	cs2method_10832(1, a0);
	cs2method_10807(3153952, a0);
	cs2method_20486(new function<script_1620>(int a0,int a1,int a2,int a3,int a4) {
		int v0 = cs2method_10060(a1, cs2method_10133());
		if (cs2method_11038(a0, a3) == 1 || a3 == -1 && cs2method_10324(a0) == 1) {
			cs2method_10002(a2);
			cs2method_20061(new function<script_1621>(int a0,int a1,int a2,int a3) {
				if (cs2method_10133() < a1) {
					return;
				}
				if (cs2method_11038(a3, a0) == 1 || a0 == -1 && cs2method_10324(a3) == 1) {
					cs2method_10002(a2);
					cs2method_20061(new function<none>() {
					}, "");
				}
				return;
			}, new WidgetPointer(a0), a3, a4, v0, "Iiii");
		}
		return;
	}, new WidgetPointer(-32768,3), -1, 100, 0, 8, "Iiiii", new WidgetPointer(a0));
	cs2method_10495(a0);
	if (itemDefsAttribute(v2, 2091) == 1) {
	} else if (itemDefsAttribute(v2, 1430) != 0 && (cs2method_10210() == 1 || cs2method_10416(v2) == 0)) {
	} else {
		cs2method_11127(1, a0, "Remove");
	}
	object v5 = itemDefsAttribute(v2, 528);
	if (cs2method_10580() == 1 && v2 == 15484) {
		v5 = "";
	}
	if (cs2method_10265(v5) > 0) {
		cs2method_11127(2, a0, v5);
	}
	object v3 = itemDefsAttribute(v2, 529);
	if (cs2method_10265(v3) > 0) {
		cs2method_11127(3, a0, v3);
	}
	object v4 = itemDefsAttribute(v2, 530);
	if (cs2method_10265(v4) > 0) {
		cs2method_11127(4, a0, v4);
	}
	object v1 = itemDefsAttribute(v2, 531);
	if (cs2method_10265(v1) > 0) {
		cs2method_11127(5, a0, v1);
	}
	object v0 = itemDefsAttribute(v2, 1211);
	if (cs2method_10265(v0) > 0) {
		cs2method_11127(6, a0, v0);
	}
	cs2method_11127(10, a0, "Examine");
	cs2method_10316(a0, "<col=ff9040>" + (string)cs2method_10018(v2));
	cs2method_21121(new function<script_5495>(int a0) {
		script_9252(a0);
		return;
	}, v2, "o", new WidgetPointer(a0));
	cs2method_20750(new function<script_5495>(int a0) {
		script_9252(a0);
		return;
	}, -1, "o", new WidgetPointer(a0));
	return;
}
