// Automatically generated by xmlvm2csharp (do not edit).

using org.xmlvm;
namespace org.apache.harmony.luni.util {
public class Base64: global::java.lang.Object {

static Base64() {
    @static();
}

private static global::org.xmlvm._nArrayAdapter<sbyte> _fmap;

new public static void @static(){
//XMLVM_BEGIN_WRAPPER[org.apache.harmony.luni.util.Base64: void <clinit>()]
    global::org.xmlvm._nElement _r0;
    global::System.Object _r0_o = null;
    _r0.i = 64;
    _r0_o = new global::org.xmlvm._nArrayAdapter<sbyte>(new sbyte[_r0.i]);
    _r0_o = new global::org.xmlvm._nArrayAdapter<sbyte>(new sbyte[]{65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47});
    global::org.apache.harmony.luni.util.Base64._fmap = (global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o;
    return;
//XMLVM_END_WRAPPER[org.apache.harmony.luni.util.Base64: void <clinit>()]
}

new public void @this(){
//XMLVM_BEGIN_WRAPPER[org.apache.harmony.luni.util.Base64: void <init>()]
    global::System.Object _r0_o = null;
    _r0_o = this;
    ((global::java.lang.Object) _r0_o).@this();
    return;
//XMLVM_END_WRAPPER[org.apache.harmony.luni.util.Base64: void <init>()]
}

public static global::System.Object decode(global::org.xmlvm._nArrayAdapter<sbyte> n1){
//XMLVM_BEGIN_WRAPPER[org.apache.harmony.luni.util.Base64: byte[] decode(byte[])]
    global::org.xmlvm._nElement _r0;
    global::System.Object _r0_o = null;
    global::System.Object _r1_o = null;
    _r1_o = n1;
    _r0.i = ((global::org.xmlvm._nIArray) _r1_o).Length;
    _r0_o = global::org.apache.harmony.luni.util.Base64.decode((global::org.xmlvm._nArrayAdapter<sbyte>) _r1_o, (int) _r0.i);
    return (global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o;
//XMLVM_END_WRAPPER[org.apache.harmony.luni.util.Base64: byte[] decode(byte[])]
}

public static global::System.Object decode(global::org.xmlvm._nArrayAdapter<sbyte> n1, int n2){
//XMLVM_BEGIN_WRAPPER[org.apache.harmony.luni.util.Base64: byte[] decode(byte[], int)]
    global::org.xmlvm._nElement _r0;
    global::System.Object _r0_o = null;
    global::org.xmlvm._nElement _r1;
    global::org.xmlvm._nElement _r2;
    global::System.Object _r2_o = null;
    global::org.xmlvm._nElement _r3;
    global::org.xmlvm._nElement _r4;
    global::org.xmlvm._nElement _r5;
    global::org.xmlvm._nElement _r6;
    global::org.xmlvm._nElement _r7;
    global::org.xmlvm._nElement _r8;
    global::org.xmlvm._nElement _r9;
    global::org.xmlvm._nElement _r10;
    global::org.xmlvm._nElement _r11;
    global::org.xmlvm._nElement _r12;
    global::org.xmlvm._nElement _r13;
    global::System.Object _r14_o = null;
    global::org.xmlvm._nElement _r15;
    _r14_o = n1;
    _r15.i = n2;
    _r13.i = 13;
    _r12.i = 10;
    _r11.i = 9;
    _r10.i = 1;
    _r9.i = 0;
    _r0.i = _r15.i / 4;
    _r0.i = _r0.i * 3;
    if (_r0.i != 0) goto label17;
    _r0_o = new global::org.xmlvm._nArrayAdapter<sbyte>(new sbyte[_r9.i]);
    label16:;
    return (global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o;
    label17:;
    _r0_o = new global::org.xmlvm._nArrayAdapter<sbyte>(new sbyte[_r0.i]);
    _r1.i = _r9.i;
    _r2.i = _r15.i;
    label21:;
    _r3.i = _r2.i - _r10.i;
    _r3.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r14_o)[_r3.i];
    if (_r3.i == _r12.i) goto label35;
    if (_r3.i == _r13.i) goto label35;
    _r4.i = 32;
    if (_r3.i == _r4.i) goto label35;
    if (_r3.i != _r11.i) goto label38;
    label35:;
    _r2.i = _r2.i + -1;
    goto label21;
    label38:;
    _r4.i = 61;
    if (_r3.i != _r4.i) goto label45;
    _r1.i = _r1.i + 1;
    goto label35;
    label45:;
    _r3.i = _r9.i;
    _r4.i = _r9.i;
    _r5.i = _r9.i;
    _r6.i = _r9.i;
    label49:;
    if (_r3.i < _r2.i) goto label87;
    if (_r1.i <= 0) goto label196;
    _r2.i = _r1.i * 6;
    _r2.i = _r4.i << (0x1f & _r2.i);
    _r3.i = _r6.i + 1;
    _r4.i = 16711680;
    _r4.i = _r4.i & _r2.i;
    _r4.i = _r4.i >> (0x1f & 16);
    _r4.i = (_r4.i << 24) >> 24;
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r6.i] = (sbyte)_r4.i;
    if (_r1.i != _r10.i) goto label194;
    _r1.i = _r3.i + 1;
    _r4.i = 65280;
    _r2.i = _r2.i & _r4.i;
    _r2.i = _r2.i >> (0x1f & 8);
    _r2.i = (_r2.i << 24) >> 24;
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r3.i] = (sbyte)_r2.i;
    label80:;
    _r2_o = new global::org.xmlvm._nArrayAdapter<sbyte>(new sbyte[_r1.i]);
    global::java.lang.System.arraycopy((global::java.lang.Object) _r0_o, (int) _r9.i, (global::java.lang.Object) _r2_o, (int) _r9.i, (int) _r1.i);
    _r0_o = _r2_o;
    goto label16;
    label87:;
    _r7.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r14_o)[_r3.i];
    if (_r7.i == _r12.i) goto label99;
    if (_r7.i == _r13.i) goto label99;
    _r8.i = 32;
    if (_r7.i == _r8.i) goto label99;
    if (_r7.i != _r11.i) goto label102;
    label99:;
    _r3.i = _r3.i + 1;
    goto label49;
    label102:;
    _r8.i = 65;
    if (_r7.i < _r8.i) goto label154;
    _r8.i = 90;
    if (_r7.i > _r8.i) goto label154;
    _r8.i = 65;
    _r7.i = _r7.i - _r8.i;
    label113:;
    _r4.i = _r4.i << (0x1f & 6);
    _r7.i = (_r7.i << 24) >> 24;
    _r4.i = _r4.i | _r7.i;
    _r7.i = _r5.i % 4;
    _r8.i = 3;
    if (_r7.i != _r8.i) goto label151;
    _r7.i = _r6.i + 1;
    _r8.i = 16711680;
    _r8.i = _r8.i & _r4.i;
    _r8.i = _r8.i >> (0x1f & 16);
    _r8.i = (_r8.i << 24) >> 24;
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r6.i] = (sbyte)_r8.i;
    _r6.i = _r7.i + 1;
    _r8.i = 65280;
    _r8.i = _r8.i & _r4.i;
    _r8.i = _r8.i >> (0x1f & 8);
    _r8.i = (_r8.i << 24) >> 24;
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r7.i] = (sbyte)_r8.i;
    _r7.i = _r6.i + 1;
    _r8.i = _r4.i & 255;
    _r8.i = (_r8.i << 24) >> 24;
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r6.i] = (sbyte)_r8.i;
    _r6.i = _r7.i;
    label151:;
    _r5.i = _r5.i + 1;
    goto label99;
    label154:;
    _r8.i = 97;
    if (_r7.i < _r8.i) goto label166;
    _r8.i = 122;
    if (_r7.i > _r8.i) goto label166;
    _r8.i = 71;
    _r7.i = _r7.i - _r8.i;
    goto label113;
    label166:;
    _r8.i = 48;
    if (_r7.i < _r8.i) goto label177;
    _r8.i = 57;
    if (_r7.i > _r8.i) goto label177;
    _r7.i = _r7.i + 4;
    goto label113;
    label177:;
    _r8.i = 43;
    if (_r7.i != _r8.i) goto label184;
    _r7.i = 62;
    goto label113;
    label184:;
    _r8.i = 47;
    if (_r7.i != _r8.i) goto label191;
    _r7.i = 63;
    goto label113;
    label191:;
    _r0_o = null;
    goto label16;
    label194:;
    _r1.i = _r3.i;
    goto label80;
    label196:;
    _r1.i = _r6.i;
    goto label80;
