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

```asm
<check_for_comma>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0x18(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L17
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L19
L54:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2c,%al
  jne    L66
  addl   $0x1,-0x18(%rbp)
L66:
  addl   $0x1,-0x20(%rbp)
L19:
  mov    -0x20(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L54
  cmpl   $0x0,-0x18(%rbp)
  je     L130
  cmpl   $0x40,-0x18(%rbp)
  jle    L112
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L47
L112:
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L61
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L90
L118:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2c,%al
  jne    L134
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
L134:
  addl   $0x1,-0x20(%rbp)
  addl   $0x1,-0x1c(%rbp)
L90:
  mov    -0x20(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L118
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  jmp    L47
L17:
  nop
  jmp    L47
L130:
  nop
  jmp    L47
L61:
  nop
L47:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D8
datatype: string

tool: D8: 
Invalid password. Password contains too many commas.


assistant: ```c
void check_for_comma(char **ppasswrd) {
  char *new_pass_buf;
  char *pass;
  int i, j;
  int number_of_commas = 0;
  int len;
  if (ppasswrd == NULL)
    return;
  else
    (pass = *ppasswrd);
  len = strlen(pass);
  for (i = 0; i < len; i++) {
    if (pass[i] == ',')
      number_of_commas++;
  }
  if (number_of_commas == 0)
    return;
  if (number_of_commas > 64) {
    printf("\nInvalid password. Password contains too many commas.\n");
    return;
  }
  new_pass_buf = malloc(len + number_of_commas + 1);
  if (new_pass_buf == NULL)
    return;
  for (i = 0, j = 0; i < len; i++, j++) {
    new_pass_buf[j] = pass[i];
    if (pass[i] == ',') {
      j++;
      new_pass_buf[j] = pass[i];
    }
  }
  new_pass_buf[len + number_of_commas] = 0;
  free(*ppasswrd);
  *ppasswrd = new_pass_buf;
  return;
}
```