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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x24(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    D44(%rip),%rdi
  call   <scanf@plt>
  mov    0x20(%rsp),%r15d
  movslq %r15d,%rax
  mov    %rax,0x18(%rsp)
  shl    $0x2,%rax
  mov    %rax,(%rsp)
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    0x24(%rsp),%r12d
  mov    %r15d,%eax
  cltd
  idiv   %r12d
  mov    %eax,0x14(%rsp)
  movslq %r12d,%rdi
  shl    $0x3,%rdi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %r12d,%r12d
  jle    L86
  movslq 0x14(%rsp),%rax
  lea    0x0(,%rax,4),%r13
  mov    %r14,%rbp
  mov    %r12d,%r12d
  lea    (%r14,%r12,8),%r12
L26:
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,0x0(%rbp)
  add    $0x8,%rbp
  cmp    %r12,%rbp
  jne    L26
L86:
  test   %r15d,%r15d
  jle    L230
  mov    %rbx,0x8(%rsp)
  mov    %r15d,%eax
  lea    (%rbx,%rax,4),%rdx
  mov    %rbx,%rax
L7:
  movl   $0x0,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L7
  mov    0x18(%rsp),%rdi
  shl    $0x3,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rax,%r13
  mov    %r15d,%r15d
  lea    (%rax,%r15,8),%r15
  mov    %rax,%rbp
L37:
  mov    (%rsp),%rdi
  call   <malloc@plt>
  mov    %rax,0x0(%rbp)
  add    $0x8,%rbp
  cmp    %r15,%rbp
  jne    L37
  movl   $0x0,(%rsp)
  lea    D18(%rip),%r15
  jmp    L68
L77:
  mov    0x0(%r13),%rax
  lea    (%rax,%rbp,4),%rsi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x0(%r13),%rax
  movss  (%rbx,%rbp,4),%xmm0
  addss  (%rax,%rbp,4),%xmm0
  movss  %xmm0,(%rbx,%rbp,4)
  add    $0x1,%rbp
  cmp    %ebp,0x20(%rsp)
  jg     L77
L316:
  addl   $0x1,(%rsp)
  mov    (%rsp),%edi
  mov    0x20(%rsp),%eax
  add    $0x8,%r13
  cmp    %edi,%eax
  jle    L145
L68:
  mov    $0x0,%ebp
  cmpl   $0x0,0x20(%rsp)
  jg     L77
  jmp    L316
L145:
  test   %eax,%eax
  jle    L148
  mov    %eax,%edx
  lea    (%rbx,%rdx,4),%rdx
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
L270:
  mov    0x8(%rsp),%rax
  movss  (%rax),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  add    $0x4,%rax
  mov    %rax,0x8(%rsp)
  cmp    %rdx,%rax
  jne    L270
L148:
  mov    $0x0,%ebp
  mov    D17(%rip),%r13d
  cmpl   $0x0,0x24(%rsp)
  jg     L45
  cmpl   $0x1,0x14(%rsp)
  jg     L236
L109:
  mov    %rbx,%rdi
  call   <free@plt>
  jmp    L379
L53:
  movslq %edx,%rcx
  movss  (%rbx,%rax,4),%xmm0
  ucomiss (%rbx,%rcx,4),%xmm0
  cmova  %eax,%edx
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L53
L161:
  mov    (%r14,%rbp,8),%rax
  mov    %edx,(%rax)
  movslq %edx,%rax
  mov    %r13d,(%rbx,%rax,4)
  mov    %edi,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <negativar@plt>
  add    $0x1,%rbp
  cmp    %ebp,0x24(%rsp)
  jle    L357
L45:
  mov    0x20(%rsp),%edi
  mov    %edi,%esi
  mov    $0x1,%eax
  mov    $0x0,%edx
  cmp    $0x1,%edi
  jg     L53
  jmp    L161
L357:
  cmpl   $0x1,0x14(%rsp)
  jle    L234
L236:
  mov    0x14(%rsp),%eax
  lea    0x0(,%rax,4),%r15
  mov    $0x4,%r13d
  jmp    L43
L155:
  mov    (%r14,%rbp,8),%r9
  mov    (%r9),%eax
  mov    0x20(%rsp),%r8d
  cmp    $0x1,%r8d
  jle    L52
  cltq
  mov    (%r12,%rax,8),%rcx
  mov    %r8d,%edi
  mov    $0x1,%eax
  mov    $0x0,%edx
L105:
  movslq %edx,%rsi
  movss  (%rcx,%rax,4),%xmm0
  ucomiss (%rcx,%rsi,4),%xmm0
  cmova  %eax,%edx
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L105
L292:
  mov    %edx,(%r9,%r13,1)
  mov    %r8d,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <negativar@plt>
  add    $0x1,%rbp
  cmp    %ebp,0x24(%rsp)
  jg     L155
L137:
  add    $0x4,%r13
  cmp    %r13,%r15
  je     L234
L43:
  mov    $0x0,%ebp
  cmpl   $0x0,0x24(%rsp)
  jg     L155
  jmp    L137
L52:
  mov    $0x0,%edx
  jmp    L292
L234:
  cmpl   $0x0,0x24(%rsp)
  jle    L109
  mov    %r14,0x8(%rsp)
  mov    0x14(%rsp),%eax
  lea    -0x1(%rax),%eax
  lea    0x4(,%rax,4),%r15
  mov    %r14,%r13
  movl   $0x0,(%rsp)
L141:
  addl   $0x1,(%rsp)
  mov    (%rsp),%eax
  mov    %eax,%esi
  lea    D45(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,0x14(%rsp)
  jle    L194
  mov    $0x0,%ebp
L17:
  mov    0x0(%r13),%rax
  mov    (%rax,%rbp,1),%esi
  add    $0x1,%esi
  lea    D38(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x4,%rbp
  cmp    %r15,%rbp
  jne    L17
L194:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x24(%rsp),%ebp
  add    $0x8,%r13
  cmp    %ebp,(%rsp)
  jl     L141
  mov    %rbx,%rdi
  call   <free@plt>
  test   %ebp,%ebp
  jle    L379
  mov    %ebp,%ebp
  lea    (%r14,%rbp,8),%rbx
L58:
  mov    0x8(%rsp),%r15
  mov    (%r15),%rdi
  call   <free@plt>
  mov    %r15,%rax
  add    $0x8,%rax
  mov    %rax,0x8(%rsp)
  cmp    %rax,%rbx
  jne    L58
L379:
  mov    %r14,%rdi
  call   <free@plt>
  cmpl   $0x0,0x20(%rsp)
  jle    L2
  mov    $0x0,%ebx
L362:
  mov    (%r12,%rbx,8),%rdi
  call   <free@plt>
  add    $0x1,%rbx
  cmp    %ebx,0x20(%rsp)
  jg     L362
L2:
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L279
  mov    $0x0,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L230:
  mov    0x18(%rsp),%rdi
  shl    $0x3,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  jmp    L148
L279:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D44
type_guessed: string
name: read_data
arguments: data_tag: D18
type_guessed: string
name: read_data
arguments: data_tag: D17
type_guessed: byte[4]
name: read_data
arguments: data_tag: D45
type_guessed: string
name: read_data
arguments: data_tag: D38
type_guessed: string

tool: D44: %d %d

tool: D18: %f

tool: {"D17": [0x00,0x00,0x80,0xbf]}

tool: D45: Time %d:

tool: D38:  %d

assistant: ```c
int main() {
  int nJogadores, nTimes, jTimes;
  int maior, capitao, i, j, k, **time;
  float **jogadores, *media;
  scanf("%d %d", &nJogadores, &nTimes);
  media = malloc(nJogadores * sizeof(float));
  jTimes = nJogadores / nTimes;
  time = malloc(nTimes * sizeof(int *));
  for (i = 0; i < nTimes; i++)
    time[i] = malloc(jTimes * sizeof(int));
  for (i = 0; i < nJogadores; i++)
    media[i] = 0;
  jogadores = malloc(nJogadores * sizeof(float *));
  for (i = 0; i < nJogadores; i++)
    jogadores[i] = malloc(nJogadores * sizeof(float));
  for (i = 0; i < nJogadores; i++) {
    for (j = 0; j < nJogadores; j++) {
      scanf("%f", &jogadores[i][j]);
      media[j] += jogadores[i][j];
    }
  }
  for (i = 0; i < nJogadores; i++)
    media[i] /= nJogadores;
  for (i = 0; i < nTimes; i++) {
    maior = 0;
    for (j = 1; j < nJogadores; j++) {
      if (media[j] > media[maior]) {
        maior = j;
      }
    }
    time[i][0] = maior;
    media[maior] = -1;
    negativar(jogadores, nJogadores, maior);
  }
  for (i = 1; i < jTimes; i++) {
    for (j = 0; j < nTimes; j++) {
      maior = 0;
      capitao = time[j][0];
      for (k = 1; k < nJogadores; k++) {
        if (jogadores[capitao][k] > jogadores[capitao][maior])
          maior = k;
      }
      time[j][i] = maior;
      negativar(jogadores, nJogadores, maior);
    }
  }
  for (i = 0; i < nTimes; i++) {
    printf("Time %d:", i + 1);
    for (j = 0; j < jTimes; j++) {
      printf(" %d", time[i][j] + 1);
    }
    printf("\n");
  }
  free(media);
  for (i = 0; i < nTimes; i++)
    free(time[i]);
  free(time);
  for (i = 0; i < nJogadores; i++)
    free(jogadores[i]);
  free(jogadores);
  return 0;
}
```