-val_t partial_order___PartialOrderElement___linear_extension(val_t self) {
- struct trace_t trace = {NULL, NULL, 243, LOCATE_partial_order___PartialOrderElement___linear_extension};
- val_t variable[12];
- struct WBT_ **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_partial_order;
- /* Register variable[0]: Local variable */
- variable[0] = self;
- /* Register variable[1]: Method return value and escape marker */
- /* Register variable[2]: Result */
- variable[2] = ATTR_partial_order___PartialOrderElement____linear_extension_cache(variable[0]) /*PartialOrderElement::_linear_extension_cache*/;
- /* Register variable[2]: Result */
- variable[2] = TAG_Bool((variable[2] == NIT_NULL /*null*/) || ((variable[2] != NIT_NULL) && UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[2])(variable[2], NIT_NULL /*null*/) /*AbstractArrayRead::==*/)));
- if (UNTAG_Bool(variable[2])) { /*if*/
- /* Register variable[2]: Local variable */
- /* Register variable[3]: Result */
- variable[3] = NEW_Array_array___Array___init() /*new Array[E]*/;
- variable[2] = variable[3];
- /* Register variable[3]: Local variable */
- /* Register variable[4]: Result */
- variable[4] = NEW_Array_array___Array___init() /*new Array[E]*/;
- variable[3] = variable[4];
- /* Register variable[4]: Result */
- variable[4] = CALL_partial_order___PartialOrderElement___value(variable[0])(variable[0]) /*PartialOrderElement::value*/;
- CALL_abstract_collection___SimpleCollection___add( variable[2] /*res*/)( variable[2] /*res*/, variable[4]) /*AbstractArray::add*/;
- /* Register variable[4]: Result */
- variable[4] = CALL_partial_order___PartialOrderElement___direct_greaters(variable[0])(variable[0]) /*PartialOrderElement::direct_greaters*/;
- /* Register variable[4]: For iterator */
- variable[4] = CALL_abstract_collection___Collection___iterator(variable[4])(variable[4]) /*AbstractArrayRead::iterator*/;
- while (true) { /*for*/
- /* Register variable[5]: For 'is_ok' result */
- variable[5] = CALL_abstract_collection___Iterator___is_ok(variable[4])(variable[4]) /*ArrayIterator::is_ok*/;
- if (!UNTAG_Bool(variable[5])) break; /*for*/
- variable[5] = CALL_abstract_collection___Iterator___item(variable[4])(variable[4]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
- /* Register variable[6]: Local variable */
- variable[6] = variable[5];
- /* Register variable[7]: Local variable */
- /* Register variable[8]: Result */
- variable[8] = CALL_partial_order___PartialOrderElement___order(variable[0])(variable[0]) /*PartialOrderElement::order*/;
- /* Register variable[8]: Result */
- variable[8] = CALL_partial_order___PartialOrder_____bra(variable[8])(variable[8], variable[6] /*s*/) /*PartialOrder::[]*/;
- /* Register variable[8]: Result */
- variable[8] = CALL_partial_order___PartialOrderElement___linear_extension(variable[8])(variable[8]) /*PartialOrderElement::linear_extension*/;
- variable[7] = variable[8];
- CALL_abstract_collection___RemovableCollection___clear( variable[3] /*res2*/)( variable[3] /*res2*/) /*AbstractArray::clear*/;
- /* Register variable[8]: For iterator */
- variable[8] = CALL_abstract_collection___Collection___iterator( variable[2] /*res*/)( variable[2] /*res*/) /*AbstractArrayRead::iterator*/;
- while (true) { /*for*/
- /* Register variable[9]: For 'is_ok' result */
- variable[9] = CALL_abstract_collection___Iterator___is_ok(variable[8])(variable[8]) /*ArrayIterator::is_ok*/;
- if (!UNTAG_Bool(variable[9])) break; /*for*/
- variable[9] = CALL_abstract_collection___Iterator___item(variable[8])(variable[8]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
- /* Register variable[10]: Local variable */
- variable[10] = variable[9];
- /* Register variable[11]: Result */
- variable[11] = CALL_abstract_collection___Collection___has( variable[7] /*sl*/)( variable[7] /*sl*/, variable[10] /*e*/) /*AbstractArrayRead::has*/;
- if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[11])))) { /*if*/
- CALL_abstract_collection___SimpleCollection___add( variable[3] /*res2*/)( variable[3] /*res2*/, variable[10] /*e*/) /*AbstractArray::add*/;
+val_t partial_order___PartialOrderElement___linear_extension(val_t p0){
+ struct {struct stack_frame_t me; val_t MORE_REG[8];} fra;
+ val_t REGB0;
+ val_t REGB1;
+ val_t REGB2;
+ val_t tmp;
+ fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
+ fra.me.file = LOCATE_partial_order;
+ fra.me.line = 243;
+ fra.me.meth = LOCATE_partial_order___PartialOrderElement___linear_extension;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 9;
+ fra.me.REG[0] = NIT_NULL;
+ fra.me.REG[1] = NIT_NULL;
+ fra.me.REG[2] = NIT_NULL;
+ fra.me.REG[3] = NIT_NULL;
+ fra.me.REG[4] = NIT_NULL;
+ fra.me.REG[5] = NIT_NULL;
+ fra.me.REG[6] = NIT_NULL;
+ fra.me.REG[7] = NIT_NULL;
+ fra.me.REG[8] = NIT_NULL;
+ fra.me.REG[0] = p0;
+ /* ./metamodel//partial_order.nit:247 */
+ fra.me.REG[1] = ATTR_partial_order___PartialOrderElement____linear_extension_cache(fra.me.REG[0]);
+ REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
+ if (UNTAG_Bool(REGB0)) {
+ } else {
+ REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
+ if (UNTAG_Bool(REGB1)) {
+ REGB1 = TAG_Bool(false);
+ REGB0 = REGB1;
+ } else {
+ REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], NIT_NULL);
+ REGB0 = REGB1;
+ }
+ }
+ if (UNTAG_Bool(REGB0)) {
+ /* ./metamodel//partial_order.nit:248 */
+ fra.me.REG[1] = NEW_Array_array___Array___init();
+ /* ./metamodel//partial_order.nit:249 */
+ fra.me.REG[2] = NEW_Array_array___Array___init();
+ /* ./metamodel//partial_order.nit:250 */
+ fra.me.REG[3] = CALL_partial_order___PartialOrderElement___value(fra.me.REG[0])(fra.me.REG[0]);
+ CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]);
+ /* ./metamodel//partial_order.nit:251 */
+ fra.me.REG[3] = CALL_partial_order___PartialOrderElement___direct_greaters(fra.me.REG[0])(fra.me.REG[0]);
+ /* ./../lib/standard//collection//array.nit:234 */
+ REGB0 = TAG_Int(0);
+ /* ./../lib/standard//collection//array.nit:235 */
+ REGB1 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
+ if (UNTAG_Bool(REGB1)) {
+ } else {
+ nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 235);
+ }
+ REGB1 = ATTR_array___AbstractArrayRead____length(fra.me.REG[3]);
+ /* ./../lib/standard//collection//array.nit:236 */
+ fra.me.REG[4] = ATTR_array___Array____items(fra.me.REG[3]);
+ /* ./../lib/standard//collection//array.nit:237 */
+ while(1) {
+ /* ./../lib/standard//collection//array.nit:23 */
+ REGB1 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
+ if (UNTAG_Bool(REGB1)) {
+ } else {
+ nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 23);
+ }
+ REGB1 = ATTR_array___AbstractArrayRead____length(fra.me.REG[3]);
+ /* ./../lib/standard//kernel.nit:212 */
+ REGB1 = TAG_Bool(UNTAG_Int(REGB0)<UNTAG_Int(REGB1));
+ /* ./../lib/standard//collection//array.nit:237 */
+ if (UNTAG_Bool(REGB1)) {
+ /* ./../lib/standard//collection//array.nit:238 */
+ REGB1 = TAG_Bool(fra.me.REG[4]==NIT_NULL);
+ if (UNTAG_Bool(REGB1)) {
+ nit_abort("Reciever is null", NULL, LOCATE_array, 238);
+ }
+ /* ./../lib/standard//collection//array.nit:654 */
+ fra.me.REG[5] = ((Nit_NativeArray)fra.me.REG[4])->val[UNTAG_Int(REGB0)];
+ /* ./metamodel//partial_order.nit:252 */
+ fra.me.REG[6] = CALL_partial_order___PartialOrderElement___order(fra.me.REG[0])(fra.me.REG[0]);
+ fra.me.REG[5] = CALL_partial_order___PartialOrder_____bra(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[5]);
+ fra.me.REG[5] = CALL_partial_order___PartialOrderElement___linear_extension(fra.me.REG[5])(fra.me.REG[5]);
+ /* ./metamodel//partial_order.nit:253 */
+ CALL_abstract_collection___RemovableCollection___clear(fra.me.REG[2])(fra.me.REG[2]);
+ /* ./../lib/standard//collection//array.nit:231 */
+ fra.me.REG[6] = fra.me.REG[1];
+ /* ./../lib/standard//collection//array.nit:234 */
+ REGB1 = TAG_Int(0);
+ /* ./../lib/standard//collection//array.nit:235 */
+ REGB2 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[6])!=NIT_NULL);
+ if (UNTAG_Bool(REGB2)) {
+ } else {
+ nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 235);
+ }
+ REGB2 = ATTR_array___AbstractArrayRead____length(fra.me.REG[6]);
+ /* ./../lib/standard//collection//array.nit:236 */
+ fra.me.REG[7] = ATTR_array___Array____items(fra.me.REG[6]);
+ /* ./../lib/standard//collection//array.nit:237 */
+ while(1) {
+ /* ./../lib/standard//collection//array.nit:23 */
+ REGB2 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[6])!=NIT_NULL);
+ if (UNTAG_Bool(REGB2)) {
+ } else {
+ nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 23);
+ }
+ REGB2 = ATTR_array___AbstractArrayRead____length(fra.me.REG[6]);
+ /* ./../lib/standard//kernel.nit:212 */
+ REGB2 = TAG_Bool(UNTAG_Int(REGB1)<UNTAG_Int(REGB2));
+ /* ./../lib/standard//collection//array.nit:237 */
+ if (UNTAG_Bool(REGB2)) {
+ /* ./../lib/standard//collection//array.nit:238 */
+ REGB2 = TAG_Bool(fra.me.REG[7]==NIT_NULL);
+ if (UNTAG_Bool(REGB2)) {
+ nit_abort("Reciever is null", NULL, LOCATE_array, 238);
+ }
+ /* ./../lib/standard//collection//array.nit:654 */
+ fra.me.REG[8] = ((Nit_NativeArray)fra.me.REG[7])->val[UNTAG_Int(REGB1)];
+ /* ./metamodel//partial_order.nit:255 */
+ REGB2 = CALL_abstract_collection___Collection___has(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[8]);
+ REGB2 = TAG_Bool(!UNTAG_Bool(REGB2));
+ if (UNTAG_Bool(REGB2)) {
+ CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[8]);
+ }
+ /* ./../lib/standard//collection//array.nit:239 */
+ REGB2 = TAG_Int(1);
+ /* ./../lib/standard//kernel.nit:215 */
+ REGB2 = TAG_Int(UNTAG_Int(REGB1)+UNTAG_Int(REGB2));
+ /* ./../lib/standard//collection//array.nit:239 */
+ REGB1 = REGB2;
+ } else {
+ /* ./../lib/standard//collection//array.nit:237 */
+ goto label1;
+ }