user: 请从给定的汇编指令推导出C源代码:

```asm
<check>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x198,%rsp
  mov    %edx,%r13d
  mov    %ecx,%r14d
  mov    %r8d,%r15d
  mov    %fs:0x28,%rax
  mov    %rax,0x188(%rsp)
  xor    %eax,%eax
L117:
  movl   $0x0,0x100(%rsp,%rax,1)
  movl   $0x0,0x80(%rsp,%rax,1)
  movl   $0x0,(%rsp,%rax,1)
  add    $0x4,%rax
  cmp    $0x80,%rax
  jne    L117
  test   %esi,%esi
  jle    L98
  mov    %rdi,%rcx
  lea    -0x1(%rsi),%eax
  lea    0x4(%rdi,%rax,4),%rsi
L13:
  mov    (%rcx),%eax
  movzbl %al,%edx
  addl   $0x1,0x100(%rsp,%rdx,4)
  movzbl %ah,%edx
  movslq %edx,%rdx
  addl   $0x1,0x80(%rsp,%rdx,4)
  sar    $0x10,%eax
  movzbl %al,%eax
  addl   $0x1,(%rsp,%rax,4)
  add    $0x4,%rcx
  cmp    %rsi,%rcx
  jne    L13
L98:
  mov    $0x1,%ebp
  mov    $0x0,%ebx
  mov    $0x0,%eax
  jmp    L84
L261:
  mov    %ebx,%esi
  lea    D26(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L131
L33:
  test   %ebx,%ebx
  je     L131
  cmpl   $0x0,(%rsp,%rbx,4)
  jne    L78
L46:
  test   %r14d,%r14d
  jne    L119
L3:
  cmpl   $0x0,0x80(%rsp,%rbx,4)
  jne    L63
L193:
  test   %r15d,%r15d
  jne    L83
L243:
  cmpl   $0x0,0x100(%rsp,%rbx,4)
  je     L133
  mov    %r12d,%esi
  lea    D17(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L133
L78:
  mov    %ebx,%esi
  lea    D8(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L46
L156:
  mov    %r12d,%esi
  lea    D56(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L182
L211:
  test   %ebx,%ebx
  jne    L3
  test   %r15d,%r15d
  je     L209
L83:
  mov    0x100(%rsp),%edx
  cmp    %edx,0x100(%rsp,%rbx,4)
  jne    L30
L133:
  cmp    $0x1f,%ebp
  jg     L1
L209:
  add    $0x1,%rbx
  add    $0x1,%ebp
L84:
  mov    %ebx,%r12d
  test   %r13d,%r13d
  je     L33
  mov    (%rsp),%edx
  cmp    %edx,(%rsp,%rbx,4)
  jne    L261
L131:
  test   %r14d,%r14d
  je     L211
L119:
  mov    0x80(%rsp),%edx
  cmp    %edx,0x80(%rsp,%rbx,4)
  jne    L156
L182:
  test   %r15d,%r15d
  jne    L83
  test   %ebx,%ebx
  jne    L243
  jmp    L209
L63:
  mov    %r12d,%esi
  lea    D45(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L193
L30:
  mov    %r12d,%esi
  lea    D24(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L133
L1:
  mov    0x188(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L260
  add    $0x198,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L260:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D26
type_guessed: string
name: parse_data
arguments: data_tag: D17
type_guessed: string
name: parse_data
arguments: data_tag: D8
type_guessed: string
name: parse_data
arguments: data_tag: D56
type_guessed: string
name: parse_data
arguments: data_tag: D45
type_guessed: string
name: parse_data
arguments: data_tag: D24
type_guessed: string

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


tool: D17: vector %d unexpectedly used


tool: D8: gang %d unexpectedly used


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


tool: D45: worker %d unexpectedly used


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


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