module "/pliant/language/context.pli"

function doit n
  arg Int n
  var Int x := 0
  
  for (var Int a) 0 n-1
    for (var Int b) 0 n-1
      for (var Int c) 0 n-1
        for (var Int d) 0 n-1
          for (var Int e) 0 n-1
            for (var Int f) 0 n-1
              x += 1
              
  console x eol

gvar Str s_n := cast ((pliant_script_args translate Address 1) map CStr) Str
if (s_n parse (gvar Int n))
  doit n
else
  console "usage: nestedloop.pli <number>" eol