user: What is the c source code of the assembly code below:

```asm
<icmpare>:
  endbr64
  xor    %eax,%eax
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %ax,(%rdx)
  movsbl (%rsi),%edx
  test   %dl,%dl
  jne    L48
  jmp    L74
  nop
L97:
  movsbl 0x0(%rbp),%eax
  cmp    %al,%dl
  jne    L110
L21:
  add    $0x1,%rbp
  mov    %rsi,%rbx
L239:
  movsbl 0x1(%rbx),%edx
  lea    0x1(%rbx),%rsi
  test   %dl,%dl
  je     L74
L48:
  cmp    $0x24,%dl
  jne    L97
  movzbl 0x1(%rsi),%eax
  lea    0x1(%rsi),%rbx
  cmp    $0x64,%al
  je     L131
  jg     L181
  cmp    $0x43,%al
  je     L211
  cmp    $0x63,%al
  jne    L276
  mov    %r12,%rdx
  xor    %esi,%esi
L171:
  xor    %eax,%eax
  mov    %rbp,%rdi
  call   <chk_cond@plt>
  test   %eax,%eax
  je     L122
  cltq
  lea    -0x1(%rbp,%rax,1),%rbp
  movzbl 0x0(%rbp),%eax
L275:
  test   %al,%al
  je     L239
  nopl   0x0(%rax)
L158:
  mov    %rbx,%rsi
  jmp    L21
  nopl   (%rax)
L181:
  cmp    $0x73,%al
  jne    L276
  movsbl 0x0(%rbp),%eax
  test   %al,%al
  je     L239
  cmp    $0x2e,%al
  jne    L166
  movzbl 0x1(%rbp),%eax
  lea    0x1(%rbp),%rdx
  cmp    $0x6c,%al
  je     L214
  cmp    $0x77,%al
  je     L149
  cmp    $0x62,%al
  je     L42
  mov    $0x2e,%eax
L166:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L131:
  movsbl 0x0(%rbp),%eax
  cmp    $0x72,%al
  je     L158
  cmp    $0x6c,%al
  jne    L141
  orw    $0x8,(%r12)
  movzbl 0x0(%rbp),%eax
  jmp    L275
  nopl   0x0(%rax)
L276:
  movzbl 0x0(%rbp),%eax
  jmp    L275
  cs nopw 0x0(%rax,%rax,1)
L211:
  mov    %r12,%rdx
  mov    $0x1,%esi
  jmp    L171
  nopl   (%rax)
L74:
  movsbl 0x0(%rbp),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L110:
  pop    %rbx
  sub    %edx,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L149:
  orw    $0x2,(%r12)
  movzbl 0x1(%rbp),%eax
  mov    %rdx,%rbp
  jmp    L275
  nopw   0x0(%rax,%rax,1)
L42:
  orw    $0x1,(%r12)
  movzbl 0x1(%rbp),%eax
  mov    %rdx,%rbp
  jmp    L275
L214:
  orw    $0x4,(%r12)
  movzbl 0x1(%rbp),%eax
  mov    %rdx,%rbp
  jmp    L275
L122:
  movsbl 0x0(%rbp),%eax
  mov    $0xffffffff,%edx
  test   %al,%al
  cmove  %edx,%eax
  jmp    L166
L141:
  test   %al,%al
  mov    $0xffffffff,%edx
  cmove  %edx,%eax
  jmp    L166
```

assistant: ```c
int icmpare(token, mnemon, misc)
char *token;
char *mnemon;
short *misc;
{
  register int i;
  register char *tp, *mp;
  *misc = 0;
  for (tp = token, mp = mnemon; *mp; mp++) {
    if (*mp == '$') {
      switch (*++mp) {
      case 'c':
        i = chk_cond(tp, 0, misc);
        if (i == 0)
          return *tp ? *tp : -1;
        tp += i - 1;
        break;
      case 'C':
        i = chk_cond(tp, 1, misc);
        if (i == 0)
          return *tp ? *tp : -1;
        tp += i - 1;
        break;
      case 'd':
        if (*tp == 'r')
          *misc |= 0x00;
        else if (*tp == 'l')
          *misc |= 0x08;
        else
          return *tp ? *tp : -1;
        break;
      case 's':
        if (*tp) {
          if (*tp != '.')
            return *tp;
          switch (*++tp) {
          case 'b':
            *misc |= 0x01;
            break;
          case 'w':
            *misc |= 0x02;
            break;
          case 'l':
            *misc |= 0x04;
            break;
          default:
            return '.';
          }
        }
        break;
      }
    } else if (*mp != *tp) {
      return *tp - *mp;
    }
    if (*tp)
      tp++;
  }
  return *tp;
}
```