package o; import com.airbnb.deeplinkdispatch.UrlTreeKt; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import o.ETY; /* renamed from: o.xwV, reason: case insensitive filesystem */ /* loaded from: classes.dex */ final class C17583xwV { private final RVV b = new RVV<>(); private final Map> d = new HashMap(); public final void a(K k, V v) { RVV rvv = this.d.get(k); if (rvv == null) { rvv = new RVV<>(k); rvv.e.a = rvv.a; rvv.a.e = rvv.e; rvv.e = this.b.e; rvv.a = this.b; rvv.a.e = rvv; rvv.e.a = rvv; this.d.put(k, rvv); } else { k.e(); } if (rvv.d == null) { rvv.d = new ArrayList(); } rvv.d.add(v); } public final V a(K k) { RVV rvv = this.d.get(k); if (rvv == null) { rvv = new RVV<>(k); this.d.put(k, rvv); } else { k.e(); } rvv.e.a = rvv.a; rvv.a.e = rvv.e; rvv.e = this.b; rvv.a = this.b.a; rvv.a.e = rvv; rvv.e.a = rvv; List list = rvv.d; int size = list != null ? list.size() : 0; if (size > 0) { return rvv.d.remove(size - 1); } return null; } public final V d() { RVV rvv = this.b.e; while (true) { if (rvv.equals(this.b)) { return null; } List list = rvv.d; int size = list != null ? list.size() : 0; V remove = size > 0 ? rvv.d.remove(size - 1) : null; if (remove != null) { return remove; } rvv.e.a = rvv.a; rvv.a.e = rvv.e; this.d.remove(rvv.b); ((ETY) rvv.b).e(); rvv = rvv.e; } } public final String toString() { StringBuilder sb = new StringBuilder("GroupedLinkedMap( "); RVV rvv = this.b.a; boolean z = false; while (!rvv.equals(this.b)) { sb.append(UrlTreeKt.componentParamPrefixChar); sb.append(rvv.b); sb.append(':'); List list = rvv.d; sb.append(list != null ? list.size() : 0); sb.append("}, "); rvv = rvv.a; z = true; } if (z) { sb.delete(sb.length() - 2, sb.length()); } sb.append(" )"); return sb.toString(); } /* renamed from: o.xwV$RVV */ /* loaded from: classes.dex */ static class RVV { RVV a; final K b; List d; RVV e; RVV() { this(null); } RVV(K k) { this.e = this; this.a = this; this.b = k; } } }