user: Converte this assembly snippet into its equivalent C code:

```asm
<validate_v4addr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    $0x0,%ebp
  cmp    $0x6,%eax
  jg     L133
L85:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L50
  mov    %ebp,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L133:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0xf,%eax
  jg     L85
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  jmp    L91
L61:
  cmpb   $0x2e,(%rbx,%rbp,1)
  sete   %al
  movzbl %al,%eax
  add    %eax,%r12d
  add    $0x1,%rbp
L91:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    %ebp,%eax
  jg     L61
  mov    $0x0,%ebp
  mov    $0x0,%r14d
  lea    D6(%rip),%r13
  cmp    $0x3,%r12d
  jne    L85
L178:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    %r14d,%eax
  jg     L150
  mov    $0x0,%ebp
  cmpb   $0x2e,(%rbx)
  je     L85
  mov    %rbx,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2e,-0x1(%rbx,%rax,1)
  je     L85
  mov    $0x0,%ebp
  jmp    L254
L150:
  mov    $0x0,%r12d
  mov    $0x0,%ebp
L252:
  mov    %r13,%rdi
  call   <strlen@plt>
  test   %ebp,%ebp
  jne    L124
  cmp    %r12d,%eax
  jle    L124
  movzbl 0x0(%r13,%r12,1),%eax
  cmp    %al,(%rbx,%r14,1)
  sete   %bpl
  movzbl %bpl,%ebp
  add    $0x1,%r12
  jmp    L252
L124:
  add    $0x1,%r14
  test   %ebp,%ebp
  jne    L178
  jmp    L85
L256:
  add    $0x1,%rbp
L254:
  mov    %rbx,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cmp    %ebp,%eax
  jle    L241
  cmpb   $0x2e,(%rbx,%rbp,1)
  jne    L256
  cmpb   $0x2e,0x1(%rbx,%rbp,1)
  jne    L256
  mov    $0x0,%ebp
  jmp    L85
L241:
  movl   $0x4,0xc(%rsp)
  mov    $0x0,%r12d
  lea    0x10(%rsp),%r15
  jmp    L196
L62:
  cmp    $0x3,%r14d
  jg     L235
L255:
  mov    %r15,%rdi
  call   <atoi@plt>
  cmp    $0xff,%eax
  ja     L131
  add    $0x1,%r12d
  subl   $0x1,0xc(%rsp)
  je     L114
L196:
  mov    $0x10,%edx
  mov    $0x0,%esi
  mov    %r15,%rdi
  call   <memset@plt>
  movslq %r12d,%r13
  add    %rbx,%r13
  mov    $0x0,%ebp
  cmpb   $0x2e,0x0(%r13)
  je     L255
L294:
  mov    %ebp,%r14d
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    %r12d,%eax
  jle    L62
  add    $0x1,%r12d
  lea    0x1(%rbp),%r14d
  movzbl 0x0(%r13,%rbp,1),%eax
  mov    %al,0x0(%rbp,%r15,1)
  add    $0x1,%rbp
  cmpb   $0x2e,0x0(%r13,%rbp,1)
  jne    L294
  jmp    L62
L114:
  mov    $0x1,%ebp
  jmp    L85
L235:
  mov    $0x0,%ebp
  jmp    L85
L131:
  mov    $0x0,%ebp
  jmp    L85
L50:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D6
type: string

tool: D6: 0123456789.

assistant: ```c
int validate_v4addr(char *addr) {
  int i, j, k, m;
  char buf[16];
  if (strlen(addr) < 7 || strlen(addr) > 15)
    return 0;
  i = 0;
  j = 0;
  while (i < (int)strlen(addr)) {
    if (addr[i++] == '.')
      j++;
  }
  if (j != 3)
    return 0;
  i = 0;
  j = 0;
  while (i < (int)strlen(addr)) {
    k = 0;
    j = 0;
    while (k < (int)strlen("0123456789.") && !j) {
      if (addr[i] == "0123456789."[k])
        j = 1;
      k++;
    }
    if (!j)
      return 0;
    i++;
  }
  if (addr[0] == '.' || addr[strlen(addr) - 1] == '.')
    return 0;
  i = 0;
  while (i < ((int)strlen(addr) - 1)) {
    if (addr[i] == '.' && addr[i + 1] == '.')
      return 0;
    i++;
  }
  j = 0;
  for (i = 0; i < 4; i++) {
    k = 0;
    memset(buf, 0, sizeof(buf));
    while (addr[j] != '.' && j < (int)strlen(addr))
      buf[k++] = addr[j++];
    if (k > 3)
      return 0;
    m = atoi(buf);
    if (m < 0 || m > 255)
      return 0;
    j++;
  };
  return 1;
}
```