fn ack(a: U15, b: U15, r7: U15, memory: &mut HashMap<(U15, U15), U15>) -> U15 {
    //Here is where our Memoization kicks in to speed things up
    if let Some(mem) = memory.get(&(a, b)) {
        return *mem;
    }

    //Standard ackerman
    if a == U15::from(0) {
        return b + 1;
    }
    if b == U15::from(0) {
        let res = ack(a + 32_767, r7, r7, memory);
        memory.insert((a + 32_767, r7), res);
        return res;
    }
    let res1 = ack(a, b + 32_767, r7, memory);
    memory.insert((a, b + 32_767), res1);
    let res2 = ack(a + 32_767, res1, r7, memory);
    memory.insert((a + 32_767, res1), res2);

    res2
}
//This function is rewritten to be better readable from the reverse engineered
//Ackerman function found in the dissasembly (see function.cpp)
This function is rewritten to be better readable from the reverse engineered
Ackerman function found in the dissasembly
This function is rewritten to be better readable from the reverse engineered Ackerman function found in the dissasembly
fn ack(a: U15, b: U15, r7: U15, memory: &mut HashMap<(U15, U15), U15>) -> U15 {
    //Here is where our Memoization kicks in to speed things up
    if let Some(mem) = memory.get(&(a, b)) {
        return *mem;
    }
    //Standard ackerman
    if a == U15::from(0) {
        return b + 1;
    }
    if b == U15::from(0) {
        let res = ack(a + 32_767, r7, r7, memory);
        memory.insert((a + 32_767, r7), res);
        return res;
    }
    let res1 = ack(a, b + 32_767, r7, memory);
    memory.insert((a, b + 32_767), res1);
    let res2 = ack(a + 32_767, res1, r7, memory);
    memory.insert((a + 32_767, res1), res2);
    res2
}
fn ack ( a : U15 , b : U15 , r7 : U15 , memory : & mut HashMap < ( U15 , U15 ) , U15 > ) -> U15 { //Here is where our Memoization kicks in to speed things up if let Some ( mem ) = memory . get ( & ( a , b ) ) { return * mem ; } //Standard ackerman if a == U15 :: from ( 0 ) { return b + 1 ; } if b == U15 :: from ( 0 ) { let res = ack ( a + 32_767 , r7 , r7 , memory ) ; memory . insert ( ( a + 32_767 , r7 ) , res ) ; return res ; } let res1 = ack ( a , b + 32_767 , r7 , memory ) ; memory . insert ( ( a , b + 32_767 ) , res1 ) ; let res2 = ack ( a + 32_767 , res1 , r7 , memory ) ; memory . insert ( ( a + 32_767 , res1 ) , res2 ) ; res2 }
This function is rewritten to be better readable from the reverse engineered
Ackerman function found in the dissasembly (see function.cpp)
This function is rewritten to be better readable from the reverse engineered Ackerman function found in the dissasembly ( see function . cpp )
a
U15
b
U15
r7
U15
memory
&mut HashMap<(U15, U15), U15>
a
U15
b
U15
r7
U15
memory
&mut HashMap<(U15, U15), U15>