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

import java.util.Arrays;

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

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

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

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

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public long f13055f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final boolean[] f13056g = new boolean[15];

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

    public final void a() {
        this.f13053d = 0L;
        this.f13054e = 0L;
        this.f13055f = 0L;
        this.f13057h = 0;
        Arrays.fill(this.f13056g, false);
    }

    public final boolean b() {
        return this.f13053d > 15 && this.f13057h == 0;
    }

    public final void c(long j10) {
        long j11 = this.f13053d;
        if (j11 == 0) {
            this.f13050a = j10;
        } else if (j11 == 1) {
            long j12 = j10 - this.f13050a;
            this.f13051b = j12;
            this.f13055f = j12;
            this.f13054e = 1L;
        } else {
            long j13 = j10 - this.f13052c;
            long jAbs = Math.abs(j13 - this.f13051b);
            int i10 = (int) (j11 % 15);
            boolean[] zArr = this.f13056g;
            if (jAbs <= 1000000) {
                this.f13054e++;
                this.f13055f += j13;
                if (zArr[i10]) {
                    zArr[i10] = false;
                    this.f13057h--;
                }
            } else if (!zArr[i10]) {
                zArr[i10] = true;
                this.f13057h++;
            }
        }
        this.f13053d++;
        this.f13052c = j10;
    }
}
