Grammar of "open condition + would have"?
The princess spent half the night hanging out the window, calling till her throat was raw, but no answering shouts came back to her. That frightened her more than she could say. If the Sand Snakes were imprisoned in the Spear Tower, _they surely would have heard her shouting._
(A Feast for Crows)
Context: The princess was imprisoned on the top floor of the Spear Tower. The princess guessed that her cousins (referred to by “Sand Snakes”) might have also been imprisoned below her in the Spear Tower so she shouted to them, hoping they might respond.
Hi. This pattern is "open condition + would have", which I find alien to me. How do you interpret the underlined part? What is the difference between the following two?
1. If the Sand Snakes were imprisoned in the Spear Tower, they surely would have heard her shouting.
2. If the Sand Snakes had been imprisoned in the Spear Tower, they surely would have heard her shouting.
Thank you.