No Branch 2
for (auto i = 0u; i < arr.size(); ++i) {
if (arr[i] > 128)
sum += arr[i];
}
int sum[2] = {0, 0};
for (auto i = 0u; i < arr.size(); ++i) {
sum[arr[i] > 128] += arr[i];
}
// The answer is in sum[true]
* The benchmark is run under Apple Macbook Air M2.
* For the full benchmark code, please refer here.