package com.google.android.m4b.maps.bp;

import com.google.android.m4b.maps.ar.b;
import com.google.android.m4b.maps.ar.b.a;
import com.google.android.m4b.maps.bo.e;
import com.google.android.m4b.maps.bo.h;
import java.nio.ByteBuffer;
import javax.microedition.khronos.opengles.GL10;

public class a
{
  protected byte[] a;
  protected int b;
  ByteBuffer c;
  protected int d = 0;
  protected b e;
  private int f;
  private int g;
  private boolean h;
  private int i = 0;

  public a(int paramInt)
  {
    this(paramInt, false);
  }

  public a(int paramInt, boolean paramBoolean)
  {
    this.h = paramBoolean;
    this.f = paramInt;
    this.g = 0;
    int j;
    if (this.a == null)
    {
      j = 4 * this.f;
      if ((j < 4096) || (this.h))
        this.a = new byte[j];
    }
    while (true)
    {
      this.b = 0;
      this.c = null;
      return;
      this.e = new b(j);
      c();
      continue;
      if (this.e != null)
      {
        this.e.a();
        c();
      }
    }
  }

  private void a(byte[] paramArrayOfByte, int paramInt)
  {
    int j = this.i;
    int k = 0;
    if (j > 0)
      while (k < paramInt)
      {
        int m = 0xFF & paramArrayOfByte[k];
        int n = this.i + m * (255 - this.i) / 255;
        this.c.put((byte)n);
        k++;
      }
    this.c.put(paramArrayOfByte, 0, paramInt);
  }

  private void c()
  {
    if (this.e != null)
    {
      this.e.b(this.g);
      this.a = ((byte[])this.e.c);
      this.g = this.e.d;
    }
  }

  public final int a()
  {
    return this.d;
  }

  public final void a(int paramInt)
  {
    int j;
    int k;
    if (paramInt > this.f)
    {
      j = Math.max(paramInt, 2 * this.f);
      k = j * 4;
      if (this.e != null)
        break label136;
      if ((k >= 4096) && (!this.h))
        break label81;
      byte[] arrayOfByte = new byte[k];
      System.arraycopy(this.a, 0, arrayOfByte, 0, this.g);
      this.a = arrayOfByte;
    }
    while (true)
    {
      this.f = j;
      return;
      label81: this.e = new b(k);
      this.e.a(this.a, this.g);
      this.a = ((byte[])this.e.c);
      this.g = this.e.d;
      continue;
      label136: this.e.c(k);
    }
  }

  public final void a(int paramInt1, int paramInt2)
  {
    int j = (byte)(paramInt1 >>> 24);
    int k = (byte)(paramInt1 >>> 16);
    int m = (byte)(paramInt1 >>> 8);
    int n = (byte)paramInt1;
    for (int i1 = 0; i1 < paramInt2; i1++)
    {
      byte[] arrayOfByte1 = this.a;
      int i2 = this.g;
      this.g = (i2 + 1);
      arrayOfByte1[i2] = j;
      byte[] arrayOfByte2 = this.a;
      int i3 = this.g;
      this.g = (i3 + 1);
      arrayOfByte2[i3] = k;
      byte[] arrayOfByte3 = this.a;
      int i4 = this.g;
      this.g = (i4 + 1);
      arrayOfByte3[i4] = m;
      byte[] arrayOfByte4 = this.a;
      int i5 = this.g;
      this.g = (i5 + 1);
      arrayOfByte4[i5] = n;
      if (this.g >= 4096)
        c();
    }
    this.b = (paramInt2 + this.b);
  }

  protected final void a(int paramInt, boolean paramBoolean)
  {
    if (this.e == null)
      a(this.a, paramInt);
    while (true)
    {
      this.c.limit(paramInt);
      this.c.position(0);
      if (paramBoolean)
      {
        if (this.e != null)
        {
          this.e.c();
          this.e = null;
        }
        this.a = null;
      }
      return;
      c();
      this.e.a(new b.a()
      {
        public final void a(byte[] paramAnonymousArrayOfByte, int paramAnonymousInt)
        {
          a.a(a.this, paramAnonymousArrayOfByte, paramAnonymousInt);
        }
      });
    }
  }

  public void a(e parame)
  {
  }

  public int b()
  {
    int j = 32;
    if (this.e != null)
      j = 32 + this.e.b();
    while (true)
    {
      if (this.c != null)
        j += this.c.capacity();
      return j;
      if (this.a != null)
        j = 32 + (16 + this.a.length);
    }
  }

  public final void b(int paramInt1, int paramInt2)
  {
    int j = (byte)(paramInt1 >>> 24);
    int k = (byte)(paramInt1 >>> 16);
    int m = (byte)(paramInt1 >>> 8);
    int n = (byte)paramInt1;
    for (int i1 = 0; i1 < paramInt2; i1++)
    {
      byte[] arrayOfByte1 = this.a;
      int i2 = this.g;
      this.g = (i2 + 1);
      arrayOfByte1[i2] = k;
      byte[] arrayOfByte2 = this.a;
      int i3 = this.g;
      this.g = (i3 + 1);
      arrayOfByte2[i3] = m;
      byte[] arrayOfByte3 = this.a;
      int i4 = this.g;
      this.g = (i4 + 1);
      arrayOfByte3[i4] = n;
      byte[] arrayOfByte4 = this.a;
      int i5 = this.g;
      this.g = (i5 + 1);
      arrayOfByte4[i5] = j;
      if (this.g >= 4096)
        c();
    }
    this.b = (paramInt2 + this.b);
  }

  public final void b(e parame)
  {
    a(parame);
    if (this.e != null)
    {
      this.e.c();
      this.e = null;
    }
    this.a = null;
  }

  public void c(e parame)
  {
    if (this.c == null)
      d(parame);
    this.d = this.c.limit();
    parame.x().glColorPointer(4, 5121, 0, this.c);
  }

  protected void d(e parame)
  {
    int j = 4 * this.b;
    this.c = parame.l().a(j);
    a(j, true);
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.android.m4b.maps.bp.a
 * JD-Core Version:    0.6.2
 */