user: 请将这段汇编代码片段转换成等效的C代码：

```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    L125
  jmp    L110
  nop
L126:
  movsbl 0x0(%rbp),%eax
  cmp    %al,%dl
  jne    L128
L175:
  add    $0x1,%rbp
  mov    %rsi,%rbx
L116:
  movsbl 0x1(%rbx),%edx
  lea    0x1(%rbx),%rsi
  test   %dl,%dl
  je     L110
L125:
  cmp    $0x24,%dl
  jne    L126
  movzbl 0x1(%rsi),%eax
  lea    0x1(%rsi),%rbx
  cmp    $0x64,%al
  je     L63
  jg     L275
  cmp    $0x43,%al
  je     L236
  cmp    $0x63,%al
  jne    L211
  mov    %r12,%rdx
  xor    %esi,%esi
L67:
  xor    %eax,%eax
  mov    %rbp,%rdi
  call   <chk_cond@plt>
  test   %eax,%eax
  je     L247
  cltq
  lea    -0x1(%rbp,%rax,1),%rbp
  movzbl 0x0(%rbp),%eax
L101:
  test   %al,%al
  je     L116
  nopl   0x0(%rax)
L130:
  mov    %rbx,%rsi
  jmp    L175
  nopl   (%rax)
L275:
  cmp    $0x73,%al
  jne    L211
  movsbl 0x0(%rbp),%eax
  test   %al,%al
  je     L116
  cmp    $0x2e,%al
  jne    L50
  movzbl 0x1(%rbp),%eax
  lea    0x1(%rbp),%rdx
  cmp    $0x6c,%al
  je     L230
  cmp    $0x77,%al
  je     L107
  cmp    $0x62,%al
  je     L71
  mov    $0x2e,%eax
L50:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L63:
  movsbl 0x0(%rbp),%eax
  cmp    $0x72,%al
  je     L130
  cmp    $0x6c,%al
  jne    L235
  orw    $0x8,(%r12)
  movzbl 0x0(%rbp),%eax
  jmp    L101
  nopl   0x0(%rax)
L211:
  movzbl 0x0(%rbp),%eax
  jmp    L101
  cs nopw 0x0(%rax,%rax,1)
L236:
  mov    %r12,%rdx
  mov    $0x1,%esi
  jmp    L67
  nopl   (%rax)
L110:
  movsbl 0x0(%rbp),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L128:
  pop    %rbx
  sub    %edx,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L107:
  orw    $0x2,(%r12)
  movzbl 0x1(%rbp),%eax
  mov    %rdx,%rbp
  jmp    L101
  nopw   0x0(%rax,%rax,1)
L71:
  orw    $0x1,(%r12)
  movzbl 0x1(%rbp),%eax
  mov    %rdx,%rbp
  jmp    L101
L230:
  orw    $0x4,(%r12)
  movzbl 0x1(%rbp),%eax
  mov    %rdx,%rbp
  jmp    L101
L247:
  movsbl 0x0(%rbp),%eax
  mov    $0xffffffff,%edx
  test   %al,%al
  cmove  %edx,%eax
  jmp    L50
L235:
  test   %al,%al
  mov    $0xffffffff,%edx
  cmove  %edx,%eax
  jmp    L50
```

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