In building emergency evacuation, the perception of hazards can stress crowds, evoke their competitive behaviors, and trigger disorder and blocking as they pass through narrow passages (e.g., a small exit). This is a serious concern threatening evacuees' survivability and egress efficiency. How to optimize crowd guidance while considering such effects is an important problem. Based on advanced microscopic pedestrian models and simulations, this paper establishes a new macroscopic network-flow model where fire, smoke, and psychological factors can evoke a crowd's desire to escape—the desired flow rate. Disorder and blocking occur when the desired flow rate exceeds the passage capacity, resulting in a drastic decrease of crowd movement in a nonlinear and random fashion. To effectively guide crowds, a divide-and-conquer approach is developed based on groups to reduce computational complexity and to reflect psychological findings. Egress routes for individual groups are optimized by using a novel combination of stochastic dynamic programming and the rollout scheme. These routes are then coordinated so that limited passage capacities are shared to meet the total need for joint movement. Numerical testing and simulation demonstrate that, compared with a strategy of merely using nearest exits, our solution can evacuate more people more rapidly by preventing or mitigating potential disorder and blocking at bottleneck passages.