user: Please show me the C implementation that matches the assembly code listed below:

```asm
<compare_short>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L287
  cmpq   $0x0,-0x18(%rbp)
  jne    L141
L287:
  mov    $0x0,%eax
  call   <ordering_err_2@plt>
  jmp    L589
L141:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  test   %rax,%rax
  jg     L480
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  test   %rax,%rax
  jns    L360
  mov    $0xffffffff,%edx
  jmp    L280
L360:
  mov    $0x0,%edx
  jmp    L280
L480:
  mov    $0x1,%edx
L280:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jg     L324
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jg     L320
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jge    L320
  mov    $0xffffffff,%eax
  jmp    L6
L320:
  mov    $0x0,%eax
  jmp    L6
L324:
  mov    $0x1,%eax
L6:
  cmp    %eax,%edx
  jne    L368
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  cmp    $0xffffffffc8130000,%rax
  je     L532
L368:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  test   %rax,%rax
  jg     L60
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  test   %rax,%rax
  jns    L588
  mov    $0xffffffff,%edx
  jmp    L408
L588:
  mov    $0x0,%edx
  jmp    L408
L60:
  mov    $0x1,%edx
L408:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jg     L379
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jg     L660
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jge    L660
  mov    $0xffffffff,%eax
  jmp    L557
L660:
  mov    $0x0,%eax
  jmp    L557
L379:
  mov    $0x1,%eax
L557:
  cmp    %eax,%edx
  jne    L348
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  cmp    $0xffffffffc8120000,%rax
  je     L532
L348:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  test   %rax,%rax
  jg     L218
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  test   %rax,%rax
  jns    L456
  mov    $0xffffffff,%edx
  jmp    L699
L456:
  mov    $0x0,%edx
  jmp    L699
L218:
  mov    $0x1,%edx
L699:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jg     L577
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jg     L165
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jge    L165
  mov    $0xffffffff,%eax
  jmp    L31
L165:
  mov    $0x0,%eax
  jmp    L31
L577:
  mov    $0x1,%eax
L31:
  cmp    %eax,%edx
  jne    L213
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswl %ax,%edx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswl %ax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  jmp    L589
L213:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%edx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%dx
  jg     L186
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%edx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%dx
  jge    L373
  mov    $0xffffffff,%eax
  jmp    L589
L373:
  mov    $0x0,%eax
  jmp    L589
L186:
  mov    $0x1,%eax
  jmp    L589
L532:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  test   %rax,%rax
  jg     L670
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  test   %rax,%rax
  jns    L422
  mov    $0xffffffff,%edx
  jmp    L185
L422:
  mov    $0x0,%edx
  jmp    L185
L670:
  mov    $0x1,%edx
L185:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jg     L447
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jg     L636
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jge    L636
  mov    $0xffffffff,%eax
  jmp    L106
L636:
  mov    $0x0,%eax
  jmp    L106
L447:
  mov    $0x1,%eax
L106:
  cmp    %eax,%edx
  jne    L609
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  test   %rax,%rax
  setle  %al
  jmp    L696
L609:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%edx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%dx
  setle  %al
L696:
  test   %al,%al
  je     L305
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  test   %rax,%rax
  jg     L352
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  test   %rax,%rax
  jns    L561
  mov    $0xffffffff,%edx
  jmp    L507
L561:
  mov    $0x0,%edx
  jmp    L507
L352:
  mov    $0x1,%edx
L507:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jg     L370
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jg     L311
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%cx
  jge    L311
  mov    $0xffffffff,%eax
  jmp    L438
L311:
  mov    $0x0,%eax
  jmp    L438
L370:
  mov    $0x1,%eax
L438:
  cmp    %eax,%edx
  jne    L638
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rdx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movswq %ax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  shr    $0x3f,%rax
  jmp    L399
L638:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%edx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%dx
  jg     L469
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%edx
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,%dx
  jge    L469
  mov    $0x1,%eax
  jmp    L671
L469:
  mov    $0x0,%eax
L671:
  and    $0x1,%eax
L399:
  test   %al,%al
  je     L78
  mov    $0xc8110000,%eax
  jmp    L589
L78:
  mov    $0x0,%eax
  jmp    L589
L305:
  mov    $0x37ef0000,%eax
L589:
  leave
  ret
```

assistant: ```c
int compare_short(void *context, const short *check, const short *baseline) {
  if (!check || !baseline)
    return ordering_err_2();
  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)))))))))))))));
}
```