#ifndef __X10_UTIL_HASHMAP_H
#define __X10_UTIL_HASHMAP_H

#include <x10rt.h>


#define X10_LANG_OBJECT_H_NODEPS
#include <x10/lang/Object.h>
#undef X10_LANG_OBJECT_H_NODEPS
#define X10_UTIL_MAP_H_NODEPS
#include <x10/util/Map.h>
#undef X10_UTIL_MAP_H_NODEPS
#define X10_IO_CUSTOMSERIALIZATION_H_NODEPS
#include <x10/io/CustomSerialization.h>
#undef X10_IO_CUSTOMSERIALIZATION_H_NODEPS
#define X10_UTIL_INDEXEDMEMORYCHUNK_H_NODEPS
#include <x10/util/IndexedMemoryChunk.h>
#undef X10_UTIL_INDEXEDMEMORYCHUNK_H_NODEPS
#define X10_LANG_INT_H_NODEPS
#include <x10/lang/Int.h>
#undef X10_LANG_INT_H_NODEPS
#define X10_LANG_BOOLEAN_H_NODEPS
#include <x10/lang/Boolean.h>
#undef X10_LANG_BOOLEAN_H_NODEPS
namespace x10 { namespace util { 
template<class TPMGL(T)> class IndexedMemoryChunk;
} } 
namespace x10 { namespace util { 
template<class TPMGL(Key), class TPMGL(Value)> class HashMap__HashEntry;
} } 
namespace x10 { namespace lang { 
class Int;
} } 
namespace x10 { namespace lang { 
class Boolean;
} } 
namespace x10 { namespace compiler { 
class NonEscaping;
} } 
namespace x10 { namespace lang { 
class Any;
} } 
namespace x10 { namespace util { 
template<class TPMGL(T)> class Box;
} } 
namespace x10 { namespace util { 
class NoSuchElementException;
} } 
namespace x10 { namespace util { 
template<class TPMGL(T)> class Set;
} } 
namespace x10 { namespace util { 
template<class TPMGL(Key), class TPMGL(Value)> class HashMap__KeySet;
} } 
namespace x10 { namespace util { 
template<class TPMGL(Key), class TPMGL(Val)> class Map__Entry;
} } 
namespace x10 { namespace util { 
template<class TPMGL(Key), class TPMGL(Value)> class HashMap__EntrySet;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(T)> class Iterator;
} } 
namespace x10 { namespace util { 
template<class TPMGL(Key), class TPMGL(Value)> class HashMap__EntriesIterator;
} } 
namespace x10 { namespace io { 
class SerialData;
} } 
namespace x10 { namespace util { 
template<class TPMGL(Key), class TPMGL(Value)> class HashMap__State;
} } 
namespace x10 { namespace array { 
class Point;
} } 
namespace x10 { namespace array { 
class Region;
} } 
namespace x10 { namespace array { 
template<class TPMGL(T)> class Array;
} } 
namespace x10 { namespace util { 
template<class TPMGL(T), class TPMGL(U)> class Pair;
} } 
namespace x10 { namespace lang { 
class Zero;
} } 
namespace x10 { namespace util { 

template<class TPMGL(K), class TPMGL(V)> class HashMap;
template <> class HashMap<void, void>;
template<class TPMGL(K), class TPMGL(V)> class HashMap : public x10::lang::Object
  {
    public:
    RTT_H_DECLS_CLASS
    
    static x10aux::itable_entry _itables[4];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    static typename x10::util::Map<TPMGL(K), TPMGL(V)>::template itable<x10::util::HashMap<TPMGL(K), TPMGL(V)> > _itable_0;
    
    static x10::lang::Any::itable<x10::util::HashMap<TPMGL(K), TPMGL(V)> > _itable_1;
    
    static x10::io::CustomSerialization::itable<x10::util::HashMap<TPMGL(K), TPMGL(V)> > _itable_2;
    
    x10::util::IndexedMemoryChunk<x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > >
      FMGL(table);
    
    x10_int FMGL(size);
    
    x10_int FMGL(occupation);
    
    x10_int FMGL(mask);
    
    x10_int FMGL(modCount);
    
    x10_boolean FMGL(shouldRehash);
    
    void _constructor();
    
    static x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > _make(
             );
    
    void _constructor(x10_int sz);
    
    static x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > _make(
             x10_int sz);
    
    virtual void init(x10_int sz);
    virtual void clear();
    virtual x10_int hash(TPMGL(K) k);
    virtual x10_int hashInternal(TPMGL(K) k);
    virtual x10aux::ref<x10::util::Box<TPMGL(V)> > __apply(
      TPMGL(K) k);
    virtual x10aux::ref<x10::util::Box<TPMGL(V)> > get(TPMGL(K) k);
    virtual TPMGL(V) getOrElse(TPMGL(K) k, TPMGL(V) orelse);
    virtual TPMGL(V) getOrThrow(TPMGL(K) k);
    virtual x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> >
      getEntry(TPMGL(K) k);
    virtual x10aux::ref<x10::util::Box<TPMGL(V)> > put(TPMGL(K) k,
                                                       TPMGL(V) v);
    virtual x10aux::ref<x10::util::Box<TPMGL(V)> > putInternal(
      TPMGL(K) k, TPMGL(V) v);
    virtual void rehash();
    virtual void rehashInternal();
    virtual x10_boolean containsKey(TPMGL(K) k);
    virtual x10aux::ref<x10::util::Box<TPMGL(V)> > remove(
      TPMGL(K) k);
    virtual x10aux::ref<x10::util::Set<TPMGL(K)> > keySet(
      );
    virtual x10aux::ref<x10::util::Set<x10aux::ref<x10::util::Map__Entry<TPMGL(K), TPMGL(V)> > > >
      entries();
    virtual x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > > >
      entriesIterator();
    virtual x10_int size();
    void _constructor(x10aux::ref<x10::io::SerialData> x);
    
    static x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > _make(
             x10aux::ref<x10::io::SerialData> x);
    
    virtual x10aux::ref<x10::io::SerialData> serialize();
    virtual x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >
      x10__util__HashMap____x10__util__HashMap__this();
    void __fieldInitializers47045();
    
    // Serialization
    public: static const x10aux::serialization_id_t _serialization_id;
    
    public: virtual x10aux::serialization_id_t _get_serialization_id() {
         return _serialization_id;
    }
    
    public: virtual void _serialize_body(x10aux::serialization_buffer& buf);
    
    public: static x10aux::ref<x10::lang::Reference> _deserializer(x10aux::deserialization_buffer& buf);
    
    public: void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};
template <> class HashMap<void, void> : public x10::lang::Object
{
    public:
    static x10aux::RuntimeType rtt;
    static const x10aux::RuntimeType* getRTT() { return & rtt; }
    static x10_int FMGL(MAX_PROBES);
    
    static x10_int FMGL(MIN_SIZE);
    
    static x10_int FMGL(MAX_PROBES__get)();
    static x10_int FMGL(MIN_SIZE__get)();
    
};

} } 
#endif // X10_UTIL_HASHMAP_H

