def METHOD_NAME(t):
    tile = t & 0x3FF
    hflip = (t >> 10) & 1
    vflip = (t >> 11) & 1
    btsType = (t >> 12) & 0xF
    # invert hflip
    hflip = 1 - hflip
    return (tile) | (hflip << 10) | (vflip << 11) | (btsType << 12)