/* DO NOT EDIT THIS FILE - it is machine generated (JCGO_116) */

#ifdef JCGO_SEPARATED
#define JCGO_116
#include "jcgortl.h"
#include "Main.h"
#endif

#ifdef JCGO_116

#ifdef CHKALL_Packet
#include "jcgobchk.h"
#endif

JCGO_NOSEP_INLINE jint CFASTCALL
package_Packet__availableStream__( package_Packet This )
{
 {
  return 0;
 }
}

JCGO_NOSEP_INLINE jint CFASTCALL
package_Packet__readStream__( package_Packet This )
{
 {
  return 0;
 }
}

JCGO_NOSEP_INLINE void CFASTCALL
package_Packet__readBytes__IBA( package_Packet This, jbyteArr buff,
 jint len )
{
 {
  (JCGO_CALL_NZVFUNC(This)->readStreamBytes__IIBA(
   This, buff, len, 0));
 }
}

JCGO_NOSEP_INLINE void CFASTCALL
package_Packet__writeStreamBytes__BAII( package_Packet This, jbyteArr
 abyte0, jint i, jint j )
{
 {
 }
}

JCGO_NOSEP_INLINE jint CFASTCALL
package_Packet__getByte__( package_Packet This )
{
 {
  return (JCGO_CALL_NZVFUNC(This)->readStream__(
   This));
 }
}

JCGO_NOSEP_INLINE void CFASTCALL
package_Packet__readStreamBytes__IIBA( package_Packet This, jbyteArr
 abyte0, jint i, jint j )
{
 {
 }
}

JCGO_NOSEP_STATIC package_Packet CFASTCALL
package_Packet__this__( package_Packet This )
{
 {
  ;
  JCGO_FIELD_NZACCESS(This, packetEnd)= (jint)3;
  JCGO_FIELD_NZACCESS(This, packet8Check)= (jint)8;
  JCGO_FIELD_NZACCESS(This, packetMaxLength)= (jint)5000;
  JCGO_FIELD_NZACCESS(This, socketException)= (jboolean)jfalse;
  JCGO_FIELD_NZACCESS(This, socketExceptionMessage)= JCGO_STRREF_OF(jcgo_string3_String6D);
 }
 return This;
}

JCGO_NOSEP_FRWINL void CFASTCALL
package_Packet__seedIsaac__IA( package_Packet This, jintArr seed )
{
 {
 }
}

JCGO_NOSEP_INLINE void CFASTCALL
package_Packet__closeStream__( package_Packet This )
{
 {
 }
}