namespace x10 { namespace util { 
template<class TPMGL(K), class TPMGL(V)> class HashMap;
} } 

#ifndef X10_UTIL_HASHMAP_H_NODEPS
#define X10_UTIL_HASHMAP_H_NODEPS
#include <x10/lang/Object.h>
#include <x10/util/Map.h>
#include <x10/io/CustomSerialization.h>
#include <x10/util/IndexedMemoryChunk.h>
#include <x10/util/HashMap__HashEntry.h>
#include <x10/lang/Int.h>
#include <x10/lang/Boolean.h>
#include <x10/compiler/NonEscaping.h>
#include <x10/lang/Any.h>
#include <x10/util/Box.h>
#include <x10/util/NoSuchElementException.h>
#include <x10/util/Set.h>
#include <x10/util/HashMap__KeySet.h>
#include <x10/util/Map__Entry.h>
#include <x10/util/HashMap__EntrySet.h>
#include <x10/lang/Iterator.h>
#include <x10/util/HashMap__EntriesIterator.h>
#include <x10/io/SerialData.h>
#include <x10/util/HashMap__State.h>
#include <x10/array/Point.h>
#include <x10/array/Region.h>
#include <x10/array/Array.h>
#include <x10/util/Pair.h>
#include <x10/lang/Zero.h>
#ifndef X10_UTIL_HASHMAP_H_GENERICS
#define X10_UTIL_HASHMAP_H_GENERICS
inline x10_int x10::util::HashMap<void, void>::FMGL(MAX_PROBES__get)() {
    return x10::util::HashMap<void, void>::FMGL(MAX_PROBES);
}

inline x10_int x10::util::HashMap<void, void>::FMGL(MIN_SIZE__get)() {
    return x10::util::HashMap<void, void>::FMGL(MIN_SIZE);
}

#endif // X10_UTIL_HASHMAP_H_GENERICS
#ifndef X10_UTIL_HASHMAP_H_IMPLEMENTATION
#define X10_UTIL_HASHMAP_H_IMPLEMENTATION
#include <x10/util/HashMap.h>

