int Correct_Date(char *value) {
  int year = -1, month = -1, day = -1, day2 = -1;
  int i, charmonth = 0;
  long n;
  char *s;
  const char months[26][4] = {"Jan", "jan", "Feb", "feb", "Mar", "mar", "Apr",
                              "apr", "May", "may", "Jun", "jun", "Jul", "jul",
                              "Aug", "aug", "Sep", "sep", "Oct", "oct", "Nov",
                              "nov", "Dec", "dec", "Okt", "okt"};
  Kill_Chars(value, 0x08u, "\n");
  for (i = 0; i < 26; i++) {
    s = strstr(value, months[i]);
    if (s) {
      if (charmonth)
        return (0);
      else {
        month = i / 2 + 1;
        charmonth = 1;
      }
    }
  }
  if (month == 13)
    month = 10;
  s = value;
  while (*s) {
    if (isdigit(*s)) {
      n = strtol(s, &s, 10);
      if (n > 31)
        if (year < 0)
          year = n;
        else
          return (0);
      else if (n > 12 || charmonth)
        if (day < 0)
          day = n;
        else if (day2 < 0)
          day2 = n;
        else
          return (0);
      else if (month < 0)
        month = n;
      else
        return (0);
    } else
      s++;
  }
  if (year < 0 || year > 9999)
    return (0);
  else if (year < 100)
    year += 1900;
  if (day > 0 && month > 0) {
    if (day2 > 0)
      sprintf(value, "%04d-%02d-%02d,%02d", year, month, day, day2);
    else
      sprintf(value, "%04d-%02d-%02d", year, month, day);
  } else if (month > 0)
    sprintf(value, "%04d-%02d", year, month);
  else
    sprintf(value, "%04d", year);
  return (-1);
}