JCGO_NOSEP_FRWINL jint CFASTCALL
package_Packet__readPacket__BA( package_Packet This, jbyteArr buff
 )
{
 {
  {
   JCGO_TRY_BLOCK
   {
    jint jcgo_rcvrI1;
    JCGO_FIELD_NZACCESS(This, readTries)++;
    if (JCGO_FIELD_NZACCESS(This, maxReadTries) > 0 && JCGO_FIELD_NZACCESS(This,
     readTries) > JCGO_FIELD_NZACCESS(This, maxReadTries))
    {
     JCGO_FIELD_NZACCESS(This, socketException)= (jboolean)jtrue;
     JCGO_FIELD_NZACCESS(This, socketExceptionMessage)= JCGO_STRREF_OF(jcgo_string2_Packet);
     JCGO_FIELD_NZACCESS(This, maxReadTries)+= JCGO_FIELD_NZACCESS(This,
      maxReadTries);
#ifndef JCGO_SEHTRY
     jcgo_tryLeave();
#endif
     return 0;
    }
    if (JCGO_FIELD_NZACCESS(This, length) == 0 && (JCGO_CALL_NZVFUNC(This)->availableStream__(
     This)) >= (jint)2)
    {
     JCGO_FIELD_NZACCESS(This, length)= (JCGO_CALL_NZVFUNC(This)->readStream__(
      This));
     if (JCGO_FIELD_NZACCESS(This, length) >= (jint)160)
     {
      jint jcgo_rcvrI1;
      JCGO_FIELD_NZACCESS(This, length)= (jcgo_rcvrI1= (JCGO_FIELD_NZACCESS(This,
       length) - (jint)160) * (jint)256, jcgo_rcvrI1 + (JCGO_CALL_NZVFUNC(This)->readStream__(
       This)));
     }
    }
    if (JCGO_FIELD_NZACCESS(This, length) > 0 && (jcgo_rcvrI1= (JCGO_CALL_NZVFUNC(This)->availableStream__(
     This)), jcgo_rcvrI1 >= JCGO_FIELD_NZACCESS(This, length)))
    {
     jint i;
     if (JCGO_FIELD_NZACCESS(This, length) >= (jint)160)
     {
      (package_Packet__readBytes__IBA(
       This, buff, JCGO_FIELD_NZACCESS(This, length)));
     }
     else
     {
      jObject jcgo_rcvrL1;
      jint jcgo_rcvrI1;
      jbyte jcgo_rcvrB1;
      (jcgo_rcvrL1= (jObject)buff, jcgo_rcvrI1= JCGO_FIELD_NZACCESS(This,
       length) - (jint)1, jcgo_rcvrB1= (jbyte)(JCGO_CALL_NZVFUNC(This)->readStream__(
       This)), JCGO_ARRAY_BACCESS((jbyteArr)jcgo_rcvrL1, jcgo_rcvrI1)=
       jcgo_rcvrB1);
      if (JCGO_FIELD_NZACCESS(This, length) > (jint)1)
      {
       (package_Packet__readBytes__IBA(
        This, buff, JCGO_FIELD_NZACCESS(This, length) - (jint)1));
      }
     }
     i= JCGO_FIELD_NZACCESS(This, length);
     JCGO_FIELD_NZACCESS(This, length)= 0;
     JCGO_FIELD_NZACCESS(This, readTries)= 0;
#ifndef JCGO_SEHTRY
     jcgo_tryLeave();
#endif
     return i;
    }
   }
   JCGO_TRY_LEAVE
   JCGO_TRY_CATCHES(1)
   JCGO_TRY_CATCH(OBJT_java_io_IOException, MAXT_java_io_IOException)
   {
    java_io_IOException ioexception;
    ioexception= (java_io_IOException)JCGO_TRY_THROWABLE(0);
    JCGO_FIELD_NZACCESS(This, socketException)= (jboolean)jtrue;
    JCGO_FIELD_NZACCESS(This, socketExceptionMessage)= (JCGO_CALL_NZVFUNC(ioexception)->getMessage__(
     (java_lang_Throwable)ioexception));
   }
   JCGO_TRY_RETHROW(1)
  }
  return 0;
 }
}

JCGO_NOSEP_FRWINL jboolean CFASTCALL
package_Packet__hasPacket__( package_Packet This )
{
 {
  return (jboolean)(JCGO_FIELD_NZACCESS(This, packetStart) > 0);
 }
}

JCGO_NOSEP_STATIC void CFASTCALL
package_Packet__writePacket__I( package_Packet This, jint i )
{
 {
  if (JCGO_FIELD_NZACCESS(This, socketException))
  {
   JCGO_FIELD_NZACCESS(This, packetStart)= 0;
   JCGO_FIELD_NZACCESS(This, packetEnd)= (jint)3;
   JCGO_FIELD_NZACCESS(This, socketException)= (jboolean)jfalse;
   JCGO_THROW_EXC((java_io_IOException__new__Ls(
    JCGO_FIELD_NZACCESS(This, socketExceptionMessage))));
  }
  JCGO_FIELD_NZACCESS(This, delay)++;
  if (JCGO_FIELD_NZACCESS(This, delay) < i)
  {
   return;
  }
  if (JCGO_FIELD_NZACCESS(This, packetStart) > 0)
  {
   JCGO_FIELD_NZACCESS(This, delay)= 0;
   (JCGO_CALL_NZVFUNC(This)->writeStreamBytes__BAII(
    This, JCGO_FIELD_NZACCESS(This, packetData), 0, JCGO_FIELD_NZACCESS(This,
    packetStart)));
  }
  JCGO_FIELD_NZACCESS(This, packetStart)= 0;
  JCGO_FIELD_NZACCESS(This, packetEnd)= (jint)3;
 }
}

