Genesis 40:3-13 NIV

3 and put them in custody in the house of the captain of the guard,1 in the same prison where Joseph was confined.

References for Genesis 40:3

4 The captain of the guard2 assigned them to Joseph,3 and he attended them. After they had been in custody4 for some time,

References for Genesis 40:4

5 each of the two men--the cupbearer and the baker of the king of Egypt, who were being held in prison--had a dream5 the same night, and each dream had a meaning of its own.6

References for Genesis 40:5

6 When Joseph came to them the next morning, he saw that they were dejected.
7 So he asked Pharaoh's officials who were in custody7 with him in his master's house, "Why are your faces so sad today?"8

References for Genesis 40:7

      8 "We both had dreams," they answered, "but there is no one to interpret them."9 Then Joseph said to them, "Do not interpretations belong to God?10 Tell me your dreams."

      References for Genesis 40:8

          9 So the chief cupbearer11 told Joseph his dream. He said to him, "In my dream I saw a vine in front of me,

          References for Genesis 40:9

              10 and on the vine were three branches. As soon as it budded, it blossomed,12 and its clusters ripened into grapes.

              References for Genesis 40:10

              11 Pharaoh's cup was in my hand, and I took the grapes, squeezed them into Pharaoh's cup and put the cup in his hand."
              12 "This is what it means,13" Joseph said to him. "The three branches are three days.14

              References for Genesis 40:12

                  13 Within three days15 Pharaoh will lift up your head16 and restore you to your position, and you will put Pharaoh's cup in his hand, just as you used to do when you were his cupbearer.17

                  References for Genesis 40:13