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

```asm
<find_intf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x4a0,%rsp
  mov    %rdi,-0x488(%rbp)
  mov    %rsi,-0x490(%rbp)
  mov    %edx,-0x494(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x494(%rbp),%edx
  lea    -0x450(%rbp),%rax
  mov    %edx,%ecx
  lea    D35(%rip),%rdx
  mov    $0x40,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  lea    -0x450(%rbp),%rax
  lea    D22(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <popen@plt>
  mov    %rax,-0x470(%rbp)
  cmpq   $0x0,-0x470(%rbp)
  jne    L107
  lea    -0x450(%rbp),%rax
  mov    %rax,%rsi
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L94
L107:
  movl   $0x0,-0x478(%rbp)
  jmp    L52
L105:
  lea    -0x410(%rbp),%rax
  lea    D44(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x468(%rbp)
  cmpq   $0x0,-0x468(%rbp)
  jne    L58
  lea    D73(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x470(%rbp),%rax
  mov    %rax,%rdi
  call   <pclose@plt>
  mov    $0xffffffff,%eax
  jmp    L94
L58:
  lea    -0x410(%rbp),%rax
  lea    D27(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x460(%rbp)
  cmpq   $0x0,-0x460(%rbp)
  jne    L95
  lea    D73(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x470(%rbp),%rax
  mov    %rax,%rdi
  call   <pclose@plt>
  mov    $0xffffffff,%eax
  jmp    L94
L95:
  mov    -0x460(%rbp),%rax
  sub    -0x468(%rbp),%rax
  mov    %eax,-0x474(%rbp)
  mov    -0x474(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x458(%rbp)
  mov    -0x474(%rbp),%eax
  lea    0x1(%rax),%esi
  mov    -0x468(%rbp),%rdx
  mov    -0x458(%rbp),%rax
  mov    %rdx,%rcx
  lea    D33(%rip),%rdx
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    -0x478(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x488(%rbp),%rax
  add    %rax,%rdx
  mov    -0x458(%rbp),%rax
  mov    %rax,(%rdx)
  addl   $0x1,-0x478(%rbp)
L52:
  mov    -0x470(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    $0x400,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L105
  cmpl   $0x4,-0x478(%rbp)
  je     L83
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x470(%rbp),%rax
  mov    %rax,%rdi
  call   <pclose@plt>
  mov    $0xffffffff,%eax
  jmp    L94
L83:
  mov    -0x490(%rbp),%rax
  movl   $0x4,(%rax)
  mov    -0x470(%rbp),%rax
  mov    %rax,%rdi
  call   <pclose@plt>
  mov    $0x0,%eax
L94:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L12
  call   <__stack_chk_fail@plt>
L12:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D35
type: string
name: unpack_data
arguments: label: D22
type: string
name: unpack_data
arguments: label: D43
type: string
name: unpack_data
arguments: label: D44
type: string
name: unpack_data
arguments: label: D73
type: string
name: unpack_data
arguments: label: D27
type: string
name: unpack_data
arguments: label: D33
type: string
name: unpack_data
arguments: label: D42
type: string

tool: D35: grep -r '%x' /sys/class/net/*/device/device

tool: D22: r

tool: D43: Failed open pipe to run cmd : %s


tool: D44: eth

tool: D73: Error in parse interface name

tool: D27: /device

tool: D33: %s

tool: D42: Failed to find all ethernet interface

assistant: ```c
int find_intf(char **intf, uint8_t *size, int did) {
  char cmd[64];
  snprintf(cmd, 64, "grep -r '%x' /sys/class/net/*/device/device", did);
  FILE *fp = popen(cmd, "r");
  if (fp == NULL) {
    printf("Failed open pipe to run cmd : %s\n", cmd);
    return -1;
  }
  char buf[1024];
  uint8_t index = 0;
  while (fgets(buf, sizeof(buf), fp) != NULL) {
    char *start = strstr(buf, "eth");
    if (start == NULL) {
      printf("Error in parse interface name\n");
      pclose(fp);
      return -1;
    }
    char *end = strstr(buf, "/device");
    if (end == NULL) {
      printf("Error in parse interface name\n");
      pclose(fp);
      return -1;
    }
    uint8_t len = end - start;
    char *interf = (char *)malloc(sizeof(char) * (len + 1));
    snprintf(interf, len + 1, "%s", start);
    intf[index] = interf;
    index++;
  }
  if (index != 4) {
    printf("Failed to find all ethernet interface\n");
    pclose(fp);
    return -1;
  }
  *size = 4;
  pclose(fp);
  return 0;
}
```