80 {
83 int num = utf16.Length & -4;
85 int num2 = 0;
86 int num3 = 0;
88 {
90 int num4 = ((
length < (num >> 2) * 3) ? (
length / 3 * 4) : (num - 4));
91 while (true)
92 {
93 if (num2 < num4)
94 {
95 int num5 =
Decode(ref
Unsafe.Add(ref reference, num2), ref reference3);
96 if (num5 >= 0)
97 {
99 num3 += 3;
100 num2 += 4;
101 continue;
102 }
103 }
104 else if (num4 == num - 4 && num2 != num)
105 {
106 int num6 =
Unsafe.Add(ref reference, num - 4);
107 int num7 =
Unsafe.Add(ref reference, num - 3);
108 int num8 =
Unsafe.Add(ref reference, num - 2);
109 int num9 =
Unsafe.Add(ref reference, num - 1);
110 if (((num6 | num7 | num8 | num9) & 0xFFFFFF00u) == 0
L)
111 {
112 num6 =
Unsafe.Add(ref reference3, num6);
113 num7 =
Unsafe.Add(ref reference3, num7);
114 num6 <<= 18;
115 num7 <<= 12;
116 num6 |= num7;
117 if (num9 != 61)
118 {
119 num8 =
Unsafe.Add(ref reference3, num8);
120 num9 =
Unsafe.Add(ref reference3, num9);
121 num8 <<= 6;
122 num6 |= num9;
123 num6 |= num8;
124 if (num6 >= 0 && num3 <=
length - 3)
125 {
127 num3 += 3;
128 goto IL_01e6;
129 }
130 }
131 else if (num8 != 61)
132 {
133 num8 =
Unsafe.Add(ref reference3, num8);
134 num8 <<= 6;
135 num6 |= num8;
136 if (num6 >= 0 && num3 <=
length - 2)
137 {
138 Unsafe.Add(ref reference2, num3) = (byte)(num6 >> 16);
139 Unsafe.Add(ref reference2, num3 + 1) = (byte)(num6 >> 8);
140 num3 += 2;
141 goto IL_01e6;
142 }
143 }
144 else if (num6 >= 0 && num3 <=
length - 1)
145 {
146 Unsafe.Add(ref reference2, num3) = (byte)(num6 >> 16);
147 num3++;
148 goto IL_01e6;
149 }
150 }
151 }
152 goto IL_0200;
153 IL_0200:
154 consumed = num2;
155 written = num3;
156 return false;
157 IL_01e6:
158 num2 += 4;
160 {
161 break;
162 }
163 goto IL_0200;
164 }
165 }
166 consumed = num2;
167 written = num3;
168 return true;
169 }
static ReadOnlySpan< sbyte > DecodingMap
static int Decode(ref char encodedChars, ref sbyte decodingMap)
static void WriteThreeLowOrderBytes(ref byte destination, int value)