package com.google.android.m4b.maps.bg;

import com.google.android.m4b.maps.aa.k;
import com.google.android.m4b.maps.al.d;
import com.google.android.m4b.maps.at.a.a;
import com.google.android.m4b.maps.z.b;
import com.google.common.annotations.VisibleForTesting;
import java.io.ByteArrayOutputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
import java.util.zip.CRC32;

public class e
{
  private static final byte[] a;

  @VisibleForTesting
  private static int b;
  private static int c;
  private static int d;
  private Set<Integer> A;
  private int B = 4;
  private final String e;
  private final a.a f;
  private com.google.android.m4b.maps.at.a g;
  private b h;
  private final i i;
  private final a j;
  private final com.google.android.m4b.maps.at.a[] k;
  private final com.google.android.m4b.maps.bk.f<Long, f> l;
  private final Set<f> m;
  private final ReentrantLock n = new ReentrantLock();
  private final ReentrantReadWriteLock o = new ReentrantReadWriteLock(true);
  private boolean p;
  private int q;
  private int r;
  private int s;
  private int t;
  private int u;
  private int v;
  private int w = -1;
  private boolean x = false;
  private i y = null;
  private f z = null;

  static
  {
    if (!e.class.desiredAssertionStatus());
    for (boolean bool = true; ; bool = false)
    {
      C = bool;
      a = new byte[0];
      b = 20;
      c = 81800;
      d = 20;
      return;
    }
  }

  private e(String paramString, b paramb, i parami, a parama, com.google.android.m4b.maps.at.a parama1, a.a parama2, f paramf)
  {
    this.e = paramString;
    this.h = paramb;
    this.i = parami;
    this.j = parama;
    this.g = parama1;
    this.f = parama2;
    this.k = new com.google.android.m4b.maps.at.a[paramb.c];
    this.l = new com.google.android.m4b.maps.bk.f(Math.min(2048, h()));
    this.m = Collections.synchronizedSet(new HashSet());
    this.z = paramf;
    this.n.lock();
    int i1 = 0;
    int i2 = 0;
    while (true)
    {
      int i5;
      try
      {
        if (i1 < this.h.c)
        {
          int i3;
          if (this.i.b[i1] == -1)
          {
            i3 = 1;
            if (i3 == 0)
            {
              if (this.i.b(i1))
              {
                a locala = this.j;
                int i4 = i1 * 1024;
                if (c(locala.a, i4, 1020) != a(locala.a, i4 + 1020))
                  continue;
                i5 = 1;
                break label386;
              }
            }
            else
            {
              new StringBuilder("Rebuilding inconsistent shard: ").append(i1);
              i2 = 1;
              this.q = (1 + this.q);
            }
          }
          try
          {
            g localg = b(i1);
            this.i.a(localg);
            this.j.a(localg);
            c(i1);
            i1++;
            continue;
            i3 = 0;
            continue;
            i5 = 0;
          }
          catch (IOException localIOException)
          {
            d.a("Rebuilding shard: " + i1, localIOException);
            d(i1);
            continue;
          }
        }
      }
      finally
      {
        this.n.unlock();
      }
      if (i2 != 0)
        k();
      this.n.unlock();
      return;
      label386: if (i5 != 0);
    }
  }

  private int a(boolean paramBoolean)
  {
    int i1 = 0;
    if (i1 < this.i.f)
      if (this.i.b(i1));
    do
    {
      return i1;
      i1++;
      break;
      if (paramBoolean)
      {
        int i3 = this.i.a(this.A);
        if (i3 != -1)
        {
          d(i3);
          return i3;
        }
      }
      if (this.i.f < this.h.c)
      {
        this.o.writeLock().lock();
        try
        {
          i locali = this.i;
          int i2 = locali.f;
          locali.f = (i2 + 1);
          locali.a[i2] = 0;
          locali.b[i2] = 0;
          locali.c[i2] = 0;
          locali.d[i2] = 0;
          if (locali.e[i2] > 0)
            locali.g = (-1 + locali.g);
          locali.e[i2] = 0;
          this.j.a(i2);
          this.j.b = (i2 + 1);
          return i2;
        }
        finally
        {
          this.o.writeLock().unlock();
        }
      }
      i1 = this.i.a(this.A);
    }
    while (i1 == -1);
    d(i1);
    return i1;
  }

  public static int a(byte[] paramArrayOfByte, int paramInt)
  {
    int i1 = paramInt + 1;
    int i2 = 0xFF & paramArrayOfByte[paramInt];
    int i3 = i1 + 1;
    int i4 = 0xFF & paramArrayOfByte[i1];
    int i5 = i3 + 1;
    int i6 = 0xFF & paramArrayOfByte[i3];
    return 0xFF & paramArrayOfByte[i5] | (i2 << 24 | i4 << 16 | i6 << 8);
  }

  public static c a(long paramLong, String paramString, int paramInt, byte[] paramArrayOfByte)
  {
    return new c(c(paramLong, paramString), paramInt, paramArrayOfByte, (byte)0);
  }

  public static c a(long paramLong, String paramString, byte[] paramArrayOfByte)
  {
    return new c(c(paramLong, paramString), paramArrayOfByte, (byte)0);
  }

  public static c a(long paramLong, byte[] paramArrayOfByte)
  {
    return a(paramLong, null, paramArrayOfByte);
  }

  private f a(d paramd)
  {
    long l1 = paramd.a();
    f localf;
    synchronized (this.l)
    {
      localf = (f)this.l.b(Long.valueOf(l1));
      if ((localf != null) && (!a(localf, paramd)))
        localf = null;
      if ((localf == null) || (this.i.b(localf.g)));
    }
    synchronized (this.l)
    {
      this.l.c(Long.valueOf(l1));
      localf = null;
      if (localf == null)
      {
        h localh = b(paramd);
        if (localh != null)
          localf = localh.b;
      }
      return localf;
      localObject1 = finally;
      throw localObject1;
    }
  }

  private g a(int paramInt1, int paramInt2, int paramInt3)
  {
    int i1 = Math.min(50 * this.h.d / 100, this.h.d - paramInt2);
    int i2 = 134217727 - paramInt3;
    while (paramInt1 < this.i.f)
    {
      if ((this.i.e[paramInt1] > 0) && (this.i.e[paramInt1] <= i1) && ((this.A == null) || (!this.A.contains(Integer.valueOf(paramInt1)))))
      {
        g localg = b(paramInt1);
        if (localg.d() <= i2)
          return localg;
      }
      paramInt1++;
    }
    return null;
  }

  private h a(d paramd, int paramInt)
  {
    Object localObject1 = null;
    long l1 = paramd.a();
    this.t = (1 + this.t);
    while (true)
    {
      try
      {
        g localg = b(paramInt);
        int i1 = localg.b();
        localArrayList = new ArrayList(i1);
        int i2 = 0;
        if (i2 < i1)
        {
          f localf4 = localg.e(i2);
          if (localf4.a == -1L)
            break label371;
          localArrayList.add(localf4);
          if ((localf4.a != paramd.a()) || (!a(localf4, paramd)))
            break label371;
          localObject6 = new h(localg, localf4, i2);
          i2++;
          localObject1 = localObject6;
          continue;
        }
      }
      catch (IOException localIOException)
      {
        ArrayList localArrayList;
        d.a("lookupShardRecordIndexFromShard: " + l1 + " : " + paramInt, localIOException);
        this.o.readLock().unlock();
        try
        {
          boolean bool = this.n.tryLock();
          if (bool);
          try
          {
            d(paramInt);
            this.n.unlock();
            return null;
          }
          finally
          {
            this.n.unlock();
          }
        }
        finally
        {
          this.o.readLock().lock();
        }
        if (localObject1 != null)
        {
          Iterator localIterator = localArrayList.iterator();
          if (localIterator.hasNext())
          {
            f localf2 = (f)localIterator.next();
            synchronized (this.l)
            {
              this.l.c(Long.valueOf(localf2.a), localf2);
            }
          }
          synchronized (this.l)
          {
            this.l.c(Long.valueOf(localObject1.b.a), localObject1.b);
            return localObject1;
          }
        }
        this.s = (1 + this.s);
        return localObject1;
      }
      label371: Object localObject6 = localObject1;
    }
  }

  public static e a(String paramString, int paramInt1, int paramInt2, Locale paramLocale, a.a parama, f paramf)
  {
    int i1;
    if (paramInt1 == -1)
      i1 = 81800;
    for (boolean bool = true; ; bool = false)
    {
      if (i1 < 4)
        i1 = 4;
      if ((!bool) && (i1 > 81800))
        throw new IllegalArgumentException("Number of records must be between 4 and " + 81800);
      int i2 = Math.max(4, 1 + (i1 - 1) / 409);
      int i3 = 1 + (i1 - 1) / i2;
      if ((!C) && ((i2 < 4) || (i2 > 409)))
        throw new AssertionError();
      if ((!C) && (!bool) && (i2 > 35))
        throw new AssertionError();
      if ((!C) && ((i3 <= 0) || (i3 > 409)))
        throw new AssertionError();
      parama.a(paramString + ".m");
      com.google.android.m4b.maps.at.a locala = parama.a(paramString + ".m", true);
      b localb = new b(20 + (f() << 16), 8192, i2, i3, bool, paramInt2, com.google.android.m4b.maps.ak.e.e().b().a(), paramLocale);
      i locali = new i(i2);
      a locala1 = new a(i2, 0);
      a(localb, locali, locala1, locala);
      locala.b();
      return new e(paramString, localb, locali, locala1, locala, parama, paramf);
      i1 = paramInt1;
    }
  }

  public static e a(String paramString, a.a parama, f paramf)
  {
    com.google.android.m4b.maps.at.a locala = parama.a(paramString + ".m", true);
    byte[] arrayOfByte = new byte[8192];
    locala.b(arrayOfByte);
    b localb = new b(arrayOfByte, 0);
    int i1 = f();
    int i2 = 20 + (i1 << 16);
    int i3 = 0xFFFF & localb.a >> 16;
    int i4 = 0xFFFF & localb.a;
    if ((i3 == 0) && (i4 != 20))
      throw new IOException("Invalid Cache Header(1): " + localb + "; cached sever schema is zero but client schema part doesn't match: cachedClientSchema = " + i4 + ", expectedClientSchema = " + 20);
    if (((i3 != 0) && (localb.a != i2)) || (localb.b != 8192))
      throw new IOException("Invalid Cache Header(2): " + localb + ", expect expectedSchema=" + i2 + ", mBlockSize=8192");
    i locali = new i(localb.c);
    locali.b(locala);
    a locala1 = new a(localb.c, locali.f);
    locala.a(locala1.a, 0, locala1.a.length);
    e locale = new e(paramString, localb, locali, locala1, locala, parama, paramf);
    if ((i3 == 0) && (i1 != 0))
      locale.a(locale.h.f, i2);
    return locale;
  }

