From 88d428ae0dc9db3f42f2a05fec7df91b76f8621c Mon Sep 17 00:00:00 2001
From: Christian Gram Kalhauge <chrg@dtu.dk>
Date: Wed, 6 Mar 2024 12:28:23 +0100
Subject: [PATCH] Try to remove functions first.

---
 rtree-c/src/ReduceC.hs                        | 23 ++++++++-----------
 rtree-c/test/cases/small/functions.c          |  3 ++-
 rtree-c/test/expected/functions/main.c        |  3 ++-
 .../expected/functions/reduction/r000000000.c | 19 +++++++--------
 .../expected/functions/reduction/r000000001.c | 19 +++++++--------
 .../expected/functions/reduction/r000000010.c | 19 +++++++--------
 .../expected/functions/reduction/r000000011.c | 19 +++++++--------
 .../expected/functions/reduction/r000000100.c | 19 +++++++--------
 .../expected/functions/reduction/r000000101.c | 19 +++++++--------
 .../expected/functions/reduction/r000000110.c | 19 +++++++--------
 .../expected/functions/reduction/r000000111.c | 19 +++++++--------
 .../expected/functions/reduction/r0000010.c   | 15 ++++++------
 .../expected/functions/reduction/r0000011.c   | 15 ++++++------
 .../expected/functions/reduction/r000010000.c | 19 +++++++--------
 .../expected/functions/reduction/r000010001.c | 19 +++++++--------
 .../expected/functions/reduction/r000010010.c | 19 +++++++--------
 .../expected/functions/reduction/r000010011.c | 19 +++++++--------
 .../expected/functions/reduction/r000010100.c | 19 +++++++--------
 .../expected/functions/reduction/r000010101.c | 19 +++++++--------
 .../expected/functions/reduction/r00001011.c  | 17 +++++++-------
 .../expected/functions/reduction/r000011.c    | 13 ++++++-----
 .../test/expected/functions/reduction/r0001.c |  9 ++++----
 .../expected/functions/reduction/r001000000.c | 16 ++++++-------
 .../expected/functions/reduction/r001000001.c | 16 ++++++-------
 .../expected/functions/reduction/r001000010.c | 16 ++++++-------
 .../expected/functions/reduction/r001000011.c | 16 ++++++-------
 .../expected/functions/reduction/r001000100.c | 16 ++++++-------
 .../expected/functions/reduction/r001000101.c | 16 ++++++-------
 .../expected/functions/reduction/r001000110.c | 16 ++++++-------
 .../expected/functions/reduction/r001000111.c | 16 ++++++-------
 .../expected/functions/reduction/r0010010.c   | 12 +++++-----
 .../expected/functions/reduction/r0010011.c   | 12 +++++-----
 .../expected/functions/reduction/r001010000.c | 16 ++++++-------
 .../expected/functions/reduction/r001010001.c | 16 ++++++-------
 .../expected/functions/reduction/r001010010.c | 16 ++++++-------
 .../expected/functions/reduction/r001010011.c | 16 ++++++-------
 .../expected/functions/reduction/r001010100.c | 16 ++++++-------
 .../expected/functions/reduction/r001010101.c | 16 ++++++-------
 .../expected/functions/reduction/r00101011.c  | 14 +++++------
 .../expected/functions/reduction/r001011.c    | 10 ++++----
 .../test/expected/functions/reduction/r0011.c |  6 ++---
 .../expected/functions/reduction/r010000.c    | 14 -----------
 .../expected/functions/reduction/r0100000.c   | 16 +++++++++++++
 .../expected/functions/reduction/r0100001.c   | 16 +++++++++++++
 .../expected/functions/reduction/r010001.c    | 14 -----------
 .../expected/functions/reduction/r0100010.c   | 16 +++++++++++++
 .../expected/functions/reduction/r0100011.c   | 16 +++++++++++++
 .../expected/functions/reduction/r010010.c    | 14 -----------
 .../expected/functions/reduction/r0100100.c   | 16 +++++++++++++
 .../expected/functions/reduction/r0100101.c   | 16 +++++++++++++
 .../expected/functions/reduction/r010011.c    | 11 +++++----
 .../test/expected/functions/reduction/r0101.c | 12 ++++++++++
 .../expected/functions/reduction/r010100.c    | 14 -----------
 .../expected/functions/reduction/r01011.c     | 13 -----------
 .../expected/functions/reduction/r0110000.c   | 15 ++++++++++++
 .../expected/functions/reduction/r0110001.c   | 15 ++++++++++++
 .../expected/functions/reduction/r0110010.c   | 15 ++++++++++++
 .../expected/functions/reduction/r0110011.c   | 15 ++++++++++++
 .../expected/functions/reduction/r0110100.c   | 15 ++++++++++++
 .../expected/functions/reduction/r0110101.c   | 15 ++++++++++++
 .../reduction/{r010101.c => r011011.c}        | 10 ++++----
 .../functions/reduction/{r011.c => r0111.c}   |  5 ++--
 .../expected/functions/reduction/r100000.c    | 14 +++++++++++
 .../expected/functions/reduction/r1000000.c   | 15 ------------
 .../expected/functions/reduction/r1000001.c   | 15 ------------
 .../expected/functions/reduction/r100001.c    | 14 +++++++++++
 .../expected/functions/reduction/r1000010.c   | 15 ------------
 .../expected/functions/reduction/r1000011.c   | 15 ------------
 .../expected/functions/reduction/r100010.c    | 14 +++++++++++
 .../expected/functions/reduction/r1000100.c   | 15 ------------
 .../expected/functions/reduction/r1000101.c   | 15 ------------
 .../expected/functions/reduction/r100011.c    | 12 +++++-----
 .../test/expected/functions/reduction/r1001.c | 11 ---------
 .../expected/functions/reduction/r100100.c    | 14 +++++++++++
 .../expected/functions/reduction/r100101.c    | 14 +++++++++++
 .../reduction/{r101011.c => r10011.c}         |  9 ++++----
 .../functions/reduction/{r1011.c => r101.c}   |  5 ++--
 .../expected/functions/reduction/r1010000.c   | 15 ------------
 .../expected/functions/reduction/r1010001.c   | 15 ------------
 .../expected/functions/reduction/r1010010.c   | 15 ------------
 .../expected/functions/reduction/r1010011.c   | 15 ------------
 .../expected/functions/reduction/r1010100.c   | 15 ------------
 .../expected/functions/reduction/r1010101.c   | 15 ------------
 .../test/expected/functions/reduction/r1100.c |  6 ++---
 .../test/expected/functions/reduction/r1101.c |  6 ++---
 .../test/expected/functions/reduction/r111.c  |  4 ++--
 rtree-c/test/src/ReduceCSpec.hs               | 18 +++++++--------
 87 files changed, 641 insertions(+), 615 deletions(-)
 delete mode 100644 rtree-c/test/expected/functions/reduction/r010000.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0100000.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0100001.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r010001.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0100010.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0100011.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r010010.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0100100.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0100101.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0101.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r010100.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r01011.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0110000.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0110001.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0110010.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0110011.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0110100.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r0110101.c
 rename rtree-c/test/expected/functions/reduction/{r010101.c => r011011.c} (54%)
 rename rtree-c/test/expected/functions/reduction/{r011.c => r0111.c} (55%)
 create mode 100644 rtree-c/test/expected/functions/reduction/r100000.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1000000.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1000001.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r100001.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1000010.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1000011.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r100010.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1000100.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1000101.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1001.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r100100.c
 create mode 100644 rtree-c/test/expected/functions/reduction/r100101.c
 rename rtree-c/test/expected/functions/reduction/{r101011.c => r10011.c} (55%)
 rename rtree-c/test/expected/functions/reduction/{r1011.c => r101.c} (56%)
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1010000.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1010001.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1010010.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1010011.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1010100.c
 delete mode 100644 rtree-c/test/expected/functions/reduction/r1010101.c

