#ifndef __X10_LANG_ACCUMULATOR_H
#define __X10_LANG_ACCUMULATOR_H

#include <x10rt.h>


#define X10_LANG_ACC_H_NODEPS
#include <x10/lang/Acc.h>
#undef X10_LANG_ACC_H_NODEPS
#define X10_IO_CUSTOMSERIALIZATION_H_NODEPS
#include <x10/io/CustomSerialization.h>
#undef X10_IO_CUSTOMSERIALIZATION_H_NODEPS
#define X10_LANG_GLOBALREF_H_NODEPS
#include <x10/lang/GlobalRef.h>
#undef X10_LANG_GLOBALREF_H_NODEPS
namespace x10 { namespace lang { 
template<class TPMGL(T)> class GlobalRef;
} } 
namespace x10 { namespace compiler { 
class NonEscaping;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(T)> class Reducible;
} } 
namespace x10 { namespace lang { 
class String;
} } 
namespace x10 { namespace lang { 
class Runtime;
} } 
namespace x10 { namespace lang { 
class Any;
} } 
namespace x10 { namespace io { 
class SerialData;
} } 
namespace x10 { namespace array { 
template<class TPMGL(T)> class Array;
} } 
namespace x10 { namespace lang { 
class Boolean;
} } 
namespace x10 { namespace compiler { 
class CompilerFlags;
} } 
namespace x10 { namespace lang { 
class FailedDynamicCheckException;
} } 
namespace x10 { namespace lang { 
class VoidFun_0_0;
} } 
namespace x10 { namespace lang { 
class Throwable;
} } 
namespace x10 { namespace compiler { 
class Finalization;
} } 
namespace x10 { namespace compiler { 
class Abort;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(U)> class Fun_0_0;
} } 
namespace x10 { namespace lang { 
class IllegalOperationException;
} } 
namespace x10 { namespace lang { 
class Place;
} } 
namespace x10 { namespace lang { 

template<class TPMGL(T)> class Accumulator;
template <> class Accumulator<void>;
template<class TPMGL(T)> class Accumulator : public x10::lang::Acc   {
    public:
    RTT_H_DECLS_CLASS
    
    static x10aux::itable_entry _itables[3];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    static x10::io::CustomSerialization::itable<x10::lang::Accumulator<TPMGL(T)> > _itable_0;
    
    static x10::lang::Any::itable<x10::lang::Accumulator<TPMGL(T)> > _itable_1;
    
    x10::lang::GlobalRef<x10aux::ref<x10::lang::Acc> > FMGL(root);
    
    TPMGL(T) FMGL(curr);
    
    x10aux::ref<x10::lang::Reducible<TPMGL(T)> > FMGL(red);
    
    void _constructor(x10aux::ref<x10::lang::Reducible<TPMGL(T)> > red);
    
    static x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > _make(x10aux::ref<x10::lang::Reducible<TPMGL(T)> > red);
    
    void _constructor(x10aux::ref<x10::io::SerialData> data);
    
    static x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > _make(x10aux::ref<x10::io::SerialData> data);
    
    virtual x10aux::ref<x10::io::SerialData> serialize();
    virtual x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > me();
    virtual void __larrow(TPMGL(T) t);
    virtual void __set(TPMGL(T) t);
    TPMGL(T) localGetResult();
    virtual TPMGL(T) __apply();
    virtual void supply(x10aux::ref<x10::lang::Any> t);
    virtual void reset(x10aux::ref<x10::lang::Any> t);
    virtual x10aux::ref<x10::lang::Any> result();
    virtual x10aux::ref<x10::lang::Any> calcResult();
    virtual void acceptResult(x10aux::ref<x10::lang::Any> a);
    virtual x10::lang::GlobalRef<x10aux::ref<x10::lang::Acc> > getRoot();
    virtual x10::lang::Place home();
    virtual x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > x10__lang__Accumulator____x10__lang__Accumulator__this(
      );
    
    // Serialization
    public: static const x10aux::serialization_id_t _serialization_id;
    
    public: virtual x10aux::serialization_id_t _get_serialization_id() {
         return _serialization_id;
    }
    
    public: virtual void _serialize_body(x10aux::serialization_buffer& buf);
    
    public: static x10aux::ref<x10::lang::Reference> _deserializer(x10aux::deserialization_buffer& buf);
    
    public: void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};
template <> class Accumulator<void> : public x10::lang::Acc {
    public:
    static x10aux::RuntimeType rtt;
    static const x10aux::RuntimeType* getRTT() { return & rtt; }
    static void MYPRINT(x10aux::ref<x10::lang::String> msg);
    
    
};

} } 
#endif // X10_LANG_ACCUMULATOR_H

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