  private void a(int paramInt1, int paramInt2)
  {
    this.n.lock();
    try
    {
      b localb;
      byte[] arrayOfByte;
      if ((paramInt1 != this.h.f) || (paramInt2 != this.h.a))
      {
        localb = new b(paramInt2, this.h.b, this.h.c, this.h.d, this.h.e, paramInt1, this.h.g, this.h.h);
        arrayOfByte = new byte[8192];
        localb.a(arrayOfByte, 0);
      }
      synchronized (this.g)
      {
        this.g.a(0L);
        this.g.a(arrayOfByte);
        this.g.b();
        this.h = localb;
        return;
      }
    }
    catch (IOException localIOException)
    {
      d();
      throw localIOException;
    }
    finally
    {
      this.n.unlock();
    }
  }

  private static void a(int paramInt, d paramd, Map<d, Integer> paramMap)
  {
    Integer localInteger1 = (Integer)paramMap.get(paramd);
    if (localInteger1 != null);
    for (Integer localInteger2 = Integer.valueOf(com.google.android.m4b.maps.be.g.a(paramInt, localInteger1.intValue())); ; localInteger2 = Integer.valueOf(paramInt))
    {
      paramMap.put(paramd, localInteger2);
      return;
    }
  }

  private static void a(com.google.android.m4b.maps.at.a parama, int paramInt, byte[] paramArrayOfByte)
  {
    long l1 = paramInt;
    try
    {
      parama.a(l1);
      parama.b(paramArrayOfByte);
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  private static void a(b paramb, i parami, a parama, com.google.android.m4b.maps.at.a parama1)
  {
    int i1 = 0;
    byte[] arrayOfByte = new byte[8192];
    paramb.a(arrayOfByte, 0);
    parama1.a(arrayOfByte);
    parami.a(parama1);
    while (i1 < parama.b)
    {
      parama.b(i1);
      i1++;
    }
    parama1.a(parama.a);
  }

  private void a(e parame, g paramg)
  {
    parame.a();
    a(paramg, true);
  }

  private void a(f paramf, IOException paramIOException)
  {
    this.r = (1 + this.r);
    d.a("Cache:" + this.e, paramIOException);
    this.m.add(paramf);
  }

  private void a(g paramg1, g paramg2, e parame)
  {
    com.google.android.m4b.maps.at.a locala = e(paramg1.a());
    for (int i1 = 0; i1 < paramg1.b(); i1++)
      if ((paramg1.b(i1) != -1L) && (paramg1.d(i1) > 0))
      {
        if ((paramg2.b() >= this.h.d) || (paramg2.c() >= 134217727))
          throw new IOException("Couldn't fit refcounted records into collecting shard");
        f localf1 = paramg1.e(i1);
        byte[] arrayOfByte = new byte[localf1.d + localf1.e];
        a(locala, localf1.b, arrayOfByte);
        parame.a(arrayOfByte);
        f localf2 = new f(localf1.a, paramg2.c(), localf1.d, localf1.e, localf1.c, localf1.f, paramg2.a(), paramg2.b());
        paramg2.a(localf2);
        if (this.z != null)
          this.z.b(localf2.a, localf2.g);
      }
  }

  private void a(g paramg, boolean paramBoolean)
  {
    int i1 = this.i.a[g.a(paramg)];
    this.o.writeLock().lock();
    while (true)
    {
      try
      {
        this.i.a(g.a(paramg));
        k();
        synchronized (this.g)
        {
          this.g.a(8192 * g.a(paramg) + this.h.i);
          paramg.a(this.g);
          this.g.b();
          this.j.a(paramg);
          this.i.a(paramg);
          if (paramBoolean)
          {
            i locali1 = this.i;
            int i2 = g.a(paramg);
            int i3 = m();
            locali1.a[i2] = i3;
            this.o.writeLock().unlock();
            c(g.a(paramg));
            k();
            return;
          }
        }
      }
      finally
      {
        this.o.writeLock().unlock();
      }
      i locali2 = this.i;
      int i4 = g.a(paramg);
      locali2.a[i4] = i1;
    }
  }

  public static void a(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    int i1 = paramInt1 + 1;
    paramArrayOfByte[paramInt1] = ((byte)(paramInt2 >> 24));
    int i2 = i1 + 1;
    paramArrayOfByte[i1] = ((byte)(paramInt2 >> 16));
    int i3 = i2 + 1;
    paramArrayOfByte[i2] = ((byte)(paramInt2 >> 8));
    paramArrayOfByte[i3] = ((byte)paramInt2);
  }

  public static void a(byte[] paramArrayOfByte, int paramInt, long paramLong)
  {
    a(paramArrayOfByte, paramInt, (int)(paramLong >> 32));
    a(paramArrayOfByte, paramInt + 4, (int)paramLong);
  }

  private boolean a(f paramf, d paramd)
  {
    byte[] arrayOfByte = paramd.b();
    if (arrayOfByte.length != paramf.d)
      return false;
    if (arrayOfByte.length == 0)
      return true;
    try
    {
      boolean bool = Arrays.equals(arrayOfByte, a(paramf));
      return bool;
    }
    catch (IOException localIOException)
    {
    }
    return false;
  }

  private byte[] a(f paramf)
  {
    if (paramf.d == 0)
      return a;
    try
    {
      com.google.android.m4b.maps.at.a locala = e(paramf.g);
      byte[] arrayOfByte = new byte[paramf.d];
      a(locala, paramf.b, arrayOfByte);
      return arrayOfByte;
    }
    catch (IOException localIOException)
    {
      a(paramf, localIOException);
      throw localIOException;
    }
  }

  public static int b(byte[] paramArrayOfByte, int paramInt)
  {
    int i1 = paramInt + 1;
    int i2 = 0xFF & paramArrayOfByte[paramInt];
    return 0xFF & paramArrayOfByte[i1] | i2 << 8;
  }

  private g b(int paramInt)
  {
    byte[] arrayOfByte;
    synchronized (this.g)
    {
      this.g.a(paramInt * 8192 + this.h.i);
      com.google.android.m4b.maps.at.a locala2 = this.g;
      arrayOfByte = new byte[8192];
      locala2.b(arrayOfByte);
      int i1 = c(arrayOfByte, 0, 8188);
      int i2 = a(arrayOfByte, 8188);
      if (i1 != i2)
        throw new IOException("Unexpected checksum: " + i1 + ", expected: " + i2);
    }
    g localg = new g(arrayOfByte);
    return localg;
  }

  private h b(d paramd)
  {
    int[] arrayOfInt = a.a(paramd.a());
    int i1 = this.i.f;
    for (int i2 = 0; i2 < i1; i2++)
      if ((this.i.b(i2)) && (this.j.a(arrayOfInt, i2)))
      {
        h localh = a(paramd, i2);
        if (localh != null)
          return localh;
      }
    return null;
  }

  // ERROR //
  private Collection<c> b(Collection<c> paramCollection)
  {
    // Byte code:
    //   0: new 137	java/util/HashSet
    //   3: dup
    //   4: aload_1
    //   5: invokeinterface 580 1 0
    //   10: invokespecial 581	java/util/HashSet:<init>	(I)V
    //   13: astore_2
    //   14: new 137	java/util/HashSet
    //   17: dup
    //   18: aload_1
    //   19: invokeinterface 580 1 0
    //   24: invokespecial 581	java/util/HashSet:<init>	(I)V
    //   27: astore_3
    //   28: new 583	java/util/HashMap
    //   31: dup
    //   32: aload_1
    //   33: invokeinterface 580 1 0
    //   38: invokespecial 584	java/util/HashMap:<init>	(I)V
    //   41: astore 4
    //   43: new 307	java/util/ArrayList
    //   46: dup
    //   47: aload_1
    //   48: invokespecial 587	java/util/ArrayList:<init>	(Ljava/util/Collection;)V
    //   51: astore 5
    //   53: aload 5
    //   55: invokestatic 591	java/util/Collections:reverse	(Ljava/util/List;)V
    //   58: aload 5
    //   60: invokeinterface 349 1 0
    //   65: astore 6
    //   67: aload 6
    //   69: invokeinterface 354 1 0
    //   74: ifeq +132 -> 206
    //   77: aload 6
    //   79: invokeinterface 358 1 0
    //   84: checkcast 238	com/google/android/m4b/maps/bg/e$c
    //   87: astore 33
    //   89: aload 33
    //   91: getfield 594	com/google/android/m4b/maps/bg/e$c:a	Lcom/google/android/m4b/maps/bg/e$d;
    //   94: invokevirtual 257	com/google/android/m4b/maps/bg/e$d:a	()J
    //   97: ldc2_w 315
    //   100: lcmp
    //   101: ifeq +15 -> 116
    //   104: aload 33
    //   106: getfield 596	com/google/android/m4b/maps/bg/e$c:b	[B
    //   109: arraylength
    //   110: sipush 255
    //   113: if_icmple +13 -> 126
    //   116: aload 6
    //   118: invokeinterface 599 1 0
    //   123: goto -56 -> 67
    //   126: aload_3
    //   127: aload 33
    //   129: getfield 594	com/google/android/m4b/maps/bg/e$c:a	Lcom/google/android/m4b/maps/bg/e$d;
    //   132: invokeinterface 296 2 0
    //   137: ifeq +36 -> 173
    //   140: aload 6
    //   142: invokeinterface 599 1 0
    //   147: aload 33
    //   149: getfield 600	com/google/android/m4b/maps/bg/e$c:c	I
    //   152: ifle -85 -> 67
    //   155: aload 33
    //   157: getfield 600	com/google/android/m4b/maps/bg/e$c:c	I
    //   160: aload 33
    //   162: getfield 594	com/google/android/m4b/maps/bg/e$c:a	Lcom/google/android/m4b/maps/bg/e$d;
    //   165: aload 4
    //   167: invokestatic 602	com/google/android/m4b/maps/bg/e:a	(ILcom/google/android/m4b/maps/bg/e$d;Ljava/util/Map;)V
    //   170: goto -103 -> 67
    //   173: aload_2
    //   174: aload 33
    //   176: getfield 594	com/google/android/m4b/maps/bg/e$c:a	Lcom/google/android/m4b/maps/bg/e$d;
    //   179: invokevirtual 257	com/google/android/m4b/maps/bg/e$d:a	()J
    //   182: invokestatic 263	java/lang/Long:valueOf	(J)Ljava/lang/Long;
    //   185: invokeinterface 499 2 0
    //   190: pop
    //   191: aload_3
    //   192: aload 33
    //   194: getfield 594	com/google/android/m4b/maps/bg/e$c:a	Lcom/google/android/m4b/maps/bg/e$d;
    //   197: invokeinterface 499 2 0
    //   202: pop
    //   203: goto -136 -> 67
    //   206: iconst_0
    //   207: istore 7
    //   209: iload 7
    //   211: aload_0
    //   212: getfield 106	com/google/android/m4b/maps/bg/e:i	Lcom/google/android/m4b/maps/bg/e$i;
    //   215: getfield 209	com/google/android/m4b/maps/bg/e$i:f	I
    //   218: if_icmpge +357 -> 575
    //   221: aload_2
    //   222: invokeinterface 603 1 0
    //   227: astore 14
    //   229: aload 14
    //   231: invokeinterface 354 1 0
    //   236: ifeq +474 -> 710
    //   239: aload 14
    //   241: invokeinterface 358 1 0
    //   246: checkcast 259	java/lang/Long
    //   249: astore 32
    //   251: aload_0
    //   252: getfield 106	com/google/android/m4b/maps/bg/e:i	Lcom/google/android/m4b/maps/bg/e$i;
    //   255: iload 7
    //   257: invokevirtual 157	com/google/android/m4b/maps/bg/e$i:b	(I)Z
    //   260: ifeq -31 -> 229
    //   263: aload_0
    //   264: getfield 108	com/google/android/m4b/maps/bg/e:j	Lcom/google/android/m4b/maps/bg/e$a;
    //   267: aload 32
    //   269: invokevirtual 606	java/lang/Long:longValue	()J
    //   272: invokestatic 569	com/google/android/m4b/maps/bg/e$a:a	(J)[I
    //   275: iload 7
    //   277: invokevirtual 572	com/google/android/m4b/maps/bg/e$a:a	([II)Z
    //   280: ifeq -51 -> 229
    //   283: iconst_1
    //   284: istore 15
    //   286: iload 15
    //   288: ifeq +268 -> 556
    //   291: aload_0
    //   292: iload 7
    //   294: invokespecial 182	com/google/android/m4b/maps/bg/e:b	(I)Lcom/google/android/m4b/maps/bg/e$g;
    //   297: astore 31
    //   299: aload 31
    //   301: astore 17
    //   303: aload 17
    //   305: ifnull +251 -> 556
    //   308: iconst_0
    //   309: istore 18
    //   311: iconst_0
    //   312: istore 19
    //   314: iload 19
    //   316: aload 17
    //   318: invokevirtual 305	com/google/android/m4b/maps/bg/e$g:b	()I
    //   321: if_icmpge +223 -> 544
    //   324: aload 17
    //   326: iload 19
    //   328: invokevirtual 508	com/google/android/m4b/maps/bg/e$g:b	(I)J
    //   331: lstore 20
    //   333: aload_2
    //   334: lload 20
    //   336: invokestatic 263	java/lang/Long:valueOf	(J)Ljava/lang/Long;
    //   339: invokeinterface 296 2 0
    //   344: ifeq +149 -> 493
    //   347: getstatic 65	com/google/android/m4b/maps/bg/e:a	[B
    //   350: astore 22
    //   352: aload 17
    //   354: iload 19
    //   356: invokevirtual 608	com/google/android/m4b/maps/bg/e$g:c	(I)I
    //   359: ifle +24 -> 383
    //   362: aload 17
    //   364: iload 19
    //   366: invokevirtual 311	com/google/android/m4b/maps/bg/e$g:e	(I)Lcom/google/android/m4b/maps/bg/e$f;
    //   369: astore 28
    //   371: aload_0
    //   372: aload 28
    //   374: invokespecial 552	com/google/android/m4b/maps/bg/e:a	(Lcom/google/android/m4b/maps/bg/e$f;)[B
    //   377: astore 30
    //   379: aload 30
    //   381: astore 22
    //   383: new 254	com/google/android/m4b/maps/bg/e$d
    //   386: dup
    //   387: lload 20
    //   389: aload 22
    //   391: invokespecial 611	com/google/android/m4b/maps/bg/e$d:<init>	(J[B)V
    //   394: astore 23
    //   396: aload_3
    //   397: aload 23
    //   399: invokeinterface 296 2 0
    //   404: ifeq +89 -> 493
    //   407: aload_0
    //   408: iconst_1
    //   409: aload_0
    //   410: getfield 613	com/google/android/m4b/maps/bg/e:v	I
    //   413: iadd
    //   414: putfield 613	com/google/android/m4b/maps/bg/e:v	I
    //   417: aload_0
    //   418: getfield 98	com/google/android/m4b/maps/bg/e:z	Lcom/google/android/m4b/maps/bg/f;
    //   421: ifnull +14 -> 435
    //   424: aload_0
    //   425: getfield 98	com/google/android/m4b/maps/bg/e:z	Lcom/google/android/m4b/maps/bg/f;
    //   428: lload 20
    //   430: invokeinterface 614 3 0
    //   435: aload_0
    //   436: getfield 135	com/google/android/m4b/maps/bg/e:l	Lcom/google/android/m4b/maps/bk/f;
    //   439: astore 24
    //   441: aload 24
    //   443: monitorenter
    //   444: aload_0
    //   445: getfield 135	com/google/android/m4b/maps/bg/e:l	Lcom/google/android/m4b/maps/bk/f;
    //   448: lload 20
    //   450: invokestatic 263	java/lang/Long:valueOf	(J)Ljava/lang/Long;
    //   453: invokevirtual 274	com/google/android/m4b/maps/bk/f:c	(Ljava/lang/Object;)Ljava/lang/Object;
    //   456: pop
    //   457: aload 24
    //   459: monitorexit
    //   460: aload 17
    //   462: iload 19
    //   464: invokevirtual 511	com/google/android/m4b/maps/bg/e$g:d	(I)I
    //   467: istore 27
    //   469: iload 27
    //   471: ifle +12 -> 483
    //   474: iload 27
    //   476: aload 23
    //   478: aload 4
    //   480: invokestatic 602	com/google/android/m4b/maps/bg/e:a	(ILcom/google/android/m4b/maps/bg/e$d;Ljava/util/Map;)V
    //   483: aload 17
    //   485: iload 19
    //   487: invokevirtual 615	com/google/android/m4b/maps/bg/e$g:a	(I)V
    //   490: iconst_1
    //   491: istore 18
    //   493: iinc 19 1
    //   496: goto -182 -> 314
    //   499: astore 16
    //   501: new 168	java/lang/StringBuilder
    //   504: dup
    //   505: ldc_w 617
    //   508: invokespecial 173	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   511: iload 7
    //   513: invokevirtual 177	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
    //   516: invokevirtual 194	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   519: aload 16
    //   521: invokestatic 199	com/google/android/m4b/maps/al/d:a	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   524: aload_0
    //   525: iload 7
    //   527: invokespecial 201	com/google/android/m4b/maps/bg/e:d	(I)V
    //   530: aconst_null
    //   531: astore 17
    //   533: goto -230 -> 303
    //   536: astore 25
    //   538: aload 24
    //   540: monitorexit
    //   541: aload 25
    //   543: athrow
    //   544: iload 18
    //   546: ifeq +16 -> 562
    //   549: aload_0
    //   550: aload 17
    //   552: iconst_0
    //   553: invokespecial 493	com/google/android/m4b/maps/bg/e:a	(Lcom/google/android/m4b/maps/bg/e$g;Z)V
    //   556: iinc 7 1
    //   559: goto -350 -> 209
    //   562: aload_0
    //   563: iconst_1
    //   564: aload_0
    //   565: getfield 619	com/google/android/m4b/maps/bg/e:u	I
    //   568: iadd
    //   569: putfield 619	com/google/android/m4b/maps/bg/e:u	I
    //   572: goto -16 -> 556
    //   575: new 307	java/util/ArrayList
    //   578: dup
    //   579: aload 5
    //   581: invokeinterface 620 1 0
    //   586: invokespecial 308	java/util/ArrayList:<init>	(I)V
    //   589: astore 8
    //   591: iconst_m1
    //   592: aload 5
    //   594: invokeinterface 620 1 0
    //   599: iadd
    //   600: istore 9
    //   602: iload 9
    //   604: iflt +103 -> 707
    //   607: aload 5
    //   609: iload 9
    //   611: invokeinterface 623 2 0
    //   616: checkcast 238	com/google/android/m4b/maps/bg/e$c
    //   619: astore 10
    //   621: aload 4
    //   623: aload 10
    //   625: getfield 594	com/google/android/m4b/maps/bg/e$c:a	Lcom/google/android/m4b/maps/bg/e$d;
    //   628: invokeinterface 469 2 0
    //   633: checkcast 287	java/lang/Integer
    //   636: astore 11
    //   638: aload 11
    //   640: ifnull +46 -> 686
    //   643: aload 11
    //   645: invokevirtual 472	java/lang/Integer:intValue	()I
    //   648: aload 10
    //   650: getfield 600	com/google/android/m4b/maps/bg/e$c:c	I
    //   653: invokestatic 476	com/google/android/m4b/maps/be/g:a	(II)I
    //   656: invokestatic 290	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
    //   659: astore 13
    //   661: new 238	com/google/android/m4b/maps/bg/e$c
    //   664: dup
    //   665: aload 10
    //   667: getfield 594	com/google/android/m4b/maps/bg/e$c:a	Lcom/google/android/m4b/maps/bg/e$d;
    //   670: aload 13
    //   672: invokevirtual 472	java/lang/Integer:intValue	()I
    //   675: aload 10
    //   677: getfield 625	com/google/android/m4b/maps/bg/e$c:d	[B
    //   680: iconst_0
    //   681: invokespecial 244	com/google/android/m4b/maps/bg/e$c:<init>	(Lcom/google/android/m4b/maps/bg/e$d;I[BB)V
    //   684: astore 10
    //   686: aload 8
    //   688: aload 10
    //   690: invokeinterface 321 2 0
    //   695: pop
    //   696: iinc 9 255
    //   699: goto -97 -> 602
    //   702: astore 29
    //   704: goto -211 -> 493
    //   707: aload 8
    //   709: areturn
    //   710: iconst_0
    //   711: istore 15
    //   713: goto -427 -> 286
    //
    // Exception table:
    //   from	to	target	type
    //   291	299	499	java/io/IOException
    //   444	460	536	finally
    //   371	379	702	java/io/IOException
  }

  private void b(boolean paramBoolean)
  {
    if (this.h.c <= this.B);
    while (true)
    {
      return;
      int i1;
      if (paramBoolean)
      {
        i1 = this.i.f;
        int i2 = i1 - this.i.g;
        if (this.A != null)
          i2 -= this.A.size();
        if (i2 >= this.B)
          continue;
        System.currentTimeMillis();
      }
      try
      {
        Object localObject = a(0, 0, 0);
        if (localObject == null)
          continue;
        int i3 = ((g)localObject).a();
        g localg2 = a(i3 + 1, this.i.e[i3], ((g)localObject).d());
        if (localg2 == null)
          continue;
        int i4 = a(paramBoolean);
        if (i4 == -1)
          continue;
        localg1 = new g(i4);
        try
        {
          byte[] arrayOfByte = new byte[131072];
          e locale = new e(e(i4), 0, arrayOfByte);
          HashSet localHashSet = new HashSet();
          while (true)
          {
            if (localObject == null)
              break label275;
            a((g)localObject, localg1, locale);
            localHashSet.add(Integer.valueOf(((g)localObject).a()));
            int i5 = localHashSet.size();
            if (i5 >= 4)
              break label275;
            if (localg2 != null)
            {
              localObject = localg2;
              localg2 = null;
              continue;
              i1 = this.h.c;
              break;
            }
            localObject = a(1 + ((g)localObject).a(), localg1.b(), localg1.c());
          }
          label275: a(locale, localg1);
          Iterator localIterator = localHashSet.iterator();
          while (localIterator.hasNext())
          {
            int i6 = ((Integer)localIterator.next()).intValue();
            try
            {
              g localg3 = b(i6);
              i7 = 0;
              if (i7 < localg3.b())
              {
                if ((localg3.b(i7) == -1L) || (localg3.d(i7) <= 0))
                  break label426;
                localg3.a(i7);
                break label426;
              }
              a(localg3, false);
            }
            catch (IOException localIOException3)
            {
              d(i6);
            }
          }
        }
        catch (IOException localIOException1)
        {
          if (localg1 != null)
            d(localg1.a());
          d.a("Failed to combine refCounted records", localIOException1);
          return;
        }
      }
      catch (IOException localIOException2)
      {
        while (true)
        {
          int i7;
          g localg1 = null;
          continue;
          label426: i7++;
        }
      }
    }
  }

  public static void b(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    int i1 = paramInt1 + 1;
    paramArrayOfByte[paramInt1] = ((byte)(paramInt2 >> 8));
    paramArrayOfByte[i1] = ((byte)paramInt2);
  }

  static int c(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    CRC32 localCRC32 = new CRC32();
    localCRC32.update(paramArrayOfByte, paramInt1, paramInt2);
    return (int)localCRC32.getValue();
  }

  public static long c(byte[] paramArrayOfByte, int paramInt)
  {
    long l1 = a(paramArrayOfByte, paramInt);
    return 0xFFFFFFFF & a(paramArrayOfByte, paramInt + 4) | l1 << 32;
  }

  private static d c(long paramLong, String paramString)
  {
    byte[] arrayOfByte = a;
    if (paramString != null)
      arrayOfByte = k.a(paramString);
    return new d(paramLong, arrayOfByte);
  }

  private void c(int paramInt)
  {
    synchronized (this.g)
    {
      this.g.a(16384 + paramInt * 1024);
      a locala = this.j;
      com.google.android.m4b.maps.at.a locala2 = this.g;
      locala.b(paramInt);
      locala2.b(locala.a, paramInt * 1024, 1024);
      this.g.b();
      return;
    }
  }

  private byte[] c(d paramd)
  {
    f localf = a(paramd);
    byte[] arrayOfByte;
    if (localf != null)
      try
      {
        com.google.android.m4b.maps.at.a locala = e(localf.g);
        arrayOfByte = new byte[localf.e];
        a(locala, localf.b + localf.d, arrayOfByte);
        int i1 = c(arrayOfByte, 0, arrayOfByte.length);
        if (i1 == localf.f)
          break label115;
        throw new IOException("Checksum mismatch: " + i1 + " record [" + localf + "]");
      }
      catch (IOException localIOException)
      {
        a(localf, localIOException);
      }
    else
      return null;
    label115: i locali = this.i;
    int i2 = localf.g;
    int i3 = m();
    locali.a[i2] = i3;
    return arrayOfByte;
  }

  private void d(int paramInt)
  {
    g localg = new g(paramInt);
    try
    {
      a(localg, false);
      synchronized (this.l)
      {
        this.l.a();
        this.m.clear();
        if (this.z != null)
        {
          this.z.a(paramInt);
          return;
        }
      }
    }
    catch (IOException localIOException)
    {
      d.a("Cache:" + this.e, localIOException);
    }
  }

  private com.google.android.m4b.maps.at.a e(int paramInt)
  {
    synchronized (this.k)
    {
      if (this.k[paramInt] == null)
        this.k[paramInt] = this.f.a(f(paramInt), true);
      com.google.android.m4b.maps.at.a locala = this.k[paramInt];
      return locala;
    }
  }

  private static int f()
  {
    com.google.android.m4b.maps.aq.i locali = com.google.android.m4b.maps.aq.g.c();
    if (locali == null)
      throw new IllegalStateException("VectorMapsParameters is null");
    return 0xFFFF & locali.b();
  }

  private String f(int paramInt)
  {
    return this.e + '.' + paramInt;
  }

  private int g()
  {
    int i1 = 0;
    this.o.readLock().lock();
    try
    {
      i locali = this.i;
      int i2 = 0;
      while (i1 < locali.f)
      {
        int i3 = locali.d[i1];
        i2 += i3;
        i1++;
      }
      return i2;
    }
    finally
    {
      this.o.readLock().unlock();
    }
  }

  private int h()
  {
    return this.h.c * this.h.d;
  }

  // ERROR //
  private void i()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 146	com/google/android/m4b/maps/bg/e:m	Ljava/util/Set;
    //   4: invokeinterface 626 1 0
    //   9: ifne +4 -> 13
    //   12: return
    //   13: aload_0
    //   14: getfield 146	com/google/android/m4b/maps/bg/e:m	Ljava/util/Set;
    //   17: astore_1
    //   18: aload_1
    //   19: monitorenter
    //   20: new 307	java/util/ArrayList
    //   23: dup
    //   24: aload_0
    //   25: getfield 146	com/google/android/m4b/maps/bg/e:m	Ljava/util/Set;
    //   28: invokespecial 587	java/util/ArrayList:<init>	(Ljava/util/Collection;)V
    //   31: astore_2
    //   32: aload_0
    //   33: getfield 146	com/google/android/m4b/maps/bg/e:m	Ljava/util/Set;
    //   36: invokeinterface 677 1 0
    //   41: aload_1
    //   42: monitorexit
    //   43: aload_2
    //   44: invokevirtual 698	java/util/ArrayList:iterator	()Ljava/util/Iterator;
    //   47: astore 4
    //   49: aload 4
    //   51: invokeinterface 354 1 0
    //   56: ifeq -44 -> 12
    //   59: aload 4
    //   61: invokeinterface 358 1 0
    //   66: checkcast 268	com/google/android/m4b/maps/bg/e$f
    //   69: astore 5
    //   71: aload_0
    //   72: aload 5
    //   74: getfield 272	com/google/android/m4b/maps/bg/e$f:g	I
    //   77: invokespecial 182	com/google/android/m4b/maps/bg/e:b	(I)Lcom/google/android/m4b/maps/bg/e$g;
    //   80: astore 7
    //   82: aload 7
    //   84: invokevirtual 305	com/google/android/m4b/maps/bg/e$g:b	()I
    //   87: aload 5
    //   89: getfield 700	com/google/android/m4b/maps/bg/e$f:h	I
    //   92: if_icmple -43 -> 49
    //   95: aload 7
    //   97: aload 5
    //   99: getfield 700	com/google/android/m4b/maps/bg/e$f:h	I
    //   102: invokevirtual 311	com/google/android/m4b/maps/bg/e$g:e	(I)Lcom/google/android/m4b/maps/bg/e$f;
    //   105: getfield 314	com/google/android/m4b/maps/bg/e$f:a	J
    //   108: aload 5
    //   110: getfield 314	com/google/android/m4b/maps/bg/e$f:a	J
    //   113: lcmp
    //   114: ifne -65 -> 49
    //   117: aload 7
    //   119: aload 5
    //   121: getfield 700	com/google/android/m4b/maps/bg/e$f:h	I
    //   124: invokevirtual 615	com/google/android/m4b/maps/bg/e$g:a	(I)V
    //   127: aload_0
    //   128: getfield 135	com/google/android/m4b/maps/bg/e:l	Lcom/google/android/m4b/maps/bk/f;
    //   131: astore 8
    //   133: aload 8
    //   135: monitorenter
    //   136: aload_0
    //   137: getfield 135	com/google/android/m4b/maps/bg/e:l	Lcom/google/android/m4b/maps/bk/f;
    //   140: aload 5
    //   142: getfield 314	com/google/android/m4b/maps/bg/e$f:a	J
    //   145: invokestatic 263	java/lang/Long:valueOf	(J)Ljava/lang/Long;
    //   148: invokevirtual 274	com/google/android/m4b/maps/bk/f:c	(Ljava/lang/Object;)Ljava/lang/Object;
    //   151: pop
    //   152: aload 8
    //   154: monitorexit
    //   155: aload_0
    //   156: aload 7
    //   158: iconst_0
    //   159: invokespecial 493	com/google/android/m4b/maps/bg/e:a	(Lcom/google/android/m4b/maps/bg/e$g;Z)V
    //   162: aload_0
    //   163: getfield 98	com/google/android/m4b/maps/bg/e:z	Lcom/google/android/m4b/maps/bg/f;
    //   166: ifnull -117 -> 49
    //   169: aload_0
    //   170: getfield 98	com/google/android/m4b/maps/bg/e:z	Lcom/google/android/m4b/maps/bg/f;
    //   173: aload 5
    //   175: getfield 314	com/google/android/m4b/maps/bg/e$f:a	J
    //   178: invokeinterface 614 3 0
    //   183: goto -134 -> 49
    //   186: astore 6
    //   188: new 168	java/lang/StringBuilder
    //   191: dup
    //   192: ldc_w 498
    //   195: invokespecial 173	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   198: aload_0
    //   199: getfield 102	com/google/android/m4b/maps/bg/e:e	Ljava/lang/String;
    //   202: invokevirtual 334	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   205: invokevirtual 194	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   208: aload 6
    //   210: invokestatic 199	com/google/android/m4b/maps/al/d:a	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   213: goto -164 -> 49
    //   216: astore_3
    //   217: aload_1
    //   218: monitorexit
    //   219: aload_3
    //   220: athrow
    //   221: astore 9
    //   223: aload 8
    //   225: monitorexit
    //   226: aload 9
    //   228: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   71	136	186	java/io/IOException
    //   155	183	186	java/io/IOException
    //   223	229	186	java/io/IOException
    //   20	43	216	finally
    //   136	155	221	finally
  }

  private void j()
  {
    if (this.m.size() == 0);
    while (!this.n.tryLock())
      return;
    try
    {
      i();
      return;
    }
    finally
    {
      this.n.unlock();
    }
  }

  private void k()
  {
    synchronized (this.g)
    {
      this.g.a(8192L);
      this.i.a(this.g);
      this.g.b();
      return;
    }
  }

  private g l()
  {
    if ((!C) && (this.A == null))
      throw new AssertionError();
    int i1 = 0;
    if (i1 < this.i.f)
      if ((this.i.c[i1] >= this.h.d) || (this.i.b[i1] > 134217727));
    while (true)
    {
      try
      {
        g localg3 = b(i1);
        localg1 = localg3;
        if (i1 != -1)
          break label312;
        if (this.i.b() < 20)
          break label266;
        long l1 = d.c();
        long l2 = this.i.a();
        if (()(0.25D * (l1 + l2)) >= l2)
          break label266;
        bool = true;
        b(bool);
        if (!this.h.e)
          break label272;
        int i3 = 0;
        if (!bool)
          break label272;
        if (i3 >= 2)
          break label272;
        int i4 = this.i.a(this.A);
        if (i4 != -1)
        {
          d(i4);
          if (this.k[i4] != null)
          {
            this.k[i4].a();
            this.k[i4] = null;
          }
          this.f.a(f(i4));
        }
        i3++;
        continue;
      }
      catch (IOException localIOException)
      {
        d.a("allocateShardToUse: " + i1, localIOException);
        localg1 = null;
        continue;
      }
      i1++;
      break;
      label266: boolean bool = false;
      continue;
      label272: i1 = a(bool);
      if (i1 == -1)
      {
        d.c("Cache:" + this.e, "Tile store full, unable to allocate shard");
        return null;
      }
      label312: int i2 = i1;
      if ((localg1 == null) || (localg1.b() != this.i.c[i2]));
      for (g localg2 = new g(i2); ; localg2 = localg1)
      {
        this.A.add(Integer.valueOf(i2));
        return localg2;
      }
      i1 = -1;
      g localg1 = null;
    }
  }

  private int m()
  {
    if (this.w >= 0)
      return this.w;
    return (int)(System.currentTimeMillis() / 1000L);
  }

  public final int a()
  {
    return this.h.f;
  }

  public final int a(long paramLong, String paramString, int paramInt)
  {
    this.n.lock();
    try
    {
      h localh = b(c(paramLong, paramString));
      if (localh == null)
        return -1;
      int i1 = this.i.e[localh.a.a()];
      f localf1 = localh.b;
      int i2 = 0x1F & com.google.android.m4b.maps.be.g.a(localf1.c, paramInt);
      f localf2 = new f(localf1.a, localf1.b, localf1.d, localf1.e, i2, localf1.f, localf1.g, localf1.h);
      localh.a.a(localf2, localh.c);
      a(localh.a, true);
      if ((i1 == 0) && (this.i.e[localh.a.a()] == 1))
        b(false);
      return i2;
    }
    finally
    {
      this.n.unlock();
    }
  }

  public final int a(Collection<c> paramCollection)
  {
    this.n.lock();
    byte[] arrayOfByte;
    Object localObject2;
    ArrayList localArrayList;
    Object localObject3;
    c localc1;
    int i2;
    try
    {
      boolean bool = this.p;
      if (bool)
        return -1;
      Collection localCollection = b(paramCollection);
      i();
      Iterator localIterator1 = localCollection.iterator();
      int i1 = 0;
      while (localIterator1.hasNext())
      {
        c localc2 = (c)localIterator1.next();
        i1 += localc2.d.length + localc2.b.length;
      }
      arrayOfByte = new byte[Math.min(i1, 131072)];
      this.A = new HashSet();
      g localg1 = l();
      localObject2 = localg1;
      if (localObject2 == null)
        return -1;
      localArrayList = new ArrayList();
      localObject3 = new e(e(((g)localObject2).a()), ((g)localObject2).c(), arrayOfByte);
      Iterator localIterator2 = localCollection.iterator();
      if (!localIterator2.hasNext())
        break label508;
      localc1 = (c)localIterator2.next();
      i2 = 0x1F & localc1.c;
      if ((((g)localObject2).b() < this.h.d) && (((g)localObject2).c() <= 134217727))
        break label590;
      a((e)localObject3, (g)localObject2);
      if (this.z != null)
      {
        Iterator localIterator4 = localArrayList.iterator();
        while (localIterator4.hasNext())
        {
          long l2 = ((Long)localIterator4.next()).longValue();
          this.z.a(l2, ((g)localObject2).a());
        }
      }
    }
    finally
    {
      this.A = null;
      this.n.unlock();
    }
    localArrayList.clear();
    g localg2 = l();
    if (localg2 == null)
    {
      this.A = null;
      this.n.unlock();
      return -1;
    }
    Object localObject4 = new e(e(localg2.a()), localg2.c(), arrayOfByte);
    for (Object localObject5 = localg2; ; localObject5 = localObject2)
    {
      ((e)localObject4).a(localc1.b);
      ((e)localObject4).a(localc1.d);
      f localf = new f(localc1.a.a(), ((g)localObject5).c(), localc1.b.length, localc1.d.length, i2, c(localc1.d, 0, localc1.d.length), ((g)localObject5).a(), ((g)localObject5).b());
      ((g)localObject5).a(localf);
      localArrayList.add(Long.valueOf(localf.a));
      localObject3 = localObject4;
      localObject2 = localObject5;
      break;
      label508: a((e)localObject3, (g)localObject2);
      if (this.z != null)
      {
        Iterator localIterator3 = localArrayList.iterator();
        while (localIterator3.hasNext())
        {
          long l1 = ((Long)localIterator3.next()).longValue();
          this.z.a(l1, ((g)localObject2).a());
        }
      }
      this.A = null;
      this.n.unlock();
      return 0;
      label590: localObject4 = localObject3;
    }
  }

  public final void a(int paramInt)
  {
    a(paramInt, this.h.a);
  }

  // ERROR //
  public final void a(int paramInt, Locale paramLocale)
  {
    // Byte code:
    //   0: iconst_0
    //   1: istore_3
    //   2: aload_0
    //   3: getfield 83	com/google/android/m4b/maps/bg/e:n	Ljava/util/concurrent/locks/ReentrantLock;
    //   6: invokevirtual 149	java/util/concurrent/locks/ReentrantLock:lock	()V
    //   9: aload_0
    //   10: iconst_1
    //   11: putfield 734	com/google/android/m4b/maps/bg/e:p	Z
    //   14: aload_0
    //   15: getfield 90	com/google/android/m4b/maps/bg/e:o	Ljava/util/concurrent/locks/ReentrantReadWriteLock;
    //   18: invokevirtual 218	java/util/concurrent/locks/ReentrantReadWriteLock:writeLock	()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
    //   21: invokevirtual 221	java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock:lock	()V
    //   24: aload_0
    //   25: getfield 98	com/google/android/m4b/maps/bg/e:z	Lcom/google/android/m4b/maps/bg/f;
    //   28: ifnull +12 -> 40
    //   31: aload_0
    //   32: getfield 98	com/google/android/m4b/maps/bg/e:z	Lcom/google/android/m4b/maps/bg/f;
    //   35: invokeinterface 745 1 0
    //   40: aload_0
    //   41: getfield 135	com/google/android/m4b/maps/bg/e:l	Lcom/google/android/m4b/maps/bk/f;
    //   44: astore 7
    //   46: aload 7
    //   48: monitorenter
    //   49: aload_0
    //   50: getfield 135	com/google/android/m4b/maps/bg/e:l	Lcom/google/android/m4b/maps/bk/f;
    //   53: invokevirtual 674	com/google/android/m4b/maps/bk/f:a	()V
    //   56: aload 7
    //   58: monitorexit
    //   59: aload_0
    //   60: getfield 146	com/google/android/m4b/maps/bg/e:m	Ljava/util/Set;
    //   63: invokeinterface 677 1 0
    //   68: iload_3
    //   69: aload_0
    //   70: getfield 119	com/google/android/m4b/maps/bg/e:k	[Lcom/google/android/m4b/maps/at/a;
    //   73: arraylength
    //   74: if_icmpge +90 -> 164
    //   77: aload_0
    //   78: getfield 119	com/google/android/m4b/maps/bg/e:k	[Lcom/google/android/m4b/maps/at/a;
    //   81: iload_3
    //   82: aaload
    //   83: ifnull +19 -> 102
    //   86: aload_0
    //   87: getfield 119	com/google/android/m4b/maps/bg/e:k	[Lcom/google/android/m4b/maps/at/a;
    //   90: iload_3
    //   91: aaload
    //   92: invokevirtual 714	com/google/android/m4b/maps/at/a:a	()V
    //   95: aload_0
    //   96: getfield 119	com/google/android/m4b/maps/bg/e:k	[Lcom/google/android/m4b/maps/at/a;
    //   99: iload_3
    //   100: aconst_null
    //   101: aastore
    //   102: aload_0
    //   103: getfield 112	com/google/android/m4b/maps/bg/e:f	Lcom/google/android/m4b/maps/at/a$a;
    //   106: aload_0
    //   107: iload_3
    //   108: invokespecial 681	com/google/android/m4b/maps/bg/e:f	(I)Ljava/lang/String;
    //   111: invokevirtual 382	com/google/android/m4b/maps/at/a$a:a	(Ljava/lang/String;)V
    //   114: iinc 3 1
    //   117: goto -49 -> 68
    //   120: astore 8
    //   122: aload 7
    //   124: monitorexit
    //   125: aload 8
    //   127: athrow
    //   128: astore 6
    //   130: aload_0
    //   131: invokevirtual 463	com/google/android/m4b/maps/bg/e:d	()V
    //   134: aload 6
    //   136: athrow
    //   137: astore 5
    //   139: aload_0
    //   140: getfield 90	com/google/android/m4b/maps/bg/e:o	Ljava/util/concurrent/locks/ReentrantReadWriteLock;
    //   143: invokevirtual 218	java/util/concurrent/locks/ReentrantReadWriteLock:writeLock	()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
    //   146: invokevirtual 235	java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock:unlock	()V
    //   149: aload 5
    //   151: athrow
    //   152: astore 4
    //   154: aload_0
    //   155: getfield 83	com/google/android/m4b/maps/bg/e:n	Ljava/util/concurrent/locks/ReentrantLock;
    //   158: invokevirtual 204	java/util/concurrent/locks/ReentrantLock:unlock	()V
    //   161: aload 4
    //   163: athrow
    //   164: aload_0
    //   165: getfield 110	com/google/android/m4b/maps/bg/e:g	Lcom/google/android/m4b/maps/at/a;
    //   168: invokevirtual 714	com/google/android/m4b/maps/at/a:a	()V
    //   171: aload_0
    //   172: getfield 112	com/google/android/m4b/maps/bg/e:f	Lcom/google/android/m4b/maps/at/a$a;
    //   175: new 168	java/lang/StringBuilder
    //   178: dup
    //   179: invokespecial 376	java/lang/StringBuilder:<init>	()V
    //   182: aload_0
    //   183: getfield 102	com/google/android/m4b/maps/bg/e:e	Ljava/lang/String;
    //   186: invokevirtual 334	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   189: ldc_w 378
    //   192: invokevirtual 334	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   195: invokevirtual 194	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   198: invokevirtual 382	com/google/android/m4b/maps/at/a$a:a	(Ljava/lang/String;)V
    //   201: aload_0
    //   202: aload_0
    //   203: getfield 112	com/google/android/m4b/maps/bg/e:f	Lcom/google/android/m4b/maps/at/a$a;
    //   206: new 168	java/lang/StringBuilder
    //   209: dup
    //   210: invokespecial 376	java/lang/StringBuilder:<init>	()V
    //   213: aload_0
    //   214: getfield 102	com/google/android/m4b/maps/bg/e:e	Ljava/lang/String;
    //   217: invokevirtual 334	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   220: ldc_w 378
    //   223: invokevirtual 334	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   226: invokevirtual 194	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   229: iconst_1
    //   230: invokevirtual 385	com/google/android/m4b/maps/at/a$a:a	(Ljava/lang/String;Z)Lcom/google/android/m4b/maps/at/a;
    //   233: putfield 110	com/google/android/m4b/maps/bg/e:g	Lcom/google/android/m4b/maps/at/a;
    //   236: aload_0
    //   237: new 114	com/google/android/m4b/maps/bg/e$b
    //   240: dup
    //   241: bipush 20
    //   243: invokestatic 387	com/google/android/m4b/maps/bg/e:f	()I
    //   246: bipush 16
    //   248: ishl
    //   249: iadd
    //   250: aload_0
    //   251: getfield 104	com/google/android/m4b/maps/bg/e:h	Lcom/google/android/m4b/maps/bg/e$b;
    //   254: getfield 433	com/google/android/m4b/maps/bg/e$b:b	I
    //   257: aload_0
    //   258: getfield 104	com/google/android/m4b/maps/bg/e:h	Lcom/google/android/m4b/maps/bg/e$b;
    //   261: getfield 115	com/google/android/m4b/maps/bg/e$b:c	I
    //   264: aload_0
    //   265: getfield 104	com/google/android/m4b/maps/bg/e:h	Lcom/google/android/m4b/maps/bg/e$b;
    //   268: getfield 284	com/google/android/m4b/maps/bg/e$b:d	I
    //   271: aload_0
    //   272: getfield 104	com/google/android/m4b/maps/bg/e:h	Lcom/google/android/m4b/maps/bg/e$b;
    //   275: getfield 450	com/google/android/m4b/maps/bg/e$b:e	Z
    //   278: iload_1
    //   279: invokestatic 392	com/google/android/m4b/maps/ak/e:e	()Lcom/google/android/m4b/maps/ak/e;
    //   282: invokevirtual 395	com/google/android/m4b/maps/ak/e:b	()Lcom/google/android/m4b/maps/z/b;
    //   285: invokevirtual 398	com/google/android/m4b/maps/z/b:a	()J
    //   288: aload_2
    //   289: invokespecial 401	com/google/android/m4b/maps/bg/e$b:<init>	(IIIIZIJLjava/util/Locale;)V
    //   292: putfield 104	com/google/android/m4b/maps/bg/e:h	Lcom/google/android/m4b/maps/bg/e$b;
    //   295: aload_0
    //   296: getfield 106	com/google/android/m4b/maps/bg/e:i	Lcom/google/android/m4b/maps/bg/e$i;
    //   299: astore 9
    //   301: aload 9
    //   303: getfield 223	com/google/android/m4b/maps/bg/e$i:a	[I
    //   306: iconst_0
    //   307: invokestatic 749	java/util/Arrays:fill	([II)V
    //   310: aload 9
    //   312: getfield 154	com/google/android/m4b/maps/bg/e$i:b	[I
    //   315: iconst_0
    //   316: invokestatic 749	java/util/Arrays:fill	([II)V
    //   319: aload 9
    //   321: getfield 225	com/google/android/m4b/maps/bg/e$i:c	[I
    //   324: iconst_0
    //   325: invokestatic 749	java/util/Arrays:fill	([II)V
    //   328: aload 9
    //   330: getfield 227	com/google/android/m4b/maps/bg/e$i:d	[I
    //   333: iconst_0
    //   334: invokestatic 749	java/util/Arrays:fill	([II)V
    //   337: aload 9
    //   339: getfield 229	com/google/android/m4b/maps/bg/e$i:e	[I
    //   342: iconst_0
    //   343: invokestatic 749	java/util/Arrays:fill	([II)V
    //   346: aload 9
    //   348: iconst_0
    //   349: putfield 209	com/google/android/m4b/maps/bg/e$i:f	I
    //   352: aload 9
    //   354: iconst_0
    //   355: putfield 231	com/google/android/m4b/maps/bg/e$i:g	I
    //   358: aload_0
    //   359: getfield 108	com/google/android/m4b/maps/bg/e:j	Lcom/google/android/m4b/maps/bg/e$a;
    //   362: getfield 160	com/google/android/m4b/maps/bg/e$a:a	[B
    //   365: iconst_0
    //   366: invokestatic 752	java/util/Arrays:fill	([BB)V
    //   369: aload_0
    //   370: getfield 104	com/google/android/m4b/maps/bg/e:h	Lcom/google/android/m4b/maps/bg/e$b;
    //   373: aload_0
    //   374: getfield 106	com/google/android/m4b/maps/bg/e:i	Lcom/google/android/m4b/maps/bg/e$i;
    //   377: aload_0
    //   378: getfield 108	com/google/android/m4b/maps/bg/e:j	Lcom/google/android/m4b/maps/bg/e$a;
    //   381: aload_0
    //   382: getfield 110	com/google/android/m4b/maps/bg/e:g	Lcom/google/android/m4b/maps/at/a;
    //   385: invokestatic 408	com/google/android/m4b/maps/bg/e:a	(Lcom/google/android/m4b/maps/bg/e$b;Lcom/google/android/m4b/maps/bg/e$i;Lcom/google/android/m4b/maps/bg/e$a;Lcom/google/android/m4b/maps/at/a;)V
    //   388: aload_0
    //   389: getfield 110	com/google/android/m4b/maps/bg/e:g	Lcom/google/android/m4b/maps/at/a;
    //   392: invokevirtual 410	com/google/android/m4b/maps/at/a:b	()V
    //   395: aload_0
    //   396: iconst_0
    //   397: putfield 734	com/google/android/m4b/maps/bg/e:p	Z
    //   400: aload_0
    //   401: getfield 90	com/google/android/m4b/maps/bg/e:o	Ljava/util/concurrent/locks/ReentrantReadWriteLock;
    //   404: invokevirtual 218	java/util/concurrent/locks/ReentrantReadWriteLock:writeLock	()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
    //   407: invokevirtual 235	java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock:unlock	()V
    //   410: aload_0
    //   411: getfield 83	com/google/android/m4b/maps/bg/e:n	Ljava/util/concurrent/locks/ReentrantLock;
    //   414: invokevirtual 204	java/util/concurrent/locks/ReentrantLock:unlock	()V
    //   417: return
    //
    // Exception table:
    //   from	to	target	type
    //   49	59	120	finally
    //   24	40	128	java/io/IOException
    //   40	49	128	java/io/IOException
    //   59	68	128	java/io/IOException
    //   68	102	128	java/io/IOException
    //   102	114	128	java/io/IOException
    //   122	128	128	java/io/IOException
    //   164	400	128	java/io/IOException
    //   24	40	137	finally
    //   40	49	137	finally
    //   59	68	137	finally
    //   68	102	137	finally
    //   102	114	137	finally
    //   122	128	137	finally
    //   130	137	137	finally
    //   164	400	137	finally
    //   9	24	152	finally
    //   139	152	152	finally
    //   400	410	152	finally
  }

  public final byte[] a(long paramLong, String paramString)
  {
    this.o.readLock().lock();
    try
    {
      boolean bool = this.p;
      if (bool)
        return null;
      byte[] arrayOfByte = c(c(paramLong, paramString));
      return arrayOfByte;
    }
    finally
    {
      this.o.readLock().unlock();
      j();
    }
  }

  public final long b()
  {
    return this.h.g;
  }

  public final boolean b(long paramLong, String paramString)
  {
    this.o.readLock().lock();
    try
    {
      f localf = a(c(paramLong, paramString));
      if (localf != null)
      {
        bool = true;
        return bool;
      }
      boolean bool = false;
    }
    finally
    {
      this.o.readLock().unlock();
      j();
    }
  }

  public final Locale c()
  {
    return this.h.h;
  }

  // ERROR //
  public final void d()
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_1
    //   2: aload_0
    //   3: getfield 83	com/google/android/m4b/maps/bg/e:n	Ljava/util/concurrent/locks/ReentrantLock;
    //   6: invokevirtual 149	java/util/concurrent/locks/ReentrantLock:lock	()V
    //   9: aload_0
    //   10: getfield 734	com/google/android/m4b/maps/bg/e:p	Z
    //   13: istore_3
    //   14: iload_3
    //   15: ifeq +11 -> 26
    //   18: aload_0
    //   19: getfield 83	com/google/android/m4b/maps/bg/e:n	Ljava/util/concurrent/locks/ReentrantLock;
    //   22: invokevirtual 204	java/util/concurrent/locks/ReentrantLock:unlock	()V
    //   25: return
    //   26: aload_0
    //   27: iconst_1
    //   28: putfield 734	com/google/android/m4b/maps/bg/e:p	Z
    //   31: aload_0
    //   32: getfield 90	com/google/android/m4b/maps/bg/e:o	Ljava/util/concurrent/locks/ReentrantReadWriteLock;
    //   35: invokevirtual 218	java/util/concurrent/locks/ReentrantReadWriteLock:writeLock	()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
    //   38: invokevirtual 221	java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock:lock	()V
    //   41: aload_0
    //   42: invokespecial 206	com/google/android/m4b/maps/bg/e:k	()V
    //   45: aload_0
    //   46: getfield 110	com/google/android/m4b/maps/bg/e:g	Lcom/google/android/m4b/maps/at/a;
    //   49: invokevirtual 714	com/google/android/m4b/maps/at/a:a	()V
    //   52: iconst_0
    //   53: istore 4
    //   55: iload 4
    //   57: aload_0
    //   58: getfield 119	com/google/android/m4b/maps/bg/e:k	[Lcom/google/android/m4b/maps/at/a;
    //   61: arraylength
    //   62: if_icmpge +38 -> 100
    //   65: aload_0
    //   66: getfield 119	com/google/android/m4b/maps/bg/e:k	[Lcom/google/android/m4b/maps/at/a;
    //   69: iload 4
    //   71: aaload
    //   72: astore 6
    //   74: aload 6
    //   76: ifnull +85 -> 161
    //   79: aload_0
    //   80: getfield 119	com/google/android/m4b/maps/bg/e:k	[Lcom/google/android/m4b/maps/at/a;
    //   83: iload 4
    //   85: aaload
    //   86: invokevirtual 714	com/google/android/m4b/maps/at/a:a	()V
    //   89: aload_0
    //   90: getfield 119	com/google/android/m4b/maps/bg/e:k	[Lcom/google/android/m4b/maps/at/a;
    //   93: iload 4
    //   95: aconst_null
    //   96: aastore
    //   97: goto +64 -> 161
    //   100: aload_1
    //   101: ifnull +30 -> 131
    //   104: aload_1
    //   105: athrow
    //   106: astore 5
    //   108: aload_0
    //   109: getfield 90	com/google/android/m4b/maps/bg/e:o	Ljava/util/concurrent/locks/ReentrantReadWriteLock;
    //   112: invokevirtual 218	java/util/concurrent/locks/ReentrantReadWriteLock:writeLock	()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
    //   115: invokevirtual 235	java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock:unlock	()V
    //   118: aload 5
    //   120: athrow
    //   121: astore_2
    //   122: aload_0
    //   123: getfield 83	com/google/android/m4b/maps/bg/e:n	Ljava/util/concurrent/locks/ReentrantLock;
    //   126: invokevirtual 204	java/util/concurrent/locks/ReentrantLock:unlock	()V
    //   129: aload_2
    //   130: athrow
    //   131: aload_0
    //   132: getfield 90	com/google/android/m4b/maps/bg/e:o	Ljava/util/concurrent/locks/ReentrantReadWriteLock;
    //   135: invokevirtual 218	java/util/concurrent/locks/ReentrantReadWriteLock:writeLock	()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
    //   138: invokevirtual 235	java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock:unlock	()V
    //   141: aload_0
    //   142: getfield 83	com/google/android/m4b/maps/bg/e:n	Ljava/util/concurrent/locks/ReentrantLock;
    //   145: invokevirtual 204	java/util/concurrent/locks/ReentrantLock:unlock	()V
    //   148: return
    //   149: astore_1
    //   150: goto -105 -> 45
    //   153: astore_1
    //   154: goto -65 -> 89
    //   157: astore_1
    //   158: goto -106 -> 52
    //   161: iinc 4 1
    //   164: goto -109 -> 55
    //
    // Exception table:
    //   from	to	target	type
    //   41	45	106	finally
    //   45	52	106	finally
    //   55	74	106	finally
    //   79	89	106	finally
    //   89	97	106	finally
    //   104	106	106	finally
    //   9	14	121	finally
    //   26	41	121	finally
    //   108	121	121	finally
    //   131	141	121	finally
    //   41	45	149	java/io/IOException
    //   79	89	153	java/io/IOException
    //   45	52	157	java/io/IOException
  }

