+
+ if (version == 1)
+ {
+ /* We only have one SPV file for this version (with many
+ tables). */
+ match_byte(0);
+ if (!match_u32(1))
+ match_u32_assert(2);
+ match_byte(0);
+ match_byte(0);
+ if (!match_u32(0) && !match_u32(1) && !match_u32(2) && !match_u32(3) && !match_u32(4) && !match_u32(5) && !match_u32(6) && !match_u32(7) && !match_u32(8) && !match_u32(9))
+ match_u32_assert(10);
+ match_byte(0);
+ match_byte(0);
+ return;
+ }
+
+ int outer_end = pos + get_u32();
+ int inner_end = pos + get_u32();
+ if (pos != inner_end)
+ {
+ match_u32_assert(0);
+ if (match_byte(0x31))
+ {
+ /* Appears to be a template string, e.g. '^1 cells (^2) expf < 5. Min exp = ^3...'.
+ Probably doesn't actually appear in output because many examples look unpolished,
+ e.g. 'partial list cases value ^1 shown upper...' */
+ get_string();
+ }
+ else
+ match_byte_assert(0x58);
+ if (pos != inner_end)
+ {
+ fprintf(stderr, "inner end discrepancy\n");
+ exit(1);
+ }
+ }
+
+ if (match_byte(0x31))
+ {
+ /* Only one example in the corpus. */
+ match_byte(1);
+ match_byte(0);
+ match_byte(0);
+ match_byte(0);
+ match_byte_assert(1);
+ get_string(); /* foreground */
+ get_string(); /* background */
+ get_string(); /* font */
+ if (!match_byte(14))
+ match_byte_assert(12); /* size? */
+ }
+ else
+ match_byte_assert(0x58);
+ if (match_byte(0x31))
+ {
+ /* Only two SPV files have anything like this, so it's hard to
+ generalize. */
+ match_u32_assert(0);
+ match_u32_assert(0);
+ match_u32_assert(0);
+ match_u32_assert(0);
+ match_byte_assert(1);
+ match_byte_assert(0);
+ if (!match_byte(8) && !match_byte(1))
+ match_byte_assert(2);
+ match_byte_assert(0);
+ match_byte_assert(8);
+ match_byte_assert(0);
+ match_byte_assert(10);
+ match_byte_assert(0);
+ }
+ else
+ match_byte_assert(0x58);
+ if (pos != outer_end)
+ {
+ fprintf(stderr, "outer end discrepancy\n");
+ exit(1);
+ }