#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*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int month(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  FILE *fp;
  char c;
  unsigned i, t0, t1, m, j, w;
  unsigned work[12] = {0};
  if (argc != 2) {
    printf("Usage: %s [FILE]\n", argv[0]);
    return 1;
  }
  fp = fopen(*++argv, "r");
  while (fscanf(fp, "%c", &c) != EOF) {
    m = month(c, fp) - 1;
    fscanf(fp, "%u", &t0);
    t0 = 12 * (t0 - 1990) + m;
    fseek(fp, 1, SEEK_CUR);
    fscanf(fp, "%c", &c);
    m = month(c, fp) - 1;
    fscanf(fp, "%u", &t1);
    t1 = 12 * (t1 - 1990) + m;
    for (i = t0; i <= t1; i++)
      work[i / 30] |= (1 << (i % 30));
    fscanf(fp, "%c", &c);
    if (c == ';') {
      fseek(fp, 1, SEEK_CUR);
    } else {
      w = 0;
      for (i = 0; i < 12; i++) {
        for (j = 0; j < 30; j++)
          if (work[i] & (1 << j))
            w++;
        work[i] = 0;
      }
      printf("%u\n", w / 12);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1050 <memset@plt>
cmpl   $0x2,-0x8(%rbp)
je     11b1 <main+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13cf <main+0x26f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
lea    0xe47(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe35(%rip),%rsi
lea    -0x19(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    0x2def(%rip),%rcx
cmp    (%rcx),%rax
je     13c8 <main+0x268>
mov    -0x19(%rbp),%al
mov    -0x18(%rbp),%rsi
movsbl %al,%edi
call   1030 <month@plt>
sub    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xdfd(%rip),%rsi
lea    -0x24(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0x24(%rbp),%eax
sub    $0x7c6,%eax
imul   $0xc,%eax,%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2da7(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%esi
call   1070 <fseek@plt>
mov    -0x18(%rbp),%rdi
lea    0xdbc(%rip),%rsi
lea    -0x19(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0x19(%rbp),%al
mov    -0x18(%rbp),%rsi
movsbl %al,%edi
call   1030 <month@plt>
sub    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xd94(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0x28(%rbp),%eax
sub    $0x7c6,%eax
imul   $0xc,%eax,%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x28(%rbp),%eax
ja     12ec <main+0x18c>
mov    -0x20(%rbp),%eax
mov    $0x1e,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
mov    $0x1e,%esi
xor    %edx,%edx
div    %esi
mov    %eax,%eax
or     -0x70(%rbp,%rax,4),%ecx
mov    %ecx,-0x70(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12a5 <main+0x145>
mov    -0x18(%rbp),%rdi
lea    0xd1d(%rip),%rsi
lea    -0x19(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
movsbl -0x19(%rbp),%eax
cmp    $0x3b,%eax
jne    132b <main+0x1cb>
mov    -0x18(%rbp),%rdi
mov    0x2cce(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%esi
call   1070 <fseek@plt>
jmp    13c3 <main+0x263>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0xc,-0x20(%rbp)
jae    13a7 <main+0x247>
movl   $0x0,-0x30(%rbp)
cmpl   $0x1e,-0x30(%rbp)
jae    138e <main+0x22e>
mov    -0x20(%rbp),%eax
mov    -0x70(%rbp,%rax,4),%eax
mov    -0x30(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     137b <main+0x21b>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1380 <main+0x220>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    134a <main+0x1ea>
mov    -0x20(%rbp),%eax
movl   $0x0,-0x70(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1339 <main+0x1d9>
mov    -0x34(%rbp),%eax
mov    $0xc,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%esi
lea    0xc5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d4 <main+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
pxor   %xmm0,%xmm0
movdqa %xmm0,0x30(%rsp)
movdqa %xmm0,0x20(%rsp)
movdqa %xmm0,0x10(%rsp)
cmp    $0x2,%edi
jne    1548 <main+0x3f8>
mov    0x8(%rsi),%rdi
lea    0xe9a(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r12
lea    0xe8d(%rip),%rsi
xor    %r15d,%r15d
lea    0x7(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1050 <fscanf@plt>
mov    0x2e30(%rip),%rcx
cmp    (%rcx),%rax
je     155f <main+0x40f>
lea    0xe64(%rip),%rbp
lea    0x7(%rsp),%r13
mov    $0x88888889,%r14d
jmp    1209 <main+0xb9>
nopl   (%rax)
mov    0x2e11(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
mov    $0x1,%esi
call   1060 <fseek@plt>
xor    %r15d,%r15d
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <fscanf@plt>
mov    0x2de0(%rip),%rcx
cmp    (%rcx),%rax
je     155f <main+0x40f>
movsbl 0x7(%rsp),%edi
mov    %r12,%rsi
call   1030 <month@plt>
mov    %eax,%r15d
mov    %r12,%rdi
lea    0xe04(%rip),%rbx
mov    %rbx,%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1050 <fscanf@plt>
mov    0x8(%rsp),%eax
lea    (%rax,%rax,2),%eax
lea    (%r15,%rax,4),%eax
add    $0xffffa2b7,%eax
mov    %eax,0x8(%rsp)
mov    0x2d9b(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
mov    $0x1,%esi
call   1060 <fseek@plt>
mov    %r12,%rdi
mov    %rbp,%r15
mov    %rbp,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <fscanf@plt>
movsbl 0x7(%rsp),%edi
mov    %r12,%rsi
call   1030 <month@plt>
mov    %eax,%ebp
mov    %r12,%rdi
mov    %rbx,%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1050 <fscanf@plt>
mov    0xc(%rsp),%eax
lea    (%rax,%rax,2),%eax
lea    -0x5d49(%rbp,%rax,4),%eax
mov    %eax,0xc(%rsp)
mov    0x8(%rsp),%edx
cmp    %eax,%edx
ja     12d1 <main+0x181>
nopw   0x0(%rax,%rax,1)
mov    %edx,%esi
imul   %r14,%rsi
shr    $0x24,%rsi
imul   $0xffffffe2,%esi,%ecx
add    %edx,%ecx
mov    $0x1,%edi
shl    %cl,%edi
or     %edi,0x10(%rsp,%rsi,4)
add    $0x1,%edx
cmp    %eax,%edx
jbe    12b0 <main+0x160>
mov    %r12,%rdi
mov    %r15,%rbp
mov    %r15,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <fscanf@plt>
cmpb   $0x3b,0x7(%rsp)
je     11d0 <main+0x80>
pxor   %xmm1,%xmm1
xor    %eax,%eax
movdqa 0xd03(%rip),%xmm5
xorps  %xmm6,%xmm6
movdqa 0x10(%rsp,%rax,4),%xmm0
movdqa %xmm0,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm1,%xmm2
movdqa %xmm0,%xmm1
psrld  $0x1,%xmm1
pand   %xmm5,%xmm1
paddd  %xmm2,%xmm1
movdqa %xmm0,%xmm2
psrld  $0x2,%xmm2
pand   %xmm5,%xmm2
movdqa %xmm0,%xmm3
psrld  $0x3,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm2,%xmm3
paddd  %xmm1,%xmm3
movdqa %xmm0,%xmm1
psrld  $0x4,%xmm1
pand   %xmm5,%xmm1
movdqa %xmm0,%xmm2
psrld  $0x5,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm1,%xmm2
movdqa %xmm0,%xmm4
psrld  $0x6,%xmm4
pand   %xmm5,%xmm4
paddd  %xmm2,%xmm4
paddd  %xmm3,%xmm4
movdqa %xmm0,%xmm1
psrld  $0x7,%xmm1
pand   %xmm5,%xmm1
movdqa %xmm0,%xmm2
psrld  $0x8,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm1,%xmm2
movdqa %xmm0,%xmm3
psrld  $0x9,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm2,%xmm3
movdqa %xmm0,%xmm1
psrld  $0xa,%xmm1
pand   %xmm5,%xmm1
paddd  %xmm3,%xmm1
paddd  %xmm4,%xmm1
movdqa %xmm0,%xmm2
psrld  $0xb,%xmm2
pand   %xmm5,%xmm2
movdqa %xmm0,%xmm3
psrld  $0xc,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm2,%xmm3
movdqa %xmm0,%xmm2
psrld  $0xd,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm3,%xmm2
movdqa %xmm0,%xmm3
psrld  $0xe,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm2,%xmm3
movdqa %xmm0,%xmm2
psrld  $0xf,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm3,%xmm2
paddd  %xmm1,%xmm2
movdqa %xmm0,%xmm1
psrld  $0x10,%xmm1
pand   %xmm5,%xmm1
movdqa %xmm0,%xmm3
psrld  $0x11,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm1,%xmm3
movdqa %xmm0,%xmm1
psrld  $0x12,%xmm1
pand   %xmm5,%xmm1
paddd  %xmm3,%xmm1
movdqa %xmm0,%xmm3
psrld  $0x13,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm1,%xmm3
movdqa %xmm0,%xmm4
psrld  $0x14,%xmm4
pand   %xmm5,%xmm4
paddd  %xmm3,%xmm4
movdqa %xmm0,%xmm1
psrld  $0x15,%xmm1
pand   %xmm5,%xmm1
paddd  %xmm4,%xmm1
paddd  %xmm2,%xmm1
movdqa %xmm0,%xmm2
psrld  $0x16,%xmm2
pand   %xmm5,%xmm2
movdqa %xmm0,%xmm3
psrld  $0x17,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm2,%xmm3
movdqa %xmm0,%xmm2
psrld  $0x18,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm3,%xmm2
movdqa %xmm0,%xmm3
psrld  $0x19,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm2,%xmm3
movdqa %xmm0,%xmm2
psrld  $0x1a,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm3,%xmm2
movdqa %xmm0,%xmm3
psrld  $0x1b,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm2,%xmm3
movdqa %xmm0,%xmm2
psrld  $0x1c,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm3,%xmm2
paddd  %xmm1,%xmm2
psrld  $0x1d,%xmm0
pand   %xmm5,%xmm0
movdqa %xmm0,%xmm1
paddd  %xmm2,%xmm1
movaps %xmm6,0x10(%rsp,%rax,4)
add    $0x4,%rax
cmp    $0xc,%rax
jne    1300 <main+0x1b0>
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%esi
mov    $0xaaaaaaab,%eax
imul   %rax,%rsi
shr    $0x23,%rsi
lea    0xaee(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11e6 <main+0x96>
mov    (%rsi),%rsi
lea    0xabe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r15d
mov    %r15d,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.3 = [3 x i8] c"%u\00"
@SEEK_CUR = global i32 0
@.str.4 = [4 x i8] c"%u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [12 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = bitcast [12 x i32]* %14 to i8*
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 2
br i1 %17, label %18, label %23
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %21)
store i32 1, i32* %3
br label %126
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i32 1
store i8** %25, i8*** %5
%26 = load i8*, i8** %25
%27 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %27, i32** %6
br label %28
28: ; preds = %124, %23
%29 = load i32*, i32** %6
%30 = call i64 (i32*, i8*, ...) @fscanf(i32* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%31 = load i64, i64* @EOF
%32 = icmp ne i64 %30, %31
br i1 %32, label %33, label %125
33: ; preds = %28
%34 = load i8, i8* %7
%35 = load i32*, i32** %6
%36 = call i32 @month(i8 signext %34, i32* %35)
%37 = sub nsw i32 %36, 1
store i32 %37, i32* %11
%38 = load i32*, i32** %6
%39 = call i64 (i32*, i8*, ...) @fscanf(i32* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%40 = load i32, i32* %9
%41 = sub i32 %40, 1990
%42 = mul i32 12, %41
%43 = load i32, i32* %11
%44 = add i32 %42, %43
store i32 %44, i32* %9
%45 = load i32*, i32** %6
%46 = load i32, i32* @SEEK_CUR
%47 = call i32 @fseek(i32* %45, i32 1, i32 %46)
%48 = load i32*, i32** %6
%49 = call i64 (i32*, i8*, ...) @fscanf(i32* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%50 = load i8, i8* %7
%51 = load i32*, i32** %6
%52 = call i32 @month(i8 signext %50, i32* %51)
%53 = sub nsw i32 %52, 1
store i32 %53, i32* %11
%54 = load i32*, i32** %6
%55 = call i64 (i32*, i8*, ...) @fscanf(i32* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%56 = load i32, i32* %10
%57 = sub i32 %56, 1990
%58 = mul i32 12, %57
%59 = load i32, i32* %11
%60 = add i32 %58, %59
store i32 %60, i32* %10
%61 = load i32, i32* %9
store i32 %61, i32* %8
br label %62
62: ; preds = %76, %33
%63 = load i32, i32* %8
%64 = load i32, i32* %10
%65 = icmp ule i32 %63, %64
br i1 %65, label %66, label %79
66: ; preds = %62
%67 = load i32, i32* %8
%68 = urem i32 %67, 30
%69 = shl i32 1, %68
%70 = load i32, i32* %8
%71 = udiv i32 %70, 30
%72 = zext i32 %71 to i64
%73 = getelementptr inbounds [12 x i32], [12 x i32]* %14, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = or i32 %74, %69
store i32 %75, i32* %73
br label %76
76: ; preds = %66
%77 = load i32, i32* %8
%78 = add i32 %77, 1
store i32 %78, i32* %8
br label %62
79: ; preds = %62
%80 = load i32*, i32** %6
%81 = call i64 (i32*, i8*, ...) @fscanf(i32* %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%82 = load i8, i8* %7
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 59
br i1 %84, label %85, label %89
85: ; preds = %79
%86 = load i32*, i32** %6
%87 = load i32, i32* @SEEK_CUR
%88 = call i32 @fseek(i32* %86, i32 1, i32 %87)
br label %124
89: ; preds = %79
store i32 0, i32* %13
store i32 0, i32* %8
br label %90
90: ; preds = %117, %89
%91 = load i32, i32* %8
%92 = icmp ult i32 %91, 12
br i1 %92, label %93, label %120
93: ; preds = %90
store i32 0, i32* %12
br label %94
94: ; preds = %110, %93
%95 = load i32, i32* %12
%96 = icmp ult i32 %95, 30
br i1 %96, label %97, label %113
97: ; preds = %94
%98 = load i32, i32* %8
%99 = zext i32 %98 to i64
%100 = getelementptr inbounds [12 x i32], [12 x i32]* %14, i64 0, i64 %99
%101 = load i32, i32* %100
%102 = load i32, i32* %12
%103 = shl i32 1, %102
%104 = and i32 %101, %103
%105 = icmp ne i32 %104, 0
br i1 %105, label %106, label %109
106: ; preds = %97
%107 = load i32, i32* %13
%108 = add i32 %107, 1
store i32 %108, i32* %13
br label %109
109: ; preds = %106, %97
br label %110
110: ; preds = %109
%111 = load i32, i32* %12
%112 = add i32 %111, 1
store i32 %112, i32* %12
br label %94
113: ; preds = %94
%114 = load i32, i32* %8
%115 = zext i32 %114 to i64
%116 = getelementptr inbounds [12 x i32], [12 x i32]* %14, i64 0, i64 %115
store i32 0, i32* %116
br label %117
117: ; preds = %113
%118 = load i32, i32* %8
%119 = add i32 %118, 1
store i32 %119, i32* %8
br label %90
120: ; preds = %90
%121 = load i32, i32* %13
%122 = udiv i32 %121, 12
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %122)
br label %124
124: ; preds = %120, %85
br label %28
125: ; preds = %28
store i32 0, i32* %3
br label %126
126: ; preds = %125, %18
%127 = load i32, i32* %3
ret i32 %127
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.3 = [3 x i8] c"%u\00"
@SEEK_CUR = global i32 0
@.str.4 = [4 x i8] c"%u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca [12 x i32]
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = bitcast [12 x i32]* %6 to i8*
%10 = icmp eq i32 %0, 2
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i8*, i8** %1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %165
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%18 = call i64 (i32*, i8*, ...) @fscanf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%19 = load i64, i64* @EOF
%20 = icmp eq i64 %18, %19
br i1 %20, label %165, label %21
21: ; preds = %14, %161
%22 = load i8, i8* %3
%23 = call i32 @month(i8 signext %22, i32* %17)
%24 = call i64 (i32*, i8*, ...) @fscanf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%25 = load i32, i32* %4
%26 = mul i32 %25, 12
%27 = add i32 %23, -23881
%28 = add i32 %27, %26
store i32 %28, i32* %4
%29 = load i32, i32* @SEEK_CUR
%30 = call i32 @fseek(i32* %17, i32 1, i32 %29)
%31 = call i64 (i32*, i8*, ...) @fscanf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%32 = load i8, i8* %3
%33 = call i32 @month(i8 signext %32, i32* %17)
%34 = call i64 (i32*, i8*, ...) @fscanf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%35 = load i32, i32* %5
%36 = mul i32 %35, 12
%37 = add i32 %33, -23881
%38 = add i32 %37, %36
store i32 %38, i32* %5
%39 = load i32, i32* %4
%40 = icmp ugt i32 %39, %38
br i1 %40, label %52, label %41
41: ; preds = %21, %41
%42 = phi i32 [ %50, %41 ], [ %39, %21 ]
%43 = urem i32 %42, 30
%44 = shl nuw nsw i32 1, %43
%45 = udiv i32 %42, 30
%46 = zext i32 %45 to i64
%47 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = or i32 %48, %44
store i32 %49, i32* %47
%50 = add i32 %42, 1
%51 = icmp ugt i32 %50, %38
br i1 %51, label %52, label %41
52: ; preds = %41, %21
%53 = call i64 (i32*, i8*, ...) @fscanf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%54 = load i8, i8* %3
%55 = icmp eq i8 %54, 59
br i1 %55, label %158, label %56
56: ; preds = %52, %56
%57 = phi i64 [ %152, %56 ], [ 0, %52 ]
%58 = phi <4 x i32> [ %150, %56 ], [ zeroinitializer, %52 ]
%59 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 %57
%60 = bitcast i32* %59 to <4 x i32>*
%61 = load <4 x i32>, <4 x i32>* %60
%62 = and <4 x i32> %61, <i32 1, i32 1, i32 1, i32 1>
%63 = add <4 x i32> %62, %58
%64 = lshr <4 x i32> %61, <i32 1, i32 1, i32 1, i32 1>
%65 = and <4 x i32> %64, <i32 1, i32 1, i32 1, i32 1>
%66 = add <4 x i32> %65, %63
%67 = lshr <4 x i32> %61, <i32 2, i32 2, i32 2, i32 2>
%68 = and <4 x i32> %67, <i32 1, i32 1, i32 1, i32 1>
%69 = add <4 x i32> %68, %66
%70 = lshr <4 x i32> %61, <i32 3, i32 3, i32 3, i32 3>
%71 = and <4 x i32> %70, <i32 1, i32 1, i32 1, i32 1>
%72 = add <4 x i32> %71, %69
%73 = lshr <4 x i32> %61, <i32 4, i32 4, i32 4, i32 4>
%74 = and <4 x i32> %73, <i32 1, i32 1, i32 1, i32 1>
%75 = add <4 x i32> %74, %72
%76 = lshr <4 x i32> %61, <i32 5, i32 5, i32 5, i32 5>
%77 = and <4 x i32> %76, <i32 1, i32 1, i32 1, i32 1>
%78 = add <4 x i32> %77, %75
%79 = lshr <4 x i32> %61, <i32 6, i32 6, i32 6, i32 6>
%80 = and <4 x i32> %79, <i32 1, i32 1, i32 1, i32 1>
%81 = add <4 x i32> %80, %78
%82 = lshr <4 x i32> %61, <i32 7, i32 7, i32 7, i32 7>
%83 = and <4 x i32> %82, <i32 1, i32 1, i32 1, i32 1>
%84 = add <4 x i32> %83, %81
%85 = lshr <4 x i32> %61, <i32 8, i32 8, i32 8, i32 8>
%86 = and <4 x i32> %85, <i32 1, i32 1, i32 1, i32 1>
%87 = add <4 x i32> %86, %84
%88 = lshr <4 x i32> %61, <i32 9, i32 9, i32 9, i32 9>
%89 = and <4 x i32> %88, <i32 1, i32 1, i32 1, i32 1>
%90 = add <4 x i32> %89, %87
%91 = lshr <4 x i32> %61, <i32 10, i32 10, i32 10, i32 10>
%92 = and <4 x i32> %91, <i32 1, i32 1, i32 1, i32 1>
%93 = add <4 x i32> %92, %90
%94 = lshr <4 x i32> %61, <i32 11, i32 11, i32 11, i32 11>
%95 = and <4 x i32> %94, <i32 1, i32 1, i32 1, i32 1>
%96 = add <4 x i32> %95, %93
%97 = lshr <4 x i32> %61, <i32 12, i32 12, i32 12, i32 12>
%98 = and <4 x i32> %97, <i32 1, i32 1, i32 1, i32 1>
%99 = add <4 x i32> %98, %96
%100 = lshr <4 x i32> %61, <i32 13, i32 13, i32 13, i32 13>
%101 = and <4 x i32> %100, <i32 1, i32 1, i32 1, i32 1>
%102 = add <4 x i32> %101, %99
%103 = lshr <4 x i32> %61, <i32 14, i32 14, i32 14, i32 14>
%104 = and <4 x i32> %103, <i32 1, i32 1, i32 1, i32 1>
%105 = add <4 x i32> %104, %102
%106 = lshr <4 x i32> %61, <i32 15, i32 15, i32 15, i32 15>
%107 = and <4 x i32> %106, <i32 1, i32 1, i32 1, i32 1>
%108 = add <4 x i32> %107, %105
%109 = lshr <4 x i32> %61, <i32 16, i32 16, i32 16, i32 16>
%110 = and <4 x i32> %109, <i32 1, i32 1, i32 1, i32 1>
%111 = add <4 x i32> %110, %108
%112 = lshr <4 x i32> %61, <i32 17, i32 17, i32 17, i32 17>
%113 = and <4 x i32> %112, <i32 1, i32 1, i32 1, i32 1>
%114 = add <4 x i32> %113, %111
%115 = lshr <4 x i32> %61, <i32 18, i32 18, i32 18, i32 18>
%116 = and <4 x i32> %115, <i32 1, i32 1, i32 1, i32 1>
%117 = add <4 x i32> %116, %114
%118 = lshr <4 x i32> %61, <i32 19, i32 19, i32 19, i32 19>
%119 = and <4 x i32> %118, <i32 1, i32 1, i32 1, i32 1>
%120 = add <4 x i32> %119, %117
%121 = lshr <4 x i32> %61, <i32 20, i32 20, i32 20, i32 20>
%122 = and <4 x i32> %121, <i32 1, i32 1, i32 1, i32 1>
%123 = add <4 x i32> %122, %120
%124 = lshr <4 x i32> %61, <i32 21, i32 21, i32 21, i32 21>
%125 = and <4 x i32> %124, <i32 1, i32 1, i32 1, i32 1>
%126 = add <4 x i32> %125, %123
%127 = lshr <4 x i32> %61, <i32 22, i32 22, i32 22, i32 22>
%128 = and <4 x i32> %127, <i32 1, i32 1, i32 1, i32 1>
%129 = add <4 x i32> %128, %126
%130 = lshr <4 x i32> %61, <i32 23, i32 23, i32 23, i32 23>
%131 = and <4 x i32> %130, <i32 1, i32 1, i32 1, i32 1>
%132 = add <4 x i32> %131, %129
%133 = lshr <4 x i32> %61, <i32 24, i32 24, i32 24, i32 24>
%134 = and <4 x i32> %133, <i32 1, i32 1, i32 1, i32 1>
%135 = add <4 x i32> %134, %132
%136 = lshr <4 x i32> %61, <i32 25, i32 25, i32 25, i32 25>
%137 = and <4 x i32> %136, <i32 1, i32 1, i32 1, i32 1>
%138 = add <4 x i32> %137, %135
%139 = lshr <4 x i32> %61, <i32 26, i32 26, i32 26, i32 26>
%140 = and <4 x i32> %139, <i32 1, i32 1, i32 1, i32 1>
%141 = add <4 x i32> %140, %138
%142 = lshr <4 x i32> %61, <i32 27, i32 27, i32 27, i32 27>
%143 = and <4 x i32> %142, <i32 1, i32 1, i32 1, i32 1>
%144 = add <4 x i32> %143, %141
%145 = lshr <4 x i32> %61, <i32 28, i32 28, i32 28, i32 28>
%146 = and <4 x i32> %145, <i32 1, i32 1, i32 1, i32 1>
%147 = add <4 x i32> %146, %144
%148 = lshr <4 x i32> %61, <i32 29, i32 29, i32 29, i32 29>
%149 = and <4 x i32> %148, <i32 1, i32 1, i32 1, i32 1>
%150 = add <4 x i32> %149, %147
%151 = bitcast i32* %59 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %151
%152 = add nuw i64 %57, 4
%153 = icmp eq i64 %152, 12
br i1 %153, label %154, label %56
154: ; preds = %56
%155 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %150)
%156 = udiv i32 %155, 12
%157 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %156)
br label %161
158: ; preds = %52
%159 = load i32, i32* @SEEK_CUR
%160 = call i32 @fseek(i32* %17, i32 1, i32 %159)
br label %161
161: ; preds = %154, %158
%162 = call i64 (i32*, i8*, ...) @fscanf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%163 = load i64, i64* @EOF
%164 = icmp eq i64 %162, %163
br i1 %164, label %165, label %21
165: ; preds = %161, %14, %11
%166 = phi i32 [ 1, %11 ], [ 0, %14 ], [ 0, %161 ]
ret i32 %166
}