template<class TPMGL(K), class TPMGL(V)> typename x10::util::Map<TPMGL(K), TPMGL(V)>::template itable<x10::util::HashMap<TPMGL(K), TPMGL(V)> >  x10::util::HashMap<TPMGL(K), TPMGL(V)>::_itable_0(&x10::util::HashMap<TPMGL(K), TPMGL(V)>::clear, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::containsKey, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::entries, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::equals, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::get, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::getOrElse, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::getOrThrow, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::hashCode, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::keySet, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::put, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::remove, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::toString, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::typeName);
template<class TPMGL(K), class TPMGL(V)> x10::lang::Any::itable<x10::util::HashMap<TPMGL(K), TPMGL(V)> >  x10::util::HashMap<TPMGL(K), TPMGL(V)>::_itable_1(&x10::util::HashMap<TPMGL(K), TPMGL(V)>::equals, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::hashCode, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::toString, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::typeName);
template<class TPMGL(K), class TPMGL(V)> x10::io::CustomSerialization::itable<x10::util::HashMap<TPMGL(K), TPMGL(V)> >  x10::util::HashMap<TPMGL(K), TPMGL(V)>::_itable_2(&x10::util::HashMap<TPMGL(K), TPMGL(V)>::equals, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::hashCode, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::serialize, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::toString, &x10::util::HashMap<TPMGL(K), TPMGL(V)>::typeName);
template<class TPMGL(K), class TPMGL(V)> x10aux::itable_entry x10::util::HashMap<TPMGL(K), TPMGL(V)>::_itables[4] = {x10aux::itable_entry(&x10aux::getRTT<x10::util::Map<TPMGL(K), TPMGL(V)> >, &_itable_0), x10aux::itable_entry(&x10aux::getRTT<x10::lang::Any>, &_itable_1), x10aux::itable_entry(&x10aux::getRTT<x10::io::CustomSerialization>, &_itable_2), x10aux::itable_entry(NULL, (void*)x10aux::getRTT<x10::util::HashMap<TPMGL(K), TPMGL(V)> >())};

//#line 38 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10FieldDecl_c
/** The actual table, must be of size 2**n */

//#line 41 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10FieldDecl_c
/** Number of non-null, non-removed entries in the table. */

//#line 44 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10FieldDecl_c
/** Number of non-null entries in the table. */

//#line 47 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10FieldDecl_c
/** table.length - 1 */

//#line 49 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10FieldDecl_c

//#line 51 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10FieldDecl_c

//#line 53 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10FieldDecl_c

//#line 54 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10FieldDecl_c

//#line 56 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(K), class TPMGL(V)> void x10::util::HashMap<TPMGL(K), TPMGL(V)>::_constructor(
                                           ) {
    
    //#line 56 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Object::_constructor();
    
    //#line 56 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.AssignPropertyCall_c
    
    //#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::__fieldInitializers47045();
    
    //#line 57 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::init(
      x10::util::HashMap<void, void>::FMGL(MIN_SIZE__get)());
}
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > x10::util::HashMap<TPMGL(K), TPMGL(V)>::_make(
                                           ) {
    x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > this_ = new (memset(x10aux::alloc<x10::util::HashMap<TPMGL(K), TPMGL(V)> >(), 0, sizeof(x10::util::HashMap<TPMGL(K), TPMGL(V)>))) x10::util::HashMap<TPMGL(K), TPMGL(V)>();
    this_->_constructor();
    return this_;
}



//#line 60 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(K), class TPMGL(V)> void x10::util::HashMap<TPMGL(K), TPMGL(V)>::_constructor(
                                           x10_int sz) {
    
    //#line 60 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Object::_constructor();
    
    //#line 60 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.AssignPropertyCall_c
    
    //#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::__fieldInitializers47045();
    
    //#line 61 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10_int pow2 = x10::util::HashMap<void, void>::FMGL(MIN_SIZE__get)();
    
    //#line 62 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10While_c
    while (((pow2) < (sz))) {
        
        //#line 63 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10LocalAssign_c
        pow2 = ((x10_int) ((pow2) << (0x1f & (((x10_int)1)))));
    }
    
    //#line 64 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::init(
      pow2);
}
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > x10::util::HashMap<TPMGL(K), TPMGL(V)>::_make(
                                           x10_int sz) {
    x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > this_ = new (memset(x10aux::alloc<x10::util::HashMap<TPMGL(K), TPMGL(V)> >(), 0, sizeof(x10::util::HashMap<TPMGL(K), TPMGL(V)>))) x10::util::HashMap<TPMGL(K), TPMGL(V)>();
    this_->_constructor(sz);
    return this_;
}



