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

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  cmp    $0x3,%edi
  jle    L48
L57:
  mov    0x8(%rbx),%rdi
  call   <atoi@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  je     L26
L2:
  lea    D18(%rip),%rdi
  call   <unsetenv@plt>
  lea    D103(%rip),%rdi
  call   <unsetenv@plt>
  lea    D148(%rip),%rdi
  call   <unsetenv@plt>
  lea    D50(%rip),%rdi
  call   <unsetenv@plt>
  lea    D175(%rip),%rdi
  call   <unsetenv@plt>
  lea    D22(%rip),%rdi
  call   <unsetenv@plt>
  lea    D86(%rip),%rdi
  call   <unsetenv@plt>
  lea    D87(%rip),%rdi
  call   <unsetenv@plt>
  lea    D140(%rip),%rdi
  call   <unsetenv@plt>
  lea    D165(%rip),%rdi
  call   <unsetenv@plt>
  lea    D158(%rip),%rdi
  call   <unsetenv@plt>
  lea    D10(%rip),%rdi
  call   <unsetenv@plt>
  lea    D134(%rip),%rdi
  call   <unsetenv@plt>
  lea    D2(%rip),%rdi
  call   <unsetenv@plt>
  lea    D171(%rip),%rdi
  call   <unsetenv@plt>
  lea    D53(%rip),%rdi
  call   <unsetenv@plt>
  xor    %esi,%esi
  xor    %edi,%edi
  call   <daemon@plt>
  cmp    $0xffffffff,%eax
  je     L43
L79:
  mov    0x10(%rbx),%rdi
  lea    D116(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L11
  xor    %eax,%eax
  call   <getpid@plt>
  mov    %r12,%rdi
  lea    D111(%rip),%rsi
  mov    %eax,%edx
  call   <fprintf@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  nopl   (%rax)
L11:
  mov    %ebp,%edi
  call   <sleep@plt>
  mov    0x18(%rbx),%rdi
  call   <system@plt>
  jmp    L11
L48:
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L57
L26:
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L2
L43:
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L79
```

tool_calls: name: parse_data
arguments: label: D18
data_type: string
name: parse_data
arguments: label: D103
data_type: string
name: parse_data
arguments: label: D148
data_type: string
name: parse_data
arguments: label: D50
data_type: string
name: parse_data
arguments: label: D175
data_type: string
name: parse_data
arguments: label: D22
data_type: string
name: parse_data
arguments: label: D86
data_type: string
name: parse_data
arguments: label: D87
data_type: string
name: parse_data
arguments: label: D140
data_type: string
name: parse_data
arguments: label: D165
data_type: string
name: parse_data
arguments: label: D158
data_type: string
name: parse_data
arguments: label: D10
data_type: string
name: parse_data
arguments: label: D134
data_type: string
name: parse_data
arguments: label: D2
data_type: string
name: parse_data
arguments: label: D171
data_type: string
name: parse_data
arguments: label: D53
data_type: string
name: parse_data
arguments: label: D116
data_type: string
name: parse_data
arguments: label: D111
data_type: string

tool: D18: CONTENT_TYPE

tool: D103: GATEWAY_INTERFACE

tool: D148: REMOTE_USER

tool: D50: REMOTE_ADDR

tool: D175: AUTH_TYPE

tool: D22: SCRIPT_FILENAME

tool: D86: CONTENT_LENGTH

tool: D87: HTTP_USER_AGENT

tool: D140: HTTP_HOST

tool: D165: SERVER_SOFTWARE

tool: D158: HTTP_REFERER

tool: D10: SERVER_PROTOCOL

tool: D134: REQUEST_METHOD

tool: D2: SERVER_PORT

tool: D171: SCRIPT_NAME

tool: D53: SERVER_NAME

tool: D116: w

tool: D111: %d


assistant: ```c
int main(int argc, char *argv[]) {
  int interval;
  FILE *pidfd;
  if (argc < 4)
    exit(1);
  interval = atoi(argv[1]);
  if (interval == 0)
    exit(1);
  unsetenv("CONTENT_TYPE");
  unsetenv("GATEWAY_INTERFACE");
  unsetenv("REMOTE_USER");
  unsetenv("REMOTE_ADDR");
  unsetenv("AUTH_TYPE");
  unsetenv("SCRIPT_FILENAME");
  unsetenv("CONTENT_LENGTH");
  unsetenv("HTTP_USER_AGENT");
  unsetenv("HTTP_HOST");
  unsetenv("SERVER_SOFTWARE");
  unsetenv("HTTP_REFERER");
  unsetenv("SERVER_PROTOCOL");
  unsetenv("REQUEST_METHOD");
  unsetenv("SERVER_PORT");
  unsetenv("SCRIPT_NAME");
  unsetenv("SERVER_NAME");
  if (daemon(0, 0) == -1)
    exit(1);
  pidfd = fopen(argv[2], "w");
  if (pidfd) {
    fprintf(pidfd, "%d\n", getpid());
    fclose(pidfd);
  }
  while (1) {
    sleep(interval);
    system(argv[3]);
  }
}
```