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

```asm
<check>:
  endbr64
  push   %r15
  mov    %rdi,%r9
  push   %r14
  push   %r13
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  mov    %ecx,%ebp
  mov    $0x10,%ecx
  push   %rbx
  mov    %edx,%ebx
  sub    $0x1b8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1a8(%rsp)
  xor    %eax,%eax
  lea    0x120(%rsp),%rdi
  mov    %rdi,0x18(%rsp)
  rep stos %rax,%es:(%rdi)
  lea    0xa0(%rsp),%rdi
  mov    $0x10,%ecx
  mov    %rdi,0x10(%rsp)
  rep stos %rax,%es:(%rdi)
  lea    0x20(%rsp),%rdi
  mov    $0x10,%ecx
  mov    %rdi,0x8(%rsp)
  rep stos %rax,%es:(%rdi)
  test   %esi,%esi
  jle    L116
  lea    -0x1(%rsi),%eax
  mov    %r9,%rcx
  lea    0x4(%r9,%rax,4),%rsi
  nopl   (%rax)
L132:
  mov    (%rcx),%eax
  add    $0x4,%rcx
  movzbl %al,%edx
  addl   $0x1,0x120(%rsp,%rdx,4)
  movzbl %ah,%edx
  sar    $0x10,%eax
  movslq %edx,%rdx
  movzbl %al,%eax
  addl   $0x1,0xa0(%rsp,%rdx,4)
  addl   $0x1,0x20(%rsp,%rax,4)
  cmp    %rcx,%rsi
  jne    L132
L116:
  xor    %r13d,%r13d
  mov    $0x1,%r14d
  xor    %eax,%eax
  mov    %r13,%rsi
  mov    %r14d,%r13d
  mov    %rsi,%r14
  jmp    L146
  nopl   (%rax)
L237:
  mov    0x8(%rsp),%rcx
  mov    0x20(%rsp),%edx
  cmp    %edx,(%rcx,%r14,4)
  je     L91
  mov    %r14d,%esi
  lea    D45(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
L91:
  test   %ebp,%ebp
  jne    L43
  test   %r14,%r14
  jne    L106
  test   %r12d,%r12d
  je     L175
  nop
L114:
  mov    0x18(%rsp),%rdi
  mov    0x120(%rsp),%edx
  cmp    %edx,(%rdi,%r14,4)
  je     L67
  mov    %r15d,%esi
  lea    D34(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
L67:
  cmp    $0x20,%r13d
  je     L172
L175:
  add    $0x1,%r14
  add    $0x1,%r13d
L146:
  mov    %r14d,%r15d
  test   %ebx,%ebx
  jne    L237
  test   %r14,%r14
  je     L91
  mov    0x8(%rsp),%rcx
  mov    (%rcx,%r14,4),%esi
  test   %esi,%esi
  jne    L214
L13:
  test   %ebp,%ebp
  jne    L43
L106:
  mov    0x10(%rsp),%rsi
  mov    (%rsi,%r14,4),%ecx
  test   %ecx,%ecx
  jne    L194
L18:
  test   %r12d,%r12d
  jne    L114
L183:
  mov    0x18(%rsp),%rcx
  mov    (%rcx,%r14,4),%edx
  test   %edx,%edx
  je     L67
  mov    %r15d,%esi
  lea    D9(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  cmp    $0x20,%r13d
  jne    L175
  cs nopw 0x0(%rax,%rax,1)
L172:
  mov    0x1a8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L102
  add    $0x1b8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L43:
  mov    0x10(%rsp),%rsi
  mov    0xa0(%rsp),%edx
  cmp    %edx,(%rsi,%r14,4)
  je     L38
  mov    %r15d,%esi
  lea    D20(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
L38:
  test   %r12d,%r12d
  jne    L114
  test   %r14,%r14
  jne    L183
  jmp    L175
  nop
L194:
  mov    %r15d,%esi
  lea    D59(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L18
  nopl   0x0(%rax,%rax,1)
L214:
  mov    %r14d,%esi
  lea    D4(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L13
L102:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D45
type_infered: string
name: parse_data
arguments: tag: D34
type_infered: string
name: parse_data
arguments: tag: D9
type_infered: string
name: parse_data
arguments: tag: D20
type_infered: string
name: parse_data
arguments: tag: D59
type_infered: string
name: parse_data
arguments: tag: D4
type_infered: string

tool: D45: gang %d not used %d times


tool: D34: vector %d not used %d times


tool: D9: vector %d unexpectedly used


tool: D20: worker %d not used %d times


tool: D59: worker %d unexpectedly used


tool: D4: gang %d unexpectedly used


assistant: ```c
int check(const int *ary, int size, int gp, int wp, int vp) {
  int exit = 0;
  int ix;
  int gangs[32], workers[32], vectors[32];
  for (ix = 0; ix < 32; ix++)
    gangs[ix] = workers[ix] = vectors[ix] = 0;
  for (ix = 0; ix < size; ix++) {
    vectors[ary[ix] & 0xff]++;
    workers[(ary[ix] >> 8) & 0xff]++;
    gangs[(ary[ix] >> 16) & 0xff]++;
  }
  for (ix = 0; ix < 32; ix++) {
    if (gp) {
      int expect = gangs[0];
      if (gangs[ix] != expect) {
        exit = 1;
        printf("gang %d not used %d times\n", ix, expect);
      }
    } else if (ix && gangs[ix]) {
      exit = 1;
      printf("gang %d unexpectedly used\n", ix);
    }
    if (wp) {
      int expect = workers[0];
      if (workers[ix] != expect) {
        exit = 1;
        printf("worker %d not used %d times\n", ix, expect);
      }
    } else if (ix && workers[ix]) {
      exit = 1;
      printf("worker %d unexpectedly used\n", ix);
    }
    if (vp) {
      int expect = vectors[0];
      if (vectors[ix] != expect) {
        exit = 1;
        printf("vector %d not used %d times\n", ix, expect);
      }
    } else if (ix && vectors[ix]) {
      exit = 1;
      printf("vector %d unexpectedly used\n", ix);
    }
  }
  return exit;
}
```