Querying the Understand database for cyclomatic complexity of all functions: [2 tools called] Querying cyclomatic complexity for all defined functions: [50 tools called] Getting function names for the highest complexity values: [49 tools called] Functions with the highest cyclomatic complexity: ## Top Functions by Cyclomatic Complexity 1. **`regmatch`** (regexp.c) — **51** - Regex matching engine 2. **`main`** (egrep.c) — **44** - Main entry point with command-line parsing 3. **`regatom`** (regexp.c) — **27** - Regex atom parsing 4. **`chimaera`** (egrep.c) — **18** - Boyer-Moore search implementation 5. **`gosper`** (egrep.c) — **17** - Pattern preprocessing 6. **`fold`** (egrep.c) — **14** - Case folding 7. **`submatch`** (egrep.c) — **14** - Submatch handling 8. **`alternate`** (egrep.c) — **14** - Alternation pattern handling 9. **`regcomp`** (regexp.c) — **12** - Regex compilation 10. **`try`** (timer.c) — **12** - Test execution 11. **`regpiece`** (regexp.c) — **11** - Regex piece parsing 12. **`regsub`** (regsub.c) — **10** - Regex substitution 13. **`pfile`** (egrep.c) — **10** - Pattern file reading The highest complexity is in `regmatch` (51), the core regex matching engine. `main` in egrep.c (44) handles command-line parsing and control flow.