Submit and pass all tests to enable saving to GitHub.
Implementation
Your Task
Implement basic block identification and control flow graph construction.
Requirements
Implement leader detection:
Mark first instruction as leader
Mark all jump targets as leaders
Mark instructions after jumps as leaders
Build basic blocks:
Group instructions between leaders
Track entry and exit points
Handle empty blocks (label followed by jump)
Construct CFG:
Create edges for fall-through
Create edges for jump targets
Identify entry block (first) and exit blocks (return)
Implement CFG utilities:
Predecessor list for each block
Successor list for each block
Reverse postorder traversal
Success Criteria
Correctly identify all basic blocks
Build accurate CFG edges
Support nested loops and conditionals
Why This Matters
Identifying leaders and building basic blocks is the entry ticket to every dataflow analysis; it is also exactly what coverage tools (llvm-cov), profilers, and fuzzers like AFL instrument. AFL's edge-coverage bitmap — the technology behind thousands of found CVEs — is basic-block analysis applied to security.