final java.math.BigInteger b = l.bigIntegerValue();
System.out.println("long: " + l + ": " + w + ": " + b.signum()
* b.bitLength() + ": " + x + ": " + l.isLong() + ": "
+ l.isULong());
return new OtpErlangTuple(new OtpErlangObject[] { l,
new OtpErlangInt(w), x,
new OtpErlangInt(l.isLong() ? 1 : 0),
new OtpErlangInt(l.isULong() ? 1 : 0) });
} else if (atomValue.equals("tail")
&& i instanceof OtpErlangList) {
final OtpErlangObject o = ((OtpErlangList) i).getTail();
if (o == null) {
return new OtpErlangAtom("null");
}
return o;
} else if (atomValue.equals("tail3")
&& i instanceof OtpErlangList) {
final OtpErlangObject o = ((OtpErlangList) i).getNthTail(3);
if (o == null) {
return new OtpErlangAtom("null");
}
return o;
} else if (atomValue.equals("strcat")
&& i instanceof OtpErlangList) {
final java.lang.StringBuffer b = new java.lang.StringBuffer();
final OtpErlangList l = (OtpErlangList) i;
for (final OtpErlangObject j : l) {
final OtpErlangString k = (OtpErlangString) j;
b.append(k.stringValue());
}
final OtpErlangObject o = new OtpErlangString(b.toString());
return o;
} else if (atomValue.equals("sub3atom")
&& i instanceof OtpErlangString) {
final OtpErlangString s = (OtpErlangString) i;
final OtpErlangAtom o = new OtpErlangAtom(s.stringValue()
.substring(3));
return o;
} else if (atomValue.equals("codepointBug")
&& i instanceof OtpErlangString) {
final OtpErlangString s = (OtpErlangString) i;
final String ss = s.stringValue().substring(3, 6);
@SuppressWarnings("unused")
final int[] cps = OtpErlangString.stringToCodePoints(ss);
return s;
} else if (atomValue.equals("utf8")) {
if (i instanceof OtpErlangString) {
final OtpErlangString s = (OtpErlangString) i;
byte[] bytes;
try {
bytes = s.stringValue().getBytes("UTF-8");
} catch (final UnsupportedEncodingException e) {
bytes = new byte[] { 'e', 'r', 'r', 'o', 'r' };
}
final OtpErlangBinary b = new OtpErlangBinary(bytes);
return b;
}
} else if(atomValue.equals("to_string_neg_int_list")) {
OtpErlangString oes = null;
if (i instanceof OtpErlangString) {
oes = (OtpErlangString) i;
} else if (i instanceof OtpErlangList) {
OtpErlangList oel = (OtpErlangList) i;
try {
oes = new OtpErlangString(oel);
} catch (final Exception e) {
}
}
if (oes != null) {
String s = oes.stringValue();
int n = s.length();
OtpErlangObject l[] = new OtpErlangObject[n];
for (int j = 0; j < n; j++) {
int c = s.charAt(j);
l[j] = new OtpErlangInt(-c);
}
return new OtpErlangList(l);
}
} else if(atomValue.equals("to_neg_int_list")) {
if (i instanceof OtpErlangString) {
OtpErlangString oes = (OtpErlangString) i;
OtpErlangList oel = new OtpErlangList(oes.stringValue());
int n = oel.arity();
OtpErlangObject l[] = new OtpErlangObject[n];
for (int j = 0; j < n; j++) {
OtpErlangLong c = (OtpErlangLong) oel.elementAt(j);
l[j] = new OtpErlangInt(-c.intValue());
}
return new OtpErlangList(l);
}
} else if (atomValue.equals("hash_lookup")) {
final boolean exists = hash_set.contains(i);