JCGO_NOSEP_STATIC void CFASTCALL
package_Packet__sendPacket__( package_Packet This )
{
 {
  jint j;
  if (((java_lang_Object)jnull) != jnull)
  {
   jint i;
   jObject jcgo_rcvrL1;
   jint jcgo_rcvrI1;
   jbyte jcgo_rcvrB1;
   i= (jint)((unsigned char)(JCGO_ARRAY_BACCESS(JCGO_FIELD_NZACCESS(This,
    packetData), JCGO_FIELD_NZACCESS(This, packetStart) + (jint)2)));
   (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, packetData), jcgo_rcvrI1=
    JCGO_FIELD_NZACCESS(This, packetStart) + (jint)2, jcgo_rcvrB1=
    (jbyte)(i + (JCGO_CALL_FINALF(((java_lang_Object)jnull)) (jint)0)),
    JCGO_ARRAY_BACCESS((jbyteArr)jcgo_rcvrL1, jcgo_rcvrI1)= jcgo_rcvrB1);
  }
  if (JCGO_FIELD_NZACCESS(This, packet8Check) != (jint)8)
  {
   JCGO_FIELD_NZACCESS(This, packetEnd)++;
  }
  j= JCGO_FIELD_NZACCESS(This, packetEnd) - JCGO_FIELD_NZACCESS(This,
   packetStart) - (jint)2;
  if (j >= (jint)160)
  {
   JCGO_ARRAY_BACCESS(JCGO_FIELD_NZACCESS(This, packetData), JCGO_FIELD_NZACCESS(This,
    packetStart))= ((jbyte)(j / (jint)256 + (jint)160));
   JCGO_ARRAY_BACCESS(JCGO_FIELD_NZACCESS(This, packetData), JCGO_FIELD_NZACCESS(This,
    packetStart) + (jint)1)= ((jbyte)(j & (jint)255));
  }
  else
  {
   jbyte jcgo_rcvrB1;
   JCGO_ARRAY_BACCESS(JCGO_FIELD_NZACCESS(This, packetData), JCGO_FIELD_NZACCESS(This,
    packetStart))= ((jbyte)j);
   JCGO_FIELD_NZACCESS(This, packetEnd)--;
   (jcgo_rcvrB1= JCGO_ARRAY_BACCESS(JCGO_FIELD_NZACCESS(This, packetData),
    JCGO_FIELD_NZACCESS(This, packetEnd)), JCGO_ARRAY_BACCESS(JCGO_FIELD_NZACCESS(This,
    packetData), JCGO_FIELD_NZACCESS(This, packetStart) + (jint)1)=
    jcgo_rcvrB1);
  }
  if (JCGO_FIELD_NZACCESS(This, packetMaxLength) <= (jint)10000)
  {
   jint k;
   k= (jint)((unsigned char)(JCGO_ARRAY_BACCESS(JCGO_FIELD_NZACCESS(This,
    packetData), JCGO_FIELD_NZACCESS(This, packetStart) + (jint)2)));
   (JCGO_ARRAY_IACCESS(package_Packet__anIntArray537, k))++;
   JCGO_ARRAY_IACCESS(package_Packet__anIntArray541, k)+= JCGO_FIELD_NZACCESS(This,
    packetEnd) - JCGO_FIELD_NZACCESS(This, packetStart);
  }
  JCGO_FIELD_NZACCESS(This, packetStart)= JCGO_FIELD_NZACCESS(This,
   packetEnd);
 }
}

