package o; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; /* renamed from: o.Wlo, reason: case insensitive filesystem */ /* loaded from: classes.dex */ public class C1139Wlo { private long a; private long b; private final long d; private final Map> e = new LinkedHashMap(100, 0.75f, true); public int c(Y y) { return 1; } protected void c(T t, Y y) { } public C1139Wlo(long j) { this.d = j; this.b = j; } public final long d() { long j; synchronized (this) { j = this.b; } return j; } public final Y b(T t) { Y y; synchronized (this) { IeS ieS = this.e.get(t); y = ieS != null ? ieS.a : null; } return y; } public final Y a(T t, Y y) { synchronized (this) { int c = c(y); long j = c; if (j >= this.b) { c(t, y); return null; } if (y != null) { this.a += j; } IeS put = this.e.put(t, y == null ? null : new IeS<>(y, c)); if (put != null) { this.a -= put.e; if (!put.a.equals(y)) { c(t, put.a); } } a(this.b); return put != null ? put.a : null; } } public final Y d(T t) { synchronized (this) { IeS remove = this.e.remove(t); if (remove == null) { return null; } this.a -= remove.e; return remove.a; } } public final void e() { a(0L); } /* JADX INFO: Access modifiers changed from: protected */ public final void a(long j) { synchronized (this) { while (this.a > j) { Iterator>> it = this.e.entrySet().iterator(); Map.Entry> next = it.next(); IeS value = next.getValue(); this.a -= value.e; T key = next.getKey(); it.remove(); c(key, value.a); } } } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.Wlo$IeS */ /* loaded from: classes.dex */ public static final class IeS { final Y a; final int e; IeS(Y y, int i) { this.a = y; this.e = i; } } }