int compare_mempos(void *context, const void *check, const void *baseline) {
  return ((
      (((((((((((((((((signed long)(check)) - ((signed long)(baseline))))) <=
                  (((0))))
                     ? (((((((signed long)(check)) -
                            ((signed long)(baseline))))) < (((0))))
                            ? ((-1))
                            : ((0)))
                     : ((1))))) ==
              ((((((((((((((check))) <= (((baseline))))
                            ? (((((check))) < (((baseline)))) ? ((-1)) : ((0)))
                            : ((1)))))))) <= (((0))))
                     ? ((((((((((((check))) <= (((baseline))))
                                   ? (((((check))) < (((baseline)))) ? ((-1))
                                                                     : ((0)))
                                   : ((1)))))))) < (((0))))
                            ? ((-1))
                            : ((0)))
                     : ((1))))))
                 ? ((((signed long)(check)) - ((signed long)(baseline))))
                 : (((((((((check))) <= (((baseline))))
                            ? (((((check))) < (((baseline)))) ? ((-1)) : ((0)))
                            : ((1))))))))))) !=
         (((int)-(((int)0x37ED)
                  << (8 * (((!!(((!!(sizeof(int))) * ((sizeof(int)) - 1)))) *
                            ((((!!(sizeof(int))) * ((sizeof(int)) - 1))) -
                             1)))))))) &&
        (((((((((((((((signed long)(check)) - ((signed long)(baseline))))) <=
                  (((0))))
                     ? (((((((signed long)(check)) -
                            ((signed long)(baseline))))) < (((0))))
                            ? ((-1))
                            : ((0)))
                     : ((1))))) ==
              ((((((((((((((check))) <= (((baseline))))
                            ? (((((check))) < (((baseline)))) ? ((-1)) : ((0)))
                            : ((1)))))))) <= (((0))))
                     ? ((((((((((((check))) <= (((baseline))))
                                   ? (((((check))) < (((baseline)))) ? ((-1))
                                                                     : ((0)))
                                   : ((1)))))))) < (((0))))
                            ? ((-1))
                            : ((0)))
                     : ((1))))))
                 ? ((((signed long)(check)) - ((signed long)(baseline))))
                 : (((((((((check))) <= (((baseline))))
                            ? (((((check))) < (((baseline)))) ? ((-1)) : ((0)))
                            : ((1))))))))))) !=
         (((int)-(((int)0x37EE)
                  << (8 * (((!!(((!!(sizeof(int))) * ((sizeof(int)) - 1)))) *
                            ((((!!(sizeof(int))) * ((sizeof(int)) - 1))) -
                             1))))))))))
          ? (((((((((((((signed long)(check)) - ((signed long)(baseline))))) <=
                    (((0))))
                       ? (((((((signed long)(check)) -
                              ((signed long)(baseline))))) < (((0))))
                              ? ((-1))
                              : ((0)))
                       : ((1))))) ==
                ((((((((((
                        ((((check))) <= (((baseline))))
                            ? (((((check))) < (((baseline)))) ? ((-1)) : ((0)))
                            : ((1)))))))) <= (((0))))
                       ? ((((((((((((check))) <= (((baseline))))
                                     ? (((((check))) < (((baseline)))) ? ((-1))
                                                                       : ((0)))
                                     : ((1)))))))) < (((0))))
                              ? ((-1))
                              : ((0)))
                       : ((1))))))
                   ? ((((signed long)(check)) - ((signed long)(baseline))))
                   : (((((
                         ((((check))) <= (((baseline))))
                             ? (((((check))) < (((baseline)))) ? ((-1)) : ((0)))
                             : ((1))))))))))
          : ((((((((((((((((((signed long)(check)) -
                            ((signed long)(baseline))))) <= (((0))))
                            ? (((((((signed long)(check)) -
                                   ((signed long)(baseline))))) < (((0))))
                                   ? ((-1))
                                   : ((0)))
                            : ((1))))) ==
                     ((((((((((((((check))) <= (((baseline))))
                                   ? (((((check))) < (((baseline)))) ? ((-1))
                                                                     : ((0)))
                                   : ((1)))))))) <= (((0))))
                            ? ((((((((((((check))) <= (((baseline))))
                                          ? (((((check))) < (((baseline))))
                                                 ? ((-1))
                                                 : ((0)))
                                          : ((1)))))))) < (((0))))
                                   ? ((-1))
                                   : ((0)))
                            : ((1))))))
                        ? ((((signed long)(check)) - ((signed long)(baseline))))
                        : (((((((((check))) <= (((baseline))))
                                   ? (((((check))) < (((baseline)))) ? ((-1))
                                                                     : ((0)))
                                   : ((1)))))))))))) <= ((0)))
                  ? (((((((
                          ((((((((((signed long)(check)) -
                                  ((signed long)(baseline))))) <= (((0))))
                                  ? (((((((signed long)(check)) -
                                         ((signed long)(baseline))))) < (((0))))
                                         ? ((-1))
                                         : ((0)))
                                  : ((1))))) ==
                           ((((((((((((((check))) <= (((baseline))))
                                         ? (((((check))) < (((baseline))))
                                                ? ((-1))
                                                : ((0)))
                                         : ((1)))))))) <= (((0))))
                                  ? (((((((
                                          (((((check))) <= (((baseline))))
                                               ? (((((check))) < (((baseline))))
                                                      ? ((-1))
                                                      : ((0)))
                                               : ((1)))))))) < (((0))))
                                         ? ((-1))
                                         : ((0)))
                                  : ((1))))))
                              ? ((((signed long)(check)) -
                                  ((signed long)(baseline))))
                              : (((((((((check))) <= (((baseline))))
                                         ? (((((check))) < (((baseline))))
                                                ? ((-1))
                                                : ((0)))
                                         : ((1)))))))))))) < ((0)))
                         ? (((((int)-(((int)0x37EF)
                                      << (8 * (((!!(((!!(sizeof(int))) *
                                                     ((sizeof(int)) - 1)))) *
                                                ((((!!(sizeof(int))) *
                                                   ((sizeof(int)) - 1))) -
                                                 1)))))))))
                         : (((0))))
                  : (((((int)-(((int)-(
                        ((int)0x37EF)
                        << (8 *
                            (((!!(((!!(sizeof(int))) * ((sizeof(int)) - 1)))) *
                              ((((!!(sizeof(int))) * ((sizeof(int)) - 1))) -
                               1)))))))))))))));
}