//#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> void x10::util::HashMap<TPMGL(K), TPMGL(V)>::init(
  x10_int sz) {
    
    //#line 69 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Assert_c
    #ifndef NO_ASSERTIONS
    if (x10aux::x10__assertions_enabled)
        x10aux::x10__assert((x10aux::struct_equals(((x10_int) ((sz) & (((x10_int) -(sz))))),
                                                   sz)));
    #endif//NO_ASSERTIONS
    
    //#line 70 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Assert_c
    #ifndef NO_ASSERTIONS
    if (x10aux::x10__assertions_enabled)
        x10aux::x10__assert(((sz) >= (x10::util::HashMap<void, void>::
                                        FMGL(MIN_SIZE__get)())));
    #endif//NO_ASSERTIONS
    
    //#line 72 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(table) = x10::util::IndexedMemoryChunk<void>::allocate<x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > >(sz, 8, false, true);
    
    //#line 73 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(mask) = ((x10_int) ((sz) - (((x10_int)1))));
    
    //#line 74 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(size) = ((x10_int)0);
    
    //#line 75 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(occupation) = ((x10_int)0);
    
    //#line 76 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(shouldRehash) = false;
}

//#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> void x10::util::HashMap<TPMGL(K), TPMGL(V)>::clear(
  ) {
    
    //#line 80 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > x47355 =
      ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this);
    
    //#line 80 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Empty_c
    ;
    
    //#line 80 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    x10aux::nullCheck(x47355)->FMGL(modCount) = ((x10_int) ((x10aux::nullCheck(x47355)->
                                                               FMGL(modCount)) + (((x10_int)1))));
    
    //#line 81 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::init(
      x10::util::HashMap<void, void>::FMGL(MIN_SIZE__get)());
}

//#line 84 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10_int x10::util::HashMap<TPMGL(K), TPMGL(V)>::hash(
  TPMGL(K) k) {
    
    //#line 84 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::hashInternal(
             k);
    
}

//#line 85 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10_int x10::util::HashMap<TPMGL(K), TPMGL(V)>::hashInternal(
  TPMGL(K) k) {
    
    //#line 86 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return ((x10_int) ((x10aux::hash_code(k)) * (((x10_int)17))));
    
}

//#line 89 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::Box<TPMGL(V)> >
  x10::util::HashMap<TPMGL(K), TPMGL(V)>::__apply(TPMGL(K) k) {
    
    //#line 89 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->get(
             k);
    
}

//#line 91 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::Box<TPMGL(V)> >
  x10::util::HashMap<TPMGL(K), TPMGL(V)>::get(TPMGL(K) k) {
    
    //#line 92 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > e =
      ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->getEntry(
        k);
    
    //#line 93 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
    if ((x10aux::struct_equals(e, X10_NULL)) || x10aux::nullCheck(e)->
                                                  FMGL(removed))
    {
        
        //#line 93 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
        return X10_NULL;
        
    }
    
    //#line 94 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return x10::util::Box<TPMGL(V)>::_make(x10aux::nullCheck(e)->
                                             FMGL(value));
    
}

//#line 97 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> TPMGL(V) x10::util::HashMap<TPMGL(K), TPMGL(V)>::getOrElse(
  TPMGL(K) k, TPMGL(V) orelse) {
    
    //#line 98 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > e =
      ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->getEntry(
        k);
    
    //#line 99 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
    if ((x10aux::struct_equals(e, X10_NULL)) || x10aux::nullCheck(e)->
                                                  FMGL(removed))
    {
        
        //#line 99 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
        return orelse;
        
    }
    
    //#line 100 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return x10aux::nullCheck(e)->FMGL(value);
    
}

//#line 103 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> TPMGL(V) x10::util::HashMap<TPMGL(K), TPMGL(V)>::getOrThrow(
  TPMGL(K) k) {
    
    //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > e =
      ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->getEntry(
        k);
    
    //#line 106 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
    if ((x10aux::struct_equals(e, X10_NULL)) || x10aux::nullCheck(e)->
                                                  FMGL(removed))
    {
        
        //#line 106 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Throw_c
        x10aux::throwException(x10aux::nullCheck(x10::util::NoSuchElementException::_make(x10aux::string_utils::lit("Not found"))));
    }
    
    //#line 107 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return x10aux::nullCheck(e)->FMGL(value);
    
}

