// Decompiled with JetBrains decompiler
// Type: .
// Assembly: WindowsBC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9909ee17073e3364
// MVID: 658BFC85-36E1-493D-98E6-AE9127D73D60
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare.00004-msil\Trojan-Downloader.MSIL.BitCoinMiner.c-64f742a0b28b2c3d2a62ef6607fcfd5fa55b793a1aff3a6c11e014e3b119149e.exe

using \u000E;
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace \u000E\u0002
{
  internal sealed class \u0014
  {
    private byte[] \u0001;
    private int \u0002;
    private int \u0003;
    private uint \u0004;
    private int \u0005;

    public int \u0013\u0003([In] int obj0)
    {
      if (this.\u0005 < obj0)
        goto label_4;
label_3:
      return (int) ((long) this.\u0004 & (long) ((1 << obj0) - 1));
label_4:
      if (this.\u0002 == this.\u0003)
        return -1;
      this.\u0004 |= (uint) (((int) this.\u0001[this.\u0002++] & (int) byte.MaxValue | ((int) this.\u0001[this.\u0002++] & (int) byte.MaxValue) << 8) << this.\u0005);
      this.\u0005 += 16;
      goto label_3;
    }

    public void \u0014\u0003([In] int obj0)
    {
      this.\u0004 >>= obj0;
      this.\u0005 -= obj0;
    }

    [SpecialName]
    public int \u0015\u0003() => this.\u0005;

    [SpecialName]
    public int \u0016\u0003() => this.\u0003 - this.\u0002 + (this.\u0005 >> 3);

    public void \u0017\u0003()
    {
      this.\u0004 >>= this.\u0005 & 7;
      this.\u0005 &= -8;
    }

    [SpecialName]
    public bool \u0018\u0003() => this.\u0002 == this.\u0003;

    public int \u0019\u0003([In] byte[] obj0, [In] int obj1, [In] int obj2)
    {
      if (obj2 < 0)
        throw new ArgumentOutOfRangeException(\u0008.\u000E\u0003(3156));
      if ((this.\u0005 & 7) != 0)
        throw new InvalidOperationException(\u0008.\u000E\u0003(3165));
      int num1 = 0;
      while (this.\u0005 > 0 && obj2 > 0)
      {
        obj0[obj1++] = (byte) this.\u0004;
        this.\u0004 >>= 8;
        this.\u0005 -= 8;
        --obj2;
        ++num1;
      }
      if (obj2 == 0)
        return num1;
      int num2 = this.\u0003 - this.\u0002;
      if (obj2 > num2)
        obj2 = num2;
      \u008F\u0003.\u0098((Array) this.\u0001, this.\u0002, (Array) obj0, obj1, obj2);
      this.\u0002 += obj2;
      if ((this.\u0002 - this.\u0003 & 1) != 0)
      {
        this.\u0004 = (uint) this.\u0001[this.\u0002++] & (uint) byte.MaxValue;
        this.\u0005 = 8;
      }
      return num1 + obj2;
    }

    public void \u001A\u0003([In] byte[] obj0, [In] int obj1, [In] int obj2)
    {
      if (obj0 == null)
        throw new ArgumentNullException(\u0008.\u000E\u0003(568));
      if (obj1 < 0)
        throw new ArgumentOutOfRangeException(\u0008.\u000E\u0003(577), \u0008.\u000E\u0003(2972));
      if (obj2 < 0)
        throw new ArgumentOutOfRangeException(\u0008.\u000E\u0003(611), \u0008.\u000E\u0003(2972));
      if (this.\u0002 < this.\u0003)
        throw new InvalidOperationException(\u0008.\u000E\u0003(3210));
      int num = obj1 + obj2;
      if (obj1 > num || num > obj0.Length)
        throw new ArgumentOutOfRangeException(\u0008.\u000E\u0003(611));
      if ((obj2 & 1) != 0)
      {
        this.\u0004 |= (uint) (((int) obj0[obj1++] & (int) byte.MaxValue) << this.\u0005);
        this.\u0005 += 8;
      }
      this.\u0001 = obj0;
      this.\u0002 = obj1;
      this.\u0003 = num;
    }
  }
}
