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

```asm
<validateIdiom>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x20(%rbp),%rcx
  lea    -0x10(%rbp),%rdx
  lea    -0x18(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <readNextName@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L247
  mov    -0x1c(%rbp),%eax
  jmp    L218
L247:
  mov    -0x20(%rbp),%eax
  cmp    $0x7c727712,%eax
  je     L158
  mov    -0x20(%rbp),%eax
  cmp    $0x7c72c5d3,%eax
  je     L158
  mov    -0x20(%rbp),%eax
  cmp    $0x7c72ac57,%eax
  je     L158
  mov    -0x20(%rbp),%eax
  cmp    $0x7c72848c,%eax
  je     L158
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <validateReference@plt>
  jmp    L218
L158:
  mov    -0x10(%rbp),%rax
  lea    -0x22(%rbp),%rcx
  lea    -0x10(%rbp),%rdx
  lea    -0x18(%rbp),%rsi
  mov    %rax,%rdi
  call   <readNextValue@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L258
  mov    -0x1c(%rbp),%eax
  jmp    L218
L258:
  mov    -0x40(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  lea    -0x20(%rbp),%rcx
  lea    -0x10(%rbp),%rdx
  lea    -0x18(%rbp),%rsi
  mov    %rax,%rdi
  call   <readNextName@plt>
  mov    %eax,-0x1c(%rbp)
  jmp    L106
L191:
  movb   $0x0,-0x21(%rbp)
  mov    -0x10(%rbp),%rax
  lea    -0x22(%rbp),%rcx
  lea    -0x10(%rbp),%rdx
  lea    -0x18(%rbp),%rsi
  mov    %rax,%rdi
  call   <readNextValue@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L118
  mov    -0x1c(%rbp),%eax
  jmp    L218
L118:
  movzbl -0x22(%rbp),%eax
  cmp    $0x6,%al
  jne    L212
  mov    -0x18(%rbp),%rax
  lea    -0x21(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <validateIdiom>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L212
  mov    -0x1c(%rbp),%eax
  jmp    L218
L212:
  movzbl -0x21(%rbp),%eax
  cmp    $0x9,%al
  je     L28
  movzbl -0x21(%rbp),%eax
  cmp    $0xb,%al
  jne    L95
L28:
  mov    -0x40(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x8,%al
  je     L140
  mov    -0x40(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L181
L140:
  mov    $0x2,%eax
  jmp    L218
L181:
  mov    -0x40(%rbp),%rax
  movb   $0xb,(%rax)
L95:
  movzbl -0x21(%rbp),%eax
  cmp    $0x8,%al
  je     L44
  movzbl -0x21(%rbp),%eax
  cmp    $0xa,%al
  jne    L169
L44:
  mov    -0x40(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L15
  mov    -0x40(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xb,%al
  jne    L130
L15:
  mov    $0x2,%eax
  jmp    L218
L130:
  mov    -0x40(%rbp),%rax
  movb   $0xa,(%rax)
L169:
  mov    -0x20(%rbp),%eax
  cmp    $0x596f55,%eax
  je     L94
  mov    -0x20(%rbp),%eax
  cmp    $0x596f5b,%eax
  je     L94
  mov    $0x5,%eax
  jmp    L218
L94:
  mov    -0x10(%rbp),%rax
  lea    -0x20(%rbp),%rcx
  lea    -0x10(%rbp),%rdx
  lea    -0x18(%rbp),%rsi
  mov    %rax,%rdi
  call   <readNextName@plt>
  mov    %eax,-0x1c(%rbp)
L106:
  cmpl   $0x0,-0x1c(%rbp)
  je     L191
  mov    $0x0,%eax
L218:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L135
  call   <__stack_chk_fail@plt>
L135:
  leave
  ret
```

assistant: ```c
unsigned int validateIdiom(char *rule, unsigned char *idiomType) {
  char *first;
  char *last;
  unsigned char type;
  unsigned int hash;
  unsigned int result;
  result = readNextName(rule, &first, &last, &hash);
  if (result != 0) {
    return result;
  }
  if (hash != 2087876370 && hash != 2087896531 && hash != 2087890007 && hash != 2087879820) {
    return validateReference(rule, idiomType);
  } else {
    result = readNextValue(last, &first, &last, &type);
    if (result != 0) {
      return result;
    }
    *idiomType = 0;
    result = readNextName(first, &first, &last, &hash);
    while (result == 0) {
      unsigned char newIdiomType = 0;
      result = readNextValue(last, &first, &last, &type);
      if (result != 0) {
        return result;
      }
      if (type == 0x06) {
        result = validateIdiom(first, &newIdiomType);
        if (result != 0) {
          return result;
        }
      }
      if (newIdiomType == 0x09 || newIdiomType == 0x0B) {
        if (*idiomType == 0x08 || *idiomType == 0x0A) {
          return 2;
        }
        *idiomType = 0x0B;
      }
      if (newIdiomType == 0x08 || newIdiomType == 0x0A) {
        if (*idiomType == 0x09 || *idiomType == 0x0B) {
          return 2;
        }
        *idiomType = 0x0A;
      }
      if (hash != 5861205 && hash != 5861211) {
        return 5;
      }
      result = readNextName(last, &first, &last, &hash);
    }
  }
  return 0;
}
```