diff --git a/rtree-c/src/ReduceC.hs b/rtree-c/src/ReduceC.hs
index 3030de0..ff0c6ee 100644
--- a/rtree-c/src/ReduceC.hs
+++ b/rtree-c/src/ReduceC.hs
@@ -150,22 +150,22 @@ reduceCTranslUnit
   -> Context
   -> m (C.CTranslationUnit C.NodeInfo)
 reduceCTranslUnit (C.CTranslUnit es ni) ctx = do
-  es' <- foldr reduceCExternalDeclaration (\_ -> pure []) es ctx
+  res' <- foldr reduceCExternalDeclaration (\_ -> pure []) es ctx
+  es' <- sequence res'
   pure $ C.CTranslUnit es' ni
 
 reduceCExternalDeclaration
   :: (MonadReduce Lab m)
   => C.CExternalDeclaration C.NodeInfo
-  -> (Context -> m [C.CExternalDeclaration C.NodeInfo])
+  -> (Context -> m [m (C.CExternalDeclaration C.NodeInfo)])
   -> Context
-  -> m [C.CExternalDeclaration C.NodeInfo]
+  -> m [m (C.CExternalDeclaration C.NodeInfo)]
 reduceCExternalDeclaration r cont ctx = do
   -- TODO This is slow
   case r of
     C.CFDefExt fun
       | KeepMain `isIn` ctx && maybe False (("main" ==) . C.identToString) (functionName fun) -> do
