
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given the line $l: y=x+m$ intersects with the circle $C: x^{2}+y^{2}-2x+4y-4=0$ at two distinct points $A$ and $B$.
$(1)$ Find the range of $m$;
$(2)$ If the circle with diameter $AB$ passes through the origin, find the equation of line $l$.

Present the answer in LaTex format: \boxed{Your answer}
user