package com.google.android.m4b.maps.bo;

import android.content.res.Resources;
import android.os.SystemClock;
import com.google.android.m4b.maps.ak.r;
import com.google.android.m4b.maps.am.b;
import com.google.android.m4b.maps.bc.af;
import com.google.android.m4b.maps.bl.n;
import com.google.android.m4b.maps.bp.f;
import com.google.android.m4b.maps.bp.f.a;
import com.google.android.m4b.maps.bp.i.a;
import com.google.android.m4b.maps.bp.j;
import com.google.android.m4b.maps.bp.k;
import com.google.android.m4b.maps.bp.m.a;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Maps;
import java.lang.ref.WeakReference;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.opengles.GL11;

public final class e
{
  private static final AtomicLong H = new AtomicLong(0L);
  private static final Map<Long, WeakReference<e>> J = Maps.newHashMap();
  private boolean A = true;
  private final int B;
  private boolean C = false;
  private final int D;
  private final com.google.android.m4b.maps.bt.g E;
  private final a F = new a();
  private final j G = new j();
  private final long I = H.getAndIncrement();
  private m K;
  final GL10 a;
  final boolean b;
  public final com.google.android.m4b.maps.bp.g c = new i.a(new int[] { 0, 0, 0, 65536, 65536, 0, 65536, 65536 });
  public final f d = new f.a(new float[] { -1.0F, 1.0F, 0.0F, 0.0F, 0.0F, -1.0F, -1.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F, 0.0F, 1.0F, 0.0F, 1.0F, -1.0F, 0.0F, 1.0F, 1.0F }, 9);
  public final k e = new m.a(new int[] { 0, 65536, 0, 0, 0, 0, 65536, 65536, 0, 65536, 0, 0 });
  public final k f = new m.a(new int[] { 0, 0, 65536, 0, 0, 0, 65536, 0, 65536, 65536, 0, 0 });
  public final k g = new m.a(new int[] { -65536, 65536, 0, -65536, -65536, 0, 65536, 65536, 0, 65536, -65536, 0 });
  public final k h = new m.a(new int[] { -65536, 0, 65536, -65536, 0, -65536, 65536, 0, 65536, 65536, 0, -65536 });
  public final k i = new m.a(new int[] { 0, 65536, 0, 0, 0, 0, 65536, 0, 0, 65536, 65536, 0 });
  public final float[] j = new float[8];
  public final float[] k = new float[4];
  public final af l = new af();
  public final af m = new af();
  private n n;
  private final h o;
  private final int[] p;
  private int q;
  private int r;
  private int[] s;
  private int t;
  private Integer u;
  private Integer v;
  private boolean w;
  private long x;
  private long y;
  private boolean z = true;

  public e(GL10 paramGL10, h paramh, n paramn, com.google.android.m4b.maps.bt.g paramg, Resources paramResources)
  {
    this.a = paramGL10;
    this.n = paramn;
    this.o = paramh;
    this.E = paramg;
    this.a.glDisable(3024);
    this.a.glEnable(2884);
    this.a.glDisable(2929);
    this.a.glDisable(2960);
    this.a.glCullFace(1029);
    this.a.glFrontFace(2305);
    this.a.glShadeModel(7425);
    this.a.glHint(3152, 4354);
    this.r = 0;
    this.p = new int[256];
    this.q = 0;
    this.s = new int[32];
    this.t = 0;
    boolean bool;
    if ((((paramGL10 instanceof GL11)) && (paramGL10.glGetString(7938).contains("1.1"))) || ((paramGL10 instanceof d)))
      bool = true;
    while (true)
    {
      this.b = bool;
      int[] arrayOfInt = new int[1];
      paramGL10.glGetIntegerv(3415, arrayOfInt, 0);
      this.B = arrayOfInt[0];
      paramGL10.glGetIntegerv(3410, arrayOfInt, 0);
      int i1 = arrayOfInt[0];
      paramGL10.glGetIntegerv(3411, arrayOfInt, 0);
      int i2 = arrayOfInt[0];
      paramGL10.glGetIntegerv(3412, arrayOfInt, 0);
      int i3 = arrayOfInt[0];
      paramGL10.glGetIntegerv(3413, arrayOfInt, 0);
      int i4 = arrayOfInt[0];
      paramGL10.glGetIntegerv(3414, arrayOfInt, 0);
      int i5 = arrayOfInt[0];
      String str1 = paramGL10.glGetString(7936);
      String str2 = paramGL10.glGetString(7938);
      String str3 = paramGL10.glGetString(7937);
      String[] arrayOfString = new String[10];
      arrayOfString[0] = ("r=" + i1);
      arrayOfString[1] = ("g=" + i2);
      arrayOfString[2] = ("b=" + i3);
      arrayOfString[3] = ("a=" + i4);
      arrayOfString[4] = ("d=" + i5);
      arrayOfString[5] = ("s=" + this.B);
      arrayOfString[6] = ("v=" + str1);
      arrayOfString[7] = ("i=" + str2);
      arrayOfString[8] = ("c=" + str3);
      StringBuilder localStringBuilder = new StringBuilder("e=");
      String str4;
      if (b.a())
      {
        str4 = "t";
        arrayOfString[9] = str4;
        r.a(58, "gl", r.a(arrayOfString));
        paramGL10.glGetIntegerv(3379, arrayOfInt, 0);
        this.D = arrayOfInt[0];
      }
      synchronized (J)
      {
        J.put(Long.valueOf(this.I), new WeakReference(this));
        if (paramResources != null)
          this.K = new m(paramResources, this);
        return;
        bool = false;
        continue;
        str4 = "f";
      }
    }
  }

