user: Translate the below assembly code into C programming language:

```asm
<validateIdiom>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x14(%rsp),%r14
  lea    0x20(%rsp),%r13
  lea    0x18(%rsp),%rbx
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    %rbx,%rsi
  call   <readNextName@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L36
  mov    0x14(%rsp),%eax
  cmp    $0x7c727712,%eax
  setne  %dl
  cmp    $0x7c72c5d3,%eax
  setne  %cl
  and    %ecx,%edx
  cmp    $0x7c72ac57,%eax
  setne  %cl
  test   %cl,%dl
  je     L100
  cmp    $0x7c72848c,%eax
  jne    L160
L100:
  mov    0x20(%rsp),%rdi
  lea    0x12(%rsp),%r15
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %r15,%rcx
  call   <readNextValue@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  je     L195
L36:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L42
  add    $0x38,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L195:
  movb   $0x0,0x0(%rbp)
  mov    0x18(%rsp),%rdi
  mov    %r13,%rdx
  mov    %r14,%rcx
  mov    %rbx,%rsi
  call   <readNextName@plt>
  lea    0x13(%rsp),%rdx
  mov    %rdx,0x8(%rsp)
  test   %eax,%eax
  je     L218
  jmp    L36
  nopw   0x0(%rax,%rax,1)
L141:
  movzbl 0x0(%rbp),%eax
  and    $0xfffffffd,%eax
  cmp    $0x8,%al
  je     L135
  movb   $0xb,0x0(%rbp)
L81:
  mov    0x14(%rsp),%eax
  cmp    $0x596f55,%eax
  je     L29
  cmp    $0x596f5b,%eax
  jne    L214
L29:
  mov    0x20(%rsp),%rdi
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    %rbx,%rsi
  call   <readNextName@plt>
  test   %eax,%eax
  jne    L36
L218:
  mov    0x20(%rsp),%rdi
  mov    %r15,%rcx
  mov    %r13,%rdx
  mov    %rbx,%rsi
  movb   $0x0,0x13(%rsp)
  call   <readNextValue@plt>
  test   %eax,%eax
  jne    L103
  cmpb   $0x6,0x12(%rsp)
  je     L24
L86:
  movzbl 0x13(%rsp),%eax
  and    $0xfffffffd,%eax
  cmp    $0x9,%al
  je     L141
  cmp    $0x8,%al
  jne    L81
  movzbl 0x0(%rbp),%eax
  and    $0xfffffffd,%eax
  cmp    $0x9,%al
  je     L135
  movb   $0xa,0x0(%rbp)
  jmp    L81
  nopl   0x0(%rax,%rax,1)
L24:
  mov    0x8(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  call   <validateIdiom>
  test   %eax,%eax
  je     L86
  nopl   0x0(%rax,%rax,1)
L103:
  mov    %eax,%r12d
  jmp    L36
L160:
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <validateReference@plt>
  mov    %eax,%r12d
  jmp    L36
  nopl   0x0(%rax,%rax,1)
L214:
  mov    $0x5,%r12d
  jmp    L36
  nopl   0x0(%rax,%rax,1)
L135:
  mov    $0x2,%r12d
  jmp    L36
L42:
  call   <__stack_chk_fail@plt>
```

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