//XMLVM_END_WRAPPER[org.apache.harmony.luni.util.Base64: byte[] decode(byte[], int)]
}

public static global::System.Object encode(global::org.xmlvm._nArrayAdapter<sbyte> n1, global::java.lang.String n2){
//XMLVM_BEGIN_WRAPPER[org.apache.harmony.luni.util.Base64: java.lang.String encode(byte[], java.lang.String)]
    global::org.xmlvm._nElement _r0;
    global::System.Object _r0_o = null;
    global::org.xmlvm._nElement _r1;
    global::org.xmlvm._nElement _r2;
    global::System.Object _r2_o = null;
    global::org.xmlvm._nElement _r3;
    global::System.Object _r3_o = null;
    global::org.xmlvm._nElement _r4;
    global::System.Object _r4_o = null;
    global::org.xmlvm._nElement _r5;
    global::org.xmlvm._nElement _r6;
    global::System.Object _r6_o = null;
    global::org.xmlvm._nElement _r7;
    global::org.xmlvm._nElement _r8;
    global::org.xmlvm._nElement _r9;
    global::org.xmlvm._nElement _r10;
    global::System.Object _r11_o = null;
    global::System.Object _r12_o = null;
    _r11_o = n1;
    _r12_o = n2;
    _r10.i = 61;
    _r9.i = 0;
    _r0.i = ((global::org.xmlvm._nIArray) _r11_o).Length;
    _r0.i = _r0.i * 4;
    _r0.i = _r0.i / 3;
    _r1.i = _r0.i / 76;
    _r1.i = _r1.i + 3;
    _r0.i = _r0.i + _r1.i;
    _r0_o = new global::org.xmlvm._nArrayAdapter<sbyte>(new sbyte[_r0.i]);
    _r1.i = ((global::org.xmlvm._nIArray) _r11_o).Length;
    _r2.i = ((global::org.xmlvm._nIArray) _r11_o).Length;
    _r2.i = _r2.i % 3;
    _r1.i = _r1.i - _r2.i;
    _r2.i = _r9.i;
    _r3.i = _r9.i;
    _r4.i = _r9.i;
    label23:;
    if (_r3.i < _r1.i) goto label38;
    _r2.i = ((global::org.xmlvm._nIArray) _r11_o).Length;
    _r2.i = _r2.i % 3;
    switch (_r2.i) {
    case 1: goto label134;
    case 2: goto label173;
    }
    _r1.i = _r4.i;
    label32:;
    _r2_o = new global::java.lang.String();
    ((global::java.lang.String) _r2_o).@this((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o, (int) _r9.i, (int) _r1.i, (global::java.lang.String) _r12_o);
    return (global::java.lang.String) _r2_o;
    label38:;
    _r5.i = _r4.i + 1;
    _r6_o = global::org.apache.harmony.luni.util.Base64._fmap;
    _r7.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r3.i];
    _r7.i = _r7.i & 255;
    _r7.i = _r7.i >> (0x1f & 2);
    _r6.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r6_o)[_r7.i];
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r4.i] = (sbyte)_r6.i;
    _r4.i = _r5.i + 1;
    _r6_o = global::org.apache.harmony.luni.util.Base64._fmap;
    _r7.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r3.i];
    _r7.i = _r7.i & 3;
    _r7.i = _r7.i << (0x1f & 4);
    _r8.i = _r3.i + 1;
    _r8.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r8.i];
    _r8.i = _r8.i & 255;
    _r8.i = _r8.i >> (0x1f & 4);
    _r7.i = _r7.i | _r8.i;
    _r6.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r6_o)[_r7.i];
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r5.i] = (sbyte)_r6.i;
    _r5.i = _r4.i + 1;
    _r6_o = global::org.apache.harmony.luni.util.Base64._fmap;
    _r7.i = _r3.i + 1;
    _r7.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r7.i];
    _r7.i = _r7.i & 15;
    _r7.i = _r7.i << (0x1f & 2);
    _r8.i = _r3.i + 2;
    _r8.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r8.i];
    _r8.i = _r8.i & 255;
    _r8.i = _r8.i >> (0x1f & 6);
    _r7.i = _r7.i | _r8.i;
    _r6.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r6_o)[_r7.i];
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r4.i] = (sbyte)_r6.i;
    _r4.i = _r5.i + 1;
    _r6_o = global::org.apache.harmony.luni.util.Base64._fmap;
    _r7.i = _r3.i + 2;
    _r7.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r7.i];
    _r7.i = _r7.i & 63;
    _r6.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r6_o)[_r7.i];
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r5.i] = (sbyte)_r6.i;
    _r5.i = _r4.i - _r2.i;
    _r5.i = _r5.i % 76;
    if (_r5.i != 0) goto label131;
    if (_r4.i == 0) goto label131;
    _r5.i = _r4.i + 1;
    _r6.i = 10;
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r4.i] = (sbyte)_r6.i;
    _r2.i = _r2.i + 1;
    _r4.i = _r5.i;
    label131:;
    _r3.i = _r3.i + 3;
    goto label23;
    label134:;
    _r2.i = _r4.i + 1;
    _r3_o = global::org.apache.harmony.luni.util.Base64._fmap;
    _r5.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r1.i];
    _r5.i = _r5.i & 255;
    _r5.i = _r5.i >> (0x1f & 2);
    _r3.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r3_o)[_r5.i];
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r4.i] = (sbyte)_r3.i;
    _r3.i = _r2.i + 1;
    _r4_o = global::org.apache.harmony.luni.util.Base64._fmap;
    _r1.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r1.i];
    _r1.i = _r1.i & 3;
    _r1.i = _r1.i << (0x1f & 4);
    _r1.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r4_o)[_r1.i];
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r2.i] = (sbyte)_r1.i;
    _r1.i = _r3.i + 1;
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r3.i] = (sbyte)_r10.i;
    _r2.i = _r1.i + 1;
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r1.i] = (sbyte)_r10.i;
    _r1.i = _r2.i;
    goto label32;
    label173:;
    _r2.i = _r4.i + 1;
    _r3_o = global::org.apache.harmony.luni.util.Base64._fmap;
    _r5.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r1.i];
    _r5.i = _r5.i & 255;
    _r5.i = _r5.i >> (0x1f & 2);
    _r3.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r3_o)[_r5.i];
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r4.i] = (sbyte)_r3.i;
    _r3.i = _r2.i + 1;
    _r4_o = global::org.apache.harmony.luni.util.Base64._fmap;
    _r5.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r1.i];
    _r5.i = _r5.i & 3;
    _r5.i = _r5.i << (0x1f & 4);
    _r6.i = _r1.i + 1;
    _r6.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r6.i];
    _r6.i = _r6.i & 255;
    _r6.i = _r6.i >> (0x1f & 4);
    _r5.i = _r5.i | _r6.i;
    _r4.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r4_o)[_r5.i];
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r2.i] = (sbyte)_r4.i;
    _r2.i = _r3.i + 1;
    _r4_o = global::org.apache.harmony.luni.util.Base64._fmap;
    _r1.i = _r1.i + 1;
    _r1.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r11_o)[_r1.i];
    _r1.i = _r1.i & 15;
    _r1.i = _r1.i << (0x1f & 2);
    _r1.i = ((global::org.xmlvm._nArrayAdapter<sbyte>) _r4_o)[_r1.i];
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r3.i] = (sbyte)_r1.i;
    _r1.i = _r2.i + 1;
    ((global::org.xmlvm._nArrayAdapter<sbyte>) _r0_o)[_r2.i] = (sbyte)_r10.i;
    goto label32;
//XMLVM_END_WRAPPER[org.apache.harmony.luni.util.Base64: java.lang.String encode(byte[], java.lang.String)]
}

//XMLVM_BEGIN_WRAPPER[org.apache.harmony.luni.util.Base64]
//XMLVM_END_WRAPPER[org.apache.harmony.luni.util.Base64]

} // end of class: Base64

} // end of namespace: org.apache.harmony.luni.util
