#ifndef __X10_LANG_PLACELOCALHANDLE_H
#define __X10_LANG_PLACELOCALHANDLE_H

#include <x10rt.h>


#define X10_LANG_ANY_H_NODEPS
#include <x10/lang/Any.h>
#undef X10_LANG_ANY_H_NODEPS
#define X10_LANG_ANY_H_NODEPS
#include <x10/lang/Any.h>
#undef X10_LANG_ANY_H_NODEPS
#define X10_LANG_PLACELOCALHANDLE_IMPL_H_NODEPS
#include <x10/lang/PlaceLocalHandle_Impl.h>
#undef X10_LANG_PLACELOCALHANDLE_IMPL_H_NODEPS
#define X10_LANG_PLACELOCALHANDLE_IMPL_H_NODEPS
#include <x10/lang/PlaceLocalHandle_Impl.h>
#undef X10_LANG_PLACELOCALHANDLE_IMPL_H_NODEPS
namespace x10 { namespace lang { 
class Object;
} } 
namespace x10 { namespace lang { 
class Int;
} } 
namespace x10 { namespace lang { 
class String;
} } 
namespace x10 { namespace array { 
class Dist;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(U)> class Fun_0_0;
} } 
namespace x10 { namespace lang { 
class Runtime;
} } 
namespace x10 { namespace lang { 
class Place;
} } 
namespace x10 { namespace lang { 
class FinishState;
} } 
namespace x10 { namespace lang { 
class Throwable;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(T)> class Iterator;
} } 
namespace x10 { namespace array { 
class PlaceGroup;
} } 
namespace x10 { namespace lang { 
class VoidFun_0_0;
} } 
namespace x10 { namespace compiler { 
class AsyncClosure;
} } 
namespace x10 { namespace lang { 
class RuntimeException;
} } 
namespace x10 { namespace compiler { 
class Finalization;
} } 
namespace x10 { namespace compiler { 
class Abort;
} } 
namespace x10 { namespace compiler { 
class CompilerFlags;
} } 
namespace x10 { namespace lang { 
class Boolean;
} } 
namespace x10 { namespace compiler { 
class Pragma;
} } 
namespace x10 { namespace compiler { 
class Native;
} } 
namespace x10 { namespace compiler { 
class NonEscaping;
} } 
namespace x10 { namespace compiler { 
class NativeClass;
} } 
namespace x10 { namespace lang { 

template<class TPMGL(T)> class PlaceLocalHandle   {
    public:
    RTT_H_DECLS_STRUCT
    
    x10::lang::PlaceLocalHandle<TPMGL(T)>* operator->() { return this; }
    
    static x10aux::itable_entry _itables[2];
    
    x10aux::itable_entry* _getITables() { return _itables; }
    
    static x10::lang::Any::itable<x10::lang::PlaceLocalHandle<TPMGL(T)> > _itable_0;
    
    static x10aux::itable_entry _iboxitables[2];
    
    x10aux::itable_entry* _getIBoxITables() { return _iboxitables; }
    
    static x10::lang::PlaceLocalHandle<TPMGL(T)> _alloc(){x10::lang::PlaceLocalHandle<TPMGL(T)> t; return t; }
    
    x10::lang::PlaceLocalHandle_Impl<TPMGL(T)> FMGL(__NATIVE_FIELD__);
    
    void _constructor(x10::lang::PlaceLocalHandle_Impl<TPMGL(T)> id0);
    
    static x10::lang::PlaceLocalHandle<TPMGL(T)> _make(x10::lang::PlaceLocalHandle_Impl<TPMGL(T)> id0);
    
    void _constructor();
    
    static x10::lang::PlaceLocalHandle<TPMGL(T)> _make();
    
    TPMGL(T) __apply();
    void set(TPMGL(T) newVal);
    x10_int hashCode();
    x10aux::ref<x10::lang::String> toString();
    x10aux::ref<x10::lang::String> typeName();
    x10_boolean equals(x10aux::ref<x10::lang::Any> other);
    x10_boolean equals(x10::lang::PlaceLocalHandle<TPMGL(T)> other);
    x10_boolean _struct_equals(x10aux::ref<x10::lang::Any> other);
    x10_boolean _struct_equals(x10::lang::PlaceLocalHandle<TPMGL(T)> other);
    x10::lang::PlaceLocalHandle<TPMGL(T)> x10__lang__PlaceLocalHandle____x10__lang__PlaceLocalHandle__this(
      );
    
    static void _serialize(x10::lang::PlaceLocalHandle<TPMGL(T)> this_, x10aux::serialization_buffer& buf);
    
    static x10::lang::PlaceLocalHandle<TPMGL(T)> _deserialize(x10aux::deserialization_buffer& buf) {
        x10::lang::PlaceLocalHandle<TPMGL(T)> this_;
        this_->_deserialize_body(buf);
        return this_;
    }
    
    void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};
template <> class PlaceLocalHandle<void> {
    public:
    static x10aux::RuntimeType rtt;
    static const x10aux::RuntimeType* getRTT() { return & rtt; }
    template<class TPMGL(T)> static x10::lang::PlaceLocalHandle<TPMGL(T)>
      make(x10aux::ref<x10::array::Dist> dist, x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > init);
    
    template<class TPMGL(T)> static x10::lang::PlaceLocalHandle<TPMGL(T)>
      makeFlat(x10aux::ref<x10::array::Dist> dist, x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > init);
    
    
};

} } 
#endif // X10_LANG_PLACELOCALHANDLE_H

namespace x10 { namespace lang { 
template<class TPMGL(T)> class PlaceLocalHandle;
} } 

#ifndef X10_LANG_PLACELOCALHANDLE_H_NODEPS
#define X10_LANG_PLACELOCALHANDLE_H_NODEPS
#include <x10/lang/Any.h>
#include <x10/lang/PlaceLocalHandle_Impl.h>
#include <x10/lang/Object.h>
#include <x10/lang/Int.h>
#include <x10/lang/String.h>
#include <x10/array/Dist.h>
#include <x10/lang/Fun_0_0.h>
#include <x10/lang/Runtime.h>
#include <x10/lang/Place.h>
#include <x10/lang/FinishState.h>
#include <x10/lang/Throwable.h>
#include <x10/lang/Iterator.h>
#include <x10/array/PlaceGroup.h>
#include <x10/lang/VoidFun_0_0.h>
#include <x10/compiler/AsyncClosure.h>
#include <x10/lang/RuntimeException.h>
#include <x10/compiler/Finalization.h>
#include <x10/compiler/Abort.h>
#include <x10/compiler/CompilerFlags.h>
#include <x10/lang/Boolean.h>
#include <x10/compiler/Pragma.h>
#include <x10/compiler/Native.h>
#include <x10/compiler/NonEscaping.h>
#include <x10/compiler/NativeClass.h>
#ifndef X10_LANG_PLACELOCALHANDLE_H_GENERICS
#define X10_LANG_PLACELOCALHANDLE_H_GENERICS
#endif // X10_LANG_PLACELOCALHANDLE_H_GENERICS
#ifndef X10_LANG_PLACELOCALHANDLE_H_IMPLEMENTATION
#define X10_LANG_PLACELOCALHANDLE_H_IMPLEMENTATION
#include <x10/lang/PlaceLocalHandle.h>

#ifndef X10_LANG_PLACELOCALHANDLE__CLOSURE__1_CLOSURE
#define X10_LANG_PLACELOCALHANDLE__CLOSURE__1_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_0.h>
template<class TPMGL(T)> class x10_lang_PlaceLocalHandle__closure__1 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> >::template itable <x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10::lang::PlaceLocalHandle<TPMGL(T)> __apply() {
        
        //#line 65 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
        return x10::lang::PlaceLocalHandle<TPMGL(T)>::_make();
        
    }
    
    // captured environment
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) >* storage = x10aux::alloc<x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) > >(storage));
        x10aux::ref<x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) > > this_ = new (storage) x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) >();
        return this_;
    }
    
    x10_lang_PlaceLocalHandle__closure__1() { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> > >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> > >(); }
    
    x10aux::ref<x10::lang::String> toString() {
        return x10aux::string_utils::lit(this->toNativeString());
    }
    
    const char* toNativeString() {
        return "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10:65";
    }

};

template<class TPMGL(T)> typename x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> >::template itable <x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) > >x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) >::_itable(&x10::lang::Reference::equals, &x10::lang::Closure::hashCode, &x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) >::__apply, &x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) >::toString, &x10::lang::Closure::typeName);
template<class TPMGL(T)> x10aux::itable_entry x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) >::_itables[2] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> > >, &x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) >::_itable),x10aux::itable_entry(NULL, NULL)};

