+ /*
+ * Redeclare the input bitstream on the stack. This shouldn't be
+ * needed, but it can improve the main loop's performance significantly
+ * with both gcc and clang, apparently because the compiler otherwise
+ * gets confused and doesn't properly allocate registers for
+ * 'is->bitbuf' et al. and/or thinks 'is->next' may point into 'is'.
+ */
+ struct input_bitstream is_onstack = *_is;
+ struct input_bitstream *is = &is_onstack;