#ifndef X10_LANG_ACCUMULATOR_H_NODEPS
#define X10_LANG_ACCUMULATOR_H_NODEPS
#include <x10/lang/Acc.h>
#include <x10/io/CustomSerialization.h>
#include <x10/lang/GlobalRef.h>
#include <x10/compiler/NonEscaping.h>
#include <x10/lang/Reducible.h>
#include <x10/lang/String.h>
#include <x10/lang/Runtime.h>
#include <x10/lang/Any.h>
#include <x10/io/SerialData.h>
#include <x10/array/Array.h>
#include <x10/lang/Boolean.h>
#include <x10/compiler/CompilerFlags.h>
#include <x10/lang/FailedDynamicCheckException.h>
#include <x10/lang/VoidFun_0_0.h>
#include <x10/lang/Throwable.h>
#include <x10/compiler/Finalization.h>
#include <x10/compiler/Abort.h>
#include <x10/lang/Fun_0_0.h>
#include <x10/lang/IllegalOperationException.h>
#include <x10/lang/Place.h>
#ifndef X10_LANG_ACCUMULATOR_H_GENERICS
#define X10_LANG_ACCUMULATOR_H_GENERICS
#endif // X10_LANG_ACCUMULATOR_H_GENERICS
#ifndef X10_LANG_ACCUMULATOR_H_IMPLEMENTATION
#define X10_LANG_ACCUMULATOR_H_IMPLEMENTATION
#include <x10/lang/Accumulator.h>

#ifndef X10_LANG_ACCUMULATOR__CLOSURE__1_CLOSURE
#define X10_LANG_ACCUMULATOR__CLOSURE__1_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/VoidFun_0_0.h>
template<class TPMGL(T)> class x10_lang_Accumulator__closure__1 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::VoidFun_0_0::template itable <x10_lang_Accumulator__closure__1<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    void __apply() {
        
        //#line 65 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > me = saved_this->me();
        {
            
            //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable42560 = X10_NULL;
            
            //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": polyglot.ast.Try_c
            try {
                {
                    
                    //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10Call_c
                    x10::lang::Runtime::enterAtomic();
                    {
                        
                        //#line 68 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10FieldAssign_c
                        x10aux::nullCheck(me)->FMGL(curr) = x10::lang::Reducible<TPMGL(T)>::__apply(x10aux::nullCheck(x10aux::nullCheck(me)->
                                                                                                                        FMGL(red)), 
                                                              x10aux::nullCheck(me)->
                                                                FMGL(curr),
                                                              t);
                    }
                }
                
                //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__1011) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__1011 = (x10aux::ref<x10::lang::Throwable>&)__ref__1011;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal42561 =
                      static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1011);
                    {
                        
                        //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable42560 = formal42561;
                    }
                } else
                throw;
            }
            
            //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable42560)))
            {
                
                //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable42560))
                {
                    
                    //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable42560));
                }
                
            }
            
            //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::exitAtomic();
            }
            
            //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable42560)))
            {
                
                //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable42560)))
                {
                    
                    //#line 67 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable42560));
                }
                
            }
            
        }
    }
    
    // captured environment
    x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > saved_this;
    TPMGL(T) t;
    
    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->t);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_lang_Accumulator__closure__1<TPMGL(T) >* storage = x10aux::alloc<x10_lang_Accumulator__closure__1<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_lang_Accumulator__closure__1<TPMGL(T) > >(storage));
        x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > that_saved_this = buf.read<x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > >();
        TPMGL(T) that_t = buf.read<TPMGL(T)>();
        x10aux::ref<x10_lang_Accumulator__closure__1<TPMGL(T) > > this_ = new (storage) x10_lang_Accumulator__closure__1<TPMGL(T) >(that_saved_this, that_t);
        return this_;
    }
    
    x10_lang_Accumulator__closure__1(x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > saved_this, TPMGL(T) t) : saved_this(saved_this), t(t) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::VoidFun_0_0>(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::VoidFun_0_0>(); }
    
    x10aux::ref<x10::lang::String> toString() {
        return x10aux::string_utils::lit(this->toNativeString());
    }
    
    const char* toNativeString() {
        return "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10:64-70";
    }

};

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

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

