These facts are not relevant to the question, and only add confusion to the fact that:
Why do people believe in the priority over the correct result (cycles or time) Disabled (/Od) like this:
// test example binary search
pointer _NOINLINE findVoidSortMap(void ** list,void *key)
{
000000013F1B1000 48 89 54 24 10 mov qword ptr [rsp+10h],rdx
000000013F1B1005 48 89 4C 24 08 mov qword ptr [rsp+8],rcx
000000013F1B100A 48 83 EC 38 sub rsp,38h
if (!list) return 0;
000000013F1B100E 48 83 7C 24 40 00 cmp qword ptr [list],0
000000013F1B1014 75 07 jne findVoidSortMap+1Dh (13F1B101Dh)
000000013F1B1016 33 C0 xor eax,eax
000000013F1B1018 E9 DB 00 00 00 jmp findVoidSortMap+0F8h (13F1B10F8h)
if (!*list) return 0;
000000013F1B101D 48 8B 44 24 40 mov rax,qword ptr [list]
000000013F1B1022 48 83 38 00 cmp qword ptr [rax],0
000000013F1B1026 75 07 jne findVoidSortMap+2Fh (13F1B102Fh)
000000013F1B1028 33 C0 xor eax,eax
000000013F1B102A E9 C9 00 00 00 jmp findVoidSortMap+0F8h (13F1B10F8h)
unsigned int count= **(unsigned int**)list;
000000013F1B102F 48 8B 44 24 40 mov rax,qword ptr [list]
000000013F1B1034 48 8B 00 mov rax,qword ptr [rax]
000000013F1B1037 8B 00 mov eax,dword ptr [rax]
000000013F1B1039 89 44 24 10 mov dword ptr [count],eax
char *p=(char*)*list;
000000013F1B103D 48 8B 44 24 40 mov rax,qword ptr [list]
000000013F1B1042 48 8B 00 mov rax,qword ptr [rax]
000000013F1B1045 48 89 04 24 mov qword ptr [rsp],rax
p+=4;
000000013F1B1049 48 8B 04 24 mov rax,qword ptr [rsp]
000000013F1B104D 48 83 C0 04 add rax,4
000000013F1B1051 48 89 04 24 mov qword ptr [rsp],rax
Element *b=(Element *)p;
000000013F1B1055 48 8B 04 24 mov rax,qword ptr [rsp]
000000013F1B1059 48 89 44 24 18 mov qword ptr [b],rax
_voidint skey=(_voidint)key;
000000013F1B105E 48 8B 44 24 48 mov rax,qword ptr [key]
000000013F1B1063 48 89 44 24 08 mov qword ptr [skey],rax
while (count>0) {
000000013F1B1068 83 7C 24 10 00 cmp dword ptr [count],0
000000013F1B106D 0F 86 83 00 00 00 jbe findVoidSortMap+0F6h (13F1B10F6h)
void** kt=(void**)&b[count>>1];
000000013F1B1073 8B 44 24 10 mov eax,dword ptr [count]
000000013F1B1077 D1 E8 shr eax,1
000000013F1B1079 8B C0 mov eax,eax
000000013F1B107B 48 6B C0 10 imul rax,rax,10h
000000013F1B107F 48 8B 4C 24 18 mov rcx,qword ptr [b]
000000013F1B1084 48 03 C8 add rcx,rax
000000013F1B1087 48 8B C1 mov rax,rcx
000000013F1B108A 48 89 44 24 28 mov qword ptr [kt],rax
_voidint rkey=(_voidint)kt[0];
000000013F1B108F 48 8B 44 24 28 mov rax,qword ptr [kt]
000000013F1B1094 48 8B 00 mov rax,qword ptr [rax]
000000013F1B1097 48 89 44 24 20 mov qword ptr [rkey],rax
if (skey==rkey) return (void**)&kt[1];
000000013F1B109C 48 8B 44 24 20 mov rax,qword ptr [rkey]
000000013F1B10A1 48 39 44 24 08 cmp qword ptr [skey],rax
000000013F1B10A6 75 0B jne findVoidSortMap+0B3h (13F1B10B3h)
000000013F1B10A8 48 8B 44 24 28 mov rax,qword ptr [kt]
000000013F1B10AD 48 83 C0 08 add rax,8
000000013F1B10B1 EB 45 jmp findVoidSortMap+0F8h (13F1B10F8h)
if (skey>rkey) {b+=(count>>1)+1;count--;}
000000013F1B10B3 48 8B 44 24 20 mov rax,qword ptr [rkey]
000000013F1B10B8 48 39 44 24 08 cmp qword ptr [skey],rax
000000013F1B10BD 7E 28 jle findVoidSortMap+0E7h (13F1B10E7h)
000000013F1B10BF 8B 44 24 10 mov eax,dword ptr [count]
000000013F1B10C3 D1 E8 shr eax,1
000000013F1B10C5 FF C0 inc eax
000000013F1B10C7 8B C0 mov eax,eax
000000013F1B10C9 48 6B C0 10 imul rax,rax,10h
000000013F1B10CD 48 8B 4C 24 18 mov rcx,qword ptr [b]
000000013F1B10D2 48 03 C8 add rcx,rax
000000013F1B10D5 48 8B C1 mov rax,rcx
000000013F1B10D8 48 89 44 24 18 mov qword ptr [b],rax
000000013F1B10DD 8B 44 24 10 mov eax,dword ptr [count]
000000013F1B10E1 FF C8 dec eax
000000013F1B10E3 89 44 24 10 mov dword ptr [count],eax
count=count>>1;
000000013F1B10E7 8B 44 24 10 mov eax,dword ptr [count]
000000013F1B10EB D1 E8 shr eax,1
000000013F1B10ED 89 44 24 10 mov dword ptr [count],eax
}
000000013F1B10F1 E9 72 FF FF FF jmp findVoidSortMap+68h (13F1B1068h)
return 0;
000000013F1B10F6 33 C0 xor eax,eax
}
000000013F1B10F8 48 83 C4 38 add rsp,38h
000000013F1B10FC C3 ret
Which gives 150 in the first embodiment and the second 250.
Excusing the behavior of this algorithm Maximize Speed (/O2):
// test example binary search
pointer _NOINLINE findVoidSortMap(void ** list,void *key)
{
000000013F6C1000 4C 8B CA mov r9,rdx
if (!list) return 0;
000000013F6C1003 48 85 C9 test rcx,rcx
000000013F6C1006 74 41 je findVoidSortMap+49h (13F6C1049h)
if (!*list) return 0;
000000013F6C1008 48 8B 11 mov rdx,qword ptr [rcx]
000000013F6C100B 48 85 D2 test rdx,rdx
000000013F6C100E 74 39 je findVoidSortMap+49h (13F6C1049h)
unsigned int count= **(unsigned int**)list;
000000013F6C1010 8B 0A mov ecx,dword ptr [rdx]
char *p=(char*)*list;
p+=4;
000000013F6C1012 48 83 C2 04 add rdx,4
Element *b=(Element *)p;
_voidint skey=(_voidint)key;
while (count>0) {
000000013F6C1016 85 C9 test ecx,ecx
000000013F6C1018 74 2F je findVoidSortMap+49h (13F6C1049h)
000000013F6C101A 66 0F 1F 44 00 00 nop word ptr [rax+rax]
void** kt=(void**)&b[count>>1];
000000013F6C1020 8B C1 mov eax,ecx
000000013F6C1022 48 D1 E8 shr rax,1
000000013F6C1025 48 C1 E0 04 shl rax,4
000000013F6C1029 48 03 C2 add rax,rdx
_voidint rkey=(_voidint)kt[0];
000000013F6C102C 4C 8B 00 mov r8,qword ptr [rax]
if (skey==rkey) return (void**)&kt[1];
000000013F6C102F 4D 3B C8 cmp r9,r8
000000013F6C1032 74 18 je findVoidSortMap+4Ch (13F6C104Ch)
if (skey>rkey) {b+=(count>>1)+1;count--;}
000000013F6C1034 7E 0F jle findVoidSortMap+45h (13F6C1045h)
000000013F6C1036 8B C1 mov eax,ecx
000000013F6C1038 D1 E8 shr eax,1
000000013F6C103A FF C0 inc eax
000000013F6C103C 48 C1 E0 04 shl rax,4
000000013F6C1040 48 03 D0 add rdx,rax
000000013F6C1043 FF C9 dec ecx
count=count>>1;
000000013F6C1045 D1 E9 shr ecx,1
Element *b=(Element *)p;
_voidint skey=(_voidint)key;
while (count>0) {
000000013F6C1047 75 D7 jne findVoidSortMap+20h (13F6C1020h)
}
return 0;
000000013F6C1049 33 C0 xor eax,eax
}
000000013F6C104B C3 ret
if (skey==rkey) return (void**)&kt[1];
000000013F6C104C 48 83 C0 08 add rax,8
}
000000013F6C1050 C3 ret
Which gives 48, 113. As someone the behavior of the compiler does not give an idea of the work of the full code