template<class TPMGL(T)> const x10aux::serialization_id_t x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) >::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) >::template _deserialize<x10::lang::Reference>,x10aux::CLOSURE_KIND_NOT_ASYNC);

#endif // X10_LANG_PLACELOCALHANDLE__CLOSURE__1_CLOSURE
#ifndef X10_LANG_PLACELOCALHANDLE__CLOSURE__2_CLOSURE
#define X10_LANG_PLACELOCALHANDLE__CLOSURE__2_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/VoidFun_0_0.h>
template<class TPMGL(T)> class x10_lang_PlaceLocalHandle__closure__2 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::VoidFun_0_0::template itable <x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    void __apply() {
        
        //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
        handle->x10::lang::PlaceLocalHandle<TPMGL(T)>::set(x10::lang::Fun_0_0<TPMGL(T)>::__apply(x10aux::nullCheck(init)));
    }
    
    // captured environment
    x10::lang::PlaceLocalHandle<TPMGL(T)> handle;
    x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > init;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->handle);
        buf.write(this->init);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) >* storage = x10aux::alloc<x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) > >(storage));
        x10::lang::PlaceLocalHandle<TPMGL(T)> that_handle = buf.read<x10::lang::PlaceLocalHandle<TPMGL(T)> >();
        x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > that_init = buf.read<x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > >();
        x10aux::ref<x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) > > this_ = new (storage) x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) >(that_handle, that_init);
        return this_;
    }
    
    x10_lang_PlaceLocalHandle__closure__2(x10::lang::PlaceLocalHandle<TPMGL(T)> handle, x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > init) : handle(handle), init(init) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::VoidFun_0_0>(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::VoidFun_0_0>(); }
    
    x10aux::ref<x10::lang::String> toString() {
        return x10aux::string_utils::lit(this->toNativeString());
    }
    
    const char* toNativeString() {
        return "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10:67";
    }

};

template<class TPMGL(T)> typename x10::lang::VoidFun_0_0::template itable <x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) > >x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) >::_itable(&x10::lang::Reference::equals, &x10::lang::Closure::hashCode, &x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) >::__apply, &x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) >::toString, &x10::lang::Closure::typeName);
template<class TPMGL(T)> x10aux::itable_entry x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) >::_itables[2] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::VoidFun_0_0>, &x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) >::_itable),x10aux::itable_entry(NULL, NULL)};

template<class TPMGL(T)> const x10aux::serialization_id_t x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) >::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) >::template _deserialize<x10::lang::Reference>,x10aux::CLOSURE_KIND_SIMPLE_ASYNC);

#endif // X10_LANG_PLACELOCALHANDLE__CLOSURE__2_CLOSURE
#ifndef X10_LANG_PLACELOCALHANDLE__CLOSURE__3_CLOSURE
#define X10_LANG_PLACELOCALHANDLE__CLOSURE__3_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_0.h>
template<class TPMGL(T)> class x10_lang_PlaceLocalHandle__closure__3 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> >::template itable <x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10::lang::PlaceLocalHandle<TPMGL(T)> __apply() {
        
        //#line 86 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
        return x10::lang::PlaceLocalHandle<TPMGL(T)>::_make();
        
    }
    
    // captured environment
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) >* storage = x10aux::alloc<x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) > >(storage));
        x10aux::ref<x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) > > this_ = new (storage) x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) >();
        return this_;
    }
    
    x10_lang_PlaceLocalHandle__closure__3() { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> > >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> > >(); }
    
    x10aux::ref<x10::lang::String> toString() {
        return x10aux::string_utils::lit(this->toNativeString());
    }
    
    const char* toNativeString() {
        return "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10:86";
    }

};

template<class TPMGL(T)> typename x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> >::template itable <x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) > >x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) >::_itable(&x10::lang::Reference::equals, &x10::lang::Closure::hashCode, &x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) >::__apply, &x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) >::toString, &x10::lang::Closure::typeName);
template<class TPMGL(T)> x10aux::itable_entry x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) >::_itables[2] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> > >, &x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) >::_itable),x10aux::itable_entry(NULL, NULL)};

template<class TPMGL(T)> const x10aux::serialization_id_t x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) >::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) >::template _deserialize<x10::lang::Reference>,x10aux::CLOSURE_KIND_NOT_ASYNC);

