diff --git a/.env b/.env
new file mode 100644
index 0000000000000000000000000000000000000000..98cea1ba56894e5bf53c88194eee3afc9ed9b089
--- /dev/null
+++ b/.env
@@ -0,0 +1 @@
+GHC=../ghc-js/_build/stage1/bin/javascript-unknown-ghcjs-ghc
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..a0f0e53867caaad1819e9c362c2b2be19af49088
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.vscode
+.DS_Store
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..4474c15123cf90bbc0ec9c2b13566977858633b2
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,175 @@
+                        Version 2.0, January 2004
+                    http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+  "License" shall mean the terms and conditions for use, reproduction,
+  and distribution as defined by Sections 1 through 9 of this document.
+
+  "Licensor" shall mean the copyright owner or entity authorized by
+  the copyright owner that is granting the License.
+
+  "Legal Entity" shall mean the union of the acting entity and all
+  other entities that control, are controlled by, or are under common
+  control with that entity. For the purposes of this definition,
+  "control" means (i) the power, direct or indirect, to cause the
+  direction or management of such entity, whether by contract or
+  otherwise, or (ii) ownership of fifty percent (50%) or more of the
+  outstanding shares, or (iii) beneficial ownership of such entity.
+
+  "You" (or "Your") shall mean an individual or Legal Entity
+  exercising permissions granted by this License.
+
+  "Source" form shall mean the preferred form for making modifications,
+  including but not limited to software source code, documentation
+  source, and configuration files.
+
+  "Object" form shall mean any form resulting from mechanical
+  transformation or translation of a Source form, including but
+  not limited to compiled object code, generated documentation,
+  and conversions to other media types.
+
+  "Work" shall mean the work of authorship, whether in Source or
+  Object form, made available under the License, as indicated by a
+  copyright notice that is included in or attached to the work
+  (an example is provided in the Appendix below).
+
+  "Derivative Works" shall mean any work, whether in Source or Object
+  form, that is based on (or derived from) the Work and for which the
+  editorial revisions, annotations, elaborations, or other modifications
+  represent, as a whole, an original work of authorship. For the purposes
+  of this License, Derivative Works shall not include works that remain
+  separable from, or merely link (or bind by name) to the interfaces of,
+  the Work and Derivative Works thereof.
+
+  "Contribution" shall mean any work of authorship, including
+  the original version of the Work and any modifications or additions
+  to that Work or Derivative Works thereof, that is intentionally
+  submitted to Licensor for inclusion in the Work by the copyright owner
+  or by an individual or Legal Entity authorized to submit on behalf of
+  the copyright owner. For the purposes of this definition, "submitted"
+  means any form of electronic, verbal, or written communication sent
+  to the Licensor or its representatives, including but not limited to
+  communication on electronic mailing lists, source code control systems,
+  and issue tracking systems that are managed by, or on behalf of, the
+  Licensor for the purpose of discussing and improving the Work, but
+  excluding communication that is conspicuously marked or otherwise
+  designated in writing by the copyright owner as "Not a Contribution."
+
+  "Contributor" shall mean Licensor and any individual or Legal Entity
+  on behalf of whom a Contribution has been received by Licensor and
+  subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+  this License, each Contributor hereby grants to You a perpetual,
+  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+  copyright license to reproduce, prepare Derivative Works of,
+  publicly display, publicly perform, sublicense, and distribute the
+  Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+  this License, each Contributor hereby grants to You a perpetual,
+  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+  (except as stated in this section) patent license to make, have made,
+  use, offer to sell, sell, import, and otherwise transfer the Work,
+  where such license applies only to those patent claims licensable
+  by such Contributor that are necessarily infringed by their
+  Contribution(s) alone or by combination of their Contribution(s)
+  with the Work to which such Contribution(s) was submitted. If You
+  institute patent litigation against any entity (including a
+  cross-claim or counterclaim in a lawsuit) alleging that the Work
+  or a Contribution incorporated within the Work constitutes direct
+  or contributory patent infringement, then any patent licenses
+  granted to You under this License for that Work shall terminate
+  as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+  Work or Derivative Works thereof in any medium, with or without
+  modifications, and in Source or Object form, provided that You
+  meet the following conditions:
+
+  (a) You must give any other recipients of the Work or
+      Derivative Works a copy of this License; and
+
+  (b) You must cause any modified files to carry prominent notices
+      stating that You changed the files; and
+
+  (c) You must retain, in the Source form of any Derivative Works
+      that You distribute, all copyright, patent, trademark, and
+      attribution notices from the Source form of the Work,
+      excluding those notices that do not pertain to any part of
+      the Derivative Works; and
+
+  (d) If the Work includes a "NOTICE" text file as part of its
+      distribution, then any Derivative Works that You distribute must
+      include a readable copy of the attribution notices contained
+      within such NOTICE file, excluding those notices that do not
+      pertain to any part of the Derivative Works, in at least one
+      of the following places: within a NOTICE text file distributed
+      as part of the Derivative Works; within the Source form or
+      documentation, if provided along with the Derivative Works; or,
+      within a display generated by the Derivative Works, if and
+      wherever such third-party notices normally appear. The contents
+      of the NOTICE file are for informational purposes only and
+      do not modify the License. You may add Your own attribution
+      notices within Derivative Works that You distribute, alongside
+      or as an addendum to the NOTICE text from the Work, provided
+      that such additional attribution notices cannot be construed
+      as modifying the License.
+
+  You may add Your own copyright statement to Your modifications and
+  may provide additional or different license terms and conditions
+  for use, reproduction, or distribution of Your modifications, or
+  for any such Derivative Works as a whole, provided Your use,
+  reproduction, and distribution of the Work otherwise complies with
+  the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+  any Contribution intentionally submitted for inclusion in the Work
+  by You to the Licensor shall be under the terms and conditions of
+  this License, without any additional terms or conditions.
+  Notwithstanding the above, nothing herein shall supersede or modify
+  the terms of any separate license agreement you may have executed
+  with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+  names, trademarks, service marks, or product names of the Licensor,
+  except as required for reasonable and customary use in describing the
+  origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+  agreed to in writing, Licensor provides the Work (and each
+  Contributor provides its Contributions) on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+  implied, including, without limitation, any warranties or conditions
+  of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+  PARTICULAR PURPOSE. You are solely responsible for determining the
+  appropriateness of using or redistributing the Work and assume any
+  risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+  whether in tort (including negligence), contract, or otherwise,
+  unless required by applicable law (such as deliberate and grossly
+  negligent acts) or agreed to in writing, shall any Contributor be
+  liable to You for damages, including any direct, indirect, special,
+  incidental, or consequential damages of any character arising as a
+  result of this License or out of the use or inability to use the
+  Work (including but not limited to damages for loss of goodwill,
+  work stoppage, computer failure or malfunction, or any and all
+  other commercial damages or losses), even if such Contributor
+  has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+  the Work or Derivative Works thereof, You may choose to offer,
+  and charge a fee for, acceptance of support, warranty, indemnity,
+  or other liability obligations and/or rights consistent with this
+  License. However, in accepting such obligations, You may act only
+  on Your own behalf and on Your sole responsibility, not on behalf
+  of any other Contributor, and only if You agree to indemnify,
+  defend, and hold each Contributor harmless for any liability
+  incurred by, or claims asserted against, such Contributor by reason
+  of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..23d61aa0c228ad4fa9a42543ce968a8ae9050c1d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,2 @@
+all:
+	source .env && ./trace_gv.sh "$${GHC}"
diff --git a/README.md b/README.md
index 56baf9c50603cb062c1be0a9648a203c8a5e06db..52413614904a00ab8d436e9b30ce00257b2f081f 100644
--- a/README.md
+++ b/README.md
@@ -1,93 +1,65 @@
 # STG javascript-backend-visualization
 