JCGO_NOSEP_STATIC void CFASTCALL
package_Packet__putBytes__BAII( package_Packet This, jbyteArr src,
 jint srcPos, jint len )
{
 {
  (java_lang_System__arraycopy__LoILoII(
   (java_lang_Object)src, (java_lang_Object)JCGO_FIELD_NZACCESS(This,
   packetData), srcPos, JCGO_FIELD_NZACCESS(This, packetEnd), len));
  JCGO_FIELD_NZACCESS(This, packetEnd)+= len;
 }
}

JCGO_NOSEP_STATIC void CFASTCALL
package_Packet__putLong__J( package_Packet This, jlong l )
{
 {
  (package_Packet__putInt__I(
   This, (jint)JCGO_LSHR_F(l, (jint)32)));
  (package_Packet__putInt__I(
   This, (jint)(l & JLONG_C(-1))));
 }
}

JCGO_NOSEP_STATIC void CFASTCALL
package_Packet__newPacket__I( package_Packet This, jint i )
{
 {
  if (JCGO_FIELD_NZACCESS(This, packetStart) > (JCGO_FIELD_NZACCESS(This,
   packetMaxLength) * (jint)4) / (jint)5)
  {
   {
    JCGO_TRY_BLOCK
    {
     (package_Packet__writePacket__I(
      This, 0));
    }
    JCGO_TRY_LEAVE
    JCGO_TRY_CATCHES(1)
    JCGO_TRY_CATCH(OBJT_java_io_IOException, MAXT_java_io_IOException)
    {
     java_io_IOException ioexception;
     ioexception= (java_io_IOException)JCGO_TRY_THROWABLE(0);
     JCGO_FIELD_NZACCESS(This, socketException)= (jboolean)jtrue;
     JCGO_FIELD_NZACCESS(This, socketExceptionMessage)= (JCGO_CALL_NZVFUNC(ioexception)->getMessage__(
      (java_lang_Throwable)ioexception));
    }
    JCGO_TRY_RETHROW(1)
   }
  }
  if (JCGO_FIELD_NZACCESS(This, packetData) == jnull)
  {
   JCGO_FIELD_NZACCESS(This, packetData)= (jbyteArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jbyte),
    0, JCGO_FIELD_NZACCESS(This, packetMaxLength));
  }
  JCGO_ARRAY_BACCESS(JCGO_FIELD_NZACCESS(This, packetData), JCGO_FIELD_NZACCESS(This,
   packetStart) + (jint)2)= ((jbyte)i);
  JCGO_ARRAY_BACCESS(JCGO_FIELD_NZACCESS(This, packetData), JCGO_FIELD_NZACCESS(This,
   packetStart) + (jint)3)= (jbyte)0;
  JCGO_FIELD_NZACCESS(This, packetEnd)= JCGO_FIELD_NZACCESS(This, packetStart) +
   (jint)3;
  JCGO_FIELD_NZACCESS(This, packet8Check)= (jint)8;
 }
}

JCGO_NOSEP_FRWINL jlong CFASTCALL
package_Packet__getLong__( package_Packet This )
{
 {
  jlong l;
  jlong l1;
  jlong l2;
  jlong l3;
  l= (jlong)(package_Packet__getShort__(
   This));
  l1= (jlong)(package_Packet__getShort__(
   This));
  l2= (jlong)(package_Packet__getShort__(
   This));
  l3= (jlong)(package_Packet__getShort__(
   This));
  return JCGO_LSHL_F(l, (jint)48) + JCGO_LSHL_F(l1, (jint)32) + JCGO_LSHL_F(l2,
   (jint)16) + l3;
 }
}

