public static Context computeContextOrModuleFromPathname(String pathname, boolean moduleP, boolean symbolnameP, Object [] MV_returnarray) {
    { Module context = ((pathname.charAt(0) == Stella.MODULE_SEPARATOR_CHARACTER) ? Stella.$ROOT_MODULE$ : ((Module)(null)));
      int componentend = ((context != null) ? 0 : -1);
      int componentstart = Stella.NULL_INTEGER;
      int lastcharpos = pathname.length() - 1;

      loop000 : while (componentend < lastcharpos) {
        componentstart = componentend + 1;
        componentend = componentstart;
        { int i = Stella.NULL_INTEGER;
          int iter000 = componentstart;
          int upperBound000 = lastcharpos;
          boolean unboundedP000 = upperBound000 == Stella.NULL_INTEGER;

          loop001 : for (;unboundedP000 ||
                    (iter000 <= upperBound000); iter000 = iter000 + 1) {
            i = iter000;
            if (!(pathname.charAt(i) == Stella.MODULE_SEPARATOR_CHARACTER)) {
              componentend = componentend + 1;
            }
            else {
              break loop001;
            }
          }
        }
        if (symbolnameP &&
            (componentend > lastcharpos)) {
          { Context _return_temp = ((context != null) ? context : ((moduleP ? ((Module)(Stella.$MODULE$.get())) : ((Context)(Stella.$CONTEXT$.get())))));

            MV_returnarray[0] = IntegerWrapper.wrapInteger(componentstart);
            return (_return_temp);
          }
        }
        if (context == null) {
          { String startstring = Native.string_subsequence(pathname, componentstart, componentend);

            context = ((Module)(Stella.string_getStellaContextSlowly(startstring)));
          }
        }
        else {
          { Context value000 = null;

            { Context child = null;
              Cons iter001 = context.childContexts.theConsList;

              loop002 : for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
                child = ((Context)(iter001.value));
                { boolean testValue000 = false;

                  testValue000 = (!moduleP) ||
                      Stella_Object.isaP(child, Stella.SGT_STELLA_MODULE);
                  if (testValue000) {
                    if (Stella.componentMatchP((moduleP ? ((Module)(child)).moduleName : ((Context)(child)).contextName()), pathname, componentstart, componentend)) {
                      testValue000 = true;
                    }
                    else {
                      {
                        testValue000 = moduleP;
                        if (testValue000) {
                          testValue000 = ((Module)(child)).nicknames != null;
                          if (testValue000) {
                            { boolean foundP000 = false;

                              { StringWrapper nickname = null;
                                Cons iter002 = ((Module)(child)).nicknames.theConsList;

                                loop003 : for (;!(iter002 == Stella.NIL); iter002 = iter002.rest) {
                                  nickname = ((StringWrapper)(iter002.value));
                                  if (Stella.componentMatchP(nickname.wrapperValue, pathname, componentstart, componentend)) {
                                    foundP000 = true;
                                    break loop003;
                                  }
                                }
                              }
                              testValue000 = foundP000;
                            }
                          }
                        }
                      }
                    }
                  }
                  if (testValue000) {
                    value000 = child;
                    break loop002;
                  }
                }
              }
            }
            context = ((Module)(value000));
          }
        }
        if (context == null) {
          break loop000;
        }
      }
      if (context == null) {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("No context with name `" + pathname + "'");
          throw ((NoSuchContextException)(NoSuchContextException.newNoSuchContextException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
      else {
        { Context _return_temp = context;

          MV_returnarray[0] = IntegerWrapper.wrapInteger(Stella.NULL_INTEGER);
          return (_return_temp);
        }
      }
    }
  }