-          r' <- C.CFDefExt <$> reduceCFunDef fun ctx
-          (r' :) <$> cont ctx
+          ((C.CFDefExt <$> reduceCFunDef fun ctx) :) <$> cont ctx
       | otherwise ->
           case functionName fun of
             Just fid -> do
@@ -173,20 +173,17 @@ reduceCExternalDeclaration r cont ctx = do
                 ("remove function " <> C.identToString fid, C.posOf r)
                 (cont (addInlineExpr fid IEDelete ctx))
                 do
-                  r' <- C.CFDefExt <$> reduceCFunDef fun ctx
-                  (r' :) <$> cont (addInlineExpr fid IEKeep ctx)
+                  ((C.CFDefExt <$> reduceCFunDef fun ctx) :) <$> cont (addInlineExpr fid IEKeep ctx)
             Nothing -> do
               split
                 ("remove function", C.posOf r)
                 (cont ctx)
-                do
-                  r' <- C.CFDefExt <$> reduceCFunDef fun ctx
-                  (r' :) <$> cont ctx
+                (((C.CFDefExt <$> reduceCFunDef fun ctx) :) <$> cont ctx)
     C.CDeclExt decl -> do
       (decl', ctx') <- handleDecl decl ctx
-      cont ctx' <&> \a -> case decl' of
-        Just d -> C.CDeclExt d : a
-        Nothing -> a
+      case decl' of
+        Just d -> (pure (C.CDeclExt d) :) <$> cont ctx'
+        Nothing -> cont ctx'
     _r -> don'tHandle r
 
 data StructDef = StructDef
diff --git a/rtree-c/test/cases/small/functions.c b/rtree-c/test/cases/small/functions.c
index 3c013ec..5f485d4 100644
--- a/rtree-c/test/cases/small/functions.c
+++ b/rtree-c/test/cases/small/functions.c
@@ -1,7 +1,8 @@
 int f(int a) { 
+  a;
 }
 
-static int g(int a) { 
+int g(int a) { 
 }
 
 int main() { 
diff --git a/rtree-c/test/expected/functions/main.c b/rtree-c/test/expected/functions/main.c
index 6c27bbd..e382894 100644
--- a/rtree-c/test/expected/functions/main.c
+++ b/rtree-c/test/expected/functions/main.c
@@ -1,7 +1,8 @@
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000000000.c b/rtree-c/test/expected/functions/reduction/r000000000.c
index 22361ac..ccb8a46 100644
--- a/rtree-c/test/expected/functions/reduction/r000000000.c
+++ b/rtree-c/test/expected/functions/reduction/r000000000.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000000001.c b/rtree-c/test/expected/functions/reduction/r000000001.c
index e8bed9f..fb815f1 100644
--- a/rtree-c/test/expected/functions/reduction/r000000001.c
+++ b/rtree-c/test/expected/functions/reduction/r000000001.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000000010.c b/rtree-c/test/expected/functions/reduction/r000000010.c
index 8777499..65bb961 100644
--- a/rtree-c/test/expected/functions/reduction/r000000010.c
+++ b/rtree-c/test/expected/functions/reduction/r000000010.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000000011.c b/rtree-c/test/expected/functions/reduction/r000000011.c
index bd8abb8..9bd144f 100644
--- a/rtree-c/test/expected/functions/reduction/r000000011.c
+++ b/rtree-c/test/expected/functions/reduction/r000000011.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000000100.c b/rtree-c/test/expected/functions/reduction/r000000100.c
index 0b62277..d4d0edb 100644
--- a/rtree-c/test/expected/functions/reduction/r000000100.c
+++ b/rtree-c/test/expected/functions/reduction/r000000100.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000000101.c b/rtree-c/test/expected/functions/reduction/r000000101.c
index 839cae9..159b2bb 100644
--- a/rtree-c/test/expected/functions/reduction/r000000101.c
+++ b/rtree-c/test/expected/functions/reduction/r000000101.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000000110.c b/rtree-c/test/expected/functions/reduction/r000000110.c
index 946e44b..af563b6 100644
--- a/rtree-c/test/expected/functions/reduction/r000000110.c
+++ b/rtree-c/test/expected/functions/reduction/r000000110.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000000111.c b/rtree-c/test/expected/functions/reduction/r000000111.c
index 87badda..350ddfc 100644
--- a/rtree-c/test/expected/functions/reduction/r000000111.c
+++ b/rtree-c/test/expected/functions/reduction/r000000111.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r0000010.c b/rtree-c/test/expected/functions/reduction/r0000010.c
index fef82a2..fea6cde 100644
--- a/rtree-c/test/expected/functions/reduction/r0000010.c
+++ b/rtree-c/test/expected/functions/reduction/r0000010.c
@@ -1,15 +1,16 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r0000011.c b/rtree-c/test/expected/functions/reduction/r0000011.c
index 97c1f82..1ef696a 100644
--- a/rtree-c/test/expected/functions/reduction/r0000011.c
+++ b/rtree-c/test/expected/functions/reduction/r0000011.c
@@ -1,15 +1,16 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000010000.c b/rtree-c/test/expected/functions/reduction/r000010000.c
index 8df0263..ff51eaf 100644
--- a/rtree-c/test/expected/functions/reduction/r000010000.c
+++ b/rtree-c/test/expected/functions/reduction/r000010000.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000010001.c b/rtree-c/test/expected/functions/reduction/r000010001.c
index f83642c..7fe5ca7 100644
--- a/rtree-c/test/expected/functions/reduction/r000010001.c
+++ b/rtree-c/test/expected/functions/reduction/r000010001.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000010010.c b/rtree-c/test/expected/functions/reduction/r000010010.c
index efb0502..737c4b1 100644
--- a/rtree-c/test/expected/functions/reduction/r000010010.c
+++ b/rtree-c/test/expected/functions/reduction/r000010010.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000010011.c b/rtree-c/test/expected/functions/reduction/r000010011.c
index ab439fa..34d75a7 100644
--- a/rtree-c/test/expected/functions/reduction/r000010011.c
+++ b/rtree-c/test/expected/functions/reduction/r000010011.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000010100.c b/rtree-c/test/expected/functions/reduction/r000010100.c
index c47fce7..9c0e7af 100644
--- a/rtree-c/test/expected/functions/reduction/r000010100.c
+++ b/rtree-c/test/expected/functions/reduction/r000010100.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000010101.c b/rtree-c/test/expected/functions/reduction/r000010101.c
index 4fa1e07..25559ad 100644
--- a/rtree-c/test/expected/functions/reduction/r000010101.c
+++ b/rtree-c/test/expected/functions/reduction/r000010101.c
@@ -1,17 +1,18 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r00001011.c b/rtree-c/test/expected/functions/reduction/r00001011.c
index a86552b..e7d9902 100644
--- a/rtree-c/test/expected/functions/reduction/r00001011.c
+++ b/rtree-c/test/expected/functions/reduction/r00001011.c
@@ -1,16 +1,17 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r000011.c b/rtree-c/test/expected/functions/reduction/r000011.c
index eef7a25..370b30f 100644
--- a/rtree-c/test/expected/functions/reduction/r000011.c
+++ b/rtree-c/test/expected/functions/reduction/r000011.c
@@ -1,14 +1,15 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r0001.c b/rtree-c/test/expected/functions/reduction/r0001.c
index 872dd58..4d52ddb 100644
--- a/rtree-c/test/expected/functions/reduction/r0001.c
+++ b/rtree-c/test/expected/functions/reduction/r0001.c
@@ -1,12 +1,13 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 1 remove statement at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 1 remove statement at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r001000000.c b/rtree-c/test/expected/functions/reduction/r001000000.c
index e234a1c..f5ce516 100644
--- a/rtree-c/test/expected/functions/reduction/r001000000.c
+++ b/rtree-c/test/expected/functions/reduction/r001000000.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001000001.c b/rtree-c/test/expected/functions/reduction/r001000001.c
index 25bfbd6..fd77d83 100644
--- a/rtree-c/test/expected/functions/reduction/r001000001.c
+++ b/rtree-c/test/expected/functions/reduction/r001000001.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001000010.c b/rtree-c/test/expected/functions/reduction/r001000010.c
index 1781459..077c6ec 100644
--- a/rtree-c/test/expected/functions/reduction/r001000010.c
+++ b/rtree-c/test/expected/functions/reduction/r001000010.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001000011.c b/rtree-c/test/expected/functions/reduction/r001000011.c
index 85f7458..8d6b985 100644
--- a/rtree-c/test/expected/functions/reduction/r001000011.c
+++ b/rtree-c/test/expected/functions/reduction/r001000011.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001000100.c b/rtree-c/test/expected/functions/reduction/r001000100.c
index 87b10da..9d9b8f4 100644
--- a/rtree-c/test/expected/functions/reduction/r001000100.c
+++ b/rtree-c/test/expected/functions/reduction/r001000100.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001000101.c b/rtree-c/test/expected/functions/reduction/r001000101.c
index 51cf2fa..f6a5792 100644
--- a/rtree-c/test/expected/functions/reduction/r001000101.c
+++ b/rtree-c/test/expected/functions/reduction/r001000101.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001000110.c b/rtree-c/test/expected/functions/reduction/r001000110.c
index 857ff48..5c72354 100644
--- a/rtree-c/test/expected/functions/reduction/r001000110.c
+++ b/rtree-c/test/expected/functions/reduction/r001000110.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001000111.c b/rtree-c/test/expected/functions/reduction/r001000111.c
index 930630c..ba39159 100644
--- a/rtree-c/test/expected/functions/reduction/r001000111.c
+++ b/rtree-c/test/expected/functions/reduction/r001000111.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r0010010.c b/rtree-c/test/expected/functions/reduction/r0010010.c
index 0627186..5432d1d 100644
--- a/rtree-c/test/expected/functions/reduction/r0010010.c
+++ b/rtree-c/test/expected/functions/reduction/r0010010.c
@@ -1,10 +1,10 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r0010011.c b/rtree-c/test/expected/functions/reduction/r0010011.c
index b87f01e..72f391c 100644
--- a/rtree-c/test/expected/functions/reduction/r0010011.c
+++ b/rtree-c/test/expected/functions/reduction/r0010011.c
@@ -1,10 +1,10 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001010000.c b/rtree-c/test/expected/functions/reduction/r001010000.c
index 1cf9c7c..acef64d 100644
--- a/rtree-c/test/expected/functions/reduction/r001010000.c
+++ b/rtree-c/test/expected/functions/reduction/r001010000.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001010001.c b/rtree-c/test/expected/functions/reduction/r001010001.c
index 24bf263..6428898 100644
--- a/rtree-c/test/expected/functions/reduction/r001010001.c
+++ b/rtree-c/test/expected/functions/reduction/r001010001.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001010010.c b/rtree-c/test/expected/functions/reduction/r001010010.c
index 45e4699..2c3f95f 100644
--- a/rtree-c/test/expected/functions/reduction/r001010010.c
+++ b/rtree-c/test/expected/functions/reduction/r001010010.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001010011.c b/rtree-c/test/expected/functions/reduction/r001010011.c
index 06fe706..0b06a61 100644
--- a/rtree-c/test/expected/functions/reduction/r001010011.c
+++ b/rtree-c/test/expected/functions/reduction/r001010011.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001010100.c b/rtree-c/test/expected/functions/reduction/r001010100.c
index 1c3a300..0741914 100644
--- a/rtree-c/test/expected/functions/reduction/r001010100.c
+++ b/rtree-c/test/expected/functions/reduction/r001010100.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001010101.c b/rtree-c/test/expected/functions/reduction/r001010101.c
index 904d845..8a33be2 100644
--- a/rtree-c/test/expected/functions/reduction/r001010101.c
+++ b/rtree-c/test/expected/functions/reduction/r001010101.c
@@ -1,12 +1,12 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r00101011.c b/rtree-c/test/expected/functions/reduction/r00101011.c
index c151f80..a2c0aa0 100644
--- a/rtree-c/test/expected/functions/reduction/r00101011.c
+++ b/rtree-c/test/expected/functions/reduction/r00101011.c
@@ -1,11 +1,11 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r001011.c b/rtree-c/test/expected/functions/reduction/r001011.c
index 1c3989b..0b9e2ef 100644
--- a/rtree-c/test/expected/functions/reduction/r001011.c
+++ b/rtree-c/test/expected/functions/reduction/r001011.c
@@ -1,9 +1,9 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r0011.c b/rtree-c/test/expected/functions/reduction/r0011.c
index 13e0025..68a96b5 100644
--- a/rtree-c/test/expected/functions/reduction/r0011.c
+++ b/rtree-c/test/expected/functions/reduction/r0011.c
@@ -1,7 +1,7 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 1 remove statement at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 1 remove statement at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r010000.c b/rtree-c/test/expected/functions/reduction/r010000.c
deleted file mode 100644
index 5ea9bc4..0000000
--- a/rtree-c/test/expected/functions/reduction/r010000.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 1 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
-
-int f(int a)
-{
-}
-int main()
-{
-    return f(42);
-}
diff --git a/rtree-c/test/expected/functions/reduction/r0100000.c b/rtree-c/test/expected/functions/reduction/r0100000.c
new file mode 100644
index 0000000..daa74ae
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0100000.c
@@ -0,0 +1,16 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+    a;
+}
+int main()
+{
+    return f(42);
+}
diff --git a/rtree-c/test/expected/functions/reduction/r0100001.c b/rtree-c/test/expected/functions/reduction/r0100001.c
new file mode 100644
index 0000000..69dedde
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0100001.c
@@ -0,0 +1,16 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+    a;
+}
+int main()
+{
+    return 0;
+}
diff --git a/rtree-c/test/expected/functions/reduction/r010001.c b/rtree-c/test/expected/functions/reduction/r010001.c
deleted file mode 100644
index f85193e..0000000
--- a/rtree-c/test/expected/functions/reduction/r010001.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 1 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
-
-int f(int a)
-{
-}
-int main()
-{
-    return 0;
-}
diff --git a/rtree-c/test/expected/functions/reduction/r0100010.c b/rtree-c/test/expected/functions/reduction/r0100010.c
new file mode 100644
index 0000000..2958389
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0100010.c
@@ -0,0 +1,16 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+    a;
+}
+int main()
+{
+    return f(0);
+}
diff --git a/rtree-c/test/expected/functions/reduction/r0100011.c b/rtree-c/test/expected/functions/reduction/r0100011.c
new file mode 100644
index 0000000..e5faf17
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0100011.c
@@ -0,0 +1,16 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+    a;
+}
+int main()
+{
+    return 0;
+}
diff --git a/rtree-c/test/expected/functions/reduction/r010010.c b/rtree-c/test/expected/functions/reduction/r010010.c
deleted file mode 100644
index fb40908..0000000
--- a/rtree-c/test/expected/functions/reduction/r010010.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 1 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
-
-int f(int a)
-{
-}
-int main()
-{
-    return f(0);
-}
diff --git a/rtree-c/test/expected/functions/reduction/r0100100.c b/rtree-c/test/expected/functions/reduction/r0100100.c
new file mode 100644
index 0000000..e013cd2
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0100100.c
@@ -0,0 +1,16 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+    a;
+}
+int main()
+{
+    return 42;
+}
diff --git a/rtree-c/test/expected/functions/reduction/r0100101.c b/rtree-c/test/expected/functions/reduction/r0100101.c
new file mode 100644
index 0000000..370ffd0
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0100101.c
@@ -0,0 +1,16 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+    a;
+}
+int main()
+{
+    return 0;
+}
diff --git a/rtree-c/test/expected/functions/reduction/r010011.c b/rtree-c/test/expected/functions/reduction/r010011.c
index e03e630..ec2cdf9 100644
--- a/rtree-c/test/expected/functions/reduction/r010011.c
+++ b/rtree-c/test/expected/functions/reduction/r010011.c
@@ -1,12 +1,13 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 1 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
+    a;
 }
 int main()
 {
diff --git a/rtree-c/test/expected/functions/reduction/r0101.c b/rtree-c/test/expected/functions/reduction/r0101.c
new file mode 100644
index 0000000..1e2eb20
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0101.c
@@ -0,0 +1,12 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 2)
+// 1 remove statement at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+    a;
+}
+int main()
+{
+}
diff --git a/rtree-c/test/expected/functions/reduction/r010100.c b/rtree-c/test/expected/functions/reduction/r010100.c
deleted file mode 100644
index 022a557..0000000
--- a/rtree-c/test/expected/functions/reduction/r010100.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 1 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
-
-int f(int a)
-{
-}
-int main()
-{
-    return 42;
-}
diff --git a/rtree-c/test/expected/functions/reduction/r01011.c b/rtree-c/test/expected/functions/reduction/r01011.c
deleted file mode 100644
index 9b8bb5e..0000000
--- a/rtree-c/test/expected/functions/reduction/r01011.c
+++ /dev/null
@@ -1,13 +0,0 @@
-// 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 1 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-
-int f(int a)
-{
-}
-int main()
-{
-    return 0;
-}
diff --git a/rtree-c/test/expected/functions/reduction/r0110000.c b/rtree-c/test/expected/functions/reduction/r0110000.c
new file mode 100644
index 0000000..eed6086
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0110000.c
@@ -0,0 +1,15 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+}
+int main()
+{
+    return f(42);
+}
diff --git a/rtree-c/test/expected/functions/reduction/r0110001.c b/rtree-c/test/expected/functions/reduction/r0110001.c
new file mode 100644
index 0000000..32f89d1
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0110001.c
@@ -0,0 +1,15 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+}
+int main()
+{
+    return 0;
+}
diff --git a/rtree-c/test/expected/functions/reduction/r0110010.c b/rtree-c/test/expected/functions/reduction/r0110010.c
new file mode 100644
index 0000000..60885b6
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0110010.c
@@ -0,0 +1,15 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+}
+int main()
+{
+    return f(0);
+}
diff --git a/rtree-c/test/expected/functions/reduction/r0110011.c b/rtree-c/test/expected/functions/reduction/r0110011.c
new file mode 100644
index 0000000..b80173d
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0110011.c
@@ -0,0 +1,15 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+}
+int main()
+{
+    return 0;
+}
diff --git a/rtree-c/test/expected/functions/reduction/r0110100.c b/rtree-c/test/expected/functions/reduction/r0110100.c
new file mode 100644
index 0000000..261a6b9
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0110100.c
@@ -0,0 +1,15 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+}
+int main()
+{
+    return 42;
+}
diff --git a/rtree-c/test/expected/functions/reduction/r0110101.c b/rtree-c/test/expected/functions/reduction/r0110101.c
new file mode 100644
index 0000000..31054fd
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r0110101.c
@@ -0,0 +1,15 @@
+// 0 remove function f at ("test/cases/small/functions.c": line 1)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int f(int a)
+{
+}
+int main()
+{
+    return 0;
+}
diff --git a/rtree-c/test/expected/functions/reduction/r010101.c b/rtree-c/test/expected/functions/reduction/r011011.c
similarity index 54%
rename from rtree-c/test/expected/functions/reduction/r010101.c
rename to rtree-c/test/expected/functions/reduction/r011011.c
index 8ef81a4..bf7786e 100644
--- a/rtree-c/test/expected/functions/reduction/r010101.c
+++ b/rtree-c/test/expected/functions/reduction/r011011.c
@@ -1,9 +1,9 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 1 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r011.c b/rtree-c/test/expected/functions/reduction/r0111.c
similarity index 55%
rename from rtree-c/test/expected/functions/reduction/r011.c
rename to rtree-c/test/expected/functions/reduction/r0111.c
index 39c73e7..bc0c52f 100644
--- a/rtree-c/test/expected/functions/reduction/r011.c
+++ b/rtree-c/test/expected/functions/reduction/r0111.c
@@ -1,6 +1,7 @@
 // 0 remove function f at ("test/cases/small/functions.c": line 1)
