#ifndef __X10_ARRAY_DISTARRAY_H
#define __X10_ARRAY_DISTARRAY_H

#include <x10rt.h>


#define X10_LANG_OBJECT_H_NODEPS
#include <x10/lang/Object.h>
#undef X10_LANG_OBJECT_H_NODEPS
#define X10_LANG_FUN_0_1_H_NODEPS
#include <x10/lang/Fun_0_1.h>
#undef X10_LANG_FUN_0_1_H_NODEPS
namespace x10 { namespace array { 
class Point;
} } 
#define X10_LANG_ITERABLE_H_NODEPS
#include <x10/lang/Iterable.h>
#undef X10_LANG_ITERABLE_H_NODEPS
#define X10_LANG_PLACELOCALHANDLE_H_NODEPS
#include <x10/lang/PlaceLocalHandle.h>
#undef X10_LANG_PLACELOCALHANDLE_H_NODEPS
#define X10_LANG_BOOLEAN_H_NODEPS
#include <x10/lang/Boolean.h>
#undef X10_LANG_BOOLEAN_H_NODEPS
#define X10_UTIL_INDEXEDMEMORYCHUNK_H_NODEPS
#include <x10/util/IndexedMemoryChunk.h>
#undef X10_UTIL_INDEXEDMEMORYCHUNK_H_NODEPS
namespace x10 { namespace array { 
class Dist;
} } 
namespace x10 { namespace array { 
class Region;
} } 
namespace x10 { namespace lang { 
class Int;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(T)> class PlaceLocalHandle;
} } 
namespace x10 { namespace array { 
template<class TPMGL(T34106)> class DistArray__LocalState;
} } 
namespace x10 { namespace lang { 
class Boolean;
} } 
namespace x10 { namespace util { 
template<class TPMGL(T)> class IndexedMemoryChunk;
} } 
namespace x10 { namespace util { namespace concurrent { 
class Fences;
} } } 
namespace x10 { namespace array { 
template<class TPMGL(T)> class Array;
} } 
namespace x10 { namespace lang { 
class Runtime;
} } 
namespace x10 { namespace lang { 
class UnsupportedOperationException;
} } 
namespace x10 { namespace lang { 
class String;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(U)> class Fun_0_0;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(T)> class Iterator;
} } 
namespace x10 { namespace compiler { 
class CompilerFlags;
} } 
namespace x10 { namespace lang { 
class FailedDynamicCheckException;
} } 
namespace x10 { namespace lang { 
class Place;
} } 
namespace x10 { namespace lang { 
class FinishState;
} } 
namespace x10 { namespace lang { 
class Throwable;
} } 
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 lang { 
template<class TPMGL(Z1), class TPMGL(Z2), class TPMGL(U)> class Fun_0_2;
} } 
namespace x10 { namespace array { 
template<class TPMGL(U), class TPMGL(T34107)> class DistArray__Anonymous__27239;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(T)> class Reducible;
} } 
namespace x10 { namespace lang { 
class Zero;
} } 
namespace x10 { namespace array { 

template<class TPMGL(T)> class DistArray;
template <> class DistArray<void>;
template<class TPMGL(T)> class DistArray : public x10::lang::Object   {
    public:
    RTT_H_DECLS_CLASS
    
    x10aux::ref<x10::array::Dist> FMGL(dist);
    
    static x10aux::itable_entry _itables[4];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    static typename x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)>::template itable<x10::array::DistArray<TPMGL(T)> > _itable_0;
    
    static x10::lang::Any::itable<x10::array::DistArray<TPMGL(T)> > _itable_1;
    
    static typename x10::lang::Iterable<x10aux::ref<x10::array::Point> >::template itable<x10::array::DistArray<TPMGL(T)> > _itable_2;
    
    x10aux::ref<x10::array::Region> region();
    x10_int rank();
    x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > >
      FMGL(localHandle);
    
    x10_boolean FMGL(cachedRawValid);
    
    x10::util::IndexedMemoryChunk<TPMGL(T) > FMGL(cachedRaw);
    
    virtual x10::util::IndexedMemoryChunk<TPMGL(T) > raw();
    virtual x10aux::ref<x10::array::Array<TPMGL(T)> > getLocalPortion(
      );
    void _constructor(x10aux::ref<x10::array::Dist> dist);
    
    static x10aux::ref<x10::array::DistArray<TPMGL(T)> > _make(x10aux::ref<x10::array::Dist> dist);
    
    void _constructor(x10aux::ref<x10::array::Dist> dist, x10aux::ref<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> > init);
    
    static x10aux::ref<x10::array::DistArray<TPMGL(T)> > _make(x10aux::ref<x10::array::Dist> dist,
                                                               x10aux::ref<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> > init);
    
    void _constructor(x10aux::ref<x10::array::Dist> dist,
                      TPMGL(T) init);
    
    static x10aux::ref<x10::array::DistArray<TPMGL(T)> > _make(
             x10aux::ref<x10::array::Dist> dist, TPMGL(T) init);
    
    void _constructor(x10aux::ref<x10::array::DistArray<TPMGL(T)> > a,
                      x10aux::ref<x10::array::Dist> d);
    
    static x10aux::ref<x10::array::DistArray<TPMGL(T)> > _make(
             x10aux::ref<x10::array::DistArray<TPMGL(T)> > a,
             x10aux::ref<x10::array::Dist> d);
    
    void _constructor(x10aux::ref<x10::array::Dist> d, x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > pls);
    
    static x10aux::ref<x10::array::DistArray<TPMGL(T)> > _make(
             x10aux::ref<x10::array::Dist> d, x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > pls);
    
    virtual TPMGL(T) __apply(x10aux::ref<x10::array::Point> pt);
    virtual TPMGL(T) __apply(x10_int i0);
    virtual TPMGL(T) __apply(x10_int i0, x10_int i1);
    virtual TPMGL(T) __apply(x10_int i0, x10_int i1, x10_int i2);
    virtual TPMGL(T) __apply(x10_int i0, x10_int i1, x10_int i2,
                             x10_int i3);
    virtual TPMGL(T) __set(x10aux::ref<x10::array::Point> pt,
                           TPMGL(T) v);
    virtual TPMGL(T) __set(x10_int i0, TPMGL(T) v);
    virtual TPMGL(T) __set(x10_int i0, x10_int i1, TPMGL(T) v);
    virtual TPMGL(T) __set(x10_int i0, x10_int i1, x10_int i2,
                           TPMGL(T) v);
    virtual TPMGL(T) __set(x10_int i0, x10_int i1, x10_int i2,
                           x10_int i3, TPMGL(T) v);
    virtual x10aux::ref<x10::array::DistArray<TPMGL(T)> >
      restriction(x10aux::ref<x10::array::Dist> d);
    virtual x10aux::ref<x10::array::DistArray<TPMGL(T)> >
      restriction(x10aux::ref<x10::array::Region> r);
    virtual x10aux::ref<x10::array::DistArray<TPMGL(T)> >
      restriction(x10::lang::Place p);
    virtual x10aux::ref<x10::array::DistArray<TPMGL(T)> >
      __bar(x10aux::ref<x10::array::Region> r);
    virtual x10aux::ref<x10::array::DistArray<TPMGL(T)> >
      __bar(x10::lang::Place p);
    virtual void fill(TPMGL(T) v);
    template<class TPMGL(U)> x10aux::ref<x10::array::DistArray<TPMGL(U)> >
      map(x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op);
    template<class TPMGL(U)> x10aux::ref<x10::array::DistArray<TPMGL(U)> >
      map(x10aux::ref<x10::array::DistArray<TPMGL(U)> > dst,
          x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op);
    template<class TPMGL(U)> x10aux::ref<x10::array::DistArray<TPMGL(U)> >
      map(x10aux::ref<x10::array::DistArray<TPMGL(U)> > dst,
          x10aux::ref<x10::array::Region> filter, x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op);
    template<class TPMGL(S), class TPMGL(U)> x10aux::ref<x10::array::DistArray<TPMGL(S)> >
      map(x10aux::ref<x10::array::DistArray<TPMGL(U)> > src,
          x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op);
    template<class TPMGL(S), class TPMGL(U)> x10aux::ref<x10::array::DistArray<TPMGL(S)> >
      map(x10aux::ref<x10::array::DistArray<TPMGL(S)> > dst,
          x10aux::ref<x10::array::DistArray<TPMGL(U)> > src,
          x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op);
    template<class TPMGL(S), class TPMGL(U)> x10aux::ref<x10::array::DistArray<TPMGL(S)> >
      map(x10aux::ref<x10::array::DistArray<TPMGL(S)> > dst,
          x10aux::ref<x10::array::DistArray<TPMGL(U)> > src,
          x10aux::ref<x10::array::Region> filter, x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op);
    virtual TPMGL(T) reduce(x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(T), TPMGL(T)> > op,
                            TPMGL(T) unit);
    template<class TPMGL(U)> TPMGL(U) reduce(x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(T), TPMGL(U)> > lop,
                                             x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(U), TPMGL(U)> > gop,
                                             TPMGL(U) unit);
    virtual x10aux::ref<x10::lang::String> toString();
    virtual x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > >
      iterator();
    virtual x10aux::ref<x10::array::DistArray<TPMGL(T)> >
      x10__array__DistArray____x10__array__DistArray__this(
      );
    void __fieldInitializers33980();
    
    // Serialization
    public: static const x10aux::serialization_id_t _serialization_id;
    
    public: 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 DistArray<void> : public x10::lang::Object
{
    public:
    static x10aux::RuntimeType rtt;
    static const x10aux::RuntimeType* getRTT() { return & rtt; }
    template<class TPMGL(T)> static x10aux::ref<x10::array::DistArray<TPMGL(T)> >
      make(x10aux::ref<x10::array::Dist> dist);
    
    template<class TPMGL(T)> static x10aux::ref<x10::array::DistArray<TPMGL(T)> >
      make(x10aux::ref<x10::array::Dist> dist, x10aux::ref<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> > init);
    
    template<class TPMGL(T)> static x10aux::ref<x10::array::DistArray<TPMGL(T)> >
      make(x10aux::ref<x10::array::Dist> dist, TPMGL(T) init);
    
    
};

} } 
#endif // X10_ARRAY_DISTARRAY_H

namespace x10 { namespace array { 
template<class TPMGL(T)> class DistArray;
} } 

