create or replace function timingcheck(n int) returns bigint as $$
declare arr int[] := '{}';
  res bigint := 0;
  dummyvar0 int := 0;
  dummyvar1 int := 0;
  dummyvar2 int := 0;
  dummyvar3 int := 0;
  dummyvar4 int := 0;
  dummyvar5 int := 0;
  dummyvar6 int := 0;
  dummyvar7 int := 0;
  dummyvar8 int := 0;
  dummyvar9 int := 0;
/*
  dummyvar10 int := 0;
  dummyvar11 int := 0;
  dummyvar12 int := 0;
  dummyvar13 int := 0;
  dummyvar14 int := 0;
  dummyvar15 int := 0;
  dummyvar16 int := 0;
  dummyvar17 int := 0;
  dummyvar18 int := 0;
  dummyvar19 int := 0;
  dummyvar20 int := 0;
  dummyvar21 int := 0;
  dummyvar22 int := 0;
  dummyvar23 int := 0;
  dummyvar24 int := 0;
  dummyvar25 int := 0;
  dummyvar26 int := 0;
  dummyvar27 int := 0;
  dummyvar28 int := 0;
  dummyvar29 int := 0;
  dummyvar30 int := 0;
  dummyvar31 int := 0;
  dummyvar32 int := 0;
  dummyvar33 int := 0;
  dummyvar34 int := 0;
  dummyvar35 int := 0;
  dummyvar36 int := 0;
  dummyvar37 int := 0;
  dummyvar38 int := 0;
  dummyvar39 int := 0;
  dummyvar40 int := 0;
  dummyvar41 int := 0;
  dummyvar42 int := 0;
  dummyvar43 int := 0;
  dummyvar44 int := 0;
  dummyvar45 int := 0;
  dummyvar46 int := 0;
  dummyvar47 int := 0;
  dummyvar48 int := 0;
  dummyvar49 int := 0;
  dummyvar50 int := 0;
  dummyvar51 int := 0;
  dummyvar52 int := 0;
  dummyvar53 int := 0;
  dummyvar54 int := 0;
  dummyvar55 int := 0;
  dummyvar56 int := 0;
  dummyvar57 int := 0;
  dummyvar58 int := 0;
  dummyvar59 int := 0;
  dummyvar60 int := 0;
  dummyvar61 int := 0;
  dummyvar62 int := 0;
  dummyvar63 int := 0;
  dummyvar64 int := 0;
  dummyvar65 int := 0;
  dummyvar66 int := 0;
  dummyvar67 int := 0;
  dummyvar68 int := 0;
  dummyvar69 int := 0;
  dummyvar70 int := 0;
  dummyvar71 int := 0;
  dummyvar72 int := 0;
  dummyvar73 int := 0;
  dummyvar74 int := 0;
  dummyvar75 int := 0;
  dummyvar76 int := 0;
  dummyvar77 int := 0;
  dummyvar78 int := 0;
  dummyvar79 int := 0;
  dummyvar80 int := 0;
  dummyvar81 int := 0;
  dummyvar82 int := 0;
  dummyvar83 int := 0;
  dummyvar84 int := 0;
  dummyvar85 int := 0;
  dummyvar86 int := 0;
  dummyvar87 int := 0;
  dummyvar88 int := 0;
  dummyvar89 int := 0;
  dummyvar90 int := 0;
  dummyvar91 int := 0;
  dummyvar92 int := 0;
  dummyvar93 int := 0;
  dummyvar94 int := 0;
  dummyvar95 int := 0;
  dummyvar96 int := 0;
  dummyvar97 int := 0;
  dummyvar98 int := 0;
  dummyvar99 int := 0;
*/
begin
  for i in 1 .. n loop
    arr[10] := i;
    res := res + arr[10];
  end loop;
  return res;
end
$$ language plpgsql strict stable;

create or replace function reusecheck10(n int) returns bigint as $$
declare res bigint := 0;
begin
  for i in 1 .. n loop
    res := res + i + i + i + i + i + i + i + i + i + i;
  end loop;
  return res;
end
$$ language plpgsql strict stable;

create or replace function reusecheck5(n int) returns bigint as $$
declare res bigint := 0;
begin
  for i in 1 .. n loop
    res := res + i + i + i + i + i;
  end loop;
  return res;
end
$$ language plpgsql strict stable;
