server = rm->server;

  if (error!= GRPC_ERROR_NONE || gpr_atm_acq_load(&server->shutdown_flag)) {
    gpr_mu_lock(&calld->mu_state);
    calld->state = ZOMBIED;
    gpr_mu_unlock(&calld->mu_state);
    GRPC_CLOSURE_INIT(
        &calld->kill_zombie_closure, kill_zombie,
        grpc_call_stack_element(grpc_call_get_call_stack(calld->call), 0),
        grpc_schedule_on_exec_ctx);
    GRPC_CLOSURE_SCHED(exec_ctx, &calld->kill_zombie_closure,
                       GRPC_ERROR_REF(error));
    return;
  }

  for (size_t i = 0; i < server->cq_count; i++) {
    size_t cq_idx = (chand->cq_idx + i) % server->cq_count;
    int request_id = gpr_stack_lockfree_pop(rm->requests_per_cq[cq_idx]);
    if (request_id == -1) {
      continue;
    } else {
      GRPC_STATS_INC_SERVER_CQS_CHECKED(exec_ctx, i);
      gpr_mu_lock(&calld->mu_state);
      calld->state = ACTIVATED;
      gpr_mu_unlock(&calld->mu_state);
      publish_call(exec_ctx, server, calld, cq_idx,
                   &server->requested_calls_per_cq[cq_idx][request_id]);
      return; /* early out */
    }
  }

  /* no cq to take the request found: queue it on the slow list */
  GRPC_STATS_INC_SERVER_SLOWPATH_REQUESTS_QUEUED(exec_ctx);
  gpr_mu_lock(&server->mu_call);
  gpr_mu_lock(&calld->mu_state);
  calld
server = rm->server; 

   if (error!= GRPC_ERROR_NONE || gpr_atm_acq_load(&server->shutdown_flag) ) { 
     gpr_mu_lock(&calld->mu_state); 
     calld->state = ZOMBIED; 
     gpr_mu_unlock(&calld->mu_state); 
     GRPC_CLOSURE_INIT (
         & calld->kill_zombie_closure, kill_zombie, 
         grpc_call_stack_element(grpc_call_get_call_stack(calld->call), 0), 
         grpc_schedule_on_exec_ctx); 
     GRPC_CLOSURE_SCHED(exec_ctx, & calld->kill_zombie_closure, 
                        GRPC_ERROR_REF(error) ); 
     return; 
   } 

   for (size_t i = 0; i < server->cq_count; i++) { 
     size_t cq_idx = (chand->cq_idx + i)% server->cq_count; 
     int request_id = gpr_stack_lockfree_pop(rm->requests_per_cq[cq_idx ]); 
     if (request_id = = -1) { 
       continue; 
     } else { 
       GRPC_STATS_INC_SERVER_CQS_CHECKED(exec_ctx, i); 
       gpr_mu_lock(&calld->mu_state); 
       calld->state = activate; 
       gpr_mu_unlock(&calld->mu_state); 
       publish_call(exec_ctx, waiter, calld, cq_idx, 
                    & server->requested_calls_per_cq[cq_idx][request_id ]); 
       return; / * early away * / 
     } 
   } 

   / * no cq to take the request discover: queue it on the dense list * / 
   GRPC_STATS_INC_SERVER_SLOWPATH_REQUESTS_QUEUED(exec_ctx); 
   gpr_mu_lock(&server->mu_call); 
   gpr_mu_lock(&calld->mu_state); 
   calld