  public String toString()
  {
    return "[" + this.e + " ver:" + this.h.f + " locale: " + this.h.h + " auto:" + this.h.e + " size:" + g() + " max:" + h() + " max_shards:" + this.h.c + "]";
  }

  static final class a
  {
    final byte[] a;
    int b;

    a(int paramInt1, int paramInt2)
    {
      this.a = new byte[paramInt1 * 1024];
      this.b = paramInt2;
    }

    static int[] a(long paramLong)
    {
      int i = 0;
      int[] arrayOfInt = new int[3];
      long l1 = Long.rotateRight(paramLong, 22);
      arrayOfInt[0] = ((int)(l1 % 8147L));
      long l2 = Long.rotateRight(l1, 22);
      arrayOfInt[1] = ((int)(l2 % 8147L));
      arrayOfInt[2] = ((int)(Long.rotateRight(l2, 22) % 8147L));
      while (i < 3)
      {
        if (arrayOfInt[i] < 0)
          arrayOfInt[i] = (8147 + arrayOfInt[i]);
        i++;
      }
      return arrayOfInt;
    }

    final void a(int paramInt)
    {
      int i = paramInt * 1024;
      Arrays.fill(this.a, i, i + 1020, (byte)0);
    }

    final void a(e.g paramg)
    {
      a(e.g.a(paramg));
      for (int i = 0; i < paramg.b(); i++)
      {
        long l = paramg.b(i);
        if (l != -1L)
        {
          int j = e.g.a(paramg);
          int[] arrayOfInt = a(l);
          int k = j * 1024;
          for (int m = 0; m < 3; m++)
          {
            int n = arrayOfInt[m] >> 3;
            int i1 = 0x7 & arrayOfInt[m];
            byte[] arrayOfByte = this.a;
            int i2 = n + k;
            arrayOfByte[i2] = ((byte)(arrayOfByte[i2] | 1 << i1));
          }
        }
      }
      if (e.g.a(paramg) >= this.b)
        this.b = (1 + e.g.a(paramg));
    }

