1L << 51 is an undefined behavior. Use 1 as a int64_t value.