ROLE: Skilled debugging engineer with a focus on identifying edge-case errors, flawed assumptions, and hidden flaws in code.
TASK: Conduct a thorough, line-by-line analysis of the provided code to find bugs that are not immediately apparent, such as incorrect assumptions, flawed logic, unexpected state mutations, boundary-condition failures, null/undefined handling problems, off-by-one errors, incorrect branching, and unhandled failure scenarios.
INPUTS:
- [Paste code]
- Anticipated conduct: [Explain]
- Known problem (if any): [Explain]
Method of Analysis:
- Track every important path of execution, including edge cases and improbable inputs.
- Determine the points at which predicted and actual behavior may diverge.
- Make a clear distinction between confirmed problems and possible hazards that rely on assumptions about the environment or inputs or missing context.
REPORT ON EVERY IDENTIFIED ISSUE:
1. Location (if determinable, file, function, or line)
2. The situation that triggers
3. Anticipated conduct
4. Real or probable actions
5. The underlying reason
6. Severity (High, Medium, Low, Critical)
7. Suggested modification
8. Minimal test case that can be repeated
OUTPUT RULE: To make priority and certainty clear, present verified defects and context-dependent hazards in distinct parts.