    final boolean a(int[] paramArrayOfInt, int paramInt)
    {
      int i = paramInt * 1024;
      for (int j = 0; j < paramArrayOfInt.length; j++)
      {
        int k = paramArrayOfInt[j] >> 3;
        int m = 0x7 & paramArrayOfInt[j];
        if ((this.a[(k + i)] & 1 << m) == 0)
          return false;
      }
      return true;
    }

    final void b(int paramInt)
    {
      int i = paramInt * 1024;
      int j = e.c(this.a, i, 1020);
      e.a(this.a, i + 1020, j);
    }
  }

  static final class b
  {
    private static final int j = 43;
    final int a;
    final int b;
    final int c;
    final int d;
    final boolean e;
    final int f;
    final long g;
    final Locale h;
    final int i;
    private int k;
    private int l;

    b(int paramInt1, int paramInt2, int paramInt3, int paramInt4, boolean paramBoolean, int paramInt5, long paramLong, Locale paramLocale)
    {
      this.a = paramInt1;
      this.b = paramInt2;
      this.c = paramInt3;
      this.d = paramInt4;
      this.e = paramBoolean;
      this.f = paramInt5;
      this.h = paramLocale;
      this.g = paramLong;
      byte[] arrayOfByte = a();
      this.k = arrayOfByte.length;
      e.a(arrayOfByte, 4, this.k);
      this.l = e.c(arrayOfByte, 0, -4 + arrayOfByte.length);
      this.i = (16384 + 8192 * (1 + (-1 + 1024 * this.c) / 8192));
    }