#endif // X10_LANG_ACCUMULATOR__CLOSURE__1_CLOSURE
#ifndef X10_LANG_ACCUMULATOR__CLOSURE__2_CLOSURE
#define X10_LANG_ACCUMULATOR__CLOSURE__2_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/VoidFun_0_0.h>
template<class TPMGL(T)> class x10_lang_Accumulator__closure__2 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::VoidFun_0_0::template itable <x10_lang_Accumulator__closure__2<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    void __apply() {
        
        //#line 77 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > me = saved_this->me();
        {
            
            //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10LocalDecl_c
            x10aux::ref<x10::lang::Throwable> throwable42563 = X10_NULL;
            
            //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": polyglot.ast.Try_c
            try {
                {
                    
                    //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10Call_c
                    x10::lang::Runtime::enterAtomic();
                    {
                        
                        //#line 80 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10FieldAssign_c
                        x10aux::nullCheck(me)->FMGL(curr) = t;
                    }
                }
                
                //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10Call_c
                x10::compiler::Finalization::plausibleThrow();
            }
            catch (x10aux::__ref& __ref__1013) {
                x10aux::ref<x10::lang::Throwable>& __exc__ref__1013 = (x10aux::ref<x10::lang::Throwable>&)__ref__1013;
                if (true) {
                    x10aux::ref<x10::lang::Throwable> formal42564 = static_cast<x10aux::ref<x10::lang::Throwable> >(__exc__ref__1013);
                    {
                        
                        //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10LocalAssign_c
                        throwable42563 = formal42564;
                    }
                } else
                throw;
            }
            
            //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable42563))) {
                
                //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
                if (x10aux::instanceof<x10aux::ref<x10::compiler::Abort> >(throwable42563))
                {
                    
                    //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable42563));
                }
                
            }
            
            //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10Call_c
                x10::lang::Runtime::exitAtomic();
            }
            
            //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
            if ((!x10aux::struct_equals(X10_NULL, throwable42563)))
            {
                
                //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
                if (!(x10aux::instanceof<x10aux::ref<x10::compiler::Finalization> >(throwable42563)))
                {
                    
                    //#line 79 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": polyglot.ast.Throw_c
                    x10aux::throwException(x10aux::nullCheck(throwable42563));
                }
                
            }
            
        }
    }
    
    // captured environment
    x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > saved_this;
    TPMGL(T) t;
    
    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->t);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_lang_Accumulator__closure__2<TPMGL(T) >* storage = x10aux::alloc<x10_lang_Accumulator__closure__2<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_lang_Accumulator__closure__2<TPMGL(T) > >(storage));
        x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > that_saved_this = buf.read<x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > >();
        TPMGL(T) that_t = buf.read<TPMGL(T)>();
        x10aux::ref<x10_lang_Accumulator__closure__2<TPMGL(T) > > this_ = new (storage) x10_lang_Accumulator__closure__2<TPMGL(T) >(that_saved_this, that_t);
        return this_;
    }
    
    x10_lang_Accumulator__closure__2(x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > saved_this, TPMGL(T) t) : saved_this(saved_this), t(t) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::VoidFun_0_0>(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::VoidFun_0_0>(); }
    
    x10aux::ref<x10::lang::String> toString() {
        return x10aux::string_utils::lit(this->toNativeString());
    }
    
    const char* toNativeString() {
        return "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10:76-82";
    }

};

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

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

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

};

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

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

#endif // X10_LANG_ACCUMULATOR__CLOSURE__3_CLOSURE
template<class TPMGL(T)> x10::io::CustomSerialization::itable<x10::lang::Accumulator<TPMGL(T)> >  x10::lang::Accumulator<TPMGL(T)>::_itable_0(&x10::lang::Accumulator<TPMGL(T)>::equals, &x10::lang::Accumulator<TPMGL(T)>::hashCode, &x10::lang::Accumulator<TPMGL(T)>::serialize, &x10::lang::Accumulator<TPMGL(T)>::toString, &x10::lang::Accumulator<TPMGL(T)>::typeName);
template<class TPMGL(T)> x10::lang::Any::itable<x10::lang::Accumulator<TPMGL(T)> >  x10::lang::Accumulator<TPMGL(T)>::_itable_1(&x10::lang::Accumulator<TPMGL(T)>::equals, &x10::lang::Accumulator<TPMGL(T)>::hashCode, &x10::lang::Accumulator<TPMGL(T)>::toString, &x10::lang::Accumulator<TPMGL(T)>::typeName);
template<class TPMGL(T)> x10aux::itable_entry x10::lang::Accumulator<TPMGL(T)>::_itables[3] = {x10aux::itable_entry(&x10aux::getRTT<x10::io::CustomSerialization>, &_itable_0), x10aux::itable_entry(&x10aux::getRTT<x10::lang::Any>, &_itable_1), x10aux::itable_entry(NULL, (void*)x10aux::getRTT<x10::lang::Accumulator<TPMGL(T)> >())};

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

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

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

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