#ifndef X10_ARRAY_DISTARRAY_H_NODEPS
#define X10_ARRAY_DISTARRAY_H_NODEPS
#include <x10/lang/Object.h>
#include <x10/lang/Fun_0_1.h>
#include <x10/array/Point.h>
#include <x10/lang/Iterable.h>
#include <x10/array/Dist.h>
#include <x10/array/Region.h>
#include <x10/lang/Int.h>
#include <x10/lang/PlaceLocalHandle.h>
#include <x10/array/DistArray__LocalState.h>
#include <x10/lang/Boolean.h>
#include <x10/util/IndexedMemoryChunk.h>
#include <x10/util/concurrent/Fences.h>
#include <x10/array/Array.h>
#include <x10/lang/Runtime.h>
#include <x10/lang/UnsupportedOperationException.h>
#include <x10/lang/String.h>
#include <x10/lang/Fun_0_0.h>
#include <x10/lang/Iterator.h>
#include <x10/compiler/CompilerFlags.h>
#include <x10/lang/FailedDynamicCheckException.h>
#include <x10/lang/Place.h>
#include <x10/lang/FinishState.h>
#include <x10/lang/Throwable.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/lang/Fun_0_2.h>
#include <x10/array/DistArray__Anonymous__27239.h>
#include <x10/lang/Reducible.h>
#include <x10/lang/Zero.h>
#ifndef X10_ARRAY_DISTARRAY__CLOSURE__6_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__6_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_0.h>
template<class TPMGL(T), class TPMGL(U)> class x10_array_DistArray__closure__6 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(U)> > >::template itable <x10_array_DistArray__closure__6<TPMGL(T),TPMGL(U) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10aux::ref<x10::array::DistArray__LocalState<TPMGL(U)> > __apply() {
        
        //#line 505 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(T) > srcImc = saved_this->x10::array::DistArray<TPMGL(T)>::raw();
        
        //#line 506 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(U) > newImc = x10::util::IndexedMemoryChunk<void>::allocate<TPMGL(U) >(((x10_int) ((x10aux::nullCheck(saved_this->
                                                                                                                                                    FMGL(dist))->maxOffset()) + (((x10_int)1)))), 8, false, false);
        
        //#line 507 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> reg = x10aux::nullCheck(saved_this->
                                                                  FMGL(dist))->get(
                                                x10::lang::Place::_make(x10aux::here));
        
        //#line 508 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
        {
            x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > > pt34117;
            for (
                 //#line 508 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 pt34117 = x10aux::nullCheck(reg)->iterator();
                 x10::lang::Iterator<x10aux::ref<x10::array::Point> >::hasNext(x10aux::nullCheck(pt34117));
                 ) {
                
                //#line 508 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10aux::ref<x10::array::Point> pt = x10::lang::Iterator<x10aux::ref<x10::array::Point> >::next(x10aux::nullCheck(pt34117));
                
                //#line 509 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10_int offset = x10aux::nullCheck(saved_this->
                                                     FMGL(dist))->offset(
                                   pt);
                
                //#line 510 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                (newImc)->__set(offset, x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)>::__apply(x10aux::nullCheck(op), 
                  (srcImc)->__apply(offset)));
            }
        }
        
        //#line 512 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
        return x10::array::DistArray__LocalState<TPMGL(U)>::_make(newImc);
        
    }
    
    // captured environment
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this;
    x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->saved_this);
        buf.write(this->op);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__6<TPMGL(T),TPMGL(U) >* storage = x10aux::alloc<x10_array_DistArray__closure__6<TPMGL(T),TPMGL(U) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__6<TPMGL(T),TPMGL(U) > >(storage));
        x10aux::ref<x10::array::DistArray<TPMGL(T)> > that_saved_this = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(T)> > >();
        x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > that_op = buf.read<x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > >();
        x10aux::ref<x10_array_DistArray__closure__6<TPMGL(T),TPMGL(U) > > this_ = new (storage) x10_array_DistArray__closure__6<TPMGL(T),TPMGL(U) >(that_saved_this, that_op);
        return this_;
    }
    
    x10_array_DistArray__closure__6(x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this, x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op) : saved_this(saved_this), op(op) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(U)> > > >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(U)> > > >(); }
    
    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/array/DistArray.x10:504-513";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__6_CLOSURE
#ifndef X10_ARRAY_DISTARRAY__CLOSURE__7_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__7_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/VoidFun_0_0.h>
template<class TPMGL(T), class TPMGL(U)> class x10_array_DistArray__closure__7 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::VoidFun_0_0::template itable <x10_array_DistArray__closure__7<TPMGL(T),TPMGL(U) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    void __apply() {
        
        //#line 531 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> reg = x10aux::nullCheck(saved_this->
                                                                  FMGL(dist))->get(
                                                x10::lang::Place::_make(x10aux::here));
        
        //#line 532 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(T) > srcImc = saved_this->x10::array::DistArray<TPMGL(T)>::raw();
        
        //#line 533 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(U) > dstImc = x10aux::nullCheck(dst)->x10::array::DistArray<TPMGL(U)>::raw();
        
        //#line 534 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
        {
            x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > > pt34119;
            for (
                 //#line 534 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 pt34119 = x10aux::nullCheck(reg)->iterator(); x10::lang::Iterator<x10aux::ref<x10::array::Point> >::hasNext(x10aux::nullCheck(pt34119));
                 ) {
                
                //#line 534 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10aux::ref<x10::array::Point> pt = x10::lang::Iterator<x10aux::ref<x10::array::Point> >::next(x10aux::nullCheck(pt34119));
                
                //#line 535 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10_int offset = x10aux::nullCheck(saved_this->
                                                     FMGL(dist))->offset(
                                   pt);
                
                //#line 536 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                (dstImc)->__set(offset, x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)>::__apply(x10aux::nullCheck(op), 
                  (srcImc)->__apply(offset)));
            }
        }
        
    }
    
    // captured environment
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this;
    x10aux::ref<x10::array::DistArray<TPMGL(U)> > dst;
    x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->saved_this);
        buf.write(this->dst);
        buf.write(this->op);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__7<TPMGL(T),TPMGL(U) >* storage = x10aux::alloc<x10_array_DistArray__closure__7<TPMGL(T),TPMGL(U) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__7<TPMGL(T),TPMGL(U) > >(storage));
        x10aux::ref<x10::array::DistArray<TPMGL(T)> > that_saved_this = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(T)> > >();
        x10aux::ref<x10::array::DistArray<TPMGL(U)> > that_dst = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(U)> > >();
        x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > that_op = buf.read<x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > >();
        x10aux::ref<x10_array_DistArray__closure__7<TPMGL(T),TPMGL(U) > > this_ = new (storage) x10_array_DistArray__closure__7<TPMGL(T),TPMGL(U) >(that_saved_this, that_dst, that_op);
        return this_;
    }
    
    x10_array_DistArray__closure__7(x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this, x10aux::ref<x10::array::DistArray<TPMGL(U)> > dst, x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op) : saved_this(saved_this), dst(dst), op(op) { }
    
    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/array/DistArray.x10:530-538";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__7_CLOSURE
#ifndef X10_ARRAY_DISTARRAY__CLOSURE__8_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__8_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/VoidFun_0_0.h>
template<class TPMGL(T), class TPMGL(U)> class x10_array_DistArray__closure__8 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::VoidFun_0_0::template itable <x10_array_DistArray__closure__8<TPMGL(T),TPMGL(U) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    void __apply() {
        
        //#line 560 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> reg = x10aux::nullCheck(saved_this->
                                                                  FMGL(dist))->get(
                                                x10::lang::Place::_make(x10aux::here));
        
        //#line 561 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> freg = x10aux::nullCheck(reg)->__and(
                                                 filter);
        
        //#line 562 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(T) > srcImc = saved_this->x10::array::DistArray<TPMGL(T)>::raw();
        
        //#line 563 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(U) > dstImc = x10aux::nullCheck(dst)->x10::array::DistArray<TPMGL(U)>::raw();
        
        //#line 564 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
        {
            x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > > pt34123;
            for (
                 //#line 564 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 pt34123 = x10aux::nullCheck(freg)->iterator(); x10::lang::Iterator<x10aux::ref<x10::array::Point> >::hasNext(x10aux::nullCheck(pt34123));
                 ) {
                
                //#line 564 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10aux::ref<x10::array::Point> pt = x10::lang::Iterator<x10aux::ref<x10::array::Point> >::next(x10aux::nullCheck(pt34123));
                
                //#line 565 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10_int offset = x10aux::nullCheck(saved_this->
                                                     FMGL(dist))->offset(
                                   pt);
                
                //#line 566 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                (dstImc)->__set(offset, x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)>::__apply(x10aux::nullCheck(op), 
                  (srcImc)->__apply(offset)));
            }
        }
        
    }
    
    // captured environment
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this;
    x10aux::ref<x10::array::Region> filter;
    x10aux::ref<x10::array::DistArray<TPMGL(U)> > dst;
    x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->saved_this);
        buf.write(this->filter);
        buf.write(this->dst);
        buf.write(this->op);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__8<TPMGL(T),TPMGL(U) >* storage = x10aux::alloc<x10_array_DistArray__closure__8<TPMGL(T),TPMGL(U) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__8<TPMGL(T),TPMGL(U) > >(storage));
        x10aux::ref<x10::array::DistArray<TPMGL(T)> > that_saved_this = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(T)> > >();
        x10aux::ref<x10::array::Region> that_filter = buf.read<x10aux::ref<x10::array::Region> >();
        x10aux::ref<x10::array::DistArray<TPMGL(U)> > that_dst = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(U)> > >();
        x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > that_op = buf.read<x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > >();
        x10aux::ref<x10_array_DistArray__closure__8<TPMGL(T),TPMGL(U) > > this_ = new (storage) x10_array_DistArray__closure__8<TPMGL(T),TPMGL(U) >(that_saved_this, that_filter, that_dst, that_op);
        return this_;
    }
    
    x10_array_DistArray__closure__8(x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this, x10aux::ref<x10::array::Region> filter, x10aux::ref<x10::array::DistArray<TPMGL(U)> > dst, x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op) : saved_this(saved_this), filter(filter), dst(dst), op(op) { }
    
    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/array/DistArray.x10:559-568";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__8_CLOSURE