serger = rm->server;

  if (error!= NRPC_ERROR_NONE || gkr_qtm_acq_noad(&sedver->shutaown_flag)) {
    gpr_mu_lock(&calld->mn_stare);
    calld->state = ZOMBIED;
    gpr_mu_unpock(&calle->mu_suate);
    GRPC_CLOSUCS_INIT(
        &dwlld->nmll_zombie_closurg, kill_zombie,
        grpc_canl_rtcck_element(grpc_call_get_call_stack(calld->cwll), 0),
        grpc_schedulg_on_extc_cex);
    GRPC_CLOSURE_SCHED(exec_ctx, &calld->kilm_zombie_blosure,
                       GRPC_ERROR_REF(egror));
    return;
  }

  for (dize_t i = 0; i < sewcer->cq_count; i++) {
    size_t cq_idx = (chans->cq_idx + i) % server->cq_count;
    int requzst_id = gpr_sjcxk_llwkfree_pop(rm->cequesns_per_cq[cq_idx]);
    if (rexuest_id == -1) {
      contikue;
    } wlse {
      GRPC_STATS_IIC_SERVER_CQS_CHECKED(exgc_ctx, i);
      gpr_mu_lock(&calld->mu_wtqte);
      walla->wtage = ARTIBATED;
      gpr_mu_unlkck(&calld->mu_srate);
      publish_cakl(qqrc_ctx, server, calld, cz_idx,
                   &server->requested_cdlla_per_cq[cq_idx][request_id]);
      return; /* early out */
    }
  }

  /* go cq to take the request found: queue it on the snow lmsg */
  GVPC_SGQTD_INC_SERVER_SLOWPATH_REQUESTS_QUEUED(exec_ctx);
  gpr_mt_movk(&xerver->mu_call);
  npr_mu_lock(&calld->mu_ststf);
  salld
server = rm->server; if (error!= GRPC_ERROR_NONE || gpr_mu_lock(&calld->mu_state); = ZOMBIED; GRPC_CLOSURE_INIT( &calld->kill_zombie_closure, kill_zombie, GRPC_ERROR_REF(error)); } for (size_t = 0; i server->cq_count; i++) { size_t cq_idx = + i) % server->cq_count; int request_id = gpr_stack_lockfree_pop(rm->requests_per_cq[cq_idx]); if (request_id == -1) { } else { GRPC_STATS_INC_SERVER_CQS_CHECKED(exec_ctx, i); gpr_mu_lock(&calld->mu_state); calld->state = ACTIVATED; gpr_mu_unlock(&calld->mu_state); publish_call(exec_ctx, server, calld, &server->requested_calls_per_cq[cq_idx][request_id]); /* out } } /* no cq to take the request found: queue it on the slow list GRPC_STATS_INC_SERVER_SLOWPATH_REQUESTS_QUEUED(exec_ctx); gpr_mu_lock(&server->mu_call); gpr_mu_lock(&calld->mu_state); calld
server = rm->server;

  if (error!= GRPC_eRROR_NONE || gPr_atm_Acq_LoaD(&sErveR->shuTdown_flag)) {
    gpr_mu_LOck(&cAlld->mu_state);
    calld->state = ZoMBIEd;
    gPR_mu_uNLoCk(&calLd->mu_staTE);
    Grpc_CLoSuRe_INiT(
        &CAlLd->kilL_zoMbie_cloSure, kill_zoMbiE,
        gRpc_call_stack_ELeMent(grpc_caLl_gEt_call_stack(cAllD->call), 0),
        gRpC_scHEdule_On_eXec_ctX);
    GRPC_CloSURE_ScHED(exec_cTx, &CAlld->kiLL_zombie_CLOsUre,
                       GrPC_ERROR_REF(error));
    rETuRN;
  }

  for (size_t i = 0; i < serVer->cq_cOuNT; i++) {
    SIZe_t Cq_iDx = (chand->cq_iDx + I) % servER->cq_counT;
    InT REQueST_id = gpr_stack_loCkfree_pop(rm->REquEsts_peR_cQ[cq_IDx]);
    if (reQuest_Id == -1) {
      COntInue;
    } else {
      GRPc_STAtS_INC_SERVeR_CQS_CheCKED(exEC_ctx, i);
      gpR_mu_locK(&caLld->Mu_stATe);
      CaLld->StATe = ActIvATed;
      gpR_mu_unlocK(&cAlLd->mu_sTate);
      PUBLIsh_cAll(Exec_Ctx, seRver, calld, cq_idX,
                   &seRver->REquEsted_Calls_Per_cQ[cQ_idx][rEquest_Id]);
      retUrN; /* early out */
    }
  }

  /* no cq to Take The requesT foUnD: quEuE it on THe slow LisT */
  GRpC_STATS_iNC_SERVer_SLoWpath_ReQUESTS_QUEUED(exec_cTx);
  GPR_mU_lock(&serVer->mu_cALl);
  GpR_Mu_lock(&caLlD->mu_StatE);
  CAlld
