Coming to wake someone with 〜に来る
Grammar Explanation: Coming to for a purpose with 〜に来る

As the new butler, Hayate is tasked with waking Nagi for breakfast, but he’s quickly startled by the sight of a large white tiger sleeping alongside her. Nagi wakes and notices Hayate standing in her room.
- ナギ:
- 「あ…起こしに来
( てくれたのか、ありがとう…」- “Ah... did you come to wake me up? Thanks...”
- 「ところで何
( を固( まっているのだ?」- “By the way, why are you frozen stiff?”
- “Ah... did you come to wake me up? Thanks...”
- ハヤテ:
- 「い…いえ… その…うしろ…」
- “N-no... it's just... behind you...”
Key Points
起こしに来てくれた means came to wake me
起
( こし is the verb stem of 起( こす, followed by に to mark purpose.来てくれた adds that Hayate came and did it for Nagi’s benefit.
のか asks for confirmation
Nagi infers Hayate’s purpose from him standing in her room.
のか makes the question explanatory: “so, you came to wake me?”
The gratitude belongs to くれた
くれる frames the action as kindness toward the speaker.
That is why ありがとう follows so naturally.
固
( まっている means frozen in placeThe literal image is having gone stiff or solid, but here it describes Hayate standing there unable to react.
何を…のだ? presses for an explanation: “why are you…?” rather than asking what object he is freezing.