+The core idea behinds this repo is to create a tooling for graphical analyze `jsexe`s generated by GHC javascript-backend. Currently it does not produce commonjs/umd/amdjs compatible modules, so, it complicates answering on the quesion why `something` is used by `anything`. We need a way how to determing answers on such quesions if we want to deal with large bundle sizes.
 
+## Motivation
 
-## Getting started
+This project started as an attempt to shed the light on reasons why javascript hello-world bundle requires unicode table to have built-in. At first glance we should not have it built-in, we just want to write "Hello, World!" into the console. We do not query unicode table here for anything. Just printing the text. **So, why should we pay 3.5mb additionaly for printing "Hello, World!"**?
 
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
+## How to use generated output?
 
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
+Take a look into `/out` directory. It contains generated files for easier changes tracking.
 
-## Add your files
+## Special notes over implementation details
 
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
+We prevent inlining some functions such `h$rawStringData` for easier unicode extraction. We need extract unicode because its volume too hight to be processed by python tool. Sorry, I am not a good Python developer. :-)
 
-```
-cd existing_repo
-git remote add origin https://gitlab.haskell.org/gulin.serge/stg-javascript-backend-visualization.git
-git branch -M main
-git push -uf origin main
-```
-
-## Integrate with your tools
-
-- [ ] [Set up project integrations](https://gitlab.haskell.org/gulin.serge/stg-javascript-backend-visualization/-/settings/integrations)
-
-## Collaborate with your team
+Functions such as `h$o`, `h$sti`, `h$stc`, `h$stl` threated specially: arguments passed to them are connected to the graph same as it would be a functional call dependency.
 
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
+Graph data contains special tag `meta=` over edges to uncover which connection type is used. It is named as such special functions or `call` when usual function call is used to determine the call graph dependency.
 
-## Test and Deploy
+## How to generate output?
 
-Use the built-in continuous integration in GitLab.
+### Installation
 
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
+To make scripts work you need to have
+1. Builded GHC javascript-backend (with emscripted)
+2. Google Closure Compiler
 
-***
+### Generate
 
-# Editing this README
+If you have all tools installed and prepared above you can try to execute the following (suppose ghc sources located at one level above and has folder name `ghc-js`):
 
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
-
-## Suggestions for a good README
+```bash
+./trace_gv.sh ../ghc-js/_build/stage1/bin/javascript-unknown-ghcjs-ghc
+```
 
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
+It will regenerate `out` with new actual content.
 
-## Name
-Choose a self-explaining name for your project.
+* `out/all.js` Origin generated bundle by GHC javascript-backend.
+* `out/all.no_comments.js` Origin generated bundle by GHC javascript-backend but with stripped comments by Google Closure Compiler.
+  - `out/all.no_comments.js.tree` Google Closure Compiler AST.
+  - `out/all.no_comments.js.gv` Call graph with attention to STG references reconstructed from AST.
+* `out/all.min.js` Minified bundle by Google Closure Compiler from `out/all.js` with `ADVANCED_OPTIMIZATIONS` enabled.
+  - `out/all.min.js.tree` Google Closure Compiler AST for minified bundle.
+  - `out/all.min.js.gv` Call graph with attention to STG references reconstructed from minified bundle AST.
 
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
+## Usage
 
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
+The most intetesting part is contained in files `out/all.no_comments.js.gv` and `out/all.min.js.gv`. You can use [Gephi](https://gephi.org/) to open them for visual navigation and manipulation.
 
 ## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
 
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
-
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
-
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
+Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
 
 ## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
+For the future it would be nice to extract characters accumulated count over code entities and append this information to graph nodes. It would allow to visually show how much each code entity takes in overall bundle size.
 
 ## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
+If you find this project useful for your own research let me known what can be added or improved via tickets. MRs are welcome as well.
 
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
-
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
+## Project status
+Probably no much changes are expected there. The project had single aim and was created to dump research results.
 
 ## License
-For open source projects, say how it is licensed.
-
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
+Apache License 2.0
diff --git a/out/all.js b/out/all.js
new file mode 100644
index 0000000000000000000000000000000000000000..901ec8f90a19b80958024dc6951d42bf5a62a8b9
--- /dev/null
+++ b/out/all.js
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c3f6f6da82aa85903803c737a769622403b662d80910eb39d88e2f9d7d9fe22b
+size 7135157
diff --git a/out/all.min.js b/out/all.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..2ca4965582e3525c6a31072a059b18e63275a454
--- /dev/null
+++ b/out/all.min.js
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1029cea84998d4f293ce5ab0f1fda82e33c887e5e72ab37e21bd33d005cc2345
+size 7127540
diff --git a/out/all.min.js.gv b/out/all.min.js.gv
new file mode 100644
index 0000000000000000000000000000000000000000..6fdbb2ab811150972fb946e7a5f837e8d8b3d418
--- /dev/null
+++ b/out/all.min.js.gv
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8e5e931d7204556168723acd08f941a091773fd89db10189ef209b87fe87f68d
+size 51462260
diff --git a/out/all.min.js.tree b/out/all.min.js.tree
new file mode 100644
index 0000000000000000000000000000000000000000..5072bb3dd00af34a4985af32b82356d4676086e6
--- /dev/null
+++ b/out/all.min.js.tree
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:db9f17162bba8cd156a75d38a275c55c53df663b947aa97cd0e4ff0c0d8b8a0c
+size 12248718
diff --git a/out/all.no_comments.js b/out/all.no_comments.js
new file mode 100644
index 0000000000000000000000000000000000000000..b88e95e5401b73c479afbf4bfa42ddeebfbee71f
--- /dev/null
+++ b/out/all.no_comments.js
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:711723b76bd80cbd239997b94956beeefc39c1d809c6a24e8084e61dc793c2c6
+size 6993759
diff --git a/out/all.no_comments.js.gv b/out/all.no_comments.js.gv
new file mode 100644
index 0000000000000000000000000000000000000000..504fba5c41b8f14d4b19b5d783fe35bc175e4233
--- /dev/null
+++ b/out/all.no_comments.js.gv
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ee08dfb8b632596d85696bb6042e662ec154d96594155095f9fa08ca77650a41
+size 3978735
diff --git a/out/all.no_comments.js.tree b/out/all.no_comments.js.tree
new file mode 100644
index 0000000000000000000000000000000000000000..69fcbb24f3fa6d9d0b10d54136fe9bb8ec27c8a6
--- /dev/null
+++ b/out/all.no_comments.js.tree
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c5c687ee4de3122eaf01bb978ab41757209abf639d102d7218b2f275bf9aca81
+size 15111090
diff --git a/trace_gv.sh b/trace_gv.sh
new file mode 100755
index 0000000000000000000000000000000000000000..8c87d542db79989c8d6ade0a76eff2c5822af6f5
--- /dev/null
+++ b/trace_gv.sh
@@ -0,0 +1,122 @@
+#!/usr/bin/env bash
+
+# $ ./trace_gv.sh ../ghc-js/_build/stage1/bin/javascript-unknown-ghcjs-ghc
+
+generate_ast_and_tree () {
+  local -r WORKING_DIR=$1
+  local -r BUNDLE_JS=$2
+  local -r NEEDLE=$3
+  local -r STG_SPECIALS=$4
+
+  local -r AST_JS="${BUNDLE_JS}.tree"
+
+  echo "Create AST ${AST_JS} from Google Closure Compiler over ${BUNDLE_JS}"
+	google-closure-compiler \
+    --debug --warning_level QUIET --formatting PRETTY_PRINT \
+    --assume_function_wrapper \
+    --compilation_level WHITESPACE_ONLY \
+    --print_tree \
+    "${WORKING_DIR}/HelloJS.jsexe/${BUNDLE_JS}" "${WORKING_DIR}/HelloJS.jsexe/all.externs.js" \
+    --js_output_file "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}"
+
+  echo "Remove [source_file... section, we do not use it"
+  sed -i -r 's/\[source_file.*//' "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}"
+  echo "Remove [free_call... section, we do not use it"
+  sed -i -r 's/\[free_call.*//' "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}"
+  echo "Remove [length... section, we do not use it"
+  # TODO: use this section for graph weight
+  sed -i -r 's/\[length.*//' "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}"
+
+  echo "String literals may contains newline symbols, we need escape it"
+  # TODO: better to support such case in `tree.py` because multline stringliterals could be present and valid
+  awk -f ./trace_gv_remove_newlines.awk "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}" > "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}.awk"
+  mv -f "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}.awk" "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}"
+
+  echo "Remove ROOT header, it is useless for us"
+  awk -f ./trace_gv_remove_root.awk "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}" > "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}.awk"
+  mv -f "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}.awk" "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}"
+
+  echo "Remove unicode list content"
+  awk -f ./trace_gv_remove_unicode.awk "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}" > "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}.awk"
+  mv -f "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}.awk" "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}"
+
+  echo "AST   : ${WORKING_DIR}/HelloJS.jsexe/${AST_JS}"
+  cp "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}" ./out
+
+  local -r GV_JS="${BUNDLE_JS}.gv"
+
+  python3 ./tree.py \
+    "${NEEDLE}" \
+    "${WORKING_DIR}/HelloJS.jsexe/${AST_JS}" \
+    "${STG_SPECIALS}" \
+    > "${WORKING_DIR}/HelloJS.jsexe/${GV_JS}"
+
+  echo "GV    : ${WORKING_DIR}/HelloJS.jsexe/${GV_JS}"
+  cp "${WORKING_DIR}/HelloJS.jsexe/${GV_JS}" ./out
+}
+
+main () {
+  local -r GHC_COMPILER="${1}"
+
+  local -r WORKING_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+
+  {
+    echo 'module Main where'
+    echo 'main :: IO ()'
+    echo 'main = print ("Hello, World!" :: String)'
+  } >> "${WORKING_DIR}/HelloJS.hs"
+
+  echo "Build HelloJS:"
+  cat "${WORKING_DIR}/HelloJS.hs"
+
+  echo "Use GHC for compile: ${GHC_COMPILER}"
+	"${GHC_COMPILER}" -O0 -ddisable-js-minifier -fforce-recomp "${WORKING_DIR}/HelloJS.hs"
+
+  echo "Run at node ${WORKING_DIR}/HelloJS.jsexe/all.js"
+	node "${WORKING_DIR}/HelloJS.jsexe/all.js"
+
+  echo "Source: ${WORKING_DIR}/HelloJS.jsexe/all.js"
+  cp "${WORKING_DIR}/HelloJS.jsexe/all.js" ./out
+
+  echo "Erase comments by Google Closure Compiler"
+  google-closure-compiler --platform java \
+    --debug --formatting PRETTY_PRINT --warning_level QUIET \
+    --assume_function_wrapper \
+    --compilation_level WHITESPACE_ONLY \
+    "${WORKING_DIR}/HelloJS.jsexe/all.js" "${WORKING_DIR}/HelloJS.jsexe/all.externs.js" \
+    --js_output_file "${WORKING_DIR}/HelloJS.jsexe/all.no_comments.js"
+
+  echo "Source: ${WORKING_DIR}/HelloJS.jsexe/all.no_comments.js"
+  cp "${WORKING_DIR}/HelloJS.jsexe/all.no_comments.js" ./out
+
+  generate_ast_and_tree \
+    "${WORKING_DIR}" \
+    "all.no_comments.js" \
+    "h\$ghczminternalZCGHCziInternalziUnicodeziCharziUnicodeDataziGeneralCategoryzilvl_1" \
+    "h\$o h\$sti h\$stc h\$stl"
+
+  echo "Prevent inlining for easier removal unicode array"
+  sed -i -r "s#function h\$rawStringData#/** @noinline */ function h\$rawStringData#" "${WORKING_DIR}/HelloJS.jsexe/all.js"
+
+  echo "Minimize first pass with Google Closure Compiler"
+  google-closure-compiler --platform java \
+    --debug --formatting PRETTY_PRINT --warning_level QUIET \
+    --assume_function_wrapper \
+    --compilation_level ADVANCED_OPTIMIZATIONS \
+    "${WORKING_DIR}/HelloJS.jsexe/all.js" "${WORKING_DIR}/HelloJS.jsexe/all.externs.js" \
+    --js_output_file "${WORKING_DIR}/HelloJS.jsexe/all.min.js"
+
+  echo "Run at node ${WORKING_DIR}/HelloJS.jsexe/all.min.js"
+  node "${WORKING_DIR}/HelloJS.jsexe/all.min.js"
+
+  echo "Source: ${WORKING_DIR}/HelloJS.jsexe/all.min.js"
+  cp "${WORKING_DIR}/HelloJS.jsexe/all.min.js" ./out
+
+  generate_ast_and_tree \
+    "${WORKING_DIR}" \
+    "all.min.js" \
+    "\$h\$ghczminternalZCGHCziInternalziUnicodeziCharziUnicodeDataziGeneralCategoryzilvl_1\$\$" \
+    "\$h\$o\$\$ \$h\$sti\$\$ \$h\$stc\$\$ \$h\$stl\$\$"
+}
+
+main "$@"
\ No newline at end of file
diff --git a/trace_gv_remove_newlines.awk b/trace_gv_remove_newlines.awk
new file mode 100755
index 0000000000000000000000000000000000000000..8bd0cb2505db4a3c8a64e438956bb13ee5d4761e
--- /dev/null
+++ b/trace_gv_remove_newlines.awk
@@ -0,0 +1,26 @@
+#!/usr/bin/awk -f
+
+BEGIN {
+  previous_line = ""
+}
+
+{
+  sub(/[\n\r]+/, "+", $0)
+  if (calculate_spaces($0) >= 4) {
+    print previous_line
+    previous_line = $0
+    next
+  }
+
+  previous_line = previous_line $0
+  next
+}
+
+END {
+  print previous_line
+}
+
+function calculate_spaces(line) {
+  match(line, /^ */)
+  return int(RLENGTH)
+}
diff --git a/trace_gv_remove_root.awk b/trace_gv_remove_root.awk
new file mode 100755
index 0000000000000000000000000000000000000000..e6767002796cb73a1278cf4ed2949feea7547eb8
--- /dev/null
+++ b/trace_gv_remove_root.awk
@@ -0,0 +1,3 @@
+#!/usr/bin/awk -f
+
+NR > 1
diff --git a/trace_gv_remove_unicode.awk b/trace_gv_remove_unicode.awk
new file mode 100755
index 0000000000000000000000000000000000000000..ec66a74e9518a772a8037c2c8752e38c0301b599
--- /dev/null
+++ b/trace_gv_remove_unicode.awk
@@ -0,0 +1,36 @@
+#!/usr/bin/awk -f
+
+BEGIN {
+  indent_width = 4
+
+  confirmed_unicode_category_spaces_inner = -1
+  confirmed_unicode = 0
+}
+
+{
+  if (calculate_spaces($0) < confirmed_unicode_category_spaces_inner) {
+    confirmed_unicode_category_spaces_inner = -1
+    confirmed_unicode = 0
+  }
+}
+
+/NAME.*h\$ghczminternalZCGHCziInternalziUnicodeziCharziUnicodeDataziGeneralCategoryzilvl_1/ {
+  confirmed_unicode_category_spaces_inner = calculate_spaces($0) + 1
+}
+
+/ARRAYLIT/ {
+  if (confirmed_unicode_category_spaces_inner > 0 && calculate_spaces($0) >= confirmed_unicode_category_spaces_inner) {
+    confirmed_unicode = 1
+  }
+}
+
+{
+  if (confirmed_unicode == 0) {
+    print $0
+  }
+}
+
+function calculate_spaces(line) {
+  match(line, /^ */)
+  return int(RLENGTH / indent_width)
+}
diff --git a/tree.py b/tree.py
new file mode 100755
index 0000000000000000000000000000000000000000..ee330995eca38792eee1fb47874728a743ed2a0a
--- /dev/null
+++ b/tree.py
@@ -0,0 +1,123 @@
+#!/usr/bin/env python3
+
+# ./tree.py "\$h\$ghczminternalZCGHCziInternalziUnicodeziCharziUnicodeDataziGeneralCategoryzilvl_1\$\$" /var/folders/9t/tf_ktyc11ng7njtg804grg4c0000gn/T/tmp.OFC7xXPZ/HelloJS.jsexe/all.min.js.tree
+
+import math
+import sys
+
+LEVEL_DELIM = 4
+# SEARCH_NEEDLE = 'h$ghczminternalZCGHCziInternalziUnicodeziCharziUnicodeDataziGeneralCategoryzilvl_1'
+SEARCH_NEEDLE = sys.argv[1]
+
+def parse_line_elements(elements):
+  parsed_elements = {
+    "type": elements[0],
+    "name": (' '.join(elements[1:-1])),
+    "line_number": int(elements[-1].split(':')[0]),
+    "line_position": int(elements[-1].split(':')[1])
+  }
+  return parsed_elements
+
+def print_graph(parsed_result, parsed_index, key, level=0):
+    if key in parsed_result:
+        for index in parsed_result[key]:
+            for next_key in parsed_index[index]:
+              print('\t'*level+key+' -> '+next_key)
+              print_graph(parsed_result, next_key, level+1)
+
+# STG_SPECIAL_FNS = ["h$o", "h$sti", "h$stc", "h$stl"]
+# STG_SPECIAL_FNS = ["$h$o$$", "$h$sti$$", "$h$stc$$", "$h$stl$$"]
+STG_SPECIAL_FNS = sys.argv[3].strip().split(' ')
+
+def index_full_path_list(lines):
+  full_path = []
+  full_path_list = []
+  last_level = -1
+  horizontal_mode = None
+
+  i = 0
+  while i < len(lines):
+    l = lines[i]
+
+    content = l.lstrip()
+    if (content == ''):
+      i = i + 1
+      continue
+
+    parsed = parse_line_elements(content.strip().split(' '))
+
+    current_level = math.ceil((len(l) - len(content)) / LEVEL_DELIM) + 1
+    current_name = parsed['name']
+
+    horizontal_mode_switched = False
+    if (current_name in STG_SPECIAL_FNS) and parsed['type'] == 'NAME':
+      horizontal_mode = current_level # Enable
+      horizontal_mode_switched = True
+
+    if horizontal_mode != None and current_level < horizontal_mode:
+      horizontal_mode = None
+
+    if last_level > current_level and horizontal_mode == None:
+      full_path = full_path[:(current_level-1)]
+
+    full_path.append(current_name)
+
+    last_level = current_level
+    if horizontal_mode_switched or (horizontal_mode == None):
+      # Control linking manually
+      if horizontal_mode_switched:
+        full_path_list.append((i, full_path))
+      else:
+        full_path_list.append((i, full_path.copy()))
+
+    i = i + 1
+
+  return full_path_list
+
+def find_edges(lpos, lres, local_needle, level=0, seen={}):
+  for p in lpos[local_needle]:
+    needle_pos = lres[p].index(local_needle)
+    input_name = lres[p][0]
+    input_meta = "call"
+
+    if lres[p][0] in STG_SPECIAL_FNS:
+      input_meta = lres[p][0]
+      input_name = lres[p][1]
+
+    if not input_name in seen:
+      seen[input_name] = []
+
+    if needle_pos > 0 and input_name != local_needle:
+      print(format_dot_edge(input_name, local_needle, p+1, input_meta, level))
+      if input_name in lpos and (not local_needle in seen[input_name]):
+        seen[input_name].append(local_needle)
+        find_edges(lpos, lres, input_name, level+1, seen)
+
+def format_dot_edge(input, output, line, meta, level):
+  return input+" -> "+output+" [line="+str(line)+" meta="+meta+" level="+str(level)+"]"+";\n"
+
+def unique_order_kept(seq):
+  seen = set()
+  seen_add = seen.add
+  return [x for x in seq if not (x in seen or seen_add(x))]
+
+# with open('HelloJS.jsexe/all.min.debug.js.tree', 'r') as f:
+with open(sys.argv[2], 'r') as f:
+  lines = f.read().splitlines()
+  full_path_list = index_full_path_list(lines)
+
+  literals_relations = [[]] * len(lines)
+  literals_positions = {}
+  for i, l in full_path_list:
+    actual_literals = unique_order_kept(list(filter(lambda x: x != '', l)))
+    literals_relations[i] = actual_literals
+
+    for a in actual_literals:
+      if a in literals_positions:
+        literals_positions[a].append(i)
+      else:
+        literals_positions[a] = [i]
+
+  print("digraph g {")
+  find_edges(literals_positions, literals_relations, SEARCH_NEEDLE)
+  print("}")