package com.google.android.gms.internal.measurement;

/* JADX INFO: loaded from: classes2.dex */
public final class t5 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public int f20420a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f20421b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f20422c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f20423d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f20424e;

    public static int a(int i10) {
        return (-(i10 & 1)) ^ (i10 >>> 1);
    }

    public static long b(long j10) {
        return (-(j10 & 1)) ^ (j10 >>> 1);
    }

    public final void c(int i10) throws zzkb {
        if (i10 < 0) {
            throw zzkb.c();
        }
        int i11 = this.f20422c;
        int i12 = this.f20423d;
        int i13 = (i11 - i12) + i10;
        if (i13 < 0) {
            throw zzkb.d();
        }
        if (i13 > this.f20424e) {
            throw zzkb.e();
        }
        this.f20424e = i13;
        int i14 = this.f20420a + this.f20421b;
        this.f20420a = i14;
        int i15 = i14 - i12;
        if (i15 <= i13) {
            this.f20421b = 0;
            return;
        }
        int i16 = i15 - i13;
        this.f20421b = i16;
        this.f20420a = i14 - i16;
    }
}
