public boolean dispatchKeyEvent(android.view.KeyEvent p7)
    {
        String v0_0 = this.mHost;
        int v2 = 1;
        if (((v0_0 instanceof androidx.core.view.KeyEventDispatcher$Component)) || ((v0_0 instanceof androidx.appcompat.app.AppCompatDialog))) {
            String v0_16 = this.mWindow.getDecorView();
            if ((v0_16 != null) && (androidx.core.view.KeyEventDispatcher.dispatchBeforeHierarchy(v0_16, p7))) {
                return 1;
            }
        }
        if ((p7.getKeyCode() != 82) || (!this.mAppCompatWindowCallback.getWrapped().dispatchKeyEvent(p7))) {
            boolean v3_1;
            String v0_10 = p7.getKeyCode();
            if (p7.getAction() != 0) {
                v3_1 = 0;
            } else {
                v3_1 = 1;
            }
            if (!v3_1) {
                if (v0_10 == 4) {
                    int v7_10 = this.mLongPressBackDown;
                    this.mLongPressBackDown = 0;
                    String v0_11 = this.getPanelState(0);
                    if (!v0_11.isOpen) {
                        int v7_14;
                        int v7_11 = this.mActionMode;
                        if (v7_11 == 0) {
                            this.initWindowDecorActionBar();
                            int v7_12 = this.mActionBar;
                            if ((v7_12 == 0) || (!v7_12.collapseActionView())) {
                                v7_14 = 0;
                            } else {
                                v7_14 = 1;
                            }
                        } else {
                            v7_11.finish();
                        }
                        if (v7_14 == 0) {
                            v2 = 0;
                        }
                    } else {
                        if (v7_10 == 0) {
                            this.closePanel(v0_11, 1);
                        }
                    }
                } else {
                    if (v0_10 == 82) {
                        if (this.mActionMode == null) {
                            int v7_2;
                            String v0_14 = this.getPanelState(0);
                            int v1_4 = this.mDecorContentParent;
                            if ((v1_4 == 0) || ((!v1_4.canShowOverflowMenu()) || (android.view.ViewConfiguration.get(this.mContext).hasPermanentMenuKey()))) {
                                int v1_9 = v0_14.isOpen;
                                if ((v1_9 == 0) && (!v0_14.isHandled)) {
                                    if (!v0_14.isPrepared) {
                                        v7_2 = 0;
                                    } else {
                                        int v1_12;
                                        if (!v0_14.refreshMenuContent) {
                                            v1_12 = 1;
                                        } else {
                                            v0_14.isPrepared = 0;
                                            v1_12 = this.preparePanel(v0_14, p7);
                                        }
                                        if (v1_12 == 0) {
                                        } else {
                                            this.openPanel(v0_14, p7);
                                            v7_2 = 1;
                                        }
                                    }
                                } else {
                                    this.closePanel(v0_14, 1);
                                    v7_2 = v1_9;
                                }
                            } else {
                                if (this.mDecorContentParent.isOverflowMenuShowing()) {
                                    v7_2 = this.mDecorContentParent.hideOverflowMenu();
                                } else {
                                    if ((this.mIsDestroyed) || (!this.preparePanel(v0_14, p7))) {
                                    } else {
                                        v7_2 = this.mDecorContentParent.showOverflowMenu();
                                    }
                                }
                            }
                            if (v7_2 != 0) {
                                int v7_6 = ((android.media.AudioManager) this.mContext.getApplicationContext().getSystemService(audio));
                                if (v7_6 == 0) {
                                    android.util.Log.w(AppCompatDelegate, Couldn't get audio manager);
                                } else {
                                    v7_6.playSoundEffect(0);
                                }
                            }
                        }
                    }
                }
            } else {
                if (v0_10 == 4) {
                    if ((p7.getFlags() & 128) == 0) {
                        v2 = 0;
                    }
                    this.mLongPressBackDown = v2;
                } else {
                    if (v0_10 == 82) {
                        if (p7.getRepeatCount() == 0) {
                            String v0_5 = this.getPanelState(0);
                            if (!v0_5.isOpen) {
                                this.preparePanel(v0_5, p7);
                            }
                        }
                    }
                }
            }
            return v2;
        } else {
            return 1;
        }
    }