#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strtok(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  char check_name[1024];
  char ent_type[1024];
  char input_buffer[1024];
  char host_name[1024];
  char service_name[1024];
  char state[1024];
  char state_type[1024];
  char temp_input[1024];
  char temp_string[1024];
  char test_host[1024];
  char *temp_var;
  FILE *command_fp;
  FILE *services_fp;
  int attempt;
  int i;
  time_t current_time;
  strcpy(state, argv[1]);
  strcpy(state_type, argv[2]);
  attempt = atoi(argv[3]);
  strcpy(host_name, argv[4]);
  if (strcmp(state, "OK") == 0) {
    services_fp = fopen("/usr/local/nagios/etc/services.cfg", "r");
    command_fp = fopen("/usr/local/nagios/var/rw/nagios.cmd", "a");
    while ((fgets(input_buffer, 1024 - 1, services_fp)) != NULL) {
      if (input_buffer[0] == '#' || input_buffer[0] == '\x0' ||
          input_buffer[0] == '\n' || input_buffer[0] == '\r') {
        continue;
      } else {
        strcpy(temp_input, input_buffer);
        strcpy(temp_string, strtok(temp_input, "="));
        strcpy(ent_type, strtok(temp_string, "["));
        if (strcmp(ent_type, "service") == 0) {
          strcpy(test_host, strtok(NULL, "]"));
          if (strcmp(test_host, host_name) == 0) {
            temp_var = strtok(input_buffer, "=");
            strcpy(service_name, strtok(NULL, ";"));
            for (i = 1; i <= 12; i++) {
              temp_var = strtok(NULL, ";");
            }
            strcpy(check_name, strtok(temp_var, "!"));
            if (strcmp(check_name, "check_nrpe") == 0) {
              time(&current_time);
              fprintf(command_fp, "[%lu] ENABLE_SVC_CHECK;%s;%s\n",
                      current_time, host_name, service_name);
            }
          }
        }
      }
    }
    fclose(command_fp);
    fclose(services_fp);
  } else if (strcmp(state, "CRITICAL") == 0) {
    if (attempt == 3) {
      services_fp = fopen("/usr/local/nagios/etc/services.cfg", "r");
      command_fp = fopen("/usr/local/nagios/var/rw/nagios.cmd", "a");
      while ((fgets(input_buffer, 1024 - 1, services_fp)) != NULL) {
        if (input_buffer[0] == '#' || input_buffer[0] == '\x0' ||
            input_buffer[0] == '\n' || input_buffer[0] == '\r') {
          continue;
        } else {
          strcpy(temp_input, input_buffer);
          strcpy(temp_string, strtok(temp_input, "="));
          strcpy(ent_type, strtok(temp_string, "["));
          if (strcmp(ent_type, "service") == 0) {
            strcpy(test_host, strtok(NULL, "]"));
            if (strcmp(test_host, host_name) == 0) {
              temp_var = strtok(input_buffer, "=");
              strcpy(service_name, strtok(NULL, ";"));
              for (i = 1; i <= 12; i++) {
                temp_var = strtok(NULL, ";");
              }
              strcpy(check_name, strtok(temp_var, "!"));
              if (strcmp(check_name, "check_nrpe") == 0) {
                time(&current_time);
                fprintf(command_fp, "[%lu] DISABLE_SVC_CHECK;%s;%s\n",
                        current_time, host_name, service_name);
              }
            }
          }
        }
      }
      fclose(command_fp);
      fclose(services_fp);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2890,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1810(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x1c10(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x282c(%rbp)
lea    -0x1010(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x1810(%rbp),%rdi
lea    0xdfa(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    14c4 <main+0x334>
lea    0xde7(%rip),%rdi
lea    0xe03(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x2828(%rbp)
lea    0xdf2(%rip),%rdi
lea    0xe0f(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x2820(%rbp)
lea    -0xc10(%rbp),%rdi
mov    -0x2828(%rbp),%rdx
mov    $0x3ff,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     14a7 <main+0x317>
movsbl -0xc10(%rbp),%eax
cmp    $0x23,%eax
je     12ab <main+0x11b>
movsbl -0xc10(%rbp),%eax
cmp    $0x0,%eax
je     12ab <main+0x11b>
movsbl -0xc10(%rbp),%eax
cmp    $0xa,%eax
je     12ab <main+0x11b>
movsbl -0xc10(%rbp),%eax
cmp    $0xd,%eax
jne    12b0 <main+0x120>
jmp    1249 <main+0xb9>
lea    -0x2010(%rbp),%rdi
lea    -0xc10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x2410(%rbp),%rax
mov    %rax,-0x2848(%rbp)
lea    -0x2010(%rbp),%rdi
lea    0xd6f(%rip),%rsi
call   10a0 <strtok@plt>
mov    -0x2848(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x810(%rbp),%rax
mov    %rax,-0x2840(%rbp)
lea    -0x2410(%rbp),%rdi
lea    0xd41(%rip),%rsi
call   10a0 <strtok@plt>
mov    -0x2840(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x810(%rbp),%rdi
lea    0xd21(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    149d <main+0x30d>
lea    -0x2810(%rbp),%rax
mov    %rax,-0x2850(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xd01(%rip),%rsi
call   10a0 <strtok@plt>
mov    -0x2850(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x2810(%rbp),%rdi
lea    -0x1010(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1498 <main+0x308>
lea    -0xc10(%rbp),%rdi
lea    0xcb6(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x2818(%rbp)
lea    -0x1410(%rbp),%rax
mov    %rax,-0x2858(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc9f(%rip),%rsi
call   10a0 <strtok@plt>
mov    -0x2858(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
movl   $0x1,-0x2830(%rbp)
cmpl   $0xc,-0x2830(%rbp)
jg     1413 <main+0x283>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc69(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x2818(%rbp)
mov    -0x2830(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2830(%rbp)
jmp    13db <main+0x24b>
lea    -0x410(%rbp),%rax
mov    %rax,-0x2860(%rbp)
mov    -0x2818(%rbp),%rdi
lea    0xc2f(%rip),%rsi
call   10a0 <strtok@plt>
mov    -0x2860(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x410(%rbp),%rdi
lea    0xc0f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1493 <main+0x303>
lea    -0x2834(%rbp),%rdi
call   1080 <time@plt>
mov    -0x2820(%rbp),%rdi
mov    -0x2834(%rbp),%edx
lea    -0x1010(%rbp),%rcx
lea    -0x1410(%rbp),%r8
lea    0xbdd(%rip),%rsi
call   1070 <fprintf@plt>
jmp    1498 <main+0x308>
jmp    149d <main+0x30d>
jmp    14a2 <main+0x312>
jmp    1249 <main+0xb9>
mov    -0x2820(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x2828(%rbp),%rdi
call   1040 <fclose@plt>
jmp    17a2 <main+0x612>
lea    -0x1810(%rbp),%rdi
lea    0xbb7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    179d <main+0x60d>
cmpl   $0x3,-0x282c(%rbp)
jne    1798 <main+0x608>
lea    0xb0e(%rip),%rdi
lea    0xb2a(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x2828(%rbp)
lea    0xb19(%rip),%rdi
lea    0xb36(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x2820(%rbp)
lea    -0xc10(%rbp),%rdi
mov    -0x2828(%rbp),%rdx
mov    $0x3ff,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1780 <main+0x5f0>
movsbl -0xc10(%rbp),%eax
cmp    $0x23,%eax
je     1584 <main+0x3f4>
movsbl -0xc10(%rbp),%eax
cmp    $0x0,%eax
je     1584 <main+0x3f4>
movsbl -0xc10(%rbp),%eax
cmp    $0xa,%eax
je     1584 <main+0x3f4>
movsbl -0xc10(%rbp),%eax
cmp    $0xd,%eax
jne    1589 <main+0x3f9>
jmp    1522 <main+0x392>
lea    -0x2010(%rbp),%rdi
lea    -0xc10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x2410(%rbp),%rax
mov    %rax,-0x2870(%rbp)
lea    -0x2010(%rbp),%rdi
lea    0xa96(%rip),%rsi
call   10a0 <strtok@plt>
mov    -0x2870(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x810(%rbp),%rax
mov    %rax,-0x2868(%rbp)
lea    -0x2410(%rbp),%rdi
lea    0xa68(%rip),%rsi
call   10a0 <strtok@plt>
mov    -0x2868(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x810(%rbp),%rdi
lea    0xa48(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1776 <main+0x5e6>
lea    -0x2810(%rbp),%rax
mov    %rax,-0x2878(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xa28(%rip),%rsi
call   10a0 <strtok@plt>
mov    -0x2878(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x2810(%rbp),%rdi
lea    -0x1010(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1771 <main+0x5e1>
lea    -0xc10(%rbp),%rdi
lea    0x9dd(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x2818(%rbp)
lea    -0x1410(%rbp),%rax
mov    %rax,-0x2880(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0x9c6(%rip),%rsi
call   10a0 <strtok@plt>
mov    -0x2880(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
movl   $0x1,-0x2830(%rbp)
cmpl   $0xc,-0x2830(%rbp)
jg     16ec <main+0x55c>
xor    %eax,%eax
mov    %eax,%edi
lea    0x990(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x2818(%rbp)
mov    -0x2830(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2830(%rbp)
jmp    16b4 <main+0x524>
lea    -0x410(%rbp),%rax
mov    %rax,-0x2888(%rbp)
mov    -0x2818(%rbp),%rdi
lea    0x956(%rip),%rsi
call   10a0 <strtok@plt>
mov    -0x2888(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x410(%rbp),%rdi
lea    0x936(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    176c <main+0x5dc>
lea    -0x2834(%rbp),%rdi
call   1080 <time@plt>
mov    -0x2820(%rbp),%rdi
mov    -0x2834(%rbp),%edx
lea    -0x1010(%rbp),%rcx
lea    -0x1410(%rbp),%r8
lea    0x92b(%rip),%rsi
call   1070 <fprintf@plt>
jmp    1771 <main+0x5e1>
jmp    1776 <main+0x5e6>
jmp    177b <main+0x5eb>
jmp    1522 <main+0x392>
mov    -0x2820(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x2828(%rbp),%rdi
call   1040 <fclose@plt>
jmp    179d <main+0x60d>
jmp    17a2 <main+0x612>
xor    %eax,%eax
add    $0x2890,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2818,%rsp
mov    %rsi,%rbp
mov    0x8(%rsi),%rsi
lea    0x1810(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    0x10(%rbp),%rsi
lea    0x2410(%rsp),%rdi
call   1030 <strcpy@plt>
mov    0x18(%rbp),%rdi
call   10b0 <atoi@plt>
mov    %eax,%r14d
mov    0x20(%rbp),%rsi
lea    0x410(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xe13(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     14ad <main+0x31d>
lea    0xe84(%rip),%rsi
lea    0x1810(%rsp),%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1752 <main+0x5c2>
cmp    $0x3,%r14d
jne    1752 <main+0x5c2>
lea    0xdd7(%rip),%rdi
lea    0xdf3(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%r12
lea    0xde6(%rip),%rdi
lea    0xe03(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbp
lea    0x10(%rsp),%rdi
mov    $0x3ff,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     1742 <main+0x5b2>
mov    %rbp,0x8(%rsp)
lea    0x1410(%rsp),%rbp
lea    0x10(%rsp),%r13
lea    0x1010(%rsp),%r15
lea    0x1c10(%rsp),%r14
movabs $0x800002401,%rbx
jmp    1319 <main+0x189>
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
lea    0xd99(%rip),%rsi
call   10a0 <strtok@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
lea    0xd81(%rip),%rsi
call   10a0 <strtok@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
lea    0xd69(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1333 <main+0x1a3>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
mov    $0x3ff,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     173d <main+0x5ad>
movzbl 0x10(%rsp),%eax
cmp    $0x23,%rax
ja     12a0 <main+0x110>
bt     %rax,%rbx
jb     1300 <main+0x170>
jmp    12a0 <main+0x110>
xor    %edi,%edi
lea    0xd1e(%rip),%rsi
call   10a0 <strtok@plt>
mov    %r14,%r13
mov    %r15,%r14
lea    0xc10(%rsp),%r15
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %r14,%r15
mov    %r13,%r14
lea    0x10(%rsp),%r13
movabs $0x800002401,%rbx
lea    0x410(%rsp),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1300 <main+0x170>
mov    %r13,%rdi
lea    0xcbc(%rip),%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
lea    0xcbc(%rip),%r13
mov    %r13,%rsi
call   10a0 <strtok@plt>
lea    0x810(%rsp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
mov    %rax,%rdi
lea    0xc24(%rip),%rsi
call   10a0 <strtok@plt>
lea    0x2010(%rsp),%r13
mov    %r13,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r13,%rdi
lea    0x10(%rsp),%r13
movabs $0x800002401,%rbx
lea    0xbf5(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1300 <main+0x170>
lea    0x4(%rsp),%rdi
call   1080 <time@plt>
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%rdi
lea    0xbff(%rip),%rsi
lea    0x410(%rsp),%rcx
lea    0x810(%rsp),%r8
call   1070 <fprintf@plt>
jmp    1300 <main+0x170>
lea    0xb4f(%rip),%rdi
lea    0xb6b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%r12
lea    0xb5e(%rip),%rdi
lea    0xb7b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbp
lea    0x10(%rsp),%rdi
mov    $0x3ff,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     1742 <main+0x5b2>
mov    %rbp,0x8(%rsp)
lea    0x1410(%rsp),%rbp
lea    0x10(%rsp),%r13
lea    0x1010(%rsp),%r15
lea    0x1c10(%rsp),%r14
movabs $0x800002401,%rbx
jmp    15a9 <main+0x419>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
lea    0xb09(%rip),%rsi
call   10a0 <strtok@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
lea    0xaf1(%rip),%rsi
call   10a0 <strtok@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
lea    0xad9(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     15c3 <main+0x433>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
mov    $0x3ff,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     173d <main+0x5ad>
movzbl 0x10(%rsp),%eax
cmp    $0x23,%rax
ja     1530 <main+0x3a0>
bt     %rax,%rbx
jb     1590 <main+0x400>
jmp    1530 <main+0x3a0>
xor    %edi,%edi
lea    0xa8e(%rip),%rsi
call   10a0 <strtok@plt>
mov    %r14,%r13
mov    %r15,%r14
lea    0xc10(%rsp),%r15
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %r14,%r15
mov    %r13,%r14
lea    0x10(%rsp),%r13
movabs $0x800002401,%rbx
lea    0x410(%rsp),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1590 <main+0x400>
mov    %r13,%rdi
lea    0xa2c(%rip),%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
lea    0xa2c(%rip),%r13
mov    %r13,%rsi
call   10a0 <strtok@plt>
lea    0x810(%rsp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   10a0 <strtok@plt>
mov    %rax,%rdi
lea    0x994(%rip),%rsi
call   10a0 <strtok@plt>
lea    0x2010(%rsp),%r13
mov    %r13,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r13,%rdi
lea    0x10(%rsp),%r13
movabs $0x800002401,%rbx
lea    0x965(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1590 <main+0x400>
lea    0x4(%rsp),%rdi
call   1080 <time@plt>
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%rdi
lea    0x948(%rip),%rsi
lea    0x410(%rsp),%rcx
lea    0x810(%rsp),%r8
call   1070 <fprintf@plt>
jmp    1590 <main+0x400>
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x2818,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
@.str.1 = [35 x i8] c"/usr/local/nagios/etc/services.cfg\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [36 x i8] c"/usr/local/nagios/var/rw/nagios.cmd\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [2 x i8] c"=\00"
@.str.6 = [2 x i8] c"[\00"
@.str.7 = [8 x i8] c"service\00"
@.str.8 = [2 x i8] c"]\00"
@.str.9 = [2 x i8] c";\00"
@.str.10 = [2 x i8] c"!\00"
@.str.11 = [11 x i8] c"check_nrpe\00"
@.str.12 = [30 x i8] c"[%lu] ENABLE_SVC_CHECK;%s;%s\0A\00"
@.str.13 = [9 x i8] c"CRITICAL\00"
@.str.14 = [31 x i8] c"[%lu] DISABLE_SVC_CHECK;%s;%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
%7 = alloca [1024 x i8]
%8 = alloca [1024 x i8]
%9 = alloca [1024 x i8]
%10 = alloca [1024 x i8]
%11 = alloca [1024 x i8]
%12 = alloca [1024 x i8]
%13 = alloca [1024 x i8]
%14 = alloca [1024 x i8]
%15 = alloca [1024 x i8]
%16 = alloca i8*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @strcpy(i8* %22, i8* %25)
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @strcpy(i8* %27, i8* %30)
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 3
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %19
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 4
%39 = load i8*, i8** %38
%40 = call i32 @strcpy(i8* %36, i8* %39)
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %134
44: ; preds = %2
%45 = call i32* @fopen(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %45, i32** %18
%46 = call i32* @fopen(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %46, i32** %17
br label %47
47: ; preds = %128, %72, %44
%48 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%49 = load i32*, i32** %18
%50 = call i32* @fgets(i8* %48, i32 1023, i32* %49)
%51 = icmp ne i32* %50, null
br i1 %51, label %52, label %129
52: ; preds = %47
%53 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 35
br i1 %56, label %72, label %57
57: ; preds = %52
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 0
br i1 %61, label %72, label %62
62: ; preds = %57
%63 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 10
br i1 %66, label %72, label %67
67: ; preds = %62
%68 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 13
br i1 %71, label %72, label %73
72: ; preds = %67, %62, %57, %52
br label %47
73: ; preds = %67
%74 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%76 = call i32 @strcpy(i8* %74, i8* %75)
%77 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%78 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%79 = call i8* @strtok(i8* %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%80 = call i32 @strcpy(i8* %77, i8* %79)
%81 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%82 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%83 = call i8* @strtok(i8* %82, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%84 = call i32 @strcpy(i8* %81, i8* %83)
%85 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%86 = call i64 @strcmp(i8* %85, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %127
88: ; preds = %73
%89 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%90 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%91 = call i32 @strcpy(i8* %89, i8* %90)
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%93 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%94 = call i64 @strcmp(i8* %92, i8* %93)
%95 = icmp eq i64 %94, 0
br i1 %95, label %96, label %126
96: ; preds = %88
%97 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%98 = call i8* @strtok(i8* %97, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i8* %98, i8** %16
%99 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%100 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%101 = call i32 @strcpy(i8* %99, i8* %100)
store i32 1, i32* %20
br label %102
102: ; preds = %107, %96
%103 = load i32, i32* %20
%104 = icmp sle i32 %103, 12
br i1 %104, label %105, label %110
105: ; preds = %102
%106 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i8* %106, i8** %16
br label %107
107: ; preds = %105
%108 = load i32, i32* %20
%109 = add nsw i32 %108, 1
store i32 %109, i32* %20
br label %102
110: ; preds = %102
%111 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%112 = load i8*, i8** %16
%113 = call i8* @strtok(i8* %112, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%114 = call i32 @strcpy(i8* %111, i8* %113)
%115 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%116 = call i64 @strcmp(i8* %115, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %125
118: ; preds = %110
%119 = call i32 @time(i32* %21)
%120 = load i32*, i32** %17
%121 = load i32, i32* %21
%122 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%123 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%124 = call i32 @fprintf(i32* %120, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i32 %121, i8* %122, i8* %123)
br label %125
125: ; preds = %118, %110
br label %126
126: ; preds = %125, %88
br label %127
127: ; preds = %126, %73
br label %128
128: ; preds = %127
br label %47
129: ; preds = %47
%130 = load i32*, i32** %17
%131 = call i32 @fclose(i32* %130)
%132 = load i32*, i32** %18
%133 = call i32 @fclose(i32* %132)
br label %233
134: ; preds = %2
%135 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%136 = call i64 @strcmp(i8* %135, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%137 = icmp eq i64 %136, 0
br i1 %137, label %138, label %232
138: ; preds = %134
%139 = load i32, i32* %19
%140 = icmp eq i32 %139, 3
br i1 %140, label %141, label %231
141: ; preds = %138
%142 = call i32* @fopen(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %142, i32** %18
%143 = call i32* @fopen(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %143, i32** %17
br label %144
144: ; preds = %225, %169, %141
%145 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%146 = load i32*, i32** %18
%147 = call i32* @fgets(i8* %145, i32 1023, i32* %146)
%148 = icmp ne i32* %147, null
br i1 %148, label %149, label %226
149: ; preds = %144
%150 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%151 = load i8, i8* %150
%152 = sext i8 %151 to i32
%153 = icmp eq i32 %152, 35
br i1 %153, label %169, label %154
154: ; preds = %149
%155 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
%158 = icmp eq i32 %157, 0
br i1 %158, label %169, label %159
159: ; preds = %154
%160 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%161 = load i8, i8* %160
%162 = sext i8 %161 to i32
%163 = icmp eq i32 %162, 10
br i1 %163, label %169, label %164
164: ; preds = %159
%165 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%166 = load i8, i8* %165
%167 = sext i8 %166 to i32
%168 = icmp eq i32 %167, 13
br i1 %168, label %169, label %170
169: ; preds = %164, %159, %154, %149
br label %144
170: ; preds = %164
%171 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%172 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%173 = call i32 @strcpy(i8* %171, i8* %172)
%174 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%175 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%176 = call i8* @strtok(i8* %175, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%177 = call i32 @strcpy(i8* %174, i8* %176)
%178 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%179 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%180 = call i8* @strtok(i8* %179, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%181 = call i32 @strcpy(i8* %178, i8* %180)
%182 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%183 = call i64 @strcmp(i8* %182, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%184 = icmp eq i64 %183, 0
br i1 %184, label %185, label %224
185: ; preds = %170
%186 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%187 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%188 = call i32 @strcpy(i8* %186, i8* %187)
%189 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%190 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%191 = call i64 @strcmp(i8* %189, i8* %190)
%192 = icmp eq i64 %191, 0
br i1 %192, label %193, label %223
193: ; preds = %185
%194 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%195 = call i8* @strtok(i8* %194, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i8* %195, i8** %16
%196 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%197 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%198 = call i32 @strcpy(i8* %196, i8* %197)
store i32 1, i32* %20
br label %199
199: ; preds = %204, %193
%200 = load i32, i32* %20
%201 = icmp sle i32 %200, 12
br i1 %201, label %202, label %207
202: ; preds = %199
%203 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i8* %203, i8** %16
br label %204
204: ; preds = %202
%205 = load i32, i32* %20
%206 = add nsw i32 %205, 1
store i32 %206, i32* %20
br label %199
207: ; preds = %199
%208 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%209 = load i8*, i8** %16
%210 = call i8* @strtok(i8* %209, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%211 = call i32 @strcpy(i8* %208, i8* %210)
%212 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%213 = call i64 @strcmp(i8* %212, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%214 = icmp eq i64 %213, 0
br i1 %214, label %215, label %222
215: ; preds = %207
%216 = call i32 @time(i32* %21)
%217 = load i32*, i32** %17
%218 = load i32, i32* %21
%219 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%220 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%221 = call i32 @fprintf(i32* %217, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), i32 %218, i8* %219, i8* %220)
br label %222
222: ; preds = %215, %207
br label %223
223: ; preds = %222, %185
br label %224
224: ; preds = %223, %170
br label %225
225: ; preds = %224
br label %144
226: ; preds = %144
%227 = load i32*, i32** %17
%228 = call i32 @fclose(i32* %227)
%229 = load i32*, i32** %18
%230 = call i32 @fclose(i32* %229)
br label %231
231: ; preds = %226, %138
br label %232
232: ; preds = %231, %134
br label %233
233: ; preds = %232, %129
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
@.str.1 = [35 x i8] c"/usr/local/nagios/etc/services.cfg\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [36 x i8] c"/usr/local/nagios/var/rw/nagios.cmd\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [2 x i8] c"=\00"
@.str.6 = [2 x i8] c"[\00"
@.str.7 = [8 x i8] c"service\00"
@.str.8 = [2 x i8] c"]\00"
@.str.9 = [2 x i8] c";\00"
@.str.10 = [2 x i8] c"!\00"
@.str.11 = [11 x i8] c"check_nrpe\00"
@.str.12 = [30 x i8] c"[%lu] ENABLE_SVC_CHECK;%s;%s\0A\00"
@.str.13 = [9 x i8] c"CRITICAL\00"
@.str.14 = [31 x i8] c"[%lu] DISABLE_SVC_CHECK;%s;%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca [1024 x i8]
%7 = alloca [1024 x i8]
%8 = alloca [1024 x i8]
%9 = alloca [1024 x i8]
%10 = alloca [1024 x i8]
%11 = alloca [1024 x i8]
%12 = alloca [1024 x i8]
%13 = alloca i32
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%24 = bitcast i32* %13 to i8*
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @strcpy(i8* %19, i8* %26)
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = call i32 @strcpy(i8* %20, i8* %29)
%31 = getelementptr inbounds i8*, i8** %1, i64 3
%32 = load i8*, i8** %31
%33 = call i32 @atoi(i8* %32)
%34 = getelementptr inbounds i8*, i8** %1, i64 4
%35 = load i8*, i8** %34
%36 = call i32 @strcpy(i8* %17, i8* %35)
%37 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %86
39: ; preds = %2
%40 = call i32* @fopen(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%41 = call i32* @fopen(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%42 = call i32* @fgets(i8* %16, i32 1023, i32* %40)
%43 = icmp eq i32* %42, null
br i1 %43, label %138, label %44
44: ; preds = %39, %83
%45 = load i8, i8* %16
switch i8 %45, label %46 [
i8 35, label %83
i8 13, label %83
i8 10, label %83
i8 0, label %83
]
46: ; preds = %44
%47 = call i32 @strcpy(i8* %21, i8* %16)
%48 = call i8* @strtok(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%49 = call i32 @strcpy(i8* %22, i8* %48)
%50 = call i8* @strtok(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%51 = call i32 @strcpy(i8* %15, i8* %50)
%52 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %83
54: ; preds = %46
%55 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%56 = call i32 @strcpy(i8* %23, i8* %55)
%57 = call i64 @strcmp(i8* %23, i8* %17)
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %83
59: ; preds = %54
%60 = call i8* @strtok(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%61 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%62 = call i32 @strcpy(i8* %18, i8* %61)
%63 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%64 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%65 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%66 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%67 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%68 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%69 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%70 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%71 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%72 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%73 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%74 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%75 = call i8* @strtok(i8* %74, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%76 = call i32 @strcpy(i8* %14, i8* %75)
%77 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %83
79: ; preds = %59
%80 = call i32 @time(i32* %13)
%81 = load i32, i32* %13
%82 = call i32 @fprintf(i32* %41, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i32 %81, i8* %17, i8* %18)
br label %83
83: ; preds = %54, %79, %59, %46, %44, %44, %44, %44
%84 = call i32* @fgets(i8* %16, i32 1023, i32* %40)
%85 = icmp eq i32* %84, null
br i1 %85, label %138, label %44
86: ; preds = %2
%87 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%88 = icmp eq i64 %87, 0
%89 = icmp eq i32 %33, 3
%90 = select i1 %88, i1 %89, i1 false
br i1 %90, label %91, label %143
91: ; preds = %86
%92 = call i32* @fopen(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%93 = call i32* @fopen(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%94 = call i32* @fgets(i8* %16, i32 1023, i32* %92)
%95 = icmp eq i32* %94, null
br i1 %95, label %138, label %96
96: ; preds = %91, %135
%97 = load i8, i8* %16
switch i8 %97, label %98 [
i8 35, label %135
i8 13, label %135
i8 10, label %135
i8 0, label %135
]
98: ; preds = %96
%99 = call i32 @strcpy(i8* %21, i8* %16)
%100 = call i8* @strtok(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%101 = call i32 @strcpy(i8* %22, i8* %100)
%102 = call i8* @strtok(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%103 = call i32 @strcpy(i8* %15, i8* %102)
%104 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%105 = icmp eq i64 %104, 0
br i1 %105, label %106, label %135
106: ; preds = %98
%107 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%108 = call i32 @strcpy(i8* %23, i8* %107)
%109 = call i64 @strcmp(i8* %23, i8* %17)
%110 = icmp eq i64 %109, 0
br i1 %110, label %111, label %135
111: ; preds = %106
%112 = call i8* @strtok(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%113 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%114 = call i32 @strcpy(i8* %18, i8* %113)
%115 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%116 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%117 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%118 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%119 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%120 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%121 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%122 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%123 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%124 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%125 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%126 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%127 = call i8* @strtok(i8* %126, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%128 = call i32 @strcpy(i8* %14, i8* %127)
%129 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%130 = icmp eq i64 %129, 0
br i1 %130, label %131, label %135
131: ; preds = %111
%132 = call i32 @time(i32* %13)
%133 = load i32, i32* %13
%134 = call i32 @fprintf(i32* %93, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), i32 %133, i8* %17, i8* %18)
br label %135
135: ; preds = %106, %131, %111, %98, %96, %96, %96, %96
%136 = call i32* @fgets(i8* %16, i32 1023, i32* %92)
%137 = icmp eq i32* %136, null
br i1 %137, label %138, label %96
138: ; preds = %135, %83, %91, %39
%139 = phi i32* [ %41, %39 ], [ %93, %91 ], [ %41, %83 ], [ %93, %135 ]
%140 = phi i32* [ %40, %39 ], [ %92, %91 ], [ %40, %83 ], [ %92, %135 ]
%141 = call i32 @fclose(i32* %139)
%142 = call i32 @fclose(i32* %140)
br label %143
143: ; preds = %138, %86
ret i32 0
}