Fix unquickening logic for quickened input dexes

In the case where an input dex is already quickened (i.e.
obfuscation), do not attempt to unquicken it. This is done by
switching the quicken info table to the compact offset table (used by
cdex debug infos).

Added test.

Posssible to get a bit of extra savings by deleting the quicken info
num entries field.

Quicken filter size regression average on golem: -0.14%.

Bug: 72608794
Bug: 63756964
Test: test-art-host-gtest-dex2oat_test -j64
Change-Id: I5534a7509b4c718a9b959fa43b82bde857e0b59e
diff --git a/libdexfile/dex/compact_offset_table.cc b/libdexfile/dex/compact_offset_table.cc
index 8cee0e3..60a7b61 100644
--- a/libdexfile/dex/compact_offset_table.cc
+++ b/libdexfile/dex/compact_offset_table.cc
@@ -30,6 +30,11 @@
       minimum_offset_(minimum_offset),
       data_begin_(data_begin) {}
 
+CompactOffsetTable::Accessor::Accessor(const uint8_t* data_begin)
+    : Accessor(data_begin + 2 * sizeof(uint32_t),
+               reinterpret_cast<const uint32_t*>(data_begin)[0],
+               reinterpret_cast<const uint32_t*>(data_begin)[1]) {}
+
 uint32_t CompactOffsetTable::Accessor::GetOffset(uint32_t index) const {
   const uint32_t offset = table_[index / kElementsPerIndex];
   const size_t bit_index = index % kElementsPerIndex;
@@ -56,6 +61,17 @@
 }
 
 void CompactOffsetTable::Build(const std::vector<uint32_t>& offsets,
+                               std::vector<uint8_t>* out_data) {
+  static constexpr size_t kNumOffsets = 2;
+  uint32_t out_offsets[kNumOffsets] = {};
+  CompactOffsetTable::Build(offsets, out_data, &out_offsets[0], &out_offsets[1]);
+  // Write the offsets at the start of the debug info.
+  out_data->insert(out_data->begin(),
+                   reinterpret_cast<const uint8_t*>(&out_offsets[0]),
+                   reinterpret_cast<const uint8_t*>(&out_offsets[kNumOffsets]));
+}
+
+void CompactOffsetTable::Build(const std::vector<uint32_t>& offsets,
                                std::vector<uint8_t>* out_data,
                                uint32_t* out_min_offset,
                                uint32_t* out_table_offset) {