user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<icmpare>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rdx,%r12
  movw   $0x0,(%rdx)
  movzbl (%rsi),%edx
  test   %dl,%dl
  jne    L318
L322:
  movsbl 0x0(%rbp),%eax
  jmp    L27
L321:
  lea    0x1(%rsi),%rbx
  movzbl 0x1(%rsi),%eax
  cmp    $0x64,%al
  je     L41
  jg     L102
  cmp    $0x43,%al
  je     L19
  cmp    $0x63,%al
  jne    L197
  mov    %r12,%rdx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <chk_cond@plt>
  test   %eax,%eax
  je     L174
  cltq
  lea    -0x1(%rbp,%rax,1),%rbp
  mov    %rbx,%rsi
  jmp    L114
L197:
  mov    %rbx,%rsi
  jmp    L114
L102:
  mov    %rbx,%rsi
  cmp    $0x73,%al
  jne    L114
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L32
  cmp    $0x2e,%al
  jne    L36
  lea    0x1(%rbp),%rdx
  movzbl 0x1(%rbp),%eax
  cmp    $0x6c,%al
  je     L326
  cmp    $0x77,%al
  je     L142
  cmp    $0x62,%al
  je     L185
  mov    $0x2e,%eax
L27:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L174:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  mov    $0xffffffff,%edx
  cmove  %edx,%eax
  movsbl %al,%eax
  jmp    L27
L19:
  mov    %r12,%rdx
  mov    $0x1,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <chk_cond@plt>
  test   %eax,%eax
  je     L188
  cltq
  lea    -0x1(%rbp,%rax,1),%rbp
  mov    %rbx,%rsi
  jmp    L114
L188:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  mov    $0xffffffff,%edx
  cmove  %edx,%eax
  movsbl %al,%eax
  jmp    L27
L41:
  movzbl 0x0(%rbp),%eax
  cmp    $0x72,%al
  je     L315
  cmp    $0x6c,%al
  jne    L35
  orw    $0x8,(%r12)
  mov    %rbx,%rsi
  jmp    L114
L35:
  test   %al,%al
  mov    $0xffffffff,%edx
  cmove  %edx,%eax
  movsbl %al,%eax
  jmp    L27
L36:
  movsbl %al,%eax
  jmp    L27
L185:
  orw    $0x1,(%r12)
  mov    %rdx,%rbp
  jmp    L114
L142:
  orw    $0x2,(%r12)
  mov    %rdx,%rbp
  jmp    L114
L326:
  orw    $0x4,(%r12)
  mov    %rdx,%rbp
  jmp    L114
L148:
  movsbl %al,%eax
  movsbl %dl,%edx
  sub    %edx,%eax
  jmp    L27
L315:
  mov    %rbx,%rsi
L205:
  add    $0x1,%rbp
  mov    %rsi,%rbx
L32:
  lea    0x1(%rbx),%rsi
  movzbl 0x1(%rbx),%edx
  test   %dl,%dl
  je     L322
L318:
  cmp    $0x24,%dl
  je     L321
  movzbl 0x0(%rbp),%eax
  cmp    %dl,%al
  jne    L148
L114:
  mov    %rsi,%rbx
  cmpb   $0x0,0x0(%rbp)
  jne    L205
  jmp    L32
```

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;
}
```