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

```asm
<validateOcurrences>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbx
  imul   %esi,%r12d
  sub    $0x48,%rsp
  mov    %esi,-0x50(%rbp)
  movslq %r12d,%rcx
  mov    %edx,-0x5c(%rbp)
  mov    %rsp,%rsi
  mov    %rdi,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    0xf(%rcx),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rdx
  cmp    %rsi,%rsp
  je     L21
L112:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L112
L21:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L105
L3:
  lea    0xf(,%rcx,4),%rax
  mov    %rsp,%rcx
  mov    %rsp,%r13
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L109
L130:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L130
L109:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L22
L77:
  mov    %rsp,-0x68(%rbp)
  test   %r12d,%r12d
  jle    L44
  mov    -0x58(%rbp),%rdi
  lea    -0x1(%r12),%eax
  movl   $0x0,-0x4c(%rbp)
  lea    0x1(%rdi,%rax,1),%rax
  mov    %rdi,%r15
  mov    %rax,-0x48(%rbp)
  jmp    L94
L59:
  add    $0x1,%r15
  cmp    -0x48(%rbp),%r15
  je     L44
L94:
  movsbl (%r15),%r14d
  mov    %r12d,%edx
  mov    %r13,%rsi
  mov    %r14d,%edi
  call   <checkExists@plt>
  cmp    $0xffffffff,%eax
  jne    L59
  mov    -0x5c(%rbp),%ecx
  mov    -0x50(%rbp),%edx
  mov    %r14d,%esi
  add    $0x1,%r15
  mov    -0x58(%rbp),%rdi
  call   <countOcurrences@plt>
  mov    -0x68(%rbp),%rdi
  mov    %r14d,%esi
  mov    %eax,%edx
  movslq -0x4c(%rbp),%rax
  mov    %edx,(%rdi,%rax,4)
  mov    %rax,%rcx
  lea    D1(%rip),%rdi
  add    $0x1,%ecx
  mov    %r14b,0x0(%r13,%rax,1)
  mov    %ecx,-0x4c(%rbp)
  call   <printf@plt>
  cmp    -0x48(%rbp),%r15
  jne    L94
L44:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L56
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   (%rax)
L105:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L3
L22:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L77
L56:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D1
datatype: string

tool: D1: Ocurrence: %c (total %d) 


assistant: ```c
void validateOcurrences(char *characters, int quantityN, int quantityM) {
  int i, ocurrenceIncrement = 0, maxCharacter = quantityM * quantityN;
  char ocurrencesCharacter[maxCharacter];
  int ocurrencesCount[maxCharacter];
  for (i = 0; i < maxCharacter; i++) {
    char actualCharacter = characters[i];
    int exists = checkExists(actualCharacter, ocurrencesCharacter, maxCharacter);
    if (exists == -1) {
      int totalOcurrences = countOcurrences(characters, actualCharacter, quantityN, quantityM);
      ocurrencesCharacter[ocurrenceIncrement] = actualCharacter;
      ocurrencesCount[ocurrenceIncrement] = totalOcurrences;
      ocurrenceIncrement++;
      printf("Ocurrence: %c (total %d) \n", actualCharacter, totalOcurrences);
    }
  }
}
```