Function:
(defun !ctri-write (ctr-index val x86) (declare (xargs :stobjs (x86))) (declare (xargs :guard (and (natp ctr-index) (n64p val)))) (declare (xargs :guard (< ctr-index 17))) (let ((__function__ '!ctri-write)) (declare (ignorable __function__)) (b* ((val-write (case ctr-index (*cr0* (loghead 32 val)) (*cr4* (logapp 21 val (ctri *cr4* x86))) (otherwise val))) (x86 (!ctri ctr-index val-write x86))) x86)))
Theorem:
(defthm x86p-of-!ctri-write (implies (x86p x86) (b* ((x86 (!ctri-write ctr-index val x86))) (x86p x86))) :rule-classes :rewrite)