//#line 110 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> >
  x10::util::HashMap<TPMGL(K), TPMGL(V)>::getEntry(TPMGL(K) k) {
    
    //#line 111 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
    if ((x10aux::struct_equals(((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                                 FMGL(size), ((x10_int)0))))
    {
        
        //#line 112 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
        return X10_NULL;
        
    }
    
    //#line 118 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10_int h = ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->hash(
                  k);
    
    //#line 120 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10_int i = h;
    
    //#line 122 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10While_c
    while (true) {
        
        //#line 123 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
        x10_int j = ((x10_int) ((i) & (((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                                         FMGL(mask))));
        
        //#line 124 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10LocalAssign_c
        i = ((x10_int) ((i) + (((x10_int)1))));
        
        //#line 126 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > e =
          (((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
             FMGL(table))->__apply(j);
        
        //#line 127 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
        if ((x10aux::struct_equals(e, X10_NULL))) {
            
            //#line 128 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
            if (((((x10_int) ((i) - (h)))) > (x10::util::HashMap<void, void>::
                                                FMGL(MAX_PROBES__get)())))
            {
                
                //#line 129 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
                ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                  FMGL(shouldRehash) = true;
            }
            
            //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
            return X10_NULL;
            
        }
        
        //#line 132 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
        if ((!x10aux::struct_equals(e, X10_NULL))) {
            
            //#line 133 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
            if ((x10aux::struct_equals(x10aux::nullCheck(e)->
                                         FMGL(hash), h)) &&
                x10aux::equals(k,x10aux::class_cast_unchecked<x10aux::ref<x10::lang::Any> >(x10aux::nullCheck(e)->
                                                                                              FMGL(key))))
            {
                
                //#line 134 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
                if (((((x10_int) ((i) - (h)))) > (x10::util::HashMap<void, void>::
                                                    FMGL(MAX_PROBES__get)())))
                {
                    
                    //#line 135 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
                    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                      FMGL(shouldRehash) = true;
                }
                
                //#line 136 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
                return e;
                
            }
            
            //#line 138 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
            if (((((x10_int) ((i) - (h)))) > ((((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                                                 FMGL(table))->length())))
            {
                
                //#line 139 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
                if (((((x10_int) ((i) - (h)))) > (x10::util::HashMap<void, void>::
                                                    FMGL(MAX_PROBES__get)())))
                {
                    
                    //#line 140 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
                    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                      FMGL(shouldRehash) = true;
                }
                
                //#line 141 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
                return X10_NULL;
                
            }
            
        }
        
    }
    
}

//#line 147 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::Box<TPMGL(V)> >
  x10::util::HashMap<TPMGL(K), TPMGL(V)>::put(TPMGL(K) k,
                                              TPMGL(V) v) {
    
    //#line 147 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::putInternal(
             k, v);
    
}

//#line 148 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::Box<TPMGL(V)> >
  x10::util::HashMap<TPMGL(K), TPMGL(V)>::putInternal(TPMGL(K) k,
                                                      TPMGL(V) v) {
    
    //#line 149 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
    if ((x10aux::struct_equals(((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                                 FMGL(occupation), (((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                                                      FMGL(table))->length())) ||
        ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
          FMGL(shouldRehash) && ((((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                                    FMGL(occupation)) >= (((x10_int) (((((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                                                                          FMGL(table))->length()) / x10aux::zeroCheck(((x10_int)2)))))))
    {
        
        //#line 150 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10Call_c
        ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::rehashInternal();
    }
    
    //#line 152 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10_int h = ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::hashInternal(
                  k);
    
    //#line 153 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10_int i = h;
    
    //#line 155 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10While_c
    while (true) {
        
        //#line 156 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
        x10_int j = ((x10_int) ((i) & (((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                                         FMGL(mask))));
        
        //#line 157 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10LocalAssign_c
        i = ((x10_int) ((i) + (((x10_int)1))));
        
        //#line 159 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > e =
          (((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
             FMGL(table))->__apply(j);
        
        //#line 160 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
        if ((x10aux::struct_equals(e, X10_NULL))) {
            
            //#line 161 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
            if (((((x10_int) ((i) - (h)))) > (x10::util::HashMap<void, void>::
                                                FMGL(MAX_PROBES__get)())))
            {
                
                //#line 162 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
                ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                  FMGL(shouldRehash) = true;
            }
            
            //#line 163 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > x47356 =
              ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this);
            
            //#line 163 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Empty_c
            ;
            
            //#line 163 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
            x10aux::nullCheck(x47356)->FMGL(modCount) = ((x10_int) ((x10aux::nullCheck(x47356)->
                                                                       FMGL(modCount)) + (((x10_int)1))));
            
            //#line 164 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10Call_c
            (((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
               FMGL(table))->__set(j, x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)>::_make(k,
                                                                                               v,
                                                                                               h));
            
            //#line 165 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > x47357 =
              ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this);
            
            //#line 165 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Empty_c
            ;
            
            //#line 165 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
            x10aux::nullCheck(x47357)->FMGL(size) = ((x10_int) ((x10aux::nullCheck(x47357)->
                                                                   FMGL(size)) + (((x10_int)1))));
            
            //#line 166 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > x47358 =
              ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this);
            
            //#line 166 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Empty_c
            ;
            
            //#line 166 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
            x10aux::nullCheck(x47358)->FMGL(occupation) =
              ((x10_int) ((x10aux::nullCheck(x47358)->FMGL(occupation)) + (((x10_int)1))));
            
            //#line 167 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
            return X10_NULL;
            
        } else 
        //#line 168 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
        if ((x10aux::struct_equals(x10aux::nullCheck(e)->
                                     FMGL(hash), h)) && x10aux::equals(k,x10aux::class_cast_unchecked<x10aux::ref<x10::lang::Any> >(x10aux::nullCheck(e)->
                                                                                                                                      FMGL(key))))
        {
            
            //#line 171 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
            TPMGL(V) old = x10aux::nullCheck(e)->FMGL(value);
            
            //#line 172 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
            x10aux::nullCheck(e)->FMGL(value) = v;
            
            //#line 173 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
            if (x10aux::nullCheck(e)->FMGL(removed)) {
                
                //#line 174 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
                x10aux::nullCheck(e)->FMGL(removed) = false;
                
                //#line 175 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
                x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > x47359 =
                  ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this);
                
                //#line 175 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Empty_c
                ;
                
                //#line 175 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
                x10aux::nullCheck(x47359)->FMGL(size) = ((x10_int) ((x10aux::nullCheck(x47359)->
                                                                       FMGL(size)) + (((x10_int)1))));
                
                //#line 176 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
                return X10_NULL;
                
            }
            
            //#line 178 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
            return x10::util::Box<TPMGL(V)>::_make(old);
            
        }
        
    }
    
}

//#line 183 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> void x10::util::HashMap<TPMGL(K), TPMGL(V)>::rehash(
  ) {
    
    //#line 183 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::rehashInternal();
}

//#line 184 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> void x10::util::HashMap<TPMGL(K), TPMGL(V)>::rehashInternal(
  ) {
    
    //#line 185 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > x47360 =
      ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this);
    
    //#line 185 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Empty_c
    ;
    
    //#line 185 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    x10aux::nullCheck(x47360)->FMGL(modCount) = ((x10_int) ((x10aux::nullCheck(x47360)->
                                                               FMGL(modCount)) + (((x10_int)1))));
    
    //#line 186 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10::util::IndexedMemoryChunk<x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > > t =
      ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
        FMGL(table);
    
    //#line 187 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10_int oldSize = ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                        FMGL(size);
    
    //#line 188 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(table) = x10::util::IndexedMemoryChunk<void>::allocate<x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > >(((x10_int) (((t)->length()) * (((x10_int)2)))), 8, false, true);
    
    //#line 189 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(mask) = ((x10_int) (((((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                                   FMGL(table))->length()) - (((x10_int)1))));
    
    //#line 190 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(size) = ((x10_int)0);
    
    //#line 191 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(occupation) = ((x10_int)0);
    
    //#line 192 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(shouldRehash) = false;
    
    //#line 194 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.For_c
    {
        x10_int i;
        for (
             //#line 194 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
             i = ((x10_int)0); ((i) < ((t)->length())); 
                                                        //#line 194 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10LocalAssign_c
                                                        i =
                                                          ((x10_int) ((i) + (((x10_int)1)))))
        {
            
            //#line 195 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals((t)->__apply(i), X10_NULL)) &&
                !(x10aux::nullCheck((t)->__apply(i))->FMGL(removed)))
            {
                
                //#line 196 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10Call_c
                ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::putInternal(
                  x10aux::nullCheck((t)->__apply(i))->FMGL(key),
                  x10aux::nullCheck((t)->__apply(i))->FMGL(value));
                
                //#line 197 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
                ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                  FMGL(shouldRehash) = false;
            }
            
        }
    }
    
    //#line 200 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Assert_c
    #ifndef NO_ASSERTIONS
    if (x10aux::x10__assertions_enabled)
        x10aux::x10__assert((x10aux::struct_equals(((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
                                                     FMGL(size),
                                                   oldSize)));
    #endif//NO_ASSERTIONS
    
    //#line 201 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(size) = oldSize;
}

//#line 204 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10_boolean x10::util::HashMap<TPMGL(K), TPMGL(V)>::containsKey(
  TPMGL(K) k) {
    
    //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > e =
      ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->getEntry(
        k);
    
    //#line 206 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return (!x10aux::struct_equals(e, X10_NULL)) && !(x10aux::nullCheck(e)->
                                                        FMGL(removed));
    
}

//#line 209 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::Box<TPMGL(V)> >
  x10::util::HashMap<TPMGL(K), TPMGL(V)>::remove(TPMGL(K) k) {
    
    //#line 210 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > x47362 =
      ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this);
    
    //#line 210 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Empty_c
    ;
    
    //#line 210 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    x10aux::nullCheck(x47362)->FMGL(modCount) = ((x10_int) ((x10aux::nullCheck(x47362)->
                                                               FMGL(modCount)) + (((x10_int)1))));
    
    //#line 211 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > e =
      ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->getEntry(
        k);
    
    //#line 212 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10If_c
    if ((!x10aux::struct_equals(e, X10_NULL)) && !(x10aux::nullCheck(e)->
                                                     FMGL(removed)))
    {
        
        //#line 213 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > x47361 =
          ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this);
        
        //#line 213 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.Empty_c
        ;
        
        //#line 213 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
        x10aux::nullCheck(x47361)->FMGL(size) = ((x10_int) ((x10aux::nullCheck(x47361)->
                                                               FMGL(size)) - (((x10_int)1))));
        
        //#line 214 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
        x10aux::nullCheck(e)->FMGL(removed) = true;
        
        //#line 215 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
        return x10::util::Box<TPMGL(V)>::_make(x10aux::nullCheck(e)->
                                                 FMGL(value));
        
    }
    
    //#line 217 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return X10_NULL;
    
}

//#line 220 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::Set<TPMGL(K)> >
  x10::util::HashMap<TPMGL(K), TPMGL(V)>::keySet() {
    
    //#line 220 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return x10::util::HashMap__KeySet<TPMGL(K), TPMGL(V)>::_make(((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this));
    
}

//#line 221 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::Set<x10aux::ref<x10::util::Map__Entry<TPMGL(K), TPMGL(V)> > > >
  x10::util::HashMap<TPMGL(K), TPMGL(V)>::entries() {
    
    //#line 221 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return x10::util::HashMap__EntrySet<TPMGL(K), TPMGL(V)>::_make(((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this));
    
}

//#line 223 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > > >
  x10::util::HashMap<TPMGL(K), TPMGL(V)>::entriesIterator(
  ) {
    
    //#line 224 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::util::HashMap__EntriesIterator<TPMGL(K), TPMGL(V)> > iterator =
      x10::util::HashMap__EntriesIterator<TPMGL(K), TPMGL(V)>::_make(((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this));
    
    //#line 225 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10Call_c
    iterator->advance();
    
    //#line 226 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return iterator;
    
}

//#line 262 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10_int x10::util::HashMap<TPMGL(K), TPMGL(V)>::size(
  ) {
    
    //#line 262 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
             FMGL(size);
    
}

//#line 321 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(K), class TPMGL(V)> void x10::util::HashMap<TPMGL(K), TPMGL(V)>::_constructor(
                                           x10aux::ref<x10::io::SerialData> x) {
    
    //#line 322 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::util::HashMap<TPMGL(K), TPMGL(V)>::_constructor();
    
    //#line 323 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::util::HashMap__State<TPMGL(K), TPMGL(V)> > state =
      x10aux::class_cast<x10aux::ref<x10::util::HashMap__State<TPMGL(K), TPMGL(V)> > >(x10aux::nullCheck(x)->
                                                                                         FMGL(data));
    
    //#line 324 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": polyglot.ast.For_c
    {
        x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > > p47334;
        for (
             //#line 324 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
             p47334 = x10aux::nullCheck(x10aux::nullCheck(state)->
                                          FMGL(content))->
                        FMGL(region)->iterator(); x10::lang::Iterator<x10aux::ref<x10::array::Point> >::hasNext(x10aux::nullCheck(p47334));
             ) {
            
            //#line 324 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::array::Point> p = x10::lang::Iterator<x10aux::ref<x10::array::Point> >::next(x10aux::nullCheck(p47334));
            
            //#line 325 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10LocalDecl_c
            x10::util::Pair<TPMGL(K), TPMGL(V)> pair = x10aux::nullCheck(x10aux::nullCheck(state)->
                                                                           FMGL(content))->x10::array::Array<x10::util::Pair<TPMGL(K), TPMGL(V)> >::__apply(
                                                         p);
            
            //#line 326 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10Call_c
            ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->x10::util::HashMap<TPMGL(K), TPMGL(V)>::putInternal(
              pair->FMGL(first), pair->FMGL(second));
        }
    }
    
}
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > x10::util::HashMap<TPMGL(K), TPMGL(V)>::_make(
                                           x10aux::ref<x10::io::SerialData> x)
{
    x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > this_ = new (memset(x10aux::alloc<x10::util::HashMap<TPMGL(K), TPMGL(V)> >(), 0, sizeof(x10::util::HashMap<TPMGL(K), TPMGL(V)>))) x10::util::HashMap<TPMGL(K), TPMGL(V)>();
    this_->_constructor(x);
    return this_;
}



//#line 333 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::io::SerialData>
  x10::util::HashMap<TPMGL(K), TPMGL(V)>::serialize() {
    
    //#line 333 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return x10::io::SerialData::_make(x10aux::class_cast_unchecked<x10aux::ref<x10::lang::Any> >(x10::util::HashMap__State<TPMGL(K), TPMGL(V)>::_make(((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this))),
                                      x10aux::class_cast_unchecked<x10aux::ref<x10::io::SerialData> >(X10_NULL));
    
}