    b(byte[] paramArrayOfByte, int paramInt)
    {
      this.a = e.a(paramArrayOfByte, 0);
      if (this.a == 1)
        throw new IOException("Can't parse header for old schema");
      this.k = e.a(paramArrayOfByte, 4);
      if ((this.k < 43) || (0 + this.k > 8192))
        throw new IOException("Wrong header size: " + this.k);
      this.l = e.a(paramArrayOfByte, -4 + (0 + this.k));
      int m = e.c(paramArrayOfByte, 0, -4 + this.k);
      if (this.l != m)
        throw new IOException("Checksum mismatch " + this.l + " vs " + m);
      com.google.android.m4b.maps.ad.a locala = new com.google.android.m4b.maps.ad.a(paramArrayOfByte);
      locala.skipBytes(8);
      this.b = locala.readInt();
      this.c = locala.readInt();
      this.d = locala.readInt();
      this.e = locala.readBoolean();
      this.f = locala.readInt();
      this.g = locala.readLong();
      this.h = new Locale(locala.readUTF(), locala.readUTF(), locala.readUTF());
      this.i = (16384 + 8192 * (1 + (-1 + 1024 * this.c) / 8192));
    }

    private byte[] a()
    {
      ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
      DataOutputStream localDataOutputStream = new DataOutputStream(localByteArrayOutputStream);
      localDataOutputStream.writeInt(this.a);
      localDataOutputStream.writeInt(this.k);
      localDataOutputStream.writeInt(this.b);
      localDataOutputStream.writeInt(this.c);
      localDataOutputStream.writeInt(this.d);
      localDataOutputStream.writeBoolean(this.e);
      localDataOutputStream.writeInt(this.f);
      localDataOutputStream.writeLong(this.g);
      localDataOutputStream.writeUTF(this.h.getLanguage());
      localDataOutputStream.writeUTF(this.h.getCountry());
      localDataOutputStream.writeUTF(this.h.getVariant());
      localDataOutputStream.writeInt(this.l);
      return localByteArrayOutputStream.toByteArray();
    }

