/* 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_gnu_java_nio_charset_UTF_116Decoder
#include "jcgobchk.h"
#endif

JCGO_NOSEP_STATIC gnu_java_nio_charset_UTF_16Decoder CFASTCALL
gnu_java_nio_charset_UTF_16Decoder__this__L7qsf6I( gnu_java_nio_charset_UTF_16Decoder
 This, java_nio_charset_Charset cs, jint byteOrder )
{
 {
  (java_nio_charset_CharsetDecoder__this__L7qsf6FF((java_nio_charset_CharsetDecoder)This,
   cs, (jfloat)0.5, (jfloat)1.0));
  JCGO_FIELD_NZACCESS(This, originalByteOrder)= byteOrder;
  JCGO_FIELD_NZACCESS(This, byteOrder)= byteOrder;
 }
 return This;
}

JCGO_NOSEP_FRWINL gnu_java_nio_charset_UTF_16Decoder CFASTCALL
gnu_java_nio_charset_UTF_16Decoder__new__L7qsf6I( java_nio_charset_Charset
 cs, jint byteOrder )
{
 return gnu_java_nio_charset_UTF_16Decoder__this__L7qsf6I(
  (gnu_java_nio_charset_UTF_16Decoder)jcgo_newObject((jvtable)&gnu_java_nio_charset_UTF_16Decoder_methods),
  cs, byteOrder);
}

JCGO_NOSEP_STATIC java_nio_charset_CoderResult CFASTCALL
gnu_java_nio_charset_UTF_16Decoder__decodeLoop__L9oaiaL3367b( gnu_java_nio_charset_UTF_16Decoder
 This, java_nio_ByteBuffer in, java_nio_CharBuffer out )
{
 {
  JCGO_TRY_VOLATILE jint inPos;
  inPos= (JCGO_CALL_FINALF(in) java_nio_Buffer__position__(
   (java_nio_Buffer)in));
  {
   JCGO_TRY_BLOCK
   {
    while ((java_nio_Buffer__remaining__(
     (java_nio_Buffer)in)) >= (jint)2)
    {
     jchar c;
     jbyte b1;
     jbyte b2;
     b1= (java_nio_ByteBufferImpl__get__(
      (java_nio_ByteBufferImpl)in));
     b2= (java_nio_ByteBufferImpl__get__(
      (java_nio_ByteBufferImpl)in));
     if (JCGO_FIELD_NZACCESS(This, byteOrder) == gnu_java_nio_charset_UTF_16Decoder__UNKNOWN_ENDIAN ||
      JCGO_FIELD_NZACCESS(This, byteOrder) == gnu_java_nio_charset_UTF_16Decoder__MAYBE_BIG_ENDIAN ||
      JCGO_FIELD_NZACCESS(This, byteOrder) == gnu_java_nio_charset_UTF_16Decoder__MAYBE_LITTLE_ENDIAN)
     {
      jchar c;
      c= (jchar)(JCGO_SHL_F(((jint)((unsigned char)b1)), (jint)8) |
       ((jint)((unsigned char)b2)));
      if (c == gnu_java_nio_charset_UTF_16Decoder__BYTE_ORDER_MARK)
      {
       if (JCGO_FIELD_NZACCESS(This, byteOrder) == gnu_java_nio_charset_UTF_16Decoder__MAYBE_LITTLE_ENDIAN)
       {
        {
         java_nio_charset_CoderResult jcgo_retval= (java_nio_charset_CoderResult__malformedForLength__I(
          (jint)2));
#ifndef JCGO_SEHTRY
         jcgo_tryLeave();
         {
          (java_nio_Buffer__position__I(
           (java_nio_Buffer)in, inPos));
         }
#endif
         return jcgo_retval;
        }
       }
       JCGO_FIELD_NZACCESS(This, byteOrder)= gnu_java_nio_charset_UTF_16Decoder__BIG_ENDIAN0;
       inPos+= (jint)2;
       continue;
      }
      else
      {
       if (c == gnu_java_nio_charset_UTF_16Decoder__REVERSED_BYTE_ORDER_MARK)
       {
        if (JCGO_FIELD_NZACCESS(This, byteOrder) == gnu_java_nio_charset_UTF_16Decoder__MAYBE_BIG_ENDIAN)
        {
         {
          java_nio_charset_CoderResult jcgo_retval= (java_nio_charset_CoderResult__malformedForLength__I(
           (jint)2));
#ifndef JCGO_SEHTRY
          jcgo_tryLeave();
          {
           (java_nio_Buffer__position__I(
            (java_nio_Buffer)in, inPos));
          }
#endif
          return jcgo_retval;
         }
        }
        JCGO_FIELD_NZACCESS(This, byteOrder)= gnu_java_nio_charset_UTF_16Decoder__LITTLE_ENDIAN0;
        inPos+= (jint)2;
        continue;
       }
       else
       {
        JCGO_FIELD_NZACCESS(This, byteOrder)= (JCGO_FIELD_NZACCESS(This,
         byteOrder) == gnu_java_nio_charset_UTF_16Decoder__MAYBE_LITTLE_ENDIAN?
         gnu_java_nio_charset_UTF_16Decoder__LITTLE_ENDIAN0 : gnu_java_nio_charset_UTF_16Decoder__BIG_ENDIAN0);
       }
      }
     }
     c= ((jchar)(JCGO_FIELD_NZACCESS(This, byteOrder) == gnu_java_nio_charset_UTF_16Decoder__BIG_ENDIAN0?
      (jchar)(JCGO_SHL_F(((jint)((unsigned char)b1)), (jint)8) | ((jint)((unsigned char)b2))) :
      (jchar)(JCGO_SHL_F(((jint)((unsigned char)b2)), (jint)8) | ((jint)((unsigned char)b1)))));
     if ((jint)55296L <= (jint)c && (jint)c <= (jint)57343L)
     {
      jchar d;
      jbyte b3;
      jbyte b4;
      if ((jint)c > (jint)56319L)
      {
       {
        java_nio_charset_CoderResult jcgo_retval= (java_nio_charset_CoderResult__malformedForLength__I(
         (jint)2));
#ifndef JCGO_SEHTRY
        jcgo_tryLeave();
        {
         (java_nio_Buffer__position__I(
          (java_nio_Buffer)in, inPos));
        }
#endif
        return jcgo_retval;
       }
      }
      if ((java_nio_Buffer__remaining__(
       (java_nio_Buffer)in)) < (jint)2)
      {
       {
        java_nio_charset_CoderResult jcgo_retval= JCGO_CLINIT_VARACC(java_nio_charset_CoderResult__class,
         java_nio_charset_CoderResult__UNDERFLOW);
#ifndef JCGO_SEHTRY
        jcgo_tryLeave();
        {
         (java_nio_Buffer__position__I(
          (java_nio_Buffer)in, inPos));
        }
#endif
        return jcgo_retval;
       }
      }
      b3= (java_nio_ByteBufferImpl__get__(
       (java_nio_ByteBufferImpl)in));
      b4= (java_nio_ByteBufferImpl__get__(
       (java_nio_ByteBufferImpl)in));
      d= ((jchar)(JCGO_FIELD_NZACCESS(This, byteOrder) == gnu_java_nio_charset_UTF_16Decoder__BIG_ENDIAN0?
       (jchar)(JCGO_SHL_F(((jint)((unsigned char)b3)), (jint)8) | ((jint)((unsigned char)b4))) :
       (jchar)(JCGO_SHL_F(((jint)((unsigned char)b4)), (jint)8) | ((jint)((unsigned char)b3)))));
      if ((jint)d < (jint)56320L || (jint)d > (jint)57343L)
      {
       {
        java_nio_charset_CoderResult jcgo_retval= (java_nio_charset_CoderResult__malformedForLength__I(
         (jint)2));
#ifndef JCGO_SEHTRY
        jcgo_tryLeave();
        {
         (java_nio_Buffer__position__I(
          (java_nio_Buffer)in, inPos));
        }
#endif
        return jcgo_retval;
       }
      }
      (JCGO_CALL_FINALF((java_nio_CharBufferImpl)out) java_nio_CharBufferImpl__put__C(
       (java_nio_CharBufferImpl)out, c));
      (java_nio_CharBufferImpl__put__C(
       (java_nio_CharBufferImpl)out, d));
      inPos+= (jint)4;
     }
     else
     {
      if (!(JCGO_CALL_FINALF(out) java_nio_Buffer__hasRemaining__(
       (java_nio_Buffer)out)))
      {
       {
        java_nio_charset_CoderResult jcgo_retval= JCGO_CLINIT_VARACC(java_nio_charset_CoderResult__class,
         java_nio_charset_CoderResult__UNDERFLOW);
#ifndef JCGO_SEHTRY
        jcgo_tryLeave();
        {
         (java_nio_Buffer__position__I(
          (java_nio_Buffer)in, inPos));
        }
#endif
        return jcgo_retval;
       }
      }
      (java_nio_CharBufferImpl__put__C(
       (java_nio_CharBufferImpl)out, c));
      inPos+= (jint)2;
     }
    }
    {
     java_nio_charset_CoderResult jcgo_retval= JCGO_CLINIT_VARACC(java_nio_charset_CoderResult__class,
      java_nio_charset_CoderResult__UNDERFLOW);
#ifndef JCGO_SEHTRY
     jcgo_tryLeave();
     {
      (java_nio_Buffer__position__I(
       (java_nio_Buffer)in, inPos));
     }
#endif
     return jcgo_retval;
    }
   }
   JCGO_TRY_LEAVE
   {
    (java_nio_Buffer__position__I(
     (java_nio_Buffer)in, inPos));
   }
   JCGO_TRY_FINALLYEND
  }
 }
 return jnull;
}

JCGO_NOSEP_INLINE void CFASTCALL
gnu_java_nio_charset_UTF_16Decoder__implReset__( gnu_java_nio_charset_UTF_16Decoder
 This )
{
 {
  JCGO_FIELD_NZACCESS(This, byteOrder)= JCGO_FIELD_NZACCESS(This, originalByteOrder);
 }
}

JCGO_NOSEP_DATA CONST struct gnu_java_nio_charset_UTF_16Decoder_methods_s
 gnu_java_nio_charset_UTF_16Decoder_methods=
{
 JCGO_CLASSREF_OF(gnu_java_nio_charset_UTF_16Decoder__class),
 JCGO_GCJDESCR_INIT(gnu_java_nio_charset_UTF_16Decoder_s, unmappableCharacterAction)
 OBJT_gnu_java_nio_charset_UTF_16Decoder,
 (JCGO_OBJSIZE_T)sizeof(struct gnu_java_nio_charset_UTF_16Decoder_s),
 NULL,
 JCGO_CLINIT_INIT(0)
 0,
 java_lang_Object__equals__Lo,
 java_lang_Object__hashCode__,
 java_lang_Object__toString__,
 java_lang_Object__finalize__,
 gnu_java_nio_charset_UTF_16Decoder__decodeLoop__L9oaiaL3367b,
 gnu_java_nio_charset_UTF_16Decoder__implReset__
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct gnu_java_nio_charset_UTF_16Decoder_class_s
 gnu_java_nio_charset_UTF_16Decoder__class JCGO_THRD_ATTRNONGC=
{
 {
  &java_lang_Class_methods,
  JCGO_MON_INIT
  JCGO_OBJREF_OF(*(java_lang_Object)&gnu_java_nio_charset_UTF_16Decoder_methods),
  JCGO_STRREF_OF(jcgo_string1_UTF16Dcd),
  JCGO_CLASSREF_OF(java_nio_charset_CharsetDecoder__class),
  ((jObjectArr)JCGO_OBJREF_OF(jcgo_array3_Object)),
  0x10
 }
};

JCGO_NOSEP_DATA CONST jcgo_arrtype87_GmCnnctn jcgo_array2_UTF16Dcd=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 34,
 {
  (jbyte)(jchar)103/*'g'*/, (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)117/*'u'*/,
   (jbyte)(jchar)46/*'.'*/, (jbyte)(jchar)106/*'j'*/, (jbyte)(jchar)97/*'a'*/,
   (jbyte)(jchar)118/*'v'*/, (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)46/*'.'*/,
   (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)111/*'o'*/,
   (jbyte)(jchar)46/*'.'*/, (jbyte)(jchar)99/*'c'*/, (jbyte)(jchar)104/*'h'*/,
   (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)114/*'r'*/, (jbyte)(jchar)115/*'s'*/,
   (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)46/*'.'*/,
   (jbyte)(jchar)85/*'U'*/, (jbyte)(jchar)84/*'T'*/, (jbyte)(jchar)70/*'F'*/,
   (jbyte)(jchar)95/*'_'*/, (jbyte)(jchar)49/*'1'*/, (jbyte)(jchar)54/*'6'*/,
   (jbyte)(jchar)68/*'D'*/, (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)99/*'c'*/,
   (jbyte)(jchar)111/*'o'*/, (jbyte)(jchar)100/*'d'*/, (jbyte)(jchar)101/*'e'*/,
   (jbyte)(jchar)114/*'r'*/
 }
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string1_UTF16Dcd
 JCGO_THRD_ATTRNONGC=
{
 &java_lang_String_methods,
 JCGO_MON_INIT
 (java_lang_Object)JCGO_OBJREF_OF(jcgo_array2_UTF16Dcd),
 0, 34, (jint)0x3e0f84dfL
};

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

#endif
