user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r15
  lea    D11(%rip),%r15
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x378,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x368(%rsp)
  xor    %eax,%eax
  lea    0x24(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0x20(%rsp),%rax
  mov    %rax,0x10(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L146:
  mov    0x18(%rsp),%rdx
  mov    0x10(%rsp),%rsi
  xor    %eax,%eax
  lea    D4(%rip),%rdi
  call   <scanf@plt>
  cmp    $0x2,%eax
  jne    L170
  test   %r14d,%r14d
  jne    L71
L175:
  xor    %eax,%eax
  lea    0x30(%rsp),%rdi
  mov    $0x32,%ecx
  mov    %rdi,(%rsp)
  rep stos %rax,%es:(%rdi)
  lea    0x1c0(%rsp),%rdi
  mov    $0x32,%ecx
  mov    %rdi,0x8(%rsp)
  rep stos %rax,%es:(%rdi)
  mov    0x20(%rsp),%ecx
  mov    0x24(%rsp),%eax
  imul   %ecx,%eax
  lea    -0x1(%rcx),%edx
  imul   %edx,%eax
  cmp    $0x1,%eax
  jle    L122
  xor    %ebp,%ebp
  lea    0x35f(%rsp),%rbx
  lea    0x2c(%rsp),%r14
  lea    0x356(%rsp),%r13
  lea    0x28(%rsp),%r12
  jmp    L236
  nopw   0x0(%rax,%rax,1)
L38:
  cmp    $0x70,%al
  je     L246
  cmp    $0x72,%al
  jne    L154
  cmp    $0x72,%cl
  je     L226
L154:
  mov    0x2c(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    0x28(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0x73,%cl
  je     L75
L50:
  movslq %edx,%rdx
  cltq
  addl   $0x1,0x30(%rsp,%rdx,4)
  addl   $0x1,0x1c0(%rsp,%rax,4)
L226:
  mov    0x20(%rsp),%ecx
  mov    0x24(%rsp),%edx
  add    $0x1,%ebp
  imul   %ecx,%edx
  lea    -0x1(%rcx),%eax
  imul   %eax,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  cmp    %ebp,%eax
  jle    L122
L236:
  mov    %r14,%rcx
  mov    %rbx,%r8
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  movzbl 0x356(%rsp),%eax
  movzbl 0x35f(%rsp),%ecx
  cmp    $0x73,%al
  jne    L38
  cmp    $0x73,%cl
  je     L226
  mov    0x2c(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    0x28(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0x70,%cl
  jne    L50
L75:
  cltq
  movslq %edx,%rdx
  addl   $0x1,0x30(%rsp,%rax,4)
  addl   $0x1,0x1c0(%rsp,%rdx,4)
  jmp    L226
  nopl   (%rax)
L246:
  cmp    $0x70,%cl
  je     L226
  mov    0x2c(%rsp),%eax
  mov    0x28(%rsp),%esi
  sub    $0x1,%eax
  lea    -0x1(%rsi),%edx
  cmp    $0x73,%cl
  jne    L50
  jmp    L75
L122:
  test   %ecx,%ecx
  jle    L238
  mov    (%rsp),%rbx
  mov    0x8(%rsp),%rbp
  xor    %r13d,%r13d
  lea    D38(%rip),%r12
  jmp    L129
  nopw   0x0(%rax,%rax,1)
L203:
  mov    %r12,%rdi
  call   <puts@plt>
L32:
  lea    0x1(%r13),%r14d
  add    $0x1,%r13
  cmp    %r13d,0x20(%rsp)
  jle    L146
L129:
  mov    (%rbx,%r13,4),%eax
  mov    0x0(%rbp,%r13,4),%edx
  pxor   %xmm1,%xmm1
  pxor   %xmm2,%xmm2
  add    %eax,%edx
  cvtsi2ss %edx,%xmm1
  ucomiss %xmm2,%xmm1
  jp     L121
  je     L203
L121:
  pxor   %xmm0,%xmm0
  lea    D22(%rip),%rdi
  cvtsi2ss %eax,%xmm0
  mov    $0x1,%eax
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  call   <printf@plt>
  jmp    L32
L71:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L175
L170:
  mov    0x368(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L119
  add    $0x378,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L238:
  xor    %r14d,%r14d
  jmp    L146
L119:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D11
type_infered: string
name: extract_symbolic_data
arguments: tag: D4
type_infered: string
name: extract_symbolic_data
arguments: tag: D38
type_infered: string
name: extract_symbolic_data
arguments: tag: D22
type_infered: string

tool: D11: %d %s %d %s

tool: D4: %d %d

tool: D38: -

tool: D22: %.3f


assistant: ```c
int main(void) {
  int n, k, v, u, i = 0, pw[100], pl[100];
  float w;
  char vt[9], ut[9];
  char type[3] = {'s', 'p', 'r'};
  while (scanf("%d %d", &n, &k) == 2) {
    if (i != 0)
      printf("\n");
    for (i = 0; i < 100; i++) {
      pw[i] = 0;
      pl[i] = 0;
    }
    for (i = 0; i < k * n * (n - 1) / 2; i++) {
      scanf("%d %s %d %s", &v, vt, &u, ut);
      if (vt[0] == type[0] && ut[0] == type[0])
        ;
      else if (vt[0] == type[1] && ut[0] == type[1])
        ;
      else if (vt[0] == type[2] && ut[0] == type[2])
        ;
      else if (vt[0] == type[0]) {
        if (ut[0] == type[1]) {
          pw[v - 1]++;
          pl[u - 1]++;
        } else {
          pw[u - 1]++;
          pl[v - 1]++;
        }
      } else if (vt[0] == type[1]) {
        if (ut[0] == type[0]) {
          pw[u - 1]++;
          pl[v - 1]++;
        } else {
          pw[v - 1]++;
          pl[u - 1]++;
        }
      } else {
        if (ut[0] == type[0]) {
          pw[v - 1]++;
          pl[u - 1]++;
        } else {
          pw[u - 1]++;
          pl[v - 1]++;
        }
      }
    }
    for (i = 0; i < n; i++) {
      w = pw[i] + pl[i];
      if (w == 0)
        printf("-\n");
      else {
        w = pw[i] / w;
        printf("%.3f\n", w);
      }
    }
  }
  return 0;
}
```