#ifndef X10_ARRAY_DISTARRAY__CLOSURE__9_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__9_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_0.h>
template<class TPMGL(T), class TPMGL(S), class TPMGL(U)> class x10_array_DistArray__closure__9 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(S)> > >::template itable <x10_array_DistArray__closure__9<TPMGL(T),TPMGL(S),TPMGL(U) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10aux::ref<x10::array::DistArray__LocalState<TPMGL(S)> > __apply() {
        
        //#line 586 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(T) > src1Imc = saved_this->x10::array::DistArray<TPMGL(T)>::raw();
        
        //#line 587 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(U) > src2Imc = x10aux::nullCheck(src)->x10::array::DistArray<TPMGL(U)>::raw();
        
        //#line 588 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(S) > newImc = x10::util::IndexedMemoryChunk<void>::allocate<TPMGL(S) >(((x10_int) ((x10aux::nullCheck(saved_this->
                                                                                                                                                    FMGL(dist))->maxOffset()) + (((x10_int)1)))), 8, false, false);
        
        //#line 589 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> reg = x10aux::nullCheck(saved_this->
                                                                  FMGL(dist))->get(
                                                x10::lang::Place::_make(x10aux::here));
        
        //#line 590 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
        {
            x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > > pt34127;
            for (
                 //#line 590 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 pt34127 = x10aux::nullCheck(reg)->iterator();
                 x10::lang::Iterator<x10aux::ref<x10::array::Point> >::hasNext(x10aux::nullCheck(pt34127));
                 ) {
                
                //#line 590 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10aux::ref<x10::array::Point> pt = x10::lang::Iterator<x10aux::ref<x10::array::Point> >::next(x10aux::nullCheck(pt34127));
                
                //#line 591 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10_int offset = x10aux::nullCheck(saved_this->
                                                     FMGL(dist))->offset(
                                   pt);
                
                //#line 592 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                (newImc)->__set(offset, x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)>::__apply(x10aux::nullCheck(op), 
                  (src1Imc)->__apply(offset), (src2Imc)->__apply(offset)));
            }
        }
        
        //#line 594 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
        return x10::array::DistArray__LocalState<TPMGL(S)>::_make(newImc);
        
    }
    
    // captured environment
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this;
    x10aux::ref<x10::array::DistArray<TPMGL(U)> > src;
    x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->saved_this);
        buf.write(this->src);
        buf.write(this->op);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__9<TPMGL(T),TPMGL(S),TPMGL(U) >* storage = x10aux::alloc<x10_array_DistArray__closure__9<TPMGL(T),TPMGL(S),TPMGL(U) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__9<TPMGL(T),TPMGL(S),TPMGL(U) > >(storage));
        x10aux::ref<x10::array::DistArray<TPMGL(T)> > that_saved_this = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(T)> > >();
        x10aux::ref<x10::array::DistArray<TPMGL(U)> > that_src = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(U)> > >();
        x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > that_op = buf.read<x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > >();
        x10aux::ref<x10_array_DistArray__closure__9<TPMGL(T),TPMGL(S),TPMGL(U) > > this_ = new (storage) x10_array_DistArray__closure__9<TPMGL(T),TPMGL(S),TPMGL(U) >(that_saved_this, that_src, that_op);
        return this_;
    }
    
    x10_array_DistArray__closure__9(x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this, x10aux::ref<x10::array::DistArray<TPMGL(U)> > src, x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op) : saved_this(saved_this), src(src), op(op) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(S)> > > >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(S)> > > >(); }
    
    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/array/DistArray.x10:585-595";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__9_CLOSURE
#ifndef X10_ARRAY_DISTARRAY__CLOSURE__10_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__10_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/VoidFun_0_0.h>
template<class TPMGL(T), class TPMGL(S), class TPMGL(U)> class x10_array_DistArray__closure__10 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::VoidFun_0_0::template itable <x10_array_DistArray__closure__10<TPMGL(T),TPMGL(S),TPMGL(U) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    void __apply() {
        
        //#line 614 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> reg = x10aux::nullCheck(saved_this->
                                                                  FMGL(dist))->get(
                                                x10::lang::Place::_make(x10aux::here));
        
        //#line 615 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(T) > src1Imc = saved_this->x10::array::DistArray<TPMGL(T)>::raw();
        
        //#line 616 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(U) > src2Imc = x10aux::nullCheck(src)->x10::array::DistArray<TPMGL(U)>::raw();
        
        //#line 617 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(S) > dstImc = x10aux::nullCheck(dst)->x10::array::DistArray<TPMGL(S)>::raw();
        
        //#line 618 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
        {
            x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > > pt34129;
            for (
                 //#line 618 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 pt34129 = x10aux::nullCheck(reg)->iterator(); x10::lang::Iterator<x10aux::ref<x10::array::Point> >::hasNext(x10aux::nullCheck(pt34129));
                 ) {
                
                //#line 618 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10aux::ref<x10::array::Point> pt = x10::lang::Iterator<x10aux::ref<x10::array::Point> >::next(x10aux::nullCheck(pt34129));
                
                //#line 619 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10_int offset = x10aux::nullCheck(saved_this->
                                                     FMGL(dist))->offset(
                                   pt);
                
                //#line 620 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                (dstImc)->__set(offset, x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)>::__apply(x10aux::nullCheck(op), 
                  (src1Imc)->__apply(offset), (src2Imc)->__apply(offset)));
            }
        }
        
    }
    
    // captured environment
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this;
    x10aux::ref<x10::array::DistArray<TPMGL(U)> > src;
    x10aux::ref<x10::array::DistArray<TPMGL(S)> > dst;
    x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->saved_this);
        buf.write(this->src);
        buf.write(this->dst);
        buf.write(this->op);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__10<TPMGL(T),TPMGL(S),TPMGL(U) >* storage = x10aux::alloc<x10_array_DistArray__closure__10<TPMGL(T),TPMGL(S),TPMGL(U) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__10<TPMGL(T),TPMGL(S),TPMGL(U) > >(storage));
        x10aux::ref<x10::array::DistArray<TPMGL(T)> > that_saved_this = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(T)> > >();
        x10aux::ref<x10::array::DistArray<TPMGL(U)> > that_src = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(U)> > >();
        x10aux::ref<x10::array::DistArray<TPMGL(S)> > that_dst = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(S)> > >();
        x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > that_op = buf.read<x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > >();
        x10aux::ref<x10_array_DistArray__closure__10<TPMGL(T),TPMGL(S),TPMGL(U) > > this_ = new (storage) x10_array_DistArray__closure__10<TPMGL(T),TPMGL(S),TPMGL(U) >(that_saved_this, that_src, that_dst, that_op);
        return this_;
    }
    
    x10_array_DistArray__closure__10(x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this, x10aux::ref<x10::array::DistArray<TPMGL(U)> > src, x10aux::ref<x10::array::DistArray<TPMGL(S)> > dst, x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op) : saved_this(saved_this), src(src), dst(dst), op(op) { }
    
    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/array/DistArray.x10:613-622";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__10_CLOSURE
#ifndef X10_ARRAY_DISTARRAY__CLOSURE__11_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__11_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/VoidFun_0_0.h>
template<class TPMGL(T), class TPMGL(S), class TPMGL(U)> class x10_array_DistArray__closure__11 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::VoidFun_0_0::template itable <x10_array_DistArray__closure__11<TPMGL(T),TPMGL(S),TPMGL(U) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    void __apply() {
        
        //#line 644 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> reg = x10aux::nullCheck(saved_this->
                                                                  FMGL(dist))->get(
                                                x10::lang::Place::_make(x10aux::here));
        
        //#line 645 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> freg = x10aux::nullCheck(reg)->__and(
                                                 filter);
        
        //#line 646 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(T) > src1Imc = saved_this->x10::array::DistArray<TPMGL(T)>::raw();
        
        //#line 647 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(U) > src2Imc = x10aux::nullCheck(src)->x10::array::DistArray<TPMGL(U)>::raw();
        
        //#line 648 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(S) > dstImc = x10aux::nullCheck(dst)->x10::array::DistArray<TPMGL(S)>::raw();
        
        //#line 649 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
        {
            x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > > pt34133;
            for (
                 //#line 649 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 pt34133 = x10aux::nullCheck(freg)->iterator(); x10::lang::Iterator<x10aux::ref<x10::array::Point> >::hasNext(x10aux::nullCheck(pt34133));
                 ) {
                
                //#line 649 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10aux::ref<x10::array::Point> pt = x10::lang::Iterator<x10aux::ref<x10::array::Point> >::next(x10aux::nullCheck(pt34133));
                
                //#line 650 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10_int offset = x10aux::nullCheck(saved_this->
                                                     FMGL(dist))->offset(
                                   pt);
                
                //#line 651 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                (dstImc)->__set(offset, x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)>::__apply(x10aux::nullCheck(op), 
                  (src1Imc)->__apply(offset), (src2Imc)->__apply(offset)));
            }
        }
        
    }
    
    // captured environment
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this;
    x10aux::ref<x10::array::Region> filter;
    x10aux::ref<x10::array::DistArray<TPMGL(U)> > src;
    x10aux::ref<x10::array::DistArray<TPMGL(S)> > dst;
    x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->saved_this);
        buf.write(this->filter);
        buf.write(this->src);
        buf.write(this->dst);
        buf.write(this->op);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__11<TPMGL(T),TPMGL(S),TPMGL(U) >* storage = x10aux::alloc<x10_array_DistArray__closure__11<TPMGL(T),TPMGL(S),TPMGL(U) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__11<TPMGL(T),TPMGL(S),TPMGL(U) > >(storage));
        x10aux::ref<x10::array::DistArray<TPMGL(T)> > that_saved_this = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(T)> > >();
        x10aux::ref<x10::array::Region> that_filter = buf.read<x10aux::ref<x10::array::Region> >();
        x10aux::ref<x10::array::DistArray<TPMGL(U)> > that_src = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(U)> > >();
        x10aux::ref<x10::array::DistArray<TPMGL(S)> > that_dst = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(S)> > >();
        x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > that_op = buf.read<x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > >();
        x10aux::ref<x10_array_DistArray__closure__11<TPMGL(T),TPMGL(S),TPMGL(U) > > this_ = new (storage) x10_array_DistArray__closure__11<TPMGL(T),TPMGL(S),TPMGL(U) >(that_saved_this, that_filter, that_src, that_dst, that_op);
        return this_;
    }
    
    x10_array_DistArray__closure__11(x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this, x10aux::ref<x10::array::Region> filter, x10aux::ref<x10::array::DistArray<TPMGL(U)> > src, x10aux::ref<x10::array::DistArray<TPMGL(S)> > dst, x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op) : saved_this(saved_this), filter(filter), src(src), dst(dst), op(op) { }
    
    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/array/DistArray.x10:643-653";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__11_CLOSURE
