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

```asm
<mean>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0xe8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  call   <strlen@plt>
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L57:
  cmp    %rdx,%rsp
  je     L110
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L57
L110:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L54
  orq    $0x0,-0x8(%rsp,%rax,1)
L54:
  mov    %rbx,%rsi
  mov    %rsp,%rdi
  call   <strcpy@plt>
  lea    -0xf0(%rbp),%rdi
  lea    D50(%rip),%rsi
  call   <strcpy@plt>
  lea    D57(%rip),%rsi
  mov    %rsp,%rdi
  call   <strtok@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L119
  lea    D57(%rip),%r13
L101:
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rax,%rdx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L124
  mov    %r13,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L101
  jmp    L119
L124:
  lea    -0xf0(%rbp),%rdi
  mov    %rbx,%rsi
  call   <strcpy@plt>
L119:
  movsd  D52(%rip),%xmm0
  cmpb   $0x0,-0xf0(%rbp)
  je     L79
  mov    $0x0,%ebx
  mov    $0x0,%r13d
  lea    -0xf0(%rbp),%r12
  jmp    L149
L87:
  movzbl (%rbx,%r12,1),%edx
  movslq %r13d,%rax
  mov    %dl,-0xf0(%rbp,%rax,1)
  lea    0x1(%r13),%r13d
L72:
  add    $0x1,%rbx
L149:
  mov    %r12,%rdi
  call   <strlen@plt>
  cmp    %rbx,%rax
  jbe    L56
  movsbl (%rbx,%r12,1),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L87
  movzbl (%rbx,%r12,1),%eax
  and    $0xfffffffd,%eax
  cmp    $0x2c,%al
  je     L87
  jmp    L72
L56:
  movslq %r13d,%r13
  movb   $0x0,-0xf0(%rbp,%r13,1)
  lea    -0xf0(%rbp),%rdi
  lea    D42(%rip),%rsi
  call   <strtok@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L44
  pxor   %xmm2,%xmm2
  movsd  %xmm2,-0xf8(%rbp)
  lea    D42(%rip),%rbx
L159:
  call   <atof@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  -0xf8(%rbp),%xmm0
  movsd  %xmm0,-0xf8(%rbp)
  mov    %rbx,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  jne    L159
L55:
  movsd  -0xf8(%rbp),%xmm0
  divsd  D62(%rip),%xmm0
L79:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L108
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
L44:
  pxor   %xmm3,%xmm3
  movsd  %xmm3,-0xf8(%rbp)
  jmp    L55
L108:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D50
type_guessed: string
name: read_data
arguments: data_tag: D57
type_guessed: string
name: read_data
arguments: data_tag: D52
type_guessed: f32[2]
name: read_data
arguments: data_tag: D42
type_guessed: string
name: read_data
arguments: data_tag: D62
type_guessed: f64

tool: 

tool: D57: 


tool: {"D52": [0.0,-1.875]}

tool: D42: ,

tool: D62: 12

assistant: ```c
double mean(char *str, char *town) {
  char buff[strlen(str)];
  strcpy(buff, str);
  char line[200];
  strcpy(line, "");
  char *pch = strtok(buff, "\n");
  while (pch != NULL) {
    if (strncmp(pch, town, strlen(town)) == 0) {
      strcpy(line, pch);
      break;
    }
    pch = strtok(NULL, "\n");
  }
  if (strlen(line) == 0)
    return -1;
  int cnt = 0;
  for (size_t i = 0; i < strlen(line); ++i) {
    if (isdigit(line[i]) || line[i] == '.' || line[i] == ',')
      line[cnt++] = line[i];
  }
  line[cnt] = '\0';
  double sum = 0;
  pch = strtok(line, ",");
  while (pch != NULL) {
    sum += atof(pch);
    pch = strtok(NULL, ",");
  }
  return sum / 12.0;
}
```