package p463.p484.p485;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.Serializable;
import org.threeten.bp.DateTimeException;
import org.threeten.bp.temporal.UnsupportedTemporalTypeException;
import p138.p139.p143.p144.C2803;
import p463.p473.p474.p479.C7158;
import p463.p484.p485.p488.AbstractC7258;
import p463.p484.p485.p489.C7276;
import p463.p484.p485.p489.C7286;
import p463.p484.p485.p489.EnumC7259;
import p463.p484.p485.p489.EnumC7260;
import p463.p484.p485.p489.InterfaceC7269;
import p463.p484.p485.p489.InterfaceC7270;
import p463.p484.p485.p489.InterfaceC7271;
import p463.p484.p485.p489.InterfaceC7275;
import p463.p484.p485.p489.InterfaceC7284;
import p463.p484.p485.p489.InterfaceC7285;

/* JADX INFO: renamed from: ޒ.ށ.֏.ރ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C7181 extends AbstractC7258 implements InterfaceC7269, InterfaceC7271, Comparable<C7181>, Serializable {

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public static final C7181 f20811;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public static final C7181 f20812;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public static final C7181 f20813;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public static final C7181[] f20814 = new C7181[24];

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final byte f20815;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final byte f20816;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public final byte f20817;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final int f20818;

    static {
        int i = 0;
        while (true) {
            C7181[] c7181Arr = f20814;
            if (i >= c7181Arr.length) {
                f20813 = c7181Arr[0];
                C7181 c7181 = c7181Arr[12];
                f20811 = c7181Arr[0];
                f20812 = new C7181(23, 59, 59, 999999999);
                return;
            }
            c7181Arr[i] = new C7181(i, 0, 0, 0);
            i++;
        }
    }

    public C7181(int i, int i2, int i3, int i4) {
        this.f20815 = (byte) i;
        this.f20816 = (byte) i2;
        this.f20817 = (byte) i3;
        this.f20818 = i4;
    }

    private Object readResolve() throws InvalidObjectException {
        throw new InvalidObjectException("Deserialization via serialization delegate");
    }

    private Object writeReplace() {
        return new C7188((byte) 5, this);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C7181 m10676(int i, int i2) {
        EnumC7259 enumC7259 = EnumC7259.HOUR_OF_DAY;
        enumC7259.f21101.m10919(i, enumC7259);
        if (i2 == 0) {
            return f20814[i];
        }
        EnumC7259 enumC72592 = EnumC7259.MINUTE_OF_HOUR;
        enumC72592.f21101.m10919(i2, enumC72592);
        return new C7181(i, i2, 0, 0);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C7181 m10677(int i, int i2, int i3) {
        EnumC7259 enumC7259 = EnumC7259.HOUR_OF_DAY;
        enumC7259.f21101.m10919(i, enumC7259);
        if ((i2 | i3) == 0) {
            return f20814[i];
        }
        EnumC7259 enumC72592 = EnumC7259.MINUTE_OF_HOUR;
        enumC72592.f21101.m10919(i2, enumC72592);
        EnumC7259 enumC72593 = EnumC7259.SECOND_OF_MINUTE;
        enumC72593.f21101.m10919(i3, enumC72593);
        return new C7181(i, i2, i3, 0);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C7181 m10678(int i, int i2, int i3, int i4) {
        return ((i2 | i3) | i4) == 0 ? f20814[i] : new C7181(i, i2, i3, i4);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C7181 m10679(long j, int i) {
        EnumC7259 enumC7259 = EnumC7259.SECOND_OF_DAY;
        enumC7259.f21101.m10919(j, enumC7259);
        EnumC7259 enumC72592 = EnumC7259.NANO_OF_SECOND;
        enumC72592.f21101.m10919(i, enumC72592);
        int i2 = (int) (j / 3600);
        long j2 = j - ((long) (i2 * 3600));
        int i3 = (int) (j2 / 60);
        return m10678(i2, i3, (int) (j2 - ((long) (i3 * 60))), i);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C7181 m10680(DataInput dataInput) throws IOException {
        int i;
        int i2;
        int i3 = dataInput.readByte();
        int i4 = 0;
        if (i3 >= 0) {
            byte b = dataInput.readByte();
            if (b < 0) {
                int i5 = ~b;
                i2 = 0;
                i4 = i5;
                i = 0;
            } else {
                byte b2 = dataInput.readByte();
                if (b2 < 0) {
                    i = ~b2;
                    i4 = b;
                } else {
                    int i6 = dataInput.readInt();
                    i = b2;
                    i2 = i6;
                    i4 = b;
                }
            }
            return m10682(i3, i4, i, i2);
        }
        i3 = ~i3;
        i = 0;
        i2 = 0;
        return m10682(i3, i4, i, i2);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C7181 m10681(InterfaceC7270 interfaceC7270) {
        C7181 c7181 = (C7181) interfaceC7270.mo10592(C7276.f21145);
        if (c7181 != null) {
            return c7181;
        }
        StringBuilder sb = new StringBuilder();
        sb.append("Unable to obtain LocalTime from TemporalAccessor: ");
        sb.append(interfaceC7270);
        sb.append(", type ");
        throw new DateTimeException(C2803.m4888(interfaceC7270, sb));
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static C7181 m10682(int i, int i2, int i3, int i4) {
        EnumC7259 enumC7259 = EnumC7259.HOUR_OF_DAY;
        enumC7259.f21101.m10919(i, enumC7259);
        EnumC7259 enumC72592 = EnumC7259.MINUTE_OF_HOUR;
        enumC72592.f21101.m10919(i2, enumC72592);
        EnumC7259 enumC72593 = EnumC7259.SECOND_OF_MINUTE;
        enumC72593.f21101.m10919(i3, enumC72593);
        EnumC7259 enumC72594 = EnumC7259.NANO_OF_SECOND;
        enumC72594.f21101.m10919(i4, enumC72594);
        return m10678(i, i2, i3, i4);
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public static C7181 m10683(long j) {
        EnumC7259 enumC7259 = EnumC7259.NANO_OF_DAY;
        enumC7259.f21101.m10919(j, enumC7259);
        int i = (int) (j / 3600000000000L);
        long j2 = j - (((long) i) * 3600000000000L);
        int i2 = (int) (j2 / 60000000000L);
        long j3 = j2 - (((long) i2) * 60000000000L);
        int i3 = (int) (j3 / 1000000000);
        return m10678(i, i2, i3, (int) (j3 - (((long) i3) * 1000000000)));
    }

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public static C7181 m10684(long j) {
        EnumC7259 enumC7259 = EnumC7259.SECOND_OF_DAY;
        enumC7259.f21101.m10919(j, enumC7259);
        int i = (int) (j / 3600);
        long j2 = j - ((long) (i * 3600));
        int i2 = (int) (j2 / 60);
        return m10678(i, i2, (int) (j2 - ((long) (i2 * 60))), 0);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof C7181)) {
            return false;
        }
        C7181 c7181 = (C7181) obj;
        return this.f20815 == c7181.f20815 && this.f20816 == c7181.f20816 && this.f20817 == c7181.f20817 && this.f20818 == c7181.f20818;
    }

    public int hashCode() {
        long jM10696 = m10696();
        return (int) (jM10696 ^ (jM10696 >>> 32));
    }

    public String toString() {
        StringBuilder sb = new StringBuilder(18);
        byte b = this.f20815;
        byte b2 = this.f20816;
        byte b3 = this.f20817;
        int i = this.f20818;
        sb.append(b < 10 ? "0" : "");
        sb.append((int) b);
        sb.append(b2 < 10 ? ":0" : ":");
        sb.append((int) b2);
        if (b3 > 0 || i > 0) {
            sb.append(b3 >= 10 ? ":" : ":0");
            sb.append((int) b3);
            if (i > 0) {
                sb.append('.');
                if (i % 1000000 == 0) {
                    sb.append(Integer.toString((i / 1000000) + 1000).substring(1));
                } else if (i % 1000 == 0) {
                    sb.append(Integer.toString((i / 1000) + 1000000).substring(1));
                } else {
                    sb.append(Integer.toString(i + 1000000000).substring(1));
                }
            }
        }
        return sb.toString();
    }

    @Override // java.lang.Comparable
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters and merged with bridge method [inline-methods] */
    public int compareTo(C7181 c7181) {
        int iM10534 = C7158.m10534((int) this.f20815, (int) c7181.f20815);
        if (iM10534 != 0) {
            return iM10534;
        }
        int iM105342 = C7158.m10534((int) this.f20816, (int) c7181.f20816);
        if (iM105342 != 0) {
            return iM105342;
        }
        int iM105343 = C7158.m10534((int) this.f20817, (int) c7181.f20817);
        return iM105343 == 0 ? C7158.m10534(this.f20818, c7181.f20818) : iM105343;
    }

    @Override // p463.p484.p485.p489.InterfaceC7269
    /* JADX INFO: renamed from: ֏ */
    public long mo10611(InterfaceC7269 interfaceC7269, InterfaceC7285 interfaceC7285) {
        C7181 c7181M10681 = m10681((InterfaceC7270) interfaceC7269);
        if (!(interfaceC7285 instanceof EnumC7260)) {
            return interfaceC7285.mo10906(this, c7181M10681);
        }
        long jM10696 = c7181M10681.m10696() - m10696();
        switch ((EnumC7260) interfaceC7285) {
            case NANOS:
                return jM10696;
            case MICROS:
                return jM10696 / 1000;
            case MILLIS:
                return jM10696 / 1000000;
            case SECONDS:
                return jM10696 / 1000000000;
            case MINUTES:
                return jM10696 / 60000000000L;
            case HOURS:
                return jM10696 / 3600000000000L;
            case HALF_DAYS:
                return jM10696 / 43200000000000L;
            default:
                throw new UnsupportedTemporalTypeException("Unsupported unit: " + interfaceC7285);
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // p463.p484.p485.p488.AbstractC7258, p463.p484.p485.p489.InterfaceC7270
    /* JADX INFO: renamed from: ֏ */
    public <R> R mo10592(InterfaceC7284<R> interfaceC7284) {
        if (interfaceC7284 == C7276.f21141) {
            return (R) EnumC7260.NANOS;
        }
        if (interfaceC7284 == C7276.f21145) {
            return this;
        }
        if (interfaceC7284 == C7276.f21140 || interfaceC7284 == C7276.f21139 || interfaceC7284 == C7276.f21142 || interfaceC7284 == C7276.f21143 || interfaceC7284 == C7276.f21144) {
            return null;
        }
        return interfaceC7284.mo10675(this);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public C7181 m10686(int i) {
        if (this.f20815 == i) {
            return this;
        }
        EnumC7259 enumC7259 = EnumC7259.HOUR_OF_DAY;
        enumC7259.f21101.m10919(i, enumC7259);
        return m10678(i, this.f20816, this.f20817, this.f20818);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public C7181 m10687(long j) {
        return j == 0 ? this : m10678(((((int) (j % 24)) + this.f20815) + 24) % 24, this.f20816, this.f20817, this.f20818);
    }

    @Override // p463.p484.p485.p489.InterfaceC7269
    /* JADX INFO: renamed from: ֏ */
    public C7181 mo10616(InterfaceC7275 interfaceC7275, long j) {
        if (!(interfaceC7275 instanceof EnumC7259)) {
            return (C7181) interfaceC7275.mo10898(this, j);
        }
        EnumC7259 enumC7259 = (EnumC7259) interfaceC7275;
        enumC7259.f21101.m10919(j, enumC7259);
        switch (enumC7259.ordinal()) {
            case 0:
                return m10691((int) j);
            case 1:
                return m10683(j);
            case 2:
                return m10691(((int) j) * 1000);
            case 3:
                return m10683(j * 1000);
            case 4:
                return m10691(((int) j) * 1000000);
            case 5:
                return m10683(j * 1000000);
            case 6:
                return m10693((int) j);
            case 7:
                return m10694(j - ((long) m10697()));
            case 8:
                return m10689((int) j);
            case 9:
                return m10690(j - ((long) ((this.f20815 * 60) + this.f20816)));
            case 10:
                return m10687(j - ((long) (this.f20815 % 12)));
            case 11:
                if (j == 12) {
                    j = 0;
                }
                return m10687(j - ((long) (this.f20815 % 12)));
            case 12:
                return m10686((int) j);
            case 13:
                if (j == 24) {
                    j = 0;
                }
                return m10686((int) j);
            case 14:
                return m10687((j - ((long) (this.f20815 / 12))) * 12);
            default:
                throw new UnsupportedTemporalTypeException(C2803.m4881("Unsupported field: ", interfaceC7275));
        }
    }

    @Override // p463.p484.p485.p489.InterfaceC7269
    /* JADX INFO: renamed from: ֏ */
    public InterfaceC7269 mo10614(long j, InterfaceC7285 interfaceC7285) {
        return j == Long.MIN_VALUE ? mo10618(Long.MAX_VALUE, interfaceC7285).mo10618(1L, interfaceC7285) : mo10618(-j, interfaceC7285);
    }

    @Override // p463.p484.p485.p489.InterfaceC7271
    /* JADX INFO: renamed from: ֏ */
    public InterfaceC7269 mo10593(InterfaceC7269 interfaceC7269) {
        return interfaceC7269.mo10616(EnumC7259.NANO_OF_DAY, m10696());
    }

    @Override // p463.p484.p485.p489.InterfaceC7269
    /* JADX INFO: renamed from: ֏ */
    public InterfaceC7269 mo10615(InterfaceC7271 interfaceC7271) {
        return interfaceC7271 instanceof C7181 ? (C7181) interfaceC7271 : (C7181) interfaceC7271.mo10593(this);
    }

    @Override // p463.p484.p485.p488.AbstractC7258, p463.p484.p485.p489.InterfaceC7270
    /* JADX INFO: renamed from: ֏ */
    public C7286 mo10594(InterfaceC7275 interfaceC7275) {
        return super.mo10594(interfaceC7275);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m10688(DataOutput dataOutput) {
        if (this.f20818 != 0) {
            dataOutput.writeByte(this.f20815);
            dataOutput.writeByte(this.f20816);
            dataOutput.writeByte(this.f20817);
            dataOutput.writeInt(this.f20818);
            return;
        }
        if (this.f20817 != 0) {
            dataOutput.writeByte(this.f20815);
            dataOutput.writeByte(this.f20816);
            dataOutput.writeByte(~this.f20817);
        } else if (this.f20816 == 0) {
            dataOutput.writeByte(~this.f20815);
        } else {
            dataOutput.writeByte(this.f20815);
            dataOutput.writeByte(~this.f20816);
        }
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public C7181 m10689(int i) {
        if (this.f20816 == i) {
            return this;
        }
        EnumC7259 enumC7259 = EnumC7259.MINUTE_OF_HOUR;
        enumC7259.f21101.m10919(i, enumC7259);
        return m10678(this.f20815, i, this.f20817, this.f20818);
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public C7181 m10690(long j) {
        if (j == 0) {
            return this;
        }
        int i = (this.f20815 * 60) + this.f20816;
        int i2 = ((((int) (j % 1440)) + i) + 1440) % 1440;
        return i == i2 ? this : m10678(i2 / 60, i2 % 60, this.f20817, this.f20818);
    }

    @Override // p463.p484.p485.p489.InterfaceC7269
    /* JADX INFO: renamed from: ؠ */
    public C7181 mo10618(long j, InterfaceC7285 interfaceC7285) {
        if (!(interfaceC7285 instanceof EnumC7260)) {
            return (C7181) interfaceC7285.mo10907(this, j);
        }
        switch ((EnumC7260) interfaceC7285) {
            case NANOS:
                return m10692(j);
            case MICROS:
                return m10692((j % 86400000000L) * 1000);
            case MILLIS:
                return m10692((j % 86400000) * 1000000);
            case SECONDS:
                return m10694(j);
            case MINUTES:
                return m10690(j);
            case HOURS:
                return m10687(j);
            case HALF_DAYS:
                return m10687((j % 2) * 12);
            default:
                throw new UnsupportedTemporalTypeException("Unsupported unit: " + interfaceC7285);
        }
    }

    @Override // p463.p484.p485.p489.InterfaceC7270
    /* JADX INFO: renamed from: ؠ */
    public boolean mo10595(InterfaceC7275 interfaceC7275) {
        return interfaceC7275 instanceof EnumC7259 ? interfaceC7275.mo10904() : interfaceC7275 != null && interfaceC7275.mo10900(this);
    }

    @Override // p463.p484.p485.p488.AbstractC7258, p463.p484.p485.p489.InterfaceC7270
    /* JADX INFO: renamed from: ހ */
    public int mo10596(InterfaceC7275 interfaceC7275) {
        return interfaceC7275 instanceof EnumC7259 ? m10695(interfaceC7275) : super.mo10596(interfaceC7275);
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public C7181 m10691(int i) {
        if (this.f20818 == i) {
            return this;
        }
        EnumC7259 enumC7259 = EnumC7259.NANO_OF_SECOND;
        enumC7259.f21101.m10919(i, enumC7259);
        return m10678(this.f20815, this.f20816, this.f20817, i);
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public C7181 m10692(long j) {
        if (j == 0) {
            return this;
        }
        long jM10696 = m10696();
        long j2 = (((j % 86400000000000L) + jM10696) + 86400000000000L) % 86400000000000L;
        return jM10696 == j2 ? this : m10678((int) (j2 / 3600000000000L), (int) ((j2 / 60000000000L) % 60), (int) ((j2 / 1000000000) % 60), (int) (j2 % 1000000000));
    }

    @Override // p463.p484.p485.p489.InterfaceC7270
    /* JADX INFO: renamed from: ށ */
    public long mo10597(InterfaceC7275 interfaceC7275) {
        return interfaceC7275 instanceof EnumC7259 ? interfaceC7275 == EnumC7259.NANO_OF_DAY ? m10696() : interfaceC7275 == EnumC7259.MICRO_OF_DAY ? m10696() / 1000 : m10695(interfaceC7275) : interfaceC7275.mo10901(this);
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public C7181 m10693(int i) {
        if (this.f20817 == i) {
            return this;
        }
        EnumC7259 enumC7259 = EnumC7259.SECOND_OF_MINUTE;
        enumC7259.f21101.m10919(i, enumC7259);
        return m10678(this.f20815, this.f20816, i, this.f20818);
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public C7181 m10694(long j) {
        if (j == 0) {
            return this;
        }
        int i = (this.f20816 * 60) + (this.f20815 * 3600) + this.f20817;
        int i2 = ((((int) (j % 86400)) + i) + 86400) % 86400;
        return i == i2 ? this : m10678(i2 / 3600, (i2 / 60) % 60, i2 % 60, this.f20818);
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final int m10695(InterfaceC7275 interfaceC7275) {
        switch (((EnumC7259) interfaceC7275).ordinal()) {
            case 0:
                return this.f20818;
            case 1:
                throw new DateTimeException(C2803.m4881("Field too large for an int: ", interfaceC7275));
            case 2:
                return this.f20818 / 1000;
            case 3:
                throw new DateTimeException(C2803.m4881("Field too large for an int: ", interfaceC7275));
            case 4:
                return this.f20818 / 1000000;
            case 5:
                return (int) (m10696() / 1000000);
            case 6:
                return this.f20817;
            case 7:
                return m10697();
            case 8:
                return this.f20816;
            case 9:
                return (this.f20815 * 60) + this.f20816;
            case 10:
                return this.f20815 % 12;
            case 11:
                int i = this.f20815 % 12;
                if (i % 12 == 0) {
                    return 12;
                }
                return i;
            case 12:
                return this.f20815;
            case 13:
                byte b = this.f20815;
                if (b == 0) {
                    return 24;
                }
                return b;
            case 14:
                return this.f20815 / 12;
            default:
                throw new UnsupportedTemporalTypeException(C2803.m4881("Unsupported field: ", interfaceC7275));
        }
    }

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public long m10696() {
        return (((long) this.f20817) * 1000000000) + (((long) this.f20816) * 60000000000L) + (((long) this.f20815) * 3600000000000L) + ((long) this.f20818);
    }

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public int m10697() {
        return (this.f20816 * 60) + (this.f20815 * 3600) + this.f20817;
    }
}
