user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<ipv4_net_to_type>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  call   <ntohl@plt>
  mov    %ebp,%edi
  shr    $0x18,%eax
  mov    %eax,%ebx
  call   <ntohl@plt>
  mov    %ebp,%edi
  mov    %eax,%r12d
  call   <ntohl@plt>
  mov    %ebp,%edi
  mov    %eax,%r13d
  call   <ntohl@plt>
  mov    %eax,%edx
  lea    D186(%rip),%rax
  test   %ebx,%ebx
  je     L113
  lea    D131(%rip),%rax
  cmp    $0xa,%ebx
  je     L113
  sar    $0x10,%r12d
  cmp    $0x64,%ebx
  je     L349
  lea    D122(%rip),%rax
  cmp    $0x7f,%ebx
  je     L113
  movzbl %r12b,%ecx
  cmp    $0xa9,%ebx
  jne    L125
  lea    D148(%rip),%rax
  cmp    $0xfe,%ecx
  jne    L125
L113:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L349:
  mov    %r12d,%ecx
  lea    D95(%rip),%rax
  and    $0xc0,%ecx
  cmp    $0x40,%ecx
  je     L113
  movzbl %r12b,%ecx
L125:
  mov    %r13d,%eax
  movzbl %ah,%eax
  mov    %eax,%r13d
  cmp    $0xac,%ebx
  je     L348
  cmp    $0xc0,%ebx
  sete   %al
  test   %ecx,%ecx
  sete   %sil
  mov    %eax,%edi
  mov    %eax,%r8d
  and    %sil,%dil
  je     L1
  lea    D0(%rip),%rax
  test   %r13d,%r13d
  je     L113
L178:
  cmp    $0x58,%ecx
  jne    L368
  test   %dil,%dil
  je     L368
  lea    D55(%rip),%rax
  cmp    $0x63,%r13d
  je     L113
L165:
  cmp    $0xc6,%ebx
  jne    L153
  and    $0xfe,%r12d
  lea    D82(%rip),%rax
  lea    D11(%rip),%rdx
  cmp    $0x12,%r12d
  cmove  %rdx,%rax
  jmp    L113
  nopl   0x0(%rax)
L348:
  mov    %r12d,%esi
  lea    D131(%rip),%rax
  xor    %edi,%edi
  and    $0xf0,%esi
  cmp    $0x10,%esi
  jne    L178
  jmp    L113
  nopl   0x0(%rax)
L1:
  cmp    $0x2,%ecx
  sete   %dil
  and    %al,%dil
  je     L158
  lea    D49(%rip),%rax
  test   %r13d,%r13d
  je     L113
L249:
  cmp    $0xa8,%ecx
  jne    L240
  test   %dil,%dil
  je     L240
  lea    D131(%rip),%rax
  jmp    L113
  nopl   (%rax)
L153:
  lea    -0xe0(%rbx),%eax
  cmp    $0xf,%eax
  ja     L65
  lea    D22(%rip),%rax
  jmp    L113
L158:
  cmp    $0x33,%ecx
  jne    L351
  test   %al,%al
  je     L351
  lea    D52(%rip),%rax
  cmp    $0x64,%r13d
  je     L113
L240:
  cmp    $0xff,%ebx
  jne    L165
  cmp    $0xff,%ecx
  jne    L165
  movzbl %dl,%eax
  cmp    $0xff,%eax
  jne    L65
  lea    D32(%rip),%rax
  cmp    $0xff,%r13d
  je     L113
L65:
  and    $0xf0,%ebx
  lea    D82(%rip),%rax
  lea    D98(%rip),%rdx
  cmp    $0xf0,%ebx
  cmove  %rdx,%rax
  jmp    L113
L351:
  cmp    $0xcb,%ebx
  jne    L98
  test   %sil,%sil
  je     L98
  lea    D136(%rip),%rax
  cmp    $0x71,%r13d
  je     L113
L307:
  cmp    $0x34,%ecx
  jne    L339
  test   %r8b,%r8b
  je     L339
  lea    D175(%rip),%rax
  cmp    $0xc1,%r13d
  jne    L165
  jmp    L113