  public static long a(e parame)
  {
    if (parame == null)
      return -1L;
    return parame.I;
  }

  private void a(int paramInt, boolean paramBoolean)
  {
    if (paramBoolean)
    {
      this.r = (paramInt | this.r);
      int[] arrayOfInt2 = this.p;
      int i2 = this.q;
      this.q = (i2 + 1);
      arrayOfInt2[i2] = paramInt;
      return;
    }
    this.r &= (paramInt ^ 0xFFFFFFFF);
    int[] arrayOfInt1 = this.p;
    int i1 = this.q;
    this.q = (i1 + 1);
    arrayOfInt1[i1] = (0x40000000 | paramInt);
  }

  public static e b(long paramLong)
  {
    while (true)
    {
      synchronized (J)
      {
        WeakReference localWeakReference = (WeakReference)J.get(Long.valueOf(paramLong));
        if (localWeakReference != null)
        {
          locale = (e)localWeakReference.get();
          if (locale == null)
            J.remove(Long.valueOf(paramLong));
          return locale;
        }
      }
      e locale = null;
    }
  }

  public final void A()
  {
    while (true)
    {
      int i1 = -1 + this.q;
      this.q = i1;
      if ((i1 < 0) || (this.p[this.q] == 2147483647))
        break;
      int i2;
      label49: int i3;
      if ((0x40000000 & this.p[this.q]) != 0)
      {
        i2 = 1;
        i3 = 0x3FFFFFFF & this.p[this.q];
        switch (i3)
        {
        default:
        case 1:
        case 2:
        case 4:
        case 8:
        case 16:
        case 32:
        case 64:
        case 128:
        }
      }
      while (true)
      {
        if (i2 == 0)
          break label458;
        this.r = (i3 | this.r);
        break;
        i2 = 0;
        break label49;
        if (i2 != 0)
        {
          this.a.glEnableClientState(32884);
        }
        else
        {
          this.a.glDisableClientState(32884);
          continue;
          if (i2 != 0)
          {
            this.a.glEnable(3553);
            this.a.glEnableClientState(32888);
          }
          else
          {
            this.a.glDisable(3553);
            this.a.glDisableClientState(32888);
            continue;
            if (i2 != 0)
            {
              this.a.glEnable(3042);
            }
            else
            {
              this.a.glDisable(3042);
              continue;
              if (i2 != 0)
              {
                this.a.glEnableClientState(32886);
              }
              else
              {
                this.a.glDisableClientState(32886);
                continue;
                if (i2 != 0)
                {
                  this.a.glEnable(3024);
                }
                else
                {
                  this.a.glDisable(3024);
                  continue;
                  if (i2 != 0)
                  {
                    this.a.glEnable(2929);
                  }
                  else
                  {
                    this.a.glDisable(2929);
                    continue;
                    if (i2 != 0)
                    {
                      this.a.glEnable(32823);
                    }
                    else
                    {
                      this.a.glDisable(32823);
                      continue;
                      if (i2 != 0)
                        this.a.glEnable(2960);
                      else
                        this.a.glDisable(2960);
                    }
                  }
                }
              }
            }
          }
        }
      }
      label458: this.r &= (i3 ^ 0xFFFFFFFF);
    }
  }