    final int a(byte[] paramArrayOfByte, int paramInt)
    {
      byte[] arrayOfByte = a();
      System.arraycopy(arrayOfByte, 0, paramArrayOfByte, 0, arrayOfByte.length);
      return arrayOfByte.length;
    }

    public final String toString()
    {
      return "CatalogVersion:" + this.a + " BlockSize:" + this.b + " MaxShardCount:" + this.c + " RecordsPerBlock: " + this.d + " AutoConfig: " + this.e + " DataVersion:" + this.f + " CacheCreationTimeMs:" + this.g + " Checksum:" + this.l;
    }
  }

  public static final class c
  {
    public final e.d a;
    public final byte[] b;
    public final int c;
    public final byte[] d;

    private c(e.d paramd, int paramInt, byte[] paramArrayOfByte)
    {
      if (paramArrayOfByte.length > 16777215)
        throw new IllegalArgumentException("data too large");
      this.a = paramd;
      this.b = paramd.b();
      this.c = paramInt;
      this.d = paramArrayOfByte;
    }

    private c(e.d paramd, byte[] paramArrayOfByte)
    {
      this(paramd, 0, paramArrayOfByte);
    }
  }

  static final class d
  {
    private final long a;
    private final byte[] b;

    d(long paramLong, byte[] paramArrayOfByte)
    {
      this.a = paramLong;
      if (paramArrayOfByte == null)
      {
        this.b = e.e();
        return;
      }
      this.b = paramArrayOfByte;
    }