//#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >
  x10::util::HashMap<TPMGL(K), TPMGL(V)>::x10__util__HashMap____x10__util__HashMap__this(
  ) {
    
    //#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this);
    
}

//#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(K), class TPMGL(V)> void x10::util::HashMap<TPMGL(K), TPMGL(V)>::__fieldInitializers47045(
  ) {
    
    //#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(table) = x10aux::zeroValue<x10::util::IndexedMemoryChunk<x10aux::ref<x10::util::HashMap__HashEntry<TPMGL(K), TPMGL(V)> > > >();
    
    //#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(size) = ((x10_int)0);
    
    //#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(occupation) = ((x10_int)0);
    
    //#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(mask) = ((x10_int)0);
    
    //#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(modCount) = ((x10_int)0);
    
    //#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/HashMap.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> >)this)->
      FMGL(shouldRehash) = false;
}
template<class TPMGL(K), class TPMGL(V)> const x10aux::serialization_id_t x10::util::HashMap<TPMGL(K), TPMGL(V)>::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10::util::HashMap<TPMGL(K), TPMGL(V)>::_deserializer, x10aux::CLOSURE_KIND_NOT_ASYNC);

template<class TPMGL(K), class TPMGL(V)> void x10::util::HashMap<TPMGL(K), TPMGL(V)>::_serialize_body(x10aux::serialization_buffer& buf) {
    /* NOTE: Implements x10.io.CustomSerialization */
    buf.write(this->serialize());
    
}