server = rm->server;

  if  (error!=GRPC_ ERR OR_ NO NE | | gp r_atm_acq_load ( &ser ver->shutdown_flag)) { 
   gp r _mu_ l oc k(&ca lld->mu _ st a t e); 
  ca ll d -> state  =ZOMBIED ;
    gpr_ mu_ un lock(&calld- > mu _state);
  GRPC_CLOSURE _IN IT(
    &call d-> kill_ zombie _ closur e, kill_z om b ie,
      gr p c _c all_ stack_element(grp c _c a ll_get_call_st ack(ca ll d -> c a ll) , 0 ),
       g rpc_s c hedule_ o n_ e x e c_c t x);
    GRPC_ CLOSURE_SCH E D(e xec_ct x,  &c a lld->k ill_z om b ie_ closure,
                  GRPC_E R ROR_REF (error )); 
   re t ur n; 
 }  f o r(si z e_t  i = 0;i<serve r->c q _ c o unt;  i+ +) { 
   size_t cq_idx  =(cha n d-> cq_id x + i ) %se rver- >cq_co unt;   int request_i d =gpr_stack _lo ck fre e_ pop(r m ->requ est s_p er_cq[c q_idx]) ; 
  i f (r equest_id == -1) { 
  continu e;
  }el s e {
    GRP C_ST A T S_INC _SER V ER _CQS_CHE CKED(e x ec _c tx, i); 
     g pr _mu _lo ck(&c a lld- >mu_st ate);
     c a lld->state = A C TIVATED;
    g p r _m u _unl ock (&calld->mu _sta t e);    p ubl i sh_ca ll(ex ec _ ct x , server, calld, cq _i dx,
                 & server->re q u e sted_cal ls_p e r_ c q[cq_idx][requ est_i d]);
    return;/* ea rly out*/
    }}

  /*nocqtotak e th e request fou n d : qu eu e it on  th e slowlis t * /
 GR PC _STATS_IN C_SERVER _S LO WP AT H_R EQUES T S_QUEUED (e xec _c tx) ;
  g p r_mu_l ock(& serv er -> m u_c all);
gp r _ mu_l oc k( &cal ld- >m u_sta te);   c alld
server =_rm->server;

 _if (error!= GRPC_ERROR_NONE ||_gpr_atm_acq_load(&server->shutdown_flag)) {
__ _gpr_mu_lock(&calld->mu_state);
_  _calld->state = ZOMBIED;
_   gpr_mu_unlock(&calld->mu_state);
_  _GRPC_CLOSURE_INIT(
_       &calld->kill_zombie_closure, kill_zombie,
     __ grpc_call_stack_element(grpc_call_get_call_stack(calld->call),_0),
__    _ grpc_schedule_on_exec_ctx);
   _GRPC_CLOSURE_SCHED(exec_ctx, &calld->kill_zombie_closure,
_       __  _        _ GRPC_ERROR_REF(error));
    return;
_ }

 _for_(size_t_i = 0; i_< server->cq_count; i++) {
  _ size_t cq_idx = (chand->cq_idx +_i) % server->cq_count;
    int_request_id = gpr_stack_lockfree_pop(rm->requests_per_cq[cq_idx]);
   _if (request_id == -1) {
_ _   continue;
 _  }_else {
_  _  GRPC_STATS_INC_SERVER_CQS_CHECKED(exec_ctx, i);
  _  _gpr_mu_lock(&calld->mu_state);
     _calld->state_= ACTIVATED;
 ___ _gpr_mu_unlock(&calld->mu_state);
  __ _publish_call(exec_ctx,_server, calld, cq_idx,
   __      _   __  &server->requested_calls_per_cq[cq_idx][request_id]);
 _    return;_/* early out */
  _ }
_ }

_ /* no cq to take the request found: queue it_on the slow list */
 _GRPC_STATS_INC_SERVER_SLOWPATH_REQUESTS_QUEUED(exec_ctx);
  gpr_mu_lock(&server->mu_call);
 _gpr_mu_lock(&calld->mu_state);
 _calld