package com.google.android.m4b.maps.bq;

import android.graphics.Bitmap;
import com.google.android.m4b.maps.aj.a.c;
import com.google.android.m4b.maps.an.e.a;
import com.google.android.m4b.maps.ba.f;
import com.google.android.m4b.maps.bc.af;
import com.google.android.m4b.maps.bc.ag;
import com.google.android.m4b.maps.bc.am;
import com.google.android.m4b.maps.bc.ao;
import com.google.android.m4b.maps.bc.as;
import com.google.android.m4b.maps.bc.b.a;
import com.google.android.m4b.maps.bc.ba;
import com.google.android.m4b.maps.bc.br;
import com.google.android.m4b.maps.bc.k;
import com.google.android.m4b.maps.bc.l;
import com.google.android.m4b.maps.bc.s;
import com.google.android.m4b.maps.bc.s.a;
import com.google.android.m4b.maps.bl.ai;
import com.google.android.m4b.maps.bl.ak;
import com.google.android.m4b.maps.bl.an;
import com.google.android.m4b.maps.bl.j;
import com.google.android.m4b.maps.bo.l.a;
import com.google.android.m4b.maps.bs.c;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.eventbus.EventBus;
import javax.microedition.khronos.opengles.GL10;

public class n extends h
{
  private static final b[] D = new b[0];
  private static final b[] E = arrayOfb;
  private float A;
  private final float B;
  private final float[] C = new float[8];
  protected com.google.android.m4b.maps.bc.a h;
  protected i i;
  protected i j;
  protected b k;
  protected float l;
  protected float m;
  protected float n;
  protected float o;
  private com.google.android.m4b.maps.bc.a p;
  private l q;
  private final String r;
  private final boolean s;
  private boolean t;
  private float u = -1.0F;
  private boolean v;
  private final b[] w;
  private int x;
  private com.google.android.m4b.maps.an.e y;
  private boolean z;

  static
  {
    b[] arrayOfb = new b[4];
    arrayOfb[0] = new b(a.d, i.c.a);
    arrayOfb[1] = new b(a.b, i.c.a);
    arrayOfb[2] = new b(a.e, i.c.c);
    arrayOfb[3] = new b(a.c, i.c.b);
  }

  @VisibleForTesting
  n(k paramk, com.google.android.m4b.maps.bs.b paramb, String paramString, com.google.android.m4b.maps.bc.a parama1, com.google.android.m4b.maps.bc.a parama2, float paramFloat1, float paramFloat2, boolean paramBoolean1, boolean paramBoolean2, i parami1, i parami2, b[] paramArrayOfb, boolean paramBoolean3, boolean paramBoolean4, EventBus paramEventBus)
  {
    super(paramk, paramb, paramk.e(), paramFloat1, paramFloat2, paramk.i(), paramBoolean1, paramBoolean3);
    this.r = paramString;
    this.h = parama1;
    this.p = parama2;
    this.i = parami1;
    this.j = parami2;
    this.s = paramBoolean2;
    if (this.j == null)
      paramArrayOfb = D;
    this.w = paramArrayOfb;
    this.x = 0;
    if (this.j != null)
    {
      this.k = this.w[this.x];
      this.j.a(this.k.b);
    }
    this.v = false;
    float f = 0.0F;
    if (parami1 != null)
      f = 0.0F + parami1.a() * parami1.b();
    if (parami2 != null)
      f += parami2.a() * parami2.b();
    this.B = f;
  }

  private float a(com.google.android.m4b.maps.bn.b paramb)
  {
    if (this.s)
      return paramb.a(1.0F, paramb.a(this.h.b(), true));
    return paramb.a(1.0F, paramb.i());
  }

  static int a(as paramas, c paramc, float paramFloat)
  {
    return (int)h.a(paramas, paramc.e, paramc.f, paramc.g, paramFloat);
  }

