def _get_pin_cw(pincount, loc):
    """Helper function to locate pin number for cw_dual.

    Args:
        pincount: Total number of pins
        loc: Starting location

    Returns:
        pin_number: Starting pin number
    """
    pins_per_side = pincount // 2
    if loc == "top_left":
        return 0
    elif loc == "bottom_left":
        return pins_per_side * 2 + 1
    elif loc == "bottom_right":
        return pins_per_side
    elif loc == "top_right":
        return pins_per_side + 1
    return 0