fn decommit_into_memory<M: Memory>(
        &mut self,
        monotonic_cycle_counter: u32,
        mut partial_query: DecommittmentQuery,
        memory: &mut M,
    ) -> Result<
        (
            zk_evm_1_3_3::aux_structures::DecommittmentQuery,
            Option<Vec<U256>>,
        ),
        anyhow::Error,
    > {
        self.decommitment_requests.push((), partial_query.timestamp);
        // First - check if we didn't fetch this bytecode in the past.
        // If we did - we can just return the page that we used before (as the memory is readonly).
        if let Some(memory_page) = self
            .decommitted_code_hashes
            .inner()
            .get(&partial_query.hash)
            .copied()
        {
            partial_query.is_fresh = false;
            partial_query.memory_page = MemoryPage(memory_page);
            partial_query.decommitted_length =
                bytecode_len_in_words(&u256_to_h256(partial_query.hash));

            Ok((partial_query, None))
        } else {
            // We are fetching a fresh bytecode that we didn't read before.
            let values = self.get_bytecode(partial_query.hash, partial_query.timestamp);
            let page_to_use = partial_query.memory_page;
            let timestamp = partial_query.timestamp;
            partial_query.decommitted_length = values.len() as u16;
            partial_query.is_fresh = true;

            // Create a template query, that we'll use for writing into memory.
            // value & index are set to 0 - as they will be updated in the inner loop below.
            let mut tmp_q = MemoryQuery {
                timestamp,
                location: MemoryLocation {
                    memory_type: MemoryType::Code,
                    page: page_to_use,
                    index: MemoryIndex(0),
                },
                value: U256::zero(),
                value_is_pointer: false,
                rw_flag: true,
            };
            self.decommitted_code_hashes
                .insert(partial_query.hash, page_to_use.0, timestamp);

            // Copy the bytecode (that is stored in 'values' Vec) into the memory page.
            if B {
                for (i, value) in values.iter().enumerate() {
                    tmp_q.location.index = MemoryIndex(i as u32);
                    tmp_q.value = *value;
                    memory.specialized_code_query(monotonic_cycle_counter, tmp_q);
                }
                // If we're in the witness mode - we also have to return the values.
                Ok((partial_query, Some(values)))
            } else {
                for (i, value) in values.into_iter().enumerate() {
                    tmp_q.location.index = MemoryIndex(i as u32);
                    tmp_q.value = value;
                    memory.specialized_code_query(monotonic_cycle_counter, tmp_q);
                }

                Ok((partial_query, None))
            }
        }
    }
Loads a given bytecode hash into memory (see trait description for more details).
core/lib/multivm/src/versions/vm_refunds_enhancement/old_vm/oracles/decommitter.rs