APPENDOR-Why WA?

Problem: Append for OR (APPENDOR Problem - CodeChef).
I have tried to solve this problem several times but it is showing me wrong answer. I don’t know why this is happening.
My solution: CodeChef: Practical coding for everyone
Can anyone help me to find out the reason for what the solution is showing WA?

Thanks in advance.

Your code gets WA in this test case

1
1 0
1

The reason for this bug is that __builtin_popcountll(y) =0 and the while loop does not even enter, much less set b=1.