cdqe does this RAX ← sign-extend of EAX.
applicable only in x64
shown below is a demo of x86 cdq which instead of using rax uses eax,edx combo
edx gets the sign extension in x86
for cdqe register rax will become 0xffffffff<eax> or 0x00000000<eax>
maybe ctf is checking the sign