Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int __cdecl memcmp(const void *Buf1, const void *Buf2, size_t Size)
- {
- signed __int64 v3; // rdx
- bool v4; // cf
- size_t v6; // r9
- unsigned __int64 v7; // rax
- size_t v8; // r9
- v3 = Buf2 - Buf1;
- if ( Size < 8 )
- goto LABEL_6;
- for ( ; Buf1 & 7; --Size )
- {
- v4 = *Buf1 < *(Buf1 + v3);
- if ( *Buf1 != *(Buf1 + v3) )
- return -v4 - (v4 - 1);
- Buf1 = Buf1 + 1;
- }
- if ( !(Size >> 3) )
- {
- LABEL_6:
- if ( !Size )
- return 0;
- while ( 1 )
- {
- v4 = *Buf1 < *(Buf1 + v3);
- if ( *Buf1 != *(Buf1 + v3) )
- break;
- Buf1 = Buf1 + 1;
- if ( !--Size )
- return 0;
- }
- return -v4 - (v4 - 1);
- }
- v6 = Size >> 5;
- if ( Size >> 5 )
- {
- while ( 1 )
- {
- v7 = *Buf1;
- if ( *Buf1 != *(Buf1 + v3) )
- break;
- v7 = *(Buf1 + 1);
- if ( v7 != *(Buf1 + v3 + 8) )
- goto LABEL_24;
- v7 = *(Buf1 + 2);
- if ( v7 != *(Buf1 + v3 + 16) )
- goto LABEL_23;
- v7 = *(Buf1 + 3);
- if ( v7 != *(Buf1 + v3 + 24) )
- {
- Buf1 = Buf1 + 8;
- LABEL_23:
- Buf1 = Buf1 + 8;
- LABEL_24:
- Buf1 = Buf1 + 8;
- break;
- }
- Buf1 = Buf1 + 32;
- if ( !--v6 )
- {
- Size &= 0x1Fu;
- goto LABEL_18;
- }
- }
- }
- else
- {
- LABEL_18:
- v8 = Size >> 3;
- if ( !(Size >> 3) )
- goto LABEL_6;
- while ( 1 )
- {
- v7 = *Buf1;
- if ( *Buf1 != *(Buf1 + v3) )
- break;
- Buf1 = Buf1 + 8;
- if ( !--v8 )
- {
- Size &= 7u;
- goto LABEL_6;
- }
- }
- }
- v4 = _byteswap_uint64(v7) < _byteswap_uint64(*(Buf1 + v3));
- return -v4 - (v4 - 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement