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


void script_9214(int a0,int a1,int a2,int a3,int a4) {
	if (script_9221(a1) == 1) {
		return;
	}
	if (script_925(a1) == 0) {
		return;
	}
	int v7 = cs2method_10873(a1);
	if (v7 == -1) {
		cs2method_10810("You can't wear this item.");
		return;
	}
	if (v7 == 17) {
		v7 = 15;
	}
	int v5 = cs2method_10640(94, v7);
	if (v5 == a1) {
		if (cs2method_10991(a1) == 0) {
			return;
		}
		v5 = -1;
	}
	if (v5 != -1) {
		if (v5 == a1) {
			if (cs2method_10991(a1) == 0) {
				return;
			}
			v5 = -1;
		} else {
			if (script_9224(v5, a1) == 1) {
				return;
			}
		}
	}
	int v2 = 0;
	int v0 = -1;
	int v4 = 0;
	int v1 = 0;
	int v8 = 0;
	if (a1 != -1) {
		int v10 = cs2method_10872(cs2method_10461(2147483647, cs2method_10936(94, a1)), cs2method_10936(a0, a1));
	}
	if (v5 != -1) {
		int v10 = cs2method_10872(cs2method_10461(2147483647, cs2method_10936(a0, v5)), cs2method_10936(94, v5));
		if (v10 < cs2method_10936(94, v5)) {
			return;
		}
	}
	if (cs2method_10873(a1) == 5) {
		v0 = cs2method_10640(94, 3);
		if (v0 != -1) {
			if (cs2method_10628(v0) == 5) {
				int v10 = cs2method_10872(cs2method_10461(2147483647, cs2method_10936(a0, v0)), cs2method_10936(94, v0));
				v2 = 3;
			} else {
				v0 = -1;
			}
		}
	} else {
		if (cs2method_10628(a1) == 5) {
			v0 = cs2method_10640(94, 5);
			if (v0 != -1) {
				int v6 = cs2method_10872(cs2method_10461(2147483647, cs2method_10936(a0, v0)), cs2method_10936(94, v0));
				if (v0 == a1) {
					if (v6 < cs2method_10936(94, v0)) {
						return;
					}
					v0 = -1;
				} else {
					v2 = 5;
				}
			}
		}
	}
	if (script_10025(v5, v0, a1, a0) == 0) {
		return;
	}
	if (a0 == 93) {
		script_9215(v7, a2, a3, a4);
	} else {
		if (a0 == 95) {
			script_9839(a1, cs2method_10936(a0, a1), a2, a4, 94, v7, a3);
		}
	}
	int v3 = -1;
	int v9 = -1;
	if (v2 > 0) {
		if (a0 == 93) {
			int v10;
			if (v5 != -1) {
				v10 = script_9249(93);
			} else {
				v10 = a2;
			}
			script_9215(v2, v10, a3, a4);
		} else {
			if (a0 == 95) {
				if (client_configs['cfg110'].bitcfg288 <= 1) {
					int v11 = script_6971();
				} else {
					int v12 = client_configs['cfg110'].bitcfg288;
					script_1467_struct(2,0,0) v11 = script_1467(v12);
					int v13 = v11.intpart_1;
					int v14 = v11.intpart_0;
				}
				int v10 = script_9831(v0, cs2method_11065(94, v2), 94, v2, 1, 1, a4, a3);
				/* 
					java.lang.RuntimeException: Stack underflow
						at mgi.tools.jagdecs2.CS2Stack.pop(CS2Stack.java:46)
						at mgi.tools.jagdecs2.FlowBlocksGenerator.processFlowBlock(FlowBlocksGenerator.java:191)
						at mgi.tools.jagdecs2.FlowBlocksGenerator.processGeneration(FlowBlocksGenerator.java:52)
						at mgi.tools.jagdecs2.FlowBlocksGenerator.generate(FlowBlocksGenerator.java:35)
						at mgi.tools.jagdecs2.CS2Decompiler.decompile(CS2Decompiler.java:77)
						at tests.Main.main(Main.java:69)
					
				 */
			}
		}
	}
	return;
}
