137 {
138 if (lhs.IsZero())
139 {
142 return;
143 }
147 {
148 var (
value, value2) = Math.DivRem(lhs._blocks[0], rhs._blocks[0]);
151 return;
152 }
154 {
156 ulong right = rhs._blocks[0];
157 ulong num2 = 0uL;
158 for (int num3 = num - 1; num3 >= 0; num3--)
159 {
160 ulong left = (num2 << 32) | lhs._blocks[num3];
161 ulong num4;
162 (num4, num2) = Math.DivRem(left, right);
163 if (num4 == 0
L && num3 == num - 1)
164 {
165 num--;
166 }
167 else
168 {
169 quo._blocks[num3] = (uint)num4;
170 }
171 }
172 quo._length = num;
174 return;
175 }
177 {
180 return;
181 }
185 uint num7 = rhs._blocks[
length2 - 1];
186 uint num8 = rhs._blocks[
length2 - 2];
188 int num10 = 32 - num9;
189 if (num9 > 0)
190 {
191 num7 = (num7 << num9) | (num8 >> num10);
192 num8 <<= num9;
194 {
195 num8 |= rhs._blocks[
length2 - 3] >> num10;
196 }
197 }
199 {
201 uint num13 = ((num11 <
length) ? rem._blocks[num11] : 0u);
202 ulong num14 = ((ulong)num13 << 32) | rem._blocks[num11 - 1];
203 uint num15 = ((num11 > 1) ? rem._blocks[num11 - 2] : 0u);
204 if (num9 > 0)
205 {
206 num14 = (num14 << num9) | (num15 >> num10);
207 num15 <<= num9;
208 if (num11 > 2)
209 {
210 num15 |= rem._blocks[num11 - 3] >> num10;
211 }
212 }
213 ulong num16 = num14 / num7;
214 if (num16 > uint.MaxValue)
215 {
216 num16 = 4294967295uL;
217 }
219 {
220 num16--;
221 }
222 if (num16 != 0)
223 {
225 if (num17 != num13)
226 {
228 num16--;
229 }
230 }
231 if (num5 != 0)
232 {
233 if (num16 == 0
L && num12 == num5 - 1)
234 {
235 num5--;
236 }
237 else
238 {
239 quo._blocks[num12] = (uint)num16;
240 }
241 }
242 if (num11 < num6)
243 {
244 num6--;
245 }
246 }
247 quo._length = num5;
248 for (int num18 = num6 - 1; num18 >= 0; num18--)
249 {
250 if (rem._blocks[num18] == 0)
251 {
252 num6--;
253 }
254 }
255 rem._length = num6;
256 }
static int LeadingZeroCount(uint value)
static bool DivideGuessTooBig(ulong q, ulong valHi, uint valLo, uint divHi, uint divLo)
static void SetZero(out BigInteger result)
static unsafe uint SubtractDivisor(ref BigInteger lhs, int lhsStartIndex, ref BigInteger rhs, ulong q)
static unsafe void SetValue(out BigInteger result, ref BigInteger value)
static unsafe uint AddDivisor(ref BigInteger lhs, int lhsStartIndex, ref BigInteger rhs)
static unsafe void SetUInt32(out BigInteger result, uint value)