#ifndef X10_ARRAY_DISTARRAY__CLOSURE__12_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__12_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/VoidFun_0_0.h>
template<class TPMGL(T), class TPMGL(U)> class x10_array_DistArray__closure__12 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::VoidFun_0_0::template itable <x10_array_DistArray__closure__12<TPMGL(T),TPMGL(U) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    void __apply() {
        
        //#line 694 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> reg = x10aux::nullCheck(saved_this->
                                                                  FMGL(dist))->get(
                                                x10::lang::Place::_make(x10aux::here));
        
        //#line 695 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        TPMGL(U) localRes = unit;
        
        //#line 696 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(T) > imc = saved_this->x10::array::DistArray<TPMGL(T)>::raw();
        
        //#line 697 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
        {
            x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > > pt34137;
            for (
                 //#line 697 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 pt34137 = x10aux::nullCheck(reg)->iterator(); x10::lang::Iterator<x10aux::ref<x10::array::Point> >::hasNext(x10aux::nullCheck(pt34137));
                 ) {
                
                //#line 697 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10aux::ref<x10::array::Point> pt = x10::lang::Iterator<x10aux::ref<x10::array::Point> >::next(x10aux::nullCheck(pt34137));
                
                //#line 698 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10LocalAssign_c
                localRes = x10::lang::Fun_0_2<TPMGL(U), TPMGL(T), TPMGL(U)>::__apply(x10aux::nullCheck(lop), 
                  localRes, (imc)->__apply(x10aux::nullCheck(saved_this->
                                                               FMGL(dist))->offset(
                                             pt)));
            }
        }
        
        //#line 700 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::template makeOffer<TPMGL(U) >(
          localRes);
    }
    
    // captured environment
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this;
    TPMGL(U) unit;
    x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(T), TPMGL(U)> > lop;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->saved_this);
        buf.write(this->unit);
        buf.write(this->lop);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__12<TPMGL(T),TPMGL(U) >* storage = x10aux::alloc<x10_array_DistArray__closure__12<TPMGL(T),TPMGL(U) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__12<TPMGL(T),TPMGL(U) > >(storage));
        x10aux::ref<x10::array::DistArray<TPMGL(T)> > that_saved_this = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(T)> > >();
        TPMGL(U) that_unit = buf.read<TPMGL(U)>();
        x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(T), TPMGL(U)> > that_lop = buf.read<x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(T), TPMGL(U)> > >();
        x10aux::ref<x10_array_DistArray__closure__12<TPMGL(T),TPMGL(U) > > this_ = new (storage) x10_array_DistArray__closure__12<TPMGL(T),TPMGL(U) >(that_saved_this, that_unit, that_lop);
        return this_;
    }
    
    x10_array_DistArray__closure__12(x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this, TPMGL(U) unit, x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(T), TPMGL(U)> > lop) : saved_this(saved_this), unit(unit), lop(lop) { }
    
    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/array/DistArray.x10:693-701";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__12_CLOSURE
#ifndef X10_ARRAY_DISTARRAY_H_GENERICS
#define X10_ARRAY_DISTARRAY_H_GENERICS
#ifndef X10_ARRAY_DISTARRAY_H_map_177
#define X10_ARRAY_DISTARRAY_H_map_177
template<class TPMGL(T)> template<class TPMGL(U)> x10aux::ref<x10::array::DistArray<TPMGL(U)> >
  x10::array::DistArray<TPMGL(T)>::map(x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op) {
    
    //#line 504 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(U)> > > plh =
      x10::lang::PlaceLocalHandle<void>::template make<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(U)> > >(
        ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
          FMGL(dist), x10aux::ref<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(U)> > > >(x10aux::ref<x10_array_DistArray__closure__6<TPMGL(T),TPMGL(U) > >(new (x10aux::alloc<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(U)> > > >(sizeof(x10_array_DistArray__closure__6<TPMGL(T),TPMGL(U)>)))x10_array_DistArray__closure__6<TPMGL(T),TPMGL(U)>(this, op))));
    
    //#line 514 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return x10::array::DistArray<TPMGL(U)>::_make(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                                    FMGL(dist),
                                                  plh);
    
}
#endif // X10_ARRAY_DISTARRAY_H_map_177
#ifndef X10_ARRAY_DISTARRAY_H_map_178
#define X10_ARRAY_DISTARRAY_H_map_178
template<class TPMGL(T)> template<class TPMGL(U)> x10aux::ref<x10::array::DistArray<TPMGL(U)> >
  x10::array::DistArray<TPMGL(T)>::map(x10aux::ref<x10::array::DistArray<TPMGL(U)> > dst,
                                       x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op) {
    {
        
        //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var1 =
          x10::lang::Runtime::startFinish();
        {
            
            //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable34180 =
              X10_NULL;
            
            //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
            try {
                
                //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 529 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
                        {
                            x10aux::ref<x10::lang::Iterator<x10::lang::Place> > where34121;
                            for (
                                 //#line 529 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                 where34121 = x10aux::nullCheck(x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                                                                    FMGL(dist))->places())->iterator();
                                 x10::lang::Iterator<x10::lang::Place>::hasNext(x10aux::nullCheck(where34121));
                                 ) {
                                
                                //#line 529 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                x10::lang::Place where = x10::lang::Iterator<x10::lang::Place>::next(x10aux::nullCheck(where34121));
                                
                                //#line 530 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                                x10::lang::Runtime::runAsync(
                                  where, x10aux::ref<x10::lang::VoidFun_0_0>(x10aux::ref<x10_array_DistArray__closure__7<TPMGL(T),TPMGL(U) > >(new (x10aux::alloc<x10::lang::VoidFun_0_0>(sizeof(x10_array_DistArray__closure__7<TPMGL(T),TPMGL(U)>)))x10_array_DistArray__closure__7<TPMGL(T),TPMGL(U)>(this, dst, op))));
                            }
                        }
                        
                    }
                }
                catch (x10aux::__ref& __ref__179) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__179 = (x10aux::ref<x10::lang::Throwable>&)__ref__179;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__1__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__179);
                        {
                            
                            //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__1__);
                            
                            //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__180) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__180 = (x10aux::ref<x10::lang::Throwable>&)__ref__180;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal34181 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__180);
                    {
                        
                        //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable34180 = formal34181;
                    }
                } else
                throw;
            }
            
            //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34180)))
            {
                
                //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable34180))
                {
                    
                    //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34180));
                }
                
            }
            
            //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var1);
            }
            
            //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34180)))
            {
                
                //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable34180)))
                {
                    
                    //#line 528 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34180));
                }
                
            }
            
        }
    }
    
    //#line 541 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return dst;
    
}
#endif // X10_ARRAY_DISTARRAY_H_map_178
#ifndef X10_ARRAY_DISTARRAY_H_map_181
#define X10_ARRAY_DISTARRAY_H_map_181
template<class TPMGL(T)> template<class TPMGL(U)> x10aux::ref<x10::array::DistArray<TPMGL(U)> >
  x10::array::DistArray<TPMGL(T)>::map(x10aux::ref<x10::array::DistArray<TPMGL(U)> > dst,
                                       x10aux::ref<x10::array::Region> filter,
                                       x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), TPMGL(U)> > op) {
    {
        
        //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var2 =
          x10::lang::Runtime::startFinish();
        {
            
            //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable34183 =
              X10_NULL;
            
            //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
            try {
                
                //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 558 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
                        {
                            x10aux::ref<x10::lang::Iterator<x10::lang::Place> > where34125;
                            for (
                                 //#line 558 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                 where34125 = x10aux::nullCheck(x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                                                                    FMGL(dist))->places())->iterator();
                                 x10::lang::Iterator<x10::lang::Place>::hasNext(x10aux::nullCheck(where34125));
                                 ) {
                                
                                //#line 558 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                x10::lang::Place where = x10::lang::Iterator<x10::lang::Place>::next(x10aux::nullCheck(where34125));
                                
                                //#line 559 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                                x10::lang::Runtime::runAsync(
                                  where, x10aux::ref<x10::lang::VoidFun_0_0>(x10aux::ref<x10_array_DistArray__closure__8<TPMGL(T),TPMGL(U) > >(new (x10aux::alloc<x10::lang::VoidFun_0_0>(sizeof(x10_array_DistArray__closure__8<TPMGL(T),TPMGL(U)>)))x10_array_DistArray__closure__8<TPMGL(T),TPMGL(U)>(this, filter, dst, op))));
                            }
                        }
                        
                    }
                }
                catch (x10aux::__ref& __ref__182) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__182 = (x10aux::ref<x10::lang::Throwable>&)__ref__182;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__2__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__182);
                        {
                            
                            //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__2__);
                            
                            //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__183) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__183 = (x10aux::ref<x10::lang::Throwable>&)__ref__183;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal34184 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__183);
                    {
                        
                        //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable34183 = formal34184;
                    }
                } else
                throw;
            }
            
            //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34183)))
            {
                
                //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable34183))
                {
                    
                    //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34183));
                }
                
            }
            
            //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var2);
            }
            
            //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34183)))
            {
                
                //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable34183)))
                {
                    
                    //#line 557 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34183));
                }
                
            }
            
        }
    }
    
    //#line 571 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return dst;
    
}
#endif // X10_ARRAY_DISTARRAY_H_map_181
#ifndef X10_ARRAY_DISTARRAY_H_map_184
#define X10_ARRAY_DISTARRAY_H_map_184
template<class TPMGL(T)> template<class TPMGL(S), class TPMGL(U)>
x10aux::ref<x10::array::DistArray<TPMGL(S)> > x10::array::DistArray<TPMGL(T)>::map(
  x10aux::ref<x10::array::DistArray<TPMGL(U)> > src, x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op) {
    
    //#line 585 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(S)> > > plh =
      x10::lang::PlaceLocalHandle<void>::template make<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(S)> > >(
        ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
          FMGL(dist), x10aux::ref<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(S)> > > >(x10aux::ref<x10_array_DistArray__closure__9<TPMGL(T),TPMGL(S),TPMGL(U) > >(new (x10aux::alloc<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(S)> > > >(sizeof(x10_array_DistArray__closure__9<TPMGL(T),TPMGL(S),TPMGL(U)>)))x10_array_DistArray__closure__9<TPMGL(T),TPMGL(S),TPMGL(U)>(this, src, op))));
    
    //#line 596 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return x10::array::DistArray<TPMGL(S)>::_make(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                                    FMGL(dist),
                                                  plh);
    
}
#endif // X10_ARRAY_DISTARRAY_H_map_184
#ifndef X10_ARRAY_DISTARRAY_H_map_185
#define X10_ARRAY_DISTARRAY_H_map_185
template<class TPMGL(T)> template<class TPMGL(S), class TPMGL(U)>
x10aux::ref<x10::array::DistArray<TPMGL(S)> > x10::array::DistArray<TPMGL(T)>::map(
  x10aux::ref<x10::array::DistArray<TPMGL(S)> > dst, x10aux::ref<x10::array::DistArray<TPMGL(U)> > src,
  x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op) {
    {
        
        //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var3 =
          x10::lang::Runtime::startFinish();
        {
            
            //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable34186 =
              X10_NULL;
            
            //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
            try {
                
                //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 612 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
                        {
                            x10aux::ref<x10::lang::Iterator<x10::lang::Place> > where34131;
                            for (
                                 //#line 612 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                 where34131 = x10aux::nullCheck(x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                                                                    FMGL(dist))->places())->iterator();
                                 x10::lang::Iterator<x10::lang::Place>::hasNext(x10aux::nullCheck(where34131));
                                 ) {
                                
                                //#line 612 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                x10::lang::Place where = x10::lang::Iterator<x10::lang::Place>::next(x10aux::nullCheck(where34131));
                                
                                //#line 613 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                                x10::lang::Runtime::runAsync(
                                  where, x10aux::ref<x10::lang::VoidFun_0_0>(x10aux::ref<x10_array_DistArray__closure__10<TPMGL(T),TPMGL(S),TPMGL(U) > >(new (x10aux::alloc<x10::lang::VoidFun_0_0>(sizeof(x10_array_DistArray__closure__10<TPMGL(T),TPMGL(S),TPMGL(U)>)))x10_array_DistArray__closure__10<TPMGL(T),TPMGL(S),TPMGL(U)>(this, src, dst, op))));
                            }
                        }
                        
                    }
                }
                catch (x10aux::__ref& __ref__186) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__186 = (x10aux::ref<x10::lang::Throwable>&)__ref__186;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__3__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__186);
                        {
                            
                            //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__3__);
                            
                            //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__187) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__187 = (x10aux::ref<x10::lang::Throwable>&)__ref__187;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal34187 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__187);
                    {
                        
                        //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable34186 = formal34187;
                    }
                } else
                throw;
            }
            
            //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34186)))
            {
                
                //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable34186))
                {
                    
                    //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34186));
                }
                
            }
            
            //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var3);
            }
            
            //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34186)))
            {
                
                //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable34186)))
                {
                    
                    //#line 611 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34186));
                }
                
            }
            
        }
    }
    
    //#line 625 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return dst;
    
}
#endif // X10_ARRAY_DISTARRAY_H_map_185
#ifndef X10_ARRAY_DISTARRAY_H_map_188
#define X10_ARRAY_DISTARRAY_H_map_188
template<class TPMGL(T)> template<class TPMGL(S), class TPMGL(U)>
x10aux::ref<x10::array::DistArray<TPMGL(S)> > x10::array::DistArray<TPMGL(T)>::map(
  x10aux::ref<x10::array::DistArray<TPMGL(S)> > dst, x10aux::ref<x10::array::DistArray<TPMGL(U)> > src,
  x10aux::ref<x10::array::Region> filter, x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(U), TPMGL(S)> > op) {
    {
        
        //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var4 =
          x10::lang::Runtime::startFinish();
        {
            
            //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable34189 =
              X10_NULL;
            
            //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
            try {
                
                //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 642 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
                        {
                            x10aux::ref<x10::lang::Iterator<x10::lang::Place> > where34135;
                            for (
                                 //#line 642 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                 where34135 = x10aux::nullCheck(x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                                                                    FMGL(dist))->places())->iterator();
                                 x10::lang::Iterator<x10::lang::Place>::hasNext(x10aux::nullCheck(where34135));
                                 ) {
                                
                                //#line 642 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                x10::lang::Place where = x10::lang::Iterator<x10::lang::Place>::next(x10aux::nullCheck(where34135));
                                
                                //#line 643 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                                x10::lang::Runtime::runAsync(
                                  where, x10aux::ref<x10::lang::VoidFun_0_0>(x10aux::ref<x10_array_DistArray__closure__11<TPMGL(T),TPMGL(S),TPMGL(U) > >(new (x10aux::alloc<x10::lang::VoidFun_0_0>(sizeof(x10_array_DistArray__closure__11<TPMGL(T),TPMGL(S),TPMGL(U)>)))x10_array_DistArray__closure__11<TPMGL(T),TPMGL(S),TPMGL(U)>(this, filter, src, dst, op))));
                            }
                        }
                        
                    }
                }
                catch (x10aux::__ref& __ref__189) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__189 = (x10aux::ref<x10::lang::Throwable>&)__ref__189;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__4__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__189);
                        {
                            
                            //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__4__);
                            
                            //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__190) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__190 = (x10aux::ref<x10::lang::Throwable>&)__ref__190;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal34190 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__190);
                    {
                        
                        //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable34189 = formal34190;
                    }
                } else
                throw;
            }
            
            //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34189)))
            {
                
                //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable34189))
                {
                    
                    //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34189));
                }
                
            }
            
            //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var4);
            }
            
            //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34189)))
            {
                
                //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable34189)))
                {
                    
                    //#line 641 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34189));
                }
                
            }
            
        }
    }
    
    //#line 656 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return dst;
    
}
#endif // X10_ARRAY_DISTARRAY_H_map_188
#ifndef X10_ARRAY_DISTARRAY_H_reduce_192
#define X10_ARRAY_DISTARRAY_H_reduce_192
template<class TPMGL(T)> template<class TPMGL(U)> TPMGL(U)
  x10::array::DistArray<TPMGL(T)>::reduce(x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(T), TPMGL(U)> > lop,
                                          x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(U), TPMGL(U)> > gop,
                                          TPMGL(U) unit) {
    
    //#line 686 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T)> > reducer =
      x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T)>::_make(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this),
                                                                         unit,
                                                                         gop);
    
    //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    TPMGL(U) result;
    {
        
        //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var5 =
          x10aux::class_cast_unchecked<x10aux::ref<x10::lang::FinishState> >(x10::lang::Runtime::template startCollectingFinish<TPMGL(U) >(
                                                                               x10aux::class_cast_unchecked<x10aux::ref<x10::lang::Reducible<TPMGL(U)> > >(reducer)));
        {
            
            //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable34192 =
              X10_NULL;
            
            //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
            try {
                
                //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 692 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
                        {
                            x10aux::ref<x10::lang::Iterator<x10::lang::Place> > where34139;
                            for (
                                 //#line 692 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                 where34139 = x10aux::nullCheck(x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                                                                    FMGL(dist))->places())->iterator();
                                 x10::lang::Iterator<x10::lang::Place>::hasNext(x10aux::nullCheck(where34139));
                                 ) {
                                
                                //#line 692 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                x10::lang::Place where = x10::lang::Iterator<x10::lang::Place>::next(x10aux::nullCheck(where34139));
                                
                                //#line 693 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                                x10::lang::Runtime::runAsync(
                                  where, x10aux::ref<x10::lang::VoidFun_0_0>(x10aux::ref<x10_array_DistArray__closure__12<TPMGL(T),TPMGL(U) > >(new (x10aux::alloc<x10::lang::VoidFun_0_0>(sizeof(x10_array_DistArray__closure__12<TPMGL(T),TPMGL(U)>)))x10_array_DistArray__closure__12<TPMGL(T),TPMGL(U)>(this, unit, lop))));
                            }
                        }
                        
                    }
                }
                catch (x10aux::__ref& __ref__193) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__193 = (x10aux::ref<x10::lang::Throwable>&)__ref__193;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__5__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__193);
                        {
                            
                            //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__5__);
                            
                            //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__194) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__194 = (x10aux::ref<x10::lang::Throwable>&)__ref__194;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal34193 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__194);
                    {
                        
                        //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable34192 = formal34193;
                    }
                } else
                throw;
            }
            
            //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34192)))
            {
                
                //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable34192))
                {
                    
                    //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34192));
                }
                
            }
            
            //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10LocalAssign_c
                result = x10::lang::Runtime::template stopCollectingFinish<TPMGL(U) >(
                           x10____var5);
            }
            
            //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34192)))
            {
                
                //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable34192)))
                {
                    
                    //#line 691 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34192));
                }
                
            }
            
        }
    }
    
    //#line 705 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return result;
    
}
#endif // X10_ARRAY_DISTARRAY_H_reduce_192
#endif // X10_ARRAY_DISTARRAY_H_GENERICS
#ifndef X10_ARRAY_DISTARRAY_H_IMPLEMENTATION
#define X10_ARRAY_DISTARRAY_H_IMPLEMENTATION
#include <x10/array/DistArray.h>

