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

```asm
<check_host>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0x1,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jne    L127
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <tcpd_warn@plt>
  jmp    L121
L127:
  mov    -0x18(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <split_at@plt>
  cltq
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L130
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <dot_quad_addr@plt>
  cmp    $0xffffffff,%eax
  je     L123
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <dot_quad_addr@plt>
  cmp    $0xffffffff,%eax
  jne    L121
L123:
  mov    -0x8(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <tcpd_warn@plt>
  jmp    L121
L130:
  mov    -0x18(%rbp),%rax
  lea    D57(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  jne    L117
  lea    D94(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <tcpd_warn@plt>
  lea    D69(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <tcpd_warn@plt>
  jmp    L121
L117:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <reserved_name@plt>
  test   %eax,%eax
  jne    L121
  mov    -0x18(%rbp),%rax
  lea    D3(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strspn@plt>
  mov    -0x18(%rbp),%rdx
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L166
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L101
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <tcpd_warn@plt>
  jmp    L121
L101:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L121
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <check_dns@plt>
  mov    %eax,-0xc(%rbp)
  jmp    L121
L166:
  mov    -0x18(%rbp),%rax
  lea    D46(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  je     L121
  mov    -0x18(%rbp),%rax
  lea    D72(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  je     L121
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L129
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D98(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <tcpd_warn@plt>
  jmp    L121
L129:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L121
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <check_dns@plt>
L121:
  mov    -0xc(%rbp),%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D61
data_type: string
name: read_data
arguments: data_label: D31
data_type: string
name: read_data
arguments: data_label: D57
data_type: string
name: read_data
arguments: data_label: D94
data_type: string
name: read_data
arguments: data_label: D69
data_type: string
name: read_data
arguments: data_label: D3
data_type: string
name: read_data
arguments: data_label: D85
data_type: string
name: read_data
arguments: data_label: D46
data_type: string
name: read_data
arguments: data_label: D72
data_type: string
name: read_data
arguments: data_label: D98
data_type: string

tool: D61: netgroup support disabled

tool: D31: %s/%s: bad net/mask pattern

tool: D57: FAIL

tool: D94: FAIL is no longer recognized

tool: D69: (use EXCEPT or DENY instead)

tool: D3: 01234567890./

tool: D85: %s: domain or host name ends in dot

tool: D46: 0.0.0.0

tool: D72: 255.255.255.255

tool: D98: %s: network number begins with dot

assistant: ```c
int check_host(pat)
char *pat;
{
  char *mask;
  int addr_count = 1;
  if (pat[0] == '@') {
    tcpd_warn("netgroup support disabled");
  } else if (mask = split_at(pat, '/')) {
    if (dot_quad_addr(pat) == (-1) || dot_quad_addr(mask) == (-1))
      tcpd_warn("%s/%s: bad net/mask pattern", pat, mask);
  } else if ((strcasecmp((pat), ("FAIL")) == 0)) {
    tcpd_warn("FAIL is no longer recognized");
    tcpd_warn("(use EXCEPT or DENY instead)");
  } else if (reserved_name(pat)) {
    ;
  } else if ((pat[strspn(pat, "01234567890./")] != 0)) {
    if (pat[strlen(pat) - 1] == '.') {
      tcpd_warn("%s: domain or host name ends in dot", pat);
    } else if (pat[0] != '.') {
      addr_count = check_dns(pat);
    }
  } else {
    if ((strcasecmp((pat), ("0.0.0.0")) == 0) || (strcasecmp((pat), ("255.255.255.255")) == 0)) {
      ;
    } else if (pat[0] == '.') {
      tcpd_warn("%s: network number begins with dot", pat);
    } else if (pat[strlen(pat) - 1] != '.') {
      check_dns(pat);
    }
  }
  return (addr_count);
}
```