L368:
  mov    %edi,%r8d
  jmp    L307
L339:
  mov    %r8d,%edi
  jmp    L249
L98:
  mov    %eax,%edi
  jmp    L178
```

tool_calls: name: unpack_data
arguments: data_tag: D186
type_infered: string
name: unpack_data
arguments: data_tag: D131
type_infered: string
name: unpack_data
arguments: data_tag: D122
type_infered: string
name: unpack_data
arguments: data_tag: D148
type_infered: string
name: unpack_data
arguments: data_tag: D95
type_infered: string
name: unpack_data
arguments: data_tag: D0
type_infered: string
name: unpack_data
arguments: data_tag: D55
type_infered: string
name: unpack_data
arguments: data_tag: D82
type_infered: string
name: unpack_data
arguments: data_tag: D11
type_infered: string
name: unpack_data
arguments: data_tag: D49
type_infered: string
name: unpack_data
arguments: data_tag: D22
type_infered: string
name: unpack_data
arguments: data_tag: D52
type_infered: string
name: unpack_data
arguments: data_tag: D32
type_infered: string
name: unpack_data
arguments: data_tag: D98
type_infered: string
name: unpack_data
arguments: data_tag: D136
type_infered: string
name: unpack_data
arguments: data_tag: D175
type_infered: string

tool: D186: This host on this network

tool: D131: Private Use

tool: D122: Loopback

tool: D148: Link Local

tool: D95: Shared Address Space

tool: D0: IETF Protocol Assignments

tool: D55: 6 to 4 Relay Anycast (Deprecated)

tool: D82: Internet

tool: D11: Benchmarking

tool: D49: Documentation (TEST-NET-1)

tool: D22: Multicast

tool: D52: Documentation (TEST-NET-2)

tool: D32: Limited Broadcast

tool: D98: Reserved

tool: D136: Documentation (TEST-NET-3)

tool: D175: AMT

assistant: ```c
const char *ipv4_net_to_type(struct in_addr net) {
  unsigned byte1 = (ntohl(net.s_addr) >> 24) & 0xff;
  unsigned byte2 = (ntohl(net.s_addr) >> 16) & 0xff;
  unsigned byte3 = (ntohl(net.s_addr) >> 8) & 0xff;
  unsigned byte4 = (ntohl(net.s_addr)) & 0xff;
  if (byte1 == 0) {
    return "This host on this network";
  }
  if (byte1 == 10) {
    return "Private Use";
  }
  if (byte1 == 100 && (byte2 & 0xc0) == 64) {
    return "Shared Address Space";
  }
  if (byte1 == 127) {
    return "Loopback";
  }
  if (byte1 == 169 && byte2 == 254) {
    return "Link Local";
  }
  if (byte1 == 172 && (byte2 & 0xf0) == 16) {
    return "Private Use";
  }
  if (byte1 == 192 && byte2 == 0 && byte3 == 0) {
    return "IETF Protocol Assignments";
  }
  if (byte1 == 192 && byte2 == 2 && byte3 == 0) {
    return "Documentation (TEST-NET-1)";
  }
  if (byte1 == 192 && byte2 == 51 && byte3 == 100) {
    return "Documentation (TEST-NET-2)";
  }
  if (byte1 == 203 && byte2 == 0 && byte3 == 113) {
    return "Documentation (TEST-NET-3)";
  }
  if (byte1 == 192 && byte2 == 88 && byte3 == 99) {
    return "6 to 4 Relay Anycast (Deprecated)";
  }
  if (byte1 == 192 && byte2 == 52 && byte3 == 193) {
    return "AMT";
  }
  if (byte1 == 192 && byte2 == 168) {
    return "Private Use";
  }
  if (byte1 == 255 && byte2 == 255 && byte3 == 255 && byte4 == 255) {
    return "Limited Broadcast";
  }
  if (byte1 == 198 && (byte2 & 0xfe) == 18) {
    return "Benchmarking";
  }
  if (byte1 >= 224 && byte1 <= 239) {
    return "Multicast";
  }
  if ((byte1 & 0xf0) == 240) {
    return "Reserved";
  }
  return "Internet";
}
```