It is not necessarily a “rib out of place”. Though there might be a sprain of the costovertebral junction (it is a synovial joint), it could just as easily be a strain of an intercostal muscle (external intercostal since the difficulty is with inspiration). Since the external intercostal functions as an accessory muscle to active inspiration, it is no wonder why you feel pain with large, active air intake. It could also be a combination of the two. Have you tried any “deep-breathing” exercises or just started pull overs to “increase chest size”?
Treat it as if it was a strain of somesort.
Poor posture in the workplace can definitely lead to this type of problem. Since you could be potentially placing the muscles in a stretched position with bad posture, I would take a hard look at how you lounge around the house or at work. If this seems to be the case, have your significant other place tape across your back across your scapulae (along the midline in the horizontal plane) while you are sitting up with your scapulae retracted. This is an easy version of something called McConnell taping.
Quick question, though. Does this pain keep you up at night? Has this pain onset correlated with any type of flu-like symptoms such as respiratory distress?
I had to ask these, because with any sort of pain in the thorax, one needs to be careful it is not of any other origin except musculoskeletal.