user: 请将以下的汇编代码转换成C语言代码:

```asm
<check_address>:
  endbr64
  push   %r13
  lea    D4(%rip),%rsi
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  call   <re_match@plt>
  test   %rax,%rax
  je     L7
  mov    $0x1,%edx
  mov    %rbp,%rsi
  lea    D15(%rip),%rdi
  call   <validateType@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  je     L84
  lea    0x2c(%rsp),%rax
  lea    0x10(%rsp),%r13
  mov    %rbp,%rdi
  xor    %r12d,%r12d
  movl   $0x0,0x8(%rsp)
  lea    0x14(%rsp),%rcx
  lea    0x20(%rsp),%rbx
  mov    %r13,%rdx
  push   %rax
  lea    D5(%rip),%rsi
  lea    0x30(%rsp),%rax
  push   %rax
  lea    0x34(%rsp),%rax
  push   %rax
  push   %rbx
  lea    0x3c(%rsp),%r9
  lea    0x38(%rsp),%r8
  call   <sscanf@plt>
  add    $0x20,%rsp
  cmp    $0x8,%eax
  jne    L109
  mov    0x8(%rsp),%edi
  xor    %eax,%eax
  xor    %edx,%edx
L54:
  shl    $0x8,%edi
  shl    $0x8,%edx
  or     0x0(%r13,%rax,1),%edi
  or     (%rbx,%rax,1),%edx
  add    $0x4,%rax
  cmp    $0x10,%rax
  jne    L54
  xor    %dil,%dil
  xor    %dl,%dl
  mov    $0x1,%r12d
  mov    %edi,0x8(%rsp)
  cmp    %edx,%edi
  je     L109
  call   <htonl@plt>
  lea    0x8(%rsp),%rsi
  mov    $0x4,%edx
  xor    %r12d,%r12d
  lea    0xc(%rsp),%rdi
  mov    %eax,0x8(%rsp)
  call   <memcpy@plt>
  mov    0xc(%rsp),%edi
  call   <inet_ntoa@plt>
  lea    D43(%rip),%rdi
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L109
  nopw   0x0(%rax,%rax,1)
L7:
  lea    D9(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L16
  mov    $0x1,%edx
  mov    %rbp,%rsi
  lea    D27(%rip),%rdi
  call   <validateType@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  je     L76
  mov    $0x1,%r12d
L109:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L112
  add    $0x48,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L16:
  lea    D58(%rip),%rdi
  xor    %r12d,%r12d
  call   <printf@plt>
  jmp    L109
  nopl   0x0(%rax)
L84:
  mov    %rbp,%rsi
  lea    D61(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L109
  nopl   0x0(%rax,%rax,1)
L76:
  mov    %rbp,%rsi
  lea    D22(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L109
L112:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D4
type_infered: string
name: read_data
arguments: data_label: D15
type_infered: string
name: read_data
arguments: data_label: D5
type_infered: string
name: read_data
arguments: data_label: D43
type_infered: string
name: read_data
arguments: data_label: D9
type_infered: string
name: read_data
arguments: data_label: D27
type_infered: string
name: read_data
arguments: data_label: D58
type_infered: string
name: read_data
arguments: data_label: D61
type_infered: string
name: read_data
arguments: data_label: D22
type_infered: string

tool: D4: ^[^-]+-[^-]+

tool: D15: ipv4range

tool: D5: %u.%u.%u.%u-%u.%u.%u.%u

tool: D43: Error: address range must be within %s/24


tool: D9: 0.0.0.0

tool: D27: ipv4

tool: D58: Error: zero IP address not valid in address-group

tool: D61: Error: [%s] is not a valid IPv4 address range


tool: D22: Error: [%s] isn't valid IPv4 address


assistant: ```c
int check_address(char *addr) {
  if (re_match(addr, "^[^-]+-[^-]+")) {
    if (!validateType("ipv4range", addr, 1)) {
      printf("Error: [%s] is not a valid IPv4 address range\n", addr);
      return 0;
    }
    unsigned int a1[4], a2[4];
    uint32_t addr1 = 0;
    uint32_t addr2 = 0;
    uint32_t mask = 0xffffff00;
    if (sscanf(addr, "%u.%u.%u.%u-%u.%u.%u.%u", &a1[0], &a1[1], &a1[2], &a1[3], &a2[0], &a2[1], &a2[2], &a2[3]) != 8)
      return 0;
    int i;
    for (i = 0; i < 4; ++i) {
      addr1 <<= 8;
      addr1 |= a1[i];
      addr2 <<= 8;
      addr2 |= a2[i];
    }
    addr1 = addr1 & mask;
    addr2 = addr2 & mask;
    struct in_addr in;
    if (addr1 != addr2) {
      addr1 = htonl(addr1);
      memcpy(&in, &addr1, sizeof(struct in_addr));
      printf("Error: address range must be within %s/24\n", inet_ntoa(in));
      return 0;
    }
    return 1;
  }
  if (strcmp(addr, "0.0.0.0") == 0) {
    printf("Error: zero IP address not valid in address-group");
    return 0;
  }
  if (!validateType("ipv4", addr, 1)) {
    printf("Error: [%s] isn't valid IPv4 address\n", addr);
    return 0;
  }
  return 1;
}
```