-// 1 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove statement at ("test/cases/small/functions.c": line 8)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 2)
+// 1 remove statement at ("test/cases/small/functions.c": line 9)
 
 int f(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r100000.c b/rtree-c/test/expected/functions/reduction/r100000.c
new file mode 100644
index 0000000..921e971
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r100000.c
@@ -0,0 +1,14 @@
+// 1 remove function f at ("test/cases/small/functions.c": line 1)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int g(int a)
+{
+}
+int main()
+{
+    return g(42);
+}
diff --git a/rtree-c/test/expected/functions/reduction/r1000000.c b/rtree-c/test/expected/functions/reduction/r1000000.c
deleted file mode 100644
index a9f70dc..0000000
--- a/rtree-c/test/expected/functions/reduction/r1000000.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
-
-static int g(int a)
-{
-}
-int main()
-{
-    return g(42);
-}
diff --git a/rtree-c/test/expected/functions/reduction/r1000001.c b/rtree-c/test/expected/functions/reduction/r1000001.c
deleted file mode 100644
index cabb1bb..0000000
--- a/rtree-c/test/expected/functions/reduction/r1000001.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
-
-static int g(int a)
-{
-}
-int main()
-{
-    return 0;
-}
diff --git a/rtree-c/test/expected/functions/reduction/r100001.c b/rtree-c/test/expected/functions/reduction/r100001.c
new file mode 100644
index 0000000..2151a04
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r100001.c
@@ -0,0 +1,14 @@
+// 1 remove function f at ("test/cases/small/functions.c": line 1)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int g(int a)
+{
+}
+int main()
+{
+    return 0;
+}
diff --git a/rtree-c/test/expected/functions/reduction/r1000010.c b/rtree-c/test/expected/functions/reduction/r1000010.c
deleted file mode 100644
index d629f15..0000000
--- a/rtree-c/test/expected/functions/reduction/r1000010.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
-
-static int g(int a)
-{
-}
-int main()
-{
-    return g(0);
-}
diff --git a/rtree-c/test/expected/functions/reduction/r1000011.c b/rtree-c/test/expected/functions/reduction/r1000011.c
deleted file mode 100644
index 210a171..0000000
--- a/rtree-c/test/expected/functions/reduction/r1000011.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
-
-static int g(int a)
-{
-}
-int main()
-{
-    return 0;
-}
diff --git a/rtree-c/test/expected/functions/reduction/r100010.c b/rtree-c/test/expected/functions/reduction/r100010.c
new file mode 100644
index 0000000..d110399
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r100010.c
@@ -0,0 +1,14 @@
+// 1 remove function f at ("test/cases/small/functions.c": line 1)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int g(int a)
+{
+}
+int main()
+{
+    return g(0);
+}
diff --git a/rtree-c/test/expected/functions/reduction/r1000100.c b/rtree-c/test/expected/functions/reduction/r1000100.c
deleted file mode 100644
index 21d1c0c..0000000
--- a/rtree-c/test/expected/functions/reduction/r1000100.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
-
-static int g(int a)
-{
-}
-int main()
-{
-    return 42;
-}
diff --git a/rtree-c/test/expected/functions/reduction/r1000101.c b/rtree-c/test/expected/functions/reduction/r1000101.c
deleted file mode 100644
index 652b3c9..0000000
--- a/rtree-c/test/expected/functions/reduction/r1000101.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
-
-static int g(int a)
-{
-}
-int main()
-{
-    return 0;
-}
diff --git a/rtree-c/test/expected/functions/reduction/r100011.c b/rtree-c/test/expected/functions/reduction/r100011.c
index 25cdf8b..14fc412 100644
--- a/rtree-c/test/expected/functions/reduction/r100011.c
+++ b/rtree-c/test/expected/functions/reduction/r100011.c
@@ -1,11 +1,11 @@
 // 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
-static int g(int a)
+int g(int a)
 {
 }
 int main()
diff --git a/rtree-c/test/expected/functions/reduction/r1001.c b/rtree-c/test/expected/functions/reduction/r1001.c
deleted file mode 100644
index 6f2ae79..0000000
--- a/rtree-c/test/expected/functions/reduction/r1001.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove static at ("test/cases/small/functions.c": line 4)
-// 1 remove statement at ("test/cases/small/functions.c": line 8)
-
-static int g(int a)
-{
-}
-int main()
-{
-}
diff --git a/rtree-c/test/expected/functions/reduction/r100100.c b/rtree-c/test/expected/functions/reduction/r100100.c
new file mode 100644
index 0000000..fdd84d8
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r100100.c
@@ -0,0 +1,14 @@
+// 1 remove function f at ("test/cases/small/functions.c": line 1)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int g(int a)
+{
+}
+int main()
+{
+    return 42;
+}
diff --git a/rtree-c/test/expected/functions/reduction/r100101.c b/rtree-c/test/expected/functions/reduction/r100101.c
new file mode 100644
index 0000000..6e38ed4
--- /dev/null
+++ b/rtree-c/test/expected/functions/reduction/r100101.c
@@ -0,0 +1,14 @@
+// 1 remove function f at ("test/cases/small/functions.c": line 1)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 0 do without pram at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
+
+int g(int a)
+{
+}
+int main()
+{
+    return 0;
+}
diff --git a/rtree-c/test/expected/functions/reduction/r101011.c b/rtree-c/test/expected/functions/reduction/r10011.c
similarity index 55%
rename from rtree-c/test/expected/functions/reduction/r101011.c
rename to rtree-c/test/expected/functions/reduction/r10011.c
index b5c4c0f..fea5e9e 100644
--- a/rtree-c/test/expected/functions/reduction/r101011.c
+++ b/rtree-c/test/expected/functions/reduction/r10011.c
@@ -1,9 +1,8 @@
 // 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 do without function at ("test/cases/small/functions.c": line 9)
+// 1 do without pram at ("test/cases/small/functions.c": line 9)
 
 int g(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r1011.c b/rtree-c/test/expected/functions/reduction/r101.c
similarity index 56%
rename from rtree-c/test/expected/functions/reduction/r1011.c
rename to rtree-c/test/expected/functions/reduction/r101.c
index 5b4125c..3e3220c 100644
--- a/rtree-c/test/expected/functions/reduction/r1011.c
+++ b/rtree-c/test/expected/functions/reduction/r101.c
@@ -1,7 +1,6 @@
 // 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 1 remove statement at ("test/cases/small/functions.c": line 8)
+// 0 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 9)
 
 int g(int a)
 {
diff --git a/rtree-c/test/expected/functions/reduction/r1010000.c b/rtree-c/test/expected/functions/reduction/r1010000.c
deleted file mode 100644
index 18ca7c0..0000000
--- a/rtree-c/test/expected/functions/reduction/r1010000.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
-
-int g(int a)
-{
-}
-int main()
-{
-    return g(42);
-}
diff --git a/rtree-c/test/expected/functions/reduction/r1010001.c b/rtree-c/test/expected/functions/reduction/r1010001.c
deleted file mode 100644
index 4e875f7..0000000
--- a/rtree-c/test/expected/functions/reduction/r1010001.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
-
-int g(int a)
-{
-}
-int main()
-{
-    return 0;
-}
diff --git a/rtree-c/test/expected/functions/reduction/r1010010.c b/rtree-c/test/expected/functions/reduction/r1010010.c
deleted file mode 100644
index efc759a..0000000
--- a/rtree-c/test/expected/functions/reduction/r1010010.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
-
-int g(int a)
-{
-}
-int main()
-{
-    return g(0);
-}
diff --git a/rtree-c/test/expected/functions/reduction/r1010011.c b/rtree-c/test/expected/functions/reduction/r1010011.c
deleted file mode 100644
index 82fe6f2..0000000
--- a/rtree-c/test/expected/functions/reduction/r1010011.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 do without function at ("test/cases/small/functions.c": line 8)
-// 1 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
-
-int g(int a)
-{
-}
-int main()
-{
-    return 0;
-}
diff --git a/rtree-c/test/expected/functions/reduction/r1010100.c b/rtree-c/test/expected/functions/reduction/r1010100.c
deleted file mode 100644
index 320c06f..0000000
--- a/rtree-c/test/expected/functions/reduction/r1010100.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
-
-int g(int a)
-{
-}
-int main()
-{
-    return 42;
-}
diff --git a/rtree-c/test/expected/functions/reduction/r1010101.c b/rtree-c/test/expected/functions/reduction/r1010101.c
deleted file mode 100644
index 6e5f74c..0000000
--- a/rtree-c/test/expected/functions/reduction/r1010101.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 0 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove static at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 do without function at ("test/cases/small/functions.c": line 8)
-// 0 do without pram at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
-
-int g(int a)
-{
-}
-int main()
-{
-    return 0;
-}
diff --git a/rtree-c/test/expected/functions/reduction/r1100.c b/rtree-c/test/expected/functions/reduction/r1100.c
index 7ec41ba..69f54b8 100644
--- a/rtree-c/test/expected/functions/reduction/r1100.c
+++ b/rtree-c/test/expected/functions/reduction/r1100.c
@@ -1,7 +1,7 @@
 // 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 1 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 0 replace by zero at ("test/cases/small/functions.c": line 8)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 0 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int main()
 {
diff --git a/rtree-c/test/expected/functions/reduction/r1101.c b/rtree-c/test/expected/functions/reduction/r1101.c
index 0d8137f..637502e 100644
--- a/rtree-c/test/expected/functions/reduction/r1101.c
+++ b/rtree-c/test/expected/functions/reduction/r1101.c
@@ -1,7 +1,7 @@
 // 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 1 remove function g at ("test/cases/small/functions.c": line 4)
-// 0 remove statement at ("test/cases/small/functions.c": line 8)
-// 1 replace by zero at ("test/cases/small/functions.c": line 8)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 0 remove statement at ("test/cases/small/functions.c": line 9)
+// 1 replace by zero at ("test/cases/small/functions.c": line 9)
 
 int main()
 {
diff --git a/rtree-c/test/expected/functions/reduction/r111.c b/rtree-c/test/expected/functions/reduction/r111.c
index 168e38f..e242b80 100644
--- a/rtree-c/test/expected/functions/reduction/r111.c
+++ b/rtree-c/test/expected/functions/reduction/r111.c
@@ -1,6 +1,6 @@
 // 1 remove function f at ("test/cases/small/functions.c": line 1)
-// 1 remove function g at ("test/cases/small/functions.c": line 4)
-// 1 remove statement at ("test/cases/small/functions.c": line 8)
+// 1 remove function g at ("test/cases/small/functions.c": line 5)
+// 1 remove statement at ("test/cases/small/functions.c": line 9)
 
 int main()
 {
diff --git a/rtree-c/test/src/ReduceCSpec.hs b/rtree-c/test/src/ReduceCSpec.hs
index 5a0497e..5970c6a 100644
--- a/rtree-c/test/src/ReduceCSpec.hs
+++ b/rtree-c/test/src/ReduceCSpec.hs
@@ -24,7 +24,6 @@ import qualified Test.Hspec.Expectations.Pretty as EP
 import qualified Control.Monad.IRTree as IRTree
 import qualified Control.Monad.RTree as RTree
 import Data.Bits
-import Data.Bool
 import Data.Functor
 import Data.RPath
 import Data.String
@@ -71,9 +70,9 @@ specLargeCases = do
             createDirectoryIfMissing True a
             0 & fix \rec n -> do
               let idx = fromString (replicate (1 `shiftL` n) '1')
-              let (c', t) = IRTree.probe (defaultReduceC c) idx
+              let (c', t, _) = IRTree.probe (defaultReduceC c) idx
               render (expected </> "reduction" </> "x" <> show n <.> "c") c'
-              unless (all fst t) do
+              unless (all ((/= Undecided) . choice) t) do
                 rec (n + 1)
         )
         do
@@ -83,10 +82,11 @@ specLargeCases = do
 
 specSmallCases :: Spec
 specSmallCases = do
-  cases <- runIO (listDirectory "test/cases/small")
+  let testcases = "test" </> "cases" </> "small"
+  cases <- runIO (listDirectory testcases)
 
   forM_ cases \cname -> do
-    let cfrom = "test/cases/small" </> cname
+    let cfrom = testcases </> cname
 
     describe cfrom do
       c <- runIO $ parse cfrom
@@ -141,15 +141,15 @@ render cto c = do
   createDirectoryIfMissing True (takeDirectory cto)
   writeFile cto (P.render (C.pretty c) <> "\n")
 
-renderWithChoices :: FilePath -> (C.CTranslUnit, [(Bool, (String, C.Position))]) -> IO ()
-renderWithChoices file (c, a) = do
+renderWithChoices :: FilePath -> (C.CTranslUnit, [AnnotatedChoice (String, C.Position)], Int) -> IO ()
+renderWithChoices file (c, a, _) = do
   createDirectoryIfMissing True (takeDirectory file)
   writeFile
     file
     ( ( unlines
           . map
-            ( \(choice, (reason, pos)) ->
-                "// " <> bool "0" "1" choice <> " " <> reason <> " at " <> show pos
+            ( \(AnnotatedChoice cs (reason, pos)) ->
+                "// " <> [debugShowChoice cs] <> " " <> reason <> " at " <> show pos
             )
           $ a
       )
-- 
GitLab