x86 assembly (clang, -O0):
<compare_mempos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x0,%rax
jg     114a <compare_mempos+0x4a>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
sub    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
mov    %eax,-0x1c(%rbp)
jmp    1157 <compare_mempos+0x57>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1157 <compare_mempos+0x57>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     1188 <compare_mempos+0x88>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x24(%rbp)
jmp    1195 <compare_mempos+0x95>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1195 <compare_mempos+0x95>
mov    -0x24(%rbp),%eax
cmp    $0x0,%eax
jg     11f1 <compare_mempos+0xf1>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     11cc <compare_mempos+0xcc>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x28(%rbp)
jmp    11d9 <compare_mempos+0xd9>
mov    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11d9 <compare_mempos+0xd9>
mov    -0x28(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x2c(%rbp)
jmp    11fe <compare_mempos+0xfe>
mov    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11fe <compare_mempos+0xfe>
mov    -0x20(%rbp),%eax
mov    -0x2c(%rbp),%ecx
cmp    %ecx,%eax
jne    1220 <compare_mempos+0x120>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x38(%rbp)
jmp    1261 <compare_mempos+0x161>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     124b <compare_mempos+0x14b>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x3c(%rbp)
jmp    1258 <compare_mempos+0x158>
mov    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1258 <compare_mempos+0x158>
mov    -0x3c(%rbp),%eax
cltq
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    $0xffffffffc8130000,%rax
je     152b <compare_mempos+0x42b>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x0,%rax
jg     12a7 <compare_mempos+0x1a7>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
sub    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
mov    %eax,-0x40(%rbp)
jmp    12b4 <compare_mempos+0x1b4>
mov    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    12b4 <compare_mempos+0x1b4>
mov    -0x40(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     12e5 <compare_mempos+0x1e5>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x48(%rbp)
jmp    12f2 <compare_mempos+0x1f2>
mov    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    12f2 <compare_mempos+0x1f2>
mov    -0x48(%rbp),%eax
cmp    $0x0,%eax
jg     134e <compare_mempos+0x24e>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     1329 <compare_mempos+0x229>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x4c(%rbp)
jmp    1336 <compare_mempos+0x236>
mov    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1336 <compare_mempos+0x236>
mov    -0x4c(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x50(%rbp)
jmp    135b <compare_mempos+0x25b>
mov    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    135b <compare_mempos+0x25b>
mov    -0x44(%rbp),%eax
mov    -0x50(%rbp),%ecx
cmp    %ecx,%eax
jne    137d <compare_mempos+0x27d>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x58(%rbp)
jmp    13be <compare_mempos+0x2be>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     13a8 <compare_mempos+0x2a8>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x5c(%rbp)
jmp    13b5 <compare_mempos+0x2b5>
mov    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    13b5 <compare_mempos+0x2b5>
mov    -0x5c(%rbp),%eax
cltq
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
cmp    $0xffffffffc8120000,%rax
je     152b <compare_mempos+0x42b>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x0,%rax
jg     1404 <compare_mempos+0x304>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
sub    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
mov    %eax,-0x60(%rbp)
jmp    1411 <compare_mempos+0x311>
mov    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    1411 <compare_mempos+0x311>
mov    -0x60(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     1442 <compare_mempos+0x342>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x68(%rbp)
jmp    144f <compare_mempos+0x34f>
mov    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    144f <compare_mempos+0x34f>
mov    -0x68(%rbp),%eax
cmp    $0x0,%eax
jg     14ab <compare_mempos+0x3ab>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     1486 <compare_mempos+0x386>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x6c(%rbp)
jmp    1493 <compare_mempos+0x393>
mov    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1493 <compare_mempos+0x393>
mov    -0x6c(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x70(%rbp)
jmp    14b8 <compare_mempos+0x3b8>
mov    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    14b8 <compare_mempos+0x3b8>
mov    -0x64(%rbp),%eax
mov    -0x70(%rbp),%ecx
cmp    %ecx,%eax
jne    14da <compare_mempos+0x3da>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x78(%rbp)
jmp    151b <compare_mempos+0x41b>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     1505 <compare_mempos+0x405>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x7c(%rbp)
jmp    1512 <compare_mempos+0x412>
mov    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1512 <compare_mempos+0x412>
mov    -0x7c(%rbp),%eax
cltq
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x88(%rbp)
jmp    1887 <compare_mempos+0x787>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x0,%rax
jg     1564 <compare_mempos+0x464>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
sub    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
mov    %eax,-0x8c(%rbp)
jmp    1574 <compare_mempos+0x474>
mov    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1574 <compare_mempos+0x474>
mov    -0x8c(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     15ae <compare_mempos+0x4ae>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x94(%rbp)
jmp    15be <compare_mempos+0x4be>
mov    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    15be <compare_mempos+0x4be>
mov    -0x94(%rbp),%eax
cmp    $0x0,%eax
jg     1629 <compare_mempos+0x529>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     15fb <compare_mempos+0x4fb>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x98(%rbp)
jmp    160b <compare_mempos+0x50b>
mov    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    160b <compare_mempos+0x50b>
mov    -0x98(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x9c(%rbp)
jmp    1639 <compare_mempos+0x539>
mov    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1639 <compare_mempos+0x539>
mov    -0x90(%rbp),%eax
mov    -0x9c(%rbp),%ecx
cmp    %ecx,%eax
jne    1664 <compare_mempos+0x564>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0xa8(%rbp)
jmp    16b1 <compare_mempos+0x5b1>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     1692 <compare_mempos+0x592>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0xac(%rbp)
jmp    16a2 <compare_mempos+0x5a2>
mov    $0x1,%eax
mov    %eax,-0xac(%rbp)
jmp    16a2 <compare_mempos+0x5a2>
mov    -0xac(%rbp),%eax
cltq
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
cmp    $0x0,%rax
jg     1868 <compare_mempos+0x768>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x0,%rax
jg     16fb <compare_mempos+0x5fb>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
sub    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
mov    %eax,-0xb0(%rbp)
jmp    170b <compare_mempos+0x60b>
mov    $0x1,%eax
mov    %eax,-0xb0(%rbp)
jmp    170b <compare_mempos+0x60b>
mov    -0xb0(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     1745 <compare_mempos+0x645>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0xb8(%rbp)
jmp    1755 <compare_mempos+0x655>
mov    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1755 <compare_mempos+0x655>
mov    -0xb8(%rbp),%eax
cmp    $0x0,%eax
jg     17c0 <compare_mempos+0x6c0>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     1792 <compare_mempos+0x692>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0xbc(%rbp)
jmp    17a2 <compare_mempos+0x6a2>
mov    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    17a2 <compare_mempos+0x6a2>
mov    -0xbc(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0xc0(%rbp)
jmp    17d0 <compare_mempos+0x6d0>
mov    $0x1,%eax
mov    %eax,-0xc0(%rbp)
jmp    17d0 <compare_mempos+0x6d0>
mov    -0xb4(%rbp),%eax
mov    -0xc0(%rbp),%ecx
cmp    %ecx,%eax
jne    17fb <compare_mempos+0x6fb>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0xc8(%rbp)
jmp    1848 <compare_mempos+0x748>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     1829 <compare_mempos+0x729>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0xcc(%rbp)
jmp    1839 <compare_mempos+0x739>
mov    $0x1,%eax
mov    %eax,-0xcc(%rbp)
jmp    1839 <compare_mempos+0x739>
mov    -0xcc(%rbp),%eax
cltq
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rdx
xor    %eax,%eax
mov    $0xc8110000,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
mov    %eax,-0xd0(%rbp)
jmp    1878 <compare_mempos+0x778>
mov    $0x37ef0000,%eax
mov    %eax,-0xd0(%rbp)
jmp    1878 <compare_mempos+0x778>
mov    -0xd0(%rbp),%eax
cltq
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_mempos>:
xor    %eax,%eax
cmp    %rdx,%rsi
setb   %al
mov    %rax,%rdi
neg    %rdi
cmp    %rdx,%rsi
mov    $0x1,%ecx
cmovbe %rdi,%rcx
neg    %eax
xor    %edi,%edi
sub    %rdx,%rsi
mov    $0x1,%r8d
cmova  %r8d,%eax
setne  %dil
neg    %edi
test   %rsi,%rsi
cmovg  %r8d,%edi
mov    %eax,%edx
sar    $0x1f,%edx
test   %eax,%eax
cmovg  %r8d,%edx
cmp    %edx,%edi
mov    %rcx,%rdx
cmove  %rsi,%rdx
or     $0x10000,%rdx
cmp    $0xffffffffc8130000,%rdx
jne    116d <compare_mempos+0x6d>
cmp    %eax,%edi
cmove  %rsi,%rcx
mov    $0x37ef0000,%eax
test   %rcx,%rcx
jle    1177 <compare_mempos+0x77>
ret
cmp    %eax,%edi
cmove  %rsi,%rcx
mov    %rcx,%rax
ret
mov    $0xffffffffc8110000,%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i32 @compare_mempos(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = ptrtoint i8* %7 to i64
%9 = load i8*, i8** %6
%10 = ptrtoint i8* %9 to i64
%11 = sub nsw i64 %8, %10
%12 = icmp sle i64 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
%16 = load i8*, i8** %6
%17 = ptrtoint i8* %16 to i64
%18 = sub nsw i64 %15, %17
%19 = icmp slt i64 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 -1, i32 0
br label %23
22: ; preds = %3
br label %23
23: ; preds = %22, %13
%24 = phi i32 [ %21, %13 ], [ 1, %22 ]
%25 = load i8*, i8** %5
%26 = load i8*, i8** %6
%27 = icmp ule i8* %25, %26
br i1 %27, label %28, label %34
28: ; preds = %23
%29 = load i8*, i8** %5
%30 = load i8*, i8** %6
%31 = icmp ult i8* %29, %30
%32 = zext i1 %31 to i64
%33 = select i1 %31, i32 -1, i32 0
br label %35
34: ; preds = %23
br label %35
35: ; preds = %34, %28
%36 = phi i32 [ %33, %28 ], [ 1, %34 ]
%37 = icmp sle i32 %36, 0
br i1 %37, label %38, label %54
38: ; preds = %35
%39 = load i8*, i8** %5
%40 = load i8*, i8** %6
%41 = icmp ule i8* %39, %40
br i1 %41, label %42, label %48
42: ; preds = %38
%43 = load i8*, i8** %5
%44 = load i8*, i8** %6
%45 = icmp ult i8* %43, %44
%46 = zext i1 %45 to i64
%47 = select i1 %45, i32 -1, i32 0
br label %49
48: ; preds = %38
br label %49
49: ; preds = %48, %42
%50 = phi i32 [ %47, %42 ], [ 1, %48 ]
%51 = icmp slt i32 %50, 0
%52 = zext i1 %51 to i64
%53 = select i1 %51, i32 -1, i32 0
br label %55
54: ; preds = %35
br label %55
55: ; preds = %54, %49
%56 = phi i32 [ %53, %49 ], [ 1, %54 ]
%57 = icmp eq i32 %24, %56
br i1 %57, label %58, label %64
58: ; preds = %55
%59 = load i8*, i8** %5
%60 = ptrtoint i8* %59 to i64
%61 = load i8*, i8** %6
%62 = ptrtoint i8* %61 to i64
%63 = sub nsw i64 %60, %62
br label %78
64: ; preds = %55
%65 = load i8*, i8** %5
%66 = load i8*, i8** %6
%67 = icmp ule i8* %65, %66
br i1 %67, label %68, label %74
68: ; preds = %64
%69 = load i8*, i8** %5
%70 = load i8*, i8** %6
%71 = icmp ult i8* %69, %70
%72 = zext i1 %71 to i64
%73 = select i1 %71, i32 -1, i32 0
br label %75
74: ; preds = %64
br label %75
75: ; preds = %74, %68
%76 = phi i32 [ %73, %68 ], [ 1, %74 ]
%77 = sext i32 %76 to i64
br label %78
78: ; preds = %75, %58
%79 = phi i64 [ %63, %58 ], [ %77, %75 ]
%80 = icmp ne i64 %79, -938278912
br i1 %80, label %81, label %230
81: ; preds = %78
%82 = load i8*, i8** %5
%83 = ptrtoint i8* %82 to i64
%84 = load i8*, i8** %6
%85 = ptrtoint i8* %84 to i64
%86 = sub nsw i64 %83, %85
%87 = icmp sle i64 %86, 0
br i1 %87, label %88, label %97
88: ; preds = %81
%89 = load i8*, i8** %5
%90 = ptrtoint i8* %89 to i64
%91 = load i8*, i8** %6
%92 = ptrtoint i8* %91 to i64
%93 = sub nsw i64 %90, %92
%94 = icmp slt i64 %93, 0
%95 = zext i1 %94 to i64
%96 = select i1 %94, i32 -1, i32 0
br label %98
97: ; preds = %81
br label %98
98: ; preds = %97, %88
%99 = phi i32 [ %96, %88 ], [ 1, %97 ]
%100 = load i8*, i8** %5
%101 = load i8*, i8** %6
%102 = icmp ule i8* %100, %101
br i1 %102, label %103, label %109
103: ; preds = %98
%104 = load i8*, i8** %5
%105 = load i8*, i8** %6
%106 = icmp ult i8* %104, %105
%107 = zext i1 %106 to i64
%108 = select i1 %106, i32 -1, i32 0
br label %110
109: ; preds = %98
br label %110
110: ; preds = %109, %103
%111 = phi i32 [ %108, %103 ], [ 1, %109 ]
%112 = icmp sle i32 %111, 0
br i1 %112, label %113, label %129
113: ; preds = %110
%114 = load i8*, i8** %5
%115 = load i8*, i8** %6
%116 = icmp ule i8* %114, %115
br i1 %116, label %117, label %123
117: ; preds = %113
%118 = load i8*, i8** %5
%119 = load i8*, i8** %6
%120 = icmp ult i8* %118, %119
%121 = zext i1 %120 to i64
%122 = select i1 %120, i32 -1, i32 0
br label %124
123: ; preds = %113
br label %124
124: ; preds = %123, %117
%125 = phi i32 [ %122, %117 ], [ 1, %123 ]
%126 = icmp slt i32 %125, 0
%127 = zext i1 %126 to i64
%128 = select i1 %126, i32 -1, i32 0
br label %130
129: ; preds = %110
br label %130
130: ; preds = %129, %124
%131 = phi i32 [ %128, %124 ], [ 1, %129 ]
%132 = icmp eq i32 %99, %131
br i1 %132, label %133, label %139
133: ; preds = %130
%134 = load i8*, i8** %5
%135 = ptrtoint i8* %134 to i64
%136 = load i8*, i8** %6
%137 = ptrtoint i8* %136 to i64
%138 = sub nsw i64 %135, %137
br label %153
139: ; preds = %130
%140 = load i8*, i8** %5
%141 = load i8*, i8** %6
%142 = icmp ule i8* %140, %141
br i1 %142, label %143, label %149
143: ; preds = %139
%144 = load i8*, i8** %5
%145 = load i8*, i8** %6
%146 = icmp ult i8* %144, %145
%147 = zext i1 %146 to i64
%148 = select i1 %146, i32 -1, i32 0
br label %150
149: ; preds = %139
br label %150
150: ; preds = %149, %143
%151 = phi i32 [ %148, %143 ], [ 1, %149 ]
%152 = sext i32 %151 to i64
br label %153
153: ; preds = %150, %133
%154 = phi i64 [ %138, %133 ], [ %152, %150 ]
%155 = icmp ne i64 %154, -938344448
br i1 %155, label %156, label %230
156: ; preds = %153
%157 = load i8*, i8** %5
%158 = ptrtoint i8* %157 to i64
%159 = load i8*, i8** %6
%160 = ptrtoint i8* %159 to i64
%161 = sub nsw i64 %158, %160
%162 = icmp sle i64 %161, 0
br i1 %162, label %163, label %172
163: ; preds = %156
%164 = load i8*, i8** %5
%165 = ptrtoint i8* %164 to i64
%166 = load i8*, i8** %6
%167 = ptrtoint i8* %166 to i64
%168 = sub nsw i64 %165, %167
%169 = icmp slt i64 %168, 0
%170 = zext i1 %169 to i64
%171 = select i1 %169, i32 -1, i32 0
br label %173
172: ; preds = %156
br label %173
173: ; preds = %172, %163
%174 = phi i32 [ %171, %163 ], [ 1, %172 ]
%175 = load i8*, i8** %5
%176 = load i8*, i8** %6
%177 = icmp ule i8* %175, %176
br i1 %177, label %178, label %184
178: ; preds = %173
%179 = load i8*, i8** %5
%180 = load i8*, i8** %6
%181 = icmp ult i8* %179, %180
%182 = zext i1 %181 to i64
%183 = select i1 %181, i32 -1, i32 0
br label %185
184: ; preds = %173
br label %185
185: ; preds = %184, %178
%186 = phi i32 [ %183, %178 ], [ 1, %184 ]
%187 = icmp sle i32 %186, 0
br i1 %187, label %188, label %204
188: ; preds = %185
%189 = load i8*, i8** %5
%190 = load i8*, i8** %6
%191 = icmp ule i8* %189, %190
br i1 %191, label %192, label %198
192: ; preds = %188
%193 = load i8*, i8** %5
%194 = load i8*, i8** %6
%195 = icmp ult i8* %193, %194
%196 = zext i1 %195 to i64
%197 = select i1 %195, i32 -1, i32 0
br label %199
198: ; preds = %188
br label %199
199: ; preds = %198, %192
%200 = phi i32 [ %197, %192 ], [ 1, %198 ]
%201 = icmp slt i32 %200, 0
%202 = zext i1 %201 to i64
%203 = select i1 %201, i32 -1, i32 0
br label %205
204: ; preds = %185
br label %205
205: ; preds = %204, %199
%206 = phi i32 [ %203, %199 ], [ 1, %204 ]
%207 = icmp eq i32 %174, %206
br i1 %207, label %208, label %214
208: ; preds = %205
%209 = load i8*, i8** %5
%210 = ptrtoint i8* %209 to i64
%211 = load i8*, i8** %6
%212 = ptrtoint i8* %211 to i64
%213 = sub nsw i64 %210, %212
br label %228
214: ; preds = %205
%215 = load i8*, i8** %5
%216 = load i8*, i8** %6
%217 = icmp ule i8* %215, %216
br i1 %217, label %218, label %224
218: ; preds = %214
%219 = load i8*, i8** %5
%220 = load i8*, i8** %6
%221 = icmp ult i8* %219, %220
%222 = zext i1 %221 to i64
%223 = select i1 %221, i32 -1, i32 0
br label %225
224: ; preds = %214
br label %225
225: ; preds = %224, %218
%226 = phi i32 [ %223, %218 ], [ 1, %224 ]
%227 = sext i32 %226 to i64
br label %228
228: ; preds = %225, %208
%229 = phi i64 [ %213, %208 ], [ %227, %225 ]
br label %386
230: ; preds = %153, %78
%231 = load i8*, i8** %5
%232 = ptrtoint i8* %231 to i64
%233 = load i8*, i8** %6
%234 = ptrtoint i8* %233 to i64
%235 = sub nsw i64 %232, %234
%236 = icmp sle i64 %235, 0
br i1 %236, label %237, label %246
237: ; preds = %230
%238 = load i8*, i8** %5
%239 = ptrtoint i8* %238 to i64
%240 = load i8*, i8** %6
%241 = ptrtoint i8* %240 to i64
%242 = sub nsw i64 %239, %241
%243 = icmp slt i64 %242, 0
%244 = zext i1 %243 to i64
%245 = select i1 %243, i32 -1, i32 0
br label %247
246: ; preds = %230
br label %247
247: ; preds = %246, %237
%248 = phi i32 [ %245, %237 ], [ 1, %246 ]
%249 = load i8*, i8** %5
%250 = load i8*, i8** %6
%251 = icmp ule i8* %249, %250
br i1 %251, label %252, label %258
252: ; preds = %247
%253 = load i8*, i8** %5
%254 = load i8*, i8** %6
%255 = icmp ult i8* %253, %254
%256 = zext i1 %255 to i64
%257 = select i1 %255, i32 -1, i32 0
br label %259
258: ; preds = %247
br label %259
259: ; preds = %258, %252
%260 = phi i32 [ %257, %252 ], [ 1, %258 ]
%261 = icmp sle i32 %260, 0
br i1 %261, label %262, label %278
262: ; preds = %259
%263 = load i8*, i8** %5
%264 = load i8*, i8** %6
%265 = icmp ule i8* %263, %264
br i1 %265, label %266, label %272
266: ; preds = %262
%267 = load i8*, i8** %5
%268 = load i8*, i8** %6
%269 = icmp ult i8* %267, %268
%270 = zext i1 %269 to i64
%271 = select i1 %269, i32 -1, i32 0
br label %273
272: ; preds = %262
br label %273
273: ; preds = %272, %266
%274 = phi i32 [ %271, %266 ], [ 1, %272 ]
%275 = icmp slt i32 %274, 0
%276 = zext i1 %275 to i64
%277 = select i1 %275, i32 -1, i32 0
br label %279
278: ; preds = %259
br label %279
279: ; preds = %278, %273
%280 = phi i32 [ %277, %273 ], [ 1, %278 ]
%281 = icmp eq i32 %248, %280
br i1 %281, label %282, label %288
282: ; preds = %279
%283 = load i8*, i8** %5
%284 = ptrtoint i8* %283 to i64
%285 = load i8*, i8** %6
%286 = ptrtoint i8* %285 to i64
%287 = sub nsw i64 %284, %286
br label %302
288: ; preds = %279
%289 = load i8*, i8** %5
%290 = load i8*, i8** %6
%291 = icmp ule i8* %289, %290
br i1 %291, label %292, label %298
292: ; preds = %288
%293 = load i8*, i8** %5
%294 = load i8*, i8** %6
%295 = icmp ult i8* %293, %294
%296 = zext i1 %295 to i64
%297 = select i1 %295, i32 -1, i32 0
br label %299
298: ; preds = %288
br label %299
299: ; preds = %298, %292
%300 = phi i32 [ %297, %292 ], [ 1, %298 ]
%301 = sext i32 %300 to i64
br label %302
302: ; preds = %299, %282
%303 = phi i64 [ %287, %282 ], [ %301, %299 ]
%304 = icmp sle i64 %303, 0
br i1 %304, label %305, label %382
305: ; preds = %302
%306 = load i8*, i8** %5
%307 = ptrtoint i8* %306 to i64
%308 = load i8*, i8** %6
%309 = ptrtoint i8* %308 to i64
%310 = sub nsw i64 %307, %309
%311 = icmp sle i64 %310, 0
br i1 %311, label %312, label %321
312: ; preds = %305
%313 = load i8*, i8** %5
%314 = ptrtoint i8* %313 to i64
%315 = load i8*, i8** %6
%316 = ptrtoint i8* %315 to i64
%317 = sub nsw i64 %314, %316
%318 = icmp slt i64 %317, 0
%319 = zext i1 %318 to i64
%320 = select i1 %318, i32 -1, i32 0
br label %322
321: ; preds = %305
br label %322
322: ; preds = %321, %312
%323 = phi i32 [ %320, %312 ], [ 1, %321 ]
%324 = load i8*, i8** %5
%325 = load i8*, i8** %6
%326 = icmp ule i8* %324, %325
br i1 %326, label %327, label %333
327: ; preds = %322
%328 = load i8*, i8** %5
%329 = load i8*, i8** %6
%330 = icmp ult i8* %328, %329
%331 = zext i1 %330 to i64
%332 = select i1 %330, i32 -1, i32 0
br label %334
333: ; preds = %322
br label %334
334: ; preds = %333, %327
%335 = phi i32 [ %332, %327 ], [ 1, %333 ]
%336 = icmp sle i32 %335, 0
br i1 %336, label %337, label %353
337: ; preds = %334
%338 = load i8*, i8** %5
%339 = load i8*, i8** %6
%340 = icmp ule i8* %338, %339
br i1 %340, label %341, label %347
341: ; preds = %337
%342 = load i8*, i8** %5
%343 = load i8*, i8** %6
%344 = icmp ult i8* %342, %343
%345 = zext i1 %344 to i64
%346 = select i1 %344, i32 -1, i32 0
br label %348
347: ; preds = %337
br label %348
348: ; preds = %347, %341
%349 = phi i32 [ %346, %341 ], [ 1, %347 ]
%350 = icmp slt i32 %349, 0
%351 = zext i1 %350 to i64
%352 = select i1 %350, i32 -1, i32 0
br label %354
353: ; preds = %334
br label %354
354: ; preds = %353, %348
%355 = phi i32 [ %352, %348 ], [ 1, %353 ]
%356 = icmp eq i32 %323, %355
br i1 %356, label %357, label %363
357: ; preds = %354
%358 = load i8*, i8** %5
%359 = ptrtoint i8* %358 to i64
%360 = load i8*, i8** %6
%361 = ptrtoint i8* %360 to i64
%362 = sub nsw i64 %359, %361
br label %377
363: ; preds = %354
%364 = load i8*, i8** %5
%365 = load i8*, i8** %6
%366 = icmp ule i8* %364, %365
br i1 %366, label %367, label %373
367: ; preds = %363
%368 = load i8*, i8** %5
%369 = load i8*, i8** %6
%370 = icmp ult i8* %368, %369
%371 = zext i1 %370 to i64
%372 = select i1 %370, i32 -1, i32 0
br label %374
373: ; preds = %363
br label %374
374: ; preds = %373, %367
%375 = phi i32 [ %372, %367 ], [ 1, %373 ]
%376 = sext i32 %375 to i64
br label %377
377: ; preds = %374, %357
%378 = phi i64 [ %362, %357 ], [ %376, %374 ]
%379 = icmp slt i64 %378, 0
%380 = zext i1 %379 to i64
%381 = select i1 %379, i32 -938409984, i32 0
br label %383
382: ; preds = %302
br label %383
383: ; preds = %382, %377
%384 = phi i32 [ %381, %377 ], [ 938409984, %382 ]
%385 = sext i32 %384 to i64
br label %386
386: ; preds = %383, %228
%387 = phi i64 [ %229, %228 ], [ %385, %383 ]
%388 = trunc i64 %387 to i32
ret i32 %388
}

LLVM IR (-O2):
define i32 @compare_mempos(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %2 to i64
%6 = sub nsw i64 %4, %5
%7 = icmp slt i64 %6, 1
%8 = icmp ne i64 %6, 0
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 %9, i32 1
%11 = icmp ugt i8* %1, %2
%12 = icmp ult i8* %1, %2
%13 = sext i1 %12 to i32
%14 = select i1 %11, i32 1, i32 %13
%15 = icmp slt i32 %14, 1
%16 = ashr i32 %14, 31
%17 = select i1 %15, i32 %16, i32 1
%18 = icmp eq i32 %10, %17
%19 = sext i1 %12 to i64
%20 = select i1 %11, i64 1, i64 %19
%21 = select i1 %18, i64 %6, i64 %20
switch i64 %21, label %22 [
i64 -938278912, label %25
i64 -938344448, label %25
]
22: ; preds = %3
%23 = icmp eq i32 %10, %14
%24 = select i1 %23, i64 %6, i64 %20
br label %32
25: ; preds = %3, %3
%26 = icmp eq i32 %10, %14
%27 = select i1 %26, i64 %6, i64 %20
%28 = icmp slt i64 %27, 1
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = icmp eq i64 %27, 0
%31 = select i1 %30, i64 0, i64 -938409984
br label %32
32: ; preds = %22, %29, %25
%33 = phi i64 [ %31, %29 ], [ 938409984, %25 ], [ %24, %22 ]
%34 = trunc i64 %33 to i32
ret i32 %34
}