user: Converte this assembly snippet into its equivalent C code:

```asm
<mstrcmp>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %edx,%edx
  je     L247
  cmp    $0x1,%edx
  je     L14
  mov    $0x0,%eax
  cmp    $0xffffffff,%edx
  je     L162
L105:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L247:
  call   <strcmp@plt>
  jmp    L105
L14:
  movzbl (%rdi),%eax
  mov    $0x0,%ecx
  test   %al,%al
  jne    L189
  jmp    L361
L145:
  lea    -0x61(%rax),%r8d
  cmp    $0x19,%r8b
  ja     L361
  lea    -0x41(%rdx),%r8d
  cmp    $0x19,%r8b
  ja     L361
  movsbl %al,%r8d
  sub    $0x20,%r8d
  movsbl %dl,%edx
  cmp    %edx,%r8d
  jne    L361
L481:
  add    $0x1,%rcx
  movzbl (%rdi,%rcx,1),%eax
  test   %al,%al
  je     L361
L189:
  movzbl (%rsi,%rcx,1),%edx
  test   %dl,%dl
  je     L361
  cmp    %al,%dl
  je     L481
  lea    -0x41(%rax),%r8d
  cmp    $0x19,%r8b
  ja     L145
  lea    -0x61(%rdx),%r8d
  cmp    $0x19,%r8b
  ja     L361
  movsbl %al,%r8d
  movsbl %dl,%edx
  sub    $0x20,%edx
  cmp    %edx,%r8d
  je     L481
L361:
  movsbl %al,%eax
  movsbl (%rsi,%rcx,1),%edx
  sub    %edx,%eax
  jmp    L105
L162:
  movzbl (%rdi),%r8d
  lea    0x1(%rdi),%rax
  mov    $0x0,%edx
  test   %r8b,%r8b
  jne    L164
  jmp    L26
L342:
  add    $0x1,%edx
  add    $0x1,%rax
  movzbl -0x1(%rax),%r8d
  test   %r8b,%r8b
  je     L26
L164:
  lea    -0x9(%r8),%ecx
  cmp    $0x4,%cl
  jbe    L342
  cmp    $0x20,%r8b
  je     L342
L26:
  movzbl (%rsi),%r9d
  test   %r9b,%r9b
  je     L212
  lea    0x1(%rsi),%rcx
  mov    $0x0,%eax
  jmp    L351
L246:
  add    $0x1,%eax
  add    $0x1,%rcx
  movzbl -0x1(%rcx),%r9d
  test   %r9b,%r9b
  je     L314
L351:
  lea    -0x9(%r9),%r10d
  cmp    $0x4,%r10b
  jbe    L246
  cmp    $0x20,%r9b
  je     L246
L314:
  cmp    $0x2d,%r8b
  sete   %r11b
  movzbl %r11b,%r11d
  cmp    $0x2d,%r9b
  sete   %r10b
  movzbl %r10b,%r10d
  add    %r10d,%eax
  add    %r11d,%edx
  movslq %edx,%rdx
L111:
  mov    %edx,%ebp
  movzbl (%rdi,%rdx,1),%ecx
  mov    %ecx,%r12d
  add    $0x1,%rdx
  mov    %ecx,%ebx
  and    $0xffffffef,%ebx
  cmp    $0x20,%bl
  je     L111
  lea    -0x9(%rcx),%ebx
  cmp    $0x4,%bl
  jbe    L111
  cltq
L276:
  mov    %eax,%r13d
  movzbl (%rsi,%rax,1),%edx
  add    $0x1,%rax
  lea    -0x9(%rdx),%ebx
  cmp    $0x4,%bl
  jbe    L276
  mov    %edx,%ebx
  and    $0xffffffef,%ebx
  cmp    $0x20,%bl
  je     L276
  sub    $0x30,%r12d
  sub    $0x30,%edx
  cmp    $0x9,%r12b
  ja     L20
  cmp    $0x9,%dl
  ja     L20
  mov    %r10d,%eax
  sub    %r11d,%eax
  cmp    %r10d,%r11d
  jne    L105
  movslq %r13d,%rax
  movzbl (%rsi,%rax,1),%r12d
  mov    $0x0,%r10d
  mov    $0x0,%r11d
  mov    $0x0,%r9d
  jmp    L119
L212:
  mov    $0x0,%eax
  jmp    L314
L20:
  cmp    $0x9,%r12b
  setbe  %al
  movzbl %al,%eax
  mov    %eax,%ecx
  neg    %ecx
  cmp    $0x2d,%r8b
  cmove  %ecx,%eax
  cmp    $0x9,%dl
  setbe  %dl
  movzbl %dl,%edx
  mov    %edx,%ecx
  neg    %ecx
  cmp    $0x2d,%r9b
  cmove  %ecx,%edx
  sub    %edx,%eax
  jmp    L105
L62:
  add    $0x1,%ebp
L359:
  movslq %ebp,%rax
  movzbl (%rdi,%rax,1),%ecx
  test   %cl,%cl
  je     L306
  movslq %r13d,%rax
  movzbl (%rsi,%rax,1),%r12d
  test   %r12b,%r12b
  je     L306
L119:
  mov    %ecx,%edx
  lea    -0x9(%rcx),%eax
  cmp    $0x4,%al
  jbe    L62
  cmp    $0x20,%cl
  je     L62
  mov    %r12d,%ebx
  lea    -0x9(%r12),%eax
  cmp    $0x4,%al
  jbe    L473
  cmp    $0x20,%r12b
  jne    L270
L473:
  add    $0x1,%r13d
  jmp    L359
L270:
  sub    $0x30,%edx
  cmp    $0x9,%dl
  ja     L488
  lea    -0x30(%rbx),%eax
  cmp    $0x9,%al
  ja     L488
  test   %r9d,%r9d
  jne    L194
  movsbl %cl,%r9d
  movsbl %r12b,%r12d
  sub    %r12d,%r9d
L194:
  add    $0x1,%r11d
  add    $0x1,%r10d
  add    $0x1,%ebp
  add    $0x1,%r13d
  jmp    L359
L488:
  cmp    $0x9,%dl
  setbe  %al
  movzbl %al,%eax
  add    %r11d,%eax
  sub    $0x30,%ebx
  cmp    $0x9,%bl
  setbe  %dl
  movzbl %dl,%edx
  add    %r10d,%edx
  sub    %edx,%eax
  cmove  %r9d,%eax
  mov    %eax,%edx
  neg    %edx
  cmp    $0x2d,%r8b
  cmove  %edx,%eax
  jmp    L105
L306:
  sub    $0x30,%ecx
  cmp    $0x9,%cl
  setbe  %al
  movzbl %al,%eax
  add    %r11d,%eax
  movslq %r13d,%r13
  movzbl (%rsi,%r13,1),%edx
  sub    $0x30,%edx
  cmp    $0x9,%dl
  setbe  %dl
  movzbl %dl,%edx
  add    %r10d,%edx
  sub    %edx,%eax
  cmove  %r9d,%eax
  mov    %eax,%edx
  neg    %edx
  cmp    $0x2d,%r8b
  cmove  %edx,%eax
  jmp    L105
```

