package i;

/* JADX INFO: loaded from: classes.dex */
public class Z {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Z f4269a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Object f4270b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Object f4271c;

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

    public Z(Z z2, Object obj, Object obj2, int i2, int i3) {
        this.f4269a = z2;
        this.f4270b = obj;
        this.f4271c = obj2;
        this.f4272d = i2;
    }

    protected void a(StringBuilder sb) {
        Z z2 = this.f4269a;
        if (z2 == null) {
            sb.append('$');
            return;
        }
        z2.a(sb);
        Object obj = this.f4271c;
        if (obj == null) {
            sb.append(".null");
            return;
        }
        if (obj instanceof Integer) {
            sb.append('[');
            sb.append(((Integer) this.f4271c).intValue());
            sb.append(']');
            return;
        }
        sb.append('.');
        String string = this.f4271c.toString();
        for (int i2 = 0; i2 < string.length(); i2++) {
            char cCharAt = string.charAt(i2);
            if ((cCharAt < '0' || cCharAt > '9') && ((cCharAt < 'A' || cCharAt > 'Z') && ((cCharAt < 'a' || cCharAt > 'z') && cCharAt <= 128))) {
                for (int i3 = 0; i3 < string.length(); i3++) {
                    char cCharAt2 = string.charAt(i3);
                    if (cCharAt2 == '\\') {
                        sb.append('\\');
                        sb.append('\\');
                        sb.append('\\');
                    } else if ((cCharAt2 >= '0' && cCharAt2 <= '9') || ((cCharAt2 >= 'A' && cCharAt2 <= 'Z') || ((cCharAt2 >= 'a' && cCharAt2 <= 'z') || cCharAt2 > 128))) {
                        sb.append(cCharAt2);
                    } else if (cCharAt2 == '\"') {
                        sb.append('\\');
                        sb.append('\\');
                        sb.append('\\');
                    } else {
                        sb.append('\\');
                        sb.append('\\');
                    }
                    sb.append(cCharAt2);
                }
                return;
            }
        }
        sb.append(string);
    }

    public String toString() {
        if (this.f4269a == null) {
            return "$";
        }
        StringBuilder sb = new StringBuilder();
        a(sb);
        return sb.toString();
    }
}
