package com.google.android.m4b.maps.bb;

import com.google.android.m4b.maps.aa.g;
import java.io.DataInput;
import java.io.IOException;

public final class a
{
  private static final c e = c.a(22);
  private static int[] f = null;
  private final int a;
  private final int b;
  private final int c;
  private final int d;

  public a(int paramInt1, int paramInt2)
  {
    int i = a(paramInt2);
    if (paramInt1 > 80000000);
    for (int j = 80000000; ; j = paramInt1)
    {
      if (j < -80000000)
        j = -80000000;
      this.c = j;
      this.d = i;
      c localc1 = e;
      this.a = ((int)(localc1.a() / 2L + i * localc1.a() / 360000000L));
      c localc2 = e;
      int k = 1 + Math.abs(j) / 1000000;
      int m = Math.abs(j) % 1000000;
      int[] arrayOfInt = c();
      int n = (-1 * arrayOfInt[(k - 1)] + 3 * arrayOfInt[k] - 3 * arrayOfInt[(k + 1)] + arrayOfInt[(k + 2)]) / 6;
      int i1 = (3 * arrayOfInt[(k - 1)] - 6 * arrayOfInt[k] + 3 * arrayOfInt[(k + 1)]) / 6;
      int i2 = (-2 * arrayOfInt[(k - 1)] - 3 * arrayOfInt[k] + 6 * arrayOfInt[(k + 1)] - arrayOfInt[(k + 2)]) / 6;
      int i3 = arrayOfInt[k];
      int i4 = (int)(n * m * m / 1000000L * m / 1000000L / 1000000L + i1 * m * m / 1000000L / 1000000L + i2 * m / 1000000L + i3);
      if (j < 0);
      for (int i5 = -i4; ; i5 = i4)
      {
        this.b = ((int)(localc2.a() / 2L - (int)(10L * (i5 * localc2.a()) / 360000000L) / 10));
        return;
      }
    }
  }

  private static int a(int paramInt)
  {
    for (int i = paramInt; i < -180000000; i += 10752);
    while (i > 180000000)
      i -= 10752;
    return i;
  }

  public static a a(String paramString)
  {
    if (paramString.indexOf(',') != -1)
      try
      {
        String[] arrayOfString = com.google.android.m4b.maps.av.a.a(paramString, ',');
        a locala = new a(b(arrayOfString[0]), b(arrayOfString[1]));
        return locala;
      }
      catch (NumberFormatException localNumberFormatException)
      {
        return null;
      }
    return null;
  }

  private static int b(String paramString)
  {
    int i = 1;
    String str1 = paramString.trim();
    if (str1.indexOf('.') != -1)
    {
      String[] arrayOfString = com.google.android.m4b.maps.av.a.a(str1, '.');
      if (arrayOfString.length > 2)
        throw new NumberFormatException("Coordinate has more than one decimal point: " + str1);
      int j = Integer.parseInt(arrayOfString[0]);
      if (arrayOfString[0].indexOf("-") != -1);
      String str2;
      for (int k = i; ; k = 0)
      {
        str2 = arrayOfString[i].substring(0, Math.min(6, arrayOfString[i].length()));
        if ((str2.length() != 0) && (str2.charAt(0) >= '0') && (str2.charAt(0) <= '9'))
          break;
        throw new NumberFormatException("Invalid fractional part in \"" + str1 + "\"");
      }
      int m = Integer.parseInt(com.google.android.m4b.maps.av.a.a(str2, 6, '0'));
      int n = 1000000 * j;
      if (k != 0)
        i = -1;
      return n + m * i;
    }
    return 1000000 * Integer.parseInt(str1);
  }

  private static int[] c()
  {
    try
    {
      if (f == null)
      {
        f = new int[84];
        try
        {
          DataInput localDataInput = g.a(new byte[] { -1, -16, -67, -115, 15, 66, 115, 15, 66, 115, 15, 67, -93, 15, 70, 6, 15, 73, -103, 15, 78, 97, 15, 84, 94, 15, 91, -109, 15, 100, 2, 15, 109, -80, 15, 120, -97, 15, -124, -44, 15, -110, 84, 15, -95, 38, 15, -79, 78, 15, -62, -45, 15, -43, -67, 15, -22, 21, 15, -1, -31, 16, 23, 45, 16, 48, 1, 16, 74, 107, 16, 102, 116, 16, -124, 43, 16, -93, -100, 16, -60, -41, 16, -25, -19, 17, 12, -18, 17, 51, -20, 17, 92, -4, 17, -120, 52, 17, -75, -87, 17, -27, 118, 18, 23, -76, 18, 76, -127, 18, -125, -3, 18, -66, 70, 18, -5, -124, 19, 59, -37, 19, 127, 119, 19, -58, -122, 20, 17, 56, 20, 95, -60, 20, -78, 100, 21, 9, 87, 21, 100, -27, 21, -59, 86, 22, 42, -1, 22, -106, 58, 23, 7, 109, 23, 127, 2, 23, -3, 117, 24, -125, 72, 25, 17, 20, 25, -89, 120, 26, 71, 46, 26, -15, 3, 27, -91, -39, 28, 102, -77, 29, 52, -77, 30, 17, 31, 30, -3, 111, 31, -5, 74, 33, 12, -105, 34, 51, -120, 35, 114, -91, 36, -52, -30, 38, 69, -76, 39, -31, 42, 41, -92, 25, 43, -108, 70, 45, -72, -91, 48, 25, -84, 50, -63, -63, 53, -67, -47, 57, 30, 28, 60, -9, 105, 65, 100, -96, 70, -119, 82, 76, -107, 115, 83, -53, 79, 92, -119, 52, 103, 90, 12 });
          int[] arrayOfInt2 = f;
          arrayOfInt2[0] = localDataInput.readInt();
          for (int i = 1; i < arrayOfInt2.length; i++)
            arrayOfInt2[i] = (arrayOfInt2[(i - 1)] + (localDataInput.readUnsignedByte() << 16 | localDataInput.readUnsignedByte() << 8 | localDataInput.readUnsignedByte()));
        }
        catch (IOException localIOException)
        {
          throw new RuntimeException("Can't read mercator.dat");
        }
      }
    }
    finally
    {
    }
    int[] arrayOfInt1 = f;
    return arrayOfInt1;
  }

  public final int a()
  {
    return this.c;
  }

  public final int b()
  {
    return this.d;
  }

  public final boolean equals(Object paramObject)
  {
    if (this == paramObject);
    a locala;
    do
    {
      return true;
      if (!(paramObject instanceof a))
        return false;
      locala = (a)paramObject;
    }
    while (((this.c == locala.c) && (this.d == locala.d)) || ((this.a == locala.a) && (this.b == locala.b)));
    return false;
  }

  public final int hashCode()
  {
    return 29 * this.c + this.d;
  }

  public final String toString()
  {
    int i = this.c;
    int j = this.d;
    return com.google.android.m4b.maps.av.a.a(i) + ',' + com.google.android.m4b.maps.av.a.a(j);
  }
}

/* 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.bb.a
 * JD-Core Version:    0.6.2
 */