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

```asm
<main>:
  endbr64
  push   %r15
  mov    $0x7e,%ecx
  pxor   %xmm0,%xmm0
  lea    D123(%rip),%r15
  push   %r14
  lea    D212(%rip),%r14
  push   %r13
  push   %r12
  lea    D80(%rip),%r12
  push   %rbp
  lea    D245(%rip),%rbp
  push   %rbx
  sub    $0x448,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x438(%rsp)
  xor    %eax,%eax
  lea    0x40(%rsp),%rdi
  movaps %xmm0,0x30(%rsp)
  lea    0x30(%rsp),%rbx
  movl   $0x0,0x24(%rsp)
  movl   $0x0,0x28(%rsp)
  movl   $0x0,0x2c(%rsp)
  rep stos %rax,%es:(%rdi)
  mov    %rbp,%rdi
  call   <puts@plt>
  lea    D97(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  lea    D107(%rip),%rbp
  call   <puts@plt>
  lea    0x24(%rsp),%rax
  mov    %rax,0x8(%rsp)
  lea    0x28(%rsp),%rax
  mov    %rax,0x10(%rsp)
  lea    0x2c(%rsp),%rax
  mov    %rax,0x18(%rsp)
  nopl   0x0(%rax,%rax,1)
L111:
  mov    $0x258,%edi
  call   <sleep@plt>
  lea    D89(%rip),%rdi
  call   <puts@plt>
  mov    %r12,%rsi
  lea    D96(%rip),%rdi
  call   <popen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L68
L78:
  mov    $0x400,%edx
  xor    %esi,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    %r13,%rcx
  mov    $0x400,%edx
  mov    %rbx,%rdi
  mov    $0x1,%esi
  call   <fread@plt>
  mov    0x8(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  movb   $0x0,0x42f(%rsp)
  call   <sscanf@plt>
  mov    %r13,%rdi
  call   <pclose@plt>
  mov    0x24(%rsp),%esi
  lea    D144(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x24(%rsp),%ecx
  test   %ecx,%ecx
  jle    L6
  lea    D16(%rip),%rdi
  call   <puts@plt>
L38:
  lea    D23(%rip),%rdi
  call   <puts@plt>
  mov    %r12,%rsi
  lea    D45(%rip),%rdi
  call   <popen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L55
L48:
  mov    $0x400,%edx
  xor    %esi,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    %r13,%rcx
  mov    $0x400,%edx
  mov    %rbx,%rdi
  mov    $0x1,%esi
  call   <fread@plt>
  mov    0x10(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  movb   $0x0,0x42f(%rsp)
  call   <sscanf@plt>
  mov    %r13,%rdi
  call   <pclose@plt>
  mov    0x28(%rsp),%esi
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x28(%rsp),%edx
  test   %edx,%edx
  jle    L117
  lea    D190(%rip),%rdi
  call   <puts@plt>
L59:
  mov    %r15,%rdi
  call   <puts@plt>
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <popen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L23
L86:
  mov    $0x400,%edx
  xor    %esi,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    %r13,%rcx
  mov    $0x400,%edx
  mov    %rbx,%rdi
  mov    $0x1,%esi
  call   <fread@plt>
  mov    0x18(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  movb   $0x0,0x42f(%rsp)
  call   <sscanf@plt>
  mov    %r13,%rdi
  call   <pclose@plt>
  mov    0x2c(%rsp),%esi
  lea    D180(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  jle    L108
  lea    D205(%rip),%rdi
  call   <puts@plt>
  jmp    L111
  cs nopw 0x0(%rax,%rax,1)
L6:
  lea    D202(%rip),%rdi
  call   <puts@plt>
  lea    D19(%rip),%rdi
  call   <sys_log@plt>
  lea    D103(%rip),%rdi
  call   <system@plt>
  mov    $0x5,%edi
  call   <sleep@plt>
  jmp    L38
  nopl   0x0(%rax,%rax,1)
L117:
  lea    D88(%rip),%rdi
  call   <puts@plt>
  lea    D151(%rip),%rdi
  call   <sys_log@plt>
  lea    D155(%rip),%rdi
  call   <system@plt>
  mov    $0x5,%edi
  call   <sleep@plt>
  jmp    L59
  nopl   0x0(%rax,%rax,1)
L108:
  lea    D124(%rip),%rdi
  call   <puts@plt>
  lea    D156(%rip),%rdi
  call   <sys_log@plt>
  lea    D95(%rip),%rdi
  call   <system@plt>
  mov    $0x5,%edi
  call   <sleep@plt>
  jmp    L111
  nopl   0x0(%rax,%rax,1)
L23:
  lea    D264(%rip),%rdi
  call   <puts@plt>
  jmp    L86
  nopl   0x0(%rax)
L68:
  lea    D264(%rip),%rdi
  call   <puts@plt>
  jmp    L78
  nopl   0x0(%rax)
L55:
  lea    D264(%rip),%rdi
  call   <puts@plt>
  jmp    L48
```

tool_calls: name: parse_data
arguments: tag: D123
datatype: string
name: parse_data
arguments: tag: D212
datatype: string
name: parse_data
arguments: tag: D80
datatype: string
name: parse_data
arguments: tag: D245
datatype: string
name: parse_data
arguments: tag: D97
datatype: string
name: parse_data
arguments: tag: D107
datatype: string
name: parse_data
arguments: tag: D89
datatype: string
name: parse_data
arguments: tag: D96
datatype: string
name: parse_data
arguments: tag: D144
datatype: string
name: parse_data
arguments: tag: D16
datatype: string
name: parse_data
arguments: tag: D23
datatype: string
name: parse_data
arguments: tag: D45
datatype: string
name: parse_data
arguments: tag: D0
datatype: string
name: parse_data
arguments: tag: D190
datatype: string
name: parse_data
arguments: tag: D180
datatype: string
name: parse_data
arguments: tag: D205
datatype: string
name: parse_data
arguments: tag: D202
datatype: string
name: parse_data
arguments: tag: D19
datatype: string
name: parse_data
arguments: tag: D103
datatype: string
name: parse_data
arguments: tag: D88
datatype: string
name: parse_data
arguments: tag: D151
datatype: string
name: parse_data
arguments: tag: D155
datatype: string
name: parse_data
arguments: tag: D124
datatype: string
name: parse_data
arguments: tag: D156
datatype: string
name: parse_data
arguments: tag: D95
datatype: string
name: parse_data
arguments: tag: D264
datatype: string

tool: D123: ---------check remote_control_run-----------

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

tool: D80: r

tool: D245: **********************************

tool: D97: run_daemon : start

tool: D107: %d

tool: D89: ---------check network_monitor_run-----------

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

tool: D144: network_monitor_run process : %d


tool: D16: network_monitor_run : ok!

tool: D23: ---------check heart_beat_run-----------

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

tool: D0: heart_beat_run process : %d


tool: D190: heart_beat_run : ok!

tool: D180: remote_control_run process : %d


tool: D205: remote_control_run : ok!

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

tool: D19: network_monitor_run : down!

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

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

tool: D151: heart_beat_run : down!

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

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

tool: D156: remote_control_run : down!

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

tool: D264: popen failed

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;
}
```