#endif // X10_LANG_PLACELOCALHANDLE__CLOSURE__3_CLOSURE
#ifndef X10_LANG_PLACELOCALHANDLE__CLOSURE__4_CLOSURE
#define X10_LANG_PLACELOCALHANDLE__CLOSURE__4_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/VoidFun_0_0.h>
template<class TPMGL(T)> class x10_lang_PlaceLocalHandle__closure__4 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::VoidFun_0_0::template itable <x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    void __apply() {
        
        //#line 89 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
        handle->x10::lang::PlaceLocalHandle<TPMGL(T)>::set(x10::lang::Fun_0_0<TPMGL(T)>::__apply(x10aux::nullCheck(init)));
    }
    
    // captured environment
    x10::lang::PlaceLocalHandle<TPMGL(T)> handle;
    x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > init;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->handle);
        buf.write(this->init);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) >* storage = x10aux::alloc<x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) > >(storage));
        x10::lang::PlaceLocalHandle<TPMGL(T)> that_handle = buf.read<x10::lang::PlaceLocalHandle<TPMGL(T)> >();
        x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > that_init = buf.read<x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > >();
        x10aux::ref<x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) > > this_ = new (storage) x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) >(that_handle, that_init);
        return this_;
    }
    
    x10_lang_PlaceLocalHandle__closure__4(x10::lang::PlaceLocalHandle<TPMGL(T)> handle, x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > init) : handle(handle), init(init) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::VoidFun_0_0>(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::VoidFun_0_0>(); }
    
    x10aux::ref<x10::lang::String> toString() {
        return x10aux::string_utils::lit(this->toNativeString());
    }
    
    const char* toNativeString() {
        return "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10:89";
    }

};

template<class TPMGL(T)> typename x10::lang::VoidFun_0_0::template itable <x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) > >x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) >::_itable(&x10::lang::Reference::equals, &x10::lang::Closure::hashCode, &x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) >::__apply, &x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) >::toString, &x10::lang::Closure::typeName);
template<class TPMGL(T)> x10aux::itable_entry x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) >::_itables[2] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::VoidFun_0_0>, &x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) >::_itable),x10aux::itable_entry(NULL, NULL)};

template<class TPMGL(T)> const x10aux::serialization_id_t x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) >::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) >::template _deserialize<x10::lang::Reference>,x10aux::CLOSURE_KIND_SIMPLE_ASYNC);

#endif // X10_LANG_PLACELOCALHANDLE__CLOSURE__4_CLOSURE
namespace x10 { namespace lang { 
template<class TPMGL(T)> class PlaceLocalHandle_ibox0 : public x10::lang::IBox<x10::lang::PlaceLocalHandle<TPMGL(T)> > {
public:
    static x10::lang::Any::itable<PlaceLocalHandle_ibox0<TPMGL(T)> > itable;
    x10_boolean equals(x10aux::ref<x10::lang::Any> arg0) {
        return this->value->equals(arg0);
    }
    x10_int hashCode() {
        return this->value->hashCode();
    }
    x10aux::ref<x10::lang::String> toString() {
        return this->value->toString();
    }
    x10aux::ref<x10::lang::String> typeName() {
        return this->value->typeName();
    }
    
};
template<class TPMGL(T)> x10::lang::Any::itable<PlaceLocalHandle_ibox0<TPMGL(T)> >  PlaceLocalHandle_ibox0<TPMGL(T)>::itable(&PlaceLocalHandle_ibox0<TPMGL(T)>::equals, &PlaceLocalHandle_ibox0<TPMGL(T)>::hashCode, &PlaceLocalHandle_ibox0<TPMGL(T)>::toString, &PlaceLocalHandle_ibox0<TPMGL(T)>::typeName);
} } 
template<class TPMGL(T)> x10::lang::Any::itable<x10::lang::PlaceLocalHandle<TPMGL(T)> >  x10::lang::PlaceLocalHandle<TPMGL(T)>::_itable_0(&x10::lang::PlaceLocalHandle<TPMGL(T)>::equals, &x10::lang::PlaceLocalHandle<TPMGL(T)>::hashCode, &x10::lang::PlaceLocalHandle<TPMGL(T)>::toString, &x10::lang::PlaceLocalHandle<TPMGL(T)>::typeName);
template<class TPMGL(T)> x10aux::itable_entry x10::lang::PlaceLocalHandle<TPMGL(T)>::_itables[2] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::Any>, &x10::lang::PlaceLocalHandle<TPMGL(T)>::_itable_0), x10aux::itable_entry(NULL, (void*)x10aux::getRTT<x10::lang::PlaceLocalHandle<TPMGL(T)> >())};
template<class TPMGL(T)> x10aux::itable_entry x10::lang::PlaceLocalHandle<TPMGL(T)>::_iboxitables[2] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::Any>, &x10::lang::PlaceLocalHandle_ibox0<TPMGL(T)>::itable), x10aux::itable_entry(NULL, (void*)x10aux::getRTT<x10::lang::PlaceLocalHandle<TPMGL(T)> >())};