JCGO_NOSEP_STATIC void CFASTCALL
package_Packet__putShort__I( package_Packet This, jint i )
{
 {
  jObject jcgo_rcvrL1;
  jint jcgo_rcvrI1;
  (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, packetData), jcgo_rcvrI1=
   JCGO_FIELD_NZACCESS(This, packetEnd)++, JCGO_ARRAY_BACCESS((jbyteArr)jcgo_rcvrL1,
   jcgo_rcvrI1)= ((jbyte)JCGO_SHR_F(i, (jint)8)));
  (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, packetData), jcgo_rcvrI1=
   JCGO_FIELD_NZACCESS(This, packetEnd)++, JCGO_ARRAY_BACCESS((jbyteArr)jcgo_rcvrL1,
   jcgo_rcvrI1)= ((jbyte)i));
 }
}

JCGO_NOSEP_STATIC void CFASTCALL
package_Packet__putInt__I( package_Packet This, jint i )
{
 {
  jObject jcgo_rcvrL1;
  jint jcgo_rcvrI1;
  (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, packetData), jcgo_rcvrI1=
   JCGO_FIELD_NZACCESS(This, packetEnd)++, JCGO_ARRAY_BACCESS((jbyteArr)jcgo_rcvrL1,
   jcgo_rcvrI1)= ((jbyte)JCGO_SHR_F(i, (jint)24)));
  (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, packetData), jcgo_rcvrI1=
   JCGO_FIELD_NZACCESS(This, packetEnd)++, JCGO_ARRAY_BACCESS((jbyteArr)jcgo_rcvrL1,
   jcgo_rcvrI1)= ((jbyte)JCGO_SHR_F(i, (jint)16)));
  (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, packetData), jcgo_rcvrI1=
   JCGO_FIELD_NZACCESS(This, packetEnd)++, JCGO_ARRAY_BACCESS((jbyteArr)jcgo_rcvrL1,
   jcgo_rcvrI1)= ((jbyte)JCGO_SHR_F(i, (jint)8)));
  (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, packetData), jcgo_rcvrI1=
   JCGO_FIELD_NZACCESS(This, packetEnd)++, JCGO_ARRAY_BACCESS((jbyteArr)jcgo_rcvrL1,
   jcgo_rcvrI1)= ((jbyte)i));
 }
}

JCGO_NOSEP_STATIC jint CFASTCALL
package_Packet__getShort__( package_Packet This )
{
 {
  jint i;
  jint j;
  i= (package_Packet__getByte__(
   This));
  j= (package_Packet__getByte__(
   This));
  return i * (jint)256 + j;
 }
}

JCGO_NOSEP_STATIC void CFASTCALL
package_Packet__putString__Ls( package_Packet This, java_lang_String
 s )
{
 {
  jObject jcgo_rcvrL1;
  jObject jcgo_rcvrL2;
  jint jcgo_rcvrI1;
  (jcgo_rcvrL1= (jObject)(JCGO_CALL_FINALF(s) java_lang_String__getBytes__(
   s)), jcgo_rcvrL2= (jObject)JCGO_FIELD_NZACCESS(This, packetData),
   jcgo_rcvrI1= JCGO_FIELD_NZACCESS(This, packetEnd), java_lang_System__arraycopy__LoILoII(
   (java_lang_Object)jcgo_rcvrL1, (java_lang_Object)jcgo_rcvrL2, 0,
   jcgo_rcvrI1, (JCGO_CALL_FINALF(s) java_lang_String__length__(
   s))));
  (jcgo_rcvrI1= *(jint*)(jcgo_rcvrL1= (void*)&JCGO_FIELD_NZACCESS(This,
   packetEnd)), *(jint*)jcgo_rcvrL1= jcgo_rcvrI1+ (java_lang_String__length__(
   s)));
 }
}

JCGO_NOSEP_FRWINL void CFASTCALL
package_Packet__putByte__I( package_Packet This, jint i )
{
 {
  jObject jcgo_rcvrL1;
  jint jcgo_rcvrI1;
  (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, packetData), jcgo_rcvrI1=
   JCGO_FIELD_NZACCESS(This, packetEnd)++, JCGO_ARRAY_BACCESS((jbyteArr)jcgo_rcvrL1,
   jcgo_rcvrI1)= ((jbyte)i));
 }
}