  public static n a(ag paramag, com.google.android.m4b.maps.bs.b paramb, boolean paramBoolean, com.google.android.m4b.maps.bn.b paramb1, l.a<Bitmap> parama, ak paramak, c paramc, EventBus paramEventBus)
  {
    i locali1 = i.a(paramag.n(), paramag, paramb1, parama, paramak, paramc);
    if ((locali1 == null) || (locali1.c()))
      return null;
    s locals = paramag.o();
    i locali2 = null;
    if (locals != null)
    {
      locali2 = i.a(paramag.o(), paramag, paramb1, parama, paramak, paramc);
      if (locali2 == null)
        return null;
      if (locali2.c())
        locali2 = null;
    }
    b[] arrayOfb;
    if ((paramag.p().length == 0) && (locali2 != null))
    {
      arrayOfb = E;
      if ((locali2 != null) && (arrayOfb.length != 1))
        break label254;
    }
    com.google.android.m4b.maps.bc.a locala;
    af localaf;
    StringBuilder localStringBuilder;
    label254: for (boolean bool1 = true; ; bool1 = false)
    {
      locala = paramag.k()[0];
      localaf = locala.b();
      localStringBuilder = new StringBuilder();
      for (int i2 = 0; i2 < paramag.n().b(); i2++)
      {
        s.a locala2 = paramag.n().a(i2);
        if (locala2.b())
          localStringBuilder.append(locala2.g());
      }
      arrayOfb = new b[paramag.p().length];
      for (int i1 = 0; i1 < arrayOfb.length; i1++)
        arrayOfb[i1] = new b(a.a(paramag.p()[i1].d()), i.c.a(paramag.p()[i1].a()));
      break;
    }
    for (int i3 = 0; i3 < paramag.o().b(); i3++)
    {
      s.a locala1 = paramag.o().a(i3);
      if (locala1.b())
        localStringBuilder.append(locala1.g());
    }
    if (paramag.a() != null)
      localStringBuilder.append(paramag.a().a());
    String str;
    if (paramag.c().length() > 0)
    {
      localStringBuilder.append(paramag.c());
      str = localStringBuilder.toString();
      if ((!paramag.q()) || (paramag.c().length() <= 0) || (!paramc.p))
        break label454;
    }
    label454: for (boolean bool2 = true; ; bool2 = false)
    {
      if (!bool2)
        break label460;
      return new g(paramag, paramb, str, locala, null, paramag.g(), paramag.j(), paramBoolean, bool1, locali1, locali2, arrayOfb, paramc.q);
      if (paramag.b().b() <= 13)
        break;
      localStringBuilder.append(localaf.toString());
      break;
    }
    label460: return new n(paramag, paramb, str, locala, null, paramag.g(), paramag.j(), paramBoolean, bool1, locali1, locali2, arrayOfb, paramc.q, bool2, paramEventBus);
  }

  public static n a(ao paramao, int paramInt, com.google.android.m4b.maps.bs.b paramb, af paramaf1, af paramaf2, boolean paramBoolean, c paramc, com.google.android.m4b.maps.bn.b paramb1, l.a<Bitmap> parama)
  {
    s locals = paramao.a(paramInt);
    StringBuilder localStringBuilder = new StringBuilder();
    for (int i1 = 0; i1 < locals.b(); i1++)
    {
      s.a locala = locals.a(i1);
      if (locala.a())
        return null;
      if (locala.b())
        localStringBuilder.append(locala.g());
    }
    if (localStringBuilder.length() == 0)
      return null;
    i locali = i.a(locals, paramao, paramb1, parama, null, paramc);
    if (locali == null)
      return null;
    String str = localStringBuilder.toString();
    com.google.android.m4b.maps.bc.a locala1 = new com.google.android.m4b.maps.bc.a(paramaf1, 0, 0.0F, null, 0.0F, 0.0F, 0.0F);
    if (paramaf2 == null);
    for (com.google.android.m4b.maps.bc.a locala2 = null; ; locala2 = new com.google.android.m4b.maps.bc.a(paramaf2, 0, 0.0F, null, 0.0F, 0.0F, 0.0F))
    {
      n localn = new n(paramao, paramb, str, locala1, locala2, -1.0F, -1.0F, paramBoolean, false, locali, null, D, paramc.q, false, null);
      return localn;
    }
  }

