Index: src/ControlStruct/TranslateEnumRange.cpp
===================================================================
--- src/ControlStruct/TranslateEnumRange.cpp	(revision d66a43bbd604d646532e6bdd2d5d5b10ce99fa6c)
+++ src/ControlStruct/TranslateEnumRange.cpp	(revision d3aa55e994d9978b6eeed324d12124cd1e92a452)
@@ -26,7 +26,11 @@
         auto enumDecl = enumInst->base;
 
-        auto init = stmt->inits.front();
+        auto objInit = stmt->inits.front();
 
-        if (auto declStmt = init.as<ast::DeclStmt>()) {
+        auto initLocation = objInit->location;
+        auto rangeLocation = stmt->range_over->location;
+        assert( stmt->inits.size() == 1 );
+
+        if (auto declStmt = objInit.as<ast::DeclStmt>()) {
             auto decl = declStmt->decl;
             if ( auto objDecl = decl.as<ast::ObjectDecl>()) {
@@ -57,5 +61,8 @@
                 if ( !objDecl->init ) {
                     auto location = stmt->location;
-                    auto newInit = new ast::SingleInit( location, new ast::NameExpr( location, enumDecl->members.front()->name ) );
+                    ast::SingleInit * newInit;
+                    newInit = new ast::SingleInit( location, 
+                        new ast::NameExpr( location, 
+                        stmt->is_inc? enumDecl->members.front()->name: enumDecl->members.back()->name ) );
                     auto objDeclWithInit = ast::mutate_field( objDecl, &ast::ObjectDecl::init, newInit );
                     auto declWithInit = ast::mutate_field( declStmt, &ast::DeclStmt::decl, objDeclWithInit );
@@ -78,13 +85,17 @@
     auto enumInst = typeExpr->type.strict_as<ast::EnumInstType>();
     auto enumDecl = enumInst->base;
-
-    auto condition = ast::UntypedExpr::createCall( location, "?<=?", {
-        new ast::NameExpr( location, indexName ),
-        // ast::ConstantExpr::from_ulong( location, enumDecl->members.size() )
-        new ast::NameExpr( location, enumDecl->members.back()->name )
-    });
-    auto increment = ast::UntypedExpr::createCall( location, "succ", {
-        new ast::NameExpr( location, indexName )
-    });
+    
+    // Both inc and dec check if the current posn less than the number of enumerator
+    // for dec, it keeps call pred until it passes 0 (the first enumerator) and underflow,
+    // it wraps around and become unsigned max
+    ast::UntypedExpr * condition = ast::UntypedExpr::createCall( location,
+        "?<=?",
+        { 
+            ast::UntypedExpr::createCall(location, "posn", { new ast::NameExpr( location, indexName ) } ),
+            ast::ConstantExpr::from_ulong( location, enumDecl->members.size()-1 )
+        });
+    auto increment = ast::UntypedExpr::createCall( location, 
+        stmt->is_inc? "succ": "pred",
+        { new ast::NameExpr( location, indexName ) });
     auto assig = ast::UntypedExpr::createAssign( location, new ast::NameExpr( location, indexName ), increment );
     auto mut = ast::mutate_field( stmt, &ast::ForStmt::cond, condition );