    final long a()
    {
      return this.a;
    }

    final byte[] b()
    {
      return this.b;
    }

    public final boolean equals(Object paramObject)
    {
      boolean bool1;
      if (this == paramObject)
        bool1 = true;
      d locald;
      boolean bool2;
      do
      {
        Class localClass1;
        Class localClass2;
        do
        {
          do
          {
            return bool1;
            bool1 = false;
          }
          while (paramObject == null);
          localClass1 = getClass();
          localClass2 = paramObject.getClass();
          bool1 = false;
        }
        while (localClass1 != localClass2);
        locald = (d)paramObject;
        bool2 = this.a < locald.a;
        bool1 = false;
      }
      while (bool2);
      return Arrays.equals(this.b, locald.b);
    }

    public final int hashCode()
    {
      return 31 * (int)(this.a ^ this.a >>> 32) + Arrays.hashCode(this.b);
    }
  }

  static final class e
  {
    private final byte[] a;
    private int b;
    private final com.google.android.m4b.maps.at.a c;
    private int d;

    e(com.google.android.m4b.maps.at.a parama, int paramInt, byte[] paramArrayOfByte)
    {
      this.a = paramArrayOfByte;
      this.b = 0;
      this.c = parama;
      this.d = paramInt;
    }

    final void a()
    {
      if (this.b == 0)
        return;
      synchronized (this.c)
      {
        this.c.a(this.d);
        this.c.b(this.a, 0, this.b);
        this.c.b();
        this.d += this.b;
        this.b = 0;
        return;
      }
    }

