<NA>
<NA>
function getMaximumCommissionAmount(
        uint256 _totalDeposited,
        uint256 _totalReceived,
        uint256 _totalCommissionReceived,
        uint256 _amountCom) private returns(uint256) {
        
        //maximum commission can receive
        uint256 maxCommissionAmount = _totalDeposited.mul(maxReceiveCommissionPercent).div(cfgPercentDivider);
        //check total receive commission
        if(maxCommissionAmount <= _totalCommissionReceived) {
            emit Logger("Not enough balance [total commission receive]", _totalCommissionReceived);
            return 0;
        }
        else if(maxCommissionAmount < _totalCommissionReceived.add(_amountCom)) {
            _amountCom = maxCommissionAmount.sub(_totalCommissionReceived);
        }
        //check player total maxout
        uint256 maxProfitCanReceive = _totalDeposited.mul(cfgPercentMaxReceive).div(cfgPercentDivider);
        if(maxProfitCanReceive <= _totalReceived) {
            emit Logger("Not enough balance [total maxout receive]", _totalReceived);
            return 0;
        }
        else if(maxProfitCanReceive < _totalReceived.add(_amountCom)) {
            _amountCom = maxProfitCanReceive.sub(_totalReceived);
        }
        
        return _amountCom;
    }
/**
 * @dev get maximum amount commission avariable
 **/