I'm working on a decompiler, and one of my friends sent me a little program that he wrote. One function had a funny output, and inspecting the disassembly, I found that it's pretty boring except that there's a 15-byte nop in the middle of it:
0000000100001300 <_strhash>:
100001300: 55 push rbp
100001301: 48 89 e5 mov rbp,rsp
100001304: 8a 0f mov cl,BYTE PTR [rdi]
100001306: 31 c0 xor eax,eax
100001308: 84 c9 test cl,cl
10000130a: 74 2b je 100001337 <_strhash+0x37>
10000130c: 48 ff c7 inc rdi
10000130f: 31 d2 xor edx,edx
100001311: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 nop WORD PTR cs:[rax+rax*1+0x0]
100001318: 0f 1f 84 00 00 00 00
10000131f: 00
100001320: 0f b6 c9 movzx ecx,cl
100001323: 89 d0 mov eax,edx
100001325: c1 e0 05 shl eax,0x5
100001328: 29 d0 sub eax,edx
10000132a: 01 c8 add eax,ecx
10000132c: 8a 0f mov cl,BYTE PTR [rdi]
10000132e: 48 ff c7 inc rdi
100001331: 84 c9 test cl,cl
100001333: 89 c2 mov edx,eax
100001335: 75 e9 jne 100001320 <_strhash+0x20>
100001337: 5d pop rbp
100001338: c3 ret
I didn't even know that x86 instructions could go to 15 bytes.
What is the benefit of this big nop?