def service_update_flags(target_rep_size=None, instance_count=None,
    rep_restart_wait=None, quorum_loss_wait=None, standby_rep_keep=None,
    min_rep_size=None, placement_constraints=None, placement_policy=None,
    correlation=None, metrics=None, move_cost=None, scaling_policy=None,
    service_placement_time=None):
    """Calculate an integer representation of flag arguments for updating
    stateful services"""
    flag_sum = 0
    if target_rep_size is not None or instance_count is not None:
        flag_sum += 1
    if rep_restart_wait is not None:
        flag_sum += 2
    if quorum_loss_wait is not None:
        flag_sum += 4
    if standby_rep_keep is not None:
        flag_sum += 8
    if min_rep_size is not None:
        flag_sum += 16
    if placement_constraints is not None:
        flag_sum += 32
    if placement_policy is not None:
        flag_sum += 64
    if correlation is not None:
        flag_sum += 128
    if metrics is not None:
        flag_sum += 256
    if move_cost is not None:
        flag_sum += 512
    if scaling_policy is not None:
        flag_sum += 1024
    if service_placement_time is not None:
        flag_sum += 2048
    return flag_sum
