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

```asm
<route_and_arp>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xd0,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %rdx,%r13
  mov    %ecx,%r14d
  mov    %r8,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  lea    D42(%rip),%rax
  mov    %rax,(%rsp)
  lea    D118(%rip),%rax
  mov    %rax,0x8(%rsp)
  lea    0x90(%rsp),%rax
  mov    %rax,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  lea    D27(%rip),%rax
  mov    %rax,0x50(%rsp)
  lea    D84(%rip),%rax
  mov    %rax,0x58(%rsp)
  lea    D7(%rip),%rax
  mov    %rax,0x60(%rsp)
  mov    %rsi,0x68(%rsp)
  lea    D29(%rip),%rax
  mov    %rax,0x70(%rsp)
  mov    %rdi,0x78(%rsp)
  movq   $0x0,0x80(%rsp)
  lea    D36(%rip),%rax
  mov    %rax,0x20(%rsp)
  lea    D86(%rip),%rax
  mov    %rax,0x28(%rsp)
  mov    %rsi,0x30(%rsp)
  lea    D0(%rip),%rax
  mov    %rax,0x38(%rsp)
  lea    D14(%rip),%rax
  mov    %rax,0x40(%rsp)
  movq   $0x0,0x48(%rsp)
  call   <is_a_device@plt>
  test   %eax,%eax
  je     L1
  lea    0x50(%rsp),%rdi
  mov    %rbp,%rdx
  mov    %r14d,%esi
  call   <do_exec@plt>
  test   %rax,%rax
  jne    L5
  lea    0x90(%rsp),%rdi
  mov    %rbx,%rcx
  lea    D49(%rip),%rdx
  mov    $0x34,%esi
  call   <snprintf@plt>
  mov    %rsp,%rdi
  mov    %rbp,%rdx
  mov    $0x0,%esi
  call   <do_exec@plt>
  test   %r13,%r13
  je     L39
  lea    0x20(%rsp),%rdi
  mov    %rbp,%r9
  mov    %rbx,%r8
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    $0x3,%esi
  call   <local_net_do@plt>
  mov    $0x0,%eax
L12:
  mov    0xc8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L55
  add    $0xd0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L1:
  mov    $0xffffffff,%edx
  lea    D19(%rip),%rsi
  mov    %rbp,%rdi
  call   <add_output@plt>
  mov    $0xffffffff,%eax
  jmp    L12
L39:
  lea    0x20(%rsp),%rdi
  mov    %rbp,%rdx
  mov    $0x0,%esi
  call   <do_exec@plt>
  mov    $0x0,%eax
  jmp    L12
L5:
  mov    $0xffffffff,%eax
  jmp    L12
L55:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D42
data_type: string
name: parse_data
arguments: tag: D118
data_type: string
name: parse_data
arguments: tag: D27
data_type: string
name: parse_data
arguments: tag: D84
data_type: string
name: parse_data
arguments: tag: D7
data_type: string
name: parse_data
arguments: tag: D29
data_type: string
name: parse_data
arguments: tag: D36
data_type: string
name: parse_data
arguments: tag: D86
data_type: string
name: parse_data
arguments: tag: D0
data_type: string
name: parse_data
arguments: tag: D14
data_type: string
name: parse_data
arguments: tag: D49
data_type: string
name: parse_data
arguments: tag: D19
data_type: string

tool: D42: bash

tool: D118: -c

tool: D27: route

tool: D84: add

tool: D7: -host

tool: D29: dev

tool: D36: arp

tool: D86: -Ds

tool: D0: eth0

tool: D14: pub

tool: D49: echo 1 > /proc/sys/net/ipv4/conf/%.9s/proxy_arp

tool: D19: Device doesn't contain only alphanumeric characters


assistant: ```c
int route_and_arp(char *dev, char *addr, char *netmask, int need_route, struct output *output) {
  char echo[sizeof("echo 1 > /proc/sys/net/ipv4/conf/XXXXXXXXX/proxy_arp")];
  char *echo_argv[] = {"bash", "-c", echo, NULL};
  char *route_argv[] = {"route", "add", "-host", addr, "dev", dev, NULL};
  char *arp_argv[] = {"arp", "-Ds", addr, "eth0", "pub", NULL};
  if (!is_a_device(dev)) {
    add_output(output, "Device doesn't contain only alphanumeric characters\n", -1);
    return (-1);
  }
  if (do_exec(route_argv, need_route, output))
    return (-1);
  snprintf(echo, sizeof(echo) - 1, "echo 1 > /proc/sys/net/ipv4/conf/%.9s/proxy_arp", dev);
  do_exec(echo_argv, 0, output);
  if (netmask)
    local_net_do(arp_argv, 3, addr, netmask, dev, output);
  else
    do_exec(arp_argv, 0, output);
  return (0);
}
```