user: What is the c source code of the assembly code below:

```asm
<check_input_buffer2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L125
L55:
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L125
  mov    -0x10(%rbp),%rax
  sub    -0x28(%rbp),%rax
  mov    %eax,-0x18(%rbp)
  jmp    L49
L125:
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jb     L55
L49:
  cmpl   $0x0,-0x18(%rbp)
  jne    L112
  mov    $0x0,%eax
  jmp    L161
L112:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  or     $0x20,%eax
  cmp    $0x60,%al
  jbe    L293
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  or     $0x20,%eax
  cmp    $0x7a,%al
  jbe    L43
L293:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L43
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L43
  mov    $0x0,%eax
  jmp    L161
L43:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L8
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L244
L8:
  movl   $0x1,-0x14(%rbp)
L244:
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x10(%rbp)
  jmp    L5
L203:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L147
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L147
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L28
L147:
  cmpl   $0x0,-0x14(%rbp)
  je     L28
  mov    $0x0,%eax
  jmp    L161
L28:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  or     $0x20,%eax
  cmp    $0x60,%al
  jbe    L106
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  or     $0x20,%eax
  cmp    $0x7a,%al
  jbe    L64
L106:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L254
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L64
L254:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L64
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L64
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L64
  mov    $0x0,%eax
  jmp    L161
L64:
  movl   $0x0,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L247
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L247
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L154
L247:
  movl   $0x1,-0x14(%rbp)
L154:
  addq   $0x1,-0x10(%rbp)
L5:
  mov    -0x18(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x10(%rbp)
  jb     L203
  mov    -0x18(%rbp),%eax
L161:
  pop    %rbp
  ret
```

assistant: ```c
int check_input_buffer2(char *buffer, size_t size) {
  char *ptr = buffer, *end_ptr = buffer + size;
  int length = 0;
  int extra = 0;
  while (ptr < end_ptr) {
    if (*++ptr == '\0') {
      length = ptr - buffer;
      break;
    }
  }
  if (!length) {
    return 0;
  }
  if (!((unsigned char)(*buffer | 0x20) >= 'a' && (unsigned char)(*buffer | 0x20) <= 'z') && *buffer != '_' && *buffer != '.') {
    return 0;
  }
  if (*buffer == '_' || *buffer == '.') {
    extra = 1;
  }
  for (ptr = buffer + 1; ptr < (buffer + length - 1); ptr++) {
    if (((*ptr) == '_' || (*ptr) == '-' || (*ptr) == '.') && extra) {
      return 0;
    }
    if (!(((unsigned char)(*ptr | 0x20) >= 'a' && (unsigned char)(*ptr | 0x20) <= 'z') || ((*ptr) >= '0' && (*ptr) <= '9')) && !((*ptr) == '_' || (*ptr) == '-' || (*ptr) == '.')) {
      return 0;
    }
    extra = 0;
    if (((*ptr) == '_' || (*ptr) == '-' || (*ptr) == '.')) {
      extra = 1;
    }
  }
  return length;
}
```