//#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10FieldDecl_c

//#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(T)> void x10::lang::PlaceLocalHandle<TPMGL(T)>::_constructor(
                           x10::lang::PlaceLocalHandle_Impl<TPMGL(T)> id0) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10FieldAssign_c
    (*this)->FMGL(__NATIVE_FIELD__) = id0;
}
template<class TPMGL(T)> x10::lang::PlaceLocalHandle<TPMGL(T)> x10::lang::PlaceLocalHandle<TPMGL(T)>::_make(
                           x10::lang::PlaceLocalHandle_Impl<TPMGL(T)> id0)
{
    x10::lang::PlaceLocalHandle<TPMGL(T)> this_; 
    this_->_constructor(id0);
    return this_;
}



//#line 39 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(T)> void x10::lang::PlaceLocalHandle<TPMGL(T)>::_constructor(
                           ) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10FieldAssign_c
    (*this)->FMGL(__NATIVE_FIELD__) = x10::lang::PlaceLocalHandle_Impl<TPMGL(T)>::_make();
}
template<class TPMGL(T)> x10::lang::PlaceLocalHandle<TPMGL(T)> x10::lang::PlaceLocalHandle<TPMGL(T)>::_make(
                           ) {
    x10::lang::PlaceLocalHandle<TPMGL(T)> this_; 
    this_->_constructor();
    return this_;
}



//#line 44 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::lang::PlaceLocalHandle<TPMGL(T)>::__apply(
  ) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
    return (*this)->FMGL(__NATIVE_FIELD__)->x10::lang::PlaceLocalHandle_Impl<TPMGL(T)>::__apply();
    
}

//#line 47 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> void x10::lang::PlaceLocalHandle<TPMGL(T)>::set(
  TPMGL(T) newVal) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
    (*this)->FMGL(__NATIVE_FIELD__)->x10::lang::PlaceLocalHandle_Impl<TPMGL(T)>::set(
      newVal);
}

//#line 49 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_int x10::lang::PlaceLocalHandle<TPMGL(T)>::hashCode(
  ) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
    return (*this)->FMGL(__NATIVE_FIELD__)->x10::lang::PlaceLocalHandle_Impl<TPMGL(T)>::hashCode();
    
}

//#line 51 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::lang::String> x10::lang::PlaceLocalHandle<TPMGL(T)>::toString(
  ) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
    return (*this)->FMGL(__NATIVE_FIELD__)->x10::lang::PlaceLocalHandle_Impl<TPMGL(T)>::toString();
    
}

//#line 64 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c

//#line 85 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c

//#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::lang::String> x10::lang::PlaceLocalHandle<TPMGL(T)>::typeName(
  ) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
    return x10aux::type_name((*this)->FMGL(__NATIVE_FIELD__));
    
}

//#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_boolean x10::lang::PlaceLocalHandle<TPMGL(T)>::equals(
  x10aux::ref<x10::lang::Any> other) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
    if (!(x10aux::instanceof<x10::lang::PlaceLocalHandle<TPMGL(T)> >(other)))
    {
        
        //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
        return false;
        
    }
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
    return (*this)->x10::lang::PlaceLocalHandle<TPMGL(T)>::equals(
             x10aux::class_cast<x10::lang::PlaceLocalHandle<TPMGL(T)> >(other));
    
}

//#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_boolean x10::lang::PlaceLocalHandle<TPMGL(T)>::equals(
  x10::lang::PlaceLocalHandle<TPMGL(T)> other) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
    return true;
    
}

//#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_boolean x10::lang::PlaceLocalHandle<TPMGL(T)>::_struct_equals(
  x10aux::ref<x10::lang::Any> other) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
    if (!(x10aux::instanceof<x10::lang::PlaceLocalHandle<TPMGL(T)> >(other)))
    {
        
        //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
        return false;
        
    }
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
    return (*this)->x10::lang::PlaceLocalHandle<TPMGL(T)>::_struct_equals(
             x10aux::class_cast<x10::lang::PlaceLocalHandle<TPMGL(T)> >(other));
    
}