  public final void a(com.google.android.m4b.maps.bo.e parame, com.google.android.m4b.maps.bn.b paramb, j paramj)
  {
    if (!this.v)
    {
      paramj.a();
      if (this.e)
        this.y = new com.google.android.m4b.maps.an.e(500L, e.a.a);
      this.v = true;
    }
    GL10 localGL101 = parame.x();
    localGL101.glPushMatrix();
    GL10 localGL102 = parame.x();
    af localaf = this.h.b();
    if ((!paramb.d()) && ((!this.h.a()) || (this.h.c() - paramb.j() == 0.0F)) && (paramb.k() == 0.0F))
    {
      paramb.a(this.h.b(), this.C);
      localaf = paramb.d(Math.round(this.C[0]), Math.round(this.C[1]));
    }
    an.a(parame, paramb, localaf, this.u);
    int i1;
    float f9;
    if (this.y != null)
    {
      i1 = this.y.a(parame);
      if (i1 == 65536)
        this.y = null;
      parame.x().glColor4x(i1, i1, i1, i1);
      if (!this.h.a())
        break label587;
      float f8 = this.h.c() - paramb.j();
      if (f8 < 0.0F)
        f8 += 360.0F;
      f9 = this.h.c();
      if ((this.t) || (f8 <= 90.0F) || (f8 >= 270.0F))
        break label824;
    }
    label824: for (float f10 = 180.0F + f9; ; f10 = f9)
    {
      if (f10 >= 360.0F)
        f10 -= 360.0F;
      localGL102.glRotatef(f10, 0.0F, 0.0F, -1.0F);
      localGL102.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
      label335: float f4;
      float f3;
      float f2;
      float f1;
      if (this.i != null)
      {
        f4 = this.i.a();
        f3 = this.i.b();
        f2 = this.i.a() / 2.0F;
        f1 = this.i.b() / 2.0F;
        localGL102.glTranslatef(-f2, 0.0F, -f1);
        this.i.a(parame, paramb, paramj);
      }
      while (true)
      {
        float f5;
        if (this.j != null)
          switch (1.a[this.k.a.ordinal()])
          {
          default:
            f3 = 0.0F;
            f5 = 0.0F;
            label482: if ((this.k.a == a.d) || (this.k.a == a.b))
              switch (1.b[this.k.b.ordinal()])
              {
              default:
              case 1:
              case 2:
              case 3:
              }
            break;
          case 1:
          case 2:
          case 3:
          case 4:
          case 5:
          case 6:
          case 7:
          case 8:
          case 9:
          }
        while (true)
        {
          localGL102.glTranslatef(f5, 0.0F, f3);
          this.j.a(parame, paramb, paramj);
          localGL101.glPopMatrix();
          return;
          i1 = this.g;
          break;
          label587: an.a(localGL102, paramb);
          break label335;
          float f7 = f2 - this.j.a() / 2.0F;
          f3 = f1 - this.j.b() / 2.0F;
          f5 = f7;
          break label482;
          f3 = f1 - this.j.b() / 2.0F;
          f5 = f4;
          break label482;
          float f6 = -this.j.a();
          f3 = f1 - this.j.b() / 2.0F;
          f5 = f6;
          break label482;
          f3 = -this.j.b();
          f5 = 0.0F;
          break label482;
          f5 = 0.0F;
          break label482;
          f3 = -this.j.b();
          f5 = f4;
          break label482;
          f5 = -this.j.a();
          f3 = -this.j.b();
          break label482;
          f5 = f4;
          break label482;
          f5 = -this.j.a();
          break label482;
          f5 = -10.0F;
          continue;
          f5 = 10.0F + f4 - this.j.a();
          continue;
          f5 = f2 - this.j.a() / 2.0F;
        }
        f1 = 0.0F;
        f2 = 0.0F;
        f3 = 0.0F;
        f4 = 0.0F;
      }
    }
  }

  public final boolean a(br parambr)
  {
    return parambr.a(this.h.b());
  }

