You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pic.rs
    path of file: ./repos/nebulet/src/arch/x64/devices
    
    the code of the file until where you have to start completion: use x86_64::instructions::port::Port;

pub const MASTER_OFFSET: u8 = 0x20;
pub const SLAVE_OFFSET: u8 = 0x28;

pub static mut MASTER: Pic = Pic::new(0x20);
pub static mut SLAVE: Pic = Pic::new(0xA0);

/// This remaps the PIC
pub unsafe fn init() {
    let mut wait_port: Port<u8> = Port::new(0x80);
    let mut wait = || wait_port.write(0);
    
    let mut master_mask = MASTER.data.read();
    let slave_mask = SLAVE.data.read();

    // Start initialization
    MASTER.cmd.write(0x11);
    wait();
    SLAVE.cmd.write(0x11);
   
    
pub unsafe fn init() {
    let mut wait_port: Port<u8> = Port::new(0x80);
    let mut wait = || wait_port.write(0);
    
    let mut master_mask = MASTER.data.read();
    let slave_mask = SLAVE.data.read();

    // Start initialization
    MASTER.cmd.write(0x11);
    wait();
    SLAVE.cmd.write(0x11);
    wait();

    // Set offsets
    MASTER.data.write(MASTER_OFFSET);
    wait();
    SLAVE.data.write(SLAVE_OFFSET);
    wait();

    // Set up cascade
    MASTER.data.write(4);
    wait();
    SLAVE.data.write(2);
    wait();

    // Set up interrupt mode (1 is 8086/88 mode, 2 is auto EOI)
    MASTER.data.write(1);
    wait();
    SLAVE.data.write(1);
    wait();

    master_mask &= !(1 << 0);

    // restore masks
    MASTER.data.write(master_mask);
    SLAVE.data.write(slave_mask);

    MASTER.ack();
    SLAVE.ack();
}