JCGO_NOSEP_FRWINL jint CFASTCALL
package_Packet__isaacCommand__I( package_Packet This, jint i )
{
 {
  return i;
 }
}

JCGO_NOSEP_STATIC void CFASTCALL
package_Packet__flushPacket__( package_Packet This )
{
 {
  (package_Packet__sendPacket__(
   This));
  (package_Packet__writePacket__I(
   This, 0));
 }
}

JCGO_NOSEP_STATIC void CFASTCALL
package_Packet__class__0( void )
{
 JCGO_CLINIT_BEGIN(package_Packet__class);
 package_Packet__anIntArray537= (jintArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jint),
  0, (jint)256);
 package_Packet__anIntArray541= (jintArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jint),
  0, (jint)256);
 JCGO_CLINIT_DONE(package_Packet__class);
}

JCGO_NOSEP_DATA CONST struct package_Packet_methods_s package_Packet_methods=
{
 JCGO_CLASSREF_OF(package_Packet__class),
 JCGO_GCJDESCR_INIT(package_Packet_s, socketExceptionMessage)
 OBJT_package_Packet,
 (JCGO_OBJSIZE_T)sizeof(struct package_Packet_s),
 NULL,
 JCGO_CLINIT_INIT(package_Packet__class__0)
 package_Packet__this__,
 java_lang_Object__equals__Lo,
 java_lang_Object__hashCode__,
 java_lang_Object__toString__,
 java_lang_Object__finalize__,
 0,
 package_Packet__availableStream__,
 package_Packet__readStreamBytes__IIBA,
 package_Packet__writeStreamBytes__BAII,
 package_Packet__readStream__
};

JCGO_NOSEP_DATA struct package_Packet_class_s package_Packet__class
 ATTRIBNONGC=
{
 {
  &java_lang_Class_methods,
  JCGO_MON_INIT
  JCGO_OBJREF_OF(*(java_lang_Object)&package_Packet_methods),
  JCGO_STRREF_OF(jcgo_string1_Packet),
  JCGO_CLASSREF_OF(java_lang_Object__class),
  ((jObjectArr)JCGO_OBJREF_OF(jcgo_array3_Object)),
  0x1c1
 }
};

JCGO_NOSEP_GCDATA jintArr package_Packet__anIntArray537 ATTRIBGCBSS=
 jnull;

JCGO_NOSEP_GCDATA jintArr package_Packet__anIntArray541 ATTRIBGCBSS=
 jnull;

JCGO_NOSEP_DATA CONST jcgo_arrtype2_BZLib jcgo_array3_Packet=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 6,
 {
  (jbyte)(jchar)80/*'P'*/, (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)99/*'c'*/,
   (jbyte)(jchar)107/*'k'*/, (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)116/*'t'*/
 }
};

JCGO_NOSEP_DATA CONST jcgo_arrtype31_GameShll jcgo_array4_Packet=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 8,
 {
  (jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)109/*'m'*/,
   (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)45/*'-'*/, (jbyte)(jchar)111/*'o'*/,
   (jbyte)(jchar)117/*'u'*/, (jbyte)(jchar)116/*'t'*/
 }
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string1_Packet
 JCGO_THRD_ATTRNONGC=
{
 &java_lang_String_methods,
 JCGO_MON_INIT
 (java_lang_Object)JCGO_OBJREF_OF(jcgo_array3_Packet),
 0, 6, (jint)0x8e0938a8L
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string2_Packet
 JCGO_THRD_ATTRNONGC=
{
 &java_lang_String_methods,
 JCGO_MON_INIT
 (java_lang_Object)JCGO_OBJREF_OF(jcgo_array4_Packet),
 0, 8, (jint)0x841c484eL
};

#ifdef CHKALL_Packet
#include "jcgochke.h"
#endif

#endif