  public boolean a(com.google.android.m4b.maps.bn.b paramb, com.google.android.m4b.maps.bo.e parame)
  {
    if ((j()) && (this.f) && (this.u > 0.0F))
    {
      float f9 = a(paramb) / this.u;
      this.g = a(f9);
      return (f9 >= 0.25F) && (f9 <= 2.0F);
    }
    this.g = 65536;
    if ((paramb.k() == 0.0F) && (paramb.j() == 0.0F));
    float f1;
    for (boolean bool = true; ; bool = false)
    {
      f1 = paramb.l();
      if ((this.q != null) && (this.z) && (bool) && (f1 == this.A))
        break;
      if ((this.q == null) || (!this.h.a()) || (f1 != this.A))
        break label164;
      return true;
    }
    label164: this.z = bool;
    this.A = f1;
    int i2;
    int i1;
    if (this.i != null)
    {
      i2 = (int)this.i.a() >> 1;
      i1 = (int)this.i.b() >> 1;
    }
    while (true)
    {
      l locall;
      if (this.j == null)
      {
        this.l = (-i2);
        this.m = i2;
        this.n = (-i1);
        this.o = i1;
        af localaf1 = ((com.google.android.m4b.maps.bo.i)ai.b.get()).a;
        af.b(paramb.n(), this.h.b(), localaf1);
        this.u = a(paramb);
        if (!this.s)
        {
          float f8 = paramb.i() / paramb.a(this.h.b(), true);
          this.l = (f8 * this.l);
          this.m = (f8 * this.m);
          this.n = (f8 * this.n);
          this.o = (f8 * this.o);
        }
        if ((this.c != null) && ((this.c instanceof com.google.android.m4b.maps.bs.a)))
        {
          Object localObject = ((com.google.android.m4b.maps.bs.a)this.c).a();
          if ((localObject != null) && ((localObject instanceof a.c)))
          {
            f localf = com.google.android.m4b.maps.ba.i.a().d((a.c)localObject);
            if (localf != null)
              this.h.b().a((int)localf.a(paramb, this.h.b()));
          }
        }
        if (!this.h.a())
          break label1349;
        if (this.h.a())
          break label1077;
        locall = null;
      }
      label514: label525: label724: float f2;
      label1077: label1103: float f3;
      for (this.q = locall; ; this.q = paramb.a(f2 + this.l, f2 + this.m, f3 + this.n, f3 + this.o))
      {
        if (this.q != null)
          break label1417;
        return false;
        int i3 = (int)this.j.a() >> 1;
        int i4 = (int)this.j.b() >> 1;
        int i5;
        int i6;
        if (i2 > i3)
        {
          i5 = i2;
          if (i1 <= i4)
            break label724;
          i6 = i1;
          switch (1.a[this.k.a.ordinal()])
          {
          default:
            this.l = (-i5);
            this.m = i5;
            this.n = (-i6);
            this.o = i6;
          case 5:
          case 2:
          case 4:
          case 3:
          case 6:
          case 7:
          case 8:
          case 9:
          }
        }
        while ((this.k.a == a.d) || (this.k.a == a.b))
          switch (1.b[this.k.b.ordinal()])
          {
          default:
            break;
          case 1:
            this.l = (-10 + -i2);
            this.m = Math.max(this.l + i3 * 2, i2);
            break;
            i5 = i3;
            break label514;
            i6 = i4;
            break label525;
            this.n = (-i1 - i4 * 2);
            this.o = i1;
            continue;
            this.l = (-i2);
            this.m = (i2 + i3 * 2);
            this.n = (-i6);
            this.o = i6;
            continue;
            this.n = (-i1);
            this.o = (i1 + i4 * 2);
            continue;
            this.l = (-i2 - i3 * 2);
            this.m = i2;
            this.n = (-i6);
            this.o = i6;
            continue;
            this.l = (-i2);
            this.m = (i2 + i3 * 2);
            this.n = (-i1);
            this.o = (i1 + i4 * 2);
            continue;
            this.l = (-i2 - i3 * 2);
            this.m = i2;
            this.n = (-i1);
            this.o = (i1 + i4 * 2);
            continue;
            this.l = (-i2);
            this.m = (i2 + i3 * 2);
            this.n = (-i1 - i4 * 2);
            this.o = i1;
            continue;
            this.l = (-i2 - i3 * 2);
            this.m = i2;
            this.n = (-i1 - i4 * 2);
            this.o = i1;
          case 2:
          case 3:
          }
        this.m = (i2 + 10);
        this.l = Math.min(this.m - i3 * 2, -i2);
        break;
        this.l = (-i5);
        this.m = i5;
        break;
        float f4 = this.h.c();
        float f5;
        if (f4 < 270.0F)
        {
          f5 = f4 + 90.0F;
          if (f5 >= 270.0F)
            break label1338;
        }
        label1338: for (float f6 = f5 + 90.0F; ; f6 = f5 - 270.0F)
        {
          float f7 = paramb.a(this.h.b(), true);
          com.google.android.m4b.maps.bo.i locali = (com.google.android.m4b.maps.bo.i)ai.b.get();
          af localaf2 = locali.a;
          localaf2.a(f5, paramb.a(this.l, f7));
          af localaf3 = locali.b;
          localaf3.a(f5, paramb.a(this.m, f7));
          af localaf4 = locali.c;
          localaf4.a(f6, paramb.a(this.n, f7));
          af localaf5 = locali.d;
          localaf5.a(f6, paramb.a(this.o, f7));
          af localaf6 = locali.e;
          af.a(this.h.b(), localaf4, localaf6);
          af localaf7 = locali.f;
          af.a(this.h.b(), localaf5, localaf7);
          af localaf8 = localaf6.e(localaf2);
          af localaf9 = localaf6.e(localaf3);
          locall = l.a(localaf7.e(localaf2), localaf7.e(localaf3), localaf8, localaf9);
          break;
          f5 = f4 - 270.0F;
          break label1103;
        }
        label1349: paramb.a(this.h.b(), this.C);
        f2 = this.C[0];
        f3 = this.C[1];
      }
      label1417: break;
      i1 = 0;
      i2 = 0;
    }
  }