    final void a(byte[] paramArrayOfByte)
    {
      if (paramArrayOfByte.length + this.b > this.a.length)
        a();
      if (paramArrayOfByte.length > this.a.length)
        synchronized (this.c)
        {
          this.c.a(this.d);
          this.c.a(paramArrayOfByte);
          this.c.b();
          this.d += paramArrayOfByte.length;
          return;
        }
      System.arraycopy(paramArrayOfByte, 0, this.a, this.b, paramArrayOfByte.length);
      this.b += paramArrayOfByte.length;
    }
  }

  static final class f
  {
    final long a;
    final int b;
    final int c;
    final int d;
    final int e;
    final int f;
    final int g;
    final int h;

    f(long paramLong, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7)
    {
      this.a = paramLong;
      this.b = paramInt1;
      this.c = paramInt4;
      this.d = paramInt2;
      this.e = paramInt3;
      this.f = paramInt5;
      this.g = paramInt6;
      this.h = paramInt7;
    }

    static f a(byte[] paramArrayOfByte, int paramInt1, int paramInt2, int paramInt3)
    {
      long l = e.c(paramArrayOfByte, paramInt1);
      int i = paramInt1 + 8;
      int j = e.a(paramArrayOfByte, i);
      int k = i + 4;
      int m = e.a(paramArrayOfByte, k);
      int n = e.a(paramArrayOfByte, k + 4);
      int i1 = j >>> 5;
      int i2 = j & 0x1F;
      return new f(l, i1, m >>> 24, m & 0xFFFFFF, i2, n, paramInt2, paramInt3);
    }

    static int b(byte[] paramArrayOfByte, int paramInt)
    {
      return e.a(paramArrayOfByte, 4 + (paramInt + 8)) >>> 24;
    }

    static int c(byte[] paramArrayOfByte, int paramInt)
    {
      return 0xFFFFFF & e.a(paramArrayOfByte, 4 + (paramInt + 8));
    }

    static int d(byte[] paramArrayOfByte, int paramInt)
    {
      return 0x1F & e.a(paramArrayOfByte, paramInt + 8);
    }

    final void a(byte[] paramArrayOfByte, int paramInt)
    {
      e.a(paramArrayOfByte, paramInt, this.a);
      int i = paramInt + 8;
      int j = this.b << 5 | this.c;
      if (j >>> 5 != this.b)
        throw new IllegalArgumentException("Could not pack data offset of " + this.b);
      if ((j & 0x1F) != this.c)
        throw new IllegalArgumentException("Could not pack refCount of " + this.c);
      e.a(paramArrayOfByte, i, j);
      int k = i + 4;
      e.a(paramArrayOfByte, k, this.d << 24 | this.e);
      e.a(paramArrayOfByte, k + 4, this.f);
    }

    public final boolean equals(Object paramObject)
    {
      if (this == paramObject);
      f localf;
      do
      {
        return true;
        if ((paramObject == null) || (getClass() != paramObject.getClass()))
          return false;
        localf = (f)paramObject;
      }
      while ((this.g == localf.g) && (this.h == localf.h));
      return false;
    }

    public final int hashCode()
    {
      return (this.g << 16) + this.h;
    }

    public final String toString()
    {
      return "ID:" + this.a + " Off:" + this.b + " KeyLen:" + this.d + " DataLen:" + this.e + " Checksum:" + this.f + " Shard:" + this.g + " ShardIndex:" + this.h;
    }
  }

  static final class g
  {
    private final byte[] a;
    private final int b;
    private int c;
    private int d = -1;
    private int e = -1;

    g(int paramInt)
    {
      this(paramInt, new byte[8192]);
    }

    private g(int paramInt, byte[] paramArrayOfByte)
    {
      this.a = paramArrayOfByte;
      this.b = paramInt;
      this.c = 0;
    }

    g(byte[] paramArrayOfByte)
    {
      this.a = paramArrayOfByte;
      this.b = e.a(this.a, 0);
      this.c = e.a(this.a, 4);
    }

    final int a()
    {
      return this.b;
    }

    final void a(int paramInt)
    {
      e.a(this.a, 8 + paramInt * 20, -1L);
    }

    final void a(com.google.android.m4b.maps.at.a parama)
    {
      e.a(this.a, 0, this.b);
      e.a(this.a, 4, this.c);
      int i = e.c(this.a, 0, 8188);
      e.a(this.a, 8188, i);
      parama.a(this.a);
    }

    final void a(e.f paramf)
    {
      a(paramf, this.c);
      this.c = (1 + this.c);
      this.d = (paramf.b + paramf.d + paramf.e);
      this.e = -1;
    }

    final void a(e.f paramf, int paramInt)
    {
      paramf.a(this.a, 8 + paramInt * 20);
    }

    final int b()
    {
      return this.c;
    }

    final long b(int paramInt)
    {
      return e.c(this.a, 8 + paramInt * 20);
    }

    final int c()
    {
      if (this.c == 0)
        return 0;
      if (this.d < 0)
      {
        e.f localf = e(-1 + this.c);
        this.d = (localf.b + localf.d + localf.e);
      }
      return this.d;
    }

    final int c(int paramInt)
    {
      return e.f.b(this.a, 8 + paramInt * 20);
    }

    final int d()
    {
      int i = 0;
      if (this.e == -1)
      {
        this.e = 0;
        while (i < this.c)
        {
          if (d(i) > 0)
            this.e += c(i) + e.f.c(this.a, 8 + i * 20);
          i++;
        }
      }
      return this.e;
    }

    final int d(int paramInt)
    {
      return e.f.d(this.a, 8 + paramInt * 20);
    }

    final e.f e(int paramInt)
    {
      return e.f.a(this.a, 8 + paramInt * 20, this.b, paramInt);
    }

    public final String toString()
    {
      return "ID:" + this.b + " Size:" + this.c;
    }
  }

  static final class h
  {
    final e.g a;
    final e.f b;
    final int c;

    h(e.g paramg, e.f paramf, int paramInt)
    {
      this.a = paramg;
      this.b = paramf;
      this.c = paramInt;
    }
  }

  static final class i
  {
    final int[] a;
    final int[] b;
    final int[] c;
    final int[] d;
    final int[] e;
    int f;
    int g;

    i(int paramInt)
    {
      this.a = new int[paramInt];
      this.b = new int[paramInt];
      this.c = new int[paramInt];
      this.d = new int[paramInt];
      this.e = new int[paramInt];
      this.f = 0;
      this.g = 0;
    }

    final int a(Set<Integer> paramSet)
    {
      int i = 2147483647;
      int j = -1;
      for (int k = 0; k < this.f; k++)
        if ((b(k)) && (this.e[k] == 0) && (this.a[k] < i) && ((paramSet == null) || (!paramSet.contains(Integer.valueOf(k)))))
        {
          i = this.a[k];
          j = k;
        }
      return j;
    }

    final long a()
    {
      int i = 0;
      long l1 = 0L;
      if (i < this.f)
      {
        if (this.b[i] > 0);
        for (long l2 = this.b[i]; ; l2 = 0L)
        {
          l1 += l2;
          i++;
          break;
        }
      }
      return l1;
    }

    final void a(int paramInt)
    {
      this.a[paramInt] = 0;
      this.c[paramInt] = 0;
      this.d[paramInt] = 0;
      if (this.e[paramInt] > 0)
        this.g = (-1 + this.g);
      this.e[paramInt] = 0;
      this.b[paramInt] = -1;
    }

    final void a(com.google.android.m4b.maps.at.a parama)
    {
      int i = 0;
      byte[] arrayOfByte = new byte[8192];
      int j = 0;
      while (i < this.a.length)
      {
        e.a(arrayOfByte, j, this.a[i]);
        int k = j + 4;
        e.a(arrayOfByte, k, this.b[i]);
        int m = k + 4;
        e.b(arrayOfByte, m, this.c[i]);
        int n = m + 2;
        e.b(arrayOfByte, n, this.d[i]);
        int i1 = n + 2;
        e.a(arrayOfByte, i1, this.e[i]);
        int i2 = i1 + 4;
        e.a(arrayOfByte, i2, e.c(arrayOfByte, i2 - 16, 16));
        j += 20;
        i++;
      }
      parama.a(arrayOfByte);
    }

    final void a(e.g paramg)
    {
      int i = 0;
      int j = e.g.a(paramg);
      if (this.e[j] > 0)
        this.g = (-1 + this.g);
      this.a[j] = 0;
      this.b[j] = paramg.c();
      this.c[j] = e.g.b(paramg);
      this.d[j] = 0;
      this.e[j] = 0;
      while (i < e.g.b(paramg))
      {
        if (paramg.b(i) != -1L)
        {
          int[] arrayOfInt1 = this.d;
          arrayOfInt1[j] = (1 + arrayOfInt1[j]);
          if (paramg.d(i) > 0)
          {
            int[] arrayOfInt2 = this.e;
            arrayOfInt2[j] = (1 + arrayOfInt2[j]);
          }
        }
        i++;
      }
      if ((this.d[j] > 0) && (j >= this.f))
        this.f = (j + 1);
      if (this.e[j] > 0)
        this.g = (1 + this.g);
    }

    final int b()
    {
      int i = 0;
      int j = 0;
      if (i < this.f)
      {
        if (b(i));
        for (int k = 1; ; k = 0)
        {
          j += k;
          i++;
          break;
        }
      }
      return j;
    }

    final void b(com.google.android.m4b.maps.at.a parama)
    {
      int i = 0;
      byte[] arrayOfByte = new byte[8192];
      parama.b(arrayOfByte);
      this.f = 0;
      this.g = 0;
      int j = 0;
      if (i < this.a.length)
      {
        this.a[i] = e.a(arrayOfByte, j);
        int k = j + 4;
        this.b[i] = e.a(arrayOfByte, k);
        int m = k + 4;
        this.c[i] = e.b(arrayOfByte, m);
        int n = m + 2;
        this.d[i] = e.b(arrayOfByte, n);
        int i1 = n + 2;
        this.e[i] = e.a(arrayOfByte, i1);
        int i2 = i1 + 4;
        if (e.a(arrayOfByte, i2) != e.c(arrayOfByte, i2 - 16, 16))
          a(i);
        while (true)
        {
          j = i2 + 4;
          i++;
          break;
          if (this.d[i] > 0)
            this.f = (i + 1);
          if (this.e[i] > 0)
            this.g = (1 + this.g);
        }
      }
    }

    final boolean b(int paramInt)
    {
      return this.d[paramInt] != 0;
    }
  }
}

/* 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.bg.e
 * JD-Core Version:    0.6.2
 */