array A_nextFree865 integer A_firstFree411 integer A_maxIndex137 array A_typeId103 array Cell_nextFree165 integer Cell_firstFree102 integer Cell_maxIndex145 array Cell_o269 integer A_firstFree411 = 0 integer A_maxIndex137 = 0 integer Cell_firstFree102 = 0 integer Cell_maxIndex145 = 0 function initGlobals194() { } function main145() { initGlobals194(); init_Test203(); } function config125() { } function init_Test203() { local integer c156 c_156 = new_Cell198(); Cell_o_269[c_156] = new_B158(); if (dispatch_A_Test_A_foo669(Cell_o_269[c_156]) == 6) { testSuccess485(); } else { }; } IS_NATIVE function testSuccess485() { } function A_foo179(integer this566) returns integer { return 5; } function A_init166(integer this131) { } function construct_A107(integer this104) { A_init166(this_104); } function B_foo196(integer this190) returns integer { return 6; } function B_init153(integer this104) { } function new_B158() returns integer { local integer this161 this_161 = alloc_B636(); construct_B154(this_161); return this_161; } function construct_B154(integer this123) { construct_A107(this_123); B_init153(this_123); } function Cell_init117(integer this489) { } function new_Cell198() returns integer { local integer this171 this_171 = alloc_Cell892(); construct_Cell210(this_171); return this_171; } function construct_Cell210(integer this202) { Cell_init117(this_202); } function error149(string msg561) { $debugPrint851((msg_561 + (" " + #getStackTrace()))); } function alloc_B636() returns integer { local integer this184 if (A_firstFree_411 == 0) { if (A_maxIndex_137 < 32768) { A_maxIndex_137 = (A_maxIndex_137 + 1); this_184 = A_maxIndex_137; A_typeId_103[this_184] = 2; } else { error149("Out of memory: Could not create B."); this_184 = 0; }; } else { A_firstFree_411 = (A_firstFree_411 - 1); this_184 = A_nextFree_865[A_firstFree_411]; A_typeId_103[this_184] = 2; }; return this_184; } function alloc_Cell892() returns integer { local integer this172 if (Cell_firstFree_102 == 0) { if (Cell_maxIndex_145 < 32768) { Cell_maxIndex_145 = (Cell_maxIndex_145 + 1); this_172 = Cell_maxIndex_145; } else { error149("Out of memory: Could not create Cell."); this_172 = 0; }; } else { Cell_firstFree_102 = (Cell_firstFree_102 - 1); this_172 = Cell_nextFree_165[Cell_firstFree_102]; }; return this_172; } function dispatch_A_Test_A_foo669(integer this881) returns integer { if (A_typeId_103[this_881] == 0) { if (this_881 == 0) { error149("Nullpointer exception when calling A.foo"); } else { error149("Called A.foo on invalid object."); }; } else { }; if (A_typeId_103[this_881] <= 1) { this_881 = A_foo179(this_881); } else { this_881 = B_foo196(this_881); }; return this_881; }