Max XOR Non-Overlapping Subarrays

Given an integer array nums, find the maximum value of xor1 + xor2 where xor1 is the XOR of a subarray nums[l1..r1], xor2 is the XOR of a subarray nums[l2..r2], and the two subarrays are non-overlapping (r1 < l2 or r2 < l1). Each subarray must be non-empty.

Examples
Input: [1,2,3,4]
Output: 10
Hints

Max XOR Non-Overlapping Subarrays

Given an integer array nums, find the maximum value of xor1 + xor2 where xor1 is the XOR of a subarray nums[l1..r1], xor2 is the XOR of a subarray nums[l2..r2], and the two subarrays are non-overlapping (r1 < l2 or r2 < l1). Each subarray must be non-empty.