template<class TPMGL(K), class TPMGL(V)> x10aux::ref<x10::lang::Reference> x10::util::HashMap<TPMGL(K), TPMGL(V)>::_deserializer(x10aux::deserialization_buffer& buf) {
    x10aux::ref<x10::util::HashMap<TPMGL(K), TPMGL(V)> > this_ = new (memset(x10aux::alloc<x10::util::HashMap<TPMGL(K), TPMGL(V)> >(), 0, sizeof(x10::util::HashMap<TPMGL(K), TPMGL(V)>))) x10::util::HashMap<TPMGL(K), TPMGL(V)>();
    buf.record_reference(this_);
    this_->_deserialize_body(buf);
    return this_;
}

template<class TPMGL(K), class TPMGL(V)> void x10::util::HashMap<TPMGL(K), TPMGL(V)>::_deserialize_body(x10aux::deserialization_buffer& buf) {
    /* NOTE: Implements x10.io.CustomSerialization */
    x10aux::ref<x10::io::SerialData>val_ = buf.read<x10aux::ref<x10::io::SerialData> >();
    _constructor(val_);
    
}

template<class TPMGL(K), class TPMGL(V)> x10aux::RuntimeType x10::util::HashMap<TPMGL(K), TPMGL(V)>::rtt;
template<class TPMGL(K), class TPMGL(V)> void x10::util::HashMap<TPMGL(K), TPMGL(V)>::_initRTT() {
    const x10aux::RuntimeType *canonical = x10aux::getRTT<x10::util::HashMap<void, void> >();
    if (rtt.initStageOne(canonical)) return;
    const x10aux::RuntimeType* parents[3] = { x10aux::getRTT<x10::lang::Object>(), x10aux::getRTT<x10::util::Map<TPMGL(K), TPMGL(V)> >(), x10aux::getRTT<x10::io::CustomSerialization>()};
    const x10aux::RuntimeType* params[2] = { x10aux::getRTT<TPMGL(K)>(), x10aux::getRTT<TPMGL(V)>()};
    x10aux::RuntimeType::Variance variances[2] = { x10aux::RuntimeType::invariant, x10aux::RuntimeType::invariant};
    const char *baseName = "x10.util.HashMap";
    rtt.initStageTwo(baseName, x10aux::RuntimeType::class_kind, 3, parents, 2, params, variances);
}
#endif // X10_UTIL_HASHMAP_H_IMPLEMENTATION
#endif // __X10_UTIL_HASHMAP_H_NODEPS
