From owner-freebsd-acpi@FreeBSD.ORG Sun Jun 17 20:43:32 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B827116A469 for ; Sun, 17 Jun 2007 20:43:32 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 9288013C484 for ; Sun, 17 Jun 2007 20:43:32 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 46818 invoked from network); 17 Jun 2007 17:13:41 -0000 Received: from ppp-71-139-42-13.dsl.snfc21.pacbell.net (HELO ?10.0.0.15?) (nate-mail@71.139.42.13) by root.org with ESMTPA; 17 Jun 2007 17:13:41 -0000 Message-ID: <46756BBE.5030603@root.org> Date: Sun, 17 Jun 2007 10:13:34 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.0 (X11/20070511) MIME-Version: 1.0 To: current X-Enigmail-Version: 0.95.0 Content-Type: multipart/mixed; boundary="------------040100070106020900000700" Cc: acpi@freebsd.org, arch@freebsd.org Subject: patch: acpi usermode suspend API change X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2007 20:43:32 -0000 This is a multi-part message in MIME format. --------------040100070106020900000700 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit This patch updates the user API for acpi suspend in a number of ways. * /etc/rc.suspend,rc.resume are always run, no matter the source of the suspend event * suspend now requires positive user acknowledgement. If a user program wants to cancel the suspend, they can. If one of the user programs hangs or doesn't respond within 10 seconds, the system suspends anyway. * /dev/apm is clonable, allowing multiple listeners for suspend events. In the future, xorg-server can use this to be informed about suspend even if there are other listeners (i.e. apmd). The API changes are intended to be MFCd and hence are minimal. * Two new ACPI ioctls: REQSLPSTATE and ACKSLPSTATE. Request begins the process of suspending by notifying all listeners. acpi is monitored by devd(8) and /dev/apm listener(s) are also counted. Users register their approval or disapproval via Ack. If anyone disapproves, suspend is vetoed. * Binary compat is preserved in that old user programs or kernel modules (yeah, right) that called the API can still do so. A message is printed once that this interface is deprecated. * acpiconf gains the -k flag to ack the suspend request. This flag is undocumented on purpose since it's only used by /etc/rc.suspend. It is not intended to be a permanent change and will be removed once a better power API is implemented. These patches have been successfully tested for about a week through suspend/resumes and various usermode programs, including patches to xorg-server. The eventual goal is to improve subr_power to be a more generic central power management interface to user and kernel providers. powerd(8) might start managing profiles similar to apmd(8). I don't know yet and there isn't time to do that. This patch provides a reasonable interface for now and eliminates some serious weaknesses, especially in that pressing a sleep button did not guarantee rc.suspend would run before sleeping. Comments welcome, patches are for 6.x and 7.x. -- Nate --------------040100070106020900000700 Content-Type: text/x-patch; name="acpi6_wakeapi.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="acpi6_wakeapi.diff" Index: etc/devd.conf =================================================================== RCS file: /home/ncvs/src/etc/devd.conf,v retrieving revision 1.26.2.5 diff -u -r1.26.2.5 devd.conf --- etc/devd.conf 24 Jul 2006 20:42:36 -0000 1.26.2.5 +++ etc/devd.conf 17 Jun 2007 16:58:35 -0000 @@ -148,6 +148,19 @@ action "logger -p kern.emerg 'WARNING: system temperature too high, shutting down soon!'"; }; +# User requested suspend, so perform preparation steps and then execute +# the actual suspend process. +notify 10 { + match "system" "ACPI"; + match "subsystem" "Suspend"; + action "/etc/rc.suspend acpi $notify"; +}; +notify 10 { + match "system" "ACPI"; + match "subsystem" "Resume"; + action "/etc/rc.resume acpi $notify"; +}; + /* EXAMPLES TO END OF FILE # The following might be an example of something that a vendor might @@ -186,6 +199,7 @@ # Button: Button pressed (0 for power, 1 for sleep) # CMBAT: ACPI battery events # Lid: Lid state (0 is closed, 1 is open) +# Suspend, Resume: Suspend and resume notification # Thermal: ACPI thermal zone events # # This example calls a script when the AC state changes, passing the Index: etc/rc.resume =================================================================== RCS file: /home/ncvs/src/etc/rc.resume,v retrieving revision 1.7 diff -u -r1.7 rc.resume --- etc/rc.resume 30 Dec 2003 17:30:39 -0000 1.7 +++ etc/rc.resume 17 Jun 2007 16:58:35 -0000 @@ -30,7 +30,7 @@ # sample run command file for APM Resume Event if [ $# -ne 2 ]; then - echo "Usage: $0 [apm|acpi] [standby,suspend|1-5]" + echo "Usage: $0 [apm|acpi] [standby,suspend|1-4]" exit 1 fi @@ -48,9 +48,13 @@ # pccardq | awk -F '~' '$5 == "inactive" \ # { printf("pccardc power %d 1", $1); }' | sh -# UHCI has trouble resuming so we just load/unload it. You -# should add any other kernel modules you want reloaded here. -# kldload usb +# If a device driver has problems resuming, try unloading it before +# suspend and reloading it on resume. Example: +# kldunload usb + +# wpa_supplicant(8) doesn't seem to reassociate during resume. Uncomment +# the following to signal it to reassociate. +# /usr/sbin/wpa_cli reassociate logger -t $subsystem resumed at `date +'%Y%m%d %H:%M:%S'` sync && sync && sync Index: etc/rc.suspend =================================================================== RCS file: /home/ncvs/src/etc/rc.suspend,v retrieving revision 1.6 diff -u -r1.6 rc.suspend --- etc/rc.suspend 21 Jan 2004 03:03:40 -0000 1.6 +++ etc/rc.suspend 17 Jun 2007 16:58:35 -0000 @@ -30,7 +30,7 @@ # sample run command file for APM Suspend Event if [ $# -ne 2 ]; then - echo "Usage: $0 [apm|acpi] [standby,suspend|1-5]" + echo "Usage: $0 [apm|acpi] [standby,suspend|1-4]" exit 1 fi @@ -48,15 +48,20 @@ # pccardq | awk -F '~' '$5 == "filled" && $4 ~ /sio/ \ # { printf("pccardc power %d 0", $1); }' | sh -# UHCI has trouble resuming so we just load/unload it. You -# should add any other kernel modules you want unloaded here. +# If a device driver has problems suspending, try unloading it before +# suspend and reloading it on resume. Example: # kldunload usb logger -t $subsystem suspend at `date +'%Y%m%d %H:%M:%S'` sync && sync && sync -[ $subsystem = "apm" ] && sleep 3 +sleep 3 rm -f /var/run/rc.suspend.pid -[ $subsystem = "apm" ] && zzz +if [ $subsystem = "apm" ]; then + /usr/sbin/zzz +else + # Notify the kernel to continue the suspend process + /usr/sbin/acpiconf -k 0 +fi exit 0 Index: sys/dev/acpica/acpi.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi.c,v retrieving revision 1.214.2.10 diff -u -r1.214.2.10 acpi.c --- sys/dev/acpica/acpi.c 26 May 2007 00:48:55 -0000 1.214.2.10 +++ sys/dev/acpica/acpi.c 17 Jun 2007 16:58:35 -0000 @@ -136,6 +136,7 @@ static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status); static BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid); +static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state); static void acpi_shutdown_final(void *arg, int howto); static void acpi_enable_fixed_events(struct acpi_softc *sc); static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate); @@ -414,6 +415,7 @@ sc = device_get_softc(dev); sc->acpi_dev = dev; + callout_init(&sc->susp_force_to, TRUE); /* Initialize resource manager. */ acpi_rman_io.rm_type = RMAN_ARRAY; @@ -561,7 +563,7 @@ /* Pick the first valid sleep state for the sleep button default. */ sc->acpi_sleep_button_sx = ACPI_S_STATES_MAX + 1; - for (state = ACPI_STATE_S1; state < ACPI_STATE_S5; state++) + for (state = ACPI_STATE_S1; state <= ACPI_STATE_S4; state++) if (ACPI_SUCCESS(AcpiGetSleepTypeData(state, &TypeA, &TypeB))) { sc->acpi_sleep_button_sx = state; break; @@ -2100,6 +2102,143 @@ return (acpi_SetInteger(ACPI_ROOT_OBJECT, "_PIC", model)); } +/* + * DEPRECATED. This interface has serious deficiencies and will be + * removed. + * + * Immediately enter the sleep state. In the old model, acpiconf(8) ran + * rc.suspend and rc.resume so we don't have to notify devd(8) to do this. + */ +ACPI_STATUS +acpi_SetSleepState(struct acpi_softc *sc, int state) +{ + static int once; + + if (!once) { + printf( +"warning: acpi_SetSleepState deprecated, need to update your software\n"); + once = 1; + } + return (acpi_EnterSleepState(sc, state)); +} + +static void +acpi_sleep_force(void *arg) +{ + struct acpi_softc *sc; + + printf("acpi: suspend request timed out, forcing sleep now\n"); + sc = arg; + acpi_EnterSleepState(sc, sc->acpi_next_sstate); +} + +/* + * Request that the system enter the given suspend state. All /dev/apm + * devices and devd(8) will be notified. Userland then has a chance to + * save state and acknowledge the request. The system sleeps once all + * acks are in. + */ +int +acpi_ReqSleepState(struct acpi_softc *sc, int state) +{ + struct apm_clone_data *clone; + + /* S5 (soft-off) should be entered via shutdown_nice(). */ + if (state < ACPI_STATE_S1 || state > ACPI_STATE_S4) + return (EINVAL); + + /* If a suspend request is already in progress, just return. */ + ACPI_LOCK(acpi); + if (sc->acpi_next_sstate != 0) { + ACPI_UNLOCK(acpi); + return (0); + } + + /* Record the pending state and notify all apm devices. */ + sc->acpi_next_sstate = state; + STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { +printf("considering clone of %s\n", devtoname(clone->cdev)); + clone->notify_status = APM_EV_NONE; + if ((clone->flags & ACPI_EVF_DEVD) == 0) { +printf("acpi ev got %d, waking listener %p\n", state, clone); + selwakeuppri(&clone->sel_read, PZERO); + KNOTE_UNLOCKED(&clone->sel_read.si_note, 0); + } + } + + /* Now notify devd(8) also. */ + acpi_UserNotify("Suspend", ACPI_ROOT_OBJECT, state); + + /* + * Set a timeout to fire if userland doesn't ack the suspend request + * in time. This way we still eventually go to sleep if we were + * overheating or running low on battery, even if userland is hung. + * We cancel this timeout once all userland acks are in or the + * suspend request is aborted. + */ + callout_reset(&sc->susp_force_to, 10 * hz, acpi_sleep_force, sc); + ACPI_UNLOCK(acpi); + return (0); +} + +/* + * Acknowledge (or reject) a pending sleep state. The caller has + * prepared for suspend and is now ready for it to proceed. If the + * error argument is non-zero, it indicates suspend should be cancelled + * and gives an errno value describing why. Once all votes are in, + * we suspend the system. + */ +int +acpi_AckSleepState(struct apm_clone_data *clone, int error) +{ + struct acpi_softc *sc; + int sleeping; + + /* If no pending sleep state, return an error. */ + ACPI_LOCK(acpi); + sc = clone->acpi_sc; + if (sc->acpi_next_sstate == 0) { + ACPI_UNLOCK(acpi); + return (ENXIO); + } + + /* Caller wants to abort suspend process. */ + if (error) { + sc->acpi_next_sstate = 0; + callout_stop(&sc->susp_force_to); + printf("acpi: listener on %s cancelled the pending suspend\n", + devtoname(clone->cdev)); + ACPI_UNLOCK(acpi); + return (0); + } + + /* + * Mark this device as acking the suspend request. Then, walk through + * all devices, seeing if they agree yet. We only count devices that + * are writable since read-only devices couldn't ack the request. + */ + clone->notify_status = APM_EV_ACKED; + sleeping = TRUE; + STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { + if ((clone->flags & ACPI_EVF_WRITE) != 0 && + clone->notify_status != APM_EV_ACKED) { + sleeping = FALSE; + break; + } + } + + /* If all devices have voted "yes", we will suspend now. */ + if (sleeping) { +printf("ack: all devs said yes, sleeping now\n"); + callout_stop(&sc->susp_force_to); + } + ACPI_UNLOCK(acpi); + if (sleeping) + acpi_EnterSleepState(sc, sc->acpi_next_sstate); + + return (0); +} + static void acpi_sleep_enable(void *arg) { @@ -2116,12 +2255,12 @@ }; /* - * Set the system sleep state + * Enter the desired system sleep state. * * Currently we support S1-S5 but S4 is only S4BIOS */ -ACPI_STATUS -acpi_SetSleepState(struct acpi_softc *sc, int state) +static ACPI_STATUS +acpi_EnterSleepState(struct acpi_softc *sc, int state) { ACPI_STATUS status; UINT8 TypeA; @@ -2233,6 +2372,7 @@ * Back out state according to how far along we got in the suspend * process. This handles both the error and success cases. */ + sc->acpi_next_sstate = 0; if (slp_state >= ACPI_SS_GPE_SET) { acpi_wake_prep_walk(state); sc->acpi_sstate = ACPI_STATE_S0; @@ -2246,7 +2386,10 @@ /* Allow another sleep request after a while. */ if (state != ACPI_STATE_S5) - timeout(acpi_sleep_enable, (caddr_t)sc, hz * ACPI_MINIMUM_AWAKETIME); + timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME); + + /* Run /etc/rc.resume after we are back. */ + acpi_UserNotify("Resume", ACPI_ROOT_OBJECT, state); mtx_unlock(&Giant); return_ACPI_STATUS (status); @@ -2558,11 +2701,14 @@ static void acpi_system_eventhandler_sleep(void *arg, int state) { + int ret; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, state); - if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX) - acpi_SetSleepState((struct acpi_softc *)arg, state); + /* Request that the system prepare to enter the given suspend state. */ + ret = acpi_ReqSleepState((struct acpi_softc *)arg, state); + if (ret != 0) + printf("acpi: request to enter state S%d failed\n", state); return_VOID; } @@ -2824,7 +2970,15 @@ /* Core system ioctls. */ switch (cmd) { - case ACPIIO_SETSLPSTATE: + case ACPIIO_REQSLPSTATE: + state = *(int *)addr; + error = acpi_ReqSleepState(sc, state); + break; + case ACPIIO_ACKSLPSTATE: + error = *(int *)addr; + error = acpi_AckSleepState(sc->acpi_clone, error); + break; + case ACPIIO_SETSLPSTATE: /* DEPRECATED */ error = EINVAL; state = *(int *)addr; if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX) Index: sys/dev/acpica/acpiio.h =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpiio.h,v retrieving revision 1.14.2.2 diff -u -r1.14.2.2 acpiio.h --- sys/dev/acpica/acpiio.h 5 Nov 2005 23:55:56 -0000 1.14.2.2 +++ sys/dev/acpica/acpiio.h 17 Jun 2007 16:58:35 -0000 @@ -33,7 +33,13 @@ /* * Core ACPI subsystem ioctls */ -#define ACPIIO_SETSLPSTATE _IOW('P', 3, int) +#define ACPIIO_SETSLPSTATE _IOW('P', 3, int) /* DEPRECATED */ + +/* Request S1-5 sleep state. User is notified and then sleep proceeds. */ +#define ACPIIO_REQSLPSTATE _IOW('P', 4, int) + +/* Allow suspend to continue (0) or abort it (errno). */ +#define ACPIIO_ACKSLPSTATE _IOW('P', 5, int) struct acpi_battinfo { int cap; /* percent */ Index: sys/dev/acpica/acpivar.h =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpivar.h,v retrieving revision 1.95.2.5 diff -u -r1.95.2.5 acpivar.h --- sys/dev/acpica/acpivar.h 23 Jan 2007 07:21:23 -0000 1.95.2.5 +++ sys/dev/acpica/acpivar.h 17 Jun 2007 16:58:35 -0000 @@ -39,12 +39,14 @@ #include #include #include +#include #include #include #include #include +struct apm_clone_data; struct acpi_softc { device_t acpi_dev; struct cdev *acpi_dev_t; @@ -76,6 +78,11 @@ bus_dmamap_t acpi_wakemap; vm_offset_t acpi_wakeaddr; vm_paddr_t acpi_wakephys; + + int acpi_next_sstate; /* Next suspend Sx state. */ + struct apm_clone_data *acpi_clone; /* Pseudo-dev for devd(8). */ + STAILQ_HEAD(,apm_clone_data) apm_cdevs; /* All apm/apmctl/acpi cdevs. */ + struct callout susp_force_to; /* Force suspend if no acks. */ }; struct acpi_device { @@ -89,6 +96,22 @@ struct resource_list ad_rl; }; +/* Track device (/dev/{apm,apmctl} and /dev/acpi) notification status. */ +struct apm_clone_data { + STAILQ_ENTRY(apm_clone_data) entries; + struct cdev *cdev; + int flags; +#define ACPI_EVF_NONE 0 /* /dev/apm semantics */ +#define ACPI_EVF_DEVD 1 /* /dev/acpi is handled via devd(8) */ +#define ACPI_EVF_WRITE 2 /* Device instance is opened writable. */ + int notify_status; +#define APM_EV_NONE 0 /* Device not yet aware of pending sleep. */ +#define APM_EV_NOTIFIED 1 /* Device saw next sleep state. */ +#define APM_EV_ACKED 2 /* Device agreed sleep can occur. */ + struct acpi_softc *acpi_sc; + struct selinfo sel_read; +}; + #define ACPI_PRW_MAX_POWERRES 8 struct acpi_prw_data { @@ -304,6 +327,8 @@ ACPI_RESOURCE *res); ACPI_STATUS acpi_OverrideInterruptLevel(UINT32 InterruptNumber); ACPI_STATUS acpi_SetIntrModel(int model); +int acpi_ReqSleepState(struct acpi_softc *sc, int state); +int acpi_AckSleepState(struct apm_clone_data *clone, int error); ACPI_STATUS acpi_SetSleepState(struct acpi_softc *sc, int state); int acpi_wake_init(device_t dev, int type); int acpi_wake_set_enable(device_t dev, int enable); Index: sys/i386/acpica/acpi_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/acpica/acpi_machdep.c,v retrieving revision 1.28.2.4 diff -u -r1.28.2.4 acpi_machdep.c --- sys/i386/acpica/acpi_machdep.c 2 May 2007 18:42:46 -0000 1.28.2.4 +++ sys/i386/acpica/acpi_machdep.c 17 Jun 2007 16:58:35 -0000 @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include #include @@ -45,8 +47,6 @@ * APM driver emulation */ -#include - #include #include @@ -63,21 +63,31 @@ static int intr_model = ACPI_INTR_PIC; static int apm_active; +static struct clonedevs *apm_clones; + +MALLOC_DEFINE(M_APMDEV, "apmdev", "APM device emulation"); -static d_open_t apmopen; -static d_close_t apmclose; -static d_write_t apmwrite; -static d_ioctl_t apmioctl; -static d_poll_t apmpoll; +static d_open_t apmopen; +static d_close_t apmclose; +static d_write_t apmwrite; +static d_ioctl_t apmioctl; +static d_poll_t apmpoll; +static d_kqfilter_t apmkqfilter; +static void apmreadfiltdetach(struct knote *kn); +static int apmreadfilt(struct knote *kn, long hint); +static struct filterops apm_readfiltops = + { 1, NULL, apmreadfiltdetach, apmreadfilt }; static struct cdevsw apm_cdevsw = { .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE, .d_open = apmopen, .d_close = apmclose, .d_write = apmwrite, .d_ioctl = apmioctl, .d_poll = apmpoll, .d_name = "apm", + .d_kqfilter = apmkqfilter }; static int @@ -201,44 +211,159 @@ return (0); } +/* Create single-use devices for /dev/apm and /dev/apmctl. */ +static void +apm_clone(void *arg, struct ucred *cred, char *name, int namelen, + struct cdev **dev) +{ + int ctl_dev, unit; + + if (*dev != NULL) + return; + if (strcmp(name, "apmctl") == 0) + ctl_dev = TRUE; + else if (strcmp(name, "apm") == 0) + ctl_dev = FALSE; + else + return; + + /* Always create a new device and unit number. */ + unit = -1; + if (clone_create(&apm_clones, &apm_cdevsw, &unit, dev, 0)) { + if (ctl_dev) { + *dev = make_dev(&apm_cdevsw, unit2minor(unit), + UID_ROOT, GID_OPERATOR, 0660, "apmctl%d", unit); + } else { + *dev = make_dev(&apm_cdevsw, unit2minor(unit), + UID_ROOT, GID_OPERATOR, 0664, "apm%d", unit); + } + if (*dev != NULL) { + dev_ref(*dev); + (*dev)->si_flags |= SI_CHEAPCLONE; + } + } +} + +/* Create a struct for tracking per-device suspend notification. */ +static struct apm_clone_data * +apm_create_clone(struct cdev *dev, struct acpi_softc *acpi_sc) +{ + struct apm_clone_data *clone; + + clone = malloc(sizeof(*clone), M_APMDEV, M_WAITOK); + clone->cdev = dev; + clone->acpi_sc = acpi_sc; + clone->notify_status = APM_EV_NONE; + bzero(&clone->sel_read, sizeof(clone->sel_read)); + knlist_init(&clone->sel_read.si_note, &acpi_mutex, NULL, NULL, NULL); + + /* + * The acpi device is always managed by devd(8) and is considered + * writable (i.e., ack is required to allow suspend to proceed.) + */ + if (strcmp("acpi", devtoname(dev)) == 0) + clone->flags = ACPI_EVF_DEVD | ACPI_EVF_WRITE; + else + clone->flags = ACPI_EVF_NONE; + + ACPI_LOCK(acpi); + STAILQ_INSERT_TAIL(&acpi_sc->apm_cdevs, clone, entries); + ACPI_UNLOCK(acpi); + return (clone); +} + static int apmopen(struct cdev *dev, int flag, int fmt, d_thread_t *td) { + struct acpi_softc *acpi_sc; + struct apm_clone_data *clone; + + acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); + clone = apm_create_clone(dev, acpi_sc); + dev->si_drv1 = clone; + + /* If the device is opened for write, record that. */ + if ((flag & FWRITE) != 0) + clone->flags |= ACPI_EVF_WRITE; + +printf("%s opened clone %p\n", devtoname(dev), (struct apm_clone_data *)dev->si_drv1); return (0); } static int apmclose(struct cdev *dev, int flag, int fmt, d_thread_t *td) { + struct apm_clone_data *clone; + struct acpi_softc *acpi_sc; + + clone = dev->si_drv1; + acpi_sc = clone->acpi_sc; + + /* We are about to lose a reference so check if suspend should occur */ + if (acpi_sc->acpi_next_sstate != 0 && + clone->notify_status != APM_EV_ACKED) + acpi_AckSleepState(clone, 0); + + /* Remove this clone's data from the list and free it. */ + ACPI_LOCK(acpi); + STAILQ_REMOVE(&acpi_sc->apm_cdevs, clone, apm_clone_data, entries); + knlist_destroy(&clone->sel_read.si_note); +printf("%s closed clone %p\n", devtoname(dev), clone); + ACPI_UNLOCK(acpi); + free(clone, M_APMDEV); + /* XXX destroy_dev() needed */ return (0); } static int apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td) { - int error = 0; + int error; + struct apm_clone_data *clone; struct acpi_softc *acpi_sc; - struct apm_info info; + struct apm_info info; + struct apm_event_info *ev_info; apm_info_old_t aiop; - acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); + error = 0; + clone = dev->si_drv1; + acpi_sc = clone->acpi_sc; switch (cmd) { case APMIO_SUSPEND: if ((flag & FWRITE) == 0) return (EPERM); - if (apm_active) - acpi_SetSleepState(acpi_sc, acpi_sc->acpi_suspend_sx); +printf("apm ioctl suspend\n"); + if (acpi_sc->acpi_next_sstate == 0) + acpi_ReqSleepState(acpi_sc, acpi_sc->acpi_suspend_sx); else - error = EINVAL; + acpi_AckSleepState(clone, 0); break; case APMIO_STANDBY: if ((flag & FWRITE) == 0) return (EPERM); - if (apm_active) - acpi_SetSleepState(acpi_sc, acpi_sc->acpi_standby_sx); +printf("apm ioctl standby\n"); + if (acpi_sc->acpi_next_sstate == 0) + acpi_ReqSleepState(acpi_sc, acpi_sc->acpi_standby_sx); else - error = EINVAL; + acpi_AckSleepState(clone, 0); + break; + case APMIO_NEXTEVENT: + printf("apm nextevent start\n"); + ACPI_LOCK(acpi); + if (acpi_sc->acpi_next_sstate != 0 && clone->notify_status == + APM_EV_NONE) { + ev_info = (struct apm_event_info *)addr; + if (acpi_sc->acpi_next_sstate <= ACPI_STATE_S3) + ev_info->type = PMEV_STANDBYREQ; + else + ev_info->type = PMEV_SUSPENDREQ; + ev_info->index = 0; + clone->notify_status = APM_EV_NOTIFIED; + printf("apm event returning %d\n", ev_info->type); + } else + error = EAGAIN; + ACPI_UNLOCK(acpi); break; case APMIO_GETINFO_OLD: if (acpi_capm_get_info(&info)) @@ -299,24 +424,72 @@ static int apmpoll(struct cdev *dev, int events, d_thread_t *td) { + struct apm_clone_data *clone; + int revents; + + revents = 0; + ACPI_LOCK(acpi); + clone = dev->si_drv1; + if (clone->acpi_sc->acpi_next_sstate) + revents |= events & (POLLIN | POLLRDNORM); + else + selrecord(td, &clone->sel_read); + ACPI_UNLOCK(acpi); +printf("apm poll returning %x\n", revents); + return (revents); +} + +static int +apmkqfilter(struct cdev *dev, struct knote *kn) +{ + struct apm_clone_data *clone; + + ACPI_LOCK(acpi); + clone = dev->si_drv1; + kn->kn_hook = clone; + kn->kn_fop = &apm_readfiltops; + knlist_add(&clone->sel_read.si_note, kn, 0); + ACPI_UNLOCK(acpi); return (0); } static void -acpi_capm_init(struct acpi_softc *sc) +apmreadfiltdetach(struct knote *kn) +{ + struct apm_clone_data *clone; + + ACPI_LOCK(acpi); + clone = kn->kn_hook; + knlist_remove(&clone->sel_read.si_note, kn, 0); + ACPI_UNLOCK(acpi); +} + +static int +apmreadfilt(struct knote *kn, long hint) { - make_dev(&apm_cdevsw, 0, 0, 5, 0664, "apm"); + struct apm_clone_data *clone; + int sleeping; + + ACPI_LOCK(acpi); + clone = kn->kn_hook; + sleeping = clone->acpi_sc->acpi_next_sstate ? 1 : 0; + ACPI_UNLOCK(acpi); + return (sleeping); } int acpi_machdep_init(device_t dev) { - struct acpi_softc *sc; + struct acpi_softc *acpi_sc; - sc = devclass_get_softc(devclass_find("acpi"), 0); - acpi_capm_init(sc); + acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); - acpi_install_wakeup_handler(sc); + /* Create a clone for /dev/acpi also. */ + STAILQ_INIT(&acpi_sc->apm_cdevs); + acpi_sc->acpi_clone = apm_create_clone(acpi_sc->acpi_dev_t, acpi_sc); + clone_setup(&apm_clones); + EVENTHANDLER_REGISTER(dev_clone, apm_clone, 0, 1000); + acpi_install_wakeup_handler(acpi_sc); if (intr_model == ACPI_INTR_PIC) BUS_CONFIG_INTR(dev, AcpiGbl_FADT->SciInt, INTR_TRIGGER_LEVEL, @@ -324,8 +497,8 @@ else acpi_SetIntrModel(intr_model); - SYSCTL_ADD_UINT(&sc->acpi_sysctl_ctx, - SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, + SYSCTL_ADD_UINT(&acpi_sc->acpi_sysctl_ctx, + SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "reset_video", CTLFLAG_RW, &acpi_reset_video, 0, "Call the VESA reset BIOS vector on the resume path"); Index: usr.sbin/acpi/acpiconf/acpiconf.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/acpi/acpiconf/acpiconf.c,v retrieving revision 1.22.2.1 diff -u -r1.22.2.1 acpiconf.c --- usr.sbin/acpi/acpiconf/acpiconf.c 29 Jul 2005 16:31:58 -0000 1.22.2.1 +++ usr.sbin/acpi/acpiconf/acpiconf.c 17 Jun 2007 16:58:35 -0000 @@ -40,8 +40,6 @@ #include #define ACPIDEV "/dev/acpi" -#define RC_SUSPEND_PATH "/etc/rc.suspend" -#define RC_RESUME_PATH "/etc/rc.resume" static int acpifd; @@ -55,32 +53,27 @@ err(EX_OSFILE, ACPIDEV); } -static int +/* Prepare to sleep and then wait for the signal that sleeping can occur. */ +static void acpi_sleep(int sleep_type) { - char cmd[64]; int ret; + + /* Notify OS that we want to sleep. devd(8) gets this notify. */ + ret = ioctl(acpifd, ACPIIO_REQSLPSTATE, &sleep_type); + if (ret != 0) + err(EX_IOERR, "request sleep type (%d) failed", sleep_type); +} - /* Run the suspend rc script, if available. */ - if (access(RC_SUSPEND_PATH, X_OK) == 0) { - snprintf(cmd, sizeof(cmd), "%s acpi %d", RC_SUSPEND_PATH, - sleep_type); - system(cmd); - } - - ret = ioctl(acpifd, ACPIIO_SETSLPSTATE, &sleep_type); - - /* Run the resume rc script, if available. */ - if (access(RC_RESUME_PATH, X_OK) == 0) { - snprintf(cmd, sizeof(cmd), "%s acpi %d", RC_RESUME_PATH, - sleep_type); - system(cmd); - } +/* Ack or abort a pending suspend request. */ +static void +acpi_sleep_ack(int err_val) +{ + int ret; + ret = ioctl(acpifd, ACPIIO_ACKSLPSTATE, &err_val); if (ret != 0) - err(EX_IOERR, "sleep type (%d) failed", sleep_type); - - return (0); + err(EX_IOERR, "ack sleep type failed"); } /* should be a acpi define, but doesn't appear to be */ @@ -183,7 +176,7 @@ static void usage(const char* prog) { - printf("usage: %s [-h] [-i batt] [-s 1-5]\n", prog); + printf("usage: %s [-h] [-i batt] [-k ack] [-s 1-4]\n", prog); exit(0); } @@ -200,17 +193,20 @@ sleep_type = -1; acpi_init(); - while ((c = getopt(argc, argv, "hi:s:")) != -1) { + while ((c = getopt(argc, argv, "hi:k:s:")) != -1) { switch (c) { case 'i': acpi_battinfo(atoi(optarg)); break; + case 'k': + acpi_sleep_ack(atoi(optarg)); + break; case 's': if (optarg[0] == 'S') sleep_type = optarg[1] - '0'; else sleep_type = optarg[0] - '0'; - if (sleep_type < 0 || sleep_type > 5) + if (sleep_type < 1 || sleep_type > 4) errx(EX_USAGE, "invalid sleep type (%d)", sleep_type); break; @@ -223,10 +219,8 @@ argc -= optind; argv += optind; - if (sleep_type != -1) { - sleep(1); /* wait 1 sec. for key-release event */ + if (sleep_type != -1) acpi_sleep(sleep_type); - } close(acpifd); exit (0); --------------040100070106020900000700 Content-Type: text/x-patch; name="acpi7_wakeapi.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="acpi7_wakeapi.diff" Index: etc/devd.conf =================================================================== RCS file: /home/ncvs/src/etc/devd.conf,v retrieving revision 1.37 diff -u -r1.37 devd.conf --- etc/devd.conf 8 Apr 2007 16:05:23 -0000 1.37 +++ etc/devd.conf 17 Jun 2007 16:52:50 -0000 @@ -239,6 +239,19 @@ action "logger -p kern.warn 'ZFS: checksum mismatch, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size'"; }; +# User requested suspend, so perform preparation steps and then execute +# the actual suspend process. +notify 10 { + match "system" "ACPI"; + match "subsystem" "Suspend"; + action "/etc/rc.suspend acpi $notify"; +}; +notify 10 { + match "system" "ACPI"; + match "subsystem" "Resume"; + action "/etc/rc.resume acpi $notify"; +}; + /* EXAMPLES TO END OF FILE # The following might be an example of something that a vendor might @@ -277,6 +290,7 @@ # Button: Button pressed (0 for power, 1 for sleep) # CMBAT: ACPI battery events # Lid: Lid state (0 is closed, 1 is open) +# Suspend, Resume: Suspend and resume notification # Thermal: ACPI thermal zone events # # This example calls a script when the AC state changes, passing the Index: etc/rc.resume =================================================================== RCS file: /home/ncvs/src/etc/rc.resume,v retrieving revision 1.7 diff -u -r1.7 rc.resume --- etc/rc.resume 30 Dec 2003 17:30:39 -0000 1.7 +++ etc/rc.resume 17 Jun 2007 16:52:50 -0000 @@ -30,7 +30,7 @@ # sample run command file for APM Resume Event if [ $# -ne 2 ]; then - echo "Usage: $0 [apm|acpi] [standby,suspend|1-5]" + echo "Usage: $0 [apm|acpi] [standby,suspend|1-4]" exit 1 fi @@ -48,9 +48,13 @@ # pccardq | awk -F '~' '$5 == "inactive" \ # { printf("pccardc power %d 1", $1); }' | sh -# UHCI has trouble resuming so we just load/unload it. You -# should add any other kernel modules you want reloaded here. -# kldload usb +# If a device driver has problems resuming, try unloading it before +# suspend and reloading it on resume. Example: +# kldunload usb + +# wpa_supplicant(8) doesn't seem to reassociate during resume. Uncomment +# the following to signal it to reassociate. +# /usr/sbin/wpa_cli reassociate logger -t $subsystem resumed at `date +'%Y%m%d %H:%M:%S'` sync && sync && sync Index: etc/rc.suspend =================================================================== RCS file: /home/ncvs/src/etc/rc.suspend,v retrieving revision 1.6 diff -u -r1.6 rc.suspend --- etc/rc.suspend 21 Jan 2004 03:03:40 -0000 1.6 +++ etc/rc.suspend 17 Jun 2007 16:54:56 -0000 @@ -30,7 +30,7 @@ # sample run command file for APM Suspend Event if [ $# -ne 2 ]; then - echo "Usage: $0 [apm|acpi] [standby,suspend|1-5]" + echo "Usage: $0 [apm|acpi] [standby,suspend|1-4]" exit 1 fi @@ -48,15 +48,20 @@ # pccardq | awk -F '~' '$5 == "filled" && $4 ~ /sio/ \ # { printf("pccardc power %d 0", $1); }' | sh -# UHCI has trouble resuming so we just load/unload it. You -# should add any other kernel modules you want unloaded here. +# If a device driver has problems suspending, try unloading it before +# suspend and reloading it on resume. Example: # kldunload usb logger -t $subsystem suspend at `date +'%Y%m%d %H:%M:%S'` sync && sync && sync -[ $subsystem = "apm" ] && sleep 3 +sleep 3 rm -f /var/run/rc.suspend.pid -[ $subsystem = "apm" ] && zzz +if [ $subsystem = "apm" ]; then + /usr/sbin/zzz +else + # Notify the kernel to continue the suspend process + /usr/sbin/acpiconf -k 0 +fi exit 0 Index: sys/dev/acpica/acpi.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi.c,v retrieving revision 1.239 diff -u -r1.239 acpi.c --- sys/dev/acpica/acpi.c 15 Jun 2007 18:02:33 -0000 1.239 +++ sys/dev/acpica/acpi.c 17 Jun 2007 16:52:50 -0000 @@ -136,6 +136,7 @@ static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status); static BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid); +static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state); static void acpi_shutdown_final(void *arg, int howto); static void acpi_enable_fixed_events(struct acpi_softc *sc); static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate); @@ -410,6 +411,7 @@ sc = device_get_softc(dev); sc->acpi_dev = dev; + callout_init(&sc->susp_force_to, TRUE); error = ENXIO; @@ -592,7 +594,7 @@ /* Pick the first valid sleep state for the sleep button default. */ sc->acpi_sleep_button_sx = ACPI_S_STATES_MAX + 1; - for (state = ACPI_STATE_S1; state < ACPI_STATE_S5; state++) + for (state = ACPI_STATE_S1; state <= ACPI_STATE_S4; state++) if (ACPI_SUCCESS(AcpiGetSleepTypeData(state, &TypeA, &TypeB))) { sc->acpi_sleep_button_sx = state; break; @@ -2118,6 +2120,143 @@ return (acpi_SetInteger(ACPI_ROOT_OBJECT, "_PIC", model)); } +/* + * DEPRECATED. This interface has serious deficiencies and will be + * removed. + * + * Immediately enter the sleep state. In the old model, acpiconf(8) ran + * rc.suspend and rc.resume so we don't have to notify devd(8) to do this. + */ +ACPI_STATUS +acpi_SetSleepState(struct acpi_softc *sc, int state) +{ + static int once; + + if (!once) { + printf( +"warning: acpi_SetSleepState deprecated, need to update your software\n"); + once = 1; + } + return (acpi_EnterSleepState(sc, state)); +} + +static void +acpi_sleep_force(void *arg) +{ + struct acpi_softc *sc; + + printf("acpi: suspend request timed out, forcing sleep now\n"); + sc = arg; + acpi_EnterSleepState(sc, sc->acpi_next_sstate); +} + +/* + * Request that the system enter the given suspend state. All /dev/apm + * devices and devd(8) will be notified. Userland then has a chance to + * save state and acknowledge the request. The system sleeps once all + * acks are in. + */ +int +acpi_ReqSleepState(struct acpi_softc *sc, int state) +{ + struct apm_clone_data *clone; + + /* S5 (soft-off) should be entered via shutdown_nice(). */ + if (state < ACPI_STATE_S1 || state > ACPI_STATE_S4) + return (EINVAL); + + /* If a suspend request is already in progress, just return. */ + ACPI_LOCK(acpi); + if (sc->acpi_next_sstate != 0) { + ACPI_UNLOCK(acpi); + return (0); + } + + /* Record the pending state and notify all apm devices. */ + sc->acpi_next_sstate = state; + STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { +printf("considering clone of %s\n", devtoname(clone->cdev)); + clone->notify_status = APM_EV_NONE; + if ((clone->flags & ACPI_EVF_DEVD) == 0) { +printf("acpi ev got %d, waking listener %p\n", state, clone); + selwakeuppri(&clone->sel_read, PZERO); + KNOTE_UNLOCKED(&clone->sel_read.si_note, 0); + } + } + + /* Now notify devd(8) also. */ + acpi_UserNotify("Suspend", ACPI_ROOT_OBJECT, state); + + /* + * Set a timeout to fire if userland doesn't ack the suspend request + * in time. This way we still eventually go to sleep if we were + * overheating or running low on battery, even if userland is hung. + * We cancel this timeout once all userland acks are in or the + * suspend request is aborted. + */ + callout_reset(&sc->susp_force_to, 10 * hz, acpi_sleep_force, sc); + ACPI_UNLOCK(acpi); + return (0); +} + +/* + * Acknowledge (or reject) a pending sleep state. The caller has + * prepared for suspend and is now ready for it to proceed. If the + * error argument is non-zero, it indicates suspend should be cancelled + * and gives an errno value describing why. Once all votes are in, + * we suspend the system. + */ +int +acpi_AckSleepState(struct apm_clone_data *clone, int error) +{ + struct acpi_softc *sc; + int sleeping; + + /* If no pending sleep state, return an error. */ + ACPI_LOCK(acpi); + sc = clone->acpi_sc; + if (sc->acpi_next_sstate == 0) { + ACPI_UNLOCK(acpi); + return (ENXIO); + } + + /* Caller wants to abort suspend process. */ + if (error) { + sc->acpi_next_sstate = 0; + callout_stop(&sc->susp_force_to); + printf("acpi: listener on %s cancelled the pending suspend\n", + devtoname(clone->cdev)); + ACPI_UNLOCK(acpi); + return (0); + } + + /* + * Mark this device as acking the suspend request. Then, walk through + * all devices, seeing if they agree yet. We only count devices that + * are writable since read-only devices couldn't ack the request. + */ + clone->notify_status = APM_EV_ACKED; + sleeping = TRUE; + STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { + if ((clone->flags & ACPI_EVF_WRITE) != 0 && + clone->notify_status != APM_EV_ACKED) { + sleeping = FALSE; + break; + } + } + + /* If all devices have voted "yes", we will suspend now. */ + if (sleeping) { +printf("ack: all devs said yes, sleeping now\n"); + callout_stop(&sc->susp_force_to); + } + ACPI_UNLOCK(acpi); + if (sleeping) + acpi_EnterSleepState(sc, sc->acpi_next_sstate); + + return (0); +} + static void acpi_sleep_enable(void *arg) { @@ -2134,12 +2273,12 @@ }; /* - * Set the system sleep state + * Enter the desired system sleep state. * * Currently we support S1-S5 but S4 is only S4BIOS */ -ACPI_STATUS -acpi_SetSleepState(struct acpi_softc *sc, int state) +static ACPI_STATUS +acpi_EnterSleepState(struct acpi_softc *sc, int state) { ACPI_STATUS status; UINT8 TypeA; @@ -2251,6 +2390,7 @@ * Back out state according to how far along we got in the suspend * process. This handles both the error and success cases. */ + sc->acpi_next_sstate = 0; if (slp_state >= ACPI_SS_GPE_SET) { acpi_wake_prep_walk(state); sc->acpi_sstate = ACPI_STATE_S0; @@ -2264,7 +2404,10 @@ /* Allow another sleep request after a while. */ if (state != ACPI_STATE_S5) - timeout(acpi_sleep_enable, (caddr_t)sc, hz * ACPI_MINIMUM_AWAKETIME); + timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME); + + /* Run /etc/rc.resume after we are back. */ + acpi_UserNotify("Resume", ACPI_ROOT_OBJECT, state); mtx_unlock(&Giant); return_ACPI_STATUS (status); @@ -2574,11 +2717,14 @@ static void acpi_system_eventhandler_sleep(void *arg, int state) { + int ret; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, state); - if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX) - acpi_SetSleepState((struct acpi_softc *)arg, state); + /* Request that the system prepare to enter the given suspend state. */ + ret = acpi_ReqSleepState((struct acpi_softc *)arg, state); + if (ret != 0) + printf("acpi: request to enter state S%d failed\n", state); return_VOID; } @@ -2840,7 +2986,15 @@ /* Core system ioctls. */ switch (cmd) { - case ACPIIO_SETSLPSTATE: + case ACPIIO_REQSLPSTATE: + state = *(int *)addr; + error = acpi_ReqSleepState(sc, state); + break; + case ACPIIO_ACKSLPSTATE: + error = *(int *)addr; + error = acpi_AckSleepState(sc->acpi_clone, error); + break; + case ACPIIO_SETSLPSTATE: /* DEPRECATED */ error = EINVAL; state = *(int *)addr; if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX) Index: sys/dev/acpica/acpiio.h =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpiio.h,v retrieving revision 1.16 diff -u -r1.16 acpiio.h --- sys/dev/acpica/acpiio.h 23 Oct 2005 00:16:41 -0000 1.16 +++ sys/dev/acpica/acpiio.h 17 Jun 2007 16:52:50 -0000 @@ -33,7 +33,13 @@ /* * Core ACPI subsystem ioctls */ -#define ACPIIO_SETSLPSTATE _IOW('P', 3, int) +#define ACPIIO_SETSLPSTATE _IOW('P', 3, int) /* DEPRECATED */ + +/* Request S1-5 sleep state. User is notified and then sleep proceeds. */ +#define ACPIIO_REQSLPSTATE _IOW('P', 4, int) + +/* Allow suspend to continue (0) or abort it (errno). */ +#define ACPIIO_ACKSLPSTATE _IOW('P', 5, int) struct acpi_battinfo { int cap; /* percent */ Index: sys/dev/acpica/acpivar.h =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpivar.h,v retrieving revision 1.106 diff -u -r1.106 acpivar.h --- sys/dev/acpica/acpivar.h 15 Jun 2007 18:02:34 -0000 1.106 +++ sys/dev/acpica/acpivar.h 17 Jun 2007 16:57:25 -0000 @@ -39,12 +39,14 @@ #include #include #include +#include #include #include #include #include +struct apm_clone_data; struct acpi_softc { device_t acpi_dev; struct cdev *acpi_dev_t; @@ -76,6 +78,11 @@ bus_dmamap_t acpi_wakemap; vm_offset_t acpi_wakeaddr; vm_paddr_t acpi_wakephys; + + int acpi_next_sstate; /* Next suspend Sx state. */ + struct apm_clone_data *acpi_clone; /* Pseudo-dev for devd(8). */ + STAILQ_HEAD(,apm_clone_data) apm_cdevs; /* All apm/apmctl/acpi cdevs. */ + struct callout susp_force_to; /* Force suspend if no acks. */ }; struct acpi_device { @@ -89,6 +96,22 @@ struct resource_list ad_rl; }; +/* Track device (/dev/{apm,apmctl} and /dev/acpi) notification status. */ +struct apm_clone_data { + STAILQ_ENTRY(apm_clone_data) entries; + struct cdev *cdev; + int flags; +#define ACPI_EVF_NONE 0 /* /dev/apm semantics */ +#define ACPI_EVF_DEVD 1 /* /dev/acpi is handled via devd(8) */ +#define ACPI_EVF_WRITE 2 /* Device instance is opened writable. */ + int notify_status; +#define APM_EV_NONE 0 /* Device not yet aware of pending sleep. */ +#define APM_EV_NOTIFIED 1 /* Device saw next sleep state. */ +#define APM_EV_ACKED 2 /* Device agreed sleep can occur. */ + struct acpi_softc *acpi_sc; + struct selinfo sel_read; +}; + #define ACPI_PRW_MAX_POWERRES 8 struct acpi_prw_data { @@ -304,6 +327,8 @@ ACPI_RESOURCE *res); ACPI_STATUS acpi_OverrideInterruptLevel(UINT32 InterruptNumber); ACPI_STATUS acpi_SetIntrModel(int model); +int acpi_ReqSleepState(struct acpi_softc *sc, int state); +int acpi_AckSleepState(struct apm_clone_data *clone, int error); ACPI_STATUS acpi_SetSleepState(struct acpi_softc *sc, int state); int acpi_wake_init(device_t dev, int type); int acpi_wake_set_enable(device_t dev, int enable); Index: sys/i386/acpica/acpi_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/acpica/acpi_machdep.c,v retrieving revision 1.35 diff -u -r1.35 acpi_machdep.c --- sys/i386/acpica/acpi_machdep.c 31 Mar 2007 23:23:41 -0000 1.35 +++ sys/i386/acpica/acpi_machdep.c 17 Jun 2007 16:52:50 -0000 @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include #include @@ -46,8 +48,6 @@ * APM driver emulation */ -#include - #include #include @@ -64,21 +64,31 @@ static int intr_model = ACPI_INTR_PIC; static int apm_active; +static struct clonedevs *apm_clones; + +MALLOC_DEFINE(M_APMDEV, "apmdev", "APM device emulation"); -static d_open_t apmopen; -static d_close_t apmclose; -static d_write_t apmwrite; -static d_ioctl_t apmioctl; -static d_poll_t apmpoll; +static d_open_t apmopen; +static d_close_t apmclose; +static d_write_t apmwrite; +static d_ioctl_t apmioctl; +static d_poll_t apmpoll; +static d_kqfilter_t apmkqfilter; +static void apmreadfiltdetach(struct knote *kn); +static int apmreadfilt(struct knote *kn, long hint); +static struct filterops apm_readfiltops = + { 1, NULL, apmreadfiltdetach, apmreadfilt }; static struct cdevsw apm_cdevsw = { .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE, .d_open = apmopen, .d_close = apmclose, .d_write = apmwrite, .d_ioctl = apmioctl, .d_poll = apmpoll, .d_name = "apm", + .d_kqfilter = apmkqfilter }; static int @@ -202,44 +212,159 @@ return (0); } +/* Create single-use devices for /dev/apm and /dev/apmctl. */ +static void +apm_clone(void *arg, struct ucred *cred, char *name, int namelen, + struct cdev **dev) +{ + int ctl_dev, unit; + + if (*dev != NULL) + return; + if (strcmp(name, "apmctl") == 0) + ctl_dev = TRUE; + else if (strcmp(name, "apm") == 0) + ctl_dev = FALSE; + else + return; + + /* Always create a new device and unit number. */ + unit = -1; + if (clone_create(&apm_clones, &apm_cdevsw, &unit, dev, 0)) { + if (ctl_dev) { + *dev = make_dev(&apm_cdevsw, unit2minor(unit), + UID_ROOT, GID_OPERATOR, 0660, "apmctl%d", unit); + } else { + *dev = make_dev(&apm_cdevsw, unit2minor(unit), + UID_ROOT, GID_OPERATOR, 0664, "apm%d", unit); + } + if (*dev != NULL) { + dev_ref(*dev); + (*dev)->si_flags |= SI_CHEAPCLONE; + } + } +} + +/* Create a struct for tracking per-device suspend notification. */ +static struct apm_clone_data * +apm_create_clone(struct cdev *dev, struct acpi_softc *acpi_sc) +{ + struct apm_clone_data *clone; + + clone = malloc(sizeof(*clone), M_APMDEV, M_WAITOK); + clone->cdev = dev; + clone->acpi_sc = acpi_sc; + clone->notify_status = APM_EV_NONE; + bzero(&clone->sel_read, sizeof(clone->sel_read)); + knlist_init(&clone->sel_read.si_note, &acpi_mutex, NULL, NULL, NULL); + + /* + * The acpi device is always managed by devd(8) and is considered + * writable (i.e., ack is required to allow suspend to proceed.) + */ + if (strcmp("acpi", devtoname(dev)) == 0) + clone->flags = ACPI_EVF_DEVD | ACPI_EVF_WRITE; + else + clone->flags = ACPI_EVF_NONE; + + ACPI_LOCK(acpi); + STAILQ_INSERT_TAIL(&acpi_sc->apm_cdevs, clone, entries); + ACPI_UNLOCK(acpi); + return (clone); +} + static int apmopen(struct cdev *dev, int flag, int fmt, d_thread_t *td) { + struct acpi_softc *acpi_sc; + struct apm_clone_data *clone; + + acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); + clone = apm_create_clone(dev, acpi_sc); + dev->si_drv1 = clone; + + /* If the device is opened for write, record that. */ + if ((flag & FWRITE) != 0) + clone->flags |= ACPI_EVF_WRITE; + +printf("%s opened clone %p\n", devtoname(dev), (struct apm_clone_data *)dev->si_drv1); return (0); } static int apmclose(struct cdev *dev, int flag, int fmt, d_thread_t *td) { + struct apm_clone_data *clone; + struct acpi_softc *acpi_sc; + + clone = dev->si_drv1; + acpi_sc = clone->acpi_sc; + + /* We are about to lose a reference so check if suspend should occur */ + if (acpi_sc->acpi_next_sstate != 0 && + clone->notify_status != APM_EV_ACKED) + acpi_AckSleepState(clone, 0); + + /* Remove this clone's data from the list and free it. */ + ACPI_LOCK(acpi); + STAILQ_REMOVE(&acpi_sc->apm_cdevs, clone, apm_clone_data, entries); + knlist_destroy(&clone->sel_read.si_note); +printf("%s closed clone %p\n", devtoname(dev), clone); + ACPI_UNLOCK(acpi); + free(clone, M_APMDEV); + /* XXX destroy_dev() needed */ return (0); } static int apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td) { - int error = 0; + int error; + struct apm_clone_data *clone; struct acpi_softc *acpi_sc; - struct apm_info info; + struct apm_info info; + struct apm_event_info *ev_info; apm_info_old_t aiop; - acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); + error = 0; + clone = dev->si_drv1; + acpi_sc = clone->acpi_sc; switch (cmd) { case APMIO_SUSPEND: if ((flag & FWRITE) == 0) return (EPERM); - if (apm_active) - acpi_SetSleepState(acpi_sc, acpi_sc->acpi_suspend_sx); +printf("apm ioctl suspend\n"); + if (acpi_sc->acpi_next_sstate == 0) + acpi_ReqSleepState(acpi_sc, acpi_sc->acpi_suspend_sx); else - error = EINVAL; + acpi_AckSleepState(clone, 0); break; case APMIO_STANDBY: if ((flag & FWRITE) == 0) return (EPERM); - if (apm_active) - acpi_SetSleepState(acpi_sc, acpi_sc->acpi_standby_sx); +printf("apm ioctl standby\n"); + if (acpi_sc->acpi_next_sstate == 0) + acpi_ReqSleepState(acpi_sc, acpi_sc->acpi_standby_sx); else - error = EINVAL; + acpi_AckSleepState(clone, 0); + break; + case APMIO_NEXTEVENT: + printf("apm nextevent start\n"); + ACPI_LOCK(acpi); + if (acpi_sc->acpi_next_sstate != 0 && clone->notify_status == + APM_EV_NONE) { + ev_info = (struct apm_event_info *)addr; + if (acpi_sc->acpi_next_sstate <= ACPI_STATE_S3) + ev_info->type = PMEV_STANDBYREQ; + else + ev_info->type = PMEV_SUSPENDREQ; + ev_info->index = 0; + clone->notify_status = APM_EV_NOTIFIED; + printf("apm event returning %d\n", ev_info->type); + } else + error = EAGAIN; + ACPI_UNLOCK(acpi); break; case APMIO_GETINFO_OLD: if (acpi_capm_get_info(&info)) @@ -300,24 +425,72 @@ static int apmpoll(struct cdev *dev, int events, d_thread_t *td) { + struct apm_clone_data *clone; + int revents; + + revents = 0; + ACPI_LOCK(acpi); + clone = dev->si_drv1; + if (clone->acpi_sc->acpi_next_sstate) + revents |= events & (POLLIN | POLLRDNORM); + else + selrecord(td, &clone->sel_read); + ACPI_UNLOCK(acpi); +printf("apm poll returning %x\n", revents); + return (revents); +} + +static int +apmkqfilter(struct cdev *dev, struct knote *kn) +{ + struct apm_clone_data *clone; + + ACPI_LOCK(acpi); + clone = dev->si_drv1; + kn->kn_hook = clone; + kn->kn_fop = &apm_readfiltops; + knlist_add(&clone->sel_read.si_note, kn, 0); + ACPI_UNLOCK(acpi); return (0); } static void -acpi_capm_init(struct acpi_softc *sc) +apmreadfiltdetach(struct knote *kn) +{ + struct apm_clone_data *clone; + + ACPI_LOCK(acpi); + clone = kn->kn_hook; + knlist_remove(&clone->sel_read.si_note, kn, 0); + ACPI_UNLOCK(acpi); +} + +static int +apmreadfilt(struct knote *kn, long hint) { - make_dev(&apm_cdevsw, 0, 0, 5, 0664, "apm"); + struct apm_clone_data *clone; + int sleeping; + + ACPI_LOCK(acpi); + clone = kn->kn_hook; + sleeping = clone->acpi_sc->acpi_next_sstate ? 1 : 0; + ACPI_UNLOCK(acpi); + return (sleeping); } int acpi_machdep_init(device_t dev) { - struct acpi_softc *sc; + struct acpi_softc *acpi_sc; - sc = devclass_get_softc(devclass_find("acpi"), 0); - acpi_capm_init(sc); + acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); - acpi_install_wakeup_handler(sc); + /* Create a clone for /dev/acpi also. */ + STAILQ_INIT(&acpi_sc->apm_cdevs); + acpi_sc->acpi_clone = apm_create_clone(acpi_sc->acpi_dev_t, acpi_sc); + clone_setup(&apm_clones); + EVENTHANDLER_REGISTER(dev_clone, apm_clone, 0, 1000); + acpi_install_wakeup_handler(acpi_sc); if (intr_model == ACPI_INTR_PIC) BUS_CONFIG_INTR(dev, AcpiGbl_FADT.SciInterrupt, @@ -325,8 +498,8 @@ else acpi_SetIntrModel(intr_model); - SYSCTL_ADD_UINT(&sc->acpi_sysctl_ctx, - SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, + SYSCTL_ADD_UINT(&acpi_sc->acpi_sysctl_ctx, + SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "reset_video", CTLFLAG_RW, &acpi_reset_video, 0, "Call the VESA reset BIOS vector on the resume path"); Index: usr.sbin/acpi/acpiconf/acpiconf.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/acpi/acpiconf/acpiconf.c,v retrieving revision 1.25 diff -u -r1.25 acpiconf.c --- usr.sbin/acpi/acpiconf/acpiconf.c 28 Jul 2005 19:41:52 -0000 1.25 +++ usr.sbin/acpi/acpiconf/acpiconf.c 17 Jun 2007 16:52:50 -0000 @@ -40,8 +40,6 @@ #include #define ACPIDEV "/dev/acpi" -#define RC_SUSPEND_PATH "/etc/rc.suspend" -#define RC_RESUME_PATH "/etc/rc.resume" static int acpifd; @@ -55,32 +53,27 @@ err(EX_OSFILE, ACPIDEV); } -static int +/* Prepare to sleep and then wait for the signal that sleeping can occur. */ +static void acpi_sleep(int sleep_type) { - char cmd[64]; int ret; + + /* Notify OS that we want to sleep. devd(8) gets this notify. */ + ret = ioctl(acpifd, ACPIIO_REQSLPSTATE, &sleep_type); + if (ret != 0) + err(EX_IOERR, "request sleep type (%d) failed", sleep_type); +} - /* Run the suspend rc script, if available. */ - if (access(RC_SUSPEND_PATH, X_OK) == 0) { - snprintf(cmd, sizeof(cmd), "%s acpi %d", RC_SUSPEND_PATH, - sleep_type); - system(cmd); - } - - ret = ioctl(acpifd, ACPIIO_SETSLPSTATE, &sleep_type); - - /* Run the resume rc script, if available. */ - if (access(RC_RESUME_PATH, X_OK) == 0) { - snprintf(cmd, sizeof(cmd), "%s acpi %d", RC_RESUME_PATH, - sleep_type); - system(cmd); - } +/* Ack or abort a pending suspend request. */ +static void +acpi_sleep_ack(int err_val) +{ + int ret; + ret = ioctl(acpifd, ACPIIO_ACKSLPSTATE, &err_val); if (ret != 0) - err(EX_IOERR, "sleep type (%d) failed", sleep_type); - - return (0); + err(EX_IOERR, "ack sleep type failed"); } /* should be a acpi define, but doesn't appear to be */ @@ -183,7 +176,7 @@ static void usage(const char* prog) { - printf("usage: %s [-h] [-i batt] [-s 1-5]\n", prog); + printf("usage: %s [-h] [-i batt] [-k ack] [-s 1-4]\n", prog); exit(0); } @@ -200,17 +193,20 @@ sleep_type = -1; acpi_init(); - while ((c = getopt(argc, argv, "hi:s:")) != -1) { + while ((c = getopt(argc, argv, "hi:k:s:")) != -1) { switch (c) { case 'i': acpi_battinfo(atoi(optarg)); break; + case 'k': + acpi_sleep_ack(atoi(optarg)); + break; case 's': if (optarg[0] == 'S') sleep_type = optarg[1] - '0'; else sleep_type = optarg[0] - '0'; - if (sleep_type < 0 || sleep_type > 5) + if (sleep_type < 1 || sleep_type > 4) errx(EX_USAGE, "invalid sleep type (%d)", sleep_type); break; @@ -223,10 +219,8 @@ argc -= optind; argv += optind; - if (sleep_type != -1) { - sleep(1); /* wait 1 sec. for key-release event */ + if (sleep_type != -1) acpi_sleep(sleep_type); - } close(acpifd); exit (0); --------------040100070106020900000700-- From owner-freebsd-acpi@FreeBSD.ORG Sun Jun 17 22:53:38 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD6ED16A468 for ; Sun, 17 Jun 2007 22:53:38 +0000 (UTC) (envelope-from mikej@rogers.com) Received: from smtp105.rog.mail.re2.yahoo.com (smtp105.rog.mail.re2.yahoo.com [206.190.36.83]) by mx1.freebsd.org (Postfix) with SMTP id 721E213C44B for ; Sun, 17 Jun 2007 22:53:38 +0000 (UTC) (envelope-from mikej@rogers.com) Received: (qmail 26369 invoked from network); 17 Jun 2007 22:26:58 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rogers.com; h=Received:X-YMail-OSG:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=kj0qv9LdAhHxDLmGZN2hwFJ7B3yr66HI/8wzrpPTfbxGT8kz1nXfHv+JY1e93Wyv9J3eKFCp0YSw/bNjyLY45ggJFknkJDhbR0eWSsxDoy0movfciRN66CgvrRNwVNkNnwroyvUvw0bvbXgZSXYt3klyKJma8cGdYSy3a/YhRgA= ; Received: from unknown (HELO ?172.16.0.165?) (mikej@rogers.com@99.244.15.156 with plain) by smtp105.rog.mail.re2.yahoo.com with SMTP; 17 Jun 2007 22:26:58 -0000 X-YMail-OSG: ah_WuN4VM1lNnH_mASljvU14l94sZIVi5NxxrRM0MGz6GMuG6EnSe9daQPajLFhqKA-- Message-ID: <4675B49F.1020107@rogers.com> Date: Sun, 17 Jun 2007 18:24:31 -0400 From: Mike Jakubik User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: acpi@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Buildkernel error in acpi_hpet.c X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2007 22:53:38 -0000 cc -O2 -fno-strict-aliasing -pipe -march=prescott -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I- -I/usr/src/sys/modules/acpi/acpi/../../../contrib/dev/acpica -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/src/sys/SPAMTOASTER/opt_global.h -I. -I@ -I@/contrib/altq -I@/../include -finline-limit=8000 -fno-common -I/usr/obj/usr/src/sys/SPAMTOASTER -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -ffreestanding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions -std=c99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -c /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_ec.c cc -O2 -fno-strict-aliasing -pipe -march=prescott -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I- -I/usr/src/sys/modules/acpi/acpi/../../../contrib/dev/acpica -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/src/sys/SPAMTOASTER/opt_global.h -I. -I@ -I@/contrib/altq -I@/../include -finline-limit=8000 -fno-common -I/usr/obj/usr/src/sys/SPAMTOASTER -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -ffreestanding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions -std=c99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -c /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c: In function `acpi_hpet_table_probe': /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:89: error: `ACPI_TABLE_HPET' undeclared (first use in this function) /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:89: error: (Each undeclared identifier is reported only once /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:89: error: for each function it appears in.) /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:89: error: `hpet' undeclared (first use in this function) /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:96: error: `ACPI_SIG_HPET' undeclared (first use in this function) /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:96: warning: passing arg 3 of `AcpiGetTable' from incompatible pointer type /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:104: error: syntax error before ')' token *** Error code 1 Stop in /usr/src/sys/modules/acpi/acpi. *** Error code 1 From owner-freebsd-acpi@FreeBSD.ORG Mon Jun 18 03:18:13 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8420116A46D for ; Mon, 18 Jun 2007 03:18:13 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 6B38D13C465 for ; Mon, 18 Jun 2007 03:18:13 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 93511 invoked from network); 18 Jun 2007 00:30:24 -0000 Received: from ppp-71-139-42-13.dsl.snfc21.pacbell.net (HELO ?10.0.0.15?) (nate-mail@71.139.42.13) by root.org with ESMTPA; 18 Jun 2007 00:30:24 -0000 Message-ID: <4675D214.4030901@root.org> Date: Sun, 17 Jun 2007 17:30:12 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.0 (X11/20070511) MIME-Version: 1.0 To: Mike Jakubik References: <4675B49F.1020107@rogers.com> In-Reply-To: <4675B49F.1020107@rogers.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: acpi@freebsd.org Subject: Re: Buildkernel error in acpi_hpet.c X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2007 03:18:13 -0000 Mike Jakubik wrote: > cc -O2 -fno-strict-aliasing -pipe -march=prescott -Werror -D_KERNEL > -DKLD_MODULE -nostdinc -I- > -I/usr/src/sys/modules/acpi/acpi/../../../contrib/dev/acpica > -DHAVE_KERNEL_OPTION_HEADERS -include > /usr/obj/usr/src/sys/SPAMTOASTER/opt_global.h -I. -I@ -I@/contrib/altq > -I@/../include -finline-limit=8000 -fno-common > -I/usr/obj/usr/src/sys/SPAMTOASTER -mno-align-long-strings > -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 > -ffreestanding -Wall -Wredundant-decls -Wnested-externs > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline > -Wcast-qual -fformat-extensions -std=c99 -Wsystem-headers -Werror -Wall > -Wno-format-y2k -Wno-uninitialized -c > /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_ec.c > cc -O2 -fno-strict-aliasing -pipe -march=prescott -Werror -D_KERNEL > -DKLD_MODULE -nostdinc -I- > -I/usr/src/sys/modules/acpi/acpi/../../../contrib/dev/acpica > -DHAVE_KERNEL_OPTION_HEADERS -include > /usr/obj/usr/src/sys/SPAMTOASTER/opt_global.h -I. -I@ -I@/contrib/altq > -I@/../include -finline-limit=8000 -fno-common > -I/usr/obj/usr/src/sys/SPAMTOASTER -mno-align-long-strings > -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 > -ffreestanding -Wall -Wredundant-decls -Wnested-externs > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline > -Wcast-qual -fformat-extensions -std=c99 -Wsystem-headers -Werror -Wall > -Wno-format-y2k -Wno-uninitialized -c > /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c > /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c: In > function `acpi_hpet_table_probe': > /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:89: > error: `ACPI_TABLE_HPET' undeclared (first use in this function) > /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:89: > error: (Each undeclared identifier is reported only once > /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:89: > error: for each function it appears in.) > /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:89: > error: `hpet' undeclared (first use in this function) > /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:96: > error: `ACPI_SIG_HPET' undeclared (first use in this function) > /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:96: > warning: passing arg 3 of `AcpiGetTable' from incompatible pointer type > /usr/src/sys/modules/acpi/acpi/../../../dev/acpica/acpi_hpet.c:104: > error: syntax error before ')' token > *** Error code 1 > > Stop in /usr/src/sys/modules/acpi/acpi. > *** Error code 1 Fixed. -- Nate From owner-freebsd-acpi@FreeBSD.ORG Mon Jun 18 11:08:09 2007 Return-Path: X-Original-To: freebsd-acpi@FreeBSD.org Delivered-To: freebsd-acpi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EDDD616A473 for ; Mon, 18 Jun 2007 11:08:09 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id C241113C45D for ; Mon, 18 Jun 2007 11:08:09 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5IB89JB017501 for ; Mon, 18 Jun 2007 11:08:09 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5IB88p4017497 for freebsd-acpi@FreeBSD.org; Mon, 18 Jun 2007 11:08:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 18 Jun 2007 11:08:08 GMT Message-Id: <200706181108.l5IB88p4017497@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-acpi@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2007 11:08:10 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o i386/54756 acpi ACPI suspend/resume problem on CF-W2 laptop o i386/55661 acpi ACPI suspend/resume problem on ARMADA M700 o kern/55822 acpi No ACPI power off with SMP kernel o kern/56024 acpi ACPI suspend drains battery while in S3 o i386/64002 acpi acpi problem o i386/67273 acpi [hang] system hangs with acpi and Xfree o i386/72566 acpi ACPI, FreeBSD disables fan on Compaq Armada 1750 s i386/79080 acpi acpi thermal changes freezes HP nx6110 o i386/79081 acpi ACPI suspend/resume not working on HP nx6110 s i386/91748 acpi acpi problem on Acer TravelMare 4652LMi (nvidia panic, o kern/102252 acpi acpi thermal does not work on Abit AW8D (intel 975) o kern/104625 acpi ACPI on ASUS A8N-32 SLI/ASUS P4P800 does not show ther o kern/106924 acpi [acpi] ACPI resume returns g_vfs_done() errors and ker 13 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/67309 acpi zzz reboot computer (ACPI S3) o i386/69750 acpi Boot without ACPI failed on ASUS L5 o i386/72179 acpi [acpi] [patch] Inconsistent apm(8) output regarding th o kern/73823 acpi [feature request] acpi / power-on by timer support o kern/76950 acpi ACPI wrongly blacklisted on Micron ClientPro 766Xi sys o kern/89411 acpi [acpi] acpiconf bug o kern/97383 acpi Volume buttons on IBM Thinkpad crash system with ACPI o i386/97468 acpi [acpi] ACPI on ASUS A7V hangs on shutdown -p (power of o kern/98171 acpi [acpi] ACPI 1304 / 0501 errors on Acer 5024WLMi Laptop o kern/103365 acpi [acpi] acpi poweroff doesn't work with geli device att o kern/105537 acpi [acpi] problems in acpi on HP Compaq nc6320 o kern/108017 acpi [acpi]: Acer Aspire 5600 o kern/108488 acpi [acpi] ACPI-1304: *** Error: Method execution failed o kern/108581 acpi [sysctl] sysctl: hw.acpi.cpu.cx_lowest: Invalid argume o kern/108695 acpi [acpi]: Fatal trap 9: general protection fault when in o kern/111591 acpi [acpi] dev.acpi_ibm.0.events returns I/O error (regres o kern/112544 acpi [acpi] [patch] Add High Precision Event Timer Driver f 17 problems total. From owner-freebsd-acpi@FreeBSD.ORG Tue Jun 19 10:53:14 2007 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 404E916A468 for ; Tue, 19 Jun 2007 10:53:14 +0000 (UTC) (envelope-from karl@krothenhoefer.de) Received: from mail-in-04.arcor-online.net (mail-in-04.arcor-online.net [151.189.21.44]) by mx1.freebsd.org (Postfix) with ESMTP id CB0BE13C43E for ; Tue, 19 Jun 2007 10:53:13 +0000 (UTC) (envelope-from karl@krothenhoefer.de) Received: from mail-in-03-z2.arcor-online.net (mail-in-03-z2.arcor-online.net [151.189.8.15]) by mail-in-04.arcor-online.net (Postfix) with ESMTP id CDE38127FBF for ; Tue, 19 Jun 2007 10:13:55 +0200 (CEST) Received: from mail-in-03.arcor-online.net (mail-in-03.arcor-online.net [151.189.21.43]) by mail-in-03-z2.arcor-online.net (Postfix) with ESMTP id B81A82D3B36 for ; Tue, 19 Jun 2007 10:13:55 +0200 (CEST) Received: from MedionL (dslb-084-057-157-035.pools.arcor-ip.net [84.57.157.35]) (Authenticated sender: karl.rothenhoefer@arcor.de) by mail-in-03.arcor-online.net (Postfix) with ESMTP id BB60A275E02 for ; Tue, 19 Jun 2007 10:13:53 +0200 (CEST) From: =?iso-8859-1?Q?Karl_Rothenh=F6fer?= To: Date: Tue, 19 Jun 2007 10:13:52 +0200 Message-ID: <000401c7b249$c659a930$72c9a8c0@MedionL> MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AceyScWrU6Xm054JSTK9rK7q71vb/g== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Mailman-Approved-At: Tue, 19 Jun 2007 10:56:19 +0000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Wake-on-LAN questions X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: karl@krothenhoefer.de List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2007 10:53:14 -0000 Are you sure, that you have the WOL cable plugged in. This has to interconnect the network adapter and the motherboard. Karl From owner-freebsd-acpi@FreeBSD.ORG Tue Jun 19 11:39:51 2007 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9EBAE16A400 for ; Tue, 19 Jun 2007 11:39:51 +0000 (UTC) (envelope-from olivier@aixmarseille.com) Received: from anchor.aixmarseille.com (anchor.aixmarseille.com [81.201.184.34]) by mx1.freebsd.org (Postfix) with ESMTP id 6E9CE13C46A for ; Tue, 19 Jun 2007 11:39:51 +0000 (UTC) (envelope-from olivier@aixmarseille.com) Received: from [81.80.156.33] (helo=[192.168.13.13]) by anchor.aixmarseille.com with esmtpsa (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.50) id 1I0bbK-0001a5-VR for freebsd-acpi@freebsd.org; Tue, 19 Jun 2007 11:10:23 +0000 From: Olivier Fauchon To: freebsd-acpi@freebsd.org Content-Type: text/plain Date: Tue, 19 Jun 2007 13:10:19 +0200 Message-Id: <1182251419.985.22.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Subject: Help required for HP NC6000 Suspend on Ram Troubleshooting X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2007 11:39:51 -0000 Hi, Suspend on RAM is not working on my HP NC 6000 Laptop. When using acpiconf -s3, the LCD goes Black, but the green power LED is still on. At this point, the laptop is stuck, and I have to hold down Power button 10s+ many times to stop and restart it. I followed all the indications on various websites to troubleshoot this: - Compile kernel as modules, so I can unload most of them before S3. - Fix DSDT - Define hw.acpi.osname - Turn ACPI debug ON on a serial console (As LCD is black at S3) So, you can find here http://www.aixmarseille.com/pub/acpi_nc6000/ - ACPI debug informations during acpiconf -s3 (s3_logs.txt) - DSDT & ASL - lspci - sysctl My first goal is to find out why my laptop don't go in S3 Mode properly (with the LED indicating the laptop is sleeping). Any help welcome. Thx From owner-freebsd-acpi@FreeBSD.ORG Tue Jun 19 17:45:53 2007 Return-Path: X-Original-To: freebsd-acpi@FreeBSD.org Delivered-To: freebsd-acpi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F21816A468 for ; Tue, 19 Jun 2007 17:45:53 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from sakura.ninth-nine.com (sakura.ninth-nine.com [219.127.74.120]) by mx1.freebsd.org (Postfix) with ESMTP id 9DDC613C487 for ; Tue, 19 Jun 2007 17:45:45 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com (nadesico.ninth-nine.com [219.127.74.122]) by sakura.ninth-nine.com (8.14.1/8.14.1/NinthNine) with SMTP id l5JHVpxs031107; Wed, 20 Jun 2007 02:31:51 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Wed, 20 Jun 2007 02:31:51 +0900 From: Norikatsu Shigemura To: freebsd-acpi@FreeBSD.org Message-Id: <20070620023151.c0f3b961.nork@FreeBSD.org> X-Mailer: Sylpheed 2.4.2 (GTK+ 2.10.13; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Wed__20_Jun_2007_02_31_51_+0900_KZTwyrG_5maCpUc3" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (sakura.ninth-nine.com [219.127.74.121]); Wed, 20 Jun 2007 02:31:51 +0900 (JST) X-Mailman-Approved-At: Tue, 19 Jun 2007 18:04:20 +0000 Cc: Subject: How do I use HPET? X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2007 17:45:53 -0000 This is a multi-part message in MIME format. --Multipart=_Wed__20_Jun_2007_02_31_51_+0900_KZTwyrG_5maCpUc3 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi. I'm using Panasonic Let's Note (Toughbook) CF-R4 with FreeBSD 6-stable. How do I use HPET? I can't use HPET:-(. Anyone, do you have any idea? --Multipart=_Wed__20_Jun_2007_02_31_51_+0900_KZTwyrG_5maCpUc3 Content-Type: text/plain; name="dmesg.txt" Content-Disposition: attachment; filename="dmesg.txt" Content-Transfer-Encoding: 7bit Copyright (c) 1992-2007 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 6.2-STABLE #65: Tue Jun 19 02:50:41 JST 2007 nork@melfina.ninth-nine.com:/usr/obj/usr/src/sys/MELFINA WARNING: Network stack Giant-free, but aio requires Giant. Consider adding 'options NET_WITH_GIANT' or setting debug.mpsafenet=0 Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Intel(R) Pentium(R) M processor 1.20GHz (1197.01-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x6d8 Stepping = 8 Features=0xafe9fbff Features2=0x180 AMD Features=0x100000 real memory = 1064173568 (1014 MB) avail memory = 1032351744 (984 MB) ACPI APIC Table: ioapic0: Changing APIC ID to 1 ioapic0 irqs 0-23 on motherboard kbd1 at kbdmux0 kqemu version 0x00010300 kqemu: KQEMU installed, max_locked_mem=515248kB. ichwd module loaded acpi0: on motherboard acpi0: Power Button (fixed) Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0 acpi_ec0: port 0x62,0x66 on acpi0 cpu0: on acpi0 est0: on cpu0 p4tcc0: on cpu0 acpi_lid0: on acpi0 battery0: on acpi0 acpi_acad0: on acpi0 acpi_button0: on acpi0 acpi_panasonic0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 agp0: port 0x1800-0x1807 mem 0xb0080000-0xb00fffff,0xc0000000-0xcfffffff,0xb0000000-0xb003ffff irq 16 at device 2.0 on pci0 agp0: detected 7932k stolen memory agp0: aperture size is 256M drmsub0: : (child of agp_i810.c) on agp0 info: [drm] AGP at 0xb0080000 0MB info: [drm] Initialized i915 1.5.0 20060119 pci0: at device 2.1 (no driver attached) uhci0: port 0x1820-0x183f irq 23 at device 29.0 on pci0 uhci0: [GIANT-LOCKED] usb0: on uhci0 usb0: USB revision 1.0 uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered ehci0: mem 0xb0040000-0xb00403ff irq 23 at device 29.7 on pci0 ehci0: [GIANT-LOCKED] usb1: EHCI version 1.0 usb1: companion controller, 2 ports each: usb0 usb1: on ehci0 usb1: USB revision 2.0 uhub1: Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered pcib1: at device 30.0 on pci0 pci6: on pcib1 rl0: port 0x3000-0x30ff mem 0xb0100000-0xb01000ff irq 19 at device 1.0 on pci6 miibus0: on rl0 rlphy0: on miibus0 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto rl0: Ethernet address: 00:0b:97:33:1c:30 iwi0: mem 0xb0101000-0xb0101fff irq 21 at device 4.0 on pci6 iwi0: Ethernet address: 00:16:6f:33:41:34 cbb0: mem 0xb0102000-0xb0102fff irq 22 at device 5.0 on pci6 cardbus0: on cbb0 pccard0: <16-bit PCCard bus> on cbb0 pci6: at device 5.1 (no driver attached) pcm0: port 0x1c00-0x1cff,0x1840-0x187f mem 0xb0040800-0xb00409ff,0xb0040400-0xb00404ff irq 17 at device 30.2 on pci0 pcm0: isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x1810-0x181f at device 31.1 on pci0 ata0: on atapci0 ata1: on atapci0 ichsmb0: port 0x18a0-0x18bf irq 19 at device 31.3 on pci0 ichsmb0: [GIANT-LOCKED] smbus0: on ichsmb0 smb0: on smbus0 acpi_tz0: on acpi0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] psm0: flags 0x2000 irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: model Synaptics Touchpad, device ID 0 pmtimer0 on isa0 ichwd0: on isa0 ichwd0: Intel ICH6M watchdog timer TCO version 2 orm0: at iomem 0xcf800-0xd07ff,0xdc000-0xdffff,0xe0000-0xeffff on isa0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Timecounter "TSC" frequency 1197010942 Hz quality 800 Timecounters tick every 1.000 msec Fast IPsec: Initialized Security Association Processing. ad0: 54156MB at ata0-master UDMA100 Trying to mount root from ufs:/dev/ad0s2a ipfw2 (+ipv6) initialized, divert loadable, rule-based forwarding disabled, default to accept, logging unlimited tap0: Ethernet address: 00:bd:51:27:00:00 --Multipart=_Wed__20_Jun_2007_02_31_51_+0900_KZTwyrG_5maCpUc3 Content-Type: text/plain; name="devinfo-rv.txt" Content-Disposition: attachment; filename="devinfo-rv.txt" Content-Transfer-Encoding: 7bit nexus0 legacy0 npx0 acpi0 Interrupt request lines: 0x9 I/O ports: 0x63 0x65 0x67 0x80 0x92 0xb2-0xb3 0x800-0x80f 0x900-0x91f 0x92c-0x97f 0x1000-0x107f 0x1180-0x11bf 0xfe00-0xfe01 I/O memory addresses: 0xcf200-0xcf7ff 0xd0800-0xd3fff 0xe0000000-0xefffffff 0xf0000000-0xf0003fff 0xf0004000-0xf0004fff 0xf0005000-0xf0005fff 0xf0008000-0xf000bfff 0xfed20000-0xfed8ffff cpu0 pnpinfo _HID=none _UID=0 at handle=\_PR_.CPU0 ACPI I/O ports: 0x1014 0x1015 est0 p4tcc0 acpi_perf0 acpi_throttle0 cpufreq0 unknown pnpinfo _HID=none _UID=0 at handle=\_PR_.CPU1 acpi_lid0 pnpinfo _HID=PNP0C0D _UID=0 at handle=\_SB_.LID_ battery0 pnpinfo _HID=PNP0C0A _UID=0 at handle=\_SB_.BATA acpi_acad0 pnpinfo _HID=ACPI0003 _UID=0 at handle=\_SB_.AC__ acpi_button0 pnpinfo _HID=PNP0C0C _UID=0 at handle=\_SB_.PWRB acpi_panasonic0 pnpinfo _HID=MAT0019 _UID=0 at handle=\_SB_.HKEY pcib0 pnpinfo _HID=PNP0A08 _UID=0 at handle=\_SB_.PCI0 pci0 hostb0 pnpinfo vendor=0x8086 device=0x2590 subvendor=0x10f7 subdevice=0x8338 class=0x060000 at slot=0 function=0 agp0 pnpinfo vendor=0x8086 device=0x2592 subvendor=0x10f7 subdevice=0x8338 class=0x030000 at slot=2 function=0 handle=\_SB_.PCI0.GFX0 Interrupt request lines: 0x10 I/O ports: 0x1800-0x1807 I/O memory addresses: 0xb0000000-0xb003ffff 0xb0080000-0xb00fffff 0xc0000000-0xcfffffff drmsub0 unknown pnpinfo vendor=0x8086 device=0x2792 subvendor=0x10f7 subdevice=0x8338 class=0x038000 at slot=2 function=1 uhci0 pnpinfo vendor=0x8086 device=0x2658 subvendor=0x10f7 subdevice=0x8338 class=0x0c0300 at slot=29 function=0 handle=\_SB_.PCI0.USB1 Interrupt request lines: 0x17 I/O ports: 0x1820-0x183f usb0 uhub0 ehci0 pnpinfo vendor=0x8086 device=0x265c subvendor=0x10f7 subdevice=0x8338 class=0x0c0320 at slot=29 function=7 handle=\_SB_.PCI0.EHCI I/O memory addresses: 0xb0040000-0xb00403ff usb1 uhub1 pcib1 pnpinfo vendor=0x8086 device=0x2448 subvendor=0x10f7 subdevice=0x8338 class=0x060401 at slot=30 function=0 handle=\_SB_.PCI0.PCIB pci6 rl0 pnpinfo vendor=0x10ec device=0x8139 subvendor=0x10f7 subdevice=0x8338 class=0x020000 at slot=1 function=0 handle=\_SB_.PCI0.PCIB.LAN_ Interrupt request lines: 0x13 I/O ports: 0x3000-0x30ff I/O memory addresses: 0xb0100000-0xb01000ff miibus0 rlphy0 pnpinfo oui=0x0 model=0x0 rev=0x0 at phyno=0 iwi0 pnpinfo vendor=0x8086 device=0x4223 subvendor=0x8086 subdevice=0x1002 class=0x028000 at slot=4 function=0 Interrupt request lines: 0x15 I/O memory addresses: 0xb0101000-0xb0101fff cbb0 pnpinfo vendor=0x1180 device=0x0476 subvendor=0x10f7 subdevice=0x8338 class=0x060700 at slot=5 function=0 handle=\_SB_.PCI0.PCIB.CDB1 Interrupt request lines: 0x16 I/O memory addresses: 0xb0102000-0xb0102fff cardbus0 pccard0 unknown pnpinfo vendor=0x1180 device=0x0822 subvendor=0x10f7 subdevice=0x8338 class=0x080500 at slot=5 function=1 I/O memory addresses: 0xb0100400-0xb01004ff pcm0 pnpinfo vendor=0x8086 device=0x266e subvendor=0x10f7 subdevice=0x834c class=0x040100 at slot=30 function=2 handle=\_SB_.PCI0.AUD0 Interrupt request lines: 0x11 I/O ports: 0x1840-0x187f 0x1c00-0x1cff I/O memory addresses: 0xb0040400-0xb00404ff 0xb0040800-0xb00409ff isab0 pnpinfo vendor=0x8086 device=0x2641 subvendor=0x10f7 subdevice=0x8338 class=0x060100 at slot=31 function=0 handle=\_SB_.PCI0.LPCB I/O memory addresses: 0xfed1c000-0xfed1c003 isa0 pmtimer0 sc0 vga0 I/O ports: 0x3c0-0x3df I/O memory addresses: 0xa0000-0xbffff adv0 aha0 aic0 bt0 cs0 ed0 fdc0 fe0 ie0 lnc0 ppc0 sio0 sio1 sio2 sio3 sn0 vt0 orm0 I/O memory addresses: 0xcf800-0xd07ff 0xdc000-0xdffff 0xe0000-0xeffff ichwd0 ACPI I/O ports: 0x1030-0x1037 0x1060-0x1069 atapci0 pnpinfo vendor=0x8086 device=0x266f subvendor=0x10f7 subdevice=0x8338 class=0x01018a at slot=31 function=1 handle=\_SB_.PCI0.PATA I/O ports: 0x170-0x177 0x1f0-0x1f7 0x376 0x3f6 0x1810-0x181f ata0 Interrupt request lines: 0xe ad0 subdisk0 ata1 Interrupt request lines: 0xf ichsmb0 pnpinfo vendor=0x8086 device=0x266a subvendor=0x10f7 subdevice=0x8338 class=0x0c0500 at slot=31 function=3 handle=\_SB_.PCI0.SBUS I/O ports: 0x18a0-0x18bf smbus0 smb0 acpi_sysresource0 pnpinfo _HID=PNP0C02 _UID=4096 at handle=\_SB_.PCI0.OPRM unknown pnpinfo _HID=none _UID=0 at handle=\_SB_.PCI0.GFX0.CRT1 unknown pnpinfo _HID=none _UID=0 at handle=\_SB_.PCI0.GFX0.LCD1 unknown pnpinfo _HID=none _UID=0 at handle=\_SB_.PCI0.USB2 unknown pnpinfo _HID=none _UID=0 at handle=\_SB_.PCI0.USB3 unknown pnpinfo _HID=none _UID=0 at handle=\_SB_.PCI0.USB4 unknown pnpinfo _HID=none _UID=0 at handle=\_SB_.PCI0.MODM acpi_sysresource1 pnpinfo _HID=PNP0C02 _UID=31 at handle=\_SB_.PCI0.LPCB.MBRD atdma0 pnpinfo _HID=PNP0200 _UID=0 at handle=\_SB_.PCI0.LPCB.DMAC unknown pnpinfo _HID=INT0800 _UID=0 at handle=\_SB_.PCI0.LPCB.FWHD unknown pnpinfo _HID=PNP0103 _UID=0 at handle=\_SB_.PCI0.LPCB.HPET atpic0 pnpinfo _HID=PNP0000 _UID=0 at handle=\_SB_.PCI0.LPCB.IPIC npxisa0 pnpinfo _HID=PNP0C04 _UID=0 at handle=\_SB_.PCI0.LPCB.MATH acpi_sysresource2 pnpinfo _HID=PNP0C02 _UID=1 at handle=\_SB_.PCI0.LPCB.MBD0 unknown pnpinfo _HID=PNP0C02 _UID=2 at handle=\_SB_.PCI0.LPCB.MBD1 attimer0 pnpinfo _HID=PNP0B00 _UID=0 at handle=\_SB_.PCI0.LPCB.RTC_ attimer1 pnpinfo _HID=PNP0100 _UID=0 at handle=\_SB_.PCI0.LPCB.TIMR unknown pnpinfo _HID=PNP0800 _UID=0 at handle=\_SB_.PCI0.LPCB.SPKR unknown pnpinfo _HID=IFX0101 _UID=1 at handle=\_SB_.PCI0.LPCB.TPM_ acpi_ec0 pnpinfo _HID=PNP0C09 _UID=0 at handle=\_SB_.PCI0.LPCB.EC0_ I/O ports: 0x62 0x66 unknown pnpinfo _HID=PNP0303 _UID=0 at handle=\_SB_.PCI0.LPCB.K101 atkbdc0 pnpinfo _HID=PNP0320 _UID=0 at handle=\_SB_.PCI0.LPCB.K106 I/O ports: 0x60 0x64 atkbd0 Interrupt request lines: 0x1 psm0 Interrupt request lines: 0xc unknown pnpinfo _HID=PNP0F13 _UID=0 at handle=\_SB_.PCI0.LPCB.MOUS psmcpnp0 pnpinfo _HID=SYN0002 _UID=0 at handle=\_SB_.PCI0.LPCB.MOU3 pci_link0 pnpinfo _HID=PNP0C0F _UID=1 at handle=\_SB_.PCI0.LPCB.LNKA pci_link1 pnpinfo _HID=PNP0C0F _UID=2 at handle=\_SB_.PCI0.LPCB.LNKB pci_link2 pnpinfo _HID=PNP0C0F _UID=3 at handle=\_SB_.PCI0.LPCB.LNKC pci_link3 pnpinfo _HID=PNP0C0F _UID=4 at handle=\_SB_.PCI0.LPCB.LNKD pci_link4 pnpinfo _HID=PNP0C0F _UID=5 at handle=\_SB_.PCI0.LPCB.LNKE pci_link5 pnpinfo _HID=PNP0C0F _UID=6 at handle=\_SB_.PCI0.LPCB.LNKF pci_link6 pnpinfo _HID=PNP0C0F _UID=7 at handle=\_SB_.PCI0.LPCB.LNKG pci_link7 pnpinfo _HID=PNP0C0F _UID=8 at handle=\_SB_.PCI0.LPCB.LNKH unknown pnpinfo _HID=none _UID=0 at handle=\_SB_.PCI0.PATA.PRID unknown pnpinfo _HID=none _UID=0 at handle=\_SB_.PCI0.PATA.PRID.P_D0 unknown pnpinfo _HID=none _UID=0 at handle=\_SB_.PCI0.PATA.PRID.P_D1 acpi_tz0 pnpinfo _HID=none _UID=0 at handle=\_TZ_.TZC_ acpi_timer0 pnpinfo unknown at unknown ACPI I/O ports: 0x1008-0x100b --Multipart=_Wed__20_Jun_2007_02_31_51_+0900_KZTwyrG_5maCpUc3 Content-Type: text/plain; name="CF-R4.asl" Content-Disposition: attachment; filename="CF-R4.asl" Content-Transfer-Encoding: base64 LyoNCiAgUlNEIFBUUjogT0VNPVBUTFRELCBBQ1BJX1Jldj0xLjB4ICgwKQ0KCVJTRFQ9MHgzZjZl MzBhYSwgY2tzdW09MTc4DQogKi8NCi8qDQogIFJTRFQ6IExlbmd0aD02NCwgUmV2aXNpb249MSwg Q2hlY2tzdW09MjQ1LA0KCU9FTUlEPVBUTFRELCBPRU0gVGFibGUgSUQ9ICBSU0RULCBPRU0gUmV2 aXNpb249MHg2MDQwMDAwLA0KCUNyZWF0b3IgSUQ9IExUUCwgQ3JlYXRvciBSZXZpc2lvbj0weDAN CglFbnRyaWVzPXsgMHgzZjZlN2U3OCwgMHgzZjZlN2VmYywgMHgzZjZlN2ZkOCwgMHgzZjZlN2Y5 YywgMHgzZjZlMzRlNywgMHgzZjZlMzMwOSwgMHgzZjZlMzBlYSB9DQogKi8NCi8qDQogIEZBQ1A6 IExlbmd0aD0xMzIsIFJldmlzaW9uPTIsIENoZWNrc3VtPTIxMCwNCglPRU1JRD1NQVRCSU8sIE9F TSBUYWJsZSBJRD1DRlI0LTMsIE9FTSBSZXZpc2lvbj0weDYwNDAwMDAsDQoJQ3JlYXRvciBJRD1N RUksIENyZWF0b3IgUmV2aXNpb249MHgxDQogCUZBQ1M9MHgzZjZlOGZjMCwgRFNEVD0weDNmNmUz OTMwDQoJSU5UX01PREVMPVBJQw0KCVByZWZlcnJlZF9QTV9Qcm9maWxlPVVuc3BlY2lmaWVkICgw KQ0KCVNDSV9JTlQ9OQ0KCVNNSV9DTUQ9MHhiMiwgQUNQSV9FTkFCTEU9MHhmMCwgQUNQSV9ESVNB QkxFPTB4ZjEsIFM0QklPU19SRVE9MHgwDQoJUFNUQVRFX0NOVD0weDgwDQoJUE0xYV9FVlRfQkxL PTB4MTAwMC0weDEwMDMNCglQTTFhX0NOVF9CTEs9MHgxMDA0LTB4MTAwNQ0KCVBNMl9DTlRfQkxL PTB4MTAyMC0weDEwMjANCglQTV9UTVJfQkxLPTB4MTAwOC0weDEwMGINCglHUEUwX0JMSz0weDEw MjgtMHgxMDJmDQoJQ1NUX0NOVD0weDg1DQoJUF9MVkwyX0xBVD0xIHVzLCBQX0xWTDNfTEFUPTg1 IHVzDQoJRkxVU0hfU0laRT0wLCBGTFVTSF9TVFJJREU9MA0KCURVVFlfT0ZGU0VUPTEsIERVVFlf V0lEVEg9Mw0KCURBWV9BTFJNPTEzLCBNT05fQUxSTT0wLCBDRU5UVVJZPTUwDQoJSUFQQ19CT09U X0FSQ0g9ezgwNDJ9DQoJRmxhZ3M9e1dCSU5WRCxQUk9DX0MxLFNMUF9CVVRUT04sUlRDX1M0LFJF U0VUX1JFR30NCglSRVNFVF9SRUc9MHhiMjowWzhdIChJTyksIFJFU0VUX1ZBTFVFPTB4YjQNCiAq Lw0KLyoNCiAgRkFDUzoJTGVuZ3RoPTY0LCBId1NpZz0weDAwMDAwMDAwLCBGaXJtX1dha2VfVmVj PTB4MDAwMDAwMDANCglHbG9iYWxfTG9jaz0NCglGbGFncz0NCglWZXJzaW9uPTANCiAqLw0KLyoN CiAgRFNEVDogTGVuZ3RoPTE3NzM2LCBSZXZpc2lvbj0xLCBDaGVja3N1bT0xNDIsDQoJT0VNSUQ9 TUFUQklPLCBPRU0gVGFibGUgSUQ9Q0ZSNC0zLCBPRU0gUmV2aXNpb249MHg2MDQwMDAwLA0KCUNy ZWF0b3IgSUQ9TVNGVCwgQ3JlYXRvciBSZXZpc2lvbj0weDEwMDAwMGUNCiAqLw0KLyoNCiAgQVBJ QzogTGVuZ3RoPTk4LCBSZXZpc2lvbj0xLCBDaGVja3N1bT04LA0KCU9FTUlEPU1BVEJJTywgT0VN IFRhYmxlIElEPUNGUjQtMywgT0VNIFJldmlzaW9uPTB4NjA0MDAwMCwNCglDcmVhdG9yIElEPU1F SSwgQ3JlYXRvciBSZXZpc2lvbj0weDENCglMb2NhbCBBUElDIEFERFI9MHhmZWUwMDAwMA0KCUZs YWdzPXtQQy1BVH0NCg0KCVR5cGU9TG9jYWwgQVBJQw0KCUFDUEkgQ1BVPTANCglGbGFncz17RU5B QkxFRH0NCglBUElDIElEPTANCg0KCVR5cGU9TG9jYWwgQVBJQw0KCUFDUEkgQ1BVPTENCglGbGFn cz17RElTQUJMRUR9DQoJQVBJQyBJRD0xDQoNCglUeXBlPUlPIEFQSUMNCglBUElDIElEPTENCglJ TlQgQkFTRT0wDQoJQUREUj0weDAwMDAwMDAwZmVjMDAwMDANCg0KCVR5cGU9SU5UIE92ZXJyaWRl DQoJQlVTPTANCglJUlE9MA0KCUlOVFI9Mg0KCUZsYWdzPXtQb2xhcml0eT1jb25mb3JtaW5nLCBU cmlnZ2VyPWNvbmZvcm1pbmd9DQoNCglUeXBlPUlOVCBPdmVycmlkZQ0KCUJVUz0wDQoJSVJRPTkN CglJTlRSPTkNCglGbGFncz17UG9sYXJpdHk9YWN0aXZlLWhpLCBUcmlnZ2VyPWxldmVsfQ0KDQoJ VHlwZT1Mb2NhbCBOTUkNCglBQ1BJIENQVT0wDQoJTElOVCBQaW49MQ0KCUZsYWdzPXtQb2xhcml0 eT1hY3RpdmUtaGksIFRyaWdnZXI9ZWRnZX0NCiAqLw0KLyoNCiAgQk9PVDogTGVuZ3RoPTQwLCBS ZXZpc2lvbj0xLCBDaGVja3N1bT0xNTQsDQoJT0VNSUQ9UFRMVEQsIE9FTSBUYWJsZSBJRD0kU0JG VEJMJCwgT0VNIFJldmlzaW9uPTB4NjA0MDAwMCwNCglDcmVhdG9yIElEPSBMVFAsIENyZWF0b3Ig UmV2aXNpb249MHgxDQogKi8NCi8qDQogIE1DRkc6IExlbmd0aD02MCwgUmV2aXNpb249MSwgQ2hl Y2tzdW09ODYsDQoJT0VNSUQ9TUFUQklPLCBPRU0gVGFibGUgSUQ9Q0ZSNC0zLCBPRU0gUmV2aXNp b249MHg2MDQwMDAwLA0KCUNyZWF0b3IgSUQ9TUVJLCBDcmVhdG9yIFJldmlzaW9uPTB4MQ0KDQoJ QmFzZSBBZGRyZXNzPSAweDAwMDAwMDAwZTAwMDAwMDANCglTZWdtZW50IEdyb3VwPSAweDAwMDAN CglTdGFydCBCdXM9IDANCglFbmQgQnVzPSAyNTUNCiAqLw0KLyoNCiAgU1NEVDogTGVuZ3RoPTU2 NSwgUmV2aXNpb249MSwgQ2hlY2tzdW09MTIsDQoJT0VNSUQ9UG1SZWYsIE9FTSBUYWJsZSBJRD1D cHUwSXN0LCBPRU0gUmV2aXNpb249MHgzMDAwLA0KCUNyZWF0b3IgSUQ9SU5UTCwgQ3JlYXRvciBS ZXZpc2lvbj0weDIwMDMwMjI0DQogKi8NCi8qDQogIFNTRFQ6IExlbmd0aD00NzgsIFJldmlzaW9u PTEsIENoZWNrc3VtPTEyOCwNCglPRU1JRD1QbVJlZiwgT0VNIFRhYmxlIElEPUNwdTBDc3QsIE9F TSBSZXZpc2lvbj0weDMwMDEsDQoJQ3JlYXRvciBJRD1JTlRMLCBDcmVhdG9yIFJldmlzaW9uPTB4 MjAwMzAyMjQNCiAqLw0KLyoNCiAgU1NEVDogTGVuZ3RoPTU0MywgUmV2aXNpb249MSwgQ2hlY2tz dW09MzUsDQoJT0VNSUQ9UG1SZWYsIE9FTSBUYWJsZSBJRD1DcHVQbSwgT0VNIFJldmlzaW9uPTB4 MzAwMCwNCglDcmVhdG9yIElEPUlOVEwsIENyZWF0b3IgUmV2aXNpb249MHgyMDAzMDIyNA0KICov DQovKg0KICogSW50ZWwgQUNQSSBDb21wb25lbnQgQXJjaGl0ZWN0dXJlDQogKiBBTUwgRGlzYXNz ZW1ibGVyIHZlcnNpb24gMjAwNDExMTkNCiAqDQogKiBEaXNhc3NlbWJseSBvZiAvdG1wL2FjcGlk dW1wLmtMT3p4cCwgV2VkIEp1biAyMCAwMTo0Mzo0NSAyMDA3DQogKi8NCkRlZmluaXRpb25CbG9j ayAoIkRTRFQuYW1sIiwgIkRTRFQiLCAxLCAiTUFUQklPIiwgIkNGUjQtMyIsIDEwMDkyNTQ0MCkN CnsNCiAgICBTY29wZSAoX1NCKQ0KICAgIHsNCiAgICAgICAgT3BlcmF0aW9uUmVnaW9uIChTTUkw LCBTeXN0ZW1JTywgMHgwMDAwRkUwMCwgMHgwMDAwMDAwMikNCiAgICAgICAgRmllbGQgKFNNSTAs IEFueUFjYywgTm9Mb2NrLCBQcmVzZXJ2ZSkNCiAgICAgICAgew0KICAgICAgICAgICAgU01JQywg ICA4DQogICAgICAgIH0NCg0KICAgICAgICBPcGVyYXRpb25SZWdpb24gKFNNSTEsIFN5c3RlbU1l bW9yeSwgMHgzRjZFOEQ0RCwgMHgwMDAwMDIwMCkNCiAgICAgICAgRmllbGQgKFNNSTEsIEFueUFj YywgTm9Mb2NrLCBQcmVzZXJ2ZSkNCiAgICAgICAgew0KICAgICAgICAgICAgQkNNRCwgICA4LCAN CiAgICAgICAgICAgIERJRCwgICAgMzIsIA0KICAgICAgICAgICAgSU5GTywgICA0MDU2DQogICAg ICAgIH0NCg0KICAgICAgICBGaWVsZCAoU01JMSwgQW55QWNjLCBOb0xvY2ssIFByZXNlcnZlKQ0K ICAgICAgICB7DQogICAgICAgICAgICBPZmZzZXQgKDB4MDUpLCANCiAgICAgICAgICAgIElORiwg ICAgOA0KICAgICAgICB9DQoNCiAgICAgICAgRmllbGQgKFNNSTEsIEFueUFjYywgTm9Mb2NrLCBQ cmVzZXJ2ZSkNCiAgICAgICAgew0KICAgICAgICAgICAgT2Zmc2V0ICgweDA1KSwgDQogICAgICAg ICAgICBJTkZELCAgIDMyDQogICAgICAgIH0NCg0KICAgICAgICBGaWVsZCAoU01JMSwgQW55QWNj LCBOb0xvY2ssIFByZXNlcnZlKQ0KICAgICAgICB7DQogICAgICAgICAgICBPZmZzZXQgKDB4MDUp LCANCiAgICAgICAgICAgIElORlAsICAgMTI4DQogICAgICAgIH0NCg0KICAgICAgICBNdXRleCAo UFNNWCwgMHgwMSkNCiAgICAgICAgTWV0aG9kIChQU1JWLCA1LCBTZXJpYWxpemVkKQ0KICAgICAg ICB7DQogICAgICAgICAgICBBY3F1aXJlIChQU01YLCAweEZGRkYpDQogICAgICAgICAgICBJZiAo QXJnMikNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBTdG9yZSAoQXJnMywgSU5GTykN CiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgU3RvcmUgKEFyZzEsIERJRCkNCiAgICAgICAg ICAgIFN0b3JlIChBcmcwLCBCQ01EKQ0KICAgICAgICAgICAgU3RvcmUgKDB4MDAsIFNNSUMpDQog ICAgICAgICAgICBJZiAoTEVxdWFsIChBcmc0LCAweDAwKSkNCiAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICBTdG9yZSAoWmVybywgTG9jYWwwKQ0KICAgICAgICAgICAgfQ0KICAgICAgICAg ICAgRWxzZQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKEFyZzQs IDB4MDEpKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgU3RvcmUgKElO RiwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBFbHNlDQogICAg ICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChBcmc0LCAweDAz KSkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUg KElORkQsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAg ICBFbHNlDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElm IChMRXF1YWwgKEFyZzQsIDB4MDQpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChJTkZQLCBMb2NhbDApDQogICAgICAgICAgICAg ICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKElORk8sIExv Y2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgfQ0K ICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgUmVsZWFzZSAo UFNNWCkNCiAgICAgICAgICAgIFJldHVybiAoTG9jYWwwKQ0KICAgICAgICB9DQoNCiAgICAgICAg TWV0aG9kIChFQ1dSLCAyLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICB7DQogICAgICAgICAgICBB bmQgKEFyZzAsIDB4RkYsIExvY2FsMCkNCiAgICAgICAgICAgIEFuZCAoQXJnMSwgMHhGRiwgTG9j YWwxKQ0KICAgICAgICAgICAgUFNSViAoMHg5OSwgQWRkIChMb2NhbDAsIFNoaWZ0TGVmdCAoTG9j YWwxLCAweDEwKSksIDB4MDAsIDB4MDAsIDB4MDApDQogICAgICAgIH0NCg0KICAgICAgICBNZXRo b2QgKFJSVEMsIDEsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgIHsNCiAgICAgICAgICAgIEFuZCAo QXJnMCwgMHhGRiwgTG9jYWwwKQ0KICAgICAgICAgICAgUmV0dXJuIChQU1JWICgweDkyLCAweDA1 LCAweDAxLCBMb2NhbDAsIDB4MDEpKQ0KICAgICAgICB9DQogICAgfQ0KDQogICAgTWV0aG9kIChN SU4sIDIsIE5vdFNlcmlhbGl6ZWQpDQogICAgew0KICAgICAgICBJZiAoTExlc3MgKEFyZzAsIEFy ZzEpKQ0KICAgICAgICB7DQogICAgICAgICAgICBSZXR1cm4gKEFyZzApDQogICAgICAgIH0NCiAg ICAgICAgRWxzZQ0KICAgICAgICB7DQogICAgICAgICAgICBSZXR1cm4gKEFyZzEpDQogICAgICAg IH0NCiAgICB9DQoNCiAgICBNZXRob2QgKFNMRU4sIDEsIE5vdFNlcmlhbGl6ZWQpDQogICAgew0K ICAgICAgICBSZXR1cm4gKFNpemVPZiAoQXJnMCkpDQogICAgfQ0KDQogICAgTWV0aG9kIChTMkJG LCAxLCBTZXJpYWxpemVkKQ0KICAgIHsNCiAgICAgICAgQWRkIChTTEVOIChBcmcwKSwgT25lLCBM b2NhbDApDQogICAgICAgIE5hbWUgKEJVRkYsIEJ1ZmZlciAoTG9jYWwwKSB7fSkNCiAgICAgICAg U3RvcmUgKEFyZzAsIEJVRkYpDQogICAgICAgIFJldHVybiAoQlVGRikNCiAgICB9DQoNCiAgICBN ZXRob2QgKFNDTVAsIDIsIE5vdFNlcmlhbGl6ZWQpDQogICAgew0KICAgICAgICBTdG9yZSAoUzJC RiAoQXJnMCksIExvY2FsMCkNCiAgICAgICAgU3RvcmUgKFMyQkYgKEFyZzEpLCBMb2NhbDEpDQog ICAgICAgIFN0b3JlIChaZXJvLCBMb2NhbDQpDQogICAgICAgIFN0b3JlIChTTEVOIChBcmcwKSwg TG9jYWw1KQ0KICAgICAgICBTdG9yZSAoU0xFTiAoQXJnMSksIExvY2FsNikNCiAgICAgICAgU3Rv cmUgKE1JTiAoTG9jYWw1LCBMb2NhbDYpLCBMb2NhbDcpDQogICAgICAgIFdoaWxlIChMTGVzcyAo TG9jYWw0LCBMb2NhbDcpKQ0KICAgICAgICB7DQogICAgICAgICAgICBTdG9yZSAoRGVyZWZPZiAo SW5kZXggKExvY2FsMCwgTG9jYWw0KSksIExvY2FsMikNCiAgICAgICAgICAgIFN0b3JlIChEZXJl Zk9mIChJbmRleCAoTG9jYWwxLCBMb2NhbDQpKSwgTG9jYWwzKQ0KICAgICAgICAgICAgSWYgKExH cmVhdGVyIChMb2NhbDIsIExvY2FsMykpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg UmV0dXJuIChPbmUpDQogICAgICAgICAgICB9DQogICAgICAgICAgICBFbHNlDQogICAgICAgICAg ICB7DQogICAgICAgICAgICAgICAgSWYgKExMZXNzIChMb2NhbDIsIExvY2FsMykpDQogICAgICAg ICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKE9uZXMpDQogICAgICAgICAg ICAgICAgfQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICBJbmNyZW1lbnQgKExvY2FsNCkN CiAgICAgICAgfQ0KDQogICAgICAgIElmIChMTGVzcyAoTG9jYWw0LCBMb2NhbDUpKQ0KICAgICAg ICB7DQogICAgICAgICAgICBSZXR1cm4gKE9uZSkNCiAgICAgICAgfQ0KICAgICAgICBFbHNlDQog ICAgICAgIHsNCiAgICAgICAgICAgIElmIChMTGVzcyAoTG9jYWw0LCBMb2NhbDYpKQ0KICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgIFJldHVybiAoT25lcykNCiAgICAgICAgICAgIH0NCiAg ICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBSZXR1cm4gKFpl cm8pDQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICB9DQoNCiAgICBOYW1lIChPU0lELCAw eDAwKQ0KICAgIE1ldGhvZCAoQ0tPUywgMCwgTm90U2VyaWFsaXplZCkNCiAgICB7DQogICAgICAg IElmIChPU0lEKQ0KICAgICAgICB7DQogICAgICAgICAgICBSZXR1cm4gKE9TSUQpDQogICAgICAg IH0NCg0KICAgICAgICBJZiAoQ29uZFJlZk9mIChcX09TSSwgTG9jYWwwKSkNCiAgICAgICAgew0K ICAgICAgICAgICAgU3RvcmUgKDB4ODIsIE9TSUQpDQogICAgICAgIH0NCiAgICAgICAgRWxzZQ0K ICAgICAgICB7DQogICAgICAgICAgICBJZiAoTEVxdWFsIChTQ01QIChcX09TLCAiTWljcm9zb2Z0 IFdpbmRvd3MgTlQiKSwgWmVybykpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgU3Rv cmUgKDB4ODEsIE9TSUQpDQogICAgICAgICAgICB9DQogICAgICAgICAgICBFbHNlDQogICAgICAg ICAgICB7DQogICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoU0NNUCAoXF9PUywgIk1pY3Jvc29m dCBXaW5kb3dzIiksIFplcm8pKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgU3RvcmUgKDB4MDEsIE9TSUQpDQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAg IEVsc2UNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwg KFNDTVAgKFxfT1MsICJNaWNyb3NvZnQgV2luZG93c01FOiBNaWxsZW5uaXVtIEVkaXRpb24iKSwg WmVybykpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0 b3JlICgweDAyLCBPU0lEKQ0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAg ICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAg U3RvcmUgKDB4RkYsIE9TSUQpDQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAg ICB9DQogICAgICAgICAgICB9DQogICAgICAgIH0NCg0KICAgICAgICBSZXR1cm4gKE9TSUQpDQog ICAgfQ0KDQogICAgU2NvcGUgKFwpDQogICAgew0KICAgICAgICBOYW1lIChXVEhULCBaZXJvKQ0K ICAgICAgICBOYW1lIChBUElDLCBPbmUpDQogICAgICAgIE5hbWUgKEdWM0UsIE9uZSkNCiAgICAg ICAgTmFtZSAoSFRURSwgWmVybykNCiAgICB9DQoNCiAgICBNZXRob2QgKEdJTkksIDAsIE5vdFNl cmlhbGl6ZWQpDQogICAgew0KICAgICAgICBTdG9yZSAoXF9TQi5QU1JWICgweEM5LCAweDAxLCAw eDAxLCAweDAxLCAweDAzKSwgQVBJQykNCiAgICAgICAgU3RvcmUgKFxfU0IuUFNSViAoMHhDOSwg MHgwMSwgMHgwMSwgMHgwMiwgMHgwMyksIEdWM0UpDQogICAgICAgIFN0b3JlIChcX1NCLlBTUlYg KDB4QzksIDB4MDEsIDB4MDEsIDB4MDMsIDB4MDMpLCBIVFRFKQ0KICAgIH0NCg0KICAgIE1ldGhv ZCAoUE5PVCwgMCwgU2VyaWFsaXplZCkNCiAgICB7DQogICAgICAgIElmIChIVFRFKQ0KICAgICAg ICB7DQogICAgICAgICAgICBJZiAoTEVxdWFsIChBbmQgKFBEQzAsIDB4MEEpLCAweDBBKSkNCiAg ICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBOb3RpZnkgKFxfUFIuQ1BVMCwgMHg4MCkNCiAg ICAgICAgICAgIH0NCg0KICAgICAgICAgICAgSWYgKExFcXVhbCAoQW5kIChQREMxLCAweDBBKSwg MHgwQSkpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgTm90aWZ5IChcX1BSLkNQVTEs IDB4ODApDQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgRWxzZQ0KICAgICAgICB7 DQogICAgICAgICAgICBOb3RpZnkgKFxfUFIuQ1BVMCwgMHg4MCkNCiAgICAgICAgICAgIFNsZWVw ICgweDY0KQ0KICAgICAgICAgICAgTm90aWZ5IChcX1BSLkNQVTAsIDB4ODEpDQogICAgICAgIH0N Cg0KICAgICAgICBOb3RpZnkgKFxfU0IuQkFUQSwgMHg4MCkNCiAgICB9DQoNCiAgICBTY29wZSAo XCkNCiAgICB7DQogICAgICAgIE5hbWUgKEdURjAsIEJ1ZmZlciAoMHgwNykge30pDQogICAgICAg IE5hbWUgKEdURjIsIEJ1ZmZlciAoMHgwNykge30pDQogICAgICAgIE5hbWUgKElERU0sIFplcm8p DQogICAgfQ0KDQogICAgTWV0aG9kIChBSU5JLCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgIHsNCiAg ICAgICAgU3RvcmUgKFxfU0IuUFNSViAoMHg5NCwgMHgwMSwgMHgwMSwgMHgwMSwgMHgwMyksIElE RU0pDQogICAgfQ0KDQogICAgTWV0aG9kIChHRVRQLCAxLCBTZXJpYWxpemVkKQ0KICAgIHsNCiAg ICAgICAgSWYgKExFcXVhbCAoQW5kIChBcmcwLCAweDA5KSwgMHgwMCkpDQogICAgICAgIHsNCiAg ICAgICAgICAgIFJldHVybiAoMHhGRkZGRkZGRikNCiAgICAgICAgfQ0KDQogICAgICAgIElmIChM RXF1YWwgKEFuZCAoQXJnMCwgMHgwOSksIDB4MDgpKQ0KICAgICAgICB7DQogICAgICAgICAgICBS ZXR1cm4gKDB4MDM4NCkNCiAgICAgICAgfQ0KDQogICAgICAgIFNoaWZ0UmlnaHQgKEFuZCAoQXJn MCwgMHgwMzAwKSwgMHgwOCwgTG9jYWwwKQ0KICAgICAgICBTaGlmdFJpZ2h0IChBbmQgKEFyZzAs IDB4MzAwMCksIDB4MEMsIExvY2FsMSkNCiAgICAgICAgUmV0dXJuIChNdWx0aXBseSAoMHgxRSwg U3VidHJhY3QgKDB4MDksIEFkZCAoTG9jYWwwLCBMb2NhbDEpKSkpDQogICAgfQ0KDQogICAgTWV0 aG9kIChHRE1BLCA1LCBTZXJpYWxpemVkKQ0KICAgIHsNCiAgICAgICAgSWYgKEFyZzApDQogICAg ICAgIHsNCiAgICAgICAgICAgIElmIChMQW5kIChBcmcxLCBBcmc0KSkNCiAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MTQpDQogICAgICAgICAgICB9DQoNCiAgICAgICAg ICAgIElmIChMQW5kIChBcmcyLCBBcmc0KSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICBSZXR1cm4gKE11bHRpcGx5IChTdWJ0cmFjdCAoMHgwNCwgQXJnMyksIDB4MEYpKQ0KICAgICAg ICAgICAgfQ0KDQogICAgICAgICAgICBSZXR1cm4gKE11bHRpcGx5IChTdWJ0cmFjdCAoMHgwNCwg QXJnMyksIDB4MUUpKQ0KICAgICAgICB9DQoNCiAgICAgICAgUmV0dXJuICgweEZGRkZGRkZGKQ0K ICAgIH0NCg0KICAgIE1ldGhvZCAoR0VUVCwgMSwgU2VyaWFsaXplZCkNCiAgICB7DQogICAgICAg IFJldHVybiAoTXVsdGlwbHkgKDB4MUUsIFN1YnRyYWN0ICgweDA5LCBBZGQgKEFuZCAoU2hpZnRS aWdodCAoQXJnMCwgMHgwMiksIDB4MDMpLCBBbmQgKEFyZzAsIDB4MDMpKSkpKQ0KICAgIH0NCg0K ICAgIE1ldGhvZCAoR0VURiwgMywgU2VyaWFsaXplZCkNCiAgICB7DQogICAgICAgIE5hbWUgKFRN UEYsIDB4MDApDQogICAgICAgIElmIChBcmcwKQ0KICAgICAgICB7DQogICAgICAgICAgICBPciAo VE1QRiwgMHgwMSwgVE1QRikNCiAgICAgICAgfQ0KDQogICAgICAgIElmIChBbmQgKEFyZzIsIDB4 MDIpKQ0KICAgICAgICB7DQogICAgICAgICAgICBPciAoVE1QRiwgMHgwMiwgVE1QRikNCiAgICAg ICAgfQ0KDQogICAgICAgIElmIChBcmcxKQ0KICAgICAgICB7DQogICAgICAgICAgICBPciAoVE1Q RiwgMHgwNCwgVE1QRikNCiAgICAgICAgfQ0KDQogICAgICAgIElmIChBbmQgKEFyZzIsIDB4MjAp KQ0KICAgICAgICB7DQogICAgICAgICAgICBPciAoVE1QRiwgMHgwOCwgVE1QRikNCiAgICAgICAg fQ0KDQogICAgICAgIElmIChBbmQgKEFyZzIsIDB4NDAwMCkpDQogICAgICAgIHsNCiAgICAgICAg ICAgIE9yIChUTVBGLCAweDEwLCBUTVBGKQ0KICAgICAgICB9DQoNCiAgICAgICAgUmV0dXJuIChU TVBGKQ0KICAgIH0NCg0KICAgIE1ldGhvZCAoU0VUUCwgMywgU2VyaWFsaXplZCkNCiAgICB7DQog ICAgICAgIElmIChMR3JlYXRlciAoQXJnMCwgMHhGMCkpDQogICAgICAgIHsNCiAgICAgICAgICAg IFJldHVybiAoMHgwOCkNCiAgICAgICAgfQ0KICAgICAgICBFbHNlDQogICAgICAgIHsNCiAgICAg ICAgICAgIElmIChBbmQgKEFyZzEsIDB4MDIpKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgIElmIChMQW5kIChMTm90IChMR3JlYXRlciAoQXJnMCwgMHg3OCkpLCBBbmQgKEFyZzIsIDB4 MDIpKSkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgy MzAxKQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIElmIChMQW5kIChMTm90 IChMR3JlYXRlciAoQXJnMCwgMHhCNCkpLCBBbmQgKEFyZzIsIDB4MDEpKSkNCiAgICAgICAgICAg ICAgICB7DQogICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgyMTAxKQ0KICAgICAgICAgICAg ICAgIH0NCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgUmV0dXJuICgweDEwMDEpDQogICAg ICAgIH0NCiAgICB9DQoNCiAgICBNZXRob2QgKFNETUEsIDEsIFNlcmlhbGl6ZWQpDQogICAgew0K ICAgICAgICBJZiAoTE5vdCAoTEdyZWF0ZXIgKEFyZzAsIDB4MTQpKSkNCiAgICAgICAgew0KICAg ICAgICAgICAgUmV0dXJuICgweDAxKQ0KICAgICAgICB9DQoNCiAgICAgICAgSWYgKExOb3QgKExH cmVhdGVyIChBcmcwLCAweDFFKSkpDQogICAgICAgIHsNCiAgICAgICAgICAgIFJldHVybiAoMHgw MikNCiAgICAgICAgfQ0KDQogICAgICAgIElmIChMTm90IChMR3JlYXRlciAoQXJnMCwgMHgyRCkp KQ0KICAgICAgICB7DQogICAgICAgICAgICBSZXR1cm4gKDB4MDEpDQogICAgICAgIH0NCg0KICAg ICAgICBJZiAoTE5vdCAoTEdyZWF0ZXIgKEFyZzAsIDB4M0MpKSkNCiAgICAgICAgew0KICAgICAg ICAgICAgUmV0dXJuICgweDAyKQ0KICAgICAgICB9DQoNCiAgICAgICAgSWYgKExOb3QgKExHcmVh dGVyIChBcmcwLCAweDVBKSkpDQogICAgICAgIHsNCiAgICAgICAgICAgIFJldHVybiAoMHgwMSkN CiAgICAgICAgfQ0KDQogICAgICAgIFJldHVybiAoMHgwMCkNCiAgICB9DQoNCiAgICBNZXRob2Qg KFNFVFQsIDMsIFNlcmlhbGl6ZWQpDQogICAgew0KICAgICAgICBJZiAoQW5kIChBcmcxLCAweDAy KSkNCiAgICAgICAgew0KICAgICAgICAgICAgSWYgKExBbmQgKExOb3QgKExHcmVhdGVyIChBcmcw LCAweDc4KSksIEFuZCAoQXJnMiwgMHgwMikpKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgIFJldHVybiAoMHgwQikNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgSWYgKExBbmQg KExOb3QgKExHcmVhdGVyIChBcmcwLCAweEI0KSksIEFuZCAoQXJnMiwgMHgwMSkpKQ0KICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgIFJldHVybiAoMHgwOSkNCiAgICAgICAgICAgIH0NCiAg ICAgICAgfQ0KDQogICAgICAgIFJldHVybiAoMHgwNCkNCiAgICB9DQoNCiAgICBPcGVyYXRpb25S ZWdpb24gKFJDUkIsIFN5c3RlbU1lbW9yeSwgMHhGRUQxQzAwMCwgMHg0MDAwKQ0KICAgIEZpZWxk IChSQ1JCLCBEV29yZEFjYywgTG9jaywgUHJlc2VydmUpDQogICAgew0KICAgICAgICBPZmZzZXQg KDB4MTAwMCksIA0KICAgICAgICBPZmZzZXQgKDB4MzAwMCksIA0KICAgICAgICBPZmZzZXQgKDB4 MzQwNCksIA0KICAgICAgICBIUEFTLCAgIDIsIA0KICAgICAgICAgICAgLCAgIDUsIA0KICAgICAg ICBIUEFFLCAgIDEsIA0KICAgICAgICBPZmZzZXQgKDB4MzQxOCksIA0KICAgICAgICAgICAgLCAg IDEsIA0KICAgICAgICBQQVRELCAgIDEsIA0KICAgICAgICBTQVRELCAgIDEsIA0KICAgICAgICBT TUJELCAgIDEsIA0KICAgICAgICBBWkFELCAgIDEsIA0KICAgICAgICBBOTdELCAgIDEsIA0KICAg ICAgICBPZmZzZXQgKDB4MzQxQSksIA0KICAgICAgICBSUDFELCAgIDEsIA0KICAgICAgICBSUDJE LCAgIDEsIA0KICAgICAgICBSUDNELCAgIDEsIA0KICAgICAgICBSUDRELCAgIDENCiAgICB9DQoN CiAgICBTY29wZSAoXCkNCiAgICB7DQogICAgICAgIE5hbWUgKFBXUlMsIDB4MDEpDQogICAgfQ0K DQogICAgU2NvcGUgKF9TQikNCiAgICB7DQogICAgICAgIE1ldGhvZCAoRUNQRiwgMywgTm90U2Vy aWFsaXplZCkNCiAgICAgICAgew0KICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMCwgMHgwMTAw KSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBTdG9yZSAoXF9TQi5QQ0kwLkxQQ0Iu RUMwLkVDMDEgKCksIFBXUlMpDQogICAgICAgICAgICAgICAgUmV0dXJuIChQV1JTKQ0KICAgICAg ICAgICAgfQ0KDQogICAgICAgICAgICBJZiAoTEVxdWFsIChBcmcwLCAweDAxMDEpKQ0KICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgIFJldHVybiAoXF9TQi5QQ0kwLkxQQ0IuRUMwLkVDMDIg KEFyZzEpKQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICBJZiAoTEVxdWFsIChBcmcwLCAw eDAxMTApKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIFJldHVybiAoXF9TQi5QQ0kw LkxQQ0IuRUMwLkVDMDMgKEFyZzEsIEFyZzIpKQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAg ICBJZiAoTEVxdWFsIChBcmcwLCAweDAxMTEpKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgIFJldHVybiAoXF9TQi5QQ0kwLkxQQ0IuRUMwLkVDMDQgKEFyZzEsIEFyZzIpKQ0KICAgICAg ICAgICAgfQ0KDQogICAgICAgICAgICBJZiAoTEVxdWFsIChBcmcwLCAweDAxMTIpKQ0KICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgIFJldHVybiAoXF9TQi5QQ0kwLkxQQ0IuRUMwLkVDMDUg KEFyZzEsIEFyZzIpKQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICBJZiAoTEVxdWFsIChB cmcwLCAweDAyMDApKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIFJldHVybiAoXF9T Qi5QQ0kwLkxQQ0IuRUMwLkVDMDYgKCkpDQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIElm IChMRXF1YWwgKEFyZzAsIDB4MDIwMSkpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg UmV0dXJuIChcX1NCLlBDSTAuTFBDQi5FQzAuRUMwNyAoKSkNCiAgICAgICAgICAgIH0NCg0KICAg ICAgICAgICAgSWYgKExFcXVhbCAoQXJnMCwgMHgwMjAyKSkNCiAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICBSZXR1cm4gKFxfU0IuUENJMC5MUENCLkVDMC5FQzA4ICgpKQ0KICAgICAgICAg ICAgfQ0KDQogICAgICAgICAgICBJZiAoTEVxdWFsIChBcmcwLCAweDAyMDMpKQ0KICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgIFJldHVybiAoXF9TQi5QQ0kwLkxQQ0IuRUMwLkVDMDkgKCkp DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIElmIChMRXF1YWwgKEFyZzAsIDB4MDIwNCkp DQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgUmV0dXJuIChcX1NCLlBDSTAuTFBDQi5F QzAuRUMwQSAoKSkNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJn MCwgMHgwMjA1KSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBSZXR1cm4gKFxfU0Iu UENJMC5MUENCLkVDMC5FQzBCIChBcmcxKSkNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAg SWYgKExFcXVhbCAoQXJnMCwgMHgwMjA2KSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICBSZXR1cm4gKFxfU0IuUENJMC5MUENCLkVDMC5FQzBDIChBcmcxKSkNCiAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMCwgMHgwMjA3KSkNCiAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICBSZXR1cm4gKFxfU0IuUENJMC5MUENCLkVDMC5FQzBEIChBcmcxKSkN CiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMCwgMHgwMjA4KSkN CiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBSZXR1cm4gKFxfU0IuUENJMC5MUENCLkVD MC5FQzBFIChBcmcxKSkNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgSWYgKExFcXVhbCAo QXJnMCwgMHgwMjA5KSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBSZXR1cm4gKFxf U0IuUENJMC5MUENCLkVDMC5FQzBGIChBcmcxKSkNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAg ICAgSWYgKExFcXVhbCAoQXJnMCwgMHgwMjBBKSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICBSZXR1cm4gKFxfU0IuUENJMC5MUENCLkVDMC5FQzEwIChBcmcxLCBBcmcyKSkNCiAgICAg ICAgICAgIH0NCg0KICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMCwgMHgwMjE1KSkNCiAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICBSZXR1cm4gKFxfU0IuUENJMC5MUENCLkVDMC5aMDAw ICgpKQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICBSZXR1cm4gKDB4RkZGRkZGRkYpDQog ICAgICAgIH0NCiAgICB9DQoNCiAgICBTY29wZSAoXF9TQikNCiAgICB7DQogICAgICAgIERldmlj ZSAoTElEKQ0KICAgICAgICB7DQogICAgICAgICAgICBOYW1lIChfSElELCBFaXNhSWQgKCJQTlAw QzBEIikpDQogICAgICAgICAgICBOYW1lIChfVUlELCAweDAwKQ0KICAgICAgICAgICAgTWV0aG9k IChfTElELCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg IFJldHVybiAoXF9TQi5FQ1BGICgweDAyMDAsIDB4MDAsIDB4MDApKQ0KICAgICAgICAgICAgfQ0K DQogICAgICAgICAgICBOYW1lIChfUFJXLCBQYWNrYWdlICgweDAyKQ0KICAgICAgICAgICAgew0K ICAgICAgICAgICAgICAgIDB4MUIsIA0KICAgICAgICAgICAgICAgIDB4MDQNCiAgICAgICAgICAg IH0pDQogICAgICAgICAgICBNZXRob2QgKF9QU1csIDEsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAg ICAgICB7DQogICAgICAgICAgICAgICAgXF9TQi5FQ1BGICgweDAyMDcsIEFyZzAsIDB4MDApDQog ICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICB9DQoNCiAgICBTY29wZSAoXF9TQikNCiAgICB7 DQogICAgICAgIE5hbWUgKFxfU0IuQkFTVCwgMHgwMCkNCiAgICAgICAgRGV2aWNlIChCQVRBKQ0K ICAgICAgICB7DQogICAgICAgICAgICBOYW1lIChfSElELCBFaXNhSWQgKCJQTlAwQzBBIikpDQog ICAgICAgICAgICBOYW1lIChfVUlELCAweDAwKQ0KICAgICAgICAgICAgTmFtZSAoQV9QVSwgMHhG RikNCiAgICAgICAgICAgIE1ldGhvZCAoX0JJRiwgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICBOYW1lIChCSUZSLCBQYWNrYWdlICgweDBEKQ0KICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgMHgwMCwgDQogICAgICAgICAgICAgICAgICAg IDB4MDAsIA0KICAgICAgICAgICAgICAgICAgICAweDAwLCANCiAgICAgICAgICAgICAgICAgICAg MHgwMCwgDQogICAgICAgICAgICAgICAgICAgIDB4MDAsIA0KICAgICAgICAgICAgICAgICAgICAw eDAwLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMCwgDQogICAgICAgICAgICAgICAgICAgIDB4 MDAsIA0KICAgICAgICAgICAgICAgICAgICAweDAwLCANCiAgICAgICAgICAgICAgICAgICAgQnVm ZmVyICgweDEwKSB7fSwgDQogICAgICAgICAgICAgICAgICAgIEJ1ZmZlciAoMHgxMCkge30sIA0K ICAgICAgICAgICAgICAgICAgICBCdWZmZXIgKDB4MTApIHt9LCANCiAgICAgICAgICAgICAgICAg ICAgQnVmZmVyICgweDEwKSB7fQ0KICAgICAgICAgICAgICAgIH0pDQogICAgICAgICAgICAgICAg U3RvcmUgKFxfU0IuRUNQRiAoMHgwMTExLCAweDAwLCAweDAwKSwgQV9QVSkNCiAgICAgICAgICAg ICAgICBTdG9yZSAoQV9QVSwgSW5kZXggKEJJRlIsIDB4MDApKQ0KICAgICAgICAgICAgICAgIElm IChBX1BVKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4 MDEsIExvY2FsMSkNCiAgICAgICAgICAgICAgICAgICAgV2hpbGUgKExOb3QgKExHcmVhdGVyIChM b2NhbDEsIDB4MDgpKSkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAg ICAgICAgU3RvcmUgKFxfU0IuRUNQRiAoMHgwMTExLCAweDAwLCBMb2NhbDEpLCBJbmRleCAoQklG UiwgTG9jYWwxKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIEluY3JlbWVudCAoTG9jYWwxKQ0K ICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAg IEVsc2UNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIFN0b3JlICgweDAx LCBMb2NhbDEpDQogICAgICAgICAgICAgICAgICAgIFdoaWxlIChMTm90IChMR3JlYXRlciAoTG9j YWwxLCAweDA4KSkpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgIFN0b3JlIChcX1NCLkVDUEYgKDB4MDExMSwgMHgwMCwgTG9jYWwxKSwgTG9jYWwyKQ0KICAg ICAgICAgICAgICAgICAgICAgICAgSWYgKExBbmQgKExOb3QgKExFcXVhbCAoTG9jYWwyLCAweEZG RkZGRkZGKSksIExBbmQgKExOb3QgKExFcXVhbCAoTG9jYWwxLCAweDAzKSksIExOb3QgKExFcXVh bCAoTG9jYWwxLCAweDA0KSkpKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICBNdWx0aXBseSAoTG9jYWwyLCAweDBBLCBMb2NhbDIpDQogICAg ICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChM b2NhbDIsIEluZGV4IChCSUZSLCBMb2NhbDEpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgSW5j cmVtZW50IChMb2NhbDEpDQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9 DQoNCiAgICAgICAgICAgICAgICBTdG9yZSAoXF9TQi5FQ1BGICgweDAxMTEsIDB4MDAsIDB4MDkp LCBJbmRleCAoQklGUiwgMHgwOSkpDQogICAgICAgICAgICAgICAgU3RvcmUgKFxfU0IuRUNQRiAo MHgwMTExLCAweDAwLCAweDBBKSwgSW5kZXggKEJJRlIsIDB4MEEpKQ0KICAgICAgICAgICAgICAg IFN0b3JlIChcX1NCLkVDUEYgKDB4MDExMSwgMHgwMCwgMHgwQiksIEluZGV4IChCSUZSLCAweDBC KSkNCiAgICAgICAgICAgICAgICBTdG9yZSAoIlBhbmFzb25pYyIsIEluZGV4IChCSUZSLCAweDBD KSkNCiAgICAgICAgICAgICAgICBSZXR1cm4gKEJJRlIpDQogICAgICAgICAgICB9DQoNCiAgICAg ICAgICAgIE1ldGhvZCAoX0JTVCwgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICBOYW1lIChCU1RSLCBQYWNrYWdlICgweDA0KQ0KICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgMHgwMCwgDQogICAgICAgICAgICAgICAgICAgIDB4MDAsIA0K ICAgICAgICAgICAgICAgICAgICAweDAwLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMA0KICAg ICAgICAgICAgICAgIH0pDQogICAgICAgICAgICAgICAgU3RvcmUgKFxfU0IuRUNQRiAoMHgwMTEw LCAweDAwLCAweDAwKSwgSW5kZXggKEJTVFIsIDB4MDApKQ0KICAgICAgICAgICAgICAgIElmIChM R3JlYXRlciAoQV9QVSwgMHgwMSkpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICBTdG9yZSAoXF9TQi5FQ1BGICgweDAxMTEsIDB4MDAsIDB4MDApLCBBX1BVKQ0KICAgICAg ICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIElmIChBX1BVKQ0KICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgU3RvcmUgKFxfU0IuRUNQRiAoMHgwMTEwLCAweDAwLCAw eDAxKSwgSW5kZXggKEJTVFIsIDB4MDEpKQ0KICAgICAgICAgICAgICAgICAgICBTdG9yZSAoXF9T Qi5FQ1BGICgweDAxMTAsIDB4MDAsIDB4MDIpLCBJbmRleCAoQlNUUiwgMHgwMikpDQogICAgICAg ICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgICAgIFN0b3JlIChcX1NCLkVDUEYgKDB4MDExMCwgMHgwMCwgMHgwMSksIExv Y2FsMCkNCiAgICAgICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoTG9jYWwwLCAweEZGRkZGRkZG KSkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUg KExvY2FsMCwgSW5kZXggKEJTVFIsIDB4MDEpKQ0KICAgICAgICAgICAgICAgICAgICB9DQogICAg ICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgU3RvcmUgKE11bHRpcGx5IChMb2NhbDAsIDB4MEEpLCBJbmRleCAoQlNUUiwg MHgwMSkpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBTdG9y ZSAoXF9TQi5FQ1BGICgweDAxMTAsIDB4MDAsIDB4MDIpLCBMb2NhbDApDQogICAgICAgICAgICAg ICAgICAgIElmIChMRXF1YWwgKExvY2FsMCwgMHhGRkZGRkZGRikpDQogICAgICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChMb2NhbDAsIEluZGV4IChCU1RS LCAweDAyKSkNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICBFbHNl DQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChN dWx0aXBseSAoTG9jYWwwLCAweDBBKSwgSW5kZXggKEJTVFIsIDB4MDIpKQ0KICAgICAgICAgICAg ICAgICAgICB9DQogICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgU3RvcmUgKFxf U0IuRUNQRiAoMHgwMTEwLCAweDAwLCAweDAzKSwgSW5kZXggKEJTVFIsIDB4MDMpKQ0KICAgICAg ICAgICAgICAgIFJldHVybiAoQlNUUikNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgTmFt ZSAoX1BDTCwgUGFja2FnZSAoMHgwMSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBc X1NCDQogICAgICAgICAgICB9KQ0KICAgICAgICAgICAgTWV0aG9kIChfU1RBLCAwLCBTZXJpYWxp emVkKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKFxfU0IuRUNQ RiAoMHgwMTAxLCAweDAwLCAweDAwKSwgMHgwMSkpDQogICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICBSZXR1cm4gKDB4MUYpDQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAg ICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIFJldHVy biAoMHgwRikNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAg IE1ldGhvZCAoX0JUUCwgMSwgTm90U2VyaWFsaXplZCkNCiAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICBJZiAoTEdyZWF0ZXIgKEFfUFUsIDB4MDEpKQ0KICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgU3RvcmUgKFxfU0IuRUNQRiAoMHgwMTExLCAweDAwLCAweDAwKSwg QV9QVSkNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBJZiAoQV9QVSkNCiAg ICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIFN0b3JlIChBcmcwLCBMb2NhbDEp DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAg ICB7DQogICAgICAgICAgICAgICAgICAgIFN0b3JlIChEaXZpZGUgKEFyZzAsIDB4MEEsICksIExv Y2FsMSkNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBJZiAoTE5vdCAoTExl c3MgKExvY2FsMSwgMHgwMDAxMDAwMCkpKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgU3RvcmUgKFplcm8sIExvY2FsMCkNCiAgICAgICAgICAgICAgICB9DQogICAgICAg ICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgU3Rv cmUgKExvY2FsMSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAg IFxfU0IuRUNQRiAoMHgwMTEyLCAweDAwLCBMb2NhbDApDQogICAgICAgICAgICB9DQogICAgICAg IH0NCiAgICB9DQoNCiAgICBTY29wZSAoXF9TQikNCiAgICB7DQogICAgICAgIERldmljZSAoQUMp DQogICAgICAgIHsNCiAgICAgICAgICAgIE5hbWUgKF9ISUQsICJBQ1BJMDAwMyIpDQogICAgICAg ICAgICBOYW1lIChfVUlELCAweDAwKQ0KICAgICAgICAgICAgTWV0aG9kIChfUFNSLCAwLCBOb3RT ZXJpYWxpemVkKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIFJldHVybiAoXF9TQi5F Q1BGICgweDAxMDAsIDB4MDAsIDB4MDApKQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICBO YW1lIChfUENMLCBQYWNrYWdlICgweDAxKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg IFxfU0INCiAgICAgICAgICAgIH0pDQogICAgICAgIH0NCg0KICAgICAgICBNZXRob2QgKEFEQUMs IDAsIFNlcmlhbGl6ZWQpDQogICAgICAgIHsNCiAgICAgICAgICAgIFN0b3JlIChcX1NCLkVDUEYg KDB4MDEwMCwgMHgwMCwgMHgwMCksIExvY2FsMCkNCiAgICAgICAgICAgIFxfU0IuUFNSViAoMHhD OSwgMHgwMywgMHgwMSwgTG9jYWwwLCAweDAwKQ0KICAgICAgICAgICAgUE5PVCAoKQ0KICAgICAg ICB9DQogICAgfQ0KDQogICAgU2NvcGUgKFxfU0IpDQogICAgew0KICAgICAgICBEZXZpY2UgKFBX UkIpDQogICAgICAgIHsNCiAgICAgICAgICAgIE5hbWUgKF9ISUQsIEVpc2FJZCAoIlBOUDBDMEMi KSkNCiAgICAgICAgICAgIE5hbWUgKF9VSUQsIDB4MDApDQogICAgICAgICAgICBNZXRob2QgKF9T VEEsIDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgUmV0 dXJuICgweDBGKQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgfQ0KDQogICAgU2NvcGUg KFxfU0IpDQogICAgew0KICAgICAgICBEZXZpY2UgKEhLRVkpDQogICAgICAgIHsNCiAgICAgICAg ICAgIE5hbWUgKF9ISUQsIEVpc2FJZCAoIk1BVDAwMTkiKSkNCiAgICAgICAgICAgIE5hbWUgKFNJ RlIsIFBhY2thZ2UgKDB4MEUpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgMHgwMSwg DQogICAgICAgICAgICAgICAgMHgwMCwgDQogICAgICAgICAgICAgICAgMHgxNSwgDQogICAgICAg ICAgICAgICAgMHgwMSwgDQogICAgICAgICAgICAgICAgMHhGRiwgDQogICAgICAgICAgICAgICAg MHgxNSwgDQogICAgICAgICAgICAgICAgMHgwMSwgDQogICAgICAgICAgICAgICAgMHg3RiwgDQog ICAgICAgICAgICAgICAgMHgwMCwgDQogICAgICAgICAgICAgICAgMHgwMSwgDQogICAgICAgICAg ICAgICAgMHgwMCwgDQogICAgICAgICAgICAgICAgMHgwMCwgDQogICAgICAgICAgICAgICAgMHgw QSwgDQogICAgICAgICAgICAgICAgMHhGRg0KICAgICAgICAgICAgfSkNCiAgICAgICAgICAgIE5h bWUgKEhEQVQsIEJ1ZmZlciAoMHgyMCkge30pDQogICAgICAgICAgICBOYW1lIChISU5QLCBaZXJv KQ0KICAgICAgICAgICAgTmFtZSAoSE9VUCwgWmVybykNCiAgICAgICAgICAgIE11dGV4IChIRE1Y LCAweDAwKQ0KICAgICAgICAgICAgTWV0aG9kIChfU1RBLCAwLCBOb3RTZXJpYWxpemVkKQ0KICAg ICAgICAgICAgew0KICAgICAgICAgICAgICAgIFJldHVybiAoMHgwRikNCiAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgTWV0aG9kIChfSU5JLCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgIEhSRVMgKCkNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAg ICAgTWV0aG9kIChIUkVTLCAwLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgew0KICAgICAgICAg ICAgICAgIEFjcXVpcmUgKEhETVgsIDB4RkZGRikNCiAgICAgICAgICAgICAgICBPciAoMHgwMTAw MDAwMCwgMHgwMCwgTG9jYWwxKQ0KICAgICAgICAgICAgICAgIFN0b3JlIChcX1NCLlBTUlYgKDB4 OTYsIDB4MTkwMDM0MzQsIDB4MDEsIExvY2FsMSwgMHgwMyksIExvY2FsMCkNCiAgICAgICAgICAg ICAgICBTdG9yZSAoQW5kIChTaGlmdFJpZ2h0IChMb2NhbDAsIDB4MDgpLCAweEZGKSwgSW5kZXgg KFNJRlIsIDB4MDcpKQ0KICAgICAgICAgICAgICAgIFN0b3JlIChBbmQgKExvY2FsMCwgMHhGRiks IEluZGV4IChTSUZSLCAweDA0KSkNCiAgICAgICAgICAgICAgICBPciAoMHgwMjAwMDAwMCwgMHgw MCwgTG9jYWwxKQ0KICAgICAgICAgICAgICAgIFN0b3JlIChBbmQgKFxfU0IuUFNSViAoMHg5Niwg MHgxOTAwMzQzNCwgMHgwMSwgTG9jYWwxLCAweDAxKSwgMHgwMSksIEluZGV4IChTSUZSLCAweDA4 KSkNCiAgICAgICAgICAgICAgICBTdG9yZSAoXF9TQi5FQ1BGICgweDAyMTUsIDB4MDAsIDB4MDAp LCBMb2NhbDApDQogICAgICAgICAgICAgICAgT3IgKExvY2FsMCwgMHgwMSwgTG9jYWwwKQ0KICAg ICAgICAgICAgICAgIE9yIChMb2NhbDAsIDB4MDIsIExvY2FsMCkNCiAgICAgICAgICAgICAgICBT dG9yZSAoTG9jYWwwLCBJbmRleCAoU0lGUiwgMHgwQSkpDQogICAgICAgICAgICAgICAgUmVsZWFz ZSAoSERNWCkNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgTWV0aG9kIChIU0FWLCAwLCBT ZXJpYWxpemVkKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIEFjcXVpcmUgKEhETVgs IDB4RkZGRikNCiAgICAgICAgICAgICAgICBTdG9yZSAoRGVyZWZPZiAoSW5kZXggKFNJRlIsIDB4 MDQpKSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgIEFkZCAoU2hpZnRMZWZ0IChEZXJlZk9mIChJ bmRleCAoU0lGUiwgMHgwNykpLCAweDA4KSwgTG9jYWwwLCBMb2NhbDApDQogICAgICAgICAgICAg ICAgT3IgKDB4MDEwMDAwMDAsIDB4MDAwMTAwMDAsIExvY2FsMSkNCiAgICAgICAgICAgICAgICBP ciAoTG9jYWwxLCBMb2NhbDAsIExvY2FsMSkNCiAgICAgICAgICAgICAgICBcX1NCLlBTUlYgKDB4 OTYsIDB4MTkwMDM0MzQsIDB4MDEsIExvY2FsMSwgMHgwMykNCiAgICAgICAgICAgICAgICBTdG9y ZSAoQW5kIChEZXJlZk9mIChJbmRleCAoU0lGUiwgMHgwOCkpLCAweDAxKSwgTG9jYWwwKQ0KICAg ICAgICAgICAgICAgIE9yICgweDAyMDAwMDAwLCAweDAwMDEwMDAwLCBMb2NhbDEpDQogICAgICAg ICAgICAgICAgT3IgKExvY2FsMSwgTG9jYWwwLCBMb2NhbDEpDQogICAgICAgICAgICAgICAgXF9T Qi5QU1JWICgweDk2LCAweDE5MDAzNDM0LCAweDAxLCBMb2NhbDEsIDB4MDEpDQogICAgICAgICAg ICAgICAgUmVsZWFzZSAoSERNWCkNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgTWV0aG9k IChISU5ELCAxLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIEFj cXVpcmUgKEhETVgsIDB4RkZGRikNCiAgICAgICAgICAgICAgICBTdG9yZSAoQXJnMCwgSW5kZXgg KEhEQVQsIEhJTlApKQ0KICAgICAgICAgICAgICAgIEluY3JlbWVudCAoSElOUCkNCiAgICAgICAg ICAgICAgICBEaXZpZGUgKEhJTlAsIDB4MjAsIEhJTlApDQogICAgICAgICAgICAgICAgSWYgKExF cXVhbCAoSElOUCwgSE9VUCkpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAg ICBJbmNyZW1lbnQgKEhPVVApDQogICAgICAgICAgICAgICAgICAgIERpdmlkZSAoSE9VUCwgMHgy MCwgSE9VUCkNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBSZWxlYXNlIChI RE1YKQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICBNZXRob2QgKEhJTkYsIDAsIFNlcmlh bGl6ZWQpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgQWNxdWlyZSAoSERNWCwgMHhG RkZGKQ0KICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKEhJTlAsIEhPVVApKQ0KICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgU3RvcmUgKFplcm8sIExvY2FsMCkNCiAgICAg ICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgU3RvcmUgKERlcmVmT2YgKEluZGV4IChIREFULCBIT1VQKSksIExv Y2FsMCkNCiAgICAgICAgICAgICAgICAgICAgSW5jcmVtZW50IChIT1VQKQ0KICAgICAgICAgICAg ICAgICAgICBEaXZpZGUgKEhPVVAsIDB4MjAsIEhPVVApDQogICAgICAgICAgICAgICAgfQ0KDQog ICAgICAgICAgICAgICAgU3RvcmUgKExOb3QgKExFcXVhbCAoSElOUCwgSE9VUCkpLCBMb2NhbDEp DQogICAgICAgICAgICAgICAgUmVsZWFzZSAoSERNWCkNCiAgICAgICAgICAgICAgICBJZiAoTG9j YWwxKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgTm90aWZ5IChcX1NC LkhLRVksIDB4ODApDQogICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgUmV0dXJu IChMb2NhbDApDQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIE1ldGhvZCAoU1FUWSwgMCwg Tm90U2VyaWFsaXplZCkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBSZXR1cm4gKDB4 MEUpDQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIE1ldGhvZCAoU0lORiwgMCwgTm90U2Vy aWFsaXplZCkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBTdG9yZSAoXF9TQi5FQ1BG ICgweDAyMTUsIDB4MDAsIDB4MDApLCBMb2NhbDApDQogICAgICAgICAgICAgICAgT3IgKExvY2Fs MCwgMHgwMSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgIE9yIChMb2NhbDAsIDB4MDIsIExvY2Fs MCkNCiAgICAgICAgICAgICAgICBTdG9yZSAoTG9jYWwwLCBJbmRleCAoU0lGUiwgMHgwQSkpDQog ICAgICAgICAgICAgICAgUmV0dXJuIChTSUZSKQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAg ICBNZXRob2QgKFNTRVQsIDIsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgSWYgKExPciAoTEVxdWFsIChBcmcwLCAweDA0KSwgTEVxdWFsIChBcmcwLCAweDA3KSkp DQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBTdG9yZSAoQXJnMSwgSW5k ZXggKFNJRlIsIEFyZzApKQ0KICAgICAgICAgICAgICAgICAgICBPciAoMHgwNDAwMDAwMCwgMHgw MDAyMDAwMCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICBPciAoTG9jYWwwLCBBcmcxLCBM b2NhbDApDQogICAgICAgICAgICAgICAgICAgIFxfU0IuUFNSViAoMHg5NiwgMHgxOTAwMzQzNCwg MHgwMSwgTG9jYWwwLCAweDAzKQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAg IElmIChMRXF1YWwgKEFyZzAsIDB4MDgpKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgU3RvcmUgKEFyZzEsIEluZGV4IChTSUZSLCBBcmcwKSkNCiAgICAgICAgICAgICAg ICAgICAgXF9TQi5FQ1BGICgweDAyMDksIEFyZzEsIDB4MDApDQogICAgICAgICAgICAgICAgfQ0K DQogICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMCwgMHg4MCkpDQogICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChBcmcxLCAweDAxKSkNCiAgICAg ICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4RTIwMSwg TG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIEVsc2UN CiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4 RTIwMCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAg ICAgXF9TQi5FQ1BGICgweDAyMDgsIEFyZzEsIDB4MDApDQogICAgICAgICAgICAgICAgfQ0KDQog ICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMCwgMHgwRCkpDQogICAgICAgICAgICAgICAg ew0KICAgICAgICAgICAgICAgICAgICBTdG9yZSAoQXJnMSwgSW5kZXggKFNJRlIsIEFyZzApKQ0K ICAgICAgICAgICAgICAgICAgICBPciAoMHgwNDAwMDAwMCwgMHgwMDAzMDAwMCwgTG9jYWwwKQ0K ICAgICAgICAgICAgICAgICAgICBPciAoTG9jYWwwLCBBcmcxLCBMb2NhbDApDQogICAgICAgICAg ICAgICAgICAgIFxfU0IuUFNSViAoMHg5NiwgMHgxOTAwMzQzNCwgMHgwMSwgTG9jYWwwLCAweDAz KQ0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgTWV0aG9k IChIQUNULCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg IE5vdGlmeSAoUFdSQiwgMHg4MCkNCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgIH0NCg0K ICAgIFNjb3BlIChcX1BSKQ0KICAgIHsNCiAgICAgICAgUHJvY2Vzc29yIChDUFUwLCAweDAwLCAw eDAwMDAxMDEwLCAweDA2KSB7fQ0KICAgICAgICBQcm9jZXNzb3IgKENQVTEsIDB4MDEsIDB4MDAw MDEwMTAsIDB4MDYpIHt9DQogICAgfQ0KDQogICAgU2NvcGUgKFxfVFopDQogICAgew0KICAgICAg ICBUaGVybWFsWm9uZSAoVFpDKQ0KICAgICAgICB7DQogICAgICAgICAgICBOYW1lIChJTklULCBa ZXJvKQ0KICAgICAgICAgICAgTmFtZSAoQ1NDUCwgWmVybykNCiAgICAgICAgICAgIE5hbWUgKFBT ViwgMHgwRENBKQ0KICAgICAgICAgICAgTmFtZSAoQ1JULCAweDBFMkUpDQogICAgICAgICAgICBN ZXRob2QgKElOSVAsIDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgSWYgKExFcXVhbCAoSU5JVCwgWmVybykpDQogICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICBTdG9yZSAoXF9TQi5FQ1BGICgweDAyMDQsIFplcm8sIFplcm8pLCBDUlQp DQogICAgICAgICAgICAgICAgICAgIFN0b3JlIChcX1NCLkVDUEYgKDB4MDIwMywgWmVybywgWmVy byksIFBTVikNCiAgICAgICAgICAgICAgICAgICAgU3RvcmUgKFxfU0IuRUNQRiAoMHgwMjAyLCBa ZXJvLCBaZXJvKSwgX1RDMikNCiAgICAgICAgICAgICAgICAgICAgU3RvcmUgKE9uZSwgSU5JVCkN CiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIE5hbWUgKF9U QzEsIFplcm8pDQogICAgICAgICAgICBOYW1lIChfVEMyLCAweDBDKQ0KICAgICAgICAgICAgTmFt ZSAoX1RTUCwgMHgyOCkNCiAgICAgICAgICAgIE1ldGhvZCAoX1RNUCwgMCwgTm90U2VyaWFsaXpl ZCkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBTdG9yZSAoXF9TQi5FQ1BGICgweDAy MDEsIFplcm8sIFplcm8pLCBMb2NhbDApDQogICAgICAgICAgICAgICAgSWYgKExHcmVhdGVyIChM b2NhbDAsIENSVCkpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBcX1NC LlBTUlYgKDB4OUMsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDApDQogICAgICAgICAgICAgICAgfQ0K DQogICAgICAgICAgICAgICAgUmV0dXJuIChMb2NhbDApDQogICAgICAgICAgICB9DQoNCiAgICAg ICAgICAgIE1ldGhvZCAoX1BTViwgMCwgTm90U2VyaWFsaXplZCkNCiAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICBcX1RaLlRaQy5JTklQICgpDQogICAgICAgICAgICAgICAgUmV0dXJuIChQ U1YpDQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIE1ldGhvZCAoX1BTTCwgMCwgU2VyaWFs aXplZCkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBJZiAoSFRURSkNCiAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIFJldHVybiAoUGFja2FnZSAoMHgwMikNCiAg ICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgXF9QUi5DUFUwLCAN CiAgICAgICAgICAgICAgICAgICAgICAgIFxfUFIuQ1BVMQ0KICAgICAgICAgICAgICAgICAgICB9 KQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIFJldHVybiAoUGFja2FnZSAo MHgwMSkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIFxfUFIuQ1BVMA0K ICAgICAgICAgICAgICAgIH0pDQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIE1ldGhvZCAo X0NSVCwgMCwgTm90U2VyaWFsaXplZCkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBc X1RaLlRaQy5JTklQICgpDQogICAgICAgICAgICAgICAgUmV0dXJuIChDUlQpDQogICAgICAgICAg ICB9DQoNCiAgICAgICAgICAgIE1ldGhvZCAoX1NDUCwgMSwgTm90U2VyaWFsaXplZCkNCiAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICBTdG9yZSAoQXJnMCwgQ1NDUCkNCiAgICAgICAgICAg ICAgICBTdG9yZSAoWmVybywgSU5JVCkNCiAgICAgICAgICAgICAgICBcX1RaLlRaQy5JTklQICgp DQogICAgICAgICAgICAgICAgTm90aWZ5IChcX1RaLlRaQywgMHg4MSkNCiAgICAgICAgICAgIH0N CiAgICAgICAgfQ0KICAgIH0NCg0KICAgIFNjb3BlIChcX1NJKQ0KICAgIHsNCiAgICAgICAgTWV0 aG9kIChfU1NULCAxLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICB7DQogICAgICAgICAgICBJZiAo TEFuZCAoTE5vdCAoTEVxdWFsIChBcmcwLCAweDA0KSksIExOb3QgKExFcXVhbCAoQXJnMCwgMHgw MCkpKSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBcX1NCLlBTUlYgKDB4OTIsIDB4 MDEsIDB4MDEsIEFyZzAsIDB4MDApDQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICB9DQoN CiAgICBOYW1lIChfUzAsIFBhY2thZ2UgKDB4MDMpDQogICAgew0KICAgICAgICAweDAwLCANCiAg ICAgICAgMHgwMCwgDQogICAgICAgIDB4MDANCiAgICB9KQ0KICAgIE5hbWUgKF9TMywgUGFja2Fn ZSAoMHgwMykNCiAgICB7DQogICAgICAgIDB4MDUsIA0KICAgICAgICAweDA1LCANCiAgICAgICAg MHgwMA0KICAgIH0pDQogICAgTmFtZSAoX1M0LCBQYWNrYWdlICgweDAzKQ0KICAgIHsNCiAgICAg ICAgMHgwNiwgDQogICAgICAgIDB4MDYsIA0KICAgICAgICAweDAwDQogICAgfSkNCiAgICBOYW1l IChfUzUsIFBhY2thZ2UgKDB4MDMpDQogICAgew0KICAgICAgICAweDA3LCANCiAgICAgICAgMHgw NywgDQogICAgICAgIDB4MDANCiAgICB9KQ0KICAgIE5hbWUgKEZXU08sICJGV1NPIikNCiAgICBN ZXRob2QgKF9XQUssIDEsIE5vdFNlcmlhbGl6ZWQpDQogICAgew0KICAgICAgICBcX1NCLlBTUlYg KDB4OTIsIDB4MDMsIDB4MDEsIFxDS09TICgpLCAweDAwKQ0KICAgICAgICBJZiAoTE9yIChMRXF1 YWwgKEFyZzAsIDB4MDQpLCBMRXF1YWwgKEFyZzAsIDB4MDMpKSkNCiAgICAgICAgew0KICAgICAg ICAgICAgU3RvcmUgKFxfU0IuUFNSViAoMHg5MywgMHgwMSwgMHgwMCwgMHgwMCwgMHgwMyksIExv Y2FsMCkNCiAgICAgICAgICAgIElmIChMT3IgKExFcXVhbCAoTG9jYWwwLCAweDA2KSwgTEVxdWFs IChMb2NhbDAsIDB4MDEpKSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBOb3RpZnkg KFxfU0IuUFdSQiwgMHgwMikNCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KDQogICAgICAgIElm IChMQW5kIChMTm90IChMTGVzcyAoQXJnMCwgMHgwMykpLCBMTm90IChMR3JlYXRlciAoQXJnMCwg MHgwNSkpKSkNCiAgICAgICAgew0KICAgICAgICAgICAgXF9TQi5IS0VZLkhSRVMgKCkNCiAgICAg ICAgfQ0KDQogICAgICAgIFxfU0IuRUNQRiAoMHgwMjA2LCAweDAwLCAweDAwKQ0KICAgICAgICBT dG9yZSAoXF9TQi5FQ1BGICgweDAxMDEsIDB4MDAsIDB4MDApLCBMb2NhbDApDQogICAgICAgIElm IChYT3IgKFxfU0IuQkFTVCwgTG9jYWwwKSkNCiAgICAgICAgew0KICAgICAgICAgICAgSWYgKExF cXVhbCAoTG9jYWwwLCAweDAxKSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBOb3Rp ZnkgKFxfU0IuQkFUQSwgMHgwMCkNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIEVsc2UNCiAg ICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBOb3RpZnkgKFxfU0IuQkFUQSwgMHgwMSkNCiAg ICAgICAgICAgIH0NCiAgICAgICAgfQ0KDQogICAgICAgIFxfU0IuQURBQyAoKQ0KICAgICAgICBc X1NCLlBTUlYgKDB4QjgsIDB4MDEsIDB4MDAsIDB4MDAsIDB4MDApDQogICAgICAgIFJldHVybiAo UGFja2FnZSAoMHgwMikNCiAgICAgICAgew0KICAgICAgICAgICAgMHgwMCwgDQogICAgICAgICAg ICAweDAwDQogICAgICAgIH0pDQogICAgfQ0KDQogICAgU2NvcGUgKF9HUEUpDQogICAgew0KICAg ICAgICBNZXRob2QgKF9MMEIsIDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgIHsNCiAgICAgICAg ICAgIE5vdGlmeSAoXF9TQi5QQ0kwLlBDSUIsIDB4MDIpDQogICAgICAgIH0NCg0KICAgICAgICBN ZXRob2QgKF9MMUIsIDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgIHsNCiAgICAgICAgICAgIE5v dGlmeSAoXF9TQi5MSUQsIDB4MDIpDQogICAgICAgIH0NCiAgICB9DQoNCiAgICBTY29wZSAoXF9T QikNCiAgICB7DQogICAgICAgIE5hbWUgKFxHUElDLCAweDAwKQ0KICAgICAgICBNZXRob2QgKFxf UElDLCAxLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICB7DQogICAgICAgICAgICBTdG9yZSAoQXJn MCwgR1BJQykNCiAgICAgICAgfQ0KDQogICAgICAgIERldmljZSAoUENJMCkNCiAgICAgICAgew0K ICAgICAgICAgICAgTWV0aG9kIChfSU5JLCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICAgICAg ew0KICAgICAgICAgICAgICAgIFxfU0IuUFNSViAoMHg5MiwgMHgwMywgMHgwMSwgXENLT1MgKCks IDB4MDApDQogICAgICAgICAgICAgICAgR0lOSSAoKQ0KICAgICAgICAgICAgICAgIEFJTkkgKCkN CiAgICAgICAgICAgICAgICBcX1NCLlBTUlYgKDB4QjgsIDB4MDEsIDB4MDAsIDB4MDAsIDB4MDAp DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIE5hbWUgKF9ISUQsIEVpc2FJZCAoIlBOUDBB MDgiKSkNCiAgICAgICAgICAgIE5hbWUgKF9DSUQsIDB4MDMwQUQwNDEpDQogICAgICAgICAgICBO YW1lIChfQURSLCAweDAwKQ0KICAgICAgICAgICAgTmFtZSAoX0JCTiwgMHgwMCkNCiAgICAgICAg ICAgIE9wZXJhdGlvblJlZ2lvbiAoSEJVUywgUENJX0NvbmZpZywgMHg0MCwgMHhDMCkNCiAgICAg ICAgICAgIEZpZWxkIChIQlVTLCBEV29yZEFjYywgTm9Mb2NrLCBQcmVzZXJ2ZSkNCiAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICBPZmZzZXQgKDB4NTApLCANCiAgICAgICAgICAgICAgICAg ICAgLCAgIDQsIA0KICAgICAgICAgICAgICAgIFBNMEgsICAgMiwgDQogICAgICAgICAgICAgICAg T2Zmc2V0ICgweDUxKSwgDQogICAgICAgICAgICAgICAgUE0xTCwgICAyLCANCiAgICAgICAgICAg ICAgICAgICAgLCAgIDIsIA0KICAgICAgICAgICAgICAgIFBNMUgsICAgMiwgDQogICAgICAgICAg ICAgICAgT2Zmc2V0ICgweDUyKSwgDQogICAgICAgICAgICAgICAgUE0yTCwgICAyLCANCiAgICAg ICAgICAgICAgICAgICAgLCAgIDIsIA0KICAgICAgICAgICAgICAgIFBNMkgsICAgMiwgDQogICAg ICAgICAgICAgICAgT2Zmc2V0ICgweDUzKSwgDQogICAgICAgICAgICAgICAgUE0zTCwgICAyLCAN CiAgICAgICAgICAgICAgICAgICAgLCAgIDIsIA0KICAgICAgICAgICAgICAgIFBNM0gsICAgMiwg DQogICAgICAgICAgICAgICAgT2Zmc2V0ICgweDU0KSwgDQogICAgICAgICAgICAgICAgUE00TCwg ICAyLCANCiAgICAgICAgICAgICAgICAgICAgLCAgIDIsIA0KICAgICAgICAgICAgICAgIFBNNEgs ICAgMiwgDQogICAgICAgICAgICAgICAgT2Zmc2V0ICgweDU1KSwgDQogICAgICAgICAgICAgICAg UE01TCwgICAyLCANCiAgICAgICAgICAgICAgICAgICAgLCAgIDIsIA0KICAgICAgICAgICAgICAg IFBNNUgsICAgMiwgDQogICAgICAgICAgICAgICAgT2Zmc2V0ICgweDU2KSwgDQogICAgICAgICAg ICAgICAgUE02TCwgICAyLCANCiAgICAgICAgICAgICAgICAgICAgLCAgIDIsIA0KICAgICAgICAg ICAgICAgIFBNNkgsICAgMiwgDQogICAgICAgICAgICAgICAgT2Zmc2V0ICgweDU3KSwgDQogICAg ICAgICAgICAgICAgICAgICwgICA3LCANCiAgICAgICAgICAgICAgICBIRU5BLCAgIDEsIA0KICAg ICAgICAgICAgICAgIE9mZnNldCAoMHg1QyksIA0KICAgICAgICAgICAgICAgICAgICAsICAgMywg DQogICAgICAgICAgICAgICAgVE9VRCwgICA1DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAg IE5hbWUgKEJVRjAsIFJlc291cmNlVGVtcGxhdGUgKCkNCiAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICBXb3JkQnVzTnVtYmVyIChSZXNvdXJjZVByb2R1Y2VyLCBNaW5GaXhlZCwgTWF4Rml4 ZWQsIFBvc0RlY29kZSwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDAwLA0KICAgICAgICAgICAg ICAgICAgICAweDAwMDAsDQogICAgICAgICAgICAgICAgICAgIDB4MDBGRiwNCiAgICAgICAgICAg ICAgICAgICAgMHgwMDAwLA0KICAgICAgICAgICAgICAgICAgICAweDAxMDAsIDB4MDApDQogICAg ICAgICAgICAgICAgRFdvcmRJTyAoUmVzb3VyY2VQcm9kdWNlciwgTWluRml4ZWQsIE1heEZpeGVk LCBQb3NEZWNvZGUsIEVudGlyZVJhbmdlLA0KICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAw LA0KICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLA0KICAgICAgICAgICAgICAgICAgICAw eDAwMDAwQ0Y3LA0KICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLA0KICAgICAgICAgICAg ICAgICAgICAweDAwMDAwQ0Y4LCAweDAwKQ0KICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwg MHgwQ0Y4LCAweDBDRjgsIDB4MDEsIDB4MDgpDQogICAgICAgICAgICAgICAgRFdvcmRJTyAoUmVz b3VyY2VQcm9kdWNlciwgTWluRml4ZWQsIE1heEZpeGVkLCBQb3NEZWNvZGUsIEVudGlyZVJhbmdl LA0KICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLA0KICAgICAgICAgICAgICAgICAgICAw eDAwMDAwRDAwLA0KICAgICAgICAgICAgICAgICAgICAweDAwMDBGRkZGLA0KICAgICAgICAgICAg ICAgICAgICAweDAwMDAwMDAwLA0KICAgICAgICAgICAgICAgICAgICAweDAwMDBGMzAwLCAweDAw KQ0KICAgICAgICAgICAgICAgIERXb3JkTWVtb3J5IChSZXNvdXJjZVByb2R1Y2VyLCBQb3NEZWNv ZGUsIE1pbkZpeGVkLCBNYXhGaXhlZCwgQ2FjaGVhYmxlLCBSZWFkV3JpdGUsDQogICAgICAgICAg ICAgICAgICAgIDB4MDAwMDAwMDAsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwQTAwMDAsDQog ICAgICAgICAgICAgICAgICAgIDB4MDAwQkZGRkYsDQogICAgICAgICAgICAgICAgICAgIDB4MDAw MDAwMDAsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwMjAwMDAsIDB4MDApDQogICAgICAgICAg ICAgICAgRFdvcmRNZW1vcnkgKFJlc291cmNlUHJvZHVjZXIsIFBvc0RlY29kZSwgTWluRml4ZWQs IE1heEZpeGVkLCBDYWNoZWFibGUsIFJlYWRXcml0ZSwNCiAgICAgICAgICAgICAgICAgICAgMHgw MDAwMDAwMCwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDBDMDAwMCwNCiAgICAgICAgICAgICAg ICAgICAgMHgwMDBDM0ZGRiwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMCwNCiAgICAg ICAgICAgICAgICAgICAgMHgwMDAwNDAwMCwgMHgwMCkNCiAgICAgICAgICAgICAgICBEV29yZE1l bW9yeSAoUmVzb3VyY2VQcm9kdWNlciwgUG9zRGVjb2RlLCBNaW5GaXhlZCwgTWF4Rml4ZWQsIENh Y2hlYWJsZSwgUmVhZFdyaXRlLA0KICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLA0KICAg ICAgICAgICAgICAgICAgICAweDAwMEM0MDAwLA0KICAgICAgICAgICAgICAgICAgICAweDAwMEM3 RkZGLA0KICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLA0KICAgICAgICAgICAgICAgICAg ICAweDAwMDA0MDAwLCAweDAwKQ0KICAgICAgICAgICAgICAgIERXb3JkTWVtb3J5IChSZXNvdXJj ZVByb2R1Y2VyLCBQb3NEZWNvZGUsIE1pbkZpeGVkLCBNYXhGaXhlZCwgQ2FjaGVhYmxlLCBSZWFk V3JpdGUsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDAsDQogICAgICAgICAgICAgICAg ICAgIDB4MDAwQzgwMDAsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwQ0JGRkYsDQogICAgICAg ICAgICAgICAgICAgIDB4MDAwMDAwMDAsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwMDQwMDAs IDB4MDApDQogICAgICAgICAgICAgICAgRFdvcmRNZW1vcnkgKFJlc291cmNlUHJvZHVjZXIsIFBv c0RlY29kZSwgTWluRml4ZWQsIE1heEZpeGVkLCBDYWNoZWFibGUsIFJlYWRXcml0ZSwNCiAgICAg ICAgICAgICAgICAgICAgMHgwMDAwMDAwMCwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDBDQzAw MCwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDBDRkZGRiwNCiAgICAgICAgICAgICAgICAgICAg MHgwMDAwMDAwMCwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDAwNDAwMCwgMHgwMCkNCiAgICAg ICAgICAgICAgICBEV29yZE1lbW9yeSAoUmVzb3VyY2VQcm9kdWNlciwgUG9zRGVjb2RlLCBNaW5G aXhlZCwgTWF4Rml4ZWQsIENhY2hlYWJsZSwgUmVhZFdyaXRlLA0KICAgICAgICAgICAgICAgICAg ICAweDAwMDAwMDAwLA0KICAgICAgICAgICAgICAgICAgICAweDAwMEQwMDAwLA0KICAgICAgICAg ICAgICAgICAgICAweDAwMEQzRkZGLA0KICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLA0K ICAgICAgICAgICAgICAgICAgICAweDAwMDA0MDAwLCAweDAwKQ0KICAgICAgICAgICAgICAgIERX b3JkTWVtb3J5IChSZXNvdXJjZVByb2R1Y2VyLCBQb3NEZWNvZGUsIE1pbkZpeGVkLCBNYXhGaXhl ZCwgQ2FjaGVhYmxlLCBSZWFkV3JpdGUsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDAs DQogICAgICAgICAgICAgICAgICAgIDB4MDAwRDQwMDAsDQogICAgICAgICAgICAgICAgICAgIDB4 MDAwRDdGRkYsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDAsDQogICAgICAgICAgICAg ICAgICAgIDB4MDAwMDQwMDAsIDB4MDApDQogICAgICAgICAgICAgICAgRFdvcmRNZW1vcnkgKFJl c291cmNlUHJvZHVjZXIsIFBvc0RlY29kZSwgTWluRml4ZWQsIE1heEZpeGVkLCBDYWNoZWFibGUs IFJlYWRXcml0ZSwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMCwNCiAgICAgICAgICAg ICAgICAgICAgMHgwMDBEODAwMCwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDBEQkZGRiwNCiAg ICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMCwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDAw NDAwMCwgMHgwMCkNCiAgICAgICAgICAgICAgICBEV29yZE1lbW9yeSAoUmVzb3VyY2VQcm9kdWNl ciwgUG9zRGVjb2RlLCBNaW5GaXhlZCwgTWF4Rml4ZWQsIENhY2hlYWJsZSwgUmVhZFdyaXRlLA0K ICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLA0KICAgICAgICAgICAgICAgICAgICAweDAw MERDMDAwLA0KICAgICAgICAgICAgICAgICAgICAweDAwMERGRkZGLA0KICAgICAgICAgICAgICAg ICAgICAweDAwMDAwMDAwLA0KICAgICAgICAgICAgICAgICAgICAweDAwMDA0MDAwLCAweDAwKQ0K ICAgICAgICAgICAgICAgIERXb3JkTWVtb3J5IChSZXNvdXJjZVByb2R1Y2VyLCBQb3NEZWNvZGUs IE1pbkZpeGVkLCBNYXhGaXhlZCwgQ2FjaGVhYmxlLCBSZWFkV3JpdGUsDQogICAgICAgICAgICAg ICAgICAgIDB4MDAwMDAwMDAsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwRTAwMDAsDQogICAg ICAgICAgICAgICAgICAgIDB4MDAwRTNGRkYsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwMDAw MDAsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwMDQwMDAsIDB4MDApDQogICAgICAgICAgICAg ICAgRFdvcmRNZW1vcnkgKFJlc291cmNlUHJvZHVjZXIsIFBvc0RlY29kZSwgTWluRml4ZWQsIE1h eEZpeGVkLCBDYWNoZWFibGUsIFJlYWRXcml0ZSwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDAw MDAwMCwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDBFNDAwMCwNCiAgICAgICAgICAgICAgICAg ICAgMHgwMDBFN0ZGRiwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMCwNCiAgICAgICAg ICAgICAgICAgICAgMHgwMDAwNDAwMCwgMHgwMCkNCiAgICAgICAgICAgICAgICBEV29yZE1lbW9y eSAoUmVzb3VyY2VQcm9kdWNlciwgUG9zRGVjb2RlLCBNaW5GaXhlZCwgTWF4Rml4ZWQsIENhY2hl YWJsZSwgUmVhZFdyaXRlLA0KICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLA0KICAgICAg ICAgICAgICAgICAgICAweDAwMEU4MDAwLA0KICAgICAgICAgICAgICAgICAgICAweDAwMEVCRkZG LA0KICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLA0KICAgICAgICAgICAgICAgICAgICAw eDAwMDA0MDAwLCAweDAwKQ0KICAgICAgICAgICAgICAgIERXb3JkTWVtb3J5IChSZXNvdXJjZVBy b2R1Y2VyLCBQb3NEZWNvZGUsIE1pbkZpeGVkLCBNYXhGaXhlZCwgQ2FjaGVhYmxlLCBSZWFkV3Jp dGUsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwMDAwMDAsDQogICAgICAgICAgICAgICAgICAg IDB4MDAwRUMwMDAsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwRUZGRkYsDQogICAgICAgICAg ICAgICAgICAgIDB4MDAwMDAwMDAsDQogICAgICAgICAgICAgICAgICAgIDB4MDAwMDQwMDAsIDB4 MDApDQogICAgICAgICAgICAgICAgRFdvcmRNZW1vcnkgKFJlc291cmNlUHJvZHVjZXIsIFBvc0Rl Y29kZSwgTWluRml4ZWQsIE1heEZpeGVkLCBDYWNoZWFibGUsIFJlYWRXcml0ZSwNCiAgICAgICAg ICAgICAgICAgICAgMHgwMDAwMDAwMCwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDBGMDAwMCwN CiAgICAgICAgICAgICAgICAgICAgMHgwMDBGRkZGRiwNCiAgICAgICAgICAgICAgICAgICAgMHgw MDAwMDAwMCwNCiAgICAgICAgICAgICAgICAgICAgMHgwMDAxMDAwMCwgMHgwMCkNCiAgICAgICAg ICAgICAgICBEV29yZE1lbW9yeSAoUmVzb3VyY2VQcm9kdWNlciwgUG9zRGVjb2RlLCBNaW5GaXhl ZCwgTWF4Rml4ZWQsIENhY2hlYWJsZSwgUmVhZFdyaXRlLA0KICAgICAgICAgICAgICAgICAgICAw eDAwMDAwMDAwLA0KICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLA0KICAgICAgICAgICAg ICAgICAgICAweEZFQkZGRkZGLA0KICAgICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLA0KICAg ICAgICAgICAgICAgICAgICAweDAwMDAwMDAwLCAweDAwKQ0KICAgICAgICAgICAgfSkNCiAgICAg ICAgICAgIE1ldGhvZCAoX0NSUywgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICBJZiAoUE0xTCkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg ICAgIENyZWF0ZURXb3JkRmllbGQgKEJVRjAsIDB4ODAsIEMwTE4pDQogICAgICAgICAgICAgICAg ICAgIFN0b3JlIChaZXJvLCBDMExOKQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAg ICAgIElmIChMRXF1YWwgKFBNMUwsIDB4MDEpKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICAgICAgQ3JlYXRlQml0RmllbGQgKEJVRjAsIDB4MDM3OCwgQzBSVykNCiAgICAgICAg ICAgICAgICAgICAgU3RvcmUgKFplcm8sIEMwUlcpDQogICAgICAgICAgICAgICAgfQ0KDQogICAg ICAgICAgICAgICAgSWYgKFBNMUgpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICBDcmVhdGVEV29yZEZpZWxkIChCVUYwLCAweDlCLCBDNExOKQ0KICAgICAgICAgICAgICAg ICAgICBTdG9yZSAoWmVybywgQzRMTikNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAg ICAgICBJZiAoTEVxdWFsIChQTTFILCAweDAxKSkNCiAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgIENyZWF0ZUJpdEZpZWxkIChCVUYwLCAweDA0NTAsIEM0UlcpDQogICAgICAg ICAgICAgICAgICAgIFN0b3JlIChaZXJvLCBDNFJXKQ0KICAgICAgICAgICAgICAgIH0NCg0KICAg ICAgICAgICAgICAgIElmIChQTTJMKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQlVGMCwgMHhCNiwgQzhMTikNCiAgICAgICAgICAgICAg ICAgICAgU3RvcmUgKFplcm8sIEM4TE4pDQogICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAg ICAgICAgSWYgKExFcXVhbCAoUE0yTCwgMHgwMSkpDQogICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICBDcmVhdGVCaXRGaWVsZCAoQlVGMCwgMHgwNTI4LCBDOFJXKQ0KICAgICAg ICAgICAgICAgICAgICBTdG9yZSAoWmVybywgQzhSVykNCiAgICAgICAgICAgICAgICB9DQoNCiAg ICAgICAgICAgICAgICBJZiAoUE0ySCkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAg ICAgICAgIENyZWF0ZURXb3JkRmllbGQgKEJVRjAsIDB4RDEsIENDTE4pDQogICAgICAgICAgICAg ICAgICAgIFN0b3JlIChaZXJvLCBDQ0xOKQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAg ICAgICAgIElmIChMRXF1YWwgKFBNMkgsIDB4MDEpKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICAgICAgQ3JlYXRlQml0RmllbGQgKEJVRjAsIDB4MDYwMCwgQ0NSVykNCiAgICAg ICAgICAgICAgICAgICAgU3RvcmUgKFplcm8sIENDUlcpDQogICAgICAgICAgICAgICAgfQ0KDQog ICAgICAgICAgICAgICAgSWYgKFBNM0wpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICBDcmVhdGVEV29yZEZpZWxkIChCVUYwLCAweEVDLCBEMExOKQ0KICAgICAgICAgICAg ICAgICAgICBTdG9yZSAoWmVybywgRDBMTikNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAg ICAgICAgICBJZiAoTEVxdWFsIChQTTNMLCAweDAxKSkNCiAgICAgICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgICAgIENyZWF0ZUJpdEZpZWxkIChCVUYwLCAweDA2RDgsIEQwUlcpDQogICAg ICAgICAgICAgICAgICAgIFN0b3JlIChaZXJvLCBEMFJXKQ0KICAgICAgICAgICAgICAgIH0NCg0K ICAgICAgICAgICAgICAgIElmIChQTTNIKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQlVGMCwgMHgwMTA3LCBENExOKQ0KICAgICAgICAg ICAgICAgICAgICBTdG9yZSAoWmVybywgRDRMTikNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAg ICAgICAgICAgICBJZiAoTEVxdWFsIChQTTNILCAweDAxKSkNCiAgICAgICAgICAgICAgICB7DQog ICAgICAgICAgICAgICAgICAgIENyZWF0ZUJpdEZpZWxkIChCVUYwLCAweDA3QjAsIEQ0UlcpDQog ICAgICAgICAgICAgICAgICAgIFN0b3JlIChaZXJvLCBENFJXKQ0KICAgICAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgICAgIElmIChQTTRMKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQlVGMCwgMHgwMTIyLCBEOExOKQ0KICAgICAg ICAgICAgICAgICAgICBTdG9yZSAoWmVybywgRDhMTikNCiAgICAgICAgICAgICAgICB9DQoNCiAg ICAgICAgICAgICAgICBJZiAoTEVxdWFsIChQTTRMLCAweDAxKSkNCiAgICAgICAgICAgICAgICB7 DQogICAgICAgICAgICAgICAgICAgIENyZWF0ZUJpdEZpZWxkIChCVUYwLCAweDA4ODgsIEQ4Ulcp DQogICAgICAgICAgICAgICAgICAgIFN0b3JlIChaZXJvLCBEOFJXKQ0KICAgICAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgICAgIElmIChQTTRIKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQlVGMCwgMHgwMTNELCBEQ0xOKQ0KICAg ICAgICAgICAgICAgICAgICBTdG9yZSAoWmVybywgRENMTikNCiAgICAgICAgICAgICAgICB9DQoN CiAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChQTTRILCAweDAxKSkNCiAgICAgICAgICAgICAg ICB7DQogICAgICAgICAgICAgICAgICAgIENyZWF0ZUJpdEZpZWxkIChCVUYwLCAweDA5NjAsIERD UlcpDQogICAgICAgICAgICAgICAgICAgIFN0b3JlIChaZXJvLCBEQ1JXKQ0KICAgICAgICAgICAg ICAgIH0NCg0KICAgICAgICAgICAgICAgIElmIChQTTVMKQ0KICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQlVGMCwgMHgwMTU4LCBFMExOKQ0K ICAgICAgICAgICAgICAgICAgICBTdG9yZSAoWmVybywgRTBMTikNCiAgICAgICAgICAgICAgICB9 DQoNCiAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChQTTVMLCAweDAxKSkNCiAgICAgICAgICAg ICAgICB7DQogICAgICAgICAgICAgICAgICAgIENyZWF0ZUJpdEZpZWxkIChCVUYwLCAweDBBMzgs IEUwUlcpDQogICAgICAgICAgICAgICAgICAgIFN0b3JlIChaZXJvLCBFMFJXKQ0KICAgICAgICAg ICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIElmIChQTTVIKQ0KICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQlVGMCwgMHgwMTczLCBFNExO KQ0KICAgICAgICAgICAgICAgICAgICBTdG9yZSAoWmVybywgRTRMTikNCiAgICAgICAgICAgICAg ICB9DQoNCiAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChQTTVILCAweDAxKSkNCiAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIENyZWF0ZUJpdEZpZWxkIChCVUYwLCAweDBC MTAsIEU0UlcpDQogICAgICAgICAgICAgICAgICAgIFN0b3JlIChaZXJvLCBFNFJXKQ0KICAgICAg ICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIElmIChQTTZMKQ0KICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQlVGMCwgMHgwMThFLCBF OExOKQ0KICAgICAgICAgICAgICAgICAgICBTdG9yZSAoWmVybywgRThMTikNCiAgICAgICAgICAg ICAgICB9DQoNCiAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChQTTZMLCAweDAxKSkNCiAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIENyZWF0ZUJpdEZpZWxkIChCVUYwLCAw eDBCRTgsIEU4UlcpDQogICAgICAgICAgICAgICAgICAgIFN0b3JlIChaZXJvLCBFOFJXKQ0KICAg ICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIElmIChQTTZIKQ0KICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQlVGMCwgMHgwMUE5 LCBFQ0xOKQ0KICAgICAgICAgICAgICAgICAgICBTdG9yZSAoWmVybywgRUNMTikNCiAgICAgICAg ICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChQTTZILCAweDAxKSkNCiAg ICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIENyZWF0ZUJpdEZpZWxkIChCVUYw LCAweDBDQzAsIEVDUlcpDQogICAgICAgICAgICAgICAgICAgIFN0b3JlIChaZXJvLCBFQ1JXKQ0K ICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIElmIChQTTBIKQ0KICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQlVGMCwgMHgw MUM0LCBGMExOKQ0KICAgICAgICAgICAgICAgICAgICBTdG9yZSAoWmVybywgRjBMTikNCiAgICAg ICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChQTTBILCAweDAxKSkN CiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIENyZWF0ZUJpdEZpZWxkIChC VUYwLCAweDBEOTgsIEYwUlcpDQogICAgICAgICAgICAgICAgICAgIFN0b3JlIChaZXJvLCBGMFJX KQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIENyZWF0ZURXb3JkRmllbGQg KEJVRjAsIDB4MDFEMywgTTFNTikNCiAgICAgICAgICAgICAgICBDcmVhdGVEV29yZEZpZWxkIChC VUYwLCAweDAxRDcsIE0xTVgpDQogICAgICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQlVG MCwgMHgwMURGLCBNMUxOKQ0KICAgICAgICAgICAgICAgIFNoaWZ0TGVmdCAoVE9VRCwgMHgxQiwg TTFNTikNCiAgICAgICAgICAgICAgICBBZGQgKFN1YnRyYWN0IChNMU1YLCBNMU1OKSwgMHgwMSwg TTFMTikNCiAgICAgICAgICAgICAgICBSZXR1cm4gKEJVRjApDQogICAgICAgICAgICB9DQoNCiAg ICAgICAgICAgIERldmljZSAoT1BSTSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBO YW1lIChfSElELCBFaXNhSWQgKCJQTlAwQzAyIikpDQogICAgICAgICAgICAgICAgTmFtZSAoX1VJ RCwgMHgxMDAwKQ0KICAgICAgICAgICAgICAgIE5hbWUgKFJTUkMsIFJlc291cmNlVGVtcGxhdGUg KCkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIE1lbW9yeTMyRml4ZWQg KFJlYWRPbmx5LCAweDAwMDAwMDAwLCAweDAwMDAwMDAwKQ0KICAgICAgICAgICAgICAgIH0pDQog ICAgICAgICAgICAgICAgTWV0aG9kIChJU1NELCAxLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4MDMsIExvY2FsMCkNCiAgICAg ICAgICAgICAgICAgICAgSWYgKEFuZCAoQXJnMCwgMHg0MDAwKSkNCiAgICAgICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4MzAsIExvY2FsMCkNCiAgICAg ICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIFN0b3JlIChTaGlmdFJpZ2h0 IChTdWJ0cmFjdCAoQXJnMCwgMHgwMDBDMDAwMCksIDB4MEYpLCBMb2NhbDEpDQogICAgICAgICAg ICAgICAgICAgIElmIChMRXF1YWwgKExvY2FsMSwgMHgwMCkpDQogICAgICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEFkZCAoTXVsdGlwbHkgKFxfU0IuUENJMC5QTTFI LCAweDEwKSwgXF9TQi5QQ0kwLlBNMUwsIExvY2FsMikNCiAgICAgICAgICAgICAgICAgICAgfQ0K DQogICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKExvY2FsMSwgMHgwMSkpDQogICAgICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEFkZCAoTXVsdGlwbHkgKFxf U0IuUENJMC5QTTJILCAweDEwKSwgXF9TQi5QQ0kwLlBNMkwsIExvY2FsMikNCiAgICAgICAgICAg ICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKExvY2FsMSwgMHgw MikpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEFkZCAo TXVsdGlwbHkgKFxfU0IuUENJMC5QTTNILCAweDEwKSwgXF9TQi5QQ0kwLlBNM0wsIExvY2FsMikN CiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwg KExvY2FsMSwgMHgwMykpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgICAgIEFkZCAoTXVsdGlwbHkgKFxfU0IuUENJMC5QTTRILCAweDEwKSwgXF9TQi5QQ0kwLlBN NEwsIExvY2FsMikNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAg IElmIChMRXF1YWwgKExvY2FsMSwgMHgwNCkpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICAgICAgICAgIEFkZCAoTXVsdGlwbHkgKFxfU0IuUENJMC5QTTVILCAweDEwKSwg XF9TQi5QQ0kwLlBNNUwsIExvY2FsMikNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAg ICAgICAgICAgICAgIElmIChMRXF1YWwgKExvY2FsMSwgMHgwNSkpDQogICAgICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEFkZCAoTXVsdGlwbHkgKFxfU0IuUENJMC5Q TTZILCAweDEwKSwgXF9TQi5QQ0kwLlBNNkwsIExvY2FsMikNCiAgICAgICAgICAgICAgICAgICAg fQ0KDQogICAgICAgICAgICAgICAgICAgIFJldHVybiAoQW5kIChMb2NhbDIsIExvY2FsMCkpDQog ICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgTWV0aG9kIChST01TLCAxLCBOb3RT ZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgSWYgKElT U0QgKEFyZzApKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAg ICBPcGVyYXRpb25SZWdpb24gKFhST00sIFN5c3RlbU1lbW9yeSwgQXJnMCwgMHgwNCkNCiAgICAg ICAgICAgICAgICAgICAgICAgIEZpZWxkIChYUk9NLCBCeXRlQWNjLCBOb0xvY2ssIFByZXNlcnZl KQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAg IFNJRywgICAgMTYsIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNJWiwgICAgOA0KICAg ICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVx dWFsIChTSUcsIDB4QUE1NSkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgUmV0dXJuIChNdWx0aXBseSAoU0laLCAweDAyMDApKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAg ICAgICAgICAgUmV0dXJuIChaZXJvKQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAg ICAgIE1ldGhvZCAoTVJTQywgMiwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgICAgIE5hbWUgKEJVRkYsIEJ1ZmZlciAoU3VidHJhY3QgKFNpemVPZiAoQXJn MCksIDB4MDIpKSB7fSkNCiAgICAgICAgICAgICAgICAgICAgU3RvcmUgKFplcm8sIExvY2FsMCkN CiAgICAgICAgICAgICAgICAgICAgV2hpbGUgKExMZXNzIChMb2NhbDAsIFN1YnRyYWN0IChTaXpl T2YgKEFyZzApLCAweDAyKSkpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgIFN0b3JlIChEZXJlZk9mIChJbmRleCAoQXJnMCwgTG9jYWwwKSksIEluZGV4IChC VUZGLCBMb2NhbDApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgSW5jcmVtZW50IChMb2NhbDAp DQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBDb25jYXRlbmF0 ZSAoQlVGRiwgQXJnMSwgTG9jYWwxKQ0KICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKExvY2Fs MSkNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBNZXRob2QgKFJTVkEsIDMs IFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBOYW1l IChGWFJTLCBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICAgICAgICAgIE1lbW9yeTMyRml4ZWQgKFJlYWRPbmx5LCAweDAwMDAwMDAwLCAw eDAwMDAwMDAwKQ0KICAgICAgICAgICAgICAgICAgICB9KQ0KICAgICAgICAgICAgICAgICAgICBD cmVhdGVEV29yZEZpZWxkIChGWFJTLCAweDA0LCBST01CKQ0KICAgICAgICAgICAgICAgICAgICBD cmVhdGVEV29yZEZpZWxkIChGWFJTLCAweDA4LCBST01MKQ0KICAgICAgICAgICAgICAgICAgICBT dG9yZSAoQXJnMSwgUk9NQikNCiAgICAgICAgICAgICAgICAgICAgU3VidHJhY3QgKEFyZzIsIEFy ZzEsIFJPTUwpDQogICAgICAgICAgICAgICAgICAgIENyZWF0ZURXb3JkRmllbGQgKEFyZzAsIDB4 MDQsIEFCQVMpDQogICAgICAgICAgICAgICAgICAgIENyZWF0ZURXb3JkRmllbGQgKEFyZzAsIDB4 MDgsIEFMRU4pDQogICAgICAgICAgICAgICAgICAgIElmIChMQW5kIChMRXF1YWwgKEFCQVMsIFpl cm8pLCBMRXF1YWwgKEFMRU4sIFplcm8pKSkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICAgICAgUmV0dXJuIChGWFJTKQ0KICAgICAgICAgICAgICAgICAgICB9DQoN CiAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChNUlNDIChBcmcwLCBGWFJTKSkNCiAgICAgICAg ICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBNZXRob2QgKEFMQUQsIDIsIE5vdFNlcmlhbGl6 ZWQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKE11bHRp cGx5IChEaXZpZGUgKFN1YnRyYWN0IChBZGQgKEFyZzAsIEFyZzEpLCBPbmUpLCBBcmcxLCApLCBB cmcxKSkNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBNZXRob2QgKE9QUlIs IDEsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAg ICBTdG9yZSAoQXJnMCwgTG9jYWw3KQ0KICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHgwMDBD MDAwMCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICBXaGlsZSAoTExlc3MgKExvY2FsMCwg MHgwMDBFMDAwMCkpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgIFN0b3JlIChST01TIChMb2NhbDApLCBMb2NhbDEpDQogICAgICAgICAgICAgICAgICAgICAg ICBJZiAoTEVxdWFsIChMb2NhbDEsIFplcm8pKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0K ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChBTEFEIChMb2NhbDAsIDB4NDAwMCks IExvY2FsMikNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoQUxBRCAoTG9jYWww LCAweDA4MDApLCBMb2NhbDMpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExOb3Qg KExFcXVhbCAoTG9jYWwwLCBMb2NhbDIpKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7 DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMQW5kIChMTm90IChMRXF1YWwg KExvY2FsMCwgTG9jYWwzKSksIFJPTVMgKExvY2FsMykpKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAo UlNWQSAoTG9jYWw3LCBMb2NhbDAsIExvY2FsMyksIExvY2FsNykNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFN0b3JlIChMb2NhbDMsIExvY2FsMCkNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbHNl DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFN0b3JlIChSU1ZBIChMb2NhbDcsIExvY2FsMCwgTG9jYWwyKSwgTG9j YWw3KQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4MDAwRTAw MDAsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBTdG9yZSAoMHgwMDBFMDAwMCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAg IEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICBBZGQgKExvY2FsMCwgTG9jYWwxLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAg ICB9DQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBSZXR1cm4g KExvY2FsNykNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBNZXRob2QgKF9D UlMsIDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICBSZXR1cm4gKE9QUlIgKFJTUkMpKQ0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgTWV0aG9kIChfUFJULCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgIElmIChHUElDKQ0KICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgUmV0dXJuIChQSUM0KQ0KICAgICAgICAgICAgICAgIH0NCiAgICAg ICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBS ZXR1cm4gKFBJQzUpDQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KDQogICAgICAg ICAgICBOYW1lIChQSUM0LCBQYWNrYWdlICgweDBBKQ0KICAgICAgICAgICAgew0KICAgICAgICAg ICAgICAgIFBhY2thZ2UgKDB4MDQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAweDAwMDJGRkZGLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMCwgDQogICAgICAgICAg ICAgICAgICAgIDB4MDAsIA0KICAgICAgICAgICAgICAgICAgICAweDEwDQogICAgICAgICAgICAg ICAgfSwgDQoNCiAgICAgICAgICAgICAgICBQYWNrYWdlICgweDA0KQ0KICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgMHgwMDFERkZGRiwgDQogICAgICAgICAgICAgICAgICAg IDB4MDAsIA0KICAgICAgICAgICAgICAgICAgICAweDAwLCANCiAgICAgICAgICAgICAgICAgICAg MHgxNw0KICAgICAgICAgICAgICAgIH0sIA0KDQogICAgICAgICAgICAgICAgUGFja2FnZSAoMHgw NCkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIDB4MDAxREZGRkYsIA0K ICAgICAgICAgICAgICAgICAgICAweDAxLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMCwgDQog ICAgICAgICAgICAgICAgICAgIDB4MTMNCiAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAg ICAgICAgIFBhY2thZ2UgKDB4MDQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAweDAwMURGRkZGLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMiwgDQogICAgICAgICAg ICAgICAgICAgIDB4MDAsIA0KICAgICAgICAgICAgICAgICAgICAweDEyDQogICAgICAgICAgICAg ICAgfSwgDQoNCiAgICAgICAgICAgICAgICBQYWNrYWdlICgweDA0KQ0KICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgMHgwMDFERkZGRiwgDQogICAgICAgICAgICAgICAgICAg IDB4MDMsIA0KICAgICAgICAgICAgICAgICAgICAweDAwLCANCiAgICAgICAgICAgICAgICAgICAg MHgxMA0KICAgICAgICAgICAgICAgIH0sIA0KDQogICAgICAgICAgICAgICAgUGFja2FnZSAoMHgw NCkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIDB4MDAxRUZGRkYsIA0K ICAgICAgICAgICAgICAgICAgICAweDAwLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMCwgDQog ICAgICAgICAgICAgICAgICAgIDB4MTENCiAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAg ICAgICAgIFBhY2thZ2UgKDB4MDQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAweDAwMUVGRkZGLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMSwgDQogICAgICAgICAg ICAgICAgICAgIDB4MDAsIA0KICAgICAgICAgICAgICAgICAgICAweDE0DQogICAgICAgICAgICAg ICAgfSwgDQoNCiAgICAgICAgICAgICAgICBQYWNrYWdlICgweDA0KQ0KICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgMHgwMDFGRkZGRiwgDQogICAgICAgICAgICAgICAgICAg IDB4MDAsIA0KICAgICAgICAgICAgICAgICAgICAweDAwLCANCiAgICAgICAgICAgICAgICAgICAg MHgxMg0KICAgICAgICAgICAgICAgIH0sIA0KDQogICAgICAgICAgICAgICAgUGFja2FnZSAoMHgw NCkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIDB4MDAxRkZGRkYsIA0K ICAgICAgICAgICAgICAgICAgICAweDAxLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMCwgDQog ICAgICAgICAgICAgICAgICAgIDB4MTMNCiAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAg ICAgICAgIFBhY2thZ2UgKDB4MDQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAweDAwMUZGRkZGLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMywgDQogICAgICAgICAg ICAgICAgICAgIDB4MDAsIA0KICAgICAgICAgICAgICAgICAgICAweDEwDQogICAgICAgICAgICAg ICAgfQ0KICAgICAgICAgICAgfSkNCiAgICAgICAgICAgIE5hbWUgKFBJQzUsIFBhY2thZ2UgKDB4 MEEpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgUGFja2FnZSAoMHgwNCkNCiAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIDB4MDAwMkZGRkYsIA0KICAgICAgICAg ICAgICAgICAgICAweDAwLCANCiAgICAgICAgICAgICAgICAgICAgXF9TQi5QQ0kwLkxQQ0IuTE5L QSwgDQogICAgICAgICAgICAgICAgICAgIDB4MDANCiAgICAgICAgICAgICAgICB9LCANCg0KICAg ICAgICAgICAgICAgIFBhY2thZ2UgKDB4MDQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAg ICAgICAgICAgICAweDAwMURGRkZGLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMCwgDQogICAg ICAgICAgICAgICAgICAgIFxfU0IuUENJMC5MUENCLkxOS0gsIA0KICAgICAgICAgICAgICAgICAg ICAweDAwDQogICAgICAgICAgICAgICAgfSwgDQoNCiAgICAgICAgICAgICAgICBQYWNrYWdlICgw eDA0KQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgMHgwMDFERkZGRiwg DQogICAgICAgICAgICAgICAgICAgIDB4MDEsIA0KICAgICAgICAgICAgICAgICAgICBcX1NCLlBD STAuTFBDQi5MTktELCANCiAgICAgICAgICAgICAgICAgICAgMHgwMA0KICAgICAgICAgICAgICAg IH0sIA0KDQogICAgICAgICAgICAgICAgUGFja2FnZSAoMHgwNCkNCiAgICAgICAgICAgICAgICB7 DQogICAgICAgICAgICAgICAgICAgIDB4MDAxREZGRkYsIA0KICAgICAgICAgICAgICAgICAgICAw eDAyLCANCiAgICAgICAgICAgICAgICAgICAgXF9TQi5QQ0kwLkxQQ0IuTE5LQywgDQogICAgICAg ICAgICAgICAgICAgIDB4MDANCiAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAgICAg IFBhY2thZ2UgKDB4MDQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAw eDAwMURGRkZGLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMywgDQogICAgICAgICAgICAgICAg ICAgIFxfU0IuUENJMC5MUENCLkxOS0EsIA0KICAgICAgICAgICAgICAgICAgICAweDAwDQogICAg ICAgICAgICAgICAgfSwgDQoNCiAgICAgICAgICAgICAgICBQYWNrYWdlICgweDA0KQ0KICAgICAg ICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgMHgwMDFFRkZGRiwgDQogICAgICAgICAg ICAgICAgICAgIDB4MDAsIA0KICAgICAgICAgICAgICAgICAgICBcX1NCLlBDSTAuTFBDQi5MTktC LCANCiAgICAgICAgICAgICAgICAgICAgMHgwMA0KICAgICAgICAgICAgICAgIH0sIA0KDQogICAg ICAgICAgICAgICAgUGFja2FnZSAoMHgwNCkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgICAgIDB4MDAxRUZGRkYsIA0KICAgICAgICAgICAgICAgICAgICAweDAxLCANCiAgICAg ICAgICAgICAgICAgICAgXF9TQi5QQ0kwLkxQQ0IuTE5LRSwgDQogICAgICAgICAgICAgICAgICAg IDB4MDANCiAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAgICAgIFBhY2thZ2UgKDB4 MDQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAweDAwMUZGRkZGLCAN CiAgICAgICAgICAgICAgICAgICAgMHgwMCwgDQogICAgICAgICAgICAgICAgICAgIFxfU0IuUENJ MC5MUENCLkxOS0MsIA0KICAgICAgICAgICAgICAgICAgICAweDAwDQogICAgICAgICAgICAgICAg fSwgDQoNCiAgICAgICAgICAgICAgICBQYWNrYWdlICgweDA0KQ0KICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgMHgwMDFGRkZGRiwgDQogICAgICAgICAgICAgICAgICAgIDB4 MDEsIA0KICAgICAgICAgICAgICAgICAgICBcX1NCLlBDSTAuTFBDQi5MTktELCANCiAgICAgICAg ICAgICAgICAgICAgMHgwMA0KICAgICAgICAgICAgICAgIH0sIA0KDQogICAgICAgICAgICAgICAg UGFja2FnZSAoMHgwNCkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIDB4 MDAxRkZGRkYsIA0KICAgICAgICAgICAgICAgICAgICAweDAzLCANCiAgICAgICAgICAgICAgICAg ICAgXF9TQi5QQ0kwLkxQQ0IuTE5LQSwgDQogICAgICAgICAgICAgICAgICAgIDB4MDANCiAgICAg ICAgICAgICAgICB9DQogICAgICAgICAgICB9KQ0KICAgICAgICAgICAgU2NvcGUgKFwpDQogICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgTmFtZSAoQ1NURSwgMHgwMCkNCiAgICAgICAgICAg ICAgICBOYW1lIChOU1RFLCAweDAwKQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICBEZXZp Y2UgKEdGWDApDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgTmFtZSAoX0FEUiwgMHgw MDAyMDAwMCkNCiAgICAgICAgICAgICAgICBNZXRob2QgKF9ET1MsIDEsIE5vdFNlcmlhbGl6ZWQp DQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBTdG9yZSAoQW5kIChBcmcw LCAweDAzKSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICBcX1NCLlBTUlYgKDB4QjksIDB4 MjAsIDB4MDEsIExvY2FsMCwgMHgwMCkNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAg ICAgICBNZXRob2QgKF9ET0QsIDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgew0K ICAgICAgICAgICAgICAgICAgICBOYW1lIChUTVAyLCBQYWNrYWdlICgweDAyKQ0KICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAweDgwMDAwMTAwLCANCiAgICAg ICAgICAgICAgICAgICAgICAgIDB4ODAwMDA0MTANCiAgICAgICAgICAgICAgICAgICAgfSkNCiAg ICAgICAgICAgICAgICAgICAgUmV0dXJuIChUTVAyKQ0KICAgICAgICAgICAgICAgIH0NCg0KICAg ICAgICAgICAgICAgIERldmljZSAoQ1JUMSkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgICAgIE1ldGhvZCAoX0FEUiwgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4ODAwMDAxMDAsIExvY2FsMCkN CiAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoQW5kICgweEZGRkYsIExvY2FsMCkpDQog ICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9EQ1Ms IDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgIFN0b3JlIChcX1NCLlBTUlYgKDB4QjksIDB4MDEsIDB4MDAsIDB4MDAsIDB4MDMp LCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoQW5kIChMb2NhbDAsIDB4MDEw MSkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgUmV0dXJuICgweDFGKQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAg ICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFJldHVybiAoMHgxRCkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0N CiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoX0RH UywgMCwgTm90U2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgU3RvcmUgKE5TVEUsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAg IElmIChBbmQgKExvY2FsMCwgMHgwMTAxKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MDEpDQogICAgICAgICAgICAgICAg ICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweDAwKQ0KICAg ICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAg ICAgICAgICAgICAgTWV0aG9kIChfRFNTLCAxLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChBbmQgKEFyZzAs IDB4QzAwMDAwMDApLCAweEMwMDAwMDAwKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoTlNURSwgQ1NURSkNCiAgICAgICAgICAg ICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgICAgIERldmljZSAoTENEMSkNCiAgICAgICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgICAgIE1ldGhvZCAoX0FEUiwgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAg ICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4ODAwMDA0MTAsIExv Y2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoQW5kICgweEZGRkYsIExvY2Fs MCkpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2Qg KF9EQ1MsIDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICAgICAgICAgIFN0b3JlIChcX1NCLlBTUlYgKDB4QjksIDB4MDEsIDB4MDAsIDB4MDAs IDB4MDMpLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoQW5kIChMb2NhbDAs IDB4MDgwOCkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgUmV0dXJuICgweDFGKQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAg ICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgxRCkNCiAgICAgICAgICAgICAgICAgICAg ICAgIH0NCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE1ldGhv ZCAoX0RHUywgMCwgTm90U2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICAgICAgU3RvcmUgKE5TVEUsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAg ICAgICAgIElmIChBbmQgKExvY2FsMCwgMHgwODA4KSkNCiAgICAgICAgICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MDEpDQogICAgICAgICAg ICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAg ICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweDAw KQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAg ICAgICAgICAgICAgICAgICAgTWV0aG9kIChfRFNTLCAxLCBOb3RTZXJpYWxpemVkKQ0KICAgICAg ICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChBbmQg KEFyZzAsIDB4QzAwMDAwMDApLCAweEMwMDAwMDAwKSkNCiAgICAgICAgICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoTlNURSwgQ1NURSkNCiAgICAg ICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAg ICAgIH0NCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgRGV2aWNlIChVU0IxKQ0KICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgIE5hbWUgKF9BRFIsIDB4MDAxRDAwMDApDQogICAgICAg ICAgICB9DQoNCiAgICAgICAgICAgIERldmljZSAoVVNCMikNCiAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICBOYW1lIChfQURSLCAweDAwMUQwMDAxKQ0KICAgICAgICAgICAgfQ0KDQogICAg ICAgICAgICBEZXZpY2UgKFVTQjMpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgTmFt ZSAoX0FEUiwgMHgwMDFEMDAwMikNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgRGV2aWNl IChVU0I0KQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIE5hbWUgKF9BRFIsIDB4MDAx RDAwMDMpDQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIERldmljZSAoRUhDSSkNCiAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICBOYW1lIChfQURSLCAweDAwMUQwMDA3KQ0KICAgICAg ICAgICAgfQ0KDQogICAgICAgICAgICBEZXZpY2UgKFBDSUIpDQogICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgTmFtZSAoX0FEUiwgMHgwMDFFMDAwMCkNCiAgICAgICAgICAgICAgICBEZXZp Y2UgKENEQjEpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBOYW1lIChf QURSLCAweDAwMDUwMDAwKQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIERl dmljZSAoTEFOKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAo X0FEUiwgMHgwMDAxMDAwMCkNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX1BSVywgUGFja2Fn ZSAoMHgwMikNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAg MHgwQiwgDQogICAgICAgICAgICAgICAgICAgICAgICAweDA0DQogICAgICAgICAgICAgICAgICAg IH0pDQogICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgTWV0aG9kIChfUFJULCAw LCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg SWYgKEdQSUMpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAg IFJldHVybiAoUElDNikNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAg ICBFbHNlDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIFJl dHVybiAoUElDNykNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCg0K ICAgICAgICAgICAgICAgIE5hbWUgKFBJQzYsIFBhY2thZ2UgKDB4MDYpDQogICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICBQYWNrYWdlICgweDA0KQ0KICAgICAgICAgICAgICAg ICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAweDAwMDVGRkZGLCANCiAgICAgICAgICAg ICAgICAgICAgICAgIDB4MDAsIA0KICAgICAgICAgICAgICAgICAgICAgICAgMHgwMCwgDQogICAg ICAgICAgICAgICAgICAgICAgICAweDE2DQogICAgICAgICAgICAgICAgICAgIH0sIA0KDQogICAg ICAgICAgICAgICAgICAgIFBhY2thZ2UgKDB4MDQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgIDB4MDAwNUZGRkYsIA0KICAgICAgICAgICAgICAgICAgICAg ICAgMHgwMSwgDQogICAgICAgICAgICAgICAgICAgICAgICAweDAwLCANCiAgICAgICAgICAgICAg ICAgICAgICAgIDB4MTQNCiAgICAgICAgICAgICAgICAgICAgfSwgDQoNCiAgICAgICAgICAgICAg ICAgICAgUGFja2FnZSAoMHgwNCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgMHgwMDA1RkZGRiwgDQogICAgICAgICAgICAgICAgICAgICAgICAweDAyLCAN CiAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAsIA0KICAgICAgICAgICAgICAgICAgICAgICAg MHgxNw0KICAgICAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAgICAgICAgICBQYWNr YWdlICgweDA0KQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAg ICAweDAwMDFGRkZGLCANCiAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAsIA0KICAgICAgICAg ICAgICAgICAgICAgICAgMHgwMCwgDQogICAgICAgICAgICAgICAgICAgICAgICAweDEzDQogICAg ICAgICAgICAgICAgICAgIH0sIA0KDQogICAgICAgICAgICAgICAgICAgIFBhY2thZ2UgKDB4MDQp DQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAwNEZG RkYsIA0KICAgICAgICAgICAgICAgICAgICAgICAgMHgwMCwgDQogICAgICAgICAgICAgICAgICAg ICAgICAweDAwLCANCiAgICAgICAgICAgICAgICAgICAgICAgIDB4MTUNCiAgICAgICAgICAgICAg ICAgICAgfSwgDQoNCiAgICAgICAgICAgICAgICAgICAgUGFja2FnZSAoMHgwNCkNCiAgICAgICAg ICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDA0RkZGRiwgDQogICAg ICAgICAgICAgICAgICAgICAgICAweDAxLCANCiAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAs IA0KICAgICAgICAgICAgICAgICAgICAgICAgMHgxMw0KICAgICAgICAgICAgICAgICAgICB9DQog ICAgICAgICAgICAgICAgfSkNCiAgICAgICAgICAgICAgICBOYW1lIChQSUM3LCBQYWNrYWdlICgw eDA2KQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgUGFja2FnZSAoMHgw NCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDA1 RkZGRiwgDQogICAgICAgICAgICAgICAgICAgICAgICAweDAwLCANCiAgICAgICAgICAgICAgICAg ICAgICAgIFxfU0IuUENJMC5MUENCLkxOS0csIA0KICAgICAgICAgICAgICAgICAgICAgICAgMHgw MA0KICAgICAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAgICAgICAgICBQYWNrYWdl ICgweDA0KQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAw eDAwMDVGRkZGLCANCiAgICAgICAgICAgICAgICAgICAgICAgIDB4MDEsIA0KICAgICAgICAgICAg ICAgICAgICAgICAgXF9TQi5QQ0kwLkxQQ0IuTE5LRSwgDQogICAgICAgICAgICAgICAgICAgICAg ICAweDAwDQogICAgICAgICAgICAgICAgICAgIH0sIA0KDQogICAgICAgICAgICAgICAgICAgIFBh Y2thZ2UgKDB4MDQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgIDB4MDAwNUZGRkYsIA0KICAgICAgICAgICAgICAgICAgICAgICAgMHgwMiwgDQogICAgICAg ICAgICAgICAgICAgICAgICBcX1NCLlBDSTAuTFBDQi5MTktILCANCiAgICAgICAgICAgICAgICAg ICAgICAgIDB4MDANCiAgICAgICAgICAgICAgICAgICAgfSwgDQoNCiAgICAgICAgICAgICAgICAg ICAgUGFja2FnZSAoMHgwNCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAgICAgMHgwMDAxRkZGRiwgDQogICAgICAgICAgICAgICAgICAgICAgICAweDAwLCANCiAg ICAgICAgICAgICAgICAgICAgICAgIFxfU0IuUENJMC5MUENCLkxOS0QsIA0KICAgICAgICAgICAg ICAgICAgICAgICAgMHgwMA0KICAgICAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAg ICAgICAgICBQYWNrYWdlICgweDA0KQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgICAgICAgICAweDAwMDRGRkZGLCANCiAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAs IA0KICAgICAgICAgICAgICAgICAgICAgICAgXF9TQi5QQ0kwLkxQQ0IuTE5LRiwgDQogICAgICAg ICAgICAgICAgICAgICAgICAweDAwDQogICAgICAgICAgICAgICAgICAgIH0sIA0KDQogICAgICAg ICAgICAgICAgICAgIFBhY2thZ2UgKDB4MDQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICAgICAgICAgIDB4MDAwNEZGRkYsIA0KICAgICAgICAgICAgICAgICAgICAgICAg MHgwMSwgDQogICAgICAgICAgICAgICAgICAgICAgICBcX1NCLlBDSTAuTFBDQi5MTktELCANCiAg ICAgICAgICAgICAgICAgICAgICAgIDB4MDANCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAg ICAgICAgICAgIH0pDQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIERldmljZSAoQVVEMCkN CiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBOYW1lIChfQURSLCAweDAwMUUwMDAyKQ0K ICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICBEZXZpY2UgKE1PRE0pDQogICAgICAgICAgICB7 DQogICAgICAgICAgICAgICAgTmFtZSAoX0FEUiwgMHgwMDFFMDAwMykNCiAgICAgICAgICAgICAg ICBOYW1lIChfUFJXLCBQYWNrYWdlICgweDAyKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICAgICAgMHgwNSwgDQogICAgICAgICAgICAgICAgICAgIDB4MDMNCiAgICAgICAgICAg ICAgICB9KQ0KICAgICAgICAgICAgICAgIE5hbWUgKE1QU1csIDB4MDApDQogICAgICAgICAgICAg ICAgTWV0aG9kIChfUFNXLCAxLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgU3RvcmUgKFNoaWZ0TGVmdCAoMHgwMCwgMHgxOCksIExvY2FsMCkN CiAgICAgICAgICAgICAgICAgICAgT3IgKExvY2FsMCwgQW5kIChfQURSLCAweDAwRkYwMDAwKSwg TG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICBPciAoTG9jYWwwLCBTaGlmdExlZnQgKEFuZCAo X0FEUiwgMHhGRiksIDB4MDgpLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgIE9yIChMb2Nh bDAsIEFyZzAsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgU3RvcmUgKExvY2FsMCwgTVBT VykNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIERldmlj ZSAoTFBDQikNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICBOYW1lIChfQURSLCAweDAw MUYwMDAwKQ0KICAgICAgICAgICAgICAgIE9wZXJhdGlvblJlZ2lvbiAoTFBDMCwgUENJX0NvbmZp ZywgMHg0MCwgMHhDMCkNCiAgICAgICAgICAgICAgICBGaWVsZCAoTFBDMCwgQW55QWNjLCBOb0xv Y2ssIFByZXNlcnZlKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgUE1C QSwgICAxNiwgDQogICAgICAgICAgICAgICAgICAgIE9mZnNldCAoMHgwOCksIA0KICAgICAgICAg ICAgICAgICAgICBHUEJBLCAgIDE2LCANCiAgICAgICAgICAgICAgICAgICAgT2Zmc2V0ICgweDIw KSwgDQogICAgICAgICAgICAgICAgICAgIFBBUkMsICAgOCwgDQogICAgICAgICAgICAgICAgICAg IFBCUkMsICAgOCwgDQogICAgICAgICAgICAgICAgICAgIFBDUkMsICAgOCwgDQogICAgICAgICAg ICAgICAgICAgIFBEUkMsICAgOCwgDQogICAgICAgICAgICAgICAgICAgIE9mZnNldCAoMHgyOCks IA0KICAgICAgICAgICAgICAgICAgICBQRVJDLCAgIDgsIA0KICAgICAgICAgICAgICAgICAgICBQ RlJDLCAgIDgsIA0KICAgICAgICAgICAgICAgICAgICBQR1JDLCAgIDgsIA0KICAgICAgICAgICAg ICAgICAgICBQSFJDLCAgIDgsIA0KICAgICAgICAgICAgICAgICAgICBPZmZzZXQgKDB4NDApLCAN CiAgICAgICAgICAgICAgICAgICAgSU9EMCwgICA4LCANCiAgICAgICAgICAgICAgICAgICAgSU9E MSwgICA4LCANCiAgICAgICAgICAgICAgICAgICAgT2Zmc2V0ICgweDQ0KSwgDQogICAgICAgICAg ICAgICAgICAgIEdFTjEsICAgMTYsIA0KICAgICAgICAgICAgICAgICAgICBPZmZzZXQgKDB4NDgp LCANCiAgICAgICAgICAgICAgICAgICAgR0VOMiwgICAxNiwgDQogICAgICAgICAgICAgICAgICAg IE9mZnNldCAoMHg2MCksIA0KICAgICAgICAgICAgICAgICAgICAgICAgLCAgIDIsIA0KICAgICAg ICAgICAgICAgICAgICBDUkVOLCAgIDEsIA0KICAgICAgICAgICAgICAgICAgICBPZmZzZXQgKDB4 QjApLCANCiAgICAgICAgICAgICAgICAgICAgUkNCQSwgICAzMg0KICAgICAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgICAgIERldmljZSAoTUJSRCkNCiAgICAgICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgICAgIE5hbWUgKF9ISUQsIEVpc2FJZCAoIlBOUDBDMDIiKSkNCiAgICAgICAg ICAgICAgICAgICAgTmFtZSAoX1VJRCwgMHgxRikNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAo QlVGMCwgUmVzb3VyY2VUZW1wbGF0ZSAoKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICBJTyAoRGVjb2RlMTYsIDB4MDkwMCwgMHgwOTAwLCAweDAxLCAweDIw KQ0KICAgICAgICAgICAgICAgICAgICAgICAgSU8gKERlY29kZTE2LCAweDA5MkMsIDB4MDkyQywg MHgwMSwgMHg1NCkNCiAgICAgICAgICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHhGRTAw LCAweEZFMDAsIDB4MDIsIDB4MDIpDQogICAgICAgICAgICAgICAgICAgIH0pDQogICAgICAgICAg ICAgICAgICAgIE1ldGhvZCAoX0NSUywgMCwgTm90U2VyaWFsaXplZCkNCiAgICAgICAgICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlV29yZEZpZWxkIChCVUYwLCAw eDAyLCBHMU1OKQ0KICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlV29yZEZpZWxkIChCVUYw LCAweDA0LCBHMU1YKQ0KICAgICAgICAgICAgICAgICAgICAgICAgQW5kICheXkdFTjEsIDB4RkY4 MCwgRzFNTikNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChHMU1OLCBHMU1YKQ0KICAg ICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChCVUYwKQ0KICAgICAgICAgICAgICAgICAgICB9 DQogICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgRGV2aWNlIChETUFDKQ0KICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX0hJRCwgRWlzYUlkICgi UE5QMDIwMCIpKQ0KICAgICAgICAgICAgICAgICAgICBOYW1lIChfQ1JTLCBSZXNvdXJjZVRlbXBs YXRlICgpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElP IChEZWNvZGUxNiwgMHgwMDAwLCAweDAwMDAsIDB4MDEsIDB4MjApDQogICAgICAgICAgICAgICAg ICAgICAgICBJTyAoRGVjb2RlMTYsIDB4MDA4MSwgMHgwMDgxLCAweDAxLCAweDExKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgSU8gKERlY29kZTE2LCAweDAwOTMsIDB4MDA5MywgMHgwMSwgMHgw RCkNCiAgICAgICAgICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgwMEMwLCAweDAwQzAs IDB4MDEsIDB4MjApDQogICAgICAgICAgICAgICAgICAgICAgICBETUEgKENvbXBhdGliaWxpdHks IE5vdEJ1c01hc3RlciwgVHJhbnNmZXI4XzE2KSB7NH0NCiAgICAgICAgICAgICAgICAgICAgfSkN CiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBEZXZpY2UgKEZXSEQpDQogICAg ICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBOYW1lIChfSElELCBFaXNhSWQgKCJJ TlQwODAwIikpDQogICAgICAgICAgICAgICAgICAgIE5hbWUgKF9DUlMsIFJlc291cmNlVGVtcGxh dGUgKCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgTWVt b3J5MzJGaXhlZCAoUmVhZE9ubHksIDB4RkYwMDAwMDAsIDB4MDEwMDAwMDApDQogICAgICAgICAg ICAgICAgICAgIH0pDQogICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgRGV2aWNl IChIUEVUKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX0hJ RCwgRWlzYUlkICgiUE5QMDEwMyIpKQ0KICAgICAgICAgICAgICAgICAgICBOYW1lIChCVUYwLCBS ZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgIElSUU5vRmxhZ3MgKCkgezB9DQogICAgICAgICAgICAgICAgICAgICAgICBJUlFO b0ZsYWdzICgpIHs4fQ0KICAgICAgICAgICAgICAgICAgICAgICAgTWVtb3J5MzJGaXhlZCAoUmVh ZE9ubHksIDB4RkVEMDAwMDAsIDB4MDAwMDA0MDApDQogICAgICAgICAgICAgICAgICAgIH0pDQog ICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoX1NUQSwgMCwgTm90U2VyaWFsaXplZCkNCiAgICAg ICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoXENL T1MgKCksIDB4ODIpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIElmIChIUEFFKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweDBGKQ0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAg ICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICBJZiAoSFBBRSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7 DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgwQikNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAg ICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgwMCkNCiAgICAgICAgICAgICAgICAgICAgfQ0K DQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoX0NSUywgMCwgU2VyaWFsaXplZCkNCiAgICAg ICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgSWYgKEhQQUUpDQogICAg ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRl RFdvcmRGaWVsZCAoQlVGMCwgMHgwQSwgSFBUMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICBJZiAoTEVxdWFsIChIUEFTLCAweDAxKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7 DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweEZFRDAxMDAwLCBIUFQw KQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIElmIChMRXF1YWwgKEhQQVMsIDB4MDIpKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4RkVEMDIwMDAs IEhQVDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgSWYgKExFcXVhbCAoSFBBUywgMHgwMykpDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHhGRUQw MzAwMCwgSFBUMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAg ICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoQlVGMCkNCiAg ICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAg IERldmljZSAoSVBJQykNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIE5h bWUgKF9ISUQsIEVpc2FJZCAoIlBOUDAwMDAiKSkNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAo X0NSUywgUmVzb3VyY2VUZW1wbGF0ZSAoKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICBJTyAoRGVjb2RlMTYsIDB4MDAyMCwgMHgwMDIwLCAweDAxLCAweDAy KQ0KICAgICAgICAgICAgICAgICAgICAgICAgSU8gKERlY29kZTE2LCAweDAwMjQsIDB4MDAyNCwg MHgwMSwgMHgwMikNCiAgICAgICAgICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgwMDI4 LCAweDAwMjgsIDB4MDEsIDB4MDIpDQogICAgICAgICAgICAgICAgICAgICAgICBJTyAoRGVjb2Rl MTYsIDB4MDAyQywgMHgwMDJDLCAweDAxLCAweDAyKQ0KICAgICAgICAgICAgICAgICAgICAgICAg SU8gKERlY29kZTE2LCAweDAwMzAsIDB4MDAzMCwgMHgwMSwgMHgwMikNCiAgICAgICAgICAgICAg ICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgwMDM0LCAweDAwMzQsIDB4MDEsIDB4MDIpDQogICAg ICAgICAgICAgICAgICAgICAgICBJTyAoRGVjb2RlMTYsIDB4MDAzOCwgMHgwMDM4LCAweDAxLCAw eDAyKQ0KICAgICAgICAgICAgICAgICAgICAgICAgSU8gKERlY29kZTE2LCAweDAwM0MsIDB4MDAz QywgMHgwMSwgMHgwMikNCiAgICAgICAgICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgw MEEwLCAweDAwQTAsIDB4MDEsIDB4MDIpDQogICAgICAgICAgICAgICAgICAgICAgICBJTyAoRGVj b2RlMTYsIDB4MDBBNCwgMHgwMEE0LCAweDAxLCAweDAyKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgSU8gKERlY29kZTE2LCAweDAwQTgsIDB4MDBBOCwgMHgwMSwgMHgwMikNCiAgICAgICAgICAg ICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgwMEFDLCAweDAwQUMsIDB4MDEsIDB4MDIpDQog ICAgICAgICAgICAgICAgICAgICAgICBJTyAoRGVjb2RlMTYsIDB4MDBCMCwgMHgwMEIwLCAweDAx LCAweDAyKQ0KICAgICAgICAgICAgICAgICAgICAgICAgSU8gKERlY29kZTE2LCAweDAwQjQsIDB4 MDBCNCwgMHgwMSwgMHgwMikNCiAgICAgICAgICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwg MHgwMEI4LCAweDAwQjgsIDB4MDEsIDB4MDIpDQogICAgICAgICAgICAgICAgICAgICAgICBJTyAo RGVjb2RlMTYsIDB4MDBCQywgMHgwMEJDLCAweDAxLCAweDAyKQ0KICAgICAgICAgICAgICAgICAg ICAgICAgSU8gKERlY29kZTE2LCAweDA0RDAsIDB4MDREMCwgMHgwMSwgMHgwMikNCiAgICAgICAg ICAgICAgICAgICAgICAgIElSUU5vRmxhZ3MgKCkgezJ9DQogICAgICAgICAgICAgICAgICAgIH0p DQogICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgRGV2aWNlIChNQVRIKQ0KICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX0hJRCwgRWlzYUlkICgi UE5QMEMwNCIpKQ0KICAgICAgICAgICAgICAgICAgICBOYW1lIChfQ1JTLCBSZXNvdXJjZVRlbXBs YXRlICgpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElP IChEZWNvZGUxNiwgMHgwMEYwLCAweDAwRjAsIDB4MDEsIDB4MDEpDQogICAgICAgICAgICAgICAg ICAgICAgICBJUlFOb0ZsYWdzICgpIHsxM30NCiAgICAgICAgICAgICAgICAgICAgfSkNCiAgICAg ICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBEZXZpY2UgKE1CRDApDQogICAgICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgICAgICBOYW1lIChfSElELCBFaXNhSWQgKCJQTlAwQzAy IikpDQogICAgICAgICAgICAgICAgICAgIE5hbWUgKF9VSUQsIDB4MDEpDQogICAgICAgICAgICAg ICAgICAgIE5hbWUgKEJVRjAsIFJlc291cmNlVGVtcGxhdGUgKCkNCiAgICAgICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgSU8gKERlY29kZTE2LCAweDAwNjMsIDB4MDA2 MywgMHgwMSwgMHgwMSkNCiAgICAgICAgICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgw MDY1LCAweDAwNjUsIDB4MDEsIDB4MDEpDQogICAgICAgICAgICAgICAgICAgICAgICBJTyAoRGVj b2RlMTYsIDB4MDA2NywgMHgwMDY3LCAweDAxLCAweDAxKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgSU8gKERlY29kZTE2LCAweDAwODAsIDB4MDA4MCwgMHgwMSwgMHgwMSkNCiAgICAgICAgICAg ICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgwMDkyLCAweDAwOTIsIDB4MDEsIDB4MDEpDQog ICAgICAgICAgICAgICAgICAgICAgICBJTyAoRGVjb2RlMTYsIDB4MDBCMiwgMHgwMEIyLCAweDAx LCAweDAyKQ0KICAgICAgICAgICAgICAgICAgICAgICAgSU8gKERlY29kZTE2LCAweDA4MDAsIDB4 MDgwMCwgMHgwMSwgMHgxMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwg MHgxMDAwLCAweDEwMDAsIDB4MDEsIDB4ODApDQogICAgICAgICAgICAgICAgICAgICAgICBJTyAo RGVjb2RlMTYsIDB4MTE4MCwgMHgxMTgwLCAweDAxLCAweDQwKQ0KICAgICAgICAgICAgICAgICAg ICAgICAgTWVtb3J5MzJGaXhlZCAoUmVhZFdyaXRlLCAweEUwMDAwMDAwLCAweDEwMDAwMDAwKQ0K ICAgICAgICAgICAgICAgICAgICAgICAgTWVtb3J5MzJGaXhlZCAoUmVhZFdyaXRlLCAweEYwMDAw MDAwLCAweDAwMDA0MDAwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgTWVtb3J5MzJGaXhlZCAo UmVhZFdyaXRlLCAweEYwMDA0MDAwLCAweDAwMDAxMDAwKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgTWVtb3J5MzJGaXhlZCAoUmVhZFdyaXRlLCAweEYwMDA1MDAwLCAweDAwMDAxMDAwKQ0KICAg ICAgICAgICAgICAgICAgICAgICAgTWVtb3J5MzJGaXhlZCAoUmVhZFdyaXRlLCAweEYwMDA4MDAw LCAweDAwMDA0MDAwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgTWVtb3J5MzJGaXhlZCAoUmVh ZFdyaXRlLCAweEZFRDIwMDAwLCAweDAwMDcwMDAwKQ0KICAgICAgICAgICAgICAgICAgICB9KQ0K ICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9DUlMsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZVdvcmRGaWVsZCAo QlVGMCwgMHgzQSwgUE1NTikNCiAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZVdvcmRGaWVs ZCAoQlVGMCwgMHgzQywgUE1NWCkNCiAgICAgICAgICAgICAgICAgICAgICAgIEFuZCAoXl5QTUJB LCAweEZGODAsIFBNTU4pDQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoUE1NTiwgUE1N WCkNCiAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZVdvcmRGaWVsZCAoQlVGMCwgMHg0Miwg R1BNTikNCiAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZVdvcmRGaWVsZCAoQlVGMCwgMHg0 NCwgR1BNWCkNCiAgICAgICAgICAgICAgICAgICAgICAgIEFuZCAoXl5HUEJBLCAweEZGQzAsIEdQ TU4pDQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoR1BNTiwgR1BNWCkNCiAgICAgICAg ICAgICAgICAgICAgICAgIFJldHVybiAoQlVGMCkNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAg ICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIERldmljZSAoTUJEMSkNCiAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIE5hbWUgKF9ISUQsIEVpc2FJZCAoIlBOUDBD MDIiKSkNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX1VJRCwgMHgwMikNCiAgICAgICAgICAg ICAgICAgICAgTmFtZSAoX0NSUywgUmVzb3VyY2VUZW1wbGF0ZSAoKQ0KICAgICAgICAgICAgICAg ICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBNZW1vcnkzMkZpeGVkIChSZWFkV3JpdGUs IDB4RkVDMDAwMDAsIDB4MDAwMDEwMDApDQogICAgICAgICAgICAgICAgICAgICAgICBNZW1vcnkz MkZpeGVkIChSZWFkV3JpdGUsIDB4RkVFMDAwMDAsIDB4MDAwMDEwMDApDQogICAgICAgICAgICAg ICAgICAgIH0pDQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoX1NUQSwgMCwgTm90U2VyaWFs aXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgU3Rv cmUgKFxDS09TICgpLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoTE9yIChM RXF1YWwgKExvY2FsMCwgMHgwMSksIExFcXVhbCAoTG9jYWwwLCAweDAyKSkpDQogICAgICAgICAg ICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExPciAoQVBJ QywgSFRURSkpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MEIpDQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAg ICBSZXR1cm4gKDB4MDApDQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9 DQoNCiAgICAgICAgICAgICAgICBEZXZpY2UgKFJUQykNCiAgICAgICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgICAgIE5hbWUgKF9ISUQsIEVpc2FJZCAoIlBOUDBCMDAiKSkNCiAgICAgICAg ICAgICAgICAgICAgTmFtZSAoQlVGMCwgUmVzb3VyY2VUZW1wbGF0ZSAoKQ0KICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBJTyAoRGVjb2RlMTYsIDB4MDA3MCwg MHgwMDcwLCAweDAxLCAweDA4KQ0KICAgICAgICAgICAgICAgICAgICB9KQ0KICAgICAgICAgICAg ICAgICAgICBOYW1lIChCVUYxLCBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgwMDcwLCAweDAw NzAsIDB4MDEsIDB4MDgpDQogICAgICAgICAgICAgICAgICAgICAgICBJUlFOb0ZsYWdzICgpIHs4 fQ0KICAgICAgICAgICAgICAgICAgICB9KQ0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9D UlMsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgIElmIChIUEFFKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFJldHVybiAoQlVGMCkNCiAgICAgICAgICAgICAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChCVUYxKQ0KICAgICAgICAgICAg ICAgICAgICB9DQogICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgRGV2aWNlIChU SU1SKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX0hJRCwg RWlzYUlkICgiUE5QMDEwMCIpKQ0KICAgICAgICAgICAgICAgICAgICBOYW1lIChCVUYwLCBSZXNv dXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgICAgIElPIChEZWNvZGUxNiwgMHgwMDQwLCAweDAwNDAsIDB4MDEsIDB4MDQpDQogICAgICAg ICAgICAgICAgICAgICAgICBJTyAoRGVjb2RlMTYsIDB4MDA1MCwgMHgwMDUwLCAweDEwLCAweDA0 KQ0KICAgICAgICAgICAgICAgICAgICB9KQ0KICAgICAgICAgICAgICAgICAgICBOYW1lIChCVUYx LCBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgwMDQwLCAweDAwNDAsIDB4MDEsIDB4MDQpDQog ICAgICAgICAgICAgICAgICAgICAgICBJTyAoRGVjb2RlMTYsIDB4MDA1MCwgMHgwMDUwLCAweDEw LCAweDA0KQ0KICAgICAgICAgICAgICAgICAgICAgICAgSVJRTm9GbGFncyAoKSB7MH0NCiAgICAg ICAgICAgICAgICAgICAgfSkNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChfQ1JTLCAwLCBT ZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAg ICBJZiAoSFBBRSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICBSZXR1cm4gKEJVRjApDQogICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAg ICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoQlVGMSkNCiAgICAgICAgICAgICAgICAgICAg fQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIERldmljZSAoU1BLUikNCiAg ICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIE5hbWUgKF9ISUQsIEVpc2FJZCAo IlBOUDA4MDAiKSkNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX0NSUywgUmVzb3VyY2VUZW1w bGF0ZSAoKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBJ TyAoRGVjb2RlMTYsIDB4MDA2MSwgMHgwMDYxLCAweDAxLCAweDAxKQ0KICAgICAgICAgICAgICAg ICAgICB9KQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIERldmljZSAoVFBN KQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX0hJRCwgRWlz YUlkICgiSUZYMDEwMSIpKQ0KICAgICAgICAgICAgICAgICAgICBOYW1lIChfVUlELCAweDAxKQ0K ICAgICAgICAgICAgICAgICAgICBOYW1lIChfQ1JTLCBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwg MHgwMDRFLCAweDAwNEUsIDB4MDEsIDB4MDIpDQogICAgICAgICAgICAgICAgICAgICAgICBJTyAo RGVjb2RlMTYsIDB4MDkyMCwgMHgwOTIwLCAweDAxLCAweDBDKQ0KICAgICAgICAgICAgICAgICAg ICB9KQ0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9TVEEsIDAsIE5vdFNlcmlhbGl6ZWQp DQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAo XF9TQi5QU1JWICgweENBLCAweDAwLCAweDAwLCAweDAwLCAweDAzKSkNCiAgICAgICAgICAgICAg ICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIE5hbWUgKFxFQ1NU LCAweDAwKQ0KICAgICAgICAgICAgICAgIERldmljZSAoRUMwKQ0KICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX0hJRCwgRWlzYUlkICgiUE5QMEMwOSIpKQ0KICAg ICAgICAgICAgICAgICAgICBOYW1lIChfQ1JTLCBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgw MDYyLCAweDAwNjIsIDB4MDAsIDB4MDEpDQogICAgICAgICAgICAgICAgICAgICAgICBJTyAoRGVj b2RlMTYsIDB4MDA2NiwgMHgwMDY2LCAweDAwLCAweDAxKQ0KICAgICAgICAgICAgICAgICAgICB9 KQ0KICAgICAgICAgICAgICAgICAgICBNdXRleCAoRUNFWCwgMHgwMCkNCiAgICAgICAgICAgICAg ICAgICAgTWV0aG9kIChfUkVHLCAyLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAg ICB7DQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChBcmcwLCAweDAzKSkNCiAg ICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9y ZSAoQXJnMSwgRUNTVCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChB cmcxLCAweDAxKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFN0b3JlIChFQzAxICgpLCBQV1JTKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBcX1NCLlBTUlYgKDB4QzksIDB4MDMsIDB4MDEsIFBXUlMsIDB4MDAp DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBOT1QgKCkNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAg ICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9JTkksIDAsIE5vdFNlcmlh bGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElO STIgKCkNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE5hbWUg KF9HUEUsIDB4MUQpDQogICAgICAgICAgICAgICAgICAgIE9wZXJhdGlvblJlZ2lvbiAoRUNSLCBF bWJlZGRlZENvbnRyb2wsIDB4MDAsIDB4RkYpDQogICAgICAgICAgICAgICAgICAgIEZpZWxkIChF Q1IsIEJ5dGVBY2MsIE5vTG9jaywgUHJlc2VydmUpDQogICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgIEJSU1QsICAgOCwgDQogICAgICAgICAgICAgICAgICAgICAg ICBDVFJMLCAgIDgsIA0KICAgICAgICAgICAgICAgICAgICAgICAgT2Zmc2V0ICgweDA0KSwgDQog ICAgICAgICAgICAgICAgICAgICAgICBFQ0NSLCAgIDgsIA0KICAgICAgICAgICAgICAgICAgICAg ICAgREFUMSwgICA4LCANCiAgICAgICAgICAgICAgICAgICAgICAgIERBVDIsICAgOCwgDQogICAg ICAgICAgICAgICAgICAgICAgICBEQVQzLCAgIDgsIA0KICAgICAgICAgICAgICAgICAgICAgICAg T2Zmc2V0ICgweDE3KSwgDQogICAgICAgICAgICAgICAgICAgICAgICBTTFBULCAgIDgNCiAgICAg ICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE5hbWUgKExIS1EsIE9uZXMp DQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoSENOViwgMSwgU2VyaWFsaXplZCkNCiAgICAg ICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4RkZGRkZG RkYsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChMQW5kIChMTm90IChMTGVz cyAoQXJnMCwgMHgwQSkpLCBMTm90IChMR3JlYXRlciAoQXJnMCwgMHgxNSkpKSkNCiAgICAgICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdWJ0cmFjdCAo QXJnMCwgMHgwOSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChBbmQg KDB4MDAsIFNoaWZ0TGVmdCAoMHgwMSwgTG9jYWwwKSkpDQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHhGRkZGRkZG RiwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAg ICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExBbmQgKExOb3QgKExM ZXNzIChBcmcwLCAweDcwKSksIExOb3QgKExHcmVhdGVyIChBcmcwLCAweDdCKSkpKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFkZCAoQXJn MCwgMHgxMSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN1YnRyYWN0IChB cmcwLCAweDZGLCBMb2NhbDEpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKEFuZCAo MHgwMCwgU2hpZnRMZWZ0ICgweDAxLCBMb2NhbDEpKSkNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweEZGRkZGRkZG LCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMSEtRKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAo RUM4NiAoMHgyOCksIExIS1EpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0K ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEFuZCAoTEhLUSwgTE5vdCAoTEVx dWFsIChMSEtRLCBTdWJ0cmFjdCAoTG9jYWwwLCAweDgwKSkpKSkNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3Rv cmUgKDB4RkZGRkZGRkYsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg fQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExBbmQgKExOb3QgKExMZXNzIChBcmcw LCAweDgxKSksIExOb3QgKExHcmVhdGVyIChBcmcwLCAweDgyKSkpKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN1YnRyYWN0IChBcmcwLCAw eDUxLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAg ICAgICAgICAgIElmIChMTm90IChMRXF1YWwgKExvY2FsMCwgMHhGRkZGRkZGRikpKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxfU0IuSEtF WS5ISU5EIChMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgTm90aWZ5IChcX1NC LkhLRVksIDB4ODApDQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAg ICAgICAgICBFbHNlDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg ICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBN ZXRob2QgKF9RMEEsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4MEEpDQogICAgICAgICAgICAgICAgICAgIH0NCg0K ICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RMEIsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4MEIpDQogICAg ICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RMEQsIDAs IFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgIEhDTlYgKDB4MEQpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAg ICAgICBNZXRob2QgKF9RMEUsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4MEUpDQogICAgICAgICAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RMEYsIDAsIFNlcmlhbGl6ZWQpDQog ICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4MEYp DQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9R MTAsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgIEhDTlYgKDB4MTApDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAg ICAgICAgICAgICBNZXRob2QgKF9RMTEsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4MTEpDQogICAgICAgICAgICAg ICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RMTIsIDAsIFNlcmlhbGl6 ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYg KDB4MTIpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRo b2QgKF9RMTMsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICAgICAgICAgIEhDTlYgKDB4MTMpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAg ICAgICAgICAgICAgICAgICBNZXRob2QgKF9RMTQsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAg ICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4MTQpDQogICAgICAg ICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RMTUsIDAsIFNl cmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAg IEhDTlYgKDB4MTUpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAg ICBNZXRob2QgKF9RNzAsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4NzApDQogICAgICAgICAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RNzEsIDAsIFNlcmlhbGl6ZWQpDQogICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4NzEpDQog ICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RNzMs IDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgICAgIEhDTlYgKDB4NzMpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAg ICAgICAgICBNZXRob2QgKF9RNzQsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4NzQpDQogICAgICAgICAgICAgICAg ICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RNzUsIDAsIFNlcmlhbGl6ZWQp DQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4 NzUpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2Qg KF9RNzYsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgICAgIEhDTlYgKDB4NzYpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAg ICAgICAgICAgICAgICBNZXRob2QgKF9RNzcsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4NzcpDQogICAgICAgICAg ICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RNzgsIDAsIFNlcmlh bGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhD TlYgKDB4NzgpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBN ZXRob2QgKF9RNzksIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4NzkpDQogICAgICAgICAgICAgICAgICAgIH0NCg0K ICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RN0EsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4N0EpDQogICAg ICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RN0IsIDAs IFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgIEhDTlYgKDB4N0IpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAg ICAgICBNZXRob2QgKF9RODEsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4ODEpDQogICAgICAgICAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9RODIsIDAsIFNlcmlhbGl6ZWQpDQog ICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEhDTlYgKDB4ODIp DQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9R MEMsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgIFxfU0IuQ0hHRCAoKQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAg ICAgICAgICAgICAgTWV0aG9kIChfUTcyLCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBN ZXRob2QgKElOSTIsIDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoX1EyMywg MCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAg ICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChfUTlGLCAwLCBTZXJpYWxpemVkKQ0K ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBOb3RpZnkgKFxf U0IuQkFUQSwgMHg4MSkNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAg ICAgIE1ldGhvZCAoX1FBMCwgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0K ICAgICAgICAgICAgICAgICAgICAgICAgTm90aWZ5IChcX1NCLkJBVEEsIDB4ODApDQogICAgICAg ICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKEVDOEQsIDEsIFNl cmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAg IElmIChMRXF1YWwgKEVDU1QsIDB4MDApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChTaGlmdExlZnQgKEFyZzAsIDB4MDgpLCBM b2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEFkZCAoTG9jYWwwLCAw eDg4KSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChcX1NCLlBT UlYgKDB4QzMsIExvY2FsMCwgMHgwMCwgMHgwMCwgMHgwMyksIExvY2FsMCkNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICBJZiAoQW5kIChMb2NhbDAsIDB4RkYpKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgw eEZGRkZGRkZGKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoQW5kIChTaGlmdFJpZ2h0IChMb2NhbDAs IDB4MDgpLCAweEZGRkYpLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IFJldHVybiAoTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAg ICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBBY3F1aXJlIChF Q0VYLCAweEZGRkYpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEFyZzAsIERB VDEpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4ODgsIEVDQ1IpDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4QzgsIExvY2FsNCkNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICBXaGlsZSAoTEFuZCAoTE5vdCAoTEVxdWFsIChMb2NhbDQsIDB4MDAp KSwgTE5vdCAoTEVxdWFsIChFQ0NSLCAweDAwKSkpKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RhbGwgKDB4MTkpDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIERlY3JlbWVudCAoTG9jYWw0KQ0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3Jl IChEQVQxLCBMb2NhbDEpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKERBVDIs IExvY2FsMikNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWxlYXNlIChFQ0VYKQ0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKExvY2FsNCwgMHgwMCkpDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBSZXR1cm4gKDB4RkZGRkZGRkYpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEFkZCAoU2hpZnRMZWZ0IChMb2NhbDIs IDB4MDgpLCBMb2NhbDEpLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0 dXJuIChMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAg ICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKEVDMDMsIDIsIFNlcmlhbGl6ZWQp DQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1 YWwgKEFyZzEsIDB4MDApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKEFyZzAsIDB4MDApKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEVD ODYgKDB4NkEpLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoTG9jYWwwLCAweEZGRkZGRkZGKSkN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFJldHVybiAoMHgwMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChMb2NhbDApDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQog ICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChBcmcxLCAweDAxKSkNCiAgICAgICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFs IChBcmcwLCAweDAwKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChFQzhEICgweDZDKSwgTG9jYWwwKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElm IChMTm90IChMTGVzcyAoTG9jYWwwLCAweEZGRkYpKSkNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHhGRkZGRkZG RikNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgUmV0dXJuIChMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAg ICAgICBJZiAoTEVxdWFsIChBcmcxLCAweDAyKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChBcmcwLCAweDAwKSkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFN0b3JlIChFQzhEICgweDZFKSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMTm90IChMTGVzcyAoTG9j YWwwLCAweEZGRkYpKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHhGRkZGRkZGRikNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg UmV0dXJuIChMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAg ICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChB cmcxLCAweDAzKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICBJZiAoTEVxdWFsIChBcmcwLCAweDAwKSkNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChFQzhEICgw eDcwKSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFQzgyICgweDQx LCAweDAwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIElmIChMTm90IChMTGVzcyAoTG9jYWwwLCAweEZGRkYpKSkNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJl dHVybiAoMHhGRkZGRkZGRikNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChMb2NhbDApDQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAg ICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChfUTVDLCAwLCBT ZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAg ICBOb3RpZnkgKFxfVFouVFpDLCAweDgwKQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAg ICAgICAgICAgICAgICAgTWV0aG9kIChfUTgwLCAwLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoRUMwMSAoKSwgUFdSUykN CiAgICAgICAgICAgICAgICAgICAgICAgIFxfU0IuUFNSViAoMHhDOSwgMHgwMywgMHgwMSwgUFdS UywgMHgwMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIFBOT1QgKCkNCiAgICAgICAgICAgICAg ICAgICAgICAgIE5vdGlmeSAoXF9TQi5BQywgMHg4MCkNCiAgICAgICAgICAgICAgICAgICAgfQ0K DQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoX1E4MywgMCwgU2VyaWFsaXplZCkNCiAgICAg ICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgTm90aWZ5IChcX1NCLkxJ RCwgMHg4MCkNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE1l dGhvZCAoX1FBMywgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICAgICAgXF9TQi5QU1JWICgweEQ1LCAweDAwLCAweDAwLCAweDAwLCAweDAw KQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChF QzA2LCAwLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAg ICAgICAgICAgICBTdG9yZSAoMHgwOSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAg U3RvcmUgKDB4MDIsIExvY2FsMSkNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChFQzg5 IChMb2NhbDAsIExvY2FsMSksIExvY2FsMikNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChM RXF1YWwgKExvY2FsMiwgMHhGRkZGRkZGRikpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweDAxKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAg ICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoTG9jYWwyKQ0K ICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAg ICAgICAgICAgICAgICAgTWV0aG9kIChFQzA3LCAwLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKEVDODggKEVDODcgKDB4 MDQsIDB4QzgpKSkNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAg IE1ldGhvZCAoRUMwOCwgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAg ICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweDAzKQ0KICAgICAgICAgICAgICAgICAgICB9 DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChFQzA5LCAwLCBTZXJpYWxpemVkKQ0KICAg ICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKEVDODgg KEVDODcgKDB4MDQsIDB4QzUpKSkNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAg ICAgICAgICAgIE1ldGhvZCAoRUMwQSwgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChFQzg4IChFQzg3ICgweDA0LCAw eEM2KSkpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRo b2QgKEVDMEIsIDEsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICAgICAgICAgIEVDODMgKDB4MEIsIEFyZzApDQogICAgICAgICAgICAgICAgICAgICAg ICBSZXR1cm4gKDB4MDApDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAg ICAgICBNZXRob2QgKEVDMDEsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoQW5kIChFQzg2ICgweDA4KSwgMHgwMSkp DQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKEVD MDIsIDEsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgIFN0b3JlIChFQzg2ICgweDA4KSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAg ICAgICAgSWYgKExFcXVhbCAoTG9jYWwwLCAweEZGRkZGRkZGKSkNCiAgICAgICAgICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MDApDQogICAg ICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1 YWwgKEFyZzAsIDB4MDApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIElmIChBbmQgKExvY2FsMCwgMHgwNCkpDQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4 MDEpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgwMCkNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKEVDMDQsIDIsIFNlcmlhbGl6ZWQpDQogICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIE5hbWUgKEJVRiwgQnVm ZmVyICgweDEwKSB7fSkNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKEFyZzAs IDB4MDApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIElmIChMRXF1YWwgKEFyZzEsIDB4MDApKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEVDODUgKDB4NjAp LCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKExv Y2FsMCwgMHhGRkZGRkZGRikpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgwMSkNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBFbHNlDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMSwgMHgwMSkpDQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9y ZSAoRUM4NSAoMHg2MiksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg SWYgKExPciAoTEVxdWFsIChMb2NhbDAsIDB4MDApLCBMTm90IChMTGVzcyAoTG9jYWwwLCAweEZG RkYpKSkpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHhGRkZGRkZGRikNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbHNl DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFJldHVybiAoTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMSwgMHgwMikpDQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoRUM4 NSAoMHg2NCksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExP ciAoTEVxdWFsIChMb2NhbDAsIDB4MDApLCBMTm90IChMTGVzcyAoTG9jYWwwLCAweEZGRkYpKSkp DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFJldHVybiAoMHhGRkZGRkZGRikNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFJldHVybiAoTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgSWYgKExFcXVhbCAoQXJnMSwgMHgwMykpDQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKE9uZSkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICBJZiAoTEVxdWFsIChBcmcxLCAweDA0KSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7 DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChFQzg1ICgweDY4KSwgTG9j YWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTE9yIChMRXF1YWwgKExv Y2FsMCwgMHgwMCksIExOb3QgKExMZXNzIChMb2NhbDAsIDB4RkZGRikpKSkNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgUmV0dXJuICgweEZGRkZGRkZGKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9 DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0 dXJuIChMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAo TEVxdWFsIChBcmcxLCAweDA1KSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChFQzg1ICgweDcyKSwgTG9jYWwwKQ0K ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChMb2NhbDAsIDB4RkZG RkZGRkYpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MDApDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBSZXR1cm4gKExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgIElmIChMRXF1YWwgKEFyZzEsIDB4MDYpKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEVDODUgKDB4 NzQpLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwg KExvY2FsMCwgMHhGRkZGRkZGRikpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgwMCkNCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBFbHNlDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoTG9jYWwwKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMSwgMHgwNykpDQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBT dG9yZSAoRUM4NSAoMHg3NiksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgSWYgKExFcXVhbCAoTG9jYWwwLCAweEZGRkZGRkZGKSkNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJu ICgweDAxKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChMb2NhbDApDQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChBcmcxLCAw eDA4KSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFN0b3JlIChFQzg1ICgweDc4KSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChMb2NhbDAsIDB4RkZGRkZGRkYpKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBSZXR1cm4gKDB4MDEpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0N CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1 cm4gKExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChM RXF1YWwgKEFyZzEsIDB4MDkpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4MDAsIEJVRikNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEVDODQgKDB4OEMsIDB4MEMpLCBCVUYpDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoQlVGKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwg KEFyZzEsIDB4MEEpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4MDAsIEJVRikNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgU3RvcmUgKEVDODUgKDB4OUEpLCBMb2NhbDApDQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFN0b3JlIChFQzhDIChMb2NhbDAsIDB4MDUpLCBCVUYpDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoQlVGKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwg KEFyZzEsIDB4MEIpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4MDAsIEJVRikNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgU3RvcmUgKEVDODQgKDB4OUMsIDB4MDgpLCBCVUYpDQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoQlVGKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKEFyZzEs IDB4MEMpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgU3RvcmUgKCJQYW5hc29uaWMiLCBCVUYpDQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFJldHVybiAoQlVGKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAg IH0NCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgfQ0KDQog ICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoRUMwNSwgMiwgU2VyaWFsaXplZCkNCiAgICAgICAg ICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMCwg MHgwMCkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgRUM4MiAoMHhGMCwgQXJnMSkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAg ICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoRUMwQywgMSwg U2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAg ICAgU3RvcmUgKEFuZCAoQXJnMCwgMHgwNyksIFNMUFQpDQogICAgICAgICAgICAgICAgICAgICAg ICBSZXR1cm4gKDB4MDApDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAg ICAgICBNZXRob2QgKEVDMEQsIDEsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKEFyZzAsIDB4MDEpKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgw eDk4LCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAg ICAgICAgICBFbHNlDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMCwgMHgwMCkpDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHg4MSwg TG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4RkZGRkZGRkYpDQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAg ICAgICAgICAgICAgICBSZXR1cm4gKEVDOEIgKDB4NDMsIExvY2FsMCkpDQogICAgICAgICAgICAg ICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKEVDMEUsIDEsIFNlcmlhbGl6 ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChM Tm90IChMRXF1YWwgKEVDOEEgKDB4MDAsIDB4MjMsIEFuZCAoRUM4NyAoMHgwMCwgMHgyMyksIDB4 RkQpKSwgMHgwMCkpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFJldHVybiAoMHhGRkZGRkZGRikNCiAgICAgICAgICAgICAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoQXJnMCwgMHgwMSkpDQog ICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3Rv cmUgKDB4ODAsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAg ICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICBTdG9yZSAoMHgwMCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAg ICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChFQzhBICgweDAx LCAweDlDLCAweEZGKSwgMHgwMCkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChFQzhBICgweDAxLCAweDlELCBMb2NhbDApKQ0K ICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0K ICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJl dHVybiAoMHhGRkZGRkZGRikNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAg ICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoRUMwRiwgMSwgU2VyaWFs aXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgSWYg KExFcXVhbCAoQXJnMCwgMHgwMSkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4MDEsIExvY2FsMCkNCiAgICAgICAgICAgICAg ICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAg ICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChBcmcw LCAweDAwKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFN0b3JlICgweDAwLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJldHVy biAoMHhGRkZGRkZGRikNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAg ICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgIEVDODMgKDB4MTcsIExv Y2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHhGRkZGRkZGRikNCiAgICAg ICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoRUMxMCwgMiwg U2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAg ICAgU3RvcmUgKEVDODkgKEFyZzAsIEFyZzEpLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAg ICAgICBJZiAoTEVxdWFsIChMb2NhbDAsIDB4RkZGRkZGRkYpKQ0KICAgICAgICAgICAgICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgwMCkNCiAgICAg ICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAg ICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4g KExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAg fQ0KDQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoWjAwMCwgMCwgU2VyaWFsaXplZCkNCiAg ICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEVDODYg KDB4MTUpLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICBBbmQgKExvY2FsMCwgMHg4 MCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChMb2NhbDApDQogICAg ICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKEVDODIsIDIs IFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgIElmIChMRXF1YWwgKEVDU1QsIDB4MDApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0K ICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMQW5kIChMTm90IChMTGVzcyAoQXJnMCwg MHhGMCkpLCBMTm90IChMR3JlYXRlciAoQXJnMCwgMHhGMykpKSkNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChTaGlm dExlZnQgKEFyZzEsIDB4MDgpLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAg fQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweDAwLCBM b2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgU3RvcmUgKEFkZCAoU2hpZnRMZWZ0IChMb2NhbDAsIDB4MDgpLCBBcmcwKSwg TG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChBZGQgKFNoaWZ0TGVm dCAoTG9jYWwwLCAweDA4KSwgMHhERCksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICBTdG9yZSAoXF9TQi5QU1JWICgweEMzLCBMb2NhbDAsIDB4MDAsIDB4MDAsIDB4MDMpLCBM b2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKEFuZCAoTG9jYWwwLCAweDQw MDAwMEZGKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFJldHVybiAoMHhGRkZGRkZGRikNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExB bmQgKExOb3QgKExMZXNzIChBcmcwLCAweDIwKSksIExOb3QgKExHcmVhdGVyIChBcmcwLCAweDM3 KSkpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBTdG9yZSAoQW5kIChTaGlmdFJpZ2h0IChMb2NhbDAsIDB4MDgp LCAweDAwODBGRkZGKSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgUmV0dXJuIChMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4g KDB4MDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAg ICAgICAgICAgICAgIEFjcXVpcmUgKEVDRVgsIDB4RkZGRikNCiAgICAgICAgICAgICAgICAgICAg ICAgIElmIChMQW5kIChMTm90IChMTGVzcyAoQXJnMCwgMHhGMCkpLCBMTm90IChMR3JlYXRlciAo QXJnMCwgMHhGMykpKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICBTdG9yZSAoQW5kIChBcmcxLCAweEZGKSwgREFUMikNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICBTdG9yZSAoQW5kIChTaGlmdFJpZ2h0IChBcmcxLCAweDA4KSwgMHhG RiksIERBVDMpDQogICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAg ICAgICAgIFN0b3JlIChBcmcwLCBEQVQxKQ0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUg KDB4REQsIEVDQ1IpDQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHhDOCwgTG9jYWw0 KQ0KICAgICAgICAgICAgICAgICAgICAgICAgV2hpbGUgKExBbmQgKExOb3QgKExFcXVhbCAoTG9j YWw0LCAweDAwKSksIExOb3QgKExFcXVhbCAoRUNDUiwgMHgwMCkpKSkNCiAgICAgICAgICAgICAg ICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdGFsbCAoMHgxOSkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICBEZWNyZW1lbnQgKExvY2FsNCkNCiAgICAgICAgICAg ICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKERBVDEsIExv Y2FsMSkNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChEQVQyLCBMb2NhbDIpDQogICAg ICAgICAgICAgICAgICAgICAgICBTdG9yZSAoREFUMywgTG9jYWwzKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgUmVsZWFzZSAoRUNFWCkNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChMT3Ig KExFcXVhbCAoTG9jYWw0LCAweDAwKSwgQW5kIChMb2NhbDMsIDB4NDApKSkNCiAgICAgICAgICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4RkZG RkZGRkYpDQogICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAg ICAgIElmIChMQW5kIChMTm90IChMTGVzcyAoQXJnMCwgMHgyMCkpLCBMTm90IChMR3JlYXRlciAo QXJnMCwgMHgzNykpKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICBTdG9yZSAoQWRkIChTaGlmdExlZnQgKExvY2FsMiwgMHgwOCksIExvY2Fs MSksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoQW5kIChMb2NhbDMs IDB4ODApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgT3IgKExvY2FsMCwgMHgwMDgwMDAwMCkNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKExvY2Fs MCkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAg UmV0dXJuICgweDAwKQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAg ICAgTWV0aG9kIChFQzgzLCAyLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQog ICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChFQ1NULCAweDAwKSkNCiAgICAgICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFs IChBcmcwLCAweDBCKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFxfU0IuRUNXUiAoMHgwQiwgQXJnMSkNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVx dWFsIChBcmcwLCAweDE3KSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFxfU0IuRUNXUiAoMHgxNywgQXJnMSkNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAg ICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgQWNxdWlyZSAoRUNFWCwgMHhGRkZGKQ0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFN0b3JlIChBcmcwLCBEQVQxKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFN0b3JlIChBcmcxLCBEQVQyKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0 b3JlICgweEI1LCBFQ0NSKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweEM4 LCBMb2NhbDEpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgV2hpbGUgKExBbmQgKExOb3Qg KExFcXVhbCAoTG9jYWwxLCAweDAwKSksIExOb3QgKExFcXVhbCAoRUNDUiwgMHgwMCkpKSkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFN0YWxsICgweDE5KQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEZWNyZW1l bnQgKExvY2FsMSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICBSZWxlYXNlIChFQ0VYKQ0KICAgICAgICAgICAgICAgICAgICAgICAg fQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChF Qzg5LCAyLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAg ICAgICAgICAgICBJZiAoTE9yIChMT3IgKExMZXNzIChBcmcwLCAweDAxKSwgTEdyZWF0ZXIgKEFy ZzAsIDB4MTApKSwgTEdyZWF0ZXIgKEFyZzEsIDB4MDcpKSkNCiAgICAgICAgICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4RkZGRkZGRkYpDQog ICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3Jl IChFQzg3ICgweDEyLCAweEVGKSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgSWYg KExFcXVhbCAoTG9jYWwwLCAweEZGRkZGRkZGKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4RkZGRkZGRkYpDQogICAgICAg ICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweDBB LCBMb2NhbDEpDQogICAgICAgICAgICAgICAgICAgICAgICBXaGlsZSAoTEFuZCAoTE5vdCAoTEVx dWFsIChMb2NhbDEsIDB4MDApKSwgTEVxdWFsIChFQzg3ICgweDEyLCAweEVGKSwgTG9jYWwwKSkp DQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAg U2xlZXAgKDB4MDEpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgRGVjcmVtZW50IChMb2Nh bDEpDQogICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAg IElmIChMRXF1YWwgKExvY2FsMSwgMHgwMCkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweEZGRkZGRkZGKQ0KICAgICAgICAg ICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoRUM4NyAo MHgxMiwgQWRkICgweEVGLCBBcmcwKSksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAg IElmIChMRXF1YWwgKExvY2FsMCwgMHhGRkZGRkZGRikpDQogICAgICAgICAgICAgICAgICAgICAg ICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweEZGRkZGRkZGKQ0KICAg ICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4g KEFuZCAoU2hpZnRSaWdodCAoTG9jYWwwLCBBcmcxKSwgMHgwMSkpDQogICAgICAgICAgICAgICAg ICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKEVDODQsIDIsIFNlcmlhbGl6ZWQp DQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIE5hbWUgKEVC VUYsIEJ1ZmZlciAoMHgxMCkge30pDQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHgw MCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExHcmVhdGVyIChBcmcxLCAw eDAwKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICBXaGlsZSAoTExlc3MgKExvY2FsMCwgQXJnMSkpDQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoRUM4NiAoQWRk IChBcmcwLCBMb2NhbDApKSwgTG9jYWwxKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBJZiAoTEVxdWFsIChMb2NhbDEsIDB4RkZGRkZGRkYpKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCcmVhaw0K ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgU3RvcmUgKExvY2FsMSwgSW5kZXggKEVCVUYsIExvY2FsMCkpDQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIEluY3JlbWVudCAoTG9jYWwwKQ0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMTm90 IChMRXF1YWwgKExvY2FsMCwgQXJnMSkpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4MDAsIEVCVUYpDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQog ICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKEVCVUYpDQogICAgICAgICAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKEVDODUsIDEsIFNlcmlhbGl6ZWQpDQog ICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIEFkZCAoQXJnMCwg MHgwMSwgTG9jYWwxKQ0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4RkZGRkZGRkYs IExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChMTm90IChMR3JlYXRlciAoTG9j YWwxLCAweEZGKSkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgU3RvcmUgKEVDODYgKExvY2FsMSksIExvY2FsMikNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICBJZiAoTE5vdCAoTEdyZWF0ZXIgKExvY2FsMiwgMHhGRikpKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg U2hpZnRMZWZ0IChMb2NhbDIsIDB4MDgsIExvY2FsMikNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgU3RvcmUgKEVDODYgKEFyZzApLCBMb2NhbDMpDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIElmIChMTm90IChMR3JlYXRlciAoTG9jYWwzLCAweEZGKSkpDQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIEFkZCAoTG9jYWwzLCBMb2NhbDIsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAg ICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChMb2NhbDAp DQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKEVD ODYsIDEsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgIFN0b3JlICgweEZGRkZGRkZGLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAg ICAgICBJZiAoTE5vdCAoTEdyZWF0ZXIgKEFyZzAsIDB4N0YpKSkNCiAgICAgICAgICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoRUM4NyAoMHgxMywg T3IgKEFyZzAsIDB4ODApKSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAg ICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMTm90IChMR3JlYXRlciAoQXJnMCwgMHhGRikp KQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgU3RvcmUgKEVDODcgKDB4MTQsIEFyZzApLCBMb2NhbDApDQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAg ICAgICAgICAgICAgICBSZXR1cm4gKExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQog ICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoRUM4RiwgMiwgU2VyaWFsaXplZCkNCiAgICAgICAg ICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4RkZGRkZGRkYs IExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChMTm90IChMR3JlYXRlciAoQXJn MCwgMHg3RikpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFN0b3JlIChFQzhBICgweDEzLCBPciAoQXJnMCwgMHg4MCksIEFyZzEpLCBMb2Nh bDApDQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBF bHNlDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgSWYgKExOb3QgKExHcmVhdGVyIChBcmcwLCAweEZGKSkpDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoRUM4QSAo MHgxNCwgQXJnMCwgQXJnMSksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9 DQogICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgIFJl dHVybiAoTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAg ICAgTWV0aG9kIChFQzg3LCAyLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQog ICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChFQ1NULCAweDAwKSkNCiAgICAgICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoQXJn MCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChBZGQgKFNoaWZ0 TGVmdCAoTG9jYWwwLCAweDA4KSwgQXJnMSksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICBTdG9yZSAoQWRkIChTaGlmdExlZnQgKExvY2FsMCwgMHgxMCksIDB4QkEpLCBMb2Nh bDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKFxfU0IuUFNSViAoMHhDMywg TG9jYWwwLCAweDAwLCAweDAwLCAweDAzKSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIElmIChBbmQgKExvY2FsMCwgMHhGRikpDQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4RkZGRkZGRkYp DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFJldHVybiAoQW5kIChTaGlmdFJpZ2h0IChMb2NhbDAsIDB4MDgpLCAw eEZGKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAg ICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgIEFjcXVpcmUgKEVDRVgsIDB4RkZGRikN CiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweEZGRkZGRkZGLCBMb2NhbDApDQogICAg ICAgICAgICAgICAgICAgICAgICBJZiAoTEFuZCAoTE5vdCAoTEdyZWF0ZXIgKEFyZzEsIDB4RkYp KSwgTE5vdCAoTEdyZWF0ZXIgKEFyZzAsIDB4MTcpKSkpDQogICAgICAgICAgICAgICAgICAgICAg ICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEFyZzEsIERBVDIpDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEFyZzAsIERBVDMpDQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgU3RvcmUgKDB4QkEsIEVDQ1IpDQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgU3RvcmUgKDB4QzgsIExvY2FsMSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBX aGlsZSAoTEFuZCAoTE5vdCAoTEVxdWFsIChMb2NhbDEsIDB4MDApKSwgTE5vdCAoTEVxdWFsIChF Q0NSLCAweDAwKSkpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgU3RhbGwgKDB4MTkpDQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIERlY3JlbWVudCAoTG9jYWwxKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKExvY2FsMSwgMHgw MCkpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBTdG9yZSAoMHhGRkZGRkZGRiwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9y ZSAoREFUMSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAg ICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgUmVsZWFzZSAoRUNF WCkNCiAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoTG9jYWwwKQ0KICAgICAgICAgICAg ICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChFQzhCLCAyLCBTZXJpYWxp emVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBTdG9y ZSAoMHhGRkZGRkZGRiwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExOb3Qg KExHcmVhdGVyIChBcmcwLCAweDdGKSkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEVDOEEgKDB4MTMsIE9yIChBcmcwLCAweDgw KSwgQXJnMSksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAg ICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICBJZiAoTE5vdCAoTEdyZWF0ZXIgKEFyZzAsIDB4RkYpKSkNCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IFN0b3JlIChFQzhBICgweDE0LCBBcmcwLCBBcmcxKSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAg ICAgICAgICAgICAgUmV0dXJuIChMb2NhbDApDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAg ICAgICAgICAgICAgICAgICBNZXRob2QgKEVDOEEsIDMsIFNlcmlhbGl6ZWQpDQogICAgICAgICAg ICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKEVDU1QsIDB4 MDApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFN0b3JlIChBcmcwLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3Rv cmUgKEFkZCAoU2hpZnRMZWZ0IChMb2NhbDAsIDB4MDgpLCBBcmcxKSwgTG9jYWwwKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChBZGQgKFNoaWZ0TGVmdCAoTG9jYWwwLCAweDA4 KSwgQXJnMiksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoQWRk IChTaGlmdExlZnQgKExvY2FsMCwgMHgwOCksIDB4QkIpLCBMb2NhbDApDQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgU3RvcmUgKFxfU0IuUFNSViAoMHhDMywgTG9jYWwwLCAweDAwLCAweDAw LCAweDAzKSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChBbmQgKExv Y2FsMCwgMHhGRikpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4RkZGRkZGRkYpDQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJl dHVybiAoMHgwMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAg ICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgIEFjcXVpcmUgKEVDRVgsIDB4 RkZGRikNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweEZGRkZGRkZGLCBMb2NhbDAp DQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEFuZCAoTE5vdCAoTEdyZWF0ZXIgKEFyZzEs IDB4RkYpKSwgTE5vdCAoTEdyZWF0ZXIgKEFyZzAsIDB4MTcpKSkpDQogICAgICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEFyZzIsIERBVDEp DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEFyZzEsIERBVDIpDQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEFyZzAsIERBVDMpDQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgU3RvcmUgKDB4QkIsIEVDQ1IpDQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgU3RvcmUgKDB4QzgsIExvY2FsMSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBXaGls ZSAoTEFuZCAoTE5vdCAoTEVxdWFsIChMb2NhbDEsIDB4MDApKSwgTE5vdCAoTEVxdWFsIChFQ0NS LCAweDAwKSkpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgU3RhbGwgKDB4MTkpDQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIERlY3JlbWVudCAoTG9jYWwxKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKExvY2FsMSwgMHgwMCkp DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBTdG9yZSAoMHhGRkZGRkZGRiwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAo MHgwMCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAg ICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgUmVsZWFzZSAoRUNFWCkN CiAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoTG9jYWwwKQ0KICAgICAgICAgICAgICAg ICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChFQzhFLCAxLCBTZXJpYWxpemVk KQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBBbmQgKEFy ZzAsIDB4RkYsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoXF9TQi5Q U1JWICgweDk4LCBMb2NhbDAsIDB4MDAsIDB4MDAsIDB4MDEpKQ0KICAgICAgICAgICAgICAgICAg ICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChFQzg4LCAxLCBTZXJpYWxpemVkKQ0K ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEdyZWF0 ZXIgKEFyZzAsIDB4RkYpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFN0b3JlICgweEZGRkZGRkZGLCBMb2NhbDApDQogICAgICAgICAgICAg ICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgQWRkIChBcmcwLCAweDEx LCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExFcXVhbCAoQW5kIChB cmcwLCAweDgwKSwgMHgwMCkpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBBZGQgKExvY2FsMCwgMHgwMTAwLCBMb2NhbDApDQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgTXVsdGlwbHkgKExvY2FsMCwgMHgwQSwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKExvY2FsMCkNCiAgICAgICAg ICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoRUM4QywgMiwgU2Vy aWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAg TmFtZSAoQlVGLCBCdWZmZXIgKDB4MTApIHt9KQ0KICAgICAgICAgICAgICAgICAgICAgICAgU3Rv cmUgKDB4MDAsIEJVRikNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChMT3IgKExMZXNzIChB cmcxLCAweDAxKSwgTEdyZWF0ZXIgKEFyZzEsIDB4MTApKSkNCiAgICAgICAgICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKEJVRikNCiAgICAgICAg ICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKEFyZzAs IExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweDAwLCBMb2NhbDEpDQog ICAgICAgICAgICAgICAgICAgICAgICBXaGlsZSAoTExlc3MgKExvY2FsMSwgQXJnMSkpDQogICAg ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgRGl2aWRl IChMb2NhbDAsIDB4MEEsIExvY2FsMiwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFN1YnRyYWN0IChBcmcxLCBMb2NhbDEsIExvY2FsMykNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICBEZWNyZW1lbnQgKExvY2FsMykNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBB ZGQgKExvY2FsMiwgMHgzMCwgSW5kZXggKEJVRiwgTG9jYWwzKSkNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICBJbmNyZW1lbnQgKExvY2FsMSkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChCVUYpDQogICAgICAgICAgICAgICAg ICAgIH0NCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBEZXZpY2UgKEsxMDEp DQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBOYW1lIChfSElELCBFaXNh SWQgKCJQTlAwMzAzIikpDQogICAgICAgICAgICAgICAgICAgIE5hbWUgKF9DUlMsIFJlc291cmNl VGVtcGxhdGUgKCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAg ICAgSU8gKERlY29kZTE2LCAweDAwNjAsIDB4MDA2MCwgMHgwMSwgMHgwMSkNCiAgICAgICAgICAg ICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgwMDY0LCAweDAwNjQsIDB4MDEsIDB4MDEpDQog ICAgICAgICAgICAgICAgICAgICAgICBJUlFOb0ZsYWdzICgpIHsxfQ0KICAgICAgICAgICAgICAg ICAgICB9KQ0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9TVEEsIDAsIE5vdFNlcmlhbGl6 ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChM Tm90IChMRXF1YWwgKFxfU0IuUFNSViAoMHg5NywgMHgwNTAwMDAwMCwgMHgwMSwgMHg1MDAwLCAw eDAzKSwgMHgwMSkpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFJldHVybiAoMHgwRikNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAg ICAgICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MDApDQogICAgICAgICAgICAgICAg ICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9DQoNCiAg ICAgICAgICAgICAgICBEZXZpY2UgKEsxMDYpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAg ICAgICAgICAgICBOYW1lIChfSElELCBFaXNhSWQgKCJQTlAwMzIwIikpDQogICAgICAgICAgICAg ICAgICAgIE5hbWUgKF9DSUQsIDB4MDMwM0QwNDEpDQogICAgICAgICAgICAgICAgICAgIE5hbWUg KF9DUlMsIFJlc291cmNlVGVtcGxhdGUgKCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICAgICAgSU8gKERlY29kZTE2LCAweDAwNjAsIDB4MDA2MCwgMHgwMSwgMHgw MSkNCiAgICAgICAgICAgICAgICAgICAgICAgIElPIChEZWNvZGUxNiwgMHgwMDY0LCAweDAwNjQs IDB4MDEsIDB4MDEpDQogICAgICAgICAgICAgICAgICAgICAgICBJUlFOb0ZsYWdzICgpIHsxfQ0K ICAgICAgICAgICAgICAgICAgICB9KQ0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9TVEEs IDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgIElmIChMRXF1YWwgKFxfU0IuUFNSViAoMHg5NywgMHgwNTAwMDAwMCwgMHgwMSwg MHg1MDAwLCAweDAzKSwgMHgwMSkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweDBGKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgwMCkNCiAgICAgICAg ICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgICAgIERldmljZSAoTU9VUykNCiAgICAgICAgICAgICAgICB7DQog ICAgICAgICAgICAgICAgICAgIE5hbWUgKF9ISUQsIEVpc2FJZCAoIlBOUDBGMTMiKSkNCiAgICAg ICAgICAgICAgICAgICAgTmFtZSAoX0NSUywgUmVzb3VyY2VUZW1wbGF0ZSAoKQ0KICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBJUlFOb0ZsYWdzICgpIHsxMn0N CiAgICAgICAgICAgICAgICAgICAgfSkNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChfU1RB LCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAg ICAgICAgICAgICBTdG9yZSAoXF9TQi5QU1JWICgweDk3LCAweDA2MDAwMDAwLCAweDAxLCAweDYw MDAsIDB4MDEpLCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsIChM b2NhbDAsIDB4MDEpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFJldHVybiAoMHgwMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAg ICAgICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MEYpDQogICAgICAgICAgICAgICAg ICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgIE9wZXJhdGlvblJlZ2lvbiAoQkRB LCBTeXN0ZW1NZW1vcnksIDB4MDQwMCwgMHgwMTAwKQ0KICAgICAgICAgICAgICAgICAgICAgICAg RmllbGQgKEJEQSwgQnl0ZUFjYywgTm9Mb2NrLCBQcmVzZXJ2ZSkNCiAgICAgICAgICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPZmZzZXQgKDB4MTApLCANCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCAgIDIsIA0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgIE1GTEcsICAgMQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAg ICAgICAgICAgICAgICAgICBJZiAoTUZMRykNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MEYpDQogICAgICAgICAgICAgICAg ICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweDAwKQ0KICAg ICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAg ICAgICAgfQ0KDQogICAgICAgICAgICAgICAgRGV2aWNlIChNT1UzKQ0KICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX0hJRCwgRWlzYUlkICgiU1lOMDAwMiIpKQ0K ICAgICAgICAgICAgICAgICAgICBOYW1lIChfQ0lELCAweDEzMEZEMDQxKQ0KICAgICAgICAgICAg ICAgICAgICBOYW1lIChfQ1JTLCBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElSUU5vRmxhZ3MgKCkgezEyfQ0KICAgICAg ICAgICAgICAgICAgICB9KQ0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9TVEEsIDAsIE5v dFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgIFN0b3JlIChcX1NCLlBTUlYgKDB4OTcsIDB4MDYwMDAwMDAsIDB4MDEsIDB4NjAwMCwgMHgw MSksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKExvY2FsMCwg MHgwMSkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgUmV0dXJuICgweDBGKQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAg ICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgwMCkNCiAgICAgICAgICAgICAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgT3BlcmF0aW9uUmVnaW9uIChCREEsIFN5c3Rl bU1lbW9yeSwgMHgwNDAwLCAweDAxMDApDQogICAgICAgICAgICAgICAgICAgICAgICBGaWVsZCAo QkRBLCBCeXRlQWNjLCBOb0xvY2ssIFByZXNlcnZlKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9mZnNldCAoMHgxMCksIA0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAsICAgMiwgDQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgTUZMRywgICAxDQogICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAg ICAgICAgICAgIElmIChNRkxHKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFJldHVybiAoMHgwRikNCiAgICAgICAgICAgICAgICAgICAgICAg IH0NCiAgICAgICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MDApDQogICAgICAgICAg ICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9 DQoNCiAgICAgICAgICAgICAgICBEZXZpY2UgKExOS0EpDQogICAgICAgICAgICAgICAgew0KICAg ICAgICAgICAgICAgICAgICBOYW1lIChfSElELCBFaXNhSWQgKCJQTlAwQzBGIikpDQogICAgICAg ICAgICAgICAgICAgIE5hbWUgKF9VSUQsIDB4MDEpDQogICAgICAgICAgICAgICAgICAgIE1ldGhv ZCAoX0RJUywgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAg ICAgICAgICAgICAgICAgU3RvcmUgKDB4ODAsIFBBUkMpDQogICAgICAgICAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgICAgICAgICBOYW1lIChfUFJTLCBSZXNvdXJjZVRlbXBsYXRlICgpDQog ICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElSUSAoTGV2ZWws IEFjdGl2ZUxvdywgU2hhcmVkKSB7MTF9DQogICAgICAgICAgICAgICAgICAgIH0pDQogICAgICAg ICAgICAgICAgICAgIE1ldGhvZCAoX0NSUywgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgTmFtZSAoUlRMQSwgUmVzb3VyY2VUZW1w bGF0ZSAoKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIElSUSAoTGV2ZWwsIEFjdGl2ZUxvdywgU2hhcmVkKSB7fQ0KICAgICAgICAgICAgICAg ICAgICAgICAgfSkNCiAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZVdvcmRGaWVsZCAoUlRM QSwgMHgwMSwgSVJRMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChaZXJvLCBJUlEw KQ0KICAgICAgICAgICAgICAgICAgICAgICAgU2hpZnRMZWZ0ICgweDAxLCBBbmQgKFBBUkMsIDB4 MEYpLCBJUlEwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChSVExBKQ0KICAgICAg ICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChfU1JTLCAxLCBT ZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAg ICBDcmVhdGVXb3JkRmllbGQgKEFyZzAsIDB4MDEsIElSUTApDQogICAgICAgICAgICAgICAgICAg ICAgICBGaW5kU2V0UmlnaHRCaXQgKElSUTAsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAg ICAgIERlY3JlbWVudCAoTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKExv Y2FsMCwgUEFSQykNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAg IE1ldGhvZCAoX1NUQSwgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAg ICAgICAgICAgICAgICAgICAgICAgSWYgKEFuZCAoUEFSQywgMHg4MCkpDQogICAgICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweDA5KQ0K ICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0K ICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJl dHVybiAoMHgwQikNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAg ICAgfQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIERldmljZSAoTE5LQikN CiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIE5hbWUgKF9ISUQsIEVpc2FJ ZCAoIlBOUDBDMEYiKSkNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX1VJRCwgMHgwMikNCiAg ICAgICAgICAgICAgICAgICAgTWV0aG9kIChfRElTLCAwLCBTZXJpYWxpemVkKQ0KICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHg4MCwgUEJSQykN CiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE5hbWUgKF9QUlMs IFJlc291cmNlVGVtcGxhdGUgKCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgSVJRIChMZXZlbCwgQWN0aXZlTG93LCBTaGFyZWQpIHs5fQ0KICAgICAgICAg ICAgICAgICAgICB9KQ0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9DUlMsIDAsIFNlcmlh bGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIE5h bWUgKFJUTEIsIFJlc291cmNlVGVtcGxhdGUgKCkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJUlEgKExldmVsLCBBY3RpdmVMb3csIFNoYXJl ZCkge30NCiAgICAgICAgICAgICAgICAgICAgICAgIH0pDQogICAgICAgICAgICAgICAgICAgICAg ICBDcmVhdGVXb3JkRmllbGQgKFJUTEIsIDB4MDEsIElSUTApDQogICAgICAgICAgICAgICAgICAg ICAgICBTdG9yZSAoWmVybywgSVJRMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIFNoaWZ0TGVm dCAoMHgwMSwgQW5kIChQQlJDLCAweDBGKSwgSVJRMCkNCiAgICAgICAgICAgICAgICAgICAgICAg IFJldHVybiAoUlRMQikNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAg ICAgIE1ldGhvZCAoX1NSUywgMSwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0K ICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlV29yZEZpZWxkIChBcmcwLCAweDAxLCBJUlEw KQ0KICAgICAgICAgICAgICAgICAgICAgICAgRmluZFNldFJpZ2h0Qml0IChJUlEwLCBMb2NhbDAp DQogICAgICAgICAgICAgICAgICAgICAgICBEZWNyZW1lbnQgKExvY2FsMCkNCiAgICAgICAgICAg ICAgICAgICAgICAgIFN0b3JlIChMb2NhbDAsIFBCUkMpDQogICAgICAgICAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9TVEEsIDAsIFNlcmlhbGl6ZWQpDQogICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChBbmQgKFBCUkMs IDB4ODApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFJldHVybiAoMHgwOSkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAg ICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MEIpDQogICAgICAgICAgICAgICAgICAgICAg ICB9DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAg ICAgICAgICBEZXZpY2UgKExOS0MpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICBOYW1lIChfSElELCBFaXNhSWQgKCJQTlAwQzBGIikpDQogICAgICAgICAgICAgICAgICAg IE5hbWUgKF9VSUQsIDB4MDMpDQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoX0RJUywgMCwg U2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAg ICAgU3RvcmUgKDB4ODAsIFBDUkMpDQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAg ICAgICAgICAgICBOYW1lIChfUFJTLCBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElSUSAoTGV2ZWwsIEFjdGl2ZUxvdywg U2hhcmVkKSB7OX0NCiAgICAgICAgICAgICAgICAgICAgfSkNCiAgICAgICAgICAgICAgICAgICAg TWV0aG9kIChfQ1JTLCAwLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgICAgICAgICBOYW1lIChSVExDLCBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAg ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgSVJRIChM ZXZlbCwgQWN0aXZlTG93LCBTaGFyZWQpIHt9DQogICAgICAgICAgICAgICAgICAgICAgICB9KQ0K ICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlV29yZEZpZWxkIChSVExDLCAweDAxLCBJUlEw KQ0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKFplcm8sIElSUTApDQogICAgICAgICAg ICAgICAgICAgICAgICBTaGlmdExlZnQgKDB4MDEsIEFuZCAoUENSQywgMHgwRiksIElSUTApDQog ICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKFJUTEMpDQogICAgICAgICAgICAgICAgICAg IH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9TUlMsIDEsIFNlcmlhbGl6ZWQpDQog ICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZVdvcmRG aWVsZCAoQXJnMCwgMHgwMSwgSVJRMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIEZpbmRTZXRS aWdodEJpdCAoSVJRMCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgRGVjcmVtZW50 IChMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoTG9jYWwwLCBQQ1JDKQ0K ICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChfU1RB LCAwLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg ICAgICAgICBJZiAoQW5kIChQQ1JDLCAweDgwKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MDkpDQogICAgICAgICAgICAg ICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweDBCKQ0K ICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAg ICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgRGV2aWNlIChMTktEKQ0KICAgICAgICAgICAg ICAgIHsNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX0hJRCwgRWlzYUlkICgiUE5QMEMwRiIp KQ0KICAgICAgICAgICAgICAgICAgICBOYW1lIChfVUlELCAweDA0KQ0KICAgICAgICAgICAgICAg ICAgICBNZXRob2QgKF9ESVMsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweDgwLCBQRFJDKQ0KICAgICAgICAgICAg ICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX1BSUywgUmVzb3VyY2VUZW1w bGF0ZSAoKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBJ UlEgKExldmVsLCBBY3RpdmVMb3csIFNoYXJlZCkgezd9DQogICAgICAgICAgICAgICAgICAgIH0p DQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoX0NSUywgMCwgU2VyaWFsaXplZCkNCiAgICAg ICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgTmFtZSAoUlRMRCwgUmVz b3VyY2VUZW1wbGF0ZSAoKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIElSUSAoTGV2ZWwsIEFjdGl2ZUxvdywgU2hhcmVkKSB7fQ0KICAgICAg ICAgICAgICAgICAgICAgICAgfSkNCiAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZVdvcmRG aWVsZCAoUlRMRCwgMHgwMSwgSVJRMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICha ZXJvLCBJUlEwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgU2hpZnRMZWZ0ICgweDAxLCBBbmQg KFBEUkMsIDB4MEYpLCBJUlEwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChSVExE KQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChf U1JTLCAxLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAg ICAgICAgICAgICBDcmVhdGVXb3JkRmllbGQgKEFyZzAsIDB4MDEsIElSUTApDQogICAgICAgICAg ICAgICAgICAgICAgICBGaW5kU2V0UmlnaHRCaXQgKElSUTAsIExvY2FsMCkNCiAgICAgICAgICAg ICAgICAgICAgICAgIERlY3JlbWVudCAoTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAg U3RvcmUgKExvY2FsMCwgUERSQykNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAg ICAgICAgICAgIE1ldGhvZCAoX1NUQSwgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgSWYgKEFuZCAoUERSQywgMHg4MCkpDQogICAg ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJu ICgweDA5KQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAg ICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFJldHVybiAoMHgwQikNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAg ICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIERldmlj ZSAoTE5LRSkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIE5hbWUgKF9I SUQsIEVpc2FJZCAoIlBOUDBDMEYiKSkNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX1VJRCwg MHgwNSkNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChfRElTLCAwLCBTZXJpYWxpemVkKQ0K ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHg4 MCwgUEVSQykNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIE5h bWUgKF9QUlMsIFJlc291cmNlVGVtcGxhdGUgKCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAg ICAgICAgICAgICAgICAgICAgICAgSVJRIChMZXZlbCwgQWN0aXZlTG93LCBTaGFyZWQpIHszfQ0K ICAgICAgICAgICAgICAgICAgICB9KQ0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9DUlMs IDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgICAgIE5hbWUgKFJUTEUsIFJlc291cmNlVGVtcGxhdGUgKCkNCiAgICAgICAgICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJUlEgKExldmVsLCBBY3RpdmVM b3csIFNoYXJlZCkge30NCiAgICAgICAgICAgICAgICAgICAgICAgIH0pDQogICAgICAgICAgICAg ICAgICAgICAgICBDcmVhdGVXb3JkRmllbGQgKFJUTEUsIDB4MDEsIElSUTApDQogICAgICAgICAg ICAgICAgICAgICAgICBTdG9yZSAoWmVybywgSVJRMCkNCiAgICAgICAgICAgICAgICAgICAgICAg IFNoaWZ0TGVmdCAoMHgwMSwgQW5kIChQRVJDLCAweDBGKSwgSVJRMCkNCiAgICAgICAgICAgICAg ICAgICAgICAgIFJldHVybiAoUlRMRSkNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAg ICAgICAgICAgICAgIE1ldGhvZCAoX1NSUywgMSwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlV29yZEZpZWxkIChBcmcwLCAw eDAxLCBJUlEwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgRmluZFNldFJpZ2h0Qml0IChJUlEw LCBMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICBEZWNyZW1lbnQgKExvY2FsMCkNCiAg ICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChMb2NhbDAsIFBFUkMpDQogICAgICAgICAgICAg ICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9TVEEsIDAsIFNlcmlhbGl6 ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElmIChB bmQgKFBFUkMsIDB4ODApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFJldHVybiAoMHgwOSkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0N CiAgICAgICAgICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MEIpDQogICAgICAgICAgICAg ICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9DQoN CiAgICAgICAgICAgICAgICBEZXZpY2UgKExOS0YpDQogICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICBOYW1lIChfSElELCBFaXNhSWQgKCJQTlAwQzBGIikpDQogICAgICAgICAg ICAgICAgICAgIE5hbWUgKF9VSUQsIDB4MDYpDQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAo X0RJUywgMCwgU2VyaWFsaXplZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgU3RvcmUgKDB4ODAsIFBGUkMpDQogICAgICAgICAgICAgICAgICAgIH0NCg0K ICAgICAgICAgICAgICAgICAgICBOYW1lIChfUFJTLCBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIElSUSAoTGV2ZWwsIEFj dGl2ZUxvdywgU2hhcmVkKSB7NX0NCiAgICAgICAgICAgICAgICAgICAgfSkNCiAgICAgICAgICAg ICAgICAgICAgTWV0aG9kIChfQ1JTLCAwLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAg ICB7DQogICAgICAgICAgICAgICAgICAgICAgICBOYW1lIChSVExGLCBSZXNvdXJjZVRlbXBsYXRl ICgpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgSVJRIChMZXZlbCwgQWN0aXZlTG93LCBTaGFyZWQpIHt9DQogICAgICAgICAgICAgICAgICAg ICAgICB9KQ0KICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlV29yZEZpZWxkIChSVExGLCAw eDAxLCBJUlEwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKFplcm8sIElSUTApDQog ICAgICAgICAgICAgICAgICAgICAgICBTaGlmdExlZnQgKDB4MDEsIEFuZCAoUEZSQywgMHgwRiks IElSUTApDQogICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKFJUTEYpDQogICAgICAgICAg ICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9TUlMsIDEsIFNlcmlh bGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIENy ZWF0ZVdvcmRGaWVsZCAoQXJnMCwgMHgwMSwgSVJRMCkNCiAgICAgICAgICAgICAgICAgICAgICAg IEZpbmRTZXRSaWdodEJpdCAoSVJRMCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAg RGVjcmVtZW50IChMb2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoTG9jYWww LCBQRlJDKQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0 aG9kIChfU1RBLCAwLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICBJZiAoQW5kIChQRlJDLCAweDgwKSkNCiAgICAgICAgICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MDkpDQogICAg ICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAg ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJu ICgweDBCKQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9 DQogICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgRGV2aWNlIChMTktHKQ0KICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX0hJRCwgRWlzYUlkICgi UE5QMEMwRiIpKQ0KICAgICAgICAgICAgICAgICAgICBOYW1lIChfVUlELCAweDA3KQ0KICAgICAg ICAgICAgICAgICAgICBNZXRob2QgKF9ESVMsIDAsIFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweDgwLCBQR1JDKQ0KICAg ICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTmFtZSAoX1BSUywgUmVz b3VyY2VUZW1wbGF0ZSAoKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg ICAgICAgICBJUlEgKExldmVsLCBBY3RpdmVMb3csIFNoYXJlZCkgezN9DQogICAgICAgICAgICAg ICAgICAgIH0pDQogICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoX0NSUywgMCwgU2VyaWFsaXpl ZCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgTmFtZSAo UlRMRywgUmVzb3VyY2VUZW1wbGF0ZSAoKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgIElSUSAoTGV2ZWwsIEFjdGl2ZUxvdywgU2hhcmVkKSB7 fQ0KICAgICAgICAgICAgICAgICAgICAgICAgfSkNCiAgICAgICAgICAgICAgICAgICAgICAgIENy ZWF0ZVdvcmRGaWVsZCAoUlRMRywgMHgwMSwgSVJRMCkNCiAgICAgICAgICAgICAgICAgICAgICAg IFN0b3JlIChaZXJvLCBJUlEwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgU2hpZnRMZWZ0ICgw eDAxLCBBbmQgKFBHUkMsIDB4MEYpLCBJUlEwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgUmV0 dXJuIChSVExHKQ0KICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAg TWV0aG9kIChfU1JTLCAxLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgICAgICAgICBDcmVhdGVXb3JkRmllbGQgKEFyZzAsIDB4MDEsIElSUTApDQog ICAgICAgICAgICAgICAgICAgICAgICBGaW5kU2V0UmlnaHRCaXQgKElSUTAsIExvY2FsMCkNCiAg ICAgICAgICAgICAgICAgICAgICAgIERlY3JlbWVudCAoTG9jYWwwKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgU3RvcmUgKExvY2FsMCwgUEdSQykNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQog ICAgICAgICAgICAgICAgICAgIE1ldGhvZCAoX1NUQSwgMCwgU2VyaWFsaXplZCkNCiAgICAgICAg ICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgSWYgKEFuZCAoUEdSQywgMHg4 MCkpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgUmV0dXJuICgweDA5KQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAg ICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFJldHVybiAoMHgwQikNCiAgICAgICAgICAgICAgICAgICAgICAgIH0N CiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAg ICAgIERldmljZSAoTE5LSCkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAg IE5hbWUgKF9ISUQsIEVpc2FJZCAoIlBOUDBDMEYiKSkNCiAgICAgICAgICAgICAgICAgICAgTmFt ZSAoX1VJRCwgMHgwOCkNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChfRElTLCAwLCBTZXJp YWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBT dG9yZSAoMHg4MCwgUEhSQykNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAg ICAgICAgIE5hbWUgKF9QUlMsIFJlc291cmNlVGVtcGxhdGUgKCkNCiAgICAgICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgSVJRIChMZXZlbCwgQWN0aXZlTG93LCBTaGFy ZWQpIHsxMH0NCiAgICAgICAgICAgICAgICAgICAgfSkNCiAgICAgICAgICAgICAgICAgICAgTWV0 aG9kIChfQ1JTLCAwLCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICBOYW1lIChSVExILCBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAg ICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgSVJRIChMZXZl bCwgQWN0aXZlTG93LCBTaGFyZWQpIHt9DQogICAgICAgICAgICAgICAgICAgICAgICB9KQ0KICAg ICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlV29yZEZpZWxkIChSVExILCAweDAxLCBJUlEwKQ0K ICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKFplcm8sIElSUTApDQogICAgICAgICAgICAg ICAgICAgICAgICBTaGlmdExlZnQgKDB4MDEsIEFuZCAoUEhSQywgMHgwRiksIElSUTApDQogICAg ICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKFJUTEgpDQogICAgICAgICAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9TUlMsIDEsIFNlcmlhbGl6ZWQpDQogICAg ICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZVdvcmRGaWVs ZCAoQXJnMCwgMHgwMSwgSVJRMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIEZpbmRTZXRSaWdo dEJpdCAoSVJRMCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgRGVjcmVtZW50IChM b2NhbDApDQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoTG9jYWwwLCBQSFJDKQ0KICAg ICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChfU1RBLCAw LCBTZXJpYWxpemVkKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAg ICAgICBJZiAoQW5kIChQSFJDLCAweDgwKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKDB4MDkpDQogICAgICAgICAgICAgICAg ICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuICgweDBCKQ0KICAg ICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAg ICAgICAgfQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICBEZXZpY2UgKFBBVEEpDQogICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgTmFtZSAoX0FEUiwgMHgwMDFGMDAwMSkNCiAgICAg ICAgICAgICAgICBPcGVyYXRpb25SZWdpb24gKFBBQ1MsIFBDSV9Db25maWcsIDB4NDAsIDB4QzAp DQogICAgICAgICAgICAgICAgRmllbGQgKFBBQ1MsIERXb3JkQWNjLCBOb0xvY2ssIFByZXNlcnZl KQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgUFJJVCwgICAxNiwgDQog ICAgICAgICAgICAgICAgICAgIE9mZnNldCAoMHgwNCksIA0KICAgICAgICAgICAgICAgICAgICBQ U0lULCAgIDQsIA0KICAgICAgICAgICAgICAgICAgICBPZmZzZXQgKDB4MDgpLCANCiAgICAgICAg ICAgICAgICAgICAgU1lOQywgICA0LCANCiAgICAgICAgICAgICAgICAgICAgT2Zmc2V0ICgweDBB KSwgDQogICAgICAgICAgICAgICAgICAgIFNEVDAsICAgMiwgDQogICAgICAgICAgICAgICAgICAg ICAgICAsICAgMiwgDQogICAgICAgICAgICAgICAgICAgIFNEVDEsICAgMiwgDQogICAgICAgICAg ICAgICAgICAgIE9mZnNldCAoMHgxNCksIA0KICAgICAgICAgICAgICAgICAgICBJQ1IwLCAgIDQs IA0KICAgICAgICAgICAgICAgICAgICBJQ1IxLCAgIDQsIA0KICAgICAgICAgICAgICAgICAgICBJ Q1IyLCAgIDQsIA0KICAgICAgICAgICAgICAgICAgICBJQ1IzLCAgIDQsIA0KICAgICAgICAgICAg ICAgICAgICBJQ1I0LCAgIDQsIA0KICAgICAgICAgICAgICAgICAgICBJQ1I1LCAgIDQNCiAgICAg ICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBEZXZpY2UgKFBSSUQpDQogICAgICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgICAgICBOYW1lIChfQURSLCAweDAwKQ0KICAgICAgICAg ICAgICAgICAgICBOYW1lIChOQ00wLCAweDAzKQ0KICAgICAgICAgICAgICAgICAgICBOYW1lIChO Q00xLCAweDAzKQ0KICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9HVE0sIDAsIE5vdFNlcmlh bGl6ZWQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIE5h bWUgKFBCVUYsIEJ1ZmZlciAoMHgxNCkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAw LCAweDAwLCAweDAwLCANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwLCAweDAwLCAw eDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCANCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwDQogICAgICAgICAgICAgICAgICAgICAgICB9 KQ0KICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoUEJVRiwgMHgwMCwg UElPMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZURXb3JkRmllbGQgKFBCVUYsIDB4 MDQsIERNQTApDQogICAgICAgICAgICAgICAgICAgICAgICBDcmVhdGVEV29yZEZpZWxkIChQQlVG LCAweDA4LCBQSU8xKQ0KICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAo UEJVRiwgMHgwQywgRE1BMSkNCiAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZURXb3JkRmll bGQgKFBCVUYsIDB4MTAsIEZMQUcpDQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoR0VU UCAoUFJJVCksIFBJTzApDQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoR0RNQSAoQW5k IChTWU5DLCAweDAxKSwgQW5kIChJQ1IzLCAweDAxKSwgQW5kIChJQ1IwLCAweDAxKSwgU0RUMCwg QW5kIChJQ1IxLCAweDAxKSksIERNQTApDQogICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVx dWFsIChETUEwLCAweEZGRkZGRkZGKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoUElPMCwgRE1BMCkNCiAgICAgICAgICAgICAg ICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgSWYgKEFuZCAoUFJJVCwgMHg0 MDAwKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICBJZiAoTEVxdWFsIChBbmQgKFBSSVQsIDB4OTApLCAweDgwKSkNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgw eDAzODQsIFBJTzEpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChHRVRUIChQU0lUKSwgUElPMSkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICB9DQog ICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAgICAgICAgICAgICAgICB7DQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4RkZGRkZGRkYsIFBJTzEpDQogICAg ICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChH RE1BIChBbmQgKFNZTkMsIDB4MDIpLCBBbmQgKElDUjMsIDB4MDIpLCBBbmQgKElDUjAsIDB4MDIp LCBTRFQxLCBBbmQgKElDUjEsIDB4MDIpKSwgRE1BMSkNCiAgICAgICAgICAgICAgICAgICAgICAg IElmIChMRXF1YWwgKERNQTEsIDB4RkZGRkZGRkYpKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChQSU8xLCBETUExKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoR0VU RiAoQW5kIChTWU5DLCAweDAxKSwgQW5kIChTWU5DLCAweDAyKSwgUFJJVCksIEZMQUcpDQogICAg ICAgICAgICAgICAgICAgICAgICBJZiAoQW5kIChMRXF1YWwgKFBJTzAsIDB4RkZGRkZGRkYpLCBM RXF1YWwgKERNQTAsIDB4RkZGRkZGRkYpKSkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHg3OCwgUElPMCkNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICBTdG9yZSAoMHgxNCwgRE1BMCkNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICBTdG9yZSAoMHgwMywgRkxBRykNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0K ICAgICAgICAgICAgICAgICAgICAgICAgUmV0dXJuIChQQlVGKQ0KICAgICAgICAgICAgICAgICAg ICB9DQoNCiAgICAgICAgICAgICAgICAgICAgTWV0aG9kIChfU1RNLCAzLCBOb3RTZXJpYWxpemVk KQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBDcmVhdGVE V29yZEZpZWxkIChBcmcwLCAweDAwLCBQSU8wKQ0KICAgICAgICAgICAgICAgICAgICAgICAgQ3Jl YXRlRFdvcmRGaWVsZCAoQXJnMCwgMHgwNCwgRE1BMCkNCiAgICAgICAgICAgICAgICAgICAgICAg IENyZWF0ZURXb3JkRmllbGQgKEFyZzAsIDB4MDgsIFBJTzEpDQogICAgICAgICAgICAgICAgICAg ICAgICBDcmVhdGVEV29yZEZpZWxkIChBcmcwLCAweDBDLCBETUExKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQXJnMCwgMHgxMCwgRkxBRykNCiAgICAgICAgICAg ICAgICAgICAgICAgIElmIChMRXF1YWwgKFNpemVPZiAoQXJnMSksIDB4MDIwMCkpDQogICAgICAg ICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgQW5kIChQUklU LCAweDQwRjAsIFBSSVQpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgQW5kIChTWU5DLCAw eDAyLCBTWU5DKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweDAwLCBTRFQw KQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFuZCAoSUNSMCwgMHgwMiwgSUNSMCkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICBBbmQgKElDUjEsIDB4MDIsIElDUjEpDQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgQW5kIChJQ1IzLCAweDAyLCBJQ1IzKQ0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIEFuZCAoSUNSNSwgMHgwMiwgSUNSNSkNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICBDcmVhdGVXb3JkRmllbGQgKEFyZzEsIDB4NjIsIFc0OTApDQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgQ3JlYXRlV29yZEZpZWxkIChBcmcxLCAweDZBLCBXNTMwKQ0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZVdvcmRGaWVsZCAoQXJnMSwgMHg3RSwgVzYz MCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDcmVhdGVXb3JkRmllbGQgKEFyZzEsIDB4 ODAsIFc2NDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlV29yZEZpZWxkIChB cmcxLCAweEIwLCBXODgwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZVdvcmRG aWVsZCAoQXJnMSwgMHhCQSwgVzkzMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDcmVh dGVXb3JkRmllbGQgKEFyZzEsIDB4QUMsIFc4NjApDQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgT3IgKFBSSVQsIDB4ODAwNCwgUFJJVCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJ ZiAoTEFuZCAoQW5kIChGTEFHLCAweDAyKSwgQW5kIChXNDkwLCAweDA4MDApKSkNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9y IChQUklULCAweDAyLCBQUklUKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgIE9yIChQUklULCBTRVRQIChQSU8wLCBXNTMwLCBXNjQw KSwgUFJJVCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoQW5kIChGTEFHLCAweDAx KSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIE9yIChTWU5DLCAweDAxLCBTWU5DKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBTdG9yZSAoU0RNQSAoRE1BMCksIFNEVDApDQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIElmIChMTGVzcyAoRE1BMCwgMHgxRSkpDQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9yIChJQ1Iz LCAweDAxLCBJQ1IzKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExMZXNzIChETUEwLCAweDNDKSkNCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgT3IgKElDUjAsIDB4MDEsIElDUjApDQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoQW5kIChXOTMw LCAweDIwMDApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBPciAoSUNSMSwgMHgwMSwgSUNSMSkNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0N Cg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweDAzLCBOQ00wKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIElmIChMTm90IChMTGVzcyAoU2l6ZU9mIChBcmcxKSwgMHgw MTAyKSkpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBJZiAoQW5kIChEZXJlZk9mIChJbmRleCAoQXJnMSwgMHgwMTAwKSksIE9u ZSkpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIE9yIChOQ00wLCAweDA0LCBOQ00wKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKFxfU0IuUFNSViAoMHg5NywgMHgwMzAwMDAw MCwgMHgwMSwgMHgzMDAwLCAweDAzKSwgTG9jYWwzKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIElmIChMb2NhbDMpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBJZiAoQW5kIChXODYwLCAweDA0MDApKQ0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBcX1NCLlBTUlYgKDB4OTcsIDB4MDMwMDAwMDAsIDB4MDEsIDB4MzEwMCwgMHgwMCkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBFbHNlDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9yIChOQ00wLCAweDA4LCBOQ00wKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAg fQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAgICBJ ZiAoTEVxdWFsIChTaXplT2YgKEFyZzIpLCAweDAyMDApKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFuZCAoUFJJVCwgMHgzRjBGLCBQUklU KQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweDAwLCBQU0lUKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIEFuZCAoU1lOQywgMHgwMSwgU1lOQykNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICBTdG9yZSAoMHgwMCwgU0RUMSkNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICBBbmQgKElDUjAsIDB4MDEsIElDUjApDQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgQW5kIChJQ1IxLCAweDAxLCBJQ1IxKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFu ZCAoSUNSMywgMHgwMSwgSUNSMykNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBBbmQgKElD UjUsIDB4MDEsIElDUjUpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlV29yZEZp ZWxkIChBcmcyLCAweDYyLCBXNDkxKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0 ZVdvcmRGaWVsZCAoQXJnMiwgMHg2QSwgVzUzMSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICBDcmVhdGVXb3JkRmllbGQgKEFyZzIsIDB4N0UsIFc2MzEpDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgQ3JlYXRlV29yZEZpZWxkIChBcmcyLCAweDgwLCBXNjQxKQ0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgIENyZWF0ZVdvcmRGaWVsZCAoQXJnMiwgMHhCMCwgVzg4MSkNCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICBDcmVhdGVXb3JkRmllbGQgKEFyZzIsIDB4QkEsIFc5MzEp DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgT3IgKFBSSVQsIDB4ODA0MCwgUFJJVCkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEFuZCAoQW5kIChGTEFHLCAweDA4KSwgQW5k IChXNDkxLCAweDA4MDApKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIE9yIChQUklULCAweDIwLCBQUklUKQ0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChB bmQgKEZMQUcsIDB4MTApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgT3IgKFBSSVQsIDB4NDAwMCwgUFJJVCkNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgSWYgKExHcmVhdGVyIChQSU8xLCAweEYwKSkNCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgT3IgKFBSSVQsIDB4ODAsIFBSSVQpDQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBPciAoUFJJVCwgMHgxMCwgUFJJVCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFN0b3JlIChTRVRUIChQSU8xLCBXNTMxLCBXNjQxKSwgUFNJVCkNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0K ICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChBbmQgKEZMQUcsIDB4MDQpKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg T3IgKFNZTkMsIDB4MDIsIFNZTkMpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0 b3JlIChTRE1BIChETUExKSwgU0RUMSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg SWYgKExMZXNzIChETUExLCAweDFFKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT3IgKElDUjMsIDB4MDIsIElD UjMpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBJZiAoTExlc3MgKERNQTEsIDB4M0MpKQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBP ciAoSUNSMCwgMHgwMiwgSUNSMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0K DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChBbmQgKFc5MzEsIDB4MjAwMCkp DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIE9yIChJQ1IxLCAweDAyLCBJQ1IxKQ0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4MDMsIE5DTTEpDQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgSWYgKExOb3QgKExMZXNzIChTaXplT2YgKEFyZzIpLCAweDAxMDIpKSkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIElmIChBbmQgKERlcmVmT2YgKEluZGV4IChBcmcyLCAweDAxMDApKSwgT25lKSkNCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgT3IgKE5DTTEsIDB4MDQsIE5DTTEpDQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAg ICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICBE ZXZpY2UgKFBfRDApDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgIE5hbWUgKF9BRFIsIDB4MDApDQogICAgICAgICAgICAgICAgICAgICAgICBNZXRob2QgKF9H VEYsIDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgTmFtZSAoUElCMCwgQnVmZmVyICgweDBFKQ0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgw MywgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHhBMCwgMHhFRiwgMHgwMywgDQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4QTAsIDB4RUYN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIE5hbWUgKEZMSzAsIEJ1ZmZlciAoMHgwNykNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4MDAsIDB4 MDAsIDB4MDAsIDB4QTAsIDB4RjUNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQ0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgIE5hbWUgKFNNWDAsIEJ1ZmZlciAoMHgwRSkNCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4RTAsIDB4RjgsIDB4MDAsIA0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweEUwLCAw eEY5DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICBDcmVhdGVCeXRlRmllbGQgKFBJQjAsIDB4MDEsIFBNRDApDQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgQ3JlYXRlQnl0ZUZpZWxkIChQSUIwLCAweDA4LCBETUQwKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIENyZWF0ZURXb3JkRmllbGQgKFNNWDAsIDB4MDksIE1YQTAp DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKEFuZCAoUFJJVCwgMHgwMikpDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBJZiAoTEVxdWFsIChBbmQgKFBSSVQsIDB4MDkpLCAweDA4KSkNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3Rv cmUgKDB4MDgsIFBNRDApDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHgw QSwgUE1EMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNoaWZ0UmlnaHQg KEFuZCAoUFJJVCwgMHgwMzAwKSwgMHgwOCwgTG9jYWwwKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgU2hpZnRSaWdodCAoQW5kIChQUklULCAweDMwMDApLCAweDBDLCBMb2Nh bDEpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBZGQgKExvY2FsMCwgTG9j YWwxLCBMb2NhbDIpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVx dWFsICgweDAzLCBMb2NhbDIpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlICgweDBCLCBQ TUQwKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoTEVxdWFsICgweDA1LCBMb2NhbDIpKQ0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFN0b3JlICgweDBDLCBQTUQwKQ0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAg IEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFN0b3JlICgweDAxLCBQTUQwKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIH0NCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChBbmQgKFNZTkMsIDB4MDEp KQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgU3RvcmUgKE9yIChTRFQwLCAweDQwKSwgRE1EMCkNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgSWYgKEFuZCAoSUNSMSwgMHgwMSkpDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChB bmQgKElDUjAsIDB4MDEpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgew0K ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFkZCAoRE1EMCwgMHgwMiwg RE1EMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKEFuZCAoSUNSMywgMHgwMSkpDQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgU3RvcmUgKDB4NDUsIERNRDApDQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxz ZQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgT3IgKFN1YnRyYWN0IChBbmQgKFBNRDAsIDB4MDcpLCAweDAyKSwgMHgyMCwgRE1E MCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICBJZiAoQW5kIChOQ00wLCAweDA4KSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChcX1NCLlBTUlYgKDB4 OTcsIDB4MDMwMDAwMDAsIDB4MDEsIDB4MzAwMCwgMHgwMyksIExvY2FsMykNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgSWYgKExvY2FsMykNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT3IgKExvY2Fs MywgMHhFMDAwMDAwMCwgTG9jYWwzKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgU3RvcmUgKExvY2FsMywgTVhBMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIENvbmNhdGVuYXRlIChQSUIwLCBTTVgwLCBMb2NhbDQpDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBTdG9yZSAoUElCMCwgTG9jYWw0KQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFN0b3JlIChQSUIwLCBMb2NhbDQpDQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKEFu ZCAoTkNNMCwgMHgwNCkpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBDb25jYXRlbmF0ZSAoTG9jYWw0LCBGTEswLCBMb2NhbDAp DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIEVsc2UNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFN0b3JlIChMb2NhbDQsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXR1cm4gKExvY2Fs MCkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgfQ0KDQog ICAgICAgICAgICAgICAgICAgIERldmljZSAoUF9EMSkNCiAgICAgICAgICAgICAgICAgICAgew0K ICAgICAgICAgICAgICAgICAgICAgICAgTmFtZSAoX0FEUiwgMHgwMSkNCiAgICAgICAgICAgICAg ICAgICAgICAgIE1ldGhvZCAoX0dURiwgMCwgTm90U2VyaWFsaXplZCkNCiAgICAgICAgICAgICAg ICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBOYW1lIChQSUIxLCBCdWZm ZXIgKDB4MEUpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweEIwLCAweEVG LCAweDAzLCANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMCwgMHgwMCwgMHgw MCwgMHgwMCwgMHhCMCwgMHhFRg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgTmFtZSAoRkxLMSwgQnVmZmVyICgweDA3KQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg MHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHhCMCwgMHhGNQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIH0pDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgQ3JlYXRlQnl0ZUZp ZWxkIChQSUIxLCAweDAxLCBQTUQxKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIENyZWF0 ZUJ5dGVGaWVsZCAoUElCMSwgMHgwOCwgRE1EMSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICBJZiAoQW5kIChQUklULCAweDIwKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKEFuZCAoUFJJVCwgMHg5 MCksIDB4ODApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHgwOCwgUE1EMSkNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBF bHNlDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEFkZCAoQW5kIChQU0lULCAweDAzKSwgU2hpZnRSaWdodCAoQW5k IChQU0lULCAweDBDKSwgMHgwMiksIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIElmIChMRXF1YWwgKDB4MDUsIExvY2FsMCkpDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgU3RvcmUgKDB4MEMsIFBNRDEpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbHNlDQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgSWYgKExFcXVhbCAoMHgwMywgTG9jYWwwKSkNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFN0b3JlICgweDBCLCBQTUQxKQ0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBFbHNlDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHgwQSwgUE1EMSkN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4MDEsIFBNRDEpDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgKEFuZCAoU1lOQywg MHgwMikpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBTdG9yZSAoT3IgKFNEVDEsIDB4NDApLCBETUQxKQ0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBJZiAoQW5kIChJQ1IxLCAweDAyKSkNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg SWYgKEFuZCAoSUNSMCwgMHgwMikpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWRkIChETUQxLCAw eDAyLCBETUQxKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiAoQW5kIChJQ1IzLCAweDAyKSkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBTdG9yZSAoMHg0NSwgRE1EMSkNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0K ICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICBFbHNlDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBPciAoU3VidHJhY3QgKEFuZCAoUE1EMSwgMHgwNyksIDB4MDIpLCAweDIw LCBETUQxKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIElmIChBbmQgKE5DTTEsIDB4MDQpKQ0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29uY2F0ZW5hdGUgKFBJ QjEsIEZMSzEsIExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgRWxzZQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RvcmUgKFBJQjEsIExvY2FsMCkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICBSZXR1cm4gKExvY2FsMCkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAg ICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCg0KICAgICAgICAg ICAgRGV2aWNlIChTQlVTKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIE5hbWUgKF9B RFIsIDB4MDAxRjAwMDMpDQogICAgICAgICAgICB9DQogICAgICAgIH0NCg0KICAgICAgICBNZXRo b2QgKENIR0QsIDAsIE5vdFNlcmlhbGl6ZWQpDQogICAgICAgIHsNCiAgICAgICAgICAgIElmIChc X1NCLlBTUlYgKDB4QjksIDB4MjIsIDB4MDAsIDB4MDAsIDB4MDEpKQ0KICAgICAgICAgICAgew0K ICAgICAgICAgICAgICAgIE5vdGlmeSAoXF9TQi5QQ0kwLCAweDAwKQ0KICAgICAgICAgICAgICAg IFNsZWVwICgweDAzRTgpDQogICAgICAgICAgICAgICAgU3RvcmUgKFxfU0IuUFNSViAoMHhCOSwg MHgwNywgMHgwMCwgMHgwMCwgMHgwMyksIE5TVEUpDQogICAgICAgICAgICAgICAgU3RvcmUgKE5T VEUsIExvY2FsMCkNCiAgICAgICAgICAgICAgICBOb3RpZnkgKFxfU0IuUENJMC5HRlgwLCAweDgw KQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgfQ0KDQogICAgTWV0aG9kIChfUFRTLCAx LCBOb3RTZXJpYWxpemVkKQ0KICAgIHsNCiAgICAgICAgXF9TQi5QU1JWICgweEI4LCAweDAwLCAw eDAwLCAweDAwLCAweDAwKQ0KICAgICAgICBJZiAoTE5vdCAoTEVxdWFsIChBcmcwLCAweDA1KSkp DQogICAgICAgIHsNCiAgICAgICAgICAgIFxfU0IuUFNSViAoMHg5MiwgMHgwMiwgMHgwMCwgMHgw MCwgMHgwMCkNCiAgICAgICAgfQ0KDQogICAgICAgIElmIChMRXF1YWwgKEFyZzAsIDB4MDMpKQ0K ICAgICAgICB7DQogICAgICAgICAgICBcX1NCLlBTUlYgKDB4QzcsIFxfU0IuUENJMC5NT0RNLk1Q U1csIDB4MDAsIDB4MDAsIDB4MDApDQogICAgICAgICAgICBcX1NCLlBTUlYgKDB4OTAsIDB4MDAs IDB4MDEsIDB4MDMsIDB4MDApDQogICAgICAgICAgICBcX1NCLlBTUlYgKDB4OTEsIDB4MTAsIDB4 MDEsIDB4MDEsIDB4MDApDQogICAgICAgICAgICBcX1NCLlBTUlYgKDB4OTEsIDB4NDAsIDB4MDEs IDB4MDEsIDB4MDApDQogICAgICAgIH0NCg0KICAgICAgICBJZiAoTEVxdWFsIChBcmcwLCAweDA0 KSkNCiAgICAgICAgew0KICAgICAgICAgICAgXF9TQi5QU1JWICgweDkwLCAweDAwLCAweDAxLCAw eDA0LCAweDAwKQ0KICAgICAgICB9DQoNCiAgICAgICAgSWYgKExFcXVhbCAoQXJnMCwgMHgwNSkp DQogICAgICAgIHsNCiAgICAgICAgICAgIFxfU0IuUFNSViAoMHg5MCwgMHgwMCwgMHgwMSwgMHgw NSwgMHgwMCkNCiAgICAgICAgfQ0KDQogICAgICAgIElmIChMQW5kIChMTm90IChMTGVzcyAoQXJn MCwgMHgwMykpLCBMTm90IChMR3JlYXRlciAoQXJnMCwgMHgwNSkpKSkNCiAgICAgICAgew0KICAg ICAgICAgICAgXF9TQi5IS0VZLkhTQVYgKCkNCiAgICAgICAgfQ0KDQogICAgICAgIFN0b3JlIChc X1NCLkVDUEYgKDB4MDEwMSwgMHgwMCwgMHgwMCksIFxfU0IuQkFTVCkNCiAgICAgICAgXF9TQi5F Q1BGICgweDAyMDYsIEFyZzAsIDB4MDApDQogICAgfQ0KDQogICAgU2NvcGUgKFxfUFIuQ1BVMCkN CiAgICB7DQogICAgICAgIE1ldGhvZCAoX1BQQywgMCwgTm90U2VyaWFsaXplZCkNCiAgICAgICAg ew0KICAgICAgICAgICAgUmV0dXJuICgweDAwKQ0KICAgICAgICB9DQoNCiAgICAgICAgTWV0aG9k IChfUENULCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICB7DQogICAgICAgICAgICBJZiAoQW5k IChDRkdELCAweDQwMDApKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIFJldHVybiAo UGFja2FnZSAoMHgwMikNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIFJl c291cmNlVGVtcGxhdGUgKCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg ICAgICAgICAgUmVnaXN0ZXIgKFN5c3RlbUlPLCAweDA4LCAweDAwLCAweDAwMDAwMDAwMDAwMDA4 MDApDQogICAgICAgICAgICAgICAgICAgIH0sIA0KDQogICAgICAgICAgICAgICAgICAgIFJlc291 cmNlVGVtcGxhdGUgKCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAg ICAgICAgUmVnaXN0ZXIgKFN5c3RlbUlPLCAweDA4LCAweDAwLCAweDAwMDAwMDAwMDAwMDA4MDIp DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9KQ0KICAgICAgICAgICAg fQ0KDQogICAgICAgICAgICBJZiAoTEFuZCAoQW5kIChDRkdELCAweDAyKSwgQW5kIChQREMwLCAw eDAxKSkpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgUmV0dXJuIChQYWNrYWdlICgw eDAyKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgUmVzb3VyY2VUZW1w bGF0ZSAoKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBS ZWdpc3RlciAoRkZpeGVkSFcsIDB4MDAsIDB4MDAsIDB4MDAwMDAwMDAwMDAwMDAwMCkNCiAgICAg ICAgICAgICAgICAgICAgfSwgDQoNCiAgICAgICAgICAgICAgICAgICAgUmVzb3VyY2VUZW1wbGF0 ZSAoKQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBSZWdp c3RlciAoRkZpeGVkSFcsIDB4MDAsIDB4MDAsIDB4MDAwMDAwMDAwMDAwMDAwMCkNCiAgICAgICAg ICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0pDQogICAgICAgICAgICB9DQoNCiAgICAg ICAgICAgIFJldHVybiAoUGFja2FnZSAoMHgwMikNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICBSZWdpc3RlciAoU3lzdGVtSU8sIDB4MTAsIDB4MDAsIDB4MDAwMDAwMDAwMDAwMDBC MikNCiAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAgICAgIFJlc291cmNlVGVtcGxh dGUgKCkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIFJlZ2lzdGVyIChT eXN0ZW1JTywgMHgwOCwgMHgwMCwgMHgwMDAwMDAwMDAwMDAwMEIzKQ0KICAgICAgICAgICAgICAg IH0NCiAgICAgICAgICAgIH0pDQogICAgICAgIH0NCg0KICAgICAgICBNZXRob2QgKF9QU1MsIDAs IE5vdFNlcmlhbGl6ZWQpDQogICAgICAgIHsNCiAgICAgICAgICAgIElmIChMQW5kIChMTm90IChB bmQgKENGR0QsIDB4NDAwMCkpLCBMQW5kIChBbmQgKENGR0QsIDB4MDIpLCBBbmQgKFBEQzAsIDB4 MDEpKSkpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgUmV0dXJuIChOUFNTKQ0KICAg ICAgICAgICAgfQ0KDQogICAgICAgICAgICBSZXR1cm4gKFNQU1MpDQogICAgICAgIH0NCg0KICAg ICAgICBOYW1lIChTUFNTLCBQYWNrYWdlICgweDA0KQ0KICAgICAgICB7DQogICAgICAgICAgICBQ YWNrYWdlICgweDA2KQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIDB4MDAwMDA0QjAs IA0KICAgICAgICAgICAgICAgIDB4MDAwMDEzODgsIA0KICAgICAgICAgICAgICAgIDB4MDAwMDAw NkUsIA0KICAgICAgICAgICAgICAgIDB4MDAwMDAwMEEsIA0KICAgICAgICAgICAgICAgIDB4MDAw MDAwODMsIA0KICAgICAgICAgICAgICAgIDB4MDAwMDAwMDANCiAgICAgICAgICAgIH0sIA0KDQog ICAgICAgICAgICBQYWNrYWdlICgweDA2KQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAg IDB4MDAwMDAzRTgsIA0KICAgICAgICAgICAgICAgIDB4MDAwMDBGQTAsIA0KICAgICAgICAgICAg ICAgIDB4MDAwMDAwNkUsIA0KICAgICAgICAgICAgICAgIDB4MDAwMDAwMEEsIA0KICAgICAgICAg ICAgICAgIDB4MDAwMDAxODMsIA0KICAgICAgICAgICAgICAgIDB4MDAwMDAwMDENCiAgICAgICAg ICAgIH0sIA0KDQogICAgICAgICAgICBQYWNrYWdlICgweDA2KQ0KICAgICAgICAgICAgew0KICAg ICAgICAgICAgICAgIDB4MDAwMDAzMjAsIA0KICAgICAgICAgICAgICAgIDB4MDAwMDBCQjgsIA0K ICAgICAgICAgICAgICAgIDB4MDAwMDAwNkUsIA0KICAgICAgICAgICAgICAgIDB4MDAwMDAwMEEs IA0KICAgICAgICAgICAgICAgIDB4MDAwMDAyODMsIA0KICAgICAgICAgICAgICAgIDB4MDAwMDAw MDINCiAgICAgICAgICAgIH0sIA0KDQogICAgICAgICAgICBQYWNrYWdlICgweDA2KQ0KICAgICAg ICAgICAgew0KICAgICAgICAgICAgICAgIDB4MDAwMDAyNTgsIA0KICAgICAgICAgICAgICAgIDB4 MDAwMDBCQjgsIA0KICAgICAgICAgICAgICAgIDB4MDAwMDAwNkUsIA0KICAgICAgICAgICAgICAg IDB4MDAwMDAwMEEsIA0KICAgICAgICAgICAgICAgIDB4MDAwMDAzODMsIA0KICAgICAgICAgICAg ICAgIDB4MDAwMDAwMDMNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSkNCiAgICAgICAgTmFtZSAo TlBTUywgUGFja2FnZSAoMHgwNCkNCiAgICAgICAgew0KICAgICAgICAgICAgUGFja2FnZSAoMHgw NikNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAweDAwMDAwNEIwLCANCiAgICAgICAg ICAgICAgICAweDAwMDAxMzg4LCANCiAgICAgICAgICAgICAgICAweDAwMDAwMDBBLCANCiAgICAg ICAgICAgICAgICAweDAwMDAwMDBBLCANCiAgICAgICAgICAgICAgICAweDAwMDAwQzBELCANCiAg ICAgICAgICAgICAgICAweDAwMDAwQzBEDQogICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAg UGFja2FnZSAoMHgwNikNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAweDAwMDAwM0U4 LCANCiAgICAgICAgICAgICAgICAweDAwMDAwRkEwLCANCiAgICAgICAgICAgICAgICAweDAwMDAw MDBBLCANCiAgICAgICAgICAgICAgICAweDAwMDAwMDBBLCANCiAgICAgICAgICAgICAgICAweDAw MDAwQTBCLCANCiAgICAgICAgICAgICAgICAweDAwMDAwQTBCDQogICAgICAgICAgICB9LCANCg0K ICAgICAgICAgICAgUGFja2FnZSAoMHgwNikNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAg ICAweDAwMDAwMzIwLCANCiAgICAgICAgICAgICAgICAweDAwMDAwQkI4LCANCiAgICAgICAgICAg ICAgICAweDAwMDAwMDBBLCANCiAgICAgICAgICAgICAgICAweDAwMDAwMDBBLCANCiAgICAgICAg ICAgICAgICAweDAwMDAwODA5LCANCiAgICAgICAgICAgICAgICAweDAwMDAwODA5DQogICAgICAg ICAgICB9LCANCg0KICAgICAgICAgICAgUGFja2FnZSAoMHgwNikNCiAgICAgICAgICAgIHsNCiAg ICAgICAgICAgICAgICAweDAwMDAwMjU4LCANCiAgICAgICAgICAgICAgICAweDAwMDAwQkI4LCAN CiAgICAgICAgICAgICAgICAweDAwMDAwMDBBLCANCiAgICAgICAgICAgICAgICAweDAwMDAwMDBB LCANCiAgICAgICAgICAgICAgICAweDAwMDAwNjA3LCANCiAgICAgICAgICAgICAgICAweDAwMDAw NjA3DQogICAgICAgICAgICB9DQogICAgICAgIH0pDQogICAgfQ0KDQogICAgU2NvcGUgKFxfUFIu Q1BVMCkNCiAgICB7DQogICAgICAgIE1ldGhvZCAoX0NTVCwgMCwgTm90U2VyaWFsaXplZCkNCiAg ICAgICAgew0KICAgICAgICAgICAgSWYgKEFuZCAoQ0ZHRCwgMHg0MDAwKSkNCiAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICBSZXR1cm4gKFBhY2thZ2UgKDB4MDIpDQogICAgICAgICAgICAg ICAgew0KICAgICAgICAgICAgICAgICAgICAweDAxLCANCiAgICAgICAgICAgICAgICAgICAgUGFj a2FnZSAoMHgwNCkNCiAgICAgICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAg ICAgUmVzb3VyY2VUZW1wbGF0ZSAoKQ0KICAgICAgICAgICAgICAgICAgICAgICAgew0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFJlZ2lzdGVyIChGRml4ZWRIVywgMHgwMSwgMHgwMSwgMHgw MDAwMDAwMDAwMDAwODA5KQ0KICAgICAgICAgICAgICAgICAgICAgICAgfSwgDQoNCiAgICAgICAg ICAgICAgICAgICAgICAgIDB4MDEsIA0KICAgICAgICAgICAgICAgICAgICAgICAgMHgwMSwgDQog ICAgICAgICAgICAgICAgICAgICAgICAweDAzRTgNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAg ICAgICAgICAgICAgIH0pDQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIElmIChMQW5kIChB bmQgKENGR0QsIDB4ODApLCBMTm90IChQV1JTKSkpDQogICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgUmV0dXJuIChQYWNrYWdlICgweDA1KQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAg ICAgICAgICAgICAgMHgwNCwgDQogICAgICAgICAgICAgICAgICAgIFBhY2thZ2UgKDB4MDQpDQog ICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIFJlc291cmNlVGVt cGxhdGUgKCkNCiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICBSZWdpc3RlciAoRkZpeGVkSFcsIDB4MDAsIDB4MDAsIDB4MDAwMDAwMDAwMDAwMDAw MCkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0sIA0KDQogICAgICAgICAgICAgICAgICAgICAg ICAweDAxLCANCiAgICAgICAgICAgICAgICAgICAgICAgIDB4MDEsIA0KICAgICAgICAgICAgICAg ICAgICAgICAgMHgwM0U4DQogICAgICAgICAgICAgICAgICAgIH0sIA0KDQogICAgICAgICAgICAg ICAgICAgIFBhY2thZ2UgKDB4MDQpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAg ICAgICAgICAgICAgIFJlc291cmNlVGVtcGxhdGUgKCkNCiAgICAgICAgICAgICAgICAgICAgICAg IHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWdpc3RlciAoU3lzdGVtSU8sIDB4MDgs IDB4MDAsIDB4MDAwMDAwMDAwMDAwMTAxNCkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0sIA0K DQogICAgICAgICAgICAgICAgICAgICAgICAweDAyLCANCiAgICAgICAgICAgICAgICAgICAgICAg IDB4MDEsIA0KICAgICAgICAgICAgICAgICAgICAgICAgMHgwMUY0DQogICAgICAgICAgICAgICAg ICAgIH0sIA0KDQogICAgICAgICAgICAgICAgICAgIFBhY2thZ2UgKDB4MDQpDQogICAgICAgICAg ICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIFJlc291cmNlVGVtcGxhdGUgKCkN CiAgICAgICAgICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBS ZWdpc3RlciAoU3lzdGVtSU8sIDB4MDgsIDB4MDAsIDB4MDAwMDAwMDAwMDAwMTAxNSkNCiAgICAg ICAgICAgICAgICAgICAgICAgIH0sIA0KDQogICAgICAgICAgICAgICAgICAgICAgICAweDAzLCAN CiAgICAgICAgICAgICAgICAgICAgICAgIDB4NTUsIA0KICAgICAgICAgICAgICAgICAgICAgICAg MHhGQQ0KICAgICAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAgICAgICAgICBQYWNr YWdlICgweDA0KQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAg ICBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgUmVnaXN0ZXIgKFN5c3RlbUlPLCAweDA4LCAweDAwLCAweDAw MDAwMDAwMDAwMDEwMTYpDQogICAgICAgICAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAg ICAgICAgICAgICAgICAgMHgwMywgDQogICAgICAgICAgICAgICAgICAgICAgICAweEI5LCANCiAg ICAgICAgICAgICAgICAgICAgICAgIDB4NjQNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAg ICAgICAgICAgIH0pDQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIElmIChBbmQgKENGR0Qs IDB4NDApKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIFJldHVybiAoUGFja2FnZSAo MHgwNCkNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgIDB4MDMsIA0KICAg ICAgICAgICAgICAgICAgICBQYWNrYWdlICgweDA0KQ0KICAgICAgICAgICAgICAgICAgICB7DQog ICAgICAgICAgICAgICAgICAgICAgICBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAg ICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVnaXN0ZXIgKEZGaXhl ZEhXLCAweDAwLCAweDAwLCAweDAwMDAwMDAwMDAwMDAwMDApDQogICAgICAgICAgICAgICAgICAg ICAgICB9LCANCg0KICAgICAgICAgICAgICAgICAgICAgICAgMHgwMSwgDQogICAgICAgICAgICAg ICAgICAgICAgICAweDAxLCANCiAgICAgICAgICAgICAgICAgICAgICAgIDB4MDNFOA0KICAgICAg ICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAgICAgICAgICBQYWNrYWdlICgweDA0KQ0K ICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBSZXNvdXJjZVRl bXBsYXRlICgpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgUmVnaXN0ZXIgKFN5c3RlbUlPLCAweDA4LCAweDAwLCAweDAwMDAwMDAwMDAwMDEw MTQpDQogICAgICAgICAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAgICAgICAgICAg ICAgMHgwMiwgDQogICAgICAgICAgICAgICAgICAgICAgICAweDAxLCANCiAgICAgICAgICAgICAg ICAgICAgICAgIDB4MDFGNA0KICAgICAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAg ICAgICAgICBQYWNrYWdlICgweDA0KQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAg ICAgICAgICAgICAgICBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAgICAgICAgICAg ICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVnaXN0ZXIgKFN5c3RlbUlPLCAweDA4 LCAweDAwLCAweDAwMDAwMDAwMDAwMDEwMTUpDQogICAgICAgICAgICAgICAgICAgICAgICB9LCAN Cg0KICAgICAgICAgICAgICAgICAgICAgICAgMHgwMywgDQogICAgICAgICAgICAgICAgICAgICAg ICAweDU1LCANCiAgICAgICAgICAgICAgICAgICAgICAgIDB4RkENCiAgICAgICAgICAgICAgICAg ICAgfQ0KICAgICAgICAgICAgICAgIH0pDQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIElm IChBbmQgKENGR0QsIDB4MjApKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIFJldHVy biAoUGFja2FnZSAoMHgwMykNCiAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAg IDB4MDIsIA0KICAgICAgICAgICAgICAgICAgICBQYWNrYWdlICgweDA0KQ0KICAgICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICBSZXNvdXJjZVRlbXBsYXRlICgpDQog ICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVn aXN0ZXIgKEZGaXhlZEhXLCAweDAwLCAweDAwLCAweDAwMDAwMDAwMDAwMDAwMDApDQogICAgICAg ICAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAgICAgICAgICAgICAgMHgwMSwgDQog ICAgICAgICAgICAgICAgICAgICAgICAweDAxLCANCiAgICAgICAgICAgICAgICAgICAgICAgIDB4 MDNFOA0KICAgICAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAgICAgICAgICBQYWNr YWdlICgweDA0KQ0KICAgICAgICAgICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAg ICBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAgICAgICAgICAgICB7DQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgUmVnaXN0ZXIgKFN5c3RlbUlPLCAweDA4LCAweDAwLCAweDAw MDAwMDAwMDAwMDEwMTQpDQogICAgICAgICAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAg ICAgICAgICAgICAgICAgMHgwMiwgDQogICAgICAgICAgICAgICAgICAgICAgICAweDAxLCANCiAg ICAgICAgICAgICAgICAgICAgICAgIDB4MDFGNA0KICAgICAgICAgICAgICAgICAgICB9DQogICAg ICAgICAgICAgICAgfSkNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgUmV0dXJuIChQYWNr YWdlICgweDAyKQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgIDB4MDEsIA0KICAgICAg ICAgICAgICAgIFBhY2thZ2UgKDB4MDQpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAg ICAgICAgICBSZXNvdXJjZVRlbXBsYXRlICgpDQogICAgICAgICAgICAgICAgICAgIHsNCiAgICAg ICAgICAgICAgICAgICAgICAgIFJlZ2lzdGVyIChGRml4ZWRIVywgMHgwMCwgMHgwMCwgMHgwMDAw MDAwMDAwMDAwMDAwKQ0KICAgICAgICAgICAgICAgICAgICB9LCANCg0KICAgICAgICAgICAgICAg ICAgICAweDAxLCANCiAgICAgICAgICAgICAgICAgICAgMHgwMSwgDQogICAgICAgICAgICAgICAg ICAgIDB4MDNFOA0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0pDQogICAgICAgIH0N CiAgICB9DQoNCiAgICBTY29wZSAoXCkNCiAgICB7DQogICAgICAgIE5hbWUgKFNTRFQsIFBhY2th Z2UgKDB4MEMpDQogICAgICAgIHsNCiAgICAgICAgICAgICJDUFUwSVNUICIsIA0KICAgICAgICAg ICAgMHgzRjZFMzRFNywgDQogICAgICAgICAgICAweDAwMDAwMjM1LCANCiAgICAgICAgICAgICJD UFUxSVNUICIsIA0KICAgICAgICAgICAgMHgwMDAwMDAwMCwgDQogICAgICAgICAgICAweEYwMDBG RjUzLCANCiAgICAgICAgICAgICJDUFUwQ1NUICIsIA0KICAgICAgICAgICAgMHgzRjZFMzMwOSwg DQogICAgICAgICAgICAweDAwMDAwMURFLCANCiAgICAgICAgICAgICJDUFUxQ1NUICIsIA0KICAg ICAgICAgICAgMHgwMDAwMDAwMCwgDQogICAgICAgICAgICAweEYwMDBGRjUzDQogICAgICAgIH0p DQogICAgICAgIE5hbWUgKENGR0QsIDB4MDZEODgyRjIpDQogICAgICAgIE5hbWUgKFxQREMwLCAw eDgwMDAwMDAwKQ0KICAgICAgICBOYW1lIChcUERDMSwgMHg4MDAwMDAwMCkNCiAgICB9DQoNCiAg ICBTY29wZSAoXF9QUi5DUFUwKQ0KICAgIHsNCiAgICAgICAgTmFtZSAoSEkwLCAweDAwKQ0KICAg ICAgICBOYW1lIChIQzAsIDB4MDApDQogICAgICAgIE1ldGhvZCAoX1BEQywgMSwgTm90U2VyaWFs aXplZCkNCiAgICAgICAgew0KICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVsZCAoQXJnMCwgMHgw OCwgQ0FQMCkNCiAgICAgICAgICAgIFN0b3JlIChDQVAwLCBQREMwKQ0KICAgICAgICAgICAgSWYg KExBbmQgKEFuZCAoQ0ZHRCwgMHg0MDAwKSwgTEVxdWFsIChBbmQgKFBEQzAsIDB4MEEpLCAweDBB KSkpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgSWYgKEFuZCAoQ0ZHRCwgMHgwMykp DQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBPcGVyYXRpb25SZWdpb24g KElTVDAsIFN5c3RlbU1lbW9yeSwgRGVyZWZPZiAoSW5kZXggKFNTRFQsIDB4MDEpKSwgRGVyZWZP ZiAoSW5kZXggKFNTRFQsIDB4MDIpKSkNCiAgICAgICAgICAgICAgICAgICAgTG9hZCAoSVNUMCwg SEkwKQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIElmIChBbmQgKENGR0Qs IDB4MTApKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgT3BlcmF0aW9u UmVnaW9uIChDU1QwLCBTeXN0ZW1NZW1vcnksIERlcmVmT2YgKEluZGV4IChTU0RULCAweDA3KSks IERlcmVmT2YgKEluZGV4IChTU0RULCAweDA4KSkpDQogICAgICAgICAgICAgICAgICAgIExvYWQg KENTVDAsIEhDMCkNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgIH0N CiAgICB9DQoNCiAgICBTY29wZSAoXF9QUi5DUFUxKQ0KICAgIHsNCiAgICAgICAgTmFtZSAoSEkx LCAweDAwKQ0KICAgICAgICBOYW1lIChIQzEsIDB4MDApDQogICAgICAgIE1ldGhvZCAoX1BEQywg MSwgTm90U2VyaWFsaXplZCkNCiAgICAgICAgew0KICAgICAgICAgICAgQ3JlYXRlRFdvcmRGaWVs ZCAoQXJnMCwgMHgwOCwgQ0FQMSkNCiAgICAgICAgICAgIFN0b3JlIChDQVAxLCBQREMxKQ0KICAg ICAgICAgICAgSWYgKExBbmQgKEFuZCAoQ0ZHRCwgMHg0MDAwKSwgTEVxdWFsIChBbmQgKFBEQzEs IDB4MEEpLCAweDBBKSkpDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgSWYgKEFuZCAo Q0ZHRCwgMHgwMykpDQogICAgICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICBPcGVy YXRpb25SZWdpb24gKElTVDEsIFN5c3RlbU1lbW9yeSwgRGVyZWZPZiAoSW5kZXggKFNTRFQsIDB4 MDQpKSwgRGVyZWZPZiAoSW5kZXggKFNTRFQsIDB4MDUpKSkNCiAgICAgICAgICAgICAgICAgICAg TG9hZCAoSVNUMSwgSEkxKQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIElm IChBbmQgKENGR0QsIDB4MTApKQ0KICAgICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAg ICAgT3BlcmF0aW9uUmVnaW9uIChDU1QxLCBTeXN0ZW1NZW1vcnksIERlcmVmT2YgKEluZGV4IChT U0RULCAweDBBKSksIERlcmVmT2YgKEluZGV4IChTU0RULCAweDBCKSkpDQogICAgICAgICAgICAg ICAgICAgIExvYWQgKENTVDEsIEhDMSkNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9 DQoNCiAgICAgICAgICAgIElmIChMRXF1YWwgKEFuZCAoUERDMSwgMHgwQSksIDB4MEEpKQ0KICAg ICAgICAgICAgew0KICAgICAgICAgICAgICAgIElmIChMRXF1YWwgKFdUSFQsIDB4MDEpKQ0KICAg ICAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgU3RvcmUgKDB4MDAsIFdUSFQpDQog ICAgICAgICAgICAgICAgICAgIFxfU0IuUFNSViAoMHhDOSwgMHgwMiwgMHgwMSwgMHgwMCwgMHgw MCkNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICB9DQp9 DQoNCg== --Multipart=_Wed__20_Jun_2007_02_31_51_+0900_KZTwyrG_5maCpUc3 Content-Type: text/plain; name="kldstat-v.txt" Content-Disposition: attachment; filename="kldstat-v.txt" Content-Transfer-Encoding: 7bit Id Refs Address Size Name 1 74 0xc0400000 32f394 kernel Contains modules: Id Name 152 null 153 pci/fixup_pci 154 pci/ignore_pci 155 pci/isab 156 pcib/pci 157 pci/pcib 158 watchdog 159 devfs 160 g_dev 161 g_disk 162 g_vfs 163 isab/isa 164 eisab/isa 165 isa/isahint 166 isa/orm 167 isa/pnp 168 elf32 169 shell 170 cpu/cpufreq 171 rootbus 172 ksem_init 173 ksem_open 174 ksem_unlink 175 ksem_close 176 ksem_post 177 ksem_wait 178 ksem_timedwait 179 ksem_trywait 180 ksem_getvalue 181 ksem_destroy 182 sem 183 enc 184 ether 185 loop 186 zlib 187 crypto 188 cryptodev 189 ufs 190 g_class 191 atkbdc/atkbd 192 isa/atkbdc 193 acpi/atkbdc 194 atkbdc/psm 195 isa/psmcpnp 196 acpi/psmcpnp 197 scterm-sc 198 scrndr-vga 199 g_bsd 200 g_mbr 201 g_mbrext 202 isa/pnpbios 203 pci/ioapic 204 nexus/legacy 205 legacy/cpu 206 legacy/mptable_pcib 207 pci/mptable_pcib 208 root/nexus 209 isa/sysresource 210 isa/atpic 211 acpi/atpic 212 isa/attimer 213 acpi/attimer 214 legacy/isa 215 isa/atdma 216 acpi/atdma 217 nexus/npx 218 isa/npxisa 219 acpi/npxisa 220 isa/pmtimer 221 legacy/pcib 222 pci/hostb 223 isa/pcibus_pnp 224 pci/pcibios_pcib 225 legacy/pir 226 isa/sc 227 isa/vga 2 2 0xc0730000 1f5b0 linux.ko Contains modules: Id Name 18 linuxelf 19 linuxaout 3 2 0xc0750000 4818 sysvmsg.ko Contains modules: Id Name 1 sysvmsg 2 msgrcv 3 msgsnd 4 msgget 5 msgctl 6 msgsys 4 2 0xc0755000 6360 sysvsem.ko Contains modules: Id Name 7 sysvsem 8 semop 9 semget 10 __semctl 11 semsys 5 2 0xc075c000 4a74 sysvshm.ko Contains modules: Id Name 12 sysvshm 13 shmget 14 shmdt 15 shmctl 16 shmat 17 shmsys 6 1 0xc0761000 5860 if_tap.ko Contains modules: Id Name 20 if_tap 7 1 0xc0767000 f964 if_iwi.ko Contains modules: Id Name 23 pci/iwi 8 3 0xc0777000 222d8 wlan.ko Contains modules: Id Name 21 wlan 9 3 0xc079a000 311c firmware.ko Contains modules: Id Name 22 firmware 10 1 0xc079e000 6758 if_rl.ko Contains modules: Id Name 48 rl/miibus 49 cardbus/rl 50 pci/rl 11 2 0xc07a5000 1edac miibus.ko Contains modules: Id Name 24 miibus/ukphy 25 miibus/e1000phy 26 miibus/xlphy 27 miibus/nsphy 28 miibus/mlphy 29 miibus/tlphy 30 miibus/rlphy 31 miibus/amphy 32 miibus/dcphy 33 miibus/pnphy 34 miibus/inphy 35 miibus/tdkphy 36 miibus/bmtphy 37 miibus/brgphy 38 miibus/xmphy 39 miibus/pnaphy 40 miibus/lxtphy 41 miibus/qsphy 42 miibus/acphy 43 miibus/nsgphy 44 miibus/rgephy 45 miibus/ruephy 46 miibus/gentbi 47 miibus/ip1000phy 12 1 0xc07c4000 7134 snd_ich.ko Contains modules: Id Name 52 pci/snd_ich 13 2 0xc07cc000 26968 sound.ko Contains modules: Id Name 51 sound 14 6 0xc07f3000 23184 usb.ko Contains modules: Id Name 53 uhub/uhub 54 usb/uhub 55 ehci/usb 56 uhci/usb 57 ohci/usb 58 cardbus/uhci 59 pci/uhci 60 cardbus/ohci 61 pci/ohci 62 cardbus/ehci 63 pci/ehci 15 1 0xc0817000 519c ugen.ko Contains modules: Id Name 64 uhub/ugen 16 1 0xc081d000 7c54 umass.ko Contains modules: Id Name 78 uhub/umass 17 2 0xc0825000 40450 cam.ko Contains modules: Id Name 65 cam 66 probe 67 xpt 68 cd 69 ch 70 da 71 pass 72 pt 73 sa 74 ses 75 sg 76 targbh 77 targ 18 1 0xc0866000 3780 umodem.ko Contains modules: Id Name 80 uhub/umodem 19 3 0xc086a000 3694 ucom.ko Contains modules: Id Name 79 ucom 20 2 0xc086e000 17920 agp.ko Contains modules: Id Name 81 pci/agp_i810 82 pci/agp_intel 83 pci/agp_via 84 pci/agp_sis 85 pci/agp_ali 86 pci/agp_amd 87 pci/agp_nvidia 88 pci/agp_ati 89 pci/agp_amd64 21 1 0xc0886000 19ac accf_data.ko Contains modules: Id Name 90 accf_data 22 1 0xc0888000 2484 accf_http.ko Contains modules: Id Name 91 accf_http 23 1 0xc088b000 c31c random.ko Contains modules: Id Name 92 random 24 1 0xc0898000 1cfc io.ko Contains modules: Id Name 93 io 25 1 0xc089a000 8884 aio.ko Contains modules: Id Name 94 aio 95 lio_listio 96 aio_waitcomplete 97 aio_write 98 aio_read 99 aio_error 100 aio_cancel 101 aio_suspend 102 aio_return 26 2 0xc08a3000 4d00 mem.ko Contains modules: Id Name 103 mem 27 1 0xc08a8000 55f0 kbdmux.ko Contains modules: Id Name 104 kbdmux 28 1 0xc08ae000 1d498 kqemu.ko Contains modules: Id Name 105 kqemu 29 5 0xc08cc000 e8c8 ata.ko Contains modules: Id Name 106 ata 30 1 0xc08db000 2166c atapci.ko Contains modules: Id Name 107 atapci/ata 108 pci/atapci 31 1 0xc08fd000 25f0 atacard.ko Contains modules: Id Name 109 pccard/ata 32 1 0xc0900000 3b40 atadisk.ko Contains modules: Id Name 110 ata/ad 33 1 0xc0904000 7100 atapicd.ko Contains modules: Id Name 111 ata/acd 34 1 0xc090c000 2ec8 wlan_wep.ko Contains modules: Id Name 112 wlan_wep 35 1 0xc090f000 300fc iwi_bss.ko Contains modules: Id Name 113 iwi_bss_fw 36 1 0xc0940000 b77c cbb.ko Contains modules: Id Name 115 isa/cbb 116 pci/cbb 37 3 0xc094c000 3514 exca.ko Contains modules: Id Name 114 exca 38 1 0xc0950000 76ec cardbus.ko Contains modules: Id Name 117 cbb/cardbus 39 1 0xc0958000 ef34 pccard.ko Contains modules: Id Name 118 cbb/pccard 119 pcic/pccard 40 1 0xc0967000 4234 uplcom.ko Contains modules: Id Name 120 uhub/uplcom 41 1 0xc096c000 3374 smb.ko Contains modules: Id Name 121 smbus/smb 42 3 0xc0970000 2c1c smbus.ko Contains modules: Id Name 43 1 0xc0973000 2af8 ichwd.ko Contains modules: Id Name 122 isa/ichwd 44 1 0xc0976000 415c ichsmb.ko Contains modules: Id Name 123 ichsmb/smbus 124 pci/ichsmb 45 1 0xc097b000 a4fc cpufreq.ko Contains modules: Id Name 125 pci/ichss_pci 126 cpu/ichss 127 cpu/est 128 cpu/p4tcc 129 cpu/powernow 130 cpu/smist 46 1 0xc0986000 3898 acpi_panasonic.ko Contains modules: Id Name 150 acpi/acpi_panasonic 47 2 0xc098a000 64df0 acpi.ko Contains modules: Id Name 131 nexus/acpi 132 acpi/acpi_button 133 acpi/acpi_isab 134 pcib/acpi_pci 135 acpi/acpi_pcib 136 pci/acpi_pcib 137 acpi/acpi_sysresource 138 acpi/acpi_timer 139 acpi/acpi_pci_link 140 acpi/acpi_tz 141 acpi/acpi_acad 142 acpi/acpi_cmbat 143 acpi/cpu 144 acpi/acpi_ec 145 acpi/acpi_hpet 146 acpi/acpi_lid 147 cpu/acpi_perf 148 acpi/acpi_smbat 149 cpu/acpi_throttle 48 1 0xc09ef000 6e40 i915.ko Contains modules: Id Name 151 agp/i915 49 2 0xc09f6000 10c68 drm.ko Contains modules: Id Name 50 2 0xc4e54000 6000 procfs.ko Contains modules: Id Name 229 procfs 51 2 0xc4e5b000 6000 pseudofs.ko Contains modules: Id Name 228 pseudofs 52 1 0xc4e61000 7000 linprocfs.ko Contains modules: Id Name 230 linprocfs 53 1 0xc4e6a000 2000 ntfs_iconv.ko Contains modules: Id Name 235 ntfs_iconv 54 1 0xc4e6c000 4000 libiconv.ko Contains modules: Id Name 231 iconv 232 iconv_xlat 233 iconv_xlat16 55 1 0xc4e7f000 b000 ntfs.ko Contains modules: Id Name 234 ntfs 56 2 0xc4f74000 e000 ipfw.ko Contains modules: Id Name 236 ipfw 57 1 0xc4f8e000 4000 ipdivert.ko Contains modules: Id Name 237 ipdivert 58 1 0xc50f8000 31000 nfsclient.ko Contains modules: Id Name 238 nfslock 239 nfs 240 nfs4 --Multipart=_Wed__20_Jun_2007_02_31_51_+0900_KZTwyrG_5maCpUc3-- From owner-freebsd-acpi@FreeBSD.ORG Tue Jun 19 18:21:02 2007 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F3DD16A400 for ; Tue, 19 Jun 2007 18:21:02 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 0898113C44C for ; Tue, 19 Jun 2007 18:21:01 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 41525 invoked from network); 19 Jun 2007 15:20:01 -0000 Received: from ppp-71-139-42-13.dsl.snfc21.pacbell.net (HELO ?10.0.0.15?) (nate-mail@71.139.42.13) by root.org with ESMTPA; 19 Jun 2007 15:20:01 -0000 Message-ID: <4677F41A.7040803@root.org> Date: Tue, 19 Jun 2007 08:19:54 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.0 (X11/20070511) MIME-Version: 1.0 To: Olivier Fauchon References: <1182251419.985.22.camel@localhost> In-Reply-To: <1182251419.985.22.camel@localhost> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@freebsd.org Subject: Re: Help required for HP NC6000 Suspend on Ram Troubleshooting X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2007 18:21:02 -0000 Olivier Fauchon wrote: > Hi, > > Suspend on RAM is not working on my HP NC 6000 Laptop. > > When using acpiconf -s3, the LCD goes Black, but the green power LED is > still on. > > At this point, the laptop is stuck, and I have to hold down Power button > 10s+ many times to stop and restart it. > > > > I followed all the indications on various websites to troubleshoot this: > > - Compile kernel as modules, so I can unload most of them before S3. > - Fix DSDT > - Define hw.acpi.osname > - Turn ACPI debug ON on a serial console (As LCD is black at S3) > > > So, you can find here http://www.aixmarseille.com/pub/acpi_nc6000/ > > > - ACPI debug informations during acpiconf -s3 (s3_logs.txt) > - DSDT & ASL > - lspci > - sysctl > > > > My first goal is to find out why my laptop don't go in S3 Mode properly > (with the LED indicating the laptop is sleeping). Set sysctl debug.acpi.suspend_bounce=1 (6-stable and 7-current) and see if all the drivers resume properly. The system won't go to sleep but this helps test your device drivers. -- Nate From owner-freebsd-acpi@FreeBSD.ORG Tue Jun 19 18:33:49 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E89F516A478 for ; Tue, 19 Jun 2007 18:33:49 +0000 (UTC) (envelope-from jlove@pixelfish.com) Received: from mail01.vmatrixmail.com (mail01.vmatrixmail.com [216.219.244.230]) by mx1.freebsd.org (Postfix) with ESMTP id 8F32F13C4BE for ; Tue, 19 Jun 2007 18:33:49 +0000 (UTC) (envelope-from jlove@pixelfish.com) Received: (root@mail01.vmatrixmail.com) by vmatrixmail.com id S6135348AbXFSS3H for ; Tue, 19 Jun 2007 11:29:07 -0700 To: acpi@freebsd.org MIME-Version: 1.0 X-Mailer: Rich Media Mail V4. Vmatrix, (C) 2003 From: "Justin Love" Sender: "Justin Love" Message-Id: Date: Tue, 19 Jun 2007 11:29:07 -0700 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Video Turns Software Leads Into Buyers X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: jlove@pixelfish.com List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2007 18:33:50 -0000 Greetings!

You have a state-of-the-art software application, but do your customers know it?

Bridge the gap between your latest software solutions and the end user with video.

PixelFish is a video production company that excels at producing high-quality videos that sell. Our talented and accomplished crew starts with a focused and innovative script to match your messaging needs. We then hand off the approved script to our team of videographers who coordinate each and every detail to get the best footage. Experienced and savvy editors complete the final stages to produce the marketing or educational video that keeps you at the cutting edge of software development.

I have embedded a few samples of our work to the right. Click on the videos to see what we can do. We digitize our videos for optimal distribution over the web, via e-mail, CD-ROM and other popular media platforms. We also provide the right tools for measuring the positive impact of each video investment instantly and around the clock.

Whether you are looking to train your customers on your latest application, promote your software, or simply create a software demonstration guide, PixelFish is your one-stop-shop for affordable video solutions for all types of purposes. Call us today to begin the planning process of your video or to gather more information. You can reach us at 800.503.3020 or on our website at www.pixelfish.com.

We’d love to work with you to help turn your software leads into sales.

Sincerely,

Justin Love
PixelFish, Inc.
800.503.3020 x7109
jlove@pixelfish.com
http://www.pixelfish.com
Certiport
Quadrant
InvesTools
------------------------------------------------ Unsubscribe to safely remove yourself from this email list, please send email to info@pixelfish.com. Powered by Pixelfish http://www.pixelfish.com From owner-freebsd-acpi@FreeBSD.ORG Wed Jun 20 08:08:18 2007 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8513316A469 for ; Wed, 20 Jun 2007 08:08:18 +0000 (UTC) (envelope-from almarrie@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 453E513C465 for ; Wed, 20 Jun 2007 08:08:18 +0000 (UTC) (envelope-from almarrie@gmail.com) Received: by an-out-0708.google.com with SMTP id c14so21439anc for ; Wed, 20 Jun 2007 01:08:17 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PfV8A07Veyexo35CMSuk8HWQMa4DRCOKdYhjWL9nOKXxd4CDafzjvddge8M7Akk8fmK84M3t0iV8vEHCTtGn9/CcRr1nY9MdVBg3wbEwSVaRrfEJ/WOwYYJ/wCchl4VTC5DkjSHsPynh86rfxEM6TwKNWcgu1lXJggs7m4nYyCQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bmZkVQMPcQPrJEIAdt70WqGXDkx6dTwMYVROWUPb3N/ObtFCL2L/rK5vBV4YGnuxH1WVmGhb9RJgRibNI6VDLQtMuaxDX+1EffSe7HO4nvGG7g4OQHi9tdkq9VVpKY4nhFgmpQpYG/aopj9kBGUdoJu+jMFL3HL2iOafuPDxXec= Received: by 10.100.173.19 with SMTP id v19mr234533ane.1182325377785; Wed, 20 Jun 2007 00:42:57 -0700 (PDT) Received: by 10.100.9.14 with HTTP; Wed, 20 Jun 2007 00:42:57 -0700 (PDT) Message-ID: <499c70c0706200042t2b9621fcmc7ef485d05b81bf9@mail.gmail.com> Date: Wed, 20 Jun 2007 10:42:57 +0300 From: "Abdullah Ibn Hamad Al-Marri" To: "Marinos Ilias" In-Reply-To: <20070619150751.GA8348@ceid.upatras.gr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070619150751.GA8348@ceid.upatras.gr> Cc: freebsd-acpi@freebsd.org, freebsd-current@freebsd.org Subject: Re: Current does not boot - BIOS problem? X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2007 08:08:18 -0000 On 6/19/07, Marinos Ilias wrote: > Hello list, > Yesterday I upgraded to latest -CURRENT.Although the build and installing was successful, the system refuses to boot.It stops at the boot sequence with the following error: > > > Can't work out which disk we are booting from. > Guessed BIOS device 0xffffffff not found by probes, defaulting to disk0: > > panic: free: guard1 fail @0x5195c from /home/ncvs/src/sys/boot/i386/loader/../../common/module.c:957 > --> Press a key on the console to reboot <-- > > > I cannot figure out what kind of problem is it.It's weird that the system cannot find which disk to boot from.I didn't have such problems at past and I run CURRENT at this desktop for over a year.Also I want to add that I cannot either boot the kernel.old , as it hangs when I try : > kernel /boot/kernel.old/kernel > at boot prompt. > > > If you have any ideas, you're welcome! > > Thank you. > > Ilias Marinos Maybe it's related to IBM new acpi changes. -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ From owner-freebsd-acpi@FreeBSD.ORG Wed Jun 20 08:34:39 2007 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9130916A41F for ; Wed, 20 Jun 2007 08:34:39 +0000 (UTC) (envelope-from olivier@aixmarseille.com) Received: from anchor.aixmarseille.com (anchor.aixmarseille.com [81.201.184.34]) by mx1.freebsd.org (Postfix) with ESMTP id 5DA2C13C46A for ; Wed, 20 Jun 2007 08:34:39 +0000 (UTC) (envelope-from olivier@aixmarseille.com) Received: from pleiades4.data-mobiles.com ([194.250.124.77] helo=[10.0.0.219]) by anchor.aixmarseille.com with esmtpsa (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.50) id 1I0ve9-0005T2-5D; Wed, 20 Jun 2007 08:34:37 +0000 From: Olivier Fauchon To: Nate Lawson In-Reply-To: <4677F41A.7040803@root.org> References: <1182251419.985.22.camel@localhost> <4677F41A.7040803@root.org> Content-Type: text/plain Date: Wed, 20 Jun 2007 10:34:33 +0200 Message-Id: <1182328473.1054.14.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@freebsd.org Subject: Re: Help required for HP NC6000 Suspend on Ram Troubleshooting X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2007 08:34:39 -0000 > > Set sysctl debug.acpi.suspend_bounce=1 (6-stable and 7-current) and see > if all the drivers resume properly. The system won't go to sleep but > this helps test your device drivers. > 1/ When using the following commands: sysctl debug.acpi.suspend_bounce=1 acpiconf -s3 - Screen goes black - Screen comes back, X revives, "/etc/rc.d/netif restart" restores - Usb devices (mouse)... works again - The system is fully operationnal I can see in the logs: .... ath0: link state changed to DOWN wakeup from sleeping state (slept 00:00:03) .... So I guess my system pass the test. 2/ Some precisions about my problem When doing a 'regular' acpiconf -s3 , - I can hear 3 'beeps' - Screen goes black - The power led is still green (No suspend on red blinking led indicating S3 mode) I can read in the logs ( http://www.aixmarseille.com/pub/acpi_nc6000/s3_logs.txt ) **** hwsleep-0404 [256] AcpiEnterSleepState : Entering sleep state [S3] My guess is that the system can't call properly S3 ACPI Suspend code??? Any more help required :-) From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 21 08:48:06 2007 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EDA516A468 for ; Thu, 21 Jun 2007 08:48:06 +0000 (UTC) (envelope-from olivier@aixmarseille.com) Received: from anchor.aixmarseille.com (anchor.aixmarseille.com [81.201.184.34]) by mx1.freebsd.org (Postfix) with ESMTP id CD36C13C484 for ; Thu, 21 Jun 2007 08:48:05 +0000 (UTC) (envelope-from olivier@aixmarseille.com) Received: from pleiades4.data-mobiles.com ([194.250.124.77] helo=[10.0.0.219]) by anchor.aixmarseille.com with esmtpsa (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.50) id 1I1IKg-0001PI-N2 for freebsd-acpi@freebsd.org; Thu, 21 Jun 2007 08:48:02 +0000 From: Olivier Fauchon To: freebsd-acpi@freebsd.org In-Reply-To: <1182328473.1054.14.camel@localhost> References: <1182251419.985.22.camel@localhost> <4677F41A.7040803@root.org> <1182328473.1054.14.camel@localhost> Content-Type: text/plain Date: Thu, 21 Jun 2007 10:47:58 +0200 Message-Id: <1182415678.1108.9.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Subject: Re: Help required for HP NC6000 Suspend on Ram Troubleshooting X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 08:48:06 -0000 .... > ath0: link state changed to DOWN > wakeup from sleeping state (slept 00:00:03) > .... > > So I guess my system pass the test. > Yep. > > > 2/ When doing a 'regular' acpiconf -s3 , system goes black, > I can hear 3 'beeps', and then the laptop is stuck (Requires > hard reboot). > > In fact the led should be red blinking in suspend mode, > but it's still permanant green. > > My guess is that the system can't call properly S3 ACPI Suspend code??? > > > Any more help required :-) > Weird.. the key is to figure out what's happening during the final entry to S3. You could try throwing in some printfs and see what was the last to trigger. -- Nate From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 21 16:13:04 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3226216A469; Thu, 21 Jun 2007 16:13:04 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: from mail.0x20.net (mail.0x20.net [217.69.67.217]) by mx1.freebsd.org (Postfix) with ESMTP id 0FCFC13C468; Thu, 21 Jun 2007 16:13:03 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: by mail.0x20.net (Postfix, from userid 1002) id D48F739E28; Thu, 21 Jun 2007 17:50:44 +0200 (CEST) Date: Thu, 21 Jun 2007 17:50:44 +0200 From: Lars Engels To: Nate Lawson Message-ID: <20070621155044.GD17194@e.0x20.net> References: <46756BBE.5030603@root.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IrhDeMKUP4DT/M7F" Content-Disposition: inline In-Reply-To: <46756BBE.5030603@root.org> X-Editor: VIM - Vi IMproved 7.0 X-Operation-System: FreeBSD 5.5-RELEASE User-Agent: mutt-ng/devel-r804 (FreeBSD) Cc: acpi@freebsd.org, arch@freebsd.org, current Subject: Re: patch: acpi usermode suspend API change X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 16:13:04 -0000 --IrhDeMKUP4DT/M7F Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 17, 2007 at 10:13:34AM -0700, Nate Lawson wrote: > This patch updates the user API for acpi suspend in a number of ways. >=20 > * /etc/rc.suspend,rc.resume are always run, no matter the source of the > suspend event > * suspend now requires positive user acknowledgement. If a user program > wants to cancel the suspend, they can. If one of the user programs > hangs or doesn't respond within 10 seconds, the system suspends anyway. > * /dev/apm is clonable, allowing multiple listeners for suspend events. > In the future, xorg-server can use this to be informed about suspend > even if there are other listeners (i.e. apmd). >=20 > The API changes are intended to be MFCd and hence are minimal. >=20 > * Two new ACPI ioctls: REQSLPSTATE and ACKSLPSTATE. Request begins the > process of suspending by notifying all listeners. acpi is monitored by > devd(8) and /dev/apm listener(s) are also counted. Users register their > approval or disapproval via Ack. If anyone disapproves, suspend is vetoe= d. >=20 > * Binary compat is preserved in that old user programs or kernel modules > (yeah, right) that called the API can still do so. A message is printed > once that this interface is deprecated. >=20 > * acpiconf gains the -k flag to ack the suspend request. This flag is > undocumented on purpose since it's only used by /etc/rc.suspend. It is > not intended to be a permanent change and will be removed once a better > power API is implemented. >=20 > These patches have been successfully tested for about a week through > suspend/resumes and various usermode programs, including patches to > xorg-server. >=20 > The eventual goal is to improve subr_power to be a more generic central > power management interface to user and kernel providers. powerd(8) > might start managing profiles similar to apmd(8). I don't know yet and > there isn't time to do that. This patch provides a reasonable interface > for now and eliminates some serious weaknesses, especially in that > pressing a sleep button did not guarantee rc.suspend would run before > sleeping. >=20 > Comments welcome, patches are for 6.x and 7.x. >=20 > --=20 > Nate Nate,=20 thanks for your patch.=20 But after applying it on a recent -Current I get a lot of kernel messages like these: Jun 21 17:48:27 maggie kernel: apm34 opened clone 0xc457fd00 Jun 21 17:48:27 maggie kernel: apm34 closed clone 0xc457fd00 Jun 21 17:48:32 maggie kernel: apm35 opened clone 0xc457ee40 Jun 21 17:48:32 maggie kernel: apm35 closed clone 0xc457ee40 Jun 21 17:48:37 maggie kernel: apm36 opened clone 0xc457ec40 Jun 21 17:48:37 maggie kernel: apm36 closed clone 0xc457ec40 Jun 21 17:48:42 maggie kernel: apm37 opened clone 0xc457fc40 Jun 21 17:48:42 maggie kernel: apm37 closed clone 0xc457fc40 Jun 21 17:48:47 maggie kernel: apm38 opened clone 0xc433b6c0 Jun 21 17:48:47 maggie kernel: apm38 closed clone 0xc433b6c0 Jun 21 17:48:52 maggie kernel: apm39 opened clone 0xc433b240 Additionally, pressing the power button only generates this: Jun 21 17:50:03 maggie kernel: acpi: request to enter state S5 failed I need to run 'shutdown -p ' to power the system down. Lars --IrhDeMKUP4DT/M7F Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGep5UKc512sD3afgRAuIOAKCe7fX+8Rq9yxYfyHEr7zpc8DIgGQCfQx1h IQDhkaFIK/F19KqAjJzz5LA= =KqZc -----END PGP SIGNATURE----- --IrhDeMKUP4DT/M7F-- From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 21 16:13:05 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7EE6B16A46C; Thu, 21 Jun 2007 16:13:05 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: from mail.0x20.net (mail.0x20.net [217.69.67.217]) by mx1.freebsd.org (Postfix) with ESMTP id 408BA13C46E; Thu, 21 Jun 2007 16:13:05 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: by mail.0x20.net (Postfix, from userid 1002) id E425B39E2B; Thu, 21 Jun 2007 17:53:30 +0200 (CEST) Date: Thu, 21 Jun 2007 17:53:30 +0200 From: Lars Engels To: Nate Lawson Message-ID: <20070621155330.GE17194@e.0x20.net> References: <46756BBE.5030603@root.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gr/z0/N6AeWAPJVB" Content-Disposition: inline In-Reply-To: <46756BBE.5030603@root.org> X-Editor: VIM - Vi IMproved 7.0 X-Operation-System: FreeBSD 5.5-RELEASE User-Agent: mutt-ng/devel-r804 (FreeBSD) Cc: acpi@freebsd.org, arch@freebsd.org, current Subject: Re: patch: acpi usermode suspend API change X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 16:13:05 -0000 --gr/z0/N6AeWAPJVB Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable And I just saw that every 5 second a new apm device is created!=20 # ls /dev acd0 apm12 apm3 apm47 apm8 = =20 acpi apm13 apm30 apm48 apm9 = =20 ad0 apm14 apm31 apm49 ata = =20 ad0.journal apm15 apm32 apm5 atkbd0 = =20 ad0.journals1 apm16 apm33 apm50 bpf0 = =20 ad0.journals2 apm17 apm34 apm51 bpf1 = =20 ad0.journals3 apm18 apm35 apm52 bpsm0 = =20 ad0.journals4 apm19 apm36 apm53 cardbus0.cis ad0.journals4a apm2 apm37 apm54 cd0 = =20 ad0.journals4b apm20 apm38 apm55 cdrom@ = =20 ad0.journals4c apm21 apm39 apm56 console = =20 ad0.journals4d apm22 apm4 apm57 consolectl = =20 ad0.journals4e apm23 apm40 apm58 ctty = =20 ad0.journals4f apm24 apm41 apm59 cuad0 = =20 agpgart apm25 apm42 apm6 cuad0.init = =20 apm0 apm26 apm43 apm60 cuad0.lock = =20 apm1 apm27 apm44 apm61 devctl = =20 apm10 apm28 apm45 apm62 devstat = =20 apm11 apm29 apm46 apm7 dri/ = =20 [...] --gr/z0/N6AeWAPJVB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGep76Kc512sD3afgRAmPQAJ0d4hnL6NlemJsT6uXypwilOicqcwCeKF7T 5b53jvz+X/izVPVOtI7endM= =uK7K -----END PGP SIGNATURE----- --gr/z0/N6AeWAPJVB-- From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 21 19:51:48 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A7B5E16A469 for ; Thu, 21 Jun 2007 19:51:48 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 89DF913C4B8 for ; Thu, 21 Jun 2007 19:51:48 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 16654 invoked from network); 21 Jun 2007 16:26:53 -0000 Received: from ppp-71-139-42-13.dsl.snfc21.pacbell.net (HELO ?10.0.0.15?) (nate-mail@71.139.42.13) by root.org with ESMTPA; 21 Jun 2007 16:26:53 -0000 Message-ID: <467AA6C6.8090607@root.org> Date: Thu, 21 Jun 2007 09:26:46 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.0 (X11/20070511) MIME-Version: 1.0 To: Lars Engels References: <46756BBE.5030603@root.org> <20070621155044.GD17194@e.0x20.net> In-Reply-To: <20070621155044.GD17194@e.0x20.net> X-Enigmail-Version: 0.95.0 Content-Type: multipart/mixed; boundary="------------000609030506070203020900" Cc: acpi@freebsd.org, arch@freebsd.org, current Subject: Re: patch: acpi usermode suspend API change X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 19:51:48 -0000 This is a multi-part message in MIME format. --------------000609030506070203020900 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lars Engels wrote: > On Sun, Jun 17, 2007 at 10:13:34AM -0700, Nate Lawson wrote: >> This patch updates the user API for acpi suspend in a number of ways. >> >> * /etc/rc.suspend,rc.resume are always run, no matter the source of the >> suspend event >> * suspend now requires positive user acknowledgement. If a user program >> wants to cancel the suspend, they can. If one of the user programs >> hangs or doesn't respond within 10 seconds, the system suspends anyway. >> * /dev/apm is clonable, allowing multiple listeners for suspend events. >> In the future, xorg-server can use this to be informed about suspend >> even if there are other listeners (i.e. apmd). >> >> The API changes are intended to be MFCd and hence are minimal. >> >> * Two new ACPI ioctls: REQSLPSTATE and ACKSLPSTATE. Request begins the >> process of suspending by notifying all listeners. acpi is monitored by >> devd(8) and /dev/apm listener(s) are also counted. Users register their >> approval or disapproval via Ack. If anyone disapproves, suspend is vetoed. >> >> * Binary compat is preserved in that old user programs or kernel modules >> (yeah, right) that called the API can still do so. A message is printed >> once that this interface is deprecated. >> >> * acpiconf gains the -k flag to ack the suspend request. This flag is >> undocumented on purpose since it's only used by /etc/rc.suspend. It is >> not intended to be a permanent change and will be removed once a better >> power API is implemented. >> >> These patches have been successfully tested for about a week through >> suspend/resumes and various usermode programs, including patches to >> xorg-server. >> >> The eventual goal is to improve subr_power to be a more generic central >> power management interface to user and kernel providers. powerd(8) >> might start managing profiles similar to apmd(8). I don't know yet and >> there isn't time to do that. This patch provides a reasonable interface >> for now and eliminates some serious weaknesses, especially in that >> pressing a sleep button did not guarantee rc.suspend would run before >> sleeping. >> >> Comments welcome, patches are for 6.x and 7.x. >> >> -- >> Nate > > Nate, > > thanks for your patch. > But after applying it on a recent -Current I get a lot of kernel messages > like these: > Jun 21 17:48:27 maggie kernel: apm34 opened clone 0xc457fd00 > Jun 21 17:48:27 maggie kernel: apm34 closed clone 0xc457fd00 > Jun 21 17:48:32 maggie kernel: apm35 opened clone 0xc457ee40 > Jun 21 17:48:32 maggie kernel: apm35 closed clone 0xc457ee40 > Jun 21 17:48:37 maggie kernel: apm36 opened clone 0xc457ec40 > Jun 21 17:48:37 maggie kernel: apm36 closed clone 0xc457ec40 > Jun 21 17:48:42 maggie kernel: apm37 opened clone 0xc457fc40 > Jun 21 17:48:42 maggie kernel: apm37 closed clone 0xc457fc40 > Jun 21 17:48:47 maggie kernel: apm38 opened clone 0xc433b6c0 > Jun 21 17:48:47 maggie kernel: apm38 closed clone 0xc433b6c0 > Jun 21 17:48:52 maggie kernel: apm39 opened clone 0xc433b240 Thanks for testing! Those were there to assist in debugging if people had any problems. > Additionally, pressing the power button only generates this: > Jun 21 17:50:03 maggie kernel: acpi: request to enter state S5 failed > > I need to run 'shutdown -p ' to power the system down. This was already fixed in the updated patch that I plan to commit today. It's attached or you can just wait for the commit to get it. -- Nate --------------000609030506070203020900 Content-Type: text/x-patch; name="acpi7_wakeapi.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="acpi7_wakeapi.diff" Index: etc/devd.conf =================================================================== RCS file: /home/ncvs/src/etc/devd.conf,v retrieving revision 1.37 diff -u -r1.37 devd.conf --- etc/devd.conf 8 Apr 2007 16:05:23 -0000 1.37 +++ etc/devd.conf 17 Jun 2007 16:52:50 -0000 @@ -239,6 +239,19 @@ action "logger -p kern.warn 'ZFS: checksum mismatch, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size'"; }; +# User requested suspend, so perform preparation steps and then execute +# the actual suspend process. +notify 10 { + match "system" "ACPI"; + match "subsystem" "Suspend"; + action "/etc/rc.suspend acpi $notify"; +}; +notify 10 { + match "system" "ACPI"; + match "subsystem" "Resume"; + action "/etc/rc.resume acpi $notify"; +}; + /* EXAMPLES TO END OF FILE # The following might be an example of something that a vendor might @@ -277,6 +290,7 @@ # Button: Button pressed (0 for power, 1 for sleep) # CMBAT: ACPI battery events # Lid: Lid state (0 is closed, 1 is open) +# Suspend, Resume: Suspend and resume notification # Thermal: ACPI thermal zone events # # This example calls a script when the AC state changes, passing the Index: etc/rc.resume =================================================================== RCS file: /home/ncvs/src/etc/rc.resume,v retrieving revision 1.7 diff -u -r1.7 rc.resume --- etc/rc.resume 30 Dec 2003 17:30:39 -0000 1.7 +++ etc/rc.resume 17 Jun 2007 16:52:50 -0000 @@ -30,7 +30,7 @@ # sample run command file for APM Resume Event if [ $# -ne 2 ]; then - echo "Usage: $0 [apm|acpi] [standby,suspend|1-5]" + echo "Usage: $0 [apm|acpi] [standby,suspend|1-4]" exit 1 fi @@ -48,9 +48,13 @@ # pccardq | awk -F '~' '$5 == "inactive" \ # { printf("pccardc power %d 1", $1); }' | sh -# UHCI has trouble resuming so we just load/unload it. You -# should add any other kernel modules you want reloaded here. -# kldload usb +# If a device driver has problems resuming, try unloading it before +# suspend and reloading it on resume. Example: +# kldunload usb + +# wpa_supplicant(8) doesn't seem to reassociate during resume. Uncomment +# the following to signal it to reassociate. +# /usr/sbin/wpa_cli reassociate logger -t $subsystem resumed at `date +'%Y%m%d %H:%M:%S'` sync && sync && sync Index: etc/rc.suspend =================================================================== RCS file: /home/ncvs/src/etc/rc.suspend,v retrieving revision 1.6 diff -u -r1.6 rc.suspend --- etc/rc.suspend 21 Jan 2004 03:03:40 -0000 1.6 +++ etc/rc.suspend 17 Jun 2007 16:54:56 -0000 @@ -30,7 +30,7 @@ # sample run command file for APM Suspend Event if [ $# -ne 2 ]; then - echo "Usage: $0 [apm|acpi] [standby,suspend|1-5]" + echo "Usage: $0 [apm|acpi] [standby,suspend|1-4]" exit 1 fi @@ -48,15 +48,20 @@ # pccardq | awk -F '~' '$5 == "filled" && $4 ~ /sio/ \ # { printf("pccardc power %d 0", $1); }' | sh -# UHCI has trouble resuming so we just load/unload it. You -# should add any other kernel modules you want unloaded here. +# If a device driver has problems suspending, try unloading it before +# suspend and reloading it on resume. Example: # kldunload usb logger -t $subsystem suspend at `date +'%Y%m%d %H:%M:%S'` sync && sync && sync -[ $subsystem = "apm" ] && sleep 3 +sleep 3 rm -f /var/run/rc.suspend.pid -[ $subsystem = "apm" ] && zzz +if [ $subsystem = "apm" ]; then + /usr/sbin/zzz +else + # Notify the kernel to continue the suspend process + /usr/sbin/acpiconf -k 0 +fi exit 0 Index: sys/dev/acpica/acpi.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi.c,v retrieving revision 1.239 diff -u -r1.239 acpi.c --- sys/dev/acpica/acpi.c 15 Jun 2007 18:02:33 -0000 1.239 +++ sys/dev/acpica/acpi.c 19 Jun 2007 21:42:04 -0000 @@ -136,6 +136,7 @@ static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status); static BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid); +static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state); static void acpi_shutdown_final(void *arg, int howto); static void acpi_enable_fixed_events(struct acpi_softc *sc); static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate); @@ -410,6 +411,7 @@ sc = device_get_softc(dev); sc->acpi_dev = dev; + callout_init(&sc->susp_force_to, TRUE); error = ENXIO; @@ -592,7 +594,7 @@ /* Pick the first valid sleep state for the sleep button default. */ sc->acpi_sleep_button_sx = ACPI_S_STATES_MAX + 1; - for (state = ACPI_STATE_S1; state < ACPI_STATE_S5; state++) + for (state = ACPI_STATE_S1; state <= ACPI_STATE_S4; state++) if (ACPI_SUCCESS(AcpiGetSleepTypeData(state, &TypeA, &TypeB))) { sc->acpi_sleep_button_sx = state; break; @@ -2118,6 +2120,150 @@ return (acpi_SetInteger(ACPI_ROOT_OBJECT, "_PIC", model)); } +/* + * DEPRECATED. This interface has serious deficiencies and will be + * removed. + * + * Immediately enter the sleep state. In the old model, acpiconf(8) ran + * rc.suspend and rc.resume so we don't have to notify devd(8) to do this. + */ +ACPI_STATUS +acpi_SetSleepState(struct acpi_softc *sc, int state) +{ + static int once; + + if (!once) { + printf( +"warning: acpi_SetSleepState() deprecated, need to update your software\n"); + once = 1; + } + return (acpi_EnterSleepState(sc, state)); +} + +static void +acpi_sleep_force(void *arg) +{ + struct acpi_softc *sc; + + printf("acpi: suspend request timed out, forcing sleep now\n"); + sc = arg; + if (ACPI_FAILURE(acpi_EnterSleepState(sc, sc->acpi_next_sstate))) + printf("acpi: force sleep state S%d failed\n", sc->acpi_next_sstate); +} + +/* + * Request that the system enter the given suspend state. All /dev/apm + * devices and devd(8) will be notified. Userland then has a chance to + * save state and acknowledge the request. The system sleeps once all + * acks are in. + */ +int +acpi_ReqSleepState(struct acpi_softc *sc, int state) +{ + struct apm_clone_data *clone; + + if (state < ACPI_STATE_S1 || state > ACPI_STATE_S5) + return (EINVAL); + + /* S5 (soft-off) should be entered directly with no waiting. */ + if (state == ACPI_STATE_S5) { + if (ACPI_SUCCESS(acpi_EnterSleepState(sc, state))) + return (0); + else + return (ENXIO); + } + + /* If a suspend request is already in progress, just return. */ + ACPI_LOCK(acpi); + if (sc->acpi_next_sstate != 0) { + ACPI_UNLOCK(acpi); + return (0); + } + + /* Record the pending state and notify all apm devices. */ + sc->acpi_next_sstate = state; + STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { + clone->notify_status = APM_EV_NONE; + if ((clone->flags & ACPI_EVF_DEVD) == 0) { + selwakeuppri(&clone->sel_read, PZERO); + KNOTE_UNLOCKED(&clone->sel_read.si_note, 0); + } + } + + /* Now notify devd(8) also. */ + acpi_UserNotify("Suspend", ACPI_ROOT_OBJECT, state); + + /* + * Set a timeout to fire if userland doesn't ack the suspend request + * in time. This way we still eventually go to sleep if we were + * overheating or running low on battery, even if userland is hung. + * We cancel this timeout once all userland acks are in or the + * suspend request is aborted. + */ + callout_reset(&sc->susp_force_to, 10 * hz, acpi_sleep_force, sc); + ACPI_UNLOCK(acpi); + return (0); +} + +/* + * Acknowledge (or reject) a pending sleep state. The caller has + * prepared for suspend and is now ready for it to proceed. If the + * error argument is non-zero, it indicates suspend should be cancelled + * and gives an errno value describing why. Once all votes are in, + * we suspend the system. + */ +int +acpi_AckSleepState(struct apm_clone_data *clone, int error) +{ + struct acpi_softc *sc; + int ret, sleeping; + + /* If no pending sleep state, return an error. */ + ACPI_LOCK(acpi); + sc = clone->acpi_sc; + if (sc->acpi_next_sstate == 0) { + ACPI_UNLOCK(acpi); + return (ENXIO); + } + + /* Caller wants to abort suspend process. */ + if (error) { + sc->acpi_next_sstate = 0; + callout_stop(&sc->susp_force_to); + printf("acpi: listener on %s cancelled the pending suspend\n", + devtoname(clone->cdev)); + ACPI_UNLOCK(acpi); + return (0); + } + + /* + * Mark this device as acking the suspend request. Then, walk through + * all devices, seeing if they agree yet. We only count devices that + * are writable since read-only devices couldn't ack the request. + */ + clone->notify_status = APM_EV_ACKED; + sleeping = TRUE; + STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { + if ((clone->flags & ACPI_EVF_WRITE) != 0 && + clone->notify_status != APM_EV_ACKED) { + sleeping = FALSE; + break; + } + } + + /* If all devices have voted "yes", we will suspend now. */ + if (sleeping) + callout_stop(&sc->susp_force_to); + ACPI_UNLOCK(acpi); + ret = 0; + if (sleeping) { + if (ACPI_FAILURE(acpi_EnterSleepState(sc, sc->acpi_next_sstate))) + ret = ENODEV; + } + + return (ret); +} + static void acpi_sleep_enable(void *arg) { @@ -2134,12 +2280,12 @@ }; /* - * Set the system sleep state + * Enter the desired system sleep state. * * Currently we support S1-S5 but S4 is only S4BIOS */ -ACPI_STATUS -acpi_SetSleepState(struct acpi_softc *sc, int state) +static ACPI_STATUS +acpi_EnterSleepState(struct acpi_softc *sc, int state) { ACPI_STATUS status; UINT8 TypeA; @@ -2148,14 +2294,13 @@ ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, state); + /* Re-entry once we're suspending is not allowed. */ status = AE_OK; ACPI_LOCK(acpi); if (sc->acpi_sleep_disabled) { - if (sc->acpi_sstate != ACPI_STATE_S0) - status = AE_ERROR; ACPI_UNLOCK(acpi); printf("acpi: suspend request ignored (not ready yet)\n"); - return (status); + return (AE_ERROR); } sc->acpi_sleep_disabled = 1; ACPI_UNLOCK(acpi); @@ -2251,6 +2396,7 @@ * Back out state according to how far along we got in the suspend * process. This handles both the error and success cases. */ + sc->acpi_next_sstate = 0; if (slp_state >= ACPI_SS_GPE_SET) { acpi_wake_prep_walk(state); sc->acpi_sstate = ACPI_STATE_S0; @@ -2264,7 +2410,10 @@ /* Allow another sleep request after a while. */ if (state != ACPI_STATE_S5) - timeout(acpi_sleep_enable, (caddr_t)sc, hz * ACPI_MINIMUM_AWAKETIME); + timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME); + + /* Run /etc/rc.resume after we are back. */ + acpi_UserNotify("Resume", ACPI_ROOT_OBJECT, state); mtx_unlock(&Giant); return_ACPI_STATUS (status); @@ -2574,11 +2723,15 @@ static void acpi_system_eventhandler_sleep(void *arg, int state) { + int ret; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, state); - if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX) - acpi_SetSleepState((struct acpi_softc *)arg, state); + /* Request that the system prepare to enter the given suspend state. */ + ret = acpi_ReqSleepState((struct acpi_softc *)arg, state); + if (ret != 0) + printf("acpi: request to enter state S%d failed (err %d)\n", + state, ret); return_VOID; } @@ -2840,7 +2993,20 @@ /* Core system ioctls. */ switch (cmd) { - case ACPIIO_SETSLPSTATE: + case ACPIIO_REQSLPSTATE: + state = *(int *)addr; + if (state != ACPI_STATE_S5) + error = acpi_ReqSleepState(sc, state); + else { + printf("power off via acpi ioctl not supported\n"); + error = ENXIO; + } + break; + case ACPIIO_ACKSLPSTATE: + error = *(int *)addr; + error = acpi_AckSleepState(sc->acpi_clone, error); + break; + case ACPIIO_SETSLPSTATE: /* DEPRECATED */ error = EINVAL; state = *(int *)addr; if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX) @@ -3171,7 +3337,8 @@ goto out; } - acpi_SetSleepState(sc, acpi_state); + if (ACPI_FAILURE(acpi_EnterSleepState(sc, acpi_state))) + error = ENXIO; break; default: error = EINVAL; Index: sys/dev/acpica/acpiio.h =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpiio.h,v retrieving revision 1.16 diff -u -r1.16 acpiio.h --- sys/dev/acpica/acpiio.h 23 Oct 2005 00:16:41 -0000 1.16 +++ sys/dev/acpica/acpiio.h 17 Jun 2007 16:52:50 -0000 @@ -33,7 +33,13 @@ /* * Core ACPI subsystem ioctls */ -#define ACPIIO_SETSLPSTATE _IOW('P', 3, int) +#define ACPIIO_SETSLPSTATE _IOW('P', 3, int) /* DEPRECATED */ + +/* Request S1-5 sleep state. User is notified and then sleep proceeds. */ +#define ACPIIO_REQSLPSTATE _IOW('P', 4, int) + +/* Allow suspend to continue (0) or abort it (errno). */ +#define ACPIIO_ACKSLPSTATE _IOW('P', 5, int) struct acpi_battinfo { int cap; /* percent */ Index: sys/dev/acpica/acpivar.h =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpivar.h,v retrieving revision 1.106 diff -u -r1.106 acpivar.h --- sys/dev/acpica/acpivar.h 15 Jun 2007 18:02:34 -0000 1.106 +++ sys/dev/acpica/acpivar.h 17 Jun 2007 16:57:25 -0000 @@ -39,12 +39,14 @@ #include #include #include +#include #include #include #include #include +struct apm_clone_data; struct acpi_softc { device_t acpi_dev; struct cdev *acpi_dev_t; @@ -76,6 +78,11 @@ bus_dmamap_t acpi_wakemap; vm_offset_t acpi_wakeaddr; vm_paddr_t acpi_wakephys; + + int acpi_next_sstate; /* Next suspend Sx state. */ + struct apm_clone_data *acpi_clone; /* Pseudo-dev for devd(8). */ + STAILQ_HEAD(,apm_clone_data) apm_cdevs; /* All apm/apmctl/acpi cdevs. */ + struct callout susp_force_to; /* Force suspend if no acks. */ }; struct acpi_device { @@ -89,6 +96,22 @@ struct resource_list ad_rl; }; +/* Track device (/dev/{apm,apmctl} and /dev/acpi) notification status. */ +struct apm_clone_data { + STAILQ_ENTRY(apm_clone_data) entries; + struct cdev *cdev; + int flags; +#define ACPI_EVF_NONE 0 /* /dev/apm semantics */ +#define ACPI_EVF_DEVD 1 /* /dev/acpi is handled via devd(8) */ +#define ACPI_EVF_WRITE 2 /* Device instance is opened writable. */ + int notify_status; +#define APM_EV_NONE 0 /* Device not yet aware of pending sleep. */ +#define APM_EV_NOTIFIED 1 /* Device saw next sleep state. */ +#define APM_EV_ACKED 2 /* Device agreed sleep can occur. */ + struct acpi_softc *acpi_sc; + struct selinfo sel_read; +}; + #define ACPI_PRW_MAX_POWERRES 8 struct acpi_prw_data { @@ -304,6 +327,8 @@ ACPI_RESOURCE *res); ACPI_STATUS acpi_OverrideInterruptLevel(UINT32 InterruptNumber); ACPI_STATUS acpi_SetIntrModel(int model); +int acpi_ReqSleepState(struct acpi_softc *sc, int state); +int acpi_AckSleepState(struct apm_clone_data *clone, int error); ACPI_STATUS acpi_SetSleepState(struct acpi_softc *sc, int state); int acpi_wake_init(device_t dev, int type); int acpi_wake_set_enable(device_t dev, int enable); Index: sys/i386/acpica/acpi_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/acpica/acpi_machdep.c,v retrieving revision 1.35 diff -u -r1.35 acpi_machdep.c --- sys/i386/acpica/acpi_machdep.c 31 Mar 2007 23:23:41 -0000 1.35 +++ sys/i386/acpica/acpi_machdep.c 19 Jun 2007 21:42:33 -0000 @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include #include @@ -46,8 +48,6 @@ * APM driver emulation */ -#include - #include #include @@ -64,21 +64,31 @@ static int intr_model = ACPI_INTR_PIC; static int apm_active; +static struct clonedevs *apm_clones; + +MALLOC_DEFINE(M_APMDEV, "apmdev", "APM device emulation"); -static d_open_t apmopen; -static d_close_t apmclose; -static d_write_t apmwrite; -static d_ioctl_t apmioctl; -static d_poll_t apmpoll; +static d_open_t apmopen; +static d_close_t apmclose; +static d_write_t apmwrite; +static d_ioctl_t apmioctl; +static d_poll_t apmpoll; +static d_kqfilter_t apmkqfilter; +static void apmreadfiltdetach(struct knote *kn); +static int apmreadfilt(struct knote *kn, long hint); +static struct filterops apm_readfiltops = + { 1, NULL, apmreadfiltdetach, apmreadfilt }; static struct cdevsw apm_cdevsw = { .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE, .d_open = apmopen, .d_close = apmclose, .d_write = apmwrite, .d_ioctl = apmioctl, .d_poll = apmpoll, .d_name = "apm", + .d_kqfilter = apmkqfilter }; static int @@ -202,44 +212,169 @@ return (0); } +/* Create single-use devices for /dev/apm and /dev/apmctl. */ +static void +apm_clone(void *arg, struct ucred *cred, char *name, int namelen, + struct cdev **dev) +{ + int ctl_dev, unit; + + if (*dev != NULL) + return; + if (strcmp(name, "apmctl") == 0) + ctl_dev = TRUE; + else if (strcmp(name, "apm") == 0) + ctl_dev = FALSE; + else + return; + + /* Always create a new device and unit number. */ + unit = -1; + if (clone_create(&apm_clones, &apm_cdevsw, &unit, dev, 0)) { + if (ctl_dev) { + *dev = make_dev(&apm_cdevsw, unit2minor(unit), + UID_ROOT, GID_OPERATOR, 0660, "apmctl%d", unit); + } else { + *dev = make_dev(&apm_cdevsw, unit2minor(unit), + UID_ROOT, GID_OPERATOR, 0664, "apm%d", unit); + } + if (*dev != NULL) { + dev_ref(*dev); + (*dev)->si_flags |= SI_CHEAPCLONE; + } + } +} + +/* Create a struct for tracking per-device suspend notification. */ +static struct apm_clone_data * +apm_create_clone(struct cdev *dev, struct acpi_softc *acpi_sc) +{ + struct apm_clone_data *clone; + + clone = malloc(sizeof(*clone), M_APMDEV, M_WAITOK); + clone->cdev = dev; + clone->acpi_sc = acpi_sc; + clone->notify_status = APM_EV_NONE; + bzero(&clone->sel_read, sizeof(clone->sel_read)); + knlist_init(&clone->sel_read.si_note, &acpi_mutex, NULL, NULL, NULL); + + /* + * The acpi device is always managed by devd(8) and is considered + * writable (i.e., ack is required to allow suspend to proceed.) + */ + if (strcmp("acpi", devtoname(dev)) == 0) + clone->flags = ACPI_EVF_DEVD | ACPI_EVF_WRITE; + else + clone->flags = ACPI_EVF_NONE; + + ACPI_LOCK(acpi); + STAILQ_INSERT_TAIL(&acpi_sc->apm_cdevs, clone, entries); + ACPI_UNLOCK(acpi); + return (clone); +} + static int apmopen(struct cdev *dev, int flag, int fmt, d_thread_t *td) { + struct acpi_softc *acpi_sc; + struct apm_clone_data *clone; + + acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); + clone = apm_create_clone(dev, acpi_sc); + dev->si_drv1 = clone; + + /* If the device is opened for write, record that. */ + if ((flag & FWRITE) != 0) + clone->flags |= ACPI_EVF_WRITE; + return (0); } static int apmclose(struct cdev *dev, int flag, int fmt, d_thread_t *td) { + struct apm_clone_data *clone; + struct acpi_softc *acpi_sc; + + clone = dev->si_drv1; + acpi_sc = clone->acpi_sc; + + /* We are about to lose a reference so check if suspend should occur */ + if (acpi_sc->acpi_next_sstate != 0 && + clone->notify_status != APM_EV_ACKED) + acpi_AckSleepState(clone, 0); + + /* Remove this clone's data from the list and free it. */ + ACPI_LOCK(acpi); + STAILQ_REMOVE(&acpi_sc->apm_cdevs, clone, apm_clone_data, entries); + knlist_destroy(&clone->sel_read.si_note); + ACPI_UNLOCK(acpi); + free(clone, M_APMDEV); + /* XXX destroy_dev() needed */ return (0); } static int apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td) { - int error = 0; + int error; + struct apm_clone_data *clone; struct acpi_softc *acpi_sc; - struct apm_info info; + struct apm_info info; + struct apm_event_info *ev_info; apm_info_old_t aiop; - acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); + error = 0; + clone = dev->si_drv1; + acpi_sc = clone->acpi_sc; switch (cmd) { case APMIO_SUSPEND: if ((flag & FWRITE) == 0) return (EPERM); - if (apm_active) - acpi_SetSleepState(acpi_sc, acpi_sc->acpi_suspend_sx); - else - error = EINVAL; + if (acpi_sc->acpi_next_sstate == 0) { + if (acpi_sc->acpi_suspend_sx != ACPI_STATE_S5) { + error = acpi_ReqSleepState(acpi_sc, + acpi_sc->acpi_suspend_sx); + } else { + printf( + "power off via apm suspend not supported\n"); + error = ENXIO; + } + } else + error = acpi_AckSleepState(clone, 0); break; case APMIO_STANDBY: if ((flag & FWRITE) == 0) return (EPERM); - if (apm_active) - acpi_SetSleepState(acpi_sc, acpi_sc->acpi_standby_sx); - else - error = EINVAL; + if (acpi_sc->acpi_next_sstate == 0) { + if (acpi_sc->acpi_standby_sx != ACPI_STATE_S5) { + error = acpi_ReqSleepState(acpi_sc, + acpi_sc->acpi_standby_sx); + } else { + printf( + "power off via apm standby not supported\n"); + error = ENXIO; + } + } else + error = acpi_AckSleepState(clone, 0); + break; + case APMIO_NEXTEVENT: + printf("apm nextevent start\n"); + ACPI_LOCK(acpi); + if (acpi_sc->acpi_next_sstate != 0 && clone->notify_status == + APM_EV_NONE) { + ev_info = (struct apm_event_info *)addr; + if (acpi_sc->acpi_next_sstate <= ACPI_STATE_S3) + ev_info->type = PMEV_STANDBYREQ; + else + ev_info->type = PMEV_SUSPENDREQ; + ev_info->index = 0; + clone->notify_status = APM_EV_NOTIFIED; + printf("apm event returning %d\n", ev_info->type); + } else + error = EAGAIN; + ACPI_UNLOCK(acpi); break; case APMIO_GETINFO_OLD: if (acpi_capm_get_info(&info)) @@ -300,24 +435,71 @@ static int apmpoll(struct cdev *dev, int events, d_thread_t *td) { + struct apm_clone_data *clone; + int revents; + + revents = 0; + ACPI_LOCK(acpi); + clone = dev->si_drv1; + if (clone->acpi_sc->acpi_next_sstate) + revents |= events & (POLLIN | POLLRDNORM); + else + selrecord(td, &clone->sel_read); + ACPI_UNLOCK(acpi); + return (revents); +} + +static int +apmkqfilter(struct cdev *dev, struct knote *kn) +{ + struct apm_clone_data *clone; + + ACPI_LOCK(acpi); + clone = dev->si_drv1; + kn->kn_hook = clone; + kn->kn_fop = &apm_readfiltops; + knlist_add(&clone->sel_read.si_note, kn, 0); + ACPI_UNLOCK(acpi); return (0); } static void -acpi_capm_init(struct acpi_softc *sc) +apmreadfiltdetach(struct knote *kn) +{ + struct apm_clone_data *clone; + + ACPI_LOCK(acpi); + clone = kn->kn_hook; + knlist_remove(&clone->sel_read.si_note, kn, 0); + ACPI_UNLOCK(acpi); +} + +static int +apmreadfilt(struct knote *kn, long hint) { - make_dev(&apm_cdevsw, 0, 0, 5, 0664, "apm"); + struct apm_clone_data *clone; + int sleeping; + + ACPI_LOCK(acpi); + clone = kn->kn_hook; + sleeping = clone->acpi_sc->acpi_next_sstate ? 1 : 0; + ACPI_UNLOCK(acpi); + return (sleeping); } int acpi_machdep_init(device_t dev) { - struct acpi_softc *sc; + struct acpi_softc *acpi_sc; - sc = devclass_get_softc(devclass_find("acpi"), 0); - acpi_capm_init(sc); + acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); - acpi_install_wakeup_handler(sc); + /* Create a clone for /dev/acpi also. */ + STAILQ_INIT(&acpi_sc->apm_cdevs); + acpi_sc->acpi_clone = apm_create_clone(acpi_sc->acpi_dev_t, acpi_sc); + clone_setup(&apm_clones); + EVENTHANDLER_REGISTER(dev_clone, apm_clone, 0, 1000); + acpi_install_wakeup_handler(acpi_sc); if (intr_model == ACPI_INTR_PIC) BUS_CONFIG_INTR(dev, AcpiGbl_FADT.SciInterrupt, @@ -325,8 +507,8 @@ else acpi_SetIntrModel(intr_model); - SYSCTL_ADD_UINT(&sc->acpi_sysctl_ctx, - SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, + SYSCTL_ADD_UINT(&acpi_sc->acpi_sysctl_ctx, + SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "reset_video", CTLFLAG_RW, &acpi_reset_video, 0, "Call the VESA reset BIOS vector on the resume path"); Index: usr.sbin/acpi/acpiconf/acpiconf.8 =================================================================== RCS file: /home/ncvs/src/usr.sbin/acpi/acpiconf/acpiconf.8,v retrieving revision 1.15 diff -u -r1.15 acpiconf.8 --- usr.sbin/acpi/acpiconf/acpiconf.8 9 Feb 2005 18:04:39 -0000 1.15 +++ usr.sbin/acpi/acpiconf/acpiconf.8 19 Jun 2007 20:46:44 -0000 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2004 +.Dd June 19, 2007 .Dt ACPICONF 8 .Os .Sh NAME @@ -57,13 +57,21 @@ .Cm 2 (not implemented on most systems but similar to S1), .Cm 3 -(the CPU context is lost and memory context is preserved), -.Cm 4 -(the CPU context is lost and memory context is stored to disk) +(suspend to RAM) and +.Cm 4 +(suspend to disk) +.Nm +does not support .Cm 5 -(soft off). -Sleep states may also be given as S1, S2, etc. +(power off). +Power-off is instead activated with the +.Fl p +flag of +.Xr shutdown 8 +or +.Xr halt 8 . +Sleep states may also be given as strings (i.e., S1, S2, etc.) The supported states depend on BIOS implementation, including ACPI byte code (AML). If the @@ -76,7 +84,9 @@ .Sh SEE ALSO .Xr acpi 4 , .Xr acpidump 8 , -.Xr apm 8 +.Xr apm 8 , +.Xr halt 8 , +.Xr shutdown 8 .Sh HISTORY The .Nm Index: usr.sbin/acpi/acpiconf/acpiconf.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/acpi/acpiconf/acpiconf.c,v retrieving revision 1.25 diff -u -r1.25 acpiconf.c --- usr.sbin/acpi/acpiconf/acpiconf.c 28 Jul 2005 19:41:52 -0000 1.25 +++ usr.sbin/acpi/acpiconf/acpiconf.c 17 Jun 2007 16:52:50 -0000 @@ -40,8 +40,6 @@ #include #define ACPIDEV "/dev/acpi" -#define RC_SUSPEND_PATH "/etc/rc.suspend" -#define RC_RESUME_PATH "/etc/rc.resume" static int acpifd; @@ -55,32 +53,27 @@ err(EX_OSFILE, ACPIDEV); } -static int +/* Prepare to sleep and then wait for the signal that sleeping can occur. */ +static void acpi_sleep(int sleep_type) { - char cmd[64]; int ret; + + /* Notify OS that we want to sleep. devd(8) gets this notify. */ + ret = ioctl(acpifd, ACPIIO_REQSLPSTATE, &sleep_type); + if (ret != 0) + err(EX_IOERR, "request sleep type (%d) failed", sleep_type); +} - /* Run the suspend rc script, if available. */ - if (access(RC_SUSPEND_PATH, X_OK) == 0) { - snprintf(cmd, sizeof(cmd), "%s acpi %d", RC_SUSPEND_PATH, - sleep_type); - system(cmd); - } - - ret = ioctl(acpifd, ACPIIO_SETSLPSTATE, &sleep_type); - - /* Run the resume rc script, if available. */ - if (access(RC_RESUME_PATH, X_OK) == 0) { - snprintf(cmd, sizeof(cmd), "%s acpi %d", RC_RESUME_PATH, - sleep_type); - system(cmd); - } +/* Ack or abort a pending suspend request. */ +static void +acpi_sleep_ack(int err_val) +{ + int ret; + ret = ioctl(acpifd, ACPIIO_ACKSLPSTATE, &err_val); if (ret != 0) - err(EX_IOERR, "sleep type (%d) failed", sleep_type); - - return (0); + err(EX_IOERR, "ack sleep type failed"); } /* should be a acpi define, but doesn't appear to be */ @@ -183,7 +176,7 @@ static void usage(const char* prog) { - printf("usage: %s [-h] [-i batt] [-s 1-5]\n", prog); + printf("usage: %s [-h] [-i batt] [-k ack] [-s 1-4]\n", prog); exit(0); } @@ -200,17 +193,20 @@ sleep_type = -1; acpi_init(); - while ((c = getopt(argc, argv, "hi:s:")) != -1) { + while ((c = getopt(argc, argv, "hi:k:s:")) != -1) { switch (c) { case 'i': acpi_battinfo(atoi(optarg)); break; + case 'k': + acpi_sleep_ack(atoi(optarg)); + break; case 's': if (optarg[0] == 'S') sleep_type = optarg[1] - '0'; else sleep_type = optarg[0] - '0'; - if (sleep_type < 0 || sleep_type > 5) + if (sleep_type < 1 || sleep_type > 4) errx(EX_USAGE, "invalid sleep type (%d)", sleep_type); break; @@ -223,10 +219,8 @@ argc -= optind; argv += optind; - if (sleep_type != -1) { - sleep(1); /* wait 1 sec. for key-release event */ + if (sleep_type != -1) acpi_sleep(sleep_type); - } close(acpifd); exit (0); --------------000609030506070203020900-- From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 21 19:52:51 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 48B3016A421 for ; Thu, 21 Jun 2007 19:52:51 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 2CDB813C44C for ; Thu, 21 Jun 2007 19:52:51 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 17034 invoked from network); 21 Jun 2007 16:29:35 -0000 Received: from ppp-71-139-42-13.dsl.snfc21.pacbell.net (HELO ?10.0.0.15?) (nate-mail@71.139.42.13) by root.org with ESMTPA; 21 Jun 2007 16:29:35 -0000 Message-ID: <467AA768.60306@root.org> Date: Thu, 21 Jun 2007 09:29:28 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.0 (X11/20070511) MIME-Version: 1.0 To: Lars Engels References: <46756BBE.5030603@root.org> <20070621155330.GE17194@e.0x20.net> In-Reply-To: <20070621155330.GE17194@e.0x20.net> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: acpi@freebsd.org, arch@freebsd.org, current Subject: Re: patch: acpi usermode suspend API change X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 19:52:51 -0000 Lars Engels wrote: > And I just saw that every 5 second a new apm device is created! > > # ls /dev > acd0 apm12 apm3 apm47 apm8 > acpi apm13 apm30 apm48 apm9 > ad0 apm14 apm31 apm49 ata > ad0.journal apm15 apm32 apm5 atkbd0 > ad0.journals1 apm16 apm33 apm50 bpf0 > ad0.journals2 apm17 apm34 apm51 bpf1 > ad0.journals3 apm18 apm35 apm52 bpsm0 > ad0.journals4 apm19 apm36 apm53 cardbus0.cis > ad0.journals4a apm2 apm37 apm54 cd0 > ad0.journals4b apm20 apm38 apm55 cdrom@ > ad0.journals4c apm21 apm39 apm56 console > ad0.journals4d apm22 apm4 apm57 consolectl > ad0.journals4e apm23 apm40 apm58 ctty > ad0.journals4f apm24 apm41 apm59 cuad0 > agpgart apm25 apm42 apm6 cuad0.init > apm0 apm26 apm43 apm60 cuad0.lock > apm1 apm27 apm44 apm61 devctl > apm10 apm28 apm45 apm62 devstat > apm11 apm29 apm46 apm7 dri/ > > [...] What are you running that opens /dev/apm? Maybe powerd? I have a patch that handles reaping these devices, unfortunately it is pending completion of another patch that allows devfs_destroy() from a close() routine. That part is a core problem in FreeBSD, and it isn't really something in acpi. -- Nate From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 21 22:26:05 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07BEA16A469; Thu, 21 Jun 2007 22:26:05 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: from mail.0x20.net (mail.0x20.net [217.69.67.217]) by mx1.freebsd.org (Postfix) with ESMTP id BCB0113C480; Thu, 21 Jun 2007 22:26:04 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: by mail.0x20.net (Postfix, from userid 1002) id 992DB39E2B; Fri, 22 Jun 2007 00:26:03 +0200 (CEST) Date: Fri, 22 Jun 2007 00:26:03 +0200 From: Lars Engels To: Nate Lawson Message-ID: <20070621222603.GB16887@e.0x20.net> References: <46756BBE.5030603@root.org> <20070621155330.GE17194@e.0x20.net> <467AA768.60306@root.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s/l3CgOIzMHHjg/5" Content-Disposition: inline In-Reply-To: <467AA768.60306@root.org> X-Editor: VIM - Vi IMproved 7.0 X-Operation-System: FreeBSD 5.5-RELEASE User-Agent: mutt-ng/devel-r804 (FreeBSD) Cc: acpi@freebsd.org, arch@freebsd.org, current Subject: Re: patch: acpi usermode suspend API change X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 22:26:05 -0000 --s/l3CgOIzMHHjg/5 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 21, 2007 at 09:29:28AM -0700, Nate Lawson wrote: > Lars Engels wrote: > > And I just saw that every 5 second a new apm device is created!=20 > >=20 > > # ls /dev > > acd0 apm12 apm3 apm47 apm8 = =20 > > acpi apm13 apm30 apm48 apm9 = =20 > > ad0 apm14 apm31 apm49 ata = =20 > > ad0.journal apm15 apm32 apm5 atkbd0 = =20 > > ad0.journals1 apm16 apm33 apm50 bpf0 = =20 > > ad0.journals2 apm17 apm34 apm51 bpf1 = =20 > > ad0.journals3 apm18 apm35 apm52 bpsm0 = =20 > > ad0.journals4 apm19 apm36 apm53 cardbus= 0.cis > > ad0.journals4a apm2 apm37 apm54 cd0 = =20 > > ad0.journals4b apm20 apm38 apm55 cdrom@ = =20 > > ad0.journals4c apm21 apm39 apm56 console= =20 > > ad0.journals4d apm22 apm4 apm57 console= ctl =20 > > ad0.journals4e apm23 apm40 apm58 ctty = =20 > > ad0.journals4f apm24 apm41 apm59 cuad0 = =20 > > agpgart apm25 apm42 apm6 cuad0.i= nit =20 > > apm0 apm26 apm43 apm60 cuad0.l= ock =20 > > apm1 apm27 apm44 apm61 devctl = =20 > > apm10 apm28 apm45 apm62 devstat= =20 > > apm11 apm29 apm46 apm7 dri/ = =20 > >=20 > > [...] >=20 > What are you running that opens /dev/apm? Maybe powerd? >=20 > I have a patch that handles reaping these devices, unfortunately it is > pending completion of another patch that allows devfs_destroy() from a > close() routine. That part is a core problem in FreeBSD, and it isn't > really something in acpi. Yes, powerd is running. Do you need additional system info? --s/l3CgOIzMHHjg/5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGevr7Kc512sD3afgRAq0vAKCWrXA4rudrFiI02IYWkTX+MBCkSQCeO5tL huV7ActDHmjtQauOH62MfPU= =AKUg -----END PGP SIGNATURE----- --s/l3CgOIzMHHjg/5-- From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 21 22:28:37 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AB1116A46C; Thu, 21 Jun 2007 22:28:37 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: from mail.0x20.net (mail.0x20.net [217.69.67.217]) by mx1.freebsd.org (Postfix) with ESMTP id D0C9F13C4DA; Thu, 21 Jun 2007 22:28:36 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: by mail.0x20.net (Postfix, from userid 1002) id 246EC39E2D; Fri, 22 Jun 2007 00:28:36 +0200 (CEST) Date: Fri, 22 Jun 2007 00:28:36 +0200 From: Lars Engels To: Nate Lawson Message-ID: <20070621222836.GC16887@e.0x20.net> References: <46756BBE.5030603@root.org> <20070621155044.GD17194@e.0x20.net> <467AA6C6.8090607@root.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E/DnYTRukya0zdZ1" Content-Disposition: inline In-Reply-To: <467AA6C6.8090607@root.org> X-Editor: VIM - Vi IMproved 7.0 X-Operation-System: FreeBSD 5.5-RELEASE User-Agent: mutt-ng/devel-r804 (FreeBSD) Cc: acpi@freebsd.org, arch@freebsd.org, current Subject: Re: patch: acpi usermode suspend API change X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 22:28:37 -0000 --E/DnYTRukya0zdZ1 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 21, 2007 at 09:26:46AM -0700, Nate Lawson wrote: > Lars Engels wrote: > >=20 > > Nate,=20 > >=20 > > thanks for your patch.=20 > > But after applying it on a recent -Current I get a lot of kernel messag= es > > like these: > > Jun 21 17:48:27 maggie kernel: apm34 opened clone 0xc457fd00 > > Jun 21 17:48:27 maggie kernel: apm34 closed clone 0xc457fd00 > > Jun 21 17:48:32 maggie kernel: apm35 opened clone 0xc457ee40 > > Jun 21 17:48:32 maggie kernel: apm35 closed clone 0xc457ee40 > > Jun 21 17:48:37 maggie kernel: apm36 opened clone 0xc457ec40 > > Jun 21 17:48:37 maggie kernel: apm36 closed clone 0xc457ec40 > > Jun 21 17:48:42 maggie kernel: apm37 opened clone 0xc457fc40 > > Jun 21 17:48:42 maggie kernel: apm37 closed clone 0xc457fc40 > > Jun 21 17:48:47 maggie kernel: apm38 opened clone 0xc433b6c0 > > Jun 21 17:48:47 maggie kernel: apm38 closed clone 0xc433b6c0 > > Jun 21 17:48:52 maggie kernel: apm39 opened clone 0xc433b240 >=20 > Thanks for testing! Those were there to assist in debugging if people > had any problems. >=20 > > Additionally, pressing the power button only generates this: > > Jun 21 17:50:03 maggie kernel: acpi: request to enter state S5 failed > >=20 > > I need to run 'shutdown -p ' to power the system down. >=20 > This was already fixed in the updated patch that I plan to commit today. > It's attached or you can just wait for the commit to get it. Okay, I cannot test this today, so I will take your committed version tomorrow. Lars --E/DnYTRukya0zdZ1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGevuUKc512sD3afgRAgLCAKDGQl2xjbBWhffsECdV+1+MzxT2DwCff8ml bOMOlF+TCLahlf1o8cbNZ3Q= =/z5M -----END PGP SIGNATURE----- --E/DnYTRukya0zdZ1-- From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 21 23:33:39 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from misaki (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with SMTP id 0F47F16A473; Thu, 21 Jun 2007 23:33:37 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Date: Fri, 22 Jun 2007 07:33:22 +0800 From: Ariff Abdullah To: Nate Lawson Message-Id: <20070622073322.3054360b.ariff@FreeBSD.org> In-Reply-To: <467AA768.60306@root.org> References: <46756BBE.5030603@root.org> <20070621155330.GE17194@e.0x20.net> <467AA768.60306@root.org> Organization: FreeBSD X-Mailer: /usr/local/lib/ruby/1.8/net/smtp.rb Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Fri__22_Jun_2007_07_33_22_+0800_yRoGAbpaDpb4XnBS" Cc: acpi@freebsd.org, arch@freebsd.org, lars.engels@0x20.net, current@freebsd.org Subject: Re: patch: acpi usermode suspend API change X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 23:33:39 -0000 --Signature=_Fri__22_Jun_2007_07_33_22_+0800_yRoGAbpaDpb4XnBS Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 21 Jun 2007 09:29:28 -0700 Nate Lawson wrote: > Lars Engels wrote: > > And I just saw that every 5 second a new apm device is created!=20 [...] > >=20 > > [...] >=20 > What are you running that opens /dev/apm? Maybe powerd? >=20 > I have a patch that handles reaping these devices, unfortunately it > is pending completion of another patch that allows devfs_destroy() > from a close() routine. That part is a core problem in FreeBSD, and > it isn't really something in acpi. >=20 Same issue with sound devices as well, but I've managed to solve it by implementing own clone manager which require tiny hook into open() and close() along with garbage collector and ability to handle various abusive behaviour (while : ; ls /dev/xxx ; done, etc). See sys/dev/sound/clone.* . It should be generic enough. -- Ariff Abdullah FreeBSD ... Recording in stereo is obviously too advanced and confusing for us idiot ***** users :P ........ --Signature=_Fri__22_Jun_2007_07_33_22_+0800_yRoGAbpaDpb4XnBS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGewrClr+deMUwTNoRAglqAJwLOBnXpZpr8C4tGOYXzFfpnt3iQgCggmaI 538OwsFjKgNtm+9WnZb9WgY= =BSeB -----END PGP SIGNATURE----- --Signature=_Fri__22_Jun_2007_07_33_22_+0800_yRoGAbpaDpb4XnBS-- From owner-freebsd-acpi@FreeBSD.ORG Fri Jun 22 01:27:40 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A90B016A421 for ; Fri, 22 Jun 2007 01:27:40 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 8F51713C455 for ; Fri, 22 Jun 2007 01:27:40 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 55368 invoked from network); 21 Jun 2007 22:29:01 -0000 Received: from ppp-71-139-42-13.dsl.snfc21.pacbell.net (HELO ?10.0.0.15?) (nate-mail@71.139.42.13) by root.org with ESMTPA; 21 Jun 2007 22:29:01 -0000 Message-ID: <467AFBA5.6040309@root.org> Date: Thu, 21 Jun 2007 15:28:53 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.0 (X11/20070511) MIME-Version: 1.0 To: Lars Engels References: <46756BBE.5030603@root.org> <20070621155330.GE17194@e.0x20.net> <467AA768.60306@root.org> <20070621222603.GB16887@e.0x20.net> In-Reply-To: <20070621222603.GB16887@e.0x20.net> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: acpi@freebsd.org, arch@freebsd.org, current Subject: Re: patch: acpi usermode suspend API change X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2007 01:27:40 -0000 Lars Engels wrote: > On Thu, Jun 21, 2007 at 09:29:28AM -0700, Nate Lawson wrote: >> Lars Engels wrote: >>> And I just saw that every 5 second a new apm device is created! >>> >>> # ls /dev >>> acd0 apm12 apm3 apm47 apm8 >>> acpi apm13 apm30 apm48 apm9 >>> ad0 apm14 apm31 apm49 ata >>> ad0.journal apm15 apm32 apm5 atkbd0 >>> ad0.journals1 apm16 apm33 apm50 bpf0 >>> ad0.journals2 apm17 apm34 apm51 bpf1 >>> ad0.journals3 apm18 apm35 apm52 bpsm0 >>> ad0.journals4 apm19 apm36 apm53 cardbus0.cis >>> ad0.journals4a apm2 apm37 apm54 cd0 >>> ad0.journals4b apm20 apm38 apm55 cdrom@ >>> ad0.journals4c apm21 apm39 apm56 console >>> ad0.journals4d apm22 apm4 apm57 consolectl >>> ad0.journals4e apm23 apm40 apm58 ctty >>> ad0.journals4f apm24 apm41 apm59 cuad0 >>> agpgart apm25 apm42 apm6 cuad0.init >>> apm0 apm26 apm43 apm60 cuad0.lock >>> apm1 apm27 apm44 apm61 devctl >>> apm10 apm28 apm45 apm62 devstat >>> apm11 apm29 apm46 apm7 dri/ >>> >>> [...] >> What are you running that opens /dev/apm? Maybe powerd? >> >> I have a patch that handles reaping these devices, unfortunately it is >> pending completion of another patch that allows devfs_destroy() from a >> close() routine. That part is a core problem in FreeBSD, and it isn't >> really something in acpi. > > Yes, powerd is running. Do you need additional system info? No, I'm just going to work around this and re-test the patch before committing. -- Nate From owner-freebsd-acpi@FreeBSD.ORG Fri Jun 22 02:14:15 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4484F16A469 for ; Fri, 22 Jun 2007 02:14:15 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6A113C45D for ; Fri, 22 Jun 2007 02:14:15 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 61038 invoked from network); 21 Jun 2007 23:26:31 -0000 Received: from ppp-71-139-42-13.dsl.snfc21.pacbell.net (HELO ?10.0.0.15?) (nate-mail@71.139.42.13) by root.org with ESMTPA; 21 Jun 2007 23:26:31 -0000 Message-ID: <467B091F.6070008@root.org> Date: Thu, 21 Jun 2007 16:26:23 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.0 (X11/20070511) MIME-Version: 1.0 To: Lars Engels References: <46756BBE.5030603@root.org> <20070621155044.GD17194@e.0x20.net> <467AA6C6.8090607@root.org> <20070621222836.GC16887@e.0x20.net> In-Reply-To: <20070621222836.GC16887@e.0x20.net> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: acpi@freebsd.org, arch@freebsd.org, current Subject: Re: patch: acpi usermode suspend API change X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2007 02:14:15 -0000 Lars Engels wrote: > On Thu, Jun 21, 2007 at 09:26:46AM -0700, Nate Lawson wrote: >> Lars Engels wrote: >>> Nate, >>> >>> thanks for your patch. >>> But after applying it on a recent -Current I get a lot of kernel messages >>> like these: >>> Jun 21 17:48:27 maggie kernel: apm34 opened clone 0xc457fd00 >>> Jun 21 17:48:27 maggie kernel: apm34 closed clone 0xc457fd00 >>> Jun 21 17:48:32 maggie kernel: apm35 opened clone 0xc457ee40 >>> Jun 21 17:48:32 maggie kernel: apm35 closed clone 0xc457ee40 >>> Jun 21 17:48:37 maggie kernel: apm36 opened clone 0xc457ec40 >>> Jun 21 17:48:37 maggie kernel: apm36 closed clone 0xc457ec40 >>> Jun 21 17:48:42 maggie kernel: apm37 opened clone 0xc457fc40 >>> Jun 21 17:48:42 maggie kernel: apm37 closed clone 0xc457fc40 >>> Jun 21 17:48:47 maggie kernel: apm38 opened clone 0xc433b6c0 >>> Jun 21 17:48:47 maggie kernel: apm38 closed clone 0xc433b6c0 >>> Jun 21 17:48:52 maggie kernel: apm39 opened clone 0xc433b240 >> Thanks for testing! Those were there to assist in debugging if people >> had any problems. >> >>> Additionally, pressing the power button only generates this: >>> Jun 21 17:50:03 maggie kernel: acpi: request to enter state S5 failed >>> >>> I need to run 'shutdown -p ' to power the system down. >> This was already fixed in the updated patch that I plan to commit today. >> It's attached or you can just wait for the commit to get it. > > Okay, I cannot test this today, so I will take your committed version > tomorrow. Patch has been committed, along with an addition to use a taskq to clean up the extra devices. You should find that all this works fine and /dev/apm is cleaned up. To upgrade, you should install the /etc/ scripts, acpiconf, and the acpi kernel module. Installworld/mergemaster take care of this. Old binaries of acpiconf will continue to work fine with just a message printed once on console that the old API is deprecated. -- Nate From owner-freebsd-acpi@FreeBSD.ORG Fri Jun 22 21:23:44 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA95116A41F; Fri, 22 Jun 2007 21:23:44 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: from mail.0x20.net (mail.0x20.net [217.69.67.217]) by mx1.freebsd.org (Postfix) with ESMTP id ADB3713C447; Fri, 22 Jun 2007 21:23:44 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: by mail.0x20.net (Postfix, from userid 1002) id 1891639E2C; Fri, 22 Jun 2007 23:23:43 +0200 (CEST) Date: Fri, 22 Jun 2007 23:23:43 +0200 From: Lars Engels To: Nate Lawson Message-ID: <20070622212342.GG16887@e.0x20.net> References: <46756BBE.5030603@root.org> <20070621155330.GE17194@e.0x20.net> <467AA768.60306@root.org> <20070621222603.GB16887@e.0x20.net> <467AFBA5.6040309@root.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SNIs70sCzqvszXB4" Content-Disposition: inline In-Reply-To: <467AFBA5.6040309@root.org> X-Editor: VIM - Vi IMproved 7.0 X-Operation-System: FreeBSD 5.5-RELEASE User-Agent: mutt-ng/devel-r804 (FreeBSD) Cc: acpi@freebsd.org, arch@freebsd.org, current Subject: Re: patch: acpi usermode suspend API change X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2007 21:23:45 -0000 --SNIs70sCzqvszXB4 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 21, 2007 at 03:28:53PM -0700, Nate Lawson wrote: > Lars Engels wrote: > > On Thu, Jun 21, 2007 at 09:29:28AM -0700, Nate Lawson wrote: > >> Lars Engels wrote: > >>> And I just saw that every 5 second a new apm device is created!=20 > >>> > >>> # ls /dev > >>> acd0 apm12 apm3 apm47 apm8 = =20 > >>> acpi apm13 apm30 apm48 apm9 = =20 > >>> ad0 apm14 apm31 apm49 ata = =20 > >>> ad0.journal apm15 apm32 apm5 atkbd= 0 =20 > >>> ad0.journals1 apm16 apm33 apm50 bpf0 = =20 > >>> ad0.journals2 apm17 apm34 apm51 bpf1 = =20 > >>> ad0.journals3 apm18 apm35 apm52 bpsm0= =20 > >>> ad0.journals4 apm19 apm36 apm53 cardb= us0.cis > >>> ad0.journals4a apm2 apm37 apm54 cd0 = =20 > >>> ad0.journals4b apm20 apm38 apm55 cdrom= @ =20 > >>> ad0.journals4c apm21 apm39 apm56 conso= le =20 > >>> ad0.journals4d apm22 apm4 apm57 conso= lectl =20 > >>> ad0.journals4e apm23 apm40 apm58 ctty = =20 > >>> ad0.journals4f apm24 apm41 apm59 cuad0= =20 > >>> agpgart apm25 apm42 apm6 cuad0= =2Einit =20 > >>> apm0 apm26 apm43 apm60 cuad0= =2Elock =20 > >>> apm1 apm27 apm44 apm61 devct= l =20 > >>> apm10 apm28 apm45 apm62 devst= at =20 > >>> apm11 apm29 apm46 apm7 dri/ = =20 > >>> > >>> [...] > >> What are you running that opens /dev/apm? Maybe powerd? > >> > >> I have a patch that handles reaping these devices, unfortunately it is > >> pending completion of another patch that allows devfs_destroy() from a > >> close() routine. That part is a core problem in FreeBSD, and it isn't > >> really something in acpi. > >=20 > > Yes, powerd is running. Do you need additional system info? >=20 > No, I'm just going to work around this and re-test the patch before > committing. With your committed code, everything is working fine now. The power button sets the system to S5, no apm[0-9] devices, and no more apm cloning messages on the console. Thanks, Nate!=20 Lars --SNIs70sCzqvszXB4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGfD3eKc512sD3afgRAlRaAJ9a9HFAx1Di5ZEW3abHAJz4w7cbmACgj91P +nkhx/g5uODHG6esuyWGtMk= =OHC2 -----END PGP SIGNATURE----- --SNIs70sCzqvszXB4--