  public final void b(com.google.android.m4b.maps.bo.e parame)
  {
    super.b(parame);
    if (this.i != null)
      this.i.b(parame);
    if (this.j != null)
      this.j.b(parame);
  }

  public final boolean b(com.google.android.m4b.maps.bn.b paramb, com.google.android.m4b.maps.bo.e parame)
  {
    if (1 + this.x < this.w.length)
    {
      b[] arrayOfb = this.w;
      int i1 = 1 + this.x;
      this.x = i1;
      this.k = arrayOfb[i1];
      this.j.a(this.k.b);
      this.q = null;
      a(paramb, parame);
      return true;
    }
    if (this.p != null)
    {
      this.h = this.p;
      this.p = null;
      if (this.w.length > 1)
      {
        this.x = 0;
        this.k = this.w[0];
        this.j.a(this.k.b);
      }
      this.q = null;
      a(paramb, parame);
      return true;
    }
    return false;
  }

  public final void c(com.google.android.m4b.maps.bo.e parame)
  {
    super.c(parame);
    if (this.i != null)
      this.i.c(parame);
    if (this.j != null)
      this.j.c(parame);
  }

  public final float k()
  {
    return this.B;
  }

  public final am l()
  {
    return this.q;
  }

  public final String r()
  {
    return this.r;
  }

  public final boolean u()
  {
    if (this.h == null)
      return false;
    return this.h.a();
  }

  public static enum a
  {
    static
    {
      a[] arrayOfa = new a[9];
      arrayOfa[0] = a;
      arrayOfa[1] = b;
      arrayOfa[2] = c;
      arrayOfa[3] = d;
      arrayOfa[4] = e;
      arrayOfa[5] = f;
      arrayOfa[6] = g;
      arrayOfa[7] = h;
      arrayOfa[8] = i;
    }

    public static a a(int paramInt)
    {
      switch (paramInt)
      {
      case 8:
      case 12:
      default:
        throw new IllegalArgumentException("Unknown position");
      case 5:
        return a;
      case 6:
        return e;
      case 7:
        return c;
      case 9:
        return b;
      case 10:
        return i;
      case 11:
        return h;
      case 13:
        return d;
      case 14:
        return g;
      case 15:
      }
      return f;
    }
  }

  public static final class b
  {
    public final n.a a;
    public final i.c b;

    public b(n.a parama, i.c paramc)
    {
      this.a = parama;
      this.b = paramc;
    }
  }
}

/* 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.bq.n
 * JD-Core Version:    0.6.2
 */