assistant: ```c
int mstrcmp(const char *str1, const char *str2, int f) {
  int i, j, f1, f2, n1, n2;
  if (f == 0)
    return strcmp(str1, str2);
  if (f == 1) {
    i = 0;
    while (str1[i] != 0 && str2[i] != 0 && (str1[i] == str2[i] || (((str1[i]) >= ('A') && (str1[i]) <= ('Z')) && ((str2[i]) >= ('a') && (str2[i]) <= ('z')) && (str1[i] - 'A' == str2[i] - 'a')) || (((str1[i]) >= ('a') && (str1[i]) <= ('z')) && ((str2[i]) >= ('A') && (str2[i]) <= ('Z')) && (str1[i] - 'a' == str2[i] - 'A'))))
      ++i;
    return str1[i] - ((int)str2[i]);
  }
  if (f == -1) {
    i = 0;
    j = 0;
    f = 0;
    while (str1[i] != 0 && ((str1[i]) == ' ' || (str1[i]) == '\r' || (str1[i]) == '\t' || (str1[i]) == '\n' || (str1[i]) == '\f' || (str1[i]) == '\v'))
      ++i;
    while (str2[j] != 0 && ((str2[j]) == ' ' || (str2[j]) == '\r' || (str2[j]) == '\t' || (str2[j]) == '\n' || (str2[j]) == '\f' || (str2[j]) == '\v'))
      ++j;
    i += n1 = str1[i] == '-';
    j += n2 = str2[j] == '-';
    while (str1[i] == '0' || ((str1[i]) == ' ' || (str1[i]) == '\r' || (str1[i]) == '\t' || (str1[i]) == '\n' || (str1[i]) == '\f' || (str1[i]) == '\v'))
      ++i;
    while (str2[j] == '0' || ((str2[j]) == ' ' || (str2[j]) == '\r' || (str2[j]) == '\t' || (str2[j]) == '\n' || (str2[j]) == '\f' || (str2[j]) == '\v'))
      ++j;
    f1 = ((str1[i]) >= ('0') && (str1[i]) <= ('9'));
    f2 = ((str2[j]) >= ('0') && (str2[j]) <= ('9'));
    if (!(f1 && f2))
      return (n1 ? -f1 : f1) - (n2 ? -f2 : f2);
    if (n1 ^ n2)
      return n2 - n1;
    f1 = 0;
    f2 = 0;
    while (str1[i] != 0 && str2[j] != 0) {
      if (((str1[i]) == ' ' || (str1[i]) == '\r' || (str1[i]) == '\t' || (str1[i]) == '\n' || (str1[i]) == '\f' || (str1[i]) == '\v')) {
        ++i;
        continue;
      }
      if (((str2[j]) == ' ' || (str2[j]) == '\r' || (str2[j]) == '\t' || (str2[j]) == '\n' || (str2[j]) == '\f' || (str2[j]) == '\v')) {
        ++j;
        continue;
      }
      if (((str1[i]) >= ('0') && (str1[i]) <= ('9')) && ((str2[j]) >= ('0') && (str2[j]) <= ('9')))
        (f) ? 0 : (f = (str1[i] - str2[j])), ++f1, ++f2, ++i, ++j;
      else
        return f1 += ((str1[i]) >= ('0') && (str1[i]) <= ('9')), f2 += ((str2[j]) >= ('0') && (str2[j]) <= ('9')), (((n2 = f1 - f2)) ? 0 : (n2 = f)), (n1 ? -n2 : n2);
    }
    return f1 += ((str1[i]) >= ('0') && (str1[i]) <= ('9')), f2 += ((str2[j]) >= ('0') && (str2[j]) <= ('9')), (((n2 = f1 - f2)) ? 0 : (n2 = f)), (n1 ? -n2 : n2);
  }
  return 0;
}
```