It seems like with libunwind's longjmp(), variables in registers would
always be restored to the values they had when longjmp() is called,
because you can never pluck an "old" value off the stack (i.e., the
register values are never stored in more than one place).
It isn't safe to assume anything more than what the standard guarantees,
and the standard says that non-volatile automatics are indeterminate
after a longjmp.
Your reasoning is flawed, because you fail to consider compiler
effects. You are assuming that automatic variables are objects
corresponding to a single storage location that is always updated when
the variable is written to. This is far from true with an optimizing
compiler. The compiler may use multiple locations for a variable, it
may use different locations in different code regions, it may defer
stores, it may optimize away the storage location, etc.