//#line 30 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(T)> void x10::lang::Accumulator<TPMGL(T)>::_constructor(
                           x10aux::ref<x10::lang::Reducible<TPMGL(T)> > red) {
    
    //#line 30 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Acc::_constructor();
    
    //#line 30 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.AssignPropertyCall_c
    
    //#line 32 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->FMGL(red) = red;
    
    //#line 33 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->FMGL(root) = x10::lang::GlobalRef<x10aux::ref<x10::lang::Acc> >::_make(x10aux::class_cast_unchecked<x10aux::ref<x10::lang::Acc> >(((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)));
    
    //#line 34 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->FMGL(curr) = x10::lang::Reducible<TPMGL(T)>::zero(x10aux::nullCheck(red));
}
template<class TPMGL(T)> x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > x10::lang::Accumulator<TPMGL(T)>::_make(
                           x10aux::ref<x10::lang::Reducible<TPMGL(T)> > red)
{
    x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > this_ = new (memset(x10aux::alloc<x10::lang::Accumulator<TPMGL(T)> >(), 0, sizeof(x10::lang::Accumulator<TPMGL(T)>))) x10::lang::Accumulator<TPMGL(T)>();
    this_->_constructor(red);
    return this_;
}



//#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(T)> void x10::lang::Accumulator<TPMGL(T)>::_constructor(
                           x10aux::ref<x10::io::SerialData> data) {
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Acc::_constructor();
    
    //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.AssignPropertyCall_c
    
    //#line 38 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::array::Array<x10aux::ref<x10::lang::Any> > > arr =
      (__extension__ ({
        
        //#line 38 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Array<x10aux::ref<x10::lang::Any> > > __desugarer__var__55__42548 =
          x10aux::class_cast<x10aux::ref<x10::array::Array<x10aux::ref<x10::lang::Any> > > >(x10aux::nullCheck(data)->
                                                                                               FMGL(data));
        
        //#line 38 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10LocalDecl_c
        x10aux::ref<x10::array::Array<x10aux::ref<x10::lang::Any> > > ret42549;
        
        //#line 38 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
        if (!((x10aux::struct_equals(x10aux::nullCheck(__desugarer__var__55__42548)->
                                       FMGL(rank), ((x10_int)1)))))
        {
            
            //#line 38 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 38 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": polyglot.ast.Throw_c
                x10aux::throwException(x10aux::nullCheck(x10::lang::FailedDynamicCheckException::_make(x10aux::string_utils::lit("x10.array.Array[x10.lang.Any]{self.rank==1}"))));
            }
            
        }
        
        //#line 38 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10LocalAssign_c
        ret42549 = __desugarer__var__55__42548;
        ret42549;
    }))
    ;
    
    //#line 39 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
      FMGL(red) = (x10aux::class_cast<x10aux::ref<x10::lang::Reducible<TPMGL(T)> > >(x10aux::nullCheck(arr)->x10::array::Array<x10aux::ref<x10::lang::Any> >::__apply(
                                                                                       ((x10_int)0))));
    
    //#line 40 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
      FMGL(root) = (x10aux::class_cast<x10::lang::GlobalRef<x10aux::ref<x10::lang::Acc> > >(x10aux::nullCheck(arr)->x10::array::Array<x10aux::ref<x10::lang::Any> >::__apply(
                                                                                              ((x10_int)1))));
    
    //#line 41 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
      FMGL(curr) = x10::lang::Reducible<TPMGL(T)>::zero(x10aux::nullCheck(((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
                                                                            FMGL(red)));
}
template<class TPMGL(T)> x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > x10::lang::Accumulator<TPMGL(T)>::_make(
                           x10aux::ref<x10::io::SerialData> data)
{
    x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > this_ = new (memset(x10aux::alloc<x10::lang::Accumulator<TPMGL(T)> >(), 0, sizeof(x10::lang::Accumulator<TPMGL(T)>))) x10::lang::Accumulator<TPMGL(T)>();
    this_->_constructor(data);
    return this_;
}



//#line 43 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::io::SerialData>
  x10::lang::Accumulator<TPMGL(T)>::serialize() {
    
    //#line 43 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10Return_c
    return x10::io::SerialData::_make(x10aux::class_cast_unchecked<x10aux::ref<x10::lang::Any> >((x10aux::ref<x10::array::Array<x10aux::ref<x10::lang::Any> > >)(__extension__ ({
                                          x10aux::ref<x10::array::Array<x10aux::ref<x10::lang::Any> > > __var1008__(x10::array::Array<x10aux::ref<x10::lang::Any> >::_make(2));
                                          __var1008__->__set(0, 
                                          (x10aux::class_cast_unchecked<x10aux::ref<x10::lang::Any> >(((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
                                                                                                        FMGL(red))));
                                          __var1008__->__set(1, 
                                          (x10aux::class_cast_unchecked<x10aux::ref<x10::lang::Any> >(((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
                                                                                                        FMGL(root))));
                                          __var1008__;
                                      }))), x10aux::class_cast_unchecked<x10aux::ref<x10::io::SerialData> >(X10_NULL));
    
}

//#line 59 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >
  x10::lang::Accumulator<TPMGL(T)>::me() {
    
    //#line 59 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10Return_c
    return x10aux::class_cast<x10aux::ref<x10::lang::Accumulator<TPMGL(T)> > >(((__extension__ ({
        
        //#line 59 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10LocalDecl_c
        x10::lang::GlobalRef<x10aux::ref<x10::lang::Acc> > __desugarer__var__56__42551 =
          ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
            FMGL(root);
        
        //#line 59 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10LocalDecl_c
        x10::lang::GlobalRef<x10aux::ref<x10::lang::Acc> > ret42552;
        
        //#line 59 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
        if (!((x10aux::struct_equals(x10::lang::Place::place((__desugarer__var__56__42551)->location),
                                     x10::lang::Place::_make(x10aux::here)))))
        {
            
            //#line 59 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10If_c
            if (true) {
                
                //#line 59 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": polyglot.ast.Throw_c
                x10aux::throwException(x10aux::nullCheck(x10::lang::FailedDynamicCheckException::_make(x10aux::string_utils::lit("x10.lang.GlobalRef[x10.lang.Acc]{self.home==here}"))));
            }
            
        }
        
        //#line 59 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10LocalAssign_c
        ret42552 = __desugarer__var__56__42551;
        ret42552;
    }))
    )->__apply());
    
}

//#line 63 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> void x10::lang::Accumulator<TPMGL(T)>::__larrow(
  TPMGL(T) t) {
    
    //#line 64 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10Call_c
    x10::lang::Runtime::runAt(x10::lang::Place::place((((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
                                                         FMGL(root))->location),
                              x10aux::ref<x10::lang::VoidFun_0_0>(x10aux::ref<x10_lang_Accumulator__closure__1<TPMGL(T) > >(new (x10aux::alloc<x10::lang::VoidFun_0_0>(sizeof(x10_lang_Accumulator__closure__1<TPMGL(T)>)))x10_lang_Accumulator__closure__1<TPMGL(T)>(this, t))));
}

//#line 75 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> void x10::lang::Accumulator<TPMGL(T)>::__set(
  TPMGL(T) t) {
    
    //#line 76 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10Call_c
    x10::lang::Runtime::runAt(x10::lang::Place::place((((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
                                                         FMGL(root))->location),
                              x10aux::ref<x10::lang::VoidFun_0_0>(x10aux::ref<x10_lang_Accumulator__closure__2<TPMGL(T) > >(new (x10aux::alloc<x10::lang::VoidFun_0_0>(sizeof(x10_lang_Accumulator__closure__2<TPMGL(T)>)))x10_lang_Accumulator__closure__2<TPMGL(T)>(this, t))));
}

//#line 85 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::lang::Accumulator<TPMGL(T)>::localGetResult(
  ) {
    
    //#line 87 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
             FMGL(curr);
    
}

//#line 89 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::lang::Accumulator<TPMGL(T)>::__apply(
  ) {
    
    //#line 90 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10Return_c
    return x10::lang::Runtime::template evalAt<TPMGL(T) >(
             x10::lang::Place::place((((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
                                        FMGL(root))->location),
             x10aux::ref<x10::lang::Fun_0_0<TPMGL(T)> >(x10aux::ref<x10_lang_Accumulator__closure__3<TPMGL(T) > >(new (x10aux::alloc<x10::lang::Fun_0_0<TPMGL(T)> >(sizeof(x10_lang_Accumulator__closure__3<TPMGL(T)>)))x10_lang_Accumulator__closure__3<TPMGL(T)>(this))));
    
}

//#line 94 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> void x10::lang::Accumulator<TPMGL(T)>::supply(
  x10aux::ref<x10::lang::Any> t) {
    
    //#line 95 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->__larrow(
      x10aux::class_cast<TPMGL(T)>(t));
}

//#line 97 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> void x10::lang::Accumulator<TPMGL(T)>::reset(
  x10aux::ref<x10::lang::Any> t) {
    
    //#line 98 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->__set(
      x10aux::class_cast<TPMGL(T)>(t));
}

//#line 100 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::lang::Any> x10::lang::Accumulator<TPMGL(T)>::result(
  ) {
    
    //#line 101 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10Return_c
    return x10aux::class_cast_unchecked<x10aux::ref<x10::lang::Any> >(((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->__apply());
    
}

//#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::lang::Any> x10::lang::Accumulator<TPMGL(T)>::calcResult(
  ) {
    
    //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": polyglot.ast.Throw_c
    x10aux::throwException(x10aux::nullCheck(x10::lang::IllegalOperationException::_make()));
}

//#line 106 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> void x10::lang::Accumulator<TPMGL(T)>::acceptResult(
  x10aux::ref<x10::lang::Any> a) {
    
    //#line 106 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": polyglot.ast.Throw_c
    x10aux::throwException(x10aux::nullCheck(x10::lang::IllegalOperationException::_make()));
}

//#line 107 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10::lang::GlobalRef<x10aux::ref<x10::lang::Acc> >
  x10::lang::Accumulator<TPMGL(T)>::getRoot() {
    
    //#line 107 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
             FMGL(root);
    
}

//#line 108 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10::lang::Place x10::lang::Accumulator<TPMGL(T)>::home(
  ) {
    
    //#line 108 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10Return_c
    return x10::lang::Place::place((((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this)->
                                      FMGL(root))->location);
    
}

//#line 20 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >
  x10::lang::Accumulator<TPMGL(T)>::x10__lang__Accumulator____x10__lang__Accumulator__this(
  ) {
    
    //#line 20 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/lang/Accumulator.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::lang::Accumulator<TPMGL(T)> >)this);
    
}
template<class TPMGL(T)> const x10aux::serialization_id_t x10::lang::Accumulator<TPMGL(T)>::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10::lang::Accumulator<TPMGL(T)>::_deserializer, x10aux::CLOSURE_KIND_NOT_ASYNC);

template<class TPMGL(T)> void x10::lang::Accumulator<TPMGL(T)>::_serialize_body(x10aux::serialization_buffer& buf) {
    /* NOTE: Implements x10.io.CustomSerialization */
    buf.write(this->serialize());
    
}

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

template<class TPMGL(T)> void x10::lang::Accumulator<TPMGL(T)>::_deserialize_body(x10aux::deserialization_buffer& buf) {
    /* NOTE: Implements x10.io.CustomSerialization */
    x10aux::ref<x10::io::SerialData>val_ = buf.read<x10aux::ref<x10::io::SerialData> >();
    _constructor(val_);
    
}

template<class TPMGL(T)> x10aux::RuntimeType x10::lang::Accumulator<TPMGL(T)>::rtt;
template<class TPMGL(T)> void x10::lang::Accumulator<TPMGL(T)>::_initRTT() {
    const x10aux::RuntimeType *canonical = x10aux::getRTT<x10::lang::Accumulator<void> >();
    if (rtt.initStageOne(canonical)) return;
    const x10aux::RuntimeType* parents[2] = { x10aux::getRTT<x10::lang::Acc>(), x10aux::getRTT<x10::io::CustomSerialization>()};
    const x10aux::RuntimeType* params[1] = { x10aux::getRTT<TPMGL(T)>()};
    x10aux::RuntimeType::Variance variances[1] = { x10aux::RuntimeType::invariant};
    const char *baseName = "x10.lang.Accumulator";
    rtt.initStageTwo(baseName, x10aux::RuntimeType::class_kind, 2, parents, 1, params, variances);
}
#endif // X10_LANG_ACCUMULATOR_H_IMPLEMENTATION
#endif // __X10_LANG_ACCUMULATOR_H_NODEPS