//#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_boolean x10::lang::PlaceLocalHandle<TPMGL(T)>::_struct_equals(
  x10::lang::PlaceLocalHandle<TPMGL(T)> other) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
    return true;
    
}

//#line 34 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10::lang::PlaceLocalHandle<TPMGL(T)>
  x10::lang::PlaceLocalHandle<TPMGL(T)>::x10__lang__PlaceLocalHandle____x10__lang__PlaceLocalHandle__this(
  ) {
    
    //#line 34 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
    return (*this);
    
}
template<class TPMGL(T)> void x10::lang::PlaceLocalHandle<TPMGL(T)>::_serialize(x10::lang::PlaceLocalHandle<TPMGL(T)> this_, x10aux::serialization_buffer& buf) {
    buf.write(this_->FMGL(__NATIVE_FIELD__));
    
}

template<class TPMGL(T)> void x10::lang::PlaceLocalHandle<TPMGL(T)>::_deserialize_body(x10aux::deserialization_buffer& buf) {
    FMGL(__NATIVE_FIELD__) = buf.read<x10::lang::PlaceLocalHandle_Impl<TPMGL(T)> >();
}


template<class TPMGL(T)> x10aux::RuntimeType x10::lang::PlaceLocalHandle<TPMGL(T)>::rtt;
template<class TPMGL(T)> void x10::lang::PlaceLocalHandle<TPMGL(T)>::_initRTT() {
    const x10aux::RuntimeType *canonical = x10aux::getRTT<x10::lang::PlaceLocalHandle<void> >();
    if (rtt.initStageOne(canonical)) return;
    const x10aux::RuntimeType* parents[2] = { x10aux::getRTT<x10::lang::Any>(), x10aux::getRTT<x10::lang::Any>()};
    const x10aux::RuntimeType* params[1] = { x10aux::getRTT<TPMGL(T)>()};
    x10aux::RuntimeType::Variance variances[1] = { x10aux::RuntimeType::invariant};
    const char *baseName = "x10.lang.PlaceLocalHandle";
    rtt.initStageTwo(baseName, x10aux::RuntimeType::struct_kind, 2, parents, 1, params, variances);
}
template<class TPMGL(T)> x10::lang::PlaceLocalHandle<TPMGL(T)>
  x10::lang::PlaceLocalHandle<void>::make(x10aux::ref<x10::array::Dist> dist,
                                          x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > init)
{
    
    //#line 65 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10LocalDecl_c
    x10::lang::PlaceLocalHandle<TPMGL(T)> handle = x10::lang::Runtime::template evalAt<x10::lang::PlaceLocalHandle<TPMGL(T)> >(
                                                     x10::lang::Place::
                                                       FMGL(FIRST_PLACE__get)(),
                                                     x10aux::ref<x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> > >(x10aux::ref<x10_lang_PlaceLocalHandle__closure__1<TPMGL(T) > >(new (x10aux::alloc<x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> > >(sizeof(x10_lang_PlaceLocalHandle__closure__1<TPMGL(T)>)))x10_lang_PlaceLocalHandle__closure__1<TPMGL(T)>())));
    {
        
        //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var6 =
          x10::lang::Runtime::startFinish();
        {
            
            //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable44649 =
              X10_NULL;
            
            //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.Try_c
            try {
                
                //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.For_c
                        {
                            x10aux::ref<x10::lang::Iterator<x10::lang::Place> > p44633;
                            for (
                                 //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10LocalDecl_c
                                 p44633 = x10aux::nullCheck(x10aux::nullCheck(dist)->places())->iterator();
                                 x10::lang::Iterator<x10::lang::Place>::hasNext(x10aux::nullCheck(p44633));
                                 ) {
                                
                                //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10LocalDecl_c
                                x10::lang::Place p = x10::lang::Iterator<x10::lang::Place>::next(x10aux::nullCheck(p44633));
                                
                                //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
                                x10::lang::Runtime::runAsync(
                                  p, x10aux::ref<x10::lang::VoidFun_0_0>(x10aux::ref<x10_lang_PlaceLocalHandle__closure__2<TPMGL(T) > >(new (x10aux::alloc<x10::lang::VoidFun_0_0>(sizeof(x10_lang_PlaceLocalHandle__closure__2<TPMGL(T)>)))x10_lang_PlaceLocalHandle__closure__2<TPMGL(T)>(handle, init))));
                            }
                        }
                        
                    }
                }
                catch (x10aux::__ref& __ref__1397) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__1397 = (x10aux::ref<x10::lang::Throwable>&)__ref__1397;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__6__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1397);
                        {
                            
                            //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__6__);
                            
                            //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__1398) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__1398 = (x10aux::ref<x10::lang::Throwable>&)__ref__1398;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal44650 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1398);
                    {
                        
                        //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable44649 = formal44650;
                    }
                } else
                throw;
            }
            
            //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable44649)))
            {
                
                //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable44649))
                {
                    
                    //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable44649));
                }
                
            }
            
            //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var6);
            }
            
            //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable44649)))
            {
                
                //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable44649)))
                {
                    
                    //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable44649));
                }
                
            }
            
        }
    }
    
    //#line 69 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
    return handle;
    
}
template<class TPMGL(T)> x10::lang::PlaceLocalHandle<TPMGL(T)>
  x10::lang::PlaceLocalHandle<void>::makeFlat(x10aux::ref<x10::array::Dist> dist,
                                              x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> > init)
{
    
    //#line 86 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10LocalDecl_c
    x10::lang::PlaceLocalHandle<TPMGL(T)> handle = x10::lang::Runtime::template evalAt<x10::lang::PlaceLocalHandle<TPMGL(T)> >(
                                                     x10::lang::Place::
                                                       FMGL(FIRST_PLACE__get)(),
                                                     x10aux::ref<x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> > >(x10aux::ref<x10_lang_PlaceLocalHandle__closure__3<TPMGL(T) > >(new (x10aux::alloc<x10::lang::Fun_0_0<x10::lang::PlaceLocalHandle<TPMGL(T)> > >(sizeof(x10_lang_PlaceLocalHandle__closure__3<TPMGL(T)>)))x10_lang_PlaceLocalHandle__closure__3<TPMGL(T)>())));
    
    //#line 87 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::array::PlaceGroup> pg = x10aux::nullCheck(dist)->places();
    {
        
        //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var7 =
          x10::lang::Runtime::startFinish(x10::compiler::Pragma::
                                            FMGL(FINISH_SPMD__get)());
        {
            
            //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable44652 =
              X10_NULL;
            
            //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.Try_c
            try {
                
                //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.For_c
                        {
                            x10aux::ref<x10::lang::Iterator<x10::lang::Place> > p44635;
                            for (
                                 //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10LocalDecl_c
                                 p44635 = x10aux::nullCheck(pg)->iterator();
                                 x10::lang::Iterator<x10::lang::Place>::hasNext(x10aux::nullCheck(p44635));
                                 ) {
                                
                                //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10LocalDecl_c
                                x10::lang::Place p = x10::lang::Iterator<x10::lang::Place>::next(x10aux::nullCheck(p44635));
                                
                                //#line 89 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
                                x10::lang::Runtime::runAsync(
                                  p, x10aux::ref<x10::lang::VoidFun_0_0>(x10aux::ref<x10_lang_PlaceLocalHandle__closure__4<TPMGL(T) > >(new (x10aux::alloc<x10::lang::VoidFun_0_0>(sizeof(x10_lang_PlaceLocalHandle__closure__4<TPMGL(T)>)))x10_lang_PlaceLocalHandle__closure__4<TPMGL(T)>(handle, init))));
                            }
                        }
                        
                    }
                }
                catch (x10aux::__ref& __ref__1399) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__1399 = (x10aux::ref<x10::lang::Throwable>&)__ref__1399;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__7__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1399);
                        {
                            
                            //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__7__);
                            
                            //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__1400) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__1400 = (x10aux::ref<x10::lang::Throwable>&)__ref__1400;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal44653 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1400);
                    {
                        
                        //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable44652 = formal44653;
                    }
                } else
                throw;
            }
            
            //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable44652)))
            {
                
                //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable44652))
                {
                    
                    //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable44652));
                }
                
            }
            
            //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var7);
            }
            
            //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable44652)))
            {
                
                //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable44652)))
                {
                    
                    //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable44652));
                }
                
            }
            
        }
    }
    
    //#line 91 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/PlaceLocalHandle.x10": x10.ast.X10Return_c
    return handle;
    
}
#endif // X10_LANG_PLACELOCALHANDLE_H_IMPLEMENTATION
#endif // __X10_LANG_PLACELOCALHANDLE_H_NODEPS