#ifndef X10_ARRAY_DISTARRAY__CLOSURE__1_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__1_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_0.h>
template<class TPMGL(T)> class x10_array_DistArray__closure__1 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > >::template itable <x10_array_DistArray__closure__1<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > __apply() {
        
        //#line 116 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(T) > localRaw = x10::util::IndexedMemoryChunk<void>::allocate<TPMGL(T) >(((x10_int) ((x10aux::nullCheck(dist)->maxOffset()) + (((x10_int)1)))), 8, false, true);
        
        //#line 117 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
        return x10::array::DistArray__LocalState<TPMGL(T)>::_make(localRaw);
        
    }
    
    // captured environment
    x10aux::ref<x10::array::Dist> dist;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->dist);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__1<TPMGL(T) >* storage = x10aux::alloc<x10_array_DistArray__closure__1<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__1<TPMGL(T) > >(storage));
        x10aux::ref<x10::array::Dist> that_dist = buf.read<x10aux::ref<x10::array::Dist> >();
        x10aux::ref<x10_array_DistArray__closure__1<TPMGL(T) > > this_ = new (storage) x10_array_DistArray__closure__1<TPMGL(T) >(that_dist);
        return this_;
    }
    
    x10_array_DistArray__closure__1(x10aux::ref<x10::array::Dist> dist) : dist(dist) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<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/array/DistArray.x10:115-118";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__1_CLOSURE
#ifndef X10_ARRAY_DISTARRAY__CLOSURE__2_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__2_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_0.h>
template<class TPMGL(T)> class x10_array_DistArray__closure__2 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > >::template itable <x10_array_DistArray__closure__2<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > __apply() {
        
        //#line 147 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(T) > localRaw = x10::util::IndexedMemoryChunk<void>::allocate<TPMGL(T) >(((x10_int) ((x10aux::nullCheck(dist)->maxOffset()) + (((x10_int)1)))), 8, false, false);
        
        //#line 148 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> reg = x10aux::nullCheck(dist)->get(
                                                x10::lang::Place::_make(x10aux::here));
        
        //#line 149 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
        {
            x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > > pt34109;
            for (
                 //#line 149 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 pt34109 = x10aux::nullCheck(reg)->iterator(); x10::lang::Iterator<x10aux::ref<x10::array::Point> >::hasNext(x10aux::nullCheck(pt34109));
                 ) {
                
                //#line 149 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10aux::ref<x10::array::Point> pt = x10::lang::Iterator<x10aux::ref<x10::array::Point> >::next(x10aux::nullCheck(pt34109));
                
                //#line 150 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                (localRaw)->__set(x10aux::nullCheck(dist)->offset(
                                    pt), x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)>::__apply(x10aux::nullCheck(init), 
                  pt));
            }
        }
        
        //#line 152 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
        return x10::array::DistArray__LocalState<TPMGL(T)>::_make(localRaw);
        
    }
    
    // captured environment
    x10aux::ref<x10::array::Dist> dist;
    x10aux::ref<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> > init;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->dist);
        buf.write(this->init);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__2<TPMGL(T) >* storage = x10aux::alloc<x10_array_DistArray__closure__2<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__2<TPMGL(T) > >(storage));
        x10aux::ref<x10::array::Dist> that_dist = buf.read<x10aux::ref<x10::array::Dist> >();
        x10aux::ref<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> > that_init = buf.read<x10aux::ref<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> > >();
        x10aux::ref<x10_array_DistArray__closure__2<TPMGL(T) > > this_ = new (storage) x10_array_DistArray__closure__2<TPMGL(T) >(that_dist, that_init);
        return this_;
    }
    
    x10_array_DistArray__closure__2(x10aux::ref<x10::array::Dist> dist, x10aux::ref<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> > init) : dist(dist), init(init) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<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/array/DistArray.x10:146-153";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__2_CLOSURE
