user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x430,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x418(%rbp)
  movq   $0x0,-0x410(%rbp)
  movq   $0x0,-0x408(%rbp)
  lea    -0x400(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x7e,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  movl   $0x0,-0x424(%rbp)
  movl   $0x0,-0x420(%rbp)
  movl   $0x0,-0x41c(%rbp)
  lea    D56(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D91(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D56(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L0:
  mov    $0x258,%edi
  call   <sleep@plt>
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movq   $0x0,-0x418(%rbp)
  lea    D112(%rip),%rax
  mov    %rax,%rsi
  lea    D239(%rip),%rax
  mov    %rax,%rdi
  call   <popen@plt>
  mov    %rax,-0x418(%rbp)
  cmpq   $0x0,-0x418(%rbp)
  jne    L50
  lea    D140(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L50:
  lea    -0x410(%rbp),%rax
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x418(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x400,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  movb   $0x0,-0x11(%rbp)
  lea    -0x424(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  lea    D307(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  mov    -0x418(%rbp),%rax
  mov    %rax,%rdi
  call   <pclose@plt>
  mov    -0x424(%rbp),%eax
  mov    %eax,%esi
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x424(%rbp),%eax
  test   %eax,%eax
  jle    L89
  lea    D104(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L24
L89:
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <sys_log@plt>
  lea    D312(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  mov    $0x5,%edi
  call   <sleep@plt>
L24:
  lea    D223(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movq   $0x0,-0x418(%rbp)
  lea    D112(%rip),%rax
  mov    %rax,%rsi
  lea    D65(%rip),%rax
  mov    %rax,%rdi
  call   <popen@plt>
  mov    %rax,-0x418(%rbp)
  cmpq   $0x0,-0x418(%rbp)
  jne    L81
  lea    D140(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L81:
  lea    -0x410(%rbp),%rax
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x418(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x400,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  movb   $0x0,-0x11(%rbp)
  lea    -0x420(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  lea    D307(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  mov    -0x418(%rbp),%rax
  mov    %rax,%rdi
  call   <pclose@plt>
  mov    -0x420(%rbp),%eax
  mov    %eax,%esi
  lea    D116(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x420(%rbp),%eax
  test   %eax,%eax
  jle    L99
  lea    D187(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L12
L99:
  lea    D77(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D235(%rip),%rax
  mov    %rax,%rdi
  call   <sys_log@plt>
  lea    D132(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  mov    $0x5,%edi
  call   <sleep@plt>
L12:
  lea    D210(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movq   $0x0,-0x418(%rbp)
  lea    D112(%rip),%rax
  mov    %rax,%rsi
  lea    D306(%rip),%rax
  mov    %rax,%rdi
  call   <popen@plt>
  mov    %rax,-0x418(%rbp)
  cmpq   $0x0,-0x418(%rbp)
  jne    L53
  lea    D140(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L53:
  lea    -0x410(%rbp),%rax
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x418(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x400,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  movb   $0x0,-0x11(%rbp)
  lea    -0x41c(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  lea    D307(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  mov    -0x418(%rbp),%rax
  mov    %rax,%rdi
  call   <pclose@plt>
  mov    -0x41c(%rbp),%eax
  mov    %eax,%esi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x41c(%rbp),%eax
  test   %eax,%eax
  jle    L11
  lea    D201(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L0
L11:
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  call   <sys_log@plt>
  lea    D215(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  mov    $0x5,%edi
  call   <sleep@plt>
  jmp    L0
```

tool_calls: name: read_data
arguments: data_label: D56
type_guessed: string
name: read_data
arguments: data_label: D91
type_guessed: string
name: read_data
arguments: data_label: D34
type_guessed: string
name: read_data
arguments: data_label: D112
type_guessed: string
name: read_data
arguments: data_label: D239
type_guessed: string
name: read_data
arguments: data_label: D140
type_guessed: string
name: read_data
arguments: data_label: D307
type_guessed: string
name: read_data
arguments: data_label: D59
type_guessed: string
name: read_data
arguments: data_label: D104
type_guessed: string
name: read_data
arguments: data_label: D19
type_guessed: string
name: read_data
arguments: data_label: D10
type_guessed: string
name: read_data
arguments: data_label: D312
type_guessed: string
name: read_data
arguments: data_label: D223
type_guessed: string
name: read_data
arguments: data_label: D65
type_guessed: string
name: read_data
arguments: data_label: D116
type_guessed: string
name: read_data
arguments: data_label: D187
type_guessed: string
name: read_data
arguments: data_label: D77
type_guessed: string
name: read_data
arguments: data_label: D235
type_guessed: string
name: read_data
arguments: data_label: D132
type_guessed: string
name: read_data
arguments: data_label: D210
type_guessed: string
name: read_data
arguments: data_label: D306
type_guessed: string
name: read_data
arguments: data_label: D12
type_guessed: string
name: read_data
arguments: data_label: D201
type_guessed: string
name: read_data
arguments: data_label: D30
type_guessed: string
name: read_data
arguments: data_label: D36
type_guessed: string
name: read_data
arguments: data_label: D215
type_guessed: string

tool: D56: **********************************

tool: D91: run_daemon : start

tool: D34: ---------check network_monitor_run-----------

tool: D112: r

tool: D239: ps -ef | grep 'network_monitor' | grep -v 'grep' | grep -v 'sh -c' | awk '{print $2}' | wc -l

tool: D140: popen failed

tool: D307: %d

tool: D59: network_monitor_run process : %d


tool: D104: network_monitor_run : ok!

tool: D19: network_monitror_run : down, restart again...

tool: D10: network_monitor_run : down!

tool: D312: /ailvgo/system/box/network_monitor_run &

tool: D223: ---------check heart_beat_run-----------

tool: D65: ps -ef | grep 'heart_beat' | grep -v 'grep' | grep -v 'sh -c' | awk '{print $2}' | wc -l

tool: D116: heart_beat_run process : %d


tool: D187: heart_beat_run : ok!

tool: D77: heart_beat_run : down, restart again...

tool: D235: heart_beat_run : down!

tool: D132: /ailvgo/system/box/heart_beat_run &

tool: D210: ---------check remote_control_run-----------

tool: D306: ps -ef | grep 'remote_control' | grep -v 'grep' | grep -v 'sh -c' | awk '{print $2}' | wc -l

tool: D12: remote_control_run process : %d


tool: D201: remote_control_run : ok!

tool: D30: remote_control_run : down, restart again...

tool: D36: remote_control_run : down!

tool: D215: /ailvgo/system/box/remote_control_run &

assistant: ```c
int main() {
  FILE *stream = NULL;
  char buf[1024] = {0};
  int cnt_network_monitor_run = 0, cnt_heart_beat_run = 0, cnt_remote_control_run = 0;
  printf("**********************************\n");
  printf("run_daemon : start\n");
  printf("**********************************\n");
  while (1) {
    sleep(600);
    printf("---------check network_monitor_run-----------\n");
    stream = NULL;
    if ((stream = popen("ps -ef | grep 'network_monitor' | grep -v 'grep' | grep -v 'sh -c' | awk '{print $2}' | wc -l", "r")) == NULL)
      printf("popen failed\n");
    memset(buf, 0, sizeof(buf));
    fread(buf, sizeof(char), sizeof(buf), stream);
    buf[1023] = '\0';
    sscanf(buf, "%d", &cnt_network_monitor_run);
    pclose(stream);
    printf("network_monitor_run process : %d\n", cnt_network_monitor_run);
    if (cnt_network_monitor_run >= 1)
      printf("network_monitor_run : ok!\n");
    else {
      printf("network_monitror_run : down, restart again...\n");
      sys_log("network_monitor_run : down!");
      system("/ailvgo/system/box/network_monitor_run &");
      sleep(5);
    }
    printf("---------check heart_beat_run-----------\n");
    stream = NULL;
    if ((stream = popen("ps -ef | grep 'heart_beat' | grep -v 'grep' | grep -v 'sh -c' | awk '{print $2}' | wc -l", "r")) == NULL)
      printf("popen failed\n");
    memset(buf, 0, sizeof(buf));
    fread(buf, sizeof(char), sizeof(buf), stream);
    buf[1023] = '\0';
    sscanf(buf, "%d", &cnt_heart_beat_run);
    pclose(stream);
    printf("heart_beat_run process : %d\n", cnt_heart_beat_run);
    if (cnt_heart_beat_run >= 1)
      printf("heart_beat_run : ok!\n");
    else {
      printf("heart_beat_run : down, restart again...\n");
      sys_log("heart_beat_run : down!");
      system("/ailvgo/system/box/heart_beat_run &");
      sleep(5);
    }
    printf("---------check remote_control_run-----------\n");
    stream = NULL;
    if ((stream = popen("ps -ef | grep 'remote_control' | grep -v 'grep' | grep -v 'sh -c' | awk '{print $2}' | wc -l", "r")) == NULL)
      printf("popen failed\n");
    memset(buf, 0, sizeof(buf));
    fread(buf, sizeof(char), sizeof(buf), stream);
    buf[1023] = '\0';
    sscanf(buf, "%d", &cnt_remote_control_run);
    pclose(stream);
    printf("remote_control_run process : %d\n", cnt_remote_control_run);
    if (cnt_remote_control_run >= 1)
      printf("remote_control_run : ok!\n");
    else {
      printf("remote_control_run : down, restart again...\n");
      sys_log("remote_control_run : down!");
      system("/ailvgo/system/box/remote_control_run &");
      sleep(5);
    }
  }
  printf("------------run_daemon : over------------\n");
  return 0;
}
```