x86 assembly (clang, -O0):
<Correct_Date>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movl   $0xffffffff,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
lea    -0xa0(%rbp),%rdi
lea    0xe60(%rip),%rsi
mov    $0x68,%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
lea    0xeae(%rip),%rdx
mov    $0x0,%al
call   1060 <Kill_Chars@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x1a,-0x24(%rbp)
jge    1242 <Correct_Date+0xe2>
mov    -0x10(%rbp),%rdi
movslq -0x24(%rbp),%rax
lea    -0xa0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
call   1080 <strstr@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     122f <Correct_Date+0xcf>
cmpl   $0x0,-0x28(%rbp)
je     1212 <Correct_Date+0xb2>
movl   $0x0,-0x4(%rbp)
jmp    1447 <Correct_Date+0x2e7>
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x28(%rbp)
jmp    122f <Correct_Date+0xcf>
jmp    1234 <Correct_Date+0xd4>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11c8 <Correct_Date+0x68>
cmpl   $0xd,-0x18(%rbp)
jne    1253 <Correct_Date+0xf3>
movl   $0xa,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmpb   $0x0,(%rax)
je     135e <Correct_Date+0x1fe>
mov    -0x38(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     134d <Correct_Date+0x1ed>
mov    -0x38(%rbp),%rdi
lea    -0x38(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x1f,-0x30(%rbp)
jle    12c5 <Correct_Date+0x165>
cmpl   $0x0,-0x14(%rbp)
jge    12b4 <Correct_Date+0x154>
mov    -0x30(%rbp),%rax
mov    %eax,-0x14(%rbp)
jmp    12c0 <Correct_Date+0x160>
movl   $0x0,-0x4(%rbp)
jmp    1447 <Correct_Date+0x2e7>
jmp    1348 <Correct_Date+0x1e8>
cmpq   $0xc,-0x30(%rbp)
jg     12da <Correct_Date+0x17a>
cmpl   $0x0,-0x28(%rbp)
je     131c <Correct_Date+0x1bc>
cmpl   $0x0,-0x1c(%rbp)
jge    12f0 <Correct_Date+0x190>
mov    -0x30(%rbp),%rax
mov    %eax,-0x1c(%rbp)
jmp    1317 <Correct_Date+0x1b7>
cmpl   $0x0,-0x20(%rbp)
jge    1306 <Correct_Date+0x1a6>
mov    -0x30(%rbp),%rax
mov    %eax,-0x20(%rbp)
jmp    1312 <Correct_Date+0x1b2>
movl   $0x0,-0x4(%rbp)
jmp    1447 <Correct_Date+0x2e7>
jmp    1317 <Correct_Date+0x1b7>
jmp    1343 <Correct_Date+0x1e3>
cmpl   $0x0,-0x18(%rbp)
jge    1332 <Correct_Date+0x1d2>
mov    -0x30(%rbp),%rax
mov    %eax,-0x18(%rbp)
jmp    133e <Correct_Date+0x1de>
movl   $0x0,-0x4(%rbp)
jmp    1447 <Correct_Date+0x2e7>
jmp    1343 <Correct_Date+0x1e3>
jmp    1348 <Correct_Date+0x1e8>
jmp    1359 <Correct_Date+0x1f9>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    125b <Correct_Date+0xfb>
cmpl   $0x0,-0x14(%rbp)
jl     1375 <Correct_Date+0x215>
cmpl   $0x270f,-0x14(%rbp)
jle    1381 <Correct_Date+0x221>
movl   $0x0,-0x4(%rbp)
jmp    1447 <Correct_Date+0x2e7>
cmpl   $0x64,-0x14(%rbp)
jge    1396 <Correct_Date+0x236>
mov    -0x14(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x14(%rbp)
jmp    139b <Correct_Date+0x23b>
cmpl   $0x0,-0x1c(%rbp)
jle    13ff <Correct_Date+0x29f>
cmpl   $0x0,-0x18(%rbp)
jle    13ff <Correct_Date+0x29f>
cmpl   $0x0,-0x20(%rbp)
jle    13de <Correct_Date+0x27e>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
lea    0xc98(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
jmp    13fa <Correct_Date+0x29a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xc8b(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
jmp    1440 <Correct_Date+0x2e0>
cmpl   $0x0,-0x18(%rbp)
jle    1426 <Correct_Date+0x2c6>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xc73(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
jmp    143b <Correct_Date+0x2db>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xc63(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
jmp    1440 <Correct_Date+0x2e0>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Correct_Date>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r12
lea    0xf10(%rip),%rdx
xor    %ebp,%ebp
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <Kill_Chars@plt>
mov    $0xffffffff,%r14d
lea    0xe8d(%rip),%rbx
xor    %r15d,%r15d
jmp    119e <Correct_Date+0x5e>
nopl   0x0(%rax,%rax,1)
mov    %ebp,%r14d
shr    %r14d
add    $0x1,%r14d
mov    $0x1,%r15d
add    $0x1,%rbp
add    $0x4,%rbx
cmp    $0x1a,%rbp
je     11ba <Correct_Date+0x7a>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <strstr@plt>
test   %rax,%rax
je     1190 <Correct_Date+0x50>
test   %r15d,%r15d
je     1180 <Correct_Date+0x40>
xor    %ebp,%ebp
jmp    130c <Correct_Date+0x1cc>
mov    %r12,0x10(%rsp)
mov    (%r12),%al
xor    %ebp,%ebp
test   %al,%al
je     130c <Correct_Date+0x1cc>
cmp    $0xd,%r14d
mov    $0xa,%ecx
cmove  %ecx,%r14d
movl   $0xffffffff,0xc(%rsp)
ff
lea    0x10(%rsp),%r13
mov    %r12,%rdi
movl   $0xffffffff,0x8(%rsp)
ff
mov    $0xffffffff,%ebx
jmp    1215 <Correct_Date+0xd5>
nopl   0x0(%rax)
add    $0x1,%rdi
mov    %rdi,0x10(%rsp)
mov    0x10(%rsp),%rdi
movzbl (%rdi),%eax
test   %al,%al
je     1277 <Correct_Date+0x137>
movsbl %al,%eax
add    $0xffffffd0,%eax
cmp    $0x9,%eax
ja     1200 <Correct_Date+0xc0>
mov    %r13,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
cmp    $0x20,%rax
jl     1240 <Correct_Date+0x100>
test   %ebx,%ebx
jns    130c <Correct_Date+0x1cc>
mov    %eax,%ebx
jmp    1209 <Correct_Date+0xc9>
nop
cmp    $0xc,%rax
jg     1259 <Correct_Date+0x119>
test   %r15d,%r15d
jne    1259 <Correct_Date+0x119>
test   %r14d,%r14d
jns    130c <Correct_Date+0x1cc>
mov    %eax,%r14d
jmp    1209 <Correct_Date+0xc9>
cmpl   $0x0,0x8(%rsp)
js     1271 <Correct_Date+0x131>
cmpl   $0x0,0xc(%rsp)
jns    130c <Correct_Date+0x1cc>
mov    %eax,0xc(%rsp)
jmp    1209 <Correct_Date+0xc9>
mov    %eax,0x8(%rsp)
jmp    1209 <Correct_Date+0xc9>
cmp    $0x270f,%ebx
ja     130c <Correct_Date+0x1cc>
lea    0x76c(%rbx),%edx
cmp    $0x64,%ebx
cmovae %ebx,%edx
cmpl   $0x0,0x8(%rsp)
jle    12c0 <Correct_Date+0x180>
test   %r14d,%r14d
jle    12c0 <Correct_Date+0x180>
mov    0xc(%rsp),%r9d
test   %r9d,%r9d
jle    12db <Correct_Date+0x19b>
lea    0xdbe(%rip),%rsi
mov    %r12,%rdi
mov    %r14d,%ecx
mov    0x8(%rsp),%r8d
xor    %eax,%eax
call   1050 <sprintf@plt>
jmp    1307 <Correct_Date+0x1c7>
test   %r14d,%r14d
jle    12f6 <Correct_Date+0x1b6>
lea    0xdc1(%rip),%rsi
mov    %r12,%rdi
mov    %r14d,%ecx
xor    %eax,%eax
call   1050 <sprintf@plt>
jmp    1307 <Correct_Date+0x1c7>
lea    0xd9c(%rip),%rsi
mov    %r12,%rdi
mov    %r14d,%ecx
mov    0x8(%rsp),%r8d
xor    %eax,%eax
call   1050 <sprintf@plt>
jmp    1307 <Correct_Date+0x1c7>
lea    0xd9a(%rip),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.Correct_Date.months = [26 x [4 x i8]] [[4 x i8] c"Jan\00", [4 x i8] c"jan\00", [4 x i8] c"Feb\00", [4 x i8] c"feb\00", [4 x i8] c"Mar\00", [4 x i8] c"mar\00", [4 x i8] c"Apr\00", [4 x i8] c"apr\00", [4 x i8] c"May\00", [4 x i8] c"may\00", [4 x i8] c"Jun\00", [4 x i8] c"jun\00", [4 x i8] c"Jul\00", [4 x i8] c"jul\00", [4 x i8] c"Aug\00", [4 x i8] c"aug\00", [4 x i8] c"Sep\00", [4 x i8] c"sep\00", [4 x i8] c"Oct\00", [4 x i8] c"oct\00", [4 x i8] c"Nov\00", [4 x i8] c"nov\00", [4 x i8] c"Dec\00", [4 x i8] c"dec\00", [4 x i8] c"Okt\00", [4 x i8] c"okt\00"]
@.str = [2 x i8] c"\0A\00"
@.str.1 = [20 x i8] c"%04d-%02d-%02d,%02d\00"
@.str.2 = [15 x i8] c"%04d-%02d-%02d\00"
@.str.3 = [10 x i8] c"%04d-%02d\00"
@.str.4 = [5 x i8] c"%04d\00"
define i32 @Correct_Date(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i8*
%12 = alloca [26 x [4 x i8]]
store i8* %0, i8** %3
store i32 -1, i32* %4
store i32 -1, i32* %5
store i32 -1, i32* %6
store i32 -1, i32* %7
store i32 0, i32* %9
%13 = bitcast [26 x [4 x i8]]* %12 to i8*
%14 = load i8*, i8** %3
%15 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @Kill_Chars to i32 (i8*, i32, i8*, ...)*)(i8* %14, i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %8
br label %16
16: ; preds = %38, %1
%17 = load i32, i32* %8
%18 = icmp slt i32 %17, 26
br i1 %18, label %19, label %41
19: ; preds = %16
%20 = load i8*, i8** %3
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [26 x [4 x i8]], [26 x [4 x i8]]* %12, i64 0, i64 %22
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %23, i64 0, i64 0
%25 = call i8* @strstr(i8* %20, i8* %24)
store i8* %25, i8** %11
%26 = load i8*, i8** %11
%27 = icmp ne i8* %26, null
br i1 %27, label %28, label %37
28: ; preds = %19
%29 = load i32, i32* %9
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %28
store i32 0, i32* %2
br label %156
32: ; preds = %28
%33 = load i32, i32* %8
%34 = sdiv i32 %33, 2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
store i32 1, i32* %9
br label %36
36: ; preds = %32
br label %37
37: ; preds = %36, %19
br label %38
38: ; preds = %37
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 1
store i32 %40, i32* %8
br label %16
41: ; preds = %16
%42 = load i32, i32* %5
%43 = icmp eq i32 %42, 13
br i1 %43, label %44, label %45
44: ; preds = %41
store i32 10, i32* %5
br label %45
45: ; preds = %44, %41
%46 = load i8*, i8** %3
store i8* %46, i8** %11
br label %47
47: ; preds = %104, %45
%48 = load i8*, i8** %11
%49 = load i8, i8* %48
%50 = icmp ne i8 %49, 0
br i1 %50, label %51, label %105
51: ; preds = %47
%52 = load i8*, i8** %11
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = call i32 @isdigit(i32 %54)
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %101
57: ; preds = %51
%58 = load i8*, i8** %11
%59 = call i64 @strtol(i8* %58, i8** %11, i32 10)
store i64 %59, i64* %10
%60 = load i64, i64* %10
%61 = icmp sgt i64 %60, 31
br i1 %61, label %62, label %70
62: ; preds = %57
%63 = load i32, i32* %4
%64 = icmp slt i32 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = load i64, i64* %10
%67 = trunc i64 %66 to i32
store i32 %67, i32* %4
br label %69
68: ; preds = %62
store i32 0, i32* %2
br label %156
69: ; preds = %65
br label %100
70: ; preds = %57
%71 = load i64, i64* %10
%72 = icmp sgt i64 %71, 12
br i1 %72, label %76, label %73
73: ; preds = %70
%74 = load i32, i32* %9
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %91
76: ; preds = %73, %70
%77 = load i32, i32* %6
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %76
%80 = load i64, i64* %10
%81 = trunc i64 %80 to i32
store i32 %81, i32* %6
br label %90
82: ; preds = %76
%83 = load i32, i32* %7
%84 = icmp slt i32 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %82
%86 = load i64, i64* %10
%87 = trunc i64 %86 to i32
store i32 %87, i32* %7
br label %89
88: ; preds = %82
store i32 0, i32* %2
br label %156
89: ; preds = %85
br label %90
90: ; preds = %89, %79
br label %99
91: ; preds = %73
%92 = load i32, i32* %5
%93 = icmp slt i32 %92, 0
br i1 %93, label %94, label %97
94: ; preds = %91
%95 = load i64, i64* %10
%96 = trunc i64 %95 to i32
store i32 %96, i32* %5
br label %98
97: ; preds = %91
store i32 0, i32* %2
br label %156
98: ; preds = %94
br label %99
99: ; preds = %98, %90
br label %100
100: ; preds = %99, %69
br label %104
101: ; preds = %51
%102 = load i8*, i8** %11
%103 = getelementptr inbounds i8, i8* %102, i32 1
store i8* %103, i8** %11
br label %104
104: ; preds = %101, %100
br label %47
105: ; preds = %47
%106 = load i32, i32* %4
%107 = icmp slt i32 %106, 0
br i1 %107, label %111, label %108
108: ; preds = %105
%109 = load i32, i32* %4
%110 = icmp sgt i32 %109, 9999
br i1 %110, label %111, label %112
111: ; preds = %108, %105
store i32 0, i32* %2
br label %156
112: ; preds = %108
%113 = load i32, i32* %4
%114 = icmp slt i32 %113, 100
br i1 %114, label %115, label %118
115: ; preds = %112
%116 = load i32, i32* %4
%117 = add nsw i32 %116, 1900
store i32 %117, i32* %4
br label %118
118: ; preds = %115, %112
br label %119
119: ; preds = %118
%120 = load i32, i32* %6
%121 = icmp sgt i32 %120, 0
br i1 %121, label %122, label %142
122: ; preds = %119
%123 = load i32, i32* %5
%124 = icmp sgt i32 %123, 0
br i1 %124, label %125, label %142
125: ; preds = %122
%126 = load i32, i32* %7
%127 = icmp sgt i32 %126, 0
br i1 %127, label %128, label %135
128: ; preds = %125
%129 = load i8*, i8** %3
%130 = load i32, i32* %4
%131 = load i32, i32* %5
%132 = load i32, i32* %6
%133 = load i32, i32* %7
%134 = call i32 (i8*, i8*, ...) @sprintf(i8* %129, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %130, i32 %131, i32 %132, i32 %133)
br label %141
135: ; preds = %125
%136 = load i8*, i8** %3
%137 = load i32, i32* %4
%138 = load i32, i32* %5
%139 = load i32, i32* %6
%140 = call i32 (i8*, i8*, ...) @sprintf(i8* %136, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %137, i32 %138, i32 %139)
br label %141
141: ; preds = %135, %128
br label %155
142: ; preds = %122, %119
%143 = load i32, i32* %5
%144 = icmp sgt i32 %143, 0
br i1 %144, label %145, label %150
145: ; preds = %142
%146 = load i8*, i8** %3
%147 = load i32, i32* %4
%148 = load i32, i32* %5
%149 = call i32 (i8*, i8*, ...) @sprintf(i8* %146, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %147, i32 %148)
br label %154
150: ; preds = %142
%151 = load i8*, i8** %3
%152 = load i32, i32* %4
%153 = call i32 (i8*, i8*, ...) @sprintf(i8* %151, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %152)
br label %154
154: ; preds = %150, %145
br label %155
155: ; preds = %154, %141
store i32 -1, i32* %2
br label %156
156: ; preds = %155, %111, %97, %88, %68, %31
%157 = load i32, i32* %2
ret i32 %157
}

LLVM IR (-O2):
@__const.Correct_Date.months = [26 x [4 x i8]] [[4 x i8] c"Jan\00", [4 x i8] c"jan\00", [4 x i8] c"Feb\00", [4 x i8] c"feb\00", [4 x i8] c"Mar\00", [4 x i8] c"mar\00", [4 x i8] c"Apr\00", [4 x i8] c"apr\00", [4 x i8] c"May\00", [4 x i8] c"may\00", [4 x i8] c"Jun\00", [4 x i8] c"jun\00", [4 x i8] c"Jul\00", [4 x i8] c"jul\00", [4 x i8] c"Aug\00", [4 x i8] c"aug\00", [4 x i8] c"Sep\00", [4 x i8] c"sep\00", [4 x i8] c"Oct\00", [4 x i8] c"oct\00", [4 x i8] c"Nov\00", [4 x i8] c"nov\00", [4 x i8] c"Dec\00", [4 x i8] c"dec\00", [4 x i8] c"Okt\00", [4 x i8] c"okt\00"]
@.str = [2 x i8] c"\0A\00"
@.str.1 = [20 x i8] c"%04d-%02d-%02d,%02d\00"
@.str.2 = [15 x i8] c"%04d-%02d-%02d\00"
@.str.3 = [10 x i8] c"%04d-%02d\00"
@.str.4 = [5 x i8] c"%04d\00"
define i32 @Correct_Date(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = tail call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @Kill_Chars to i32 (i8*, i32, i8*, ...)*)(i8* %0, i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %18
%6 = phi i64 [ 0, %1 ], [ %21, %18 ]
%7 = phi i32 [ 0, %1 ], [ %20, %18 ]
%8 = phi i32 [ -1, %1 ], [ %19, %18 ]
%9 = getelementptr inbounds [26 x [4 x i8]], [26 x [4 x i8]]* @__const.Correct_Date.months, i64 0, i64 %6, i64 0
%10 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* %9)
%11 = icmp eq i8* %10, null
br i1 %11, label %18, label %12
12: ; preds = %5
%13 = icmp eq i32 %7, 0
br i1 %13, label %14, label %92
14: ; preds = %12
%15 = trunc i64 %6 to i32
%16 = lshr i32 %15, 1
%17 = add nuw nsw i32 %16, 1
br label %18
18: ; preds = %5, %14
%19 = phi i32 [ %17, %14 ], [ %8, %5 ]
%20 = phi i32 [ 1, %14 ], [ %7, %5 ]
%21 = add nuw nsw i64 %6, 1
%22 = icmp eq i64 %21, 26
br i1 %22, label %23, label %5
23: ; preds = %18
store i8* %0, i8** %2
%24 = load i8, i8* %0
%25 = icmp eq i8 %24, 0
br i1 %25, label %92, label %26
26: ; preds = %23
%27 = icmp eq i32 %19, 13
%28 = select i1 %27, i32 10, i32 %19
%29 = icmp ne i32 %20, 0
br label %30
30: ; preds = %26, %64
%31 = phi i8 [ %24, %26 ], [ %70, %64 ]
%32 = phi i8* [ %0, %26 ], [ %69, %64 ]
%33 = phi i32 [ -1, %26 ], [ %68, %64 ]
%34 = phi i32 [ -1, %26 ], [ %67, %64 ]
%35 = phi i32 [ %28, %26 ], [ %66, %64 ]
%36 = phi i32 [ -1, %26 ], [ %65, %64 ]
%37 = sext i8 %31 to i32
%38 = add nsw i32 %37, -48
%39 = icmp ult i32 %38, 10
br i1 %39, label %40, label %62
40: ; preds = %30
%41 = call i64 @strtol(i8* %32, i8** %2, i32 10)
%42 = icmp sgt i64 %41, 31
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = icmp slt i32 %36, 0
br i1 %44, label %45, label %92
45: ; preds = %43
%46 = trunc i64 %41 to i32
br label %64
47: ; preds = %40
%48 = icmp sgt i64 %41, 12
%49 = select i1 %48, i1 true, i1 %29
br i1 %49, label %50, label %58
50: ; preds = %47
%51 = icmp slt i32 %34, 0
br i1 %51, label %52, label %54
52: ; preds = %50
%53 = trunc i64 %41 to i32
br label %64
54: ; preds = %50
%55 = icmp slt i32 %33, 0
br i1 %55, label %56, label %92
56: ; preds = %54
%57 = trunc i64 %41 to i32
br label %64
58: ; preds = %47
%59 = icmp slt i32 %35, 0
br i1 %59, label %60, label %92
60: ; preds = %58
%61 = trunc i64 %41 to i32
br label %64
62: ; preds = %30
%63 = getelementptr inbounds i8, i8* %32, i64 1
store i8* %63, i8** %2
br label %64
64: ; preds = %45, %52, %56, %60, %62
%65 = phi i32 [ %46, %45 ], [ %36, %52 ], [ %36, %56 ], [ %36, %60 ], [ %36, %62 ]
%66 = phi i32 [ %35, %45 ], [ %35, %52 ], [ %35, %56 ], [ %61, %60 ], [ %35, %62 ]
%67 = phi i32 [ %34, %45 ], [ %53, %52 ], [ %34, %56 ], [ %34, %60 ], [ %34, %62 ]
%68 = phi i32 [ %33, %45 ], [ %33, %52 ], [ %57, %56 ], [ %33, %60 ], [ %33, %62 ]
%69 = load i8*, i8** %2
%70 = load i8, i8* %69
%71 = icmp eq i8 %70, 0
br i1 %71, label %72, label %30
72: ; preds = %64
%73 = icmp ugt i32 %65, 9999
br i1 %73, label %92, label %74
74: ; preds = %72
%75 = icmp ult i32 %65, 100
%76 = add nuw nsw i32 %65, 1900
%77 = select i1 %75, i32 %76, i32 %65
%78 = icmp sgt i32 %67, 0
%79 = icmp sgt i32 %66, 0
%80 = select i1 %78, i1 %79, i1 false
br i1 %80, label %81, label %87
81: ; preds = %74
%82 = icmp sgt i32 %68, 0
br i1 %82, label %83, label %85
83: ; preds = %81
%84 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %77, i32 %66, i32 %67, i32 %68)
br label %92
85: ; preds = %81
%86 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %77, i32 %66, i32 %67)
br label %92
87: ; preds = %74
br i1 %79, label %88, label %90
88: ; preds = %87
%89 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %77, i32 %66)
br label %92
90: ; preds = %87
%91 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %77)
br label %92
92: ; preds = %12, %58, %54, %43, %23, %85, %83, %90, %88, %72
%93 = phi i32 [ 0, %72 ], [ -1, %88 ], [ -1, %90 ], [ -1, %83 ], [ -1, %85 ], [ 0, %23 ], [ 0, %43 ], [ 0, %54 ], [ 0, %58 ], [ 0, %12 ]
ret i32 %93
}