(fill-data-data-section-bytes h-size lc-size remaining-file mach-o state) → (mv err new-mach-o new-state)
Function:
(defun fill-data-data-section-bytes (h-size lc-size remaining-file mach-o state) (declare (xargs :stobjs (mach-o state))) (declare (type (unsigned-byte 64) h-size) (type (unsigned-byte 64) lc-size)) (declare (xargs :guard (byte-listp remaining-file))) (let ((__function__ 'fill-data-data-section-bytes)) (declare (ignorable __function__)) (b* ((size (@data-data-section-size mach-o)) (offset (@data-data-section-offset mach-o)) (section (if (equal size 0) nil (if (not (natp (- offset (+ h-size lc-size)))) t (take size (nthcdr (- offset (+ h-size lc-size)) remaining-file))))) ((when (not (byte-listp section))) (cw "EOF encountered unexpectedly. DATA::data section could not be read.~%") (mv t mach-o state)) (mach-o (!data-data-section-bytes section mach-o))) (mv nil mach-o state))))
Theorem:
(defthm good-mach-o-p-of-fill-data-data-section-bytes.new-mach-o (implies (good-mach-o-p mach-o) (b* (((mv ?err ?new-mach-o ?new-state) (fill-data-data-section-bytes h-size lc-size remaining-file mach-o state))) (good-mach-o-p new-mach-o))) :rule-classes :rewrite)
Theorem:
(defthm state-p-of-fill-data-data-section-bytes.new-state (implies (state-p state) (b* (((mv ?err ?new-mach-o ?new-state) (fill-data-data-section-bytes h-size lc-size remaining-file mach-o state))) (state-p new-state))) :rule-classes :rewrite)