user: Translate the below assembly code into C programming language:

```asm
<verify_ipv4_addr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x140,%rsp
  mov    %rdi,-0x138(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x128(%rbp)
  mov    -0x138(%rbp),%rax
  mov    %rax,-0x120(%rbp)
  movl   $0x0,-0x124(%rbp)
  movq   $0x0,-0x118(%rbp)
  mov    -0x138(%rbp),%rax
  lea    D37(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L20
  mov    -0x138(%rbp),%rax
  lea    D12(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L20
  mov    -0x138(%rbp),%rax
  lea    D31(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L20
  mov    -0x138(%rbp),%rax
  lea    D42(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L20
  mov    -0x138(%rbp),%rax
  lea    D34(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L52
L20:
  mov    $0x1,%eax
  jmp    L22
L52:
  lea    -0x110(%rbp),%rax
  mov    $0xff,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x138(%rbp),%rax
  mov    %rax,-0x120(%rbp)
  jmp    L55
L99:
  mov    -0x120(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L188
  mov    -0x120(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  jne    L188
  mov    $0x0,%eax
  jmp    L22
L188:
  mov    -0x120(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L165
  mov    -0x120(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L172
L165:
  mov    -0x120(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L97
  mov    -0x120(%rbp),%rax
  movzbl (%rax),%eax
  lea    -0x110(%rbp),%rcx
  mov    -0x118(%rbp),%rdx
  add    %rcx,%rdx
  mov    %al,(%rdx)
L97:
  mov    -0x120(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L108
  addl   $0x1,-0x124(%rbp)
L108:
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  test   %eax,%eax
  js     L158
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  cmp    $0xff,%eax
  jg     L158
  mov    $0x1,%eax
  jmp    L72
L158:
  mov    $0x0,%eax
L72:
  mov    %eax,-0x128(%rbp)
  movq   $0xffffffffffffffff,-0x118(%rbp)
  lea    -0x110(%rbp),%rax
  mov    $0xff,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  jmp    L134
L172:
  mov    -0x120(%rbp),%rax
  movzbl (%rax),%eax
  lea    -0x110(%rbp),%rcx
  mov    -0x118(%rbp),%rdx
  add    %rcx,%rdx
  mov    %al,(%rdx)
L134:
  mov    -0x118(%rbp),%rax
  lea    0x1(%rax),%rcx
  movabs $0x8080808080808081,%rdx
  mov    %rcx,%rax
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x7,%rax
  mov    %rax,-0x118(%rbp)
  mov    -0x118(%rbp),%rdx
  mov    %rdx,%rax
  shl    $0x8,%rax
  sub    %rdx,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %rdx,-0x118(%rbp)
  addq   $0x1,-0x120(%rbp)
L55:
  mov    -0x120(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L195
  cmpl   $0x0,-0x128(%rbp)
  jne    L99
L195:
  cmpl   $0x0,-0x128(%rbp)
  je     L155
  cmpl   $0x3,-0x124(%rbp)
  jne    L155
  mov    $0x1,%eax
  jmp    L22
L155:
  mov    $0x0,%eax
L22:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L198
  call   <__stack_chk_fail@plt>
L198:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D37
data_type: string
name: unpack_data
arguments: tag: D12
data_type: string
name: unpack_data
arguments: tag: D31
data_type: string
name: unpack_data
arguments: tag: D42
data_type: string
name: unpack_data
arguments: tag: D34
data_type: string

tool: D37: north-american-ip

tool: D12: south-american-ip

tool: D31: asian-ip

tool: D42: european-ip

tool: D34: user-defined-ip

assistant: ```c
int verify_ipv4_addr(const char *buffer) {
  int retval = 1;
  const char *b = buffer;
  int dots_nr = 0;
  char oct[255];
  size_t o = 0;
  if (strcmp(buffer, "north-american-ip") == 0 || strcmp(buffer, "south-american-ip") == 0 || strcmp(buffer, "asian-ip") == 0 || strcmp(buffer, "european-ip") == 0 || strcmp(buffer, "user-defined-ip") == 0) {
    return 1;
  }
  memset(oct, 0, sizeof(oct));
  for (b = buffer; *b != 0 && retval; b++) {
    if (*b != '.' && !isdigit(*b)) {
      return 0;
    }
    if (*b == '.' || *(b + 1) == 0) {
      if (*(b + 1) == 0) {
        oct[o] = *b;
      }
      if (*b == '.') {
        dots_nr++;
      }
      retval = (atoi(oct) >= 0 && atoi(oct) <= 255);
      o = -1;
      memset(oct, 0, sizeof(oct));
    } else {
      oct[o] = *b;
    }
    o = (o + 1) % sizeof(oct);
  }
  return (retval && dots_nr == 3);
}
```