<commit_before>extern "C" {
    #[no_mangle]
    fn mmap_read8(addr: u32) -> i32;
    #[no_mangle]
    fn mmap_read16(addr: u32) -> i32;
    #[no_mangle]
    fn mmap_read32(addr: u32) -> i32;

    #[no_mangle]
    pub fn mmap_write8(addr: u32, value: i32);
    #[no_mangle]
    pub fn mmap_write16(addr: u32, value: i32);
    #[no_mangle]
    pub fn mmap_write32(addr: u32, value: i32);
    #[no_mangle]
    pub fn mmap_write64(addr: u32, v0: i32, v1: i32);
    #[no_mangle]
    pub fn mmap_write128(addr: u32, v0: i32, v1: i32, v2: i32, v3: i32);
}

use cpu2::cpu::*;
use cpu2::global_pointers::*;
use page::Page;
use std::ptr;

#[no_mangle]
pub fn in_mapped_range(addr: u32) -> bool {
    return addr >= 0xA0000 && addr < 0xC0000 || addr >= unsafe { *memory_size };
}

#[no_mangle]
pub fn read8(addr: u32) -> i32 {
    if in_mapped_range(addr) {
        return unsafe { mmap_read8(addr) };
    }
    else {
        return read8_no_mmap_check(addr);
    };<commit_msg>Avoid use cpu2::cpu::* in memory<commit_after>extern "C" {
    #[no_mangle]
    fn mmap_read8(addr: u32) -> i32;
    #[no_mangle]
    fn mmap_read16(addr: u32) -> i32;
    #[no_mangle]
    fn mmap_read32(addr: u32) -> i32;

    #[no_mangle]
    pub fn mmap_write8(addr: u32, value: i32);
    #[no_mangle]
    pub fn mmap_write16(addr: u32, value: i32);
    #[no_mangle]
    pub fn mmap_write32(addr: u32, value: i32);
    #[no_mangle]
    pub fn mmap_write64(addr: u32, v0: i32, v1: i32);
    #[no_mangle]
    pub fn mmap_write128(addr: u32, v0: i32, v1: i32, v2: i32, v3: i32);
}

use cpu2::cpu::{mem8, reg128};
use cpu2::global_pointers::memory_size;
use page::Page;
use std::ptr;

#[no_mangle]
pub fn in_mapped_range(addr: u32) -> bool {
    return addr >= 0xA0000 && addr < 0xC0000 || addr >= unsafe { *memory_size };
}

#[no_mangle]
pub fn read8(addr: u32) -> i32 {
    if in_mapped_range(addr) {
        return unsafe { mmap_read8(addr) };
    }
    else {
        return read8_no_mmap_check(addr);
    };
{'fraction_non_alphanumeric': 0.15656565656565657, 'fraction_numerical': 0.08535353535353535, 'mean_word_length': 3.3065217391304347, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1324175', 'n_tokens_mistral': 937, 'n_tokens_neox': 875, 'n_words': 197}