package vg;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/* loaded from: classes4.dex */
class i {

    /* renamed from: a, reason: collision with root package name */
    private final a f39690a;

    /* renamed from: b, reason: collision with root package name */
    private final String f39691b;

    /* renamed from: c, reason: collision with root package name */
    private String f39692c;

    /* renamed from: d, reason: collision with root package name */
    private i f39693d;

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes4.dex */
    public enum a {
        FUNCTION,
        VARIABLE
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public i(String str) {
        Matcher matcher = Pattern.compile("\\(([^)]+)\\)").matcher(str);
        this.f39691b = str;
        if (!matcher.find()) {
            this.f39690a = a.VARIABLE;
            return;
        }
        this.f39693d = new i(matcher.group(1));
        this.f39692c = str.substring(0, matcher.start());
        this.f39690a = a.FUNCTION;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public Object a(x xVar, a0 a0Var) {
        return this.f39690a == a.FUNCTION ? a0Var.a(this.f39692c, this.f39693d.a(xVar, a0Var)) : xVar.get(this.f39691b);
    }
}
