the present invention relates to novel substituted diamine derivatives for the formula wherein r 1 , r 2 , r 3 , r 4 , x 1 , x 2 , x 3 , x 4 , a , y and n are as described in the specification , pharmaceutical compositions containing them and intermediates used in their manufacture . more particularly , the compounds of the invention are motilin receptor antagonists useful for the treatment of associated conditions and disorders such as gastrointestinal reflux disorders , eating disorders leading to obesity and irritable bowel syndrome .