  public final void B()
  {
    try
    {
      if (this.t > 0)
      {
        this.a.glDeleteTextures(this.t, this.s, 0);
        this.t = 0;
      }
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final int C()
  {
    if (this.u == null)
    {
      int[] arrayOfInt = new int[1];
      this.a.glGetIntegerv(3379, arrayOfInt, 0);
      this.u = Integer.valueOf(arrayOfInt[0]);
    }
    return this.u.intValue();
  }

  public final int D()
  {
    if (this.v == null)
    {
      int[] arrayOfInt = new int[2];
      this.a.glGetIntegerv(33902, arrayOfInt, 0);
      this.v = Integer.valueOf(arrayOfInt[1]);
    }
    return this.v.intValue();
  }

  public final a E()
  {
    return this.F;
  }

  public final boolean F()
  {
    return this.b;
  }

  public final int G()
  {
    return this.B;
  }

  public final boolean H()
  {
    return this.C;
  }

  public final int I()
  {
    return this.D;
  }

  public final j J()
  {
    return this.G;
  }

  public final m a()
  {
    return this.K;
  }

  public final void a(long paramLong)
  {
    if (this.x == 0L);
    for (this.x = paramLong; ; this.x = Math.min(this.x, paramLong))
    {
      this.n.a(this.x);
      return;
    }
  }

  public final void a(boolean paramBoolean)
  {
    this.C = paramBoolean;
  }

  public final boolean a(int paramInt)
  {
    boolean bool = true;
    if (!this.n.a(paramInt))
    {
      this.w = bool;
      bool = false;
    }
    return bool;
  }

  public final void b()
  {
    this.w = true;
  }

  public final void b(int paramInt)
  {
    this.n.b(20000);
  }

  public final long c()
  {
    if (this.x == 0L)
      return -1L;
    return Math.max(0L, this.x - SystemClock.uptimeMillis());
  }

  public final void c(int paramInt)
  {
    try
    {
      if (this.t == this.s.length)
      {
        int[] arrayOfInt2 = new int[2 * this.s.length];
        System.arraycopy(this.s, 0, arrayOfInt2, 0, this.s.length);
        this.s = arrayOfInt2;
      }
      int[] arrayOfInt1 = this.s;
      int i1 = this.t;
      this.t = (i1 + 1);
      arrayOfInt1[i1] = paramInt;
      return;
    }
    finally
    {
    }
  }

  @VisibleForTesting
  public final boolean d()
  {
    return this.w;
  }

  public final long e()
  {
    return this.y;
  }

  @VisibleForTesting
  public final void f()
  {
    this.n.a();
    this.y = SystemClock.uptimeMillis();
    this.w = false;
    if ((this.x != 0L) && (this.y >= this.x))
      this.x = 0L;
  }

  public final void g()
  {
    this.n.b();
  }

  public final boolean h()
  {
    return this.z;
  }

  public final void i()
  {
    this.z = false;
  }

  public final boolean j()
  {
    return this.A;
  }

  public final void k()
  {
    this.A = false;
  }

  public final h l()
  {
    return this.o;
  }

  public final void m()
  {
    if ((0x1 & this.r) == 0)
    {
      this.a.glEnableClientState(32884);
      a(1, true);
    }
  }

  public final void n()
  {
    if ((0x8 & this.r) == 0)
    {
      this.a.glEnableClientState(32886);
      a(8, true);
    }
  }

  public final void o()
  {
    if ((0x8 & this.r) != 0)
    {
      this.a.glDisableClientState(32886);
      a(8, false);
    }
  }

  public final void p()
  {
    if ((0x2 & this.r) == 0)
    {
      this.a.glEnable(3553);
      this.a.glEnableClientState(32888);
      a(2, true);
    }
  }

  public final void q()
  {
    if ((0x2 & this.r) != 0)
    {
      this.a.glDisable(3553);
      this.a.glDisableClientState(32888);
      a(2, false);
    }
  }

  public final void r()
  {
    if ((0x4 & this.r) == 0)
    {
      this.a.glEnable(3042);
      a(4, true);
    }
  }

  public final void s()
  {
    if ((0x10 & this.r) == 0)
    {
      this.a.glEnable(3024);
      a(16, true);
    }
  }

  public final void t()
  {
    if ((0x20 & this.r) == 0)
    {
      this.z = true;
      this.a.glEnable(2929);
      a(32, true);
    }
  }

  public final void u()
  {
    if ((0x40 & this.r) == 0)
    {
      this.a.glEnable(32823);
      a(64, true);
    }
  }

  public final void v()
  {
    if ((0x80 & this.r) == 0)
    {
      this.A = true;
      this.a.glEnable(2960);
      a(128, true);
    }
  }

  public final void w()
  {
    if ((0x80 & this.r) != 0)
    {
      this.a.glDisable(2960);
      a(128, false);
    }
  }

  public final GL10 x()
  {
    return this.a;
  }

  public final n y()
  {
    return this.n;
  }

  public final void z()
  {
    int[] arrayOfInt = this.p;
    int i1 = this.q;
    this.q = (i1 + 1);
    arrayOfInt[i1] = 2147483647;
  }
}

/* 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.bo.e
 * JD-Core Version:    0.6.2
 */