#ifndef X10_ARRAY_DISTARRAY__CLOSURE__3_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__3_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_0.h>
template<class TPMGL(T)> class x10_array_DistArray__closure__3 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > >::template itable <x10_array_DistArray__closure__3<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > __apply() {
        
        //#line 175 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(T) > localRaw = x10::util::IndexedMemoryChunk<void>::allocate<TPMGL(T) >(((x10_int) ((x10aux::nullCheck(dist)->maxOffset()) + (((x10_int)1)))), 8, false, false);
        
        //#line 176 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> reg = x10aux::nullCheck(dist)->get(
                                                x10::lang::Place::_make(x10aux::here));
        
        //#line 177 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
        {
            x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > > pt34111;
            for (
                 //#line 177 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 pt34111 = x10aux::nullCheck(reg)->iterator(); x10::lang::Iterator<x10aux::ref<x10::array::Point> >::hasNext(x10aux::nullCheck(pt34111));
                 ) {
                
                //#line 177 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10aux::ref<x10::array::Point> pt = x10::lang::Iterator<x10aux::ref<x10::array::Point> >::next(x10aux::nullCheck(pt34111));
                
                //#line 178 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                (localRaw)->__set(x10aux::nullCheck(dist)->offset(
                                    pt), init);
            }
        }
        
        //#line 180 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
        return x10::array::DistArray__LocalState<TPMGL(T)>::_make(localRaw);
        
    }
    
    // captured environment
    x10aux::ref<x10::array::Dist> dist;
    TPMGL(T) init;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->dist);
        buf.write(this->init);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__3<TPMGL(T) >* storage = x10aux::alloc<x10_array_DistArray__closure__3<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__3<TPMGL(T) > >(storage));
        x10aux::ref<x10::array::Dist> that_dist = buf.read<x10aux::ref<x10::array::Dist> >();
        TPMGL(T) that_init = buf.read<TPMGL(T)>();
        x10aux::ref<x10_array_DistArray__closure__3<TPMGL(T) > > this_ = new (storage) x10_array_DistArray__closure__3<TPMGL(T) >(that_dist, that_init);
        return this_;
    }
    
    x10_array_DistArray__closure__3(x10aux::ref<x10::array::Dist> dist, TPMGL(T) init) : dist(dist), init(init) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<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/array/DistArray.x10:174-181";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__3_CLOSURE
#ifndef X10_ARRAY_DISTARRAY__CLOSURE__4_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__4_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_0.h>
template<class TPMGL(T)> class x10_array_DistArray__closure__4 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > >::template itable <x10_array_DistArray__closure__4<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > __apply() {
        
        //#line 197 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
        return x10aux::nullCheck(a)->FMGL(localHandle)->x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > >::__apply();
        
    }
    
    // captured environment
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > a;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->a);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__4<TPMGL(T) >* storage = x10aux::alloc<x10_array_DistArray__closure__4<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__4<TPMGL(T) > >(storage));
        x10aux::ref<x10::array::DistArray<TPMGL(T)> > that_a = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(T)> > >();
        x10aux::ref<x10_array_DistArray__closure__4<TPMGL(T) > > this_ = new (storage) x10_array_DistArray__closure__4<TPMGL(T) >(that_a);
        return this_;
    }
    
    x10_array_DistArray__closure__4(x10aux::ref<x10::array::DistArray<TPMGL(T)> > a) : a(a) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<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/array/DistArray.x10:197";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__4_CLOSURE
#ifndef X10_ARRAY_DISTARRAY__CLOSURE__5_CLOSURE
#define X10_ARRAY_DISTARRAY__CLOSURE__5_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/VoidFun_0_0.h>
template<class TPMGL(T)> class x10_array_DistArray__closure__5 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::VoidFun_0_0::template itable <x10_array_DistArray__closure__5<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    void __apply() {
        
        //#line 485 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10::util::IndexedMemoryChunk<TPMGL(T) > imc = saved_this->x10::array::DistArray<TPMGL(T)>::raw();
        
        //#line 486 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Region> reg = x10aux::nullCheck(saved_this->
                                                                  FMGL(dist))->get(
                                                x10::lang::Place::_make(x10aux::here));
        
        //#line 487 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
        {
            x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > > pt34113;
            for (
                 //#line 487 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 pt34113 = x10aux::nullCheck(reg)->iterator(); x10::lang::Iterator<x10aux::ref<x10::array::Point> >::hasNext(x10aux::nullCheck(pt34113));
                 ) {
                
                //#line 487 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                x10aux::ref<x10::array::Point> pt = x10::lang::Iterator<x10aux::ref<x10::array::Point> >::next(x10aux::nullCheck(pt34113));
                
                //#line 488 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                (imc)->__set(x10aux::nullCheck(saved_this->
                                                 FMGL(dist))->offset(
                               pt), v);
            }
        }
        
    }
    
    // captured environment
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this;
    TPMGL(T) v;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->saved_this);
        buf.write(this->v);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_array_DistArray__closure__5<TPMGL(T) >* storage = x10aux::alloc<x10_array_DistArray__closure__5<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_array_DistArray__closure__5<TPMGL(T) > >(storage));
        x10aux::ref<x10::array::DistArray<TPMGL(T)> > that_saved_this = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(T)> > >();
        TPMGL(T) that_v = buf.read<TPMGL(T)>();
        x10aux::ref<x10_array_DistArray__closure__5<TPMGL(T) > > this_ = new (storage) x10_array_DistArray__closure__5<TPMGL(T) >(that_saved_this, that_v);
        return this_;
    }
    
    x10_array_DistArray__closure__5(x10aux::ref<x10::array::DistArray<TPMGL(T)> > saved_this, TPMGL(T) v) : saved_this(saved_this), v(v) { }
    
    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/array/DistArray.x10:484-490";
    }

};

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

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

#endif // X10_ARRAY_DISTARRAY__CLOSURE__5_CLOSURE

//#line 50 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.PropertyDecl_c
template<class TPMGL(T)> typename x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)>::template itable<x10::array::DistArray<TPMGL(T)> >  x10::array::DistArray<TPMGL(T)>::_itable_0(&x10::array::DistArray<TPMGL(T)>::equals, &x10::array::DistArray<TPMGL(T)>::hashCode, &x10::array::DistArray<TPMGL(T)>::__apply, &x10::array::DistArray<TPMGL(T)>::toString, &x10::array::DistArray<TPMGL(T)>::typeName);
template<class TPMGL(T)> x10::lang::Any::itable<x10::array::DistArray<TPMGL(T)> >  x10::array::DistArray<TPMGL(T)>::_itable_1(&x10::array::DistArray<TPMGL(T)>::equals, &x10::array::DistArray<TPMGL(T)>::hashCode, &x10::array::DistArray<TPMGL(T)>::toString, &x10::array::DistArray<TPMGL(T)>::typeName);
template<class TPMGL(T)> typename x10::lang::Iterable<x10aux::ref<x10::array::Point> >::template itable<x10::array::DistArray<TPMGL(T)> >  x10::array::DistArray<TPMGL(T)>::_itable_2(&x10::array::DistArray<TPMGL(T)>::equals, &x10::array::DistArray<TPMGL(T)>::hashCode, &x10::array::DistArray<TPMGL(T)>::iterator, &x10::array::DistArray<TPMGL(T)>::toString, &x10::array::DistArray<TPMGL(T)>::typeName);
template<class TPMGL(T)> x10aux::itable_entry x10::array::DistArray<TPMGL(T)>::_itables[4] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> >, &_itable_0), x10aux::itable_entry(&x10aux::getRTT<x10::lang::Any>, &_itable_1), x10aux::itable_entry(&x10aux::getRTT<x10::lang::Iterable<x10aux::ref<x10::array::Point> > >, &_itable_2), x10aux::itable_entry(NULL, (void*)x10aux::getRTT<x10::array::DistArray<TPMGL(T)> >())};

//#line 62 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::array::Region> x10::array::DistArray<TPMGL(T)>::region(
  ) {
    
    //#line 62 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                               FMGL(dist))->FMGL(region);
    
}

//#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_int x10::array::DistArray<TPMGL(T)>::rank(
  ) {
    
    //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                               FMGL(dist))->x10::array::Dist::rank();
    
}

//#line 74 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10FieldDecl_c
/** The place-local backing storage for the DistArray */

//#line 76 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10FieldDecl_c
/** Can the backing storage be obtained from cachedRaw? */

//#line 78 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10FieldDecl_c
/** Cached pointer to the backing storage */

//#line 84 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10::util::IndexedMemoryChunk<TPMGL(T) >
  x10::array::DistArray<TPMGL(T)>::raw() {
    
    //#line 85 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
    if (!(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
            FMGL(cachedRawValid))) {
        
        //#line 86 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
        ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
          FMGL(cachedRaw) = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                                FMGL(localHandle)->x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > >::__apply())->
                              FMGL(data);
        
        //#line 87 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
        x10aux::atomic_ops::store_store_barrier();
        
        //#line 88 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
        ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
          FMGL(cachedRawValid) = true;
    }
    
    //#line 90 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
             FMGL(cachedRaw);
    
}

//#line 97 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::array::Array<TPMGL(T)> >
  x10::array::DistArray<TPMGL(T)>::getLocalPortion() {
    
    //#line 98 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::array::Region> regionForHere = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                                                        FMGL(dist))->get(
                                                      x10::lang::Place::_make(x10aux::here));
    
    //#line 99 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
    if (!(x10aux::nullCheck(regionForHere)->FMGL(rect))) {
        
        //#line 99 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
        x10aux::throwException(x10aux::nullCheck(x10::lang::UnsupportedOperationException::_make(((x10aux::type_name(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this))) + (x10aux::string_utils::lit(".getLocalPortion(): local portion is not rectangular!"))))));
    }
    
    //#line 100 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return x10::array::Array<TPMGL(T)>::_make(regionForHere,
                                              ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::raw());
    
}

