user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  mov    $0x7e,%ecx
  pxor   %xmm0,%xmm0
  lea    D268(%rip),%r15
  push   %r14
  lea    D236(%rip),%r14
  push   %r13
  push   %r12
  lea    D38(%rip),%r12
  push   %rbp
  lea    D263(%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    D64(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  lea    D11(%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)
L6:
  mov    $0x258,%edi
  call   <sleep@plt>
  lea    D4(%rip),%rdi
  call   <puts@plt>
  mov    %r12,%rsi
  lea    D99(%rip),%rdi
  call   <popen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L115
L129:
  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    D259(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x24(%rsp),%ecx
  test   %ecx,%ecx
  jle    L35
  lea    D61(%rip),%rdi
  call   <puts@plt>
L104:
  lea    D50(%rip),%rdi
  call   <puts@plt>
  mov    %r12,%rsi
  lea    D216(%rip),%rdi
  call   <popen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L99
L16:
  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    D130(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x28(%rsp),%edx
  test   %edx,%edx
  jle    L69
  lea    D106(%rip),%rdi
  call   <puts@plt>
L84:
  mov    %r15,%rdi
  call   <puts@plt>
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <popen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L30
L67:
  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    D190(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  jle    L32
  lea    D147(%rip),%rdi
  call   <puts@plt>
  jmp    L6
  cs nopw 0x0(%rax,%rax,1)
L35:
  lea    D204(%rip),%rdi
  call   <puts@plt>
  lea    D32(%rip),%rdi
  call   <sys_log@plt>
  lea    D219(%rip),%rdi
  call   <system@plt>
  mov    $0x5,%edi
  call   <sleep@plt>
  jmp    L104
  nopl   0x0(%rax,%rax,1)
L69:
  lea    D89(%rip),%rdi
  call   <puts@plt>
  lea    D162(%rip),%rdi
  call   <sys_log@plt>
  lea    D42(%rip),%rdi
  call   <system@plt>
  mov    $0x5,%edi
  call   <sleep@plt>
  jmp    L84
  nopl   0x0(%rax,%rax,1)
L32:
  lea    D28(%rip),%rdi
  call   <puts@plt>
  lea    D199(%rip),%rdi
  call   <sys_log@plt>
  lea    D74(%rip),%rdi
  call   <system@plt>
  mov    $0x5,%edi
  call   <sleep@plt>
  jmp    L6
  nopl   0x0(%rax,%rax,1)
L30:
  lea    D153(%rip),%rdi
  call   <puts@plt>
  jmp    L67
  nopl   0x0(%rax)
L115:
  lea    D153(%rip),%rdi
  call   <puts@plt>
  jmp    L129
  nopl   0x0(%rax)
L99:
  lea    D153(%rip),%rdi
  call   <puts@plt>
  jmp    L16
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D268
type: string
name: extract_symbolic_data
arguments: data_label: D236
type: string
name: extract_symbolic_data
arguments: data_label: D38
type: string
name: extract_symbolic_data
arguments: data_label: D263
type: string
name: extract_symbolic_data
arguments: data_label: D64
type: string
name: extract_symbolic_data
arguments: data_label: D11
type: string
name: extract_symbolic_data
arguments: data_label: D4
type: string
name: extract_symbolic_data
arguments: data_label: D99
type: string
name: extract_symbolic_data
arguments: data_label: D259
type: string
name: extract_symbolic_data
arguments: data_label: D61
type: string
name: extract_symbolic_data
arguments: data_label: D50
type: string
name: extract_symbolic_data
arguments: data_label: D216
type: string
name: extract_symbolic_data
arguments: data_label: D130
type: string
name: extract_symbolic_data
arguments: data_label: D106
type: string
name: extract_symbolic_data
arguments: data_label: D190
type: string
name: extract_symbolic_data
arguments: data_label: D147
type: string
name: extract_symbolic_data
arguments: data_label: D204
type: string
name: extract_symbolic_data
arguments: data_label: D32
type: string
name: extract_symbolic_data
arguments: data_label: D219
type: string
name: extract_symbolic_data
arguments: data_label: D89
type: string
name: extract_symbolic_data
arguments: data_label: D162
type: string
name: extract_symbolic_data
arguments: data_label: D42
type: string
name: extract_symbolic_data
arguments: data_label: D28
type: string
name: extract_symbolic_data
arguments: data_label: D199
type: string
name: extract_symbolic_data
arguments: data_label: D74
type: string
name: extract_symbolic_data
arguments: data_label: D153
type: string

tool: D268: ---------check remote_control_run-----------

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

tool: D38: r

tool: D263: **********************************

tool: D64: run_daemon : start

tool: D11: %d

tool: D4: ---------check network_monitor_run-----------

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

tool: D259: network_monitor_run process : %d


tool: D61: network_monitor_run : ok!

tool: D50: ---------check heart_beat_run-----------

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

tool: D130: heart_beat_run process : %d


tool: D106: heart_beat_run : ok!

tool: D190: remote_control_run process : %d


tool: D147: remote_control_run : ok!

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

tool: D32: network_monitor_run : down!

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

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

tool: D162: heart_beat_run : down!

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

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

tool: D199: remote_control_run : down!

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

tool: D153: 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;
}
```