(x86-syscall-open x86) → x86
Function:
(defun x86-syscall-open (x86) (declare (xargs :stobjs (x86))) (declare (xargs :guard t)) (let ((__function__ 'x86-syscall-open)) (declare (ignorable __function__)) (b* ((ctx 'x86-syscall-open) (path-ptr (rgfi *rdi* x86)) (flags (rr64 *rsi* x86)) (mode (rr64 *rdx* x86)) ((when (not (canonical-address-p path-ptr))) (!ms :syscall-open-path-ptr-not-canonical x86)) ((mv flg path x86) (read-string-zero-terminated path-ptr x86)) ((when flg) (!ms (list ctx :path flg) x86)) ((mv ret x86) (syscall-open path flags mode x86)) ((when (or (ms x86) (not (i64p ret)))) (!ms (list ctx :ret-val-or-ms-for-syscall-write ret) x86)) (x86 (!rgfi *rax* ret x86))) x86)))
Theorem:
(defthm x86p-of-x86-syscall-open (implies (and (x86p x86)) (b* ((x86 (x86-syscall-open x86))) (x86p x86))) :rule-classes :rewrite)