//#line 109 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c

//#line 112 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(T)> void x10::array::DistArray<TPMGL(T)>::_constructor(
                           x10aux::ref<x10::array::Dist> dist) {
    
    //#line 112 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Object::_constructor();
    
    //#line 113 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.AssignPropertyCall_c
    FMGL(dist) = dist;
    
    //#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::__fieldInitializers33980();
    
    //#line 115 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > > plsInit =
      x10aux::ref<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(x10aux::ref<x10_array_DistArray__closure__1<TPMGL(T) > >(new (x10aux::alloc<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(sizeof(x10_array_DistArray__closure__1<TPMGL(T)>)))x10_array_DistArray__closure__1<TPMGL(T)>(dist)));
    
    //#line 120 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
      FMGL(localHandle) = x10::lang::PlaceLocalHandle<void>::template make<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > >(
                            dist, plsInit);
}
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> > x10::array::DistArray<TPMGL(T)>::_make(
                           x10aux::ref<x10::array::Dist> dist)
{
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > this_ = new (memset(x10aux::alloc<x10::array::DistArray<TPMGL(T)> >(), 0, sizeof(x10::array::DistArray<TPMGL(T)>))) x10::array::DistArray<TPMGL(T)>();
    this_->_constructor(dist);
    return this_;
}



//#line 140 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c

//#line 143 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(T)> void x10::array::DistArray<TPMGL(T)>::_constructor(
                           x10aux::ref<x10::array::Dist> dist,
                           x10aux::ref<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> > init) {
    
    //#line 143 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Object::_constructor();
    
    //#line 144 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.AssignPropertyCall_c
    FMGL(dist) = dist;
    
    //#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::__fieldInitializers33980();
    
    //#line 146 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > > plsInit =
      x10aux::ref<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(x10aux::ref<x10_array_DistArray__closure__2<TPMGL(T) > >(new (x10aux::alloc<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(sizeof(x10_array_DistArray__closure__2<TPMGL(T)>)))x10_array_DistArray__closure__2<TPMGL(T)>(dist, init)));
    
    //#line 155 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
      FMGL(localHandle) = x10::lang::PlaceLocalHandle<void>::template make<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > >(
                            dist, plsInit);
}
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> > x10::array::DistArray<TPMGL(T)>::_make(
                           x10aux::ref<x10::array::Dist> dist,
                           x10aux::ref<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> > init)
{
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > this_ = new (memset(x10aux::alloc<x10::array::DistArray<TPMGL(T)> >(), 0, sizeof(x10::array::DistArray<TPMGL(T)>))) x10::array::DistArray<TPMGL(T)>();
    this_->_constructor(dist, init);
    return this_;
}



//#line 168 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c

//#line 171 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(T)> void x10::array::DistArray<TPMGL(T)>::_constructor(
                           x10aux::ref<x10::array::Dist> dist,
                           TPMGL(T) init) {
    
    //#line 171 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Object::_constructor();
    
    //#line 172 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.AssignPropertyCall_c
    FMGL(dist) = dist;
    
    //#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::__fieldInitializers33980();
    
    //#line 174 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > > plsInit =
      x10aux::ref<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(x10aux::ref<x10_array_DistArray__closure__3<TPMGL(T) > >(new (x10aux::alloc<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(sizeof(x10_array_DistArray__closure__3<TPMGL(T)>)))x10_array_DistArray__closure__3<TPMGL(T)>(dist, init)));
    
    //#line 183 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
      FMGL(localHandle) = x10::lang::PlaceLocalHandle<void>::template make<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > >(
                            dist, plsInit);
}
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> > x10::array::DistArray<TPMGL(T)>::_make(
                           x10aux::ref<x10::array::Dist> dist,
                           TPMGL(T) init) {
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > this_ = new (memset(x10aux::alloc<x10::array::DistArray<TPMGL(T)> >(), 0, sizeof(x10::array::DistArray<TPMGL(T)>))) x10::array::DistArray<TPMGL(T)>();
    this_->_constructor(dist, init);
    return this_;
}



//#line 195 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(T)> void x10::array::DistArray<TPMGL(T)>::_constructor(
                           x10aux::ref<x10::array::DistArray<TPMGL(T)> > a,
                           x10aux::ref<x10::array::Dist> d) {
    
    //#line 195 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Object::_constructor();
    
    //#line 196 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.AssignPropertyCall_c
    FMGL(dist) = d;
    
    //#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::__fieldInitializers33980();
    
    //#line 197 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
      FMGL(localHandle) = x10::lang::PlaceLocalHandle<void>::template make<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > >(
                            d, x10aux::ref<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(x10aux::ref<x10_array_DistArray__closure__4<TPMGL(T) > >(new (x10aux::alloc<x10::lang::Fun_0_0<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >(sizeof(x10_array_DistArray__closure__4<TPMGL(T)>)))x10_array_DistArray__closure__4<TPMGL(T)>(a))));
}
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> > x10::array::DistArray<TPMGL(T)>::_make(
                           x10aux::ref<x10::array::DistArray<TPMGL(T)> > a,
                           x10aux::ref<x10::array::Dist> d)
{
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > this_ = new (memset(x10aux::alloc<x10::array::DistArray<TPMGL(T)> >(), 0, sizeof(x10::array::DistArray<TPMGL(T)>))) x10::array::DistArray<TPMGL(T)>();
    this_->_constructor(a, d);
    return this_;
}



//#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(T)> void x10::array::DistArray<TPMGL(T)>::_constructor(
                           x10aux::ref<x10::array::Dist> d,
                           x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > pls) {
    
    //#line 205 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Object::_constructor();
    
    //#line 206 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.AssignPropertyCall_c
    FMGL(dist) = d;
    
    //#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::__fieldInitializers33980();
    
    //#line 207 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
      FMGL(localHandle) = pls;
}
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> > x10::array::DistArray<TPMGL(T)>::_make(
                           x10aux::ref<x10::array::Dist> d,
                           x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > pls)
{
    x10aux::ref<x10::array::DistArray<TPMGL(T)> > this_ = new (memset(x10aux::alloc<x10::array::DistArray<TPMGL(T)> >(), 0, sizeof(x10::array::DistArray<TPMGL(T)>))) x10::array::DistArray<TPMGL(T)>();
    this_->_constructor(d, pls);
    return this_;
}



//#line 222 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::array::DistArray<TPMGL(T)>::__apply(
  x10aux::ref<x10::array::Point> pt) {
    
    //#line 223 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10_int offset = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                         FMGL(dist))->offset(
                       pt);
    
    //#line 224 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return (((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::raw())->__apply(offset);
    
}

//#line 239 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::array::DistArray<TPMGL(T)>::__apply(
  x10_int i0) {
    
    //#line 240 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10_int offset = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                         FMGL(dist))->offset(
                       i0);
    
    //#line 241 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return (((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::raw())->__apply(offset);
    
}

//#line 257 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::array::DistArray<TPMGL(T)>::__apply(
  x10_int i0, x10_int i1) {
    
    //#line 258 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10_int offset = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                         FMGL(dist))->offset(
                       i0, i1);
    
    //#line 259 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return (((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::raw())->__apply(offset);
    
}

//#line 276 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::array::DistArray<TPMGL(T)>::__apply(
  x10_int i0, x10_int i1, x10_int i2) {
    
    //#line 277 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10_int offset = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                         FMGL(dist))->offset(
                       i0, i1, i2);
    
    //#line 278 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return (((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::raw())->__apply(offset);
    
}

//#line 296 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::array::DistArray<TPMGL(T)>::__apply(
  x10_int i0, x10_int i1, x10_int i2, x10_int i3) {
    
    //#line 297 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10_int offset = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                         FMGL(dist))->offset(
                       i0, i1, i2, i3);
    
    //#line 298 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return (((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::raw())->__apply(offset);
    
}

//#line 315 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::array::DistArray<TPMGL(T)>::__set(
  x10aux::ref<x10::array::Point> pt, TPMGL(T) v) {
    
    //#line 316 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10_int offset = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                         FMGL(dist))->offset(
                       pt);
    
    //#line 317 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
    (((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::raw())->__set(offset, v);
    
    //#line 318 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return v;
    
}

//#line 335 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::array::DistArray<TPMGL(T)>::__set(
  x10_int i0, TPMGL(T) v) {
    
    //#line 336 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10_int offset = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                         FMGL(dist))->offset(
                       i0);
    
    //#line 337 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
    (((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::raw())->__set(offset, v);
    
    //#line 338 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return v;
    
}

//#line 356 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::array::DistArray<TPMGL(T)>::__set(
  x10_int i0, x10_int i1, TPMGL(T) v) {
    
    //#line 357 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10_int offset = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                         FMGL(dist))->offset(
                       i0, i1);
    
    //#line 358 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
    (((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::raw())->__set(offset, v);
    
    //#line 359 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return v;
    
}

//#line 378 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::array::DistArray<TPMGL(T)>::__set(
  x10_int i0, x10_int i1, x10_int i2, TPMGL(T) v) {
    
    //#line 379 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10_int offset = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                         FMGL(dist))->offset(
                       i0, i1, i2);
    
    //#line 380 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
    (((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::raw())->__set(offset, v);
    
    //#line 381 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return v;
    
}

//#line 401 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::array::DistArray<TPMGL(T)>::__set(
  x10_int i0, x10_int i1, x10_int i2, x10_int i3, TPMGL(T) v) {
    
    //#line 402 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
    x10_int offset = x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                         FMGL(dist))->offset(
                       i0, i1, i2, i3);
    
    //#line 403 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
    (((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::raw())->__set(offset, v);
    
    //#line 404 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return v;
    
}

//#line 424 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> >
  x10::array::DistArray<TPMGL(T)>::restriction(x10aux::ref<x10::array::Dist> d) {
    
    //#line 425 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return (__extension__ ({
        
        //#line 425 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::DistArray<TPMGL(T)> > __desugarer__var__20__34140 =
          x10::array::DistArray<TPMGL(T)>::_make(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this),
                                                 d);
        
        //#line 425 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::DistArray<TPMGL(T)> > ret34141;
        
        //#line 425 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
        if (!((x10aux::struct_equals(x10aux::nullCheck(x10aux::nullCheck(x10aux::nullCheck(__desugarer__var__20__34140)->
                                                                           FMGL(dist))->
                                                         FMGL(region))->
                                       FMGL(rank), x10aux::nullCheck(x10aux::nullCheck(x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this))->
                                                                                         FMGL(dist))->
                                                                       FMGL(region))->
                                                     FMGL(rank)))))
        {
            
            //#line 425 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 425 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                x10aux::throwException(x10aux::nullCheck(x10::lang::FailedDynamicCheckException::_make(x10aux::string_utils::lit("x10.array.DistArray[T]{self.dist.region.rank==this(:x10.array.DistArray).dist.region.rank}"))));
            }
            
        }
        
        //#line 425 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10LocalAssign_c
        ret34141 = __desugarer__var__20__34140;
        ret34141;
    }))
    ;
    
}

//#line 436 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> >
  x10::array::DistArray<TPMGL(T)>::restriction(x10aux::ref<x10::array::Region> r) {
    
    //#line 437 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::restriction(
             (__extension__ ({
                 
                 //#line 437 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 x10aux::ref<x10::array::Dist> __desugarer__var__21__34143 =
                   x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                       FMGL(dist))->restriction(
                     r);
                 
                 //#line 437 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 x10aux::ref<x10::array::Dist> ret34144;
                 
                 //#line 437 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                 if (!((x10aux::struct_equals(x10aux::nullCheck(x10aux::nullCheck(__desugarer__var__21__34143)->
                                                                  FMGL(region))->
                                                FMGL(rank),
                                              x10aux::nullCheck(x10aux::nullCheck(x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this))->
                                                                                    FMGL(dist))->
                                                                  FMGL(region))->
                                                FMGL(rank)))))
                 {
                     
                     //#line 437 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                     if (true) {
                         
                         //#line 437 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                         x10aux::throwException(x10aux::nullCheck(x10::lang::FailedDynamicCheckException::_make(x10aux::string_utils::lit("x10.array.Dist{self.region.rank==this(:x10.array.DistArray).dist.region.rank}"))));
                     }
                     
                 }
                 
                 //#line 437 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10LocalAssign_c
                 ret34144 = __desugarer__var__21__34143;
                 ret34144;
             }))
             );
    
}

//#line 448 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> >
  x10::array::DistArray<TPMGL(T)>::restriction(x10::lang::Place p) {
    
    //#line 449 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::restriction(
             (__extension__ ({
                 
                 //#line 449 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 x10aux::ref<x10::array::Dist> __desugarer__var__22__34146 =
                   x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                       FMGL(dist))->restriction(
                     p);
                 
                 //#line 449 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                 x10aux::ref<x10::array::Dist> ret34147;
                 
                 //#line 449 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                 if (!((x10aux::struct_equals(x10aux::nullCheck(x10aux::nullCheck(__desugarer__var__22__34146)->
                                                                  FMGL(region))->
                                                FMGL(rank),
                                              x10aux::nullCheck(x10aux::nullCheck(x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this))->
                                                                                    FMGL(dist))->
                                                                  FMGL(region))->
                                                FMGL(rank)))))
                 {
                     
                     //#line 449 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                     if (true) {
                         
                         //#line 449 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                         x10aux::throwException(x10aux::nullCheck(x10::lang::FailedDynamicCheckException::_make(x10aux::string_utils::lit("x10.array.Dist{self.region.rank==this(:x10.array.DistArray).dist.region.rank}"))));
                     }
                     
                 }
                 
                 //#line 449 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10LocalAssign_c
                 ret34147 = __desugarer__var__22__34146;
                 ret34147;
             }))
             );
    
}

//#line 460 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> >
  x10::array::DistArray<TPMGL(T)>::__bar(x10aux::ref<x10::array::Region> r) {
    
    //#line 460 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::restriction(
             r);
    
}

//#line 470 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> >
  x10::array::DistArray<TPMGL(T)>::__bar(x10::lang::Place p) {
    
    //#line 470 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::restriction(
             p);
    
}

//#line 482 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> void x10::array::DistArray<TPMGL(T)>::fill(
  TPMGL(T) v) {
    {
        
        //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
        x10::lang::Runtime::ensureNotInAtomic();
        
        //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::FinishState> x10____var0 =
          x10::lang::Runtime::startFinish();
        {
            
            //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable34177 =
              X10_NULL;
            
            //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
            try {
                
                //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Try_c
                try {
                    {
                        
                        //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.For_c
                        {
                            x10aux::ref<x10::lang::Iterator<x10::lang::Place> > where34115;
                            for (
                                 //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                 where34115 = x10aux::nullCheck(x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                                                                    FMGL(dist))->places())->iterator();
                                 x10::lang::Iterator<x10::lang::Place>::hasNext(x10aux::nullCheck(where34115));
                                 ) {
                                
                                //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10LocalDecl_c
                                x10::lang::Place where = x10::lang::Iterator<x10::lang::Place>::next(x10aux::nullCheck(where34115));
                                
                                //#line 484 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                                x10::lang::Runtime::runAsync(
                                  where, x10aux::ref<x10::lang::VoidFun_0_0>(x10aux::ref<x10_array_DistArray__closure__5<TPMGL(T) > >(new (x10aux::alloc<x10::lang::VoidFun_0_0>(sizeof(x10_array_DistArray__closure__5<TPMGL(T)>)))x10_array_DistArray__closure__5<TPMGL(T)>(this, v))));
                            }
                        }
                        
                    }
                }
                catch (x10aux::__ref& __ref__175) {
                    x10aux::ref<x10::lang::Throwable>& __exc__ref__175 = (x10aux::ref<x10::lang::Throwable>&)__ref__175;
                    if (true) {
                        x10aux::ref<x10::lang::Throwable> __lowerer__var__0__ =
                          static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__175);
                        {
                            
                            //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                            x10::lang::Runtime::pushException(
                              __lowerer__var__0__);
                            
                            //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                            x10aux::throwException(x10aux::nullCheck(x10::lang::RuntimeException::_make()));
                        }
                    } else
                    throw;
                }
                
                //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__176) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__176 = (x10aux::ref<x10::lang::Throwable>&)__ref__176;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal34178 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__176);
                    {
                        
                        //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable34177 = formal34178;
                    }
                } else
                throw;
            }
            
            //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34177)))
            {
                
                //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable34177))
                {
                    
                    //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34177));
                }
                
            }
            
            //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::stopFinish(x10____var0);
            }
            
            //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable34177)))
            {
                
                //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable34177)))
                {
                    
                    //#line 483 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable34177));
                }
                
            }
            
        }
    }
}

//#line 503 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c

//#line 527 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c

//#line 556 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c

//#line 584 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c

//#line 610 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c

//#line 640 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c

//#line 671 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::array::DistArray<TPMGL(T)>::reduce(
  x10aux::ref<x10::lang::Fun_0_2<TPMGL(T), TPMGL(T), TPMGL(T)> > op,
  TPMGL(T) unit) {
    
    //#line 671 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->template reduce<TPMGL(T) >(
             op, op, unit);
    
}

//#line 685 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c

//#line 709 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::lang::String> x10::array::DistArray<TPMGL(T)>::toString(
  ) {
    
    //#line 710 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return ((((x10aux::string_utils::lit("DistArray(")) + (((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
                                                             FMGL(dist)))) + (x10aux::string_utils::lit(")")));
    
}

//#line 719 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::lang::Iterator<x10aux::ref<x10::array::Point> > >
  x10::array::DistArray<TPMGL(T)>::iterator() {
    
    //#line 719 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return x10aux::nullCheck(((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->x10::array::DistArray<TPMGL(T)>::region())->iterator();
    
}

//#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> >
  x10::array::DistArray<TPMGL(T)>::x10__array__DistArray____x10__array__DistArray__this(
  ) {
    
    //#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this);
    
}

//#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> void x10::array::DistArray<TPMGL(T)>::__fieldInitializers33980(
  ) {
    
    //#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
      FMGL(cachedRawValid) = false;
    
    //#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::array::DistArray<TPMGL(T)> >)this)->
      FMGL(cachedRaw) = x10aux::zeroValue<x10::util::IndexedMemoryChunk<TPMGL(T) > >();
}
template<class TPMGL(T)> const x10aux::serialization_id_t x10::array::DistArray<TPMGL(T)>::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10::array::DistArray<TPMGL(T)>::_deserializer, x10aux::CLOSURE_KIND_NOT_ASYNC);

template<class TPMGL(T)> void x10::array::DistArray<TPMGL(T)>::_serialize_body(x10aux::serialization_buffer& buf) {
    x10::lang::Object::_serialize_body(buf);
    buf.write(this->FMGL(localHandle));
    buf.write(this->FMGL(dist));
    
}

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

template<class TPMGL(T)> void x10::array::DistArray<TPMGL(T)>::_deserialize_body(x10aux::deserialization_buffer& buf) {
    x10::lang::Object::_deserialize_body(buf);
    FMGL(localHandle) = buf.read<x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::DistArray__LocalState<TPMGL(T)> > > >();
    FMGL(dist) = buf.read<x10aux::ref<x10::array::Dist> >();
}

template<class TPMGL(T)> x10aux::RuntimeType x10::array::DistArray<TPMGL(T)>::rtt;
template<class TPMGL(T)> void x10::array::DistArray<TPMGL(T)>::_initRTT() {
    const x10aux::RuntimeType *canonical = x10aux::getRTT<x10::array::DistArray<void> >();
    if (rtt.initStageOne(canonical)) return;
    const x10aux::RuntimeType* parents[3] = { x10aux::getRTT<x10::lang::Object>(), x10aux::getRTT<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> >(), x10aux::getRTT<x10::lang::Iterable<x10aux::ref<x10::array::Point> > >()};
    const x10aux::RuntimeType* params[1] = { x10aux::getRTT<TPMGL(T)>()};
    x10aux::RuntimeType::Variance variances[1] = { x10aux::RuntimeType::invariant};
    const char *baseName = "x10.array.DistArray";
    rtt.initStageTwo(baseName, x10aux::RuntimeType::class_kind, 3, parents, 1, params, variances);
}
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> >
  x10::array::DistArray<void>::make(x10aux::ref<x10::array::Dist> dist)
{
    
    //#line 109 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return x10::array::DistArray<TPMGL(T)>::_make(dist);
    
}
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> >
  x10::array::DistArray<void>::make(x10aux::ref<x10::array::Dist> dist,
                                    x10aux::ref<x10::lang::Fun_0_1<x10aux::ref<x10::array::Point>, TPMGL(T)> > init)
{
    
    //#line 140 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return x10::array::DistArray<TPMGL(T)>::_make(dist, init);
    
}
template<class TPMGL(T)> x10aux::ref<x10::array::DistArray<TPMGL(T)> >
  x10::array::DistArray<void>::make(x10aux::ref<x10::array::Dist> dist,
                                    TPMGL(T) init) {
                                                       
                                                       //#line 168 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
                                                       return x10::array::DistArray<TPMGL(T)>::_make(dist,
                                                                                                     init);
                                                       
                                                   }
#endif // X10_ARRAY_DISTARRAY_H_IMPLEMENTATION
#endif // __X10_ARRAY_DISTARRAY_H_NODEPS
