#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 ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ convertedTime(char *, char *);
scalar_t__ difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strstr(char *, char *);
char *strtok(char *, char *);
int main(int argc, char *argv[]) {
  FILE *fp;
  char *line = NULL;
  size_t len = 0;
  ssize_t read;
  fp = fopen(argv[1], "r");
  char filenameOutput[30];
  char *dateInputFrom = argv[2];
  char *timeInputFrom = argv[3];
  time_t inputTimeFrom = convertedTime(dateInputFrom, timeInputFrom);
  char *dateInputTo = argv[4];
  char *timeInputTo = argv[5];
  time_t inputTimeTo = convertedTime(dateInputTo, timeInputTo);
  char *tableName = argv[6];
  char *dateSave;
  char *timeSave;
  char listFilename[1500][50];
  int index = 0;
  int doTokenize = 1;
  if (fp == NULL)
    exit(EXIT_FAILURE);
  while ((read = getline(&line, &len, fp)) != -1) {
    if ((strstr(line, "-----")) || (strstr(line, "====="))) {
      doTokenize = 1;
      sprintf(filenameOutput, "%s", "");
      continue;
    }
    if (doTokenize == 1) {
      char saveLine[4096];
      strcpy(saveLine, line);
      dateSave = strtok(saveLine, " ");
      timeSave = strtok(NULL, " ");
      char dateSaveNew[20];
      strcpy(dateSaveNew, dateSave);
      char timeSaveNew[20];
      strcpy(timeSaveNew, timeSave);
      time_t checkTime = convertedTime(dateSaveNew, timeSaveNew);
      if (difftime(inputTimeTo, checkTime) >= 0 &&
          difftime(checkTime, inputTimeFrom) >= 0) {
        sprintf(filenameOutput, "%s_%s.out", dateSave, timeSave);
        sprintf(listFilename[index], "%s", filenameOutput);
        ++index;
      } else if (difftime(checkTime, inputTimeTo) > 0 &&
                 difftime(checkTime, inputTimeFrom) > 0) {
        break;
      }
      doTokenize = 0;
    }
    FILE *fpWrite = fopen(filenameOutput, "a");
    if (!fpWrite) {
      printf("Output File: %s could not be opened.\n", filenameOutput);
      exit(EXIT_FAILURE);
    }
    fputs(line, fpWrite);
    fclose(fpWrite);
  }
  if (line)
    free(line);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x135f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf8(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%rsi
call   1060 <convertedTime@plt>
mov    %eax,-0x64(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rdi
mov    -0x78(%rbp),%rsi
call   1060 <convertedTime@plt>
mov    %eax,-0x7c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rax
mov    %rax,-0x88(%rbp)
movl   $0x0,-0x12594(%rbp)
movl   $0x1,-0x12598(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    129d <main+0xcd>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
jmp    12a2 <main+0xd2>
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   10c0 <getline@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0xffffffff,%eax
je     14db <main+0x30b>
mov    -0x20(%rbp),%rdi
lea    0xd38(%rip),%rsi
call   10f0 <strstr@plt>
cmp    $0x0,%rax
jne    12f3 <main+0x123>
mov    -0x20(%rbp),%rdi
lea    0xd24(%rip),%rsi
call   10f0 <strstr@plt>
cmp    $0x0,%rax
je     131b <main+0x14b>
movl   $0x1,-0x12598(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xd06(%rip),%rsi
lea    0xd35(%rip),%rdx
mov    $0x0,%al
call   10d0 <sprintf@plt>
jmp    12a2 <main+0xd2>
cmpl   $0x1,-0x12598(%rbp)
jne    1477 <main+0x2a7>
lea    -0x135a0(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x135a0(%rbp),%rdi
lea    0xccb(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,-0x90(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xcb4(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,-0x98(%rbp)
lea    -0x135c0(%rbp),%rdi
mov    -0x90(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x135e0(%rbp),%rdi
mov    -0x98(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x135c0(%rbp),%rdi
lea    -0x135e0(%rbp),%rsi
call   1060 <convertedTime@plt>
mov    %eax,-0x135e4(%rbp)
mov    -0x7c(%rbp),%edi
mov    -0x135e4(%rbp),%esi
call   1080 <difftime@plt>
cmp    $0x0,%rax
jl     1433 <main+0x263>
mov    -0x135e4(%rbp),%edi
mov    -0x64(%rbp),%esi
call   1080 <difftime@plt>
cmp    $0x0,%rax
jl     1433 <main+0x263>
lea    -0x50(%rbp),%rdi
mov    -0x90(%rbp),%rdx
mov    -0x98(%rbp),%rcx
lea    0xc22(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
movslq -0x12594(%rbp),%rax
lea    -0x12590(%rbp),%rdi
imul   $0x32,%rax,%rax
add    %rax,%rdi
lea    -0x50(%rbp),%rdx
lea    0xbf6(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    -0x12594(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12594(%rbp)
jmp    146d <main+0x29d>
mov    -0x135e4(%rbp),%edi
mov    -0x7c(%rbp),%esi
call   1080 <difftime@plt>
cmp    $0x0,%rax
jle    1468 <main+0x298>
mov    -0x135e4(%rbp),%edi
mov    -0x64(%rbp),%esi
call   1080 <difftime@plt>
cmp    $0x0,%rax
jle    1468 <main+0x298>
jmp    14db <main+0x30b>
jmp    146d <main+0x29d>
movl   $0x0,-0x12598(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xb9b(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x135f0(%rbp)
cmpq   $0x0,-0x135f0(%rbp)
jne    14ba <main+0x2ea>
lea    -0x50(%rbp),%rsi
lea    0xb78(%rip),%rdi
call   1070 <printf@plt>
mov    0x2b2d(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x135f0(%rbp),%rsi
call   1090 <fputs@plt>
mov    -0x135f0(%rbp),%rdi
call   1050 <fclose@plt>
jmp    12a2 <main+0xd2>
cmpq   $0x0,-0x20(%rbp)
je     14ef <main+0x31f>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    0x2ae2(%rip),%rax
mov    (%rax),%eax
add    $0x135f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x13588,%rsp
mov    %rsi,%rbp
movq   $0x0,(%rsp)
movq   $0x0,0x28(%rsp)
mov    0x8(%rsi),%rdi
lea    0xe00(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
mov    0x10(%rbp),%rdi
mov    0x18(%rbp),%rsi
call   1060 <convertedTime@plt>
mov    %eax,0x8(%rsp)
mov    0x20(%rbp),%rdi
mov    0x28(%rbp),%rsi
call   1060 <convertedTime@plt>
mov    %eax,0xc(%rsp)
test   %rbx,%rbx
je     1436 <main+0x266>
mov    %rsp,%rdi
lea    0x28(%rsp),%rsi
mov    %rbx,%rdx
call   10c0 <getline@plt>
cmp    $0xffffffff,%eax
je     13fc <main+0x22c>
mov    $0x1,%bpl
lea    0x50(%rsp),%r13
mov    %rsp,%r14
lea    0x28(%rsp),%r15
lea    0xdde(%rip),%r12
xor    %eax,%eax
mov    %rax,0x20(%rsp)
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%rdi
lea    0xd87(%rip),%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
jne    129a <main+0xca>
mov    (%rsp),%rdi
lea    0xd78(%rip),%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
je     12c0 <main+0xf0>
mov    %r13,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   10c0 <getline@plt>
mov    $0x1,%bpl
cmp    $0xffffffff,%eax
jne    1270 <main+0xa0>
jmp    13fc <main+0x22c>
test   $0x1,%bpl
je     13b8 <main+0x1e8>
mov    (%rsp),%rsi
lea    0x90(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <strcpy@plt>
mov    %rbp,%rdi
lea    0xd26(%rip),%rbp
mov    %rbp,%rsi
call   10b0 <strtok@plt>
mov    %rax,0x18(%rsp)
xor    %edi,%edi
mov    %rbp,%rsi
call   10b0 <strtok@plt>
mov    %rax,0x10(%rsp)
lea    0x30(%rsp),%rdi
mov    0x18(%rsp),%rsi
call   1040 <strcpy@plt>
lea    0x70(%rsp),%rbp
mov    %rbp,%rdi
mov    0x10(%rsp),%rsi
call   1040 <strcpy@plt>
lea    0x30(%rsp),%rdi
mov    %rbp,%rsi
call   1060 <convertedTime@plt>
mov    %eax,%ebp
mov    0xc(%rsp),%edi
mov    %eax,%esi
call   1080 <difftime@plt>
test   %rax,%rax
js     1398 <main+0x1c8>
mov    %ebp,%edi
mov    0x8(%rsp),%esi
call   1080 <difftime@plt>
test   %rax,%rax
js     1398 <main+0x1c8>
mov    %r13,%rdi
lea    0xcb2(%rip),%rsi
mov    0x18(%rsp),%rdx
mov    0x10(%rsp),%rcx
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    0x20(%rsp),%rbp
movslq %ebp,%rbp
imul   $0x32,%rbp,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x1090,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
add    $0x1,%ebp
mov    %rbp,0x20(%rsp)
jmp    13b8 <main+0x1e8>
mov    %ebp,%edi
mov    0xc(%rsp),%esi
call   1080 <difftime@plt>
test   %rax,%rax
jle    13b8 <main+0x1e8>
mov    %ebp,%edi
mov    0x8(%rsp),%esi
call   1080 <difftime@plt>
test   %rax,%rax
jg     13fc <main+0x22c>
mov    %r13,%rdi
lea    0xc58(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1425 <main+0x255>
mov    %rax,%rbp
mov    (%rsp),%rdi
mov    %rax,%rsi
call   1090 <fputs@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   10c0 <getline@plt>
xor    %ebp,%ebp
cmp    $0xffffffff,%eax
jne    1270 <main+0xa0>
mov    (%rsp),%rdi
test   %rdi,%rdi
je     140a <main+0x23a>
call   1030 <free@plt>
mov    0x2bc7(%rip),%rax
mov    (%rax),%eax
add    $0x13588,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbf0(%rip),%rdi
lea    0x50(%rsp),%rsi
call   1070 <printf@plt>
mov    0x2ba3(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [6 x i8] c"-----\00"
@.str.2 = [6 x i8] c"=====\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [2 x i8] c" \00"
@.str.6 = [10 x i8] c"%s_%s.out\00"
@.str.7 = [2 x i8] c"a\00"
@.str.8 = [38 x i8] c"Output File: %s could not be opened.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca [30 x i8]
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca [1500 x [50 x i8]]
%21 = alloca i32
%22 = alloca i32
%23 = alloca [4096 x i8]
%24 = alloca [20 x i8]
%25 = alloca [20 x i8]
%26 = alloca i32
%27 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %7
store i64 0, i64* %8
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %31, i32** %6
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
store i8* %34, i8** %11
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 3
%37 = load i8*, i8** %36
store i8* %37, i8** %12
%38 = load i8*, i8** %11
%39 = load i8*, i8** %12
%40 = call i32 @convertedTime(i8* %38, i8* %39)
store i32 %40, i32* %13
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 4
%43 = load i8*, i8** %42
store i8* %43, i8** %14
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 5
%46 = load i8*, i8** %45
store i8* %46, i8** %15
%47 = load i8*, i8** %14
%48 = load i8*, i8** %15
%49 = call i32 @convertedTime(i8* %47, i8* %48)
store i32 %49, i32* %16
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 6
%52 = load i8*, i8** %51
store i8* %52, i8** %17
store i32 0, i32* %21
store i32 1, i32* %22
%53 = load i32*, i32** %6
%54 = icmp eq i32* %53, null
br i1 %54, label %55, label %58
55: ; preds = %2
%56 = load i32, i32* @EXIT_FAILURE
%57 = call i32 @exit(i32 %56)
unreachable
58: ; preds = %2
br label %59
59: ; preds = %138, %71, %58
%60 = load i32*, i32** %6
%61 = call i32 @getline(i8** %7, i64* %8, i32* %60)
store i32 %61, i32* %9
%62 = icmp ne i32 %61, -1
br i1 %62, label %63, label %144
63: ; preds = %59
%64 = load i8*, i8** %7
%65 = call i64 @strstr(i8* %64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%66 = icmp ne i64 %65, 0
br i1 %66, label %71, label %67
67: ; preds = %63
%68 = load i8*, i8** %7
%69 = call i64 @strstr(i8* %68, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %67, %63
store i32 1, i32* %22
%72 = getelementptr inbounds [30 x i8], [30 x i8]* %10, i64 0, i64 0
%73 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
br label %59
74: ; preds = %67
%75 = load i32, i32* %22
%76 = icmp eq i32 %75, 1
br i1 %76, label %77, label %128
77: ; preds = %74
%78 = getelementptr inbounds [4096 x i8], [4096 x i8]* %23, i64 0, i64 0
%79 = load i8*, i8** %7
%80 = call i32 @strcpy(i8* %78, i8* %79)
%81 = getelementptr inbounds [4096 x i8], [4096 x i8]* %23, i64 0, i64 0
%82 = call i8* @strtok(i8* %81, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i8* %82, i8** %18
%83 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i8* %83, i8** %19
%84 = getelementptr inbounds [20 x i8], [20 x i8]* %24, i64 0, i64 0
%85 = load i8*, i8** %18
%86 = call i32 @strcpy(i8* %84, i8* %85)
%87 = getelementptr inbounds [20 x i8], [20 x i8]* %25, i64 0, i64 0
%88 = load i8*, i8** %19
%89 = call i32 @strcpy(i8* %87, i8* %88)
%90 = getelementptr inbounds [20 x i8], [20 x i8]* %24, i64 0, i64 0
%91 = getelementptr inbounds [20 x i8], [20 x i8]* %25, i64 0, i64 0
%92 = call i32 @convertedTime(i8* %90, i8* %91)
store i32 %92, i32* %26
%93 = load i32, i32* %16
%94 = load i32, i32* %26
%95 = call i64 @difftime(i32 %93, i32 %94)
%96 = icmp sge i64 %95, 0
br i1 %96, label %97, label %115
97: ; preds = %77
%98 = load i32, i32* %26
%99 = load i32, i32* %13
%100 = call i64 @difftime(i32 %98, i32 %99)
%101 = icmp sge i64 %100, 0
br i1 %101, label %102, label %115
102: ; preds = %97
%103 = getelementptr inbounds [30 x i8], [30 x i8]* %10, i64 0, i64 0
%104 = load i8*, i8** %18
%105 = load i8*, i8** %19
%106 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %103, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %104, i8* %105)
%107 = load i32, i32* %21
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [1500 x [50 x i8]], [1500 x [50 x i8]]* %20, i64 0, i64 %108
%110 = getelementptr inbounds [50 x i8], [50 x i8]* %109, i64 0, i64 0
%111 = getelementptr inbounds [30 x i8], [30 x i8]* %10, i64 0, i64 0
%112 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %110, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %111)
%113 = load i32, i32* %21
%114 = add nsw i32 %113, 1
store i32 %114, i32* %21
br label %127
115: ; preds = %97, %77
%116 = load i32, i32* %26
%117 = load i32, i32* %16
%118 = call i64 @difftime(i32 %116, i32 %117)
%119 = icmp sgt i64 %118, 0
br i1 %119, label %120, label %126
120: ; preds = %115
%121 = load i32, i32* %26
%122 = load i32, i32* %13
%123 = call i64 @difftime(i32 %121, i32 %122)
%124 = icmp sgt i64 %123, 0
br i1 %124, label %125, label %126
125: ; preds = %120
br label %144
126: ; preds = %120, %115
br label %127
127: ; preds = %126, %102
store i32 0, i32* %22
br label %128
128: ; preds = %127, %74
%129 = getelementptr inbounds [30 x i8], [30 x i8]* %10, i64 0, i64 0
%130 = call i32* @fopen(i8* %129, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %130, i32** %27
%131 = load i32*, i32** %27
%132 = icmp ne i32* %131, null
br i1 %132, label %138, label %133
133: ; preds = %128
%134 = getelementptr inbounds [30 x i8], [30 x i8]* %10, i64 0, i64 0
%135 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), i8* %134)
%136 = load i32, i32* @EXIT_FAILURE
%137 = call i32 @exit(i32 %136)
unreachable
138: ; preds = %128
%139 = load i8*, i8** %7
%140 = load i32*, i32** %27
%141 = call i32 @fputs(i8* %139, i32* %140)
%142 = load i32*, i32** %27
%143 = call i32 @fclose(i32* %142)
br label %59
144: ; preds = %125, %59
%145 = load i8*, i8** %7
%146 = icmp ne i8* %145, null
br i1 %146, label %147, label %150
147: ; preds = %144
%148 = load i8*, i8** %7
%149 = call i32 @free(i8* %148)
br label %150
150: ; preds = %147, %144
%151 = load i32, i32* @EXIT_SUCCESS
ret i32 %151
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [6 x i8] c"-----\00"
@.str.2 = [6 x i8] c"=====\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [2 x i8] c" \00"
@.str.6 = [10 x i8] c"%s_%s.out\00"
@.str.7 = [2 x i8] c"a\00"
@.str.8 = [38 x i8] c"Output File: %s could not be opened.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [30 x i8]
%6 = alloca [1500 x [50 x i8]]
%7 = alloca [4096 x i8]
%8 = alloca [20 x i8]
%9 = alloca [20 x i8]
%10 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%11 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8*, i8** %1, i64 3
%19 = load i8*, i8** %18
%20 = tail call i32 @convertedTime(i8* %17, i8* %19)
%21 = getelementptr inbounds i8*, i8** %1, i64 4
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8*, i8** %1, i64 5
%24 = load i8*, i8** %23
%25 = tail call i32 @convertedTime(i8* %22, i8* %24)
%26 = getelementptr inbounds [1500 x [50 x i8]], [1500 x [50 x i8]]* %6, i64 0, i64 0, i64 0
%27 = icmp eq i32* %14, null
br i1 %27, label %35, label %28
28: ; preds = %2
%29 = call i32 @getline(i8** %3, i64* %4, i32* %14)
%30 = icmp eq i32 %29, -1
br i1 %30, label %97, label %31
31: ; preds = %28
%32 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%33 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%34 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
br label %94
35: ; preds = %2
%36 = load i32, i32* @EXIT_FAILURE
%37 = tail call i32 @exit(i32 %36)
unreachable
38: ; preds = %94, %47
%39 = phi i1 [ %96, %94 ], [ true, %47 ]
%40 = load i8*, i8** %3
%41 = call i64 @strstr(i8* %40, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %38
%44 = load i8*, i8** %3
%45 = call i64 @strstr(i8* %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %51, label %47
47: ; preds = %43, %38
%48 = call i8* bitcast (i32 (i8*, i8*)* @strcpy to i8* (i8*, i8*)*)(i8* %15, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%49 = call i32 @getline(i8** %3, i64* %4, i32* %14)
%50 = icmp eq i32 %49, -1
br i1 %50, label %97, label %38
51: ; preds = %43
br i1 %39, label %52, label %80
52: ; preds = %51
%53 = load i8*, i8** %3
%54 = call i32 @strcpy(i8* %32, i8* %53)
%55 = call i8* @strtok(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%56 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%57 = call i32 @strcpy(i8* %33, i8* %55)
%58 = call i32 @strcpy(i8* %34, i8* %56)
%59 = call i32 @convertedTime(i8* %33, i8* %34)
%60 = call i64 @difftime(i32 %25, i32 %59)
%61 = icmp sgt i64 %60, -1
br i1 %61, label %62, label %71
62: ; preds = %52
%63 = call i64 @difftime(i32 %59, i32 %20)
%64 = icmp sgt i64 %63, -1
br i1 %64, label %65, label %71
65: ; preds = %62
%66 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %55, i8* %56)
%67 = sext i32 %95 to i64
%68 = getelementptr inbounds [1500 x [50 x i8]], [1500 x [50 x i8]]* %6, i64 0, i64 %67, i64 0
%69 = call i8* bitcast (i32 (i8*, i8*)* @strcpy to i8* (i8*, i8*)*)(i8* %68, i8* %15)
%70 = add nsw i32 %95, 1
br label %77
71: ; preds = %62, %52
%72 = call i64 @difftime(i32 %59, i32 %25)
%73 = icmp sgt i64 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %71
%75 = call i64 @difftime(i32 %59, i32 %20)
%76 = icmp sgt i64 %75, 0
br i1 %76, label %79, label %77
77: ; preds = %65, %74, %71
%78 = phi i32 [ %70, %65 ], [ %95, %74 ], [ %95, %71 ]
br label %80
79: ; preds = %74
br label %97
80: ; preds = %77, %51
%81 = phi i32 [ %95, %51 ], [ %78, %77 ]
%82 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%83 = icmp eq i32* %82, null
br i1 %83, label %84, label %88
84: ; preds = %80
%85 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), i8* %15)
%86 = load i32, i32* @EXIT_FAILURE
%87 = call i32 @exit(i32 %86)
unreachable
88: ; preds = %80
%89 = load i8*, i8** %3
%90 = call i32 @fputs(i8* %89, i32* %82)
%91 = call i32 @fclose(i32* %82)
%92 = call i32 @getline(i8** %3, i64* %4, i32* %14)
%93 = icmp eq i32 %92, -1
br i1 %93, label %97, label %94
94: ; preds = %31, %88
%95 = phi i32 [ 0, %31 ], [ %81, %88 ]
%96 = phi i1 [ true, %31 ], [ false, %88 ]
br label %38
97: ; preds = %88, %47, %28, %79
%98 = load i8*, i8** %3
%99 = icmp eq i8* %98, null
br i1 %99, label %102, label %100
100: ; preds = %97
%101 = call i32 @free(i8* %98)
br label %102
102: ; preds = %100, %97
%103 = load i32, i32* @EXIT_SUCCESS
ret i32 %103
}