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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
scalar_t__ strcmp(char *, char *);
int main() {
  int t, i, count, j, m;
  char s1[5], s2[5];
  scanf("%d", &t);
  for (i = 0; i < t; i++) {
    count = 0;
    scanf("%s %s", s1, s2);
    if (strcmp(s1, "JAN") == 0)
      m = 31;
    else if (strcmp(s1, "FEB") == 0)
      m = 28;
    else if (strcmp(s1, "MAR") == 0)
      m = 31;
    else if (strcmp(s1, "APR") == 0)
      m = 30;
    else if (strcmp(s1, "MAY") == 0)
      m = 31;
    else if (strcmp(s1, "JUN") == 0)
      m = 30;
    else if (strcmp(s1, "JUL") == 0)
      m = 31;
    else if (strcmp(s1, "AUG") == 0)
      m = 31;
    else if (strcmp(s1, "SEP") == 0)
      m = 30;
    else if (strcmp(s1, "OCT") == 0)
      m = 31;
    else if (strcmp(s1, "NOV") == 0)
      m = 30;
    else if (strcmp(s1, "DEC") == 0)
      m = 31;
    if (strcmp(s2, "SUN") == 0)
      j = 1;
    else if (strcmp(s2, "MON") == 0)
      j = 2;
    else if (strcmp(s2, "TUE") == 0)
      j = 3;
    else if (strcmp(s2, "WED") == 0)
      j = 4;
    else if (strcmp(s2, "THU") == 0)
      j = 5;
    else if (strcmp(s2, "FRI") == 0)
      j = 6;
    else if (strcmp(s2, "SAT") == 0)
      j = 7;
    m = m + j;
    for (j; j < m; j++) {
      if (j % 7 == 6 || j % 7 == 0)
        count++;
    }
    printf("%d\n", count);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1514 <main+0x3e4>
movl   $0x0,-0x10(%rbp)
lea    -0x1d(%rbp),%rsi
lea    -0x22(%rbp),%rdx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x1d(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11a7 <main+0x77>
movl   $0x1f,-0x18(%rbp)
jmp    137b <main+0x24b>
lea    -0x1d(%rbp),%rdi
lea    0xe5b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11cd <main+0x9d>
movl   $0x1c,-0x18(%rbp)
jmp    1376 <main+0x246>
lea    -0x1d(%rbp),%rdi
lea    0xe39(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11f3 <main+0xc3>
movl   $0x1f,-0x18(%rbp)
jmp    1371 <main+0x241>
lea    -0x1d(%rbp),%rdi
lea    0xe17(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1219 <main+0xe9>
movl   $0x1e,-0x18(%rbp)
jmp    136c <main+0x23c>
lea    -0x1d(%rbp),%rdi
lea    0xdf5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    123f <main+0x10f>
movl   $0x1f,-0x18(%rbp)
jmp    1367 <main+0x237>
lea    -0x1d(%rbp),%rdi
lea    0xdd3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1265 <main+0x135>
movl   $0x1e,-0x18(%rbp)
jmp    1362 <main+0x232>
lea    -0x1d(%rbp),%rdi
lea    0xdb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    128b <main+0x15b>
movl   $0x1f,-0x18(%rbp)
jmp    135d <main+0x22d>
lea    -0x1d(%rbp),%rdi
lea    0xd8f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12b1 <main+0x181>
movl   $0x1f,-0x18(%rbp)
jmp    1358 <main+0x228>
lea    -0x1d(%rbp),%rdi
lea    0xd6d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12d7 <main+0x1a7>
movl   $0x1e,-0x18(%rbp)
jmp    1353 <main+0x223>
lea    -0x1d(%rbp),%rdi
lea    0xd4b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12fd <main+0x1cd>
movl   $0x1f,-0x18(%rbp)
jmp    134e <main+0x21e>
lea    -0x1d(%rbp),%rdi
lea    0xd29(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1323 <main+0x1f3>
movl   $0x1e,-0x18(%rbp)
jmp    1349 <main+0x219>
lea    -0x1d(%rbp),%rdi
lea    0xd07(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1344 <main+0x214>
movl   $0x1f,-0x18(%rbp)
jmp    1349 <main+0x219>
jmp    134e <main+0x21e>
jmp    1353 <main+0x223>
jmp    1358 <main+0x228>
jmp    135d <main+0x22d>
jmp    1362 <main+0x232>
jmp    1367 <main+0x237>
jmp    136c <main+0x23c>
jmp    1371 <main+0x241>
jmp    1376 <main+0x246>
jmp    137b <main+0x24b>
lea    -0x22(%rbp),%rdi
lea    0xcb3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    13a1 <main+0x271>
movl   $0x1,-0x14(%rbp)
jmp    149e <main+0x36e>
lea    -0x22(%rbp),%rdi
lea    0xc91(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    13c7 <main+0x297>
movl   $0x2,-0x14(%rbp)
jmp    1499 <main+0x369>
lea    -0x22(%rbp),%rdi
lea    0xc6f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    13ed <main+0x2bd>
movl   $0x3,-0x14(%rbp)
jmp    1494 <main+0x364>
lea    -0x22(%rbp),%rdi
lea    0xc4d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1413 <main+0x2e3>
movl   $0x4,-0x14(%rbp)
jmp    148f <main+0x35f>
lea    -0x22(%rbp),%rdi
lea    0xc2b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1439 <main+0x309>
movl   $0x5,-0x14(%rbp)
jmp    148a <main+0x35a>
lea    -0x22(%rbp),%rdi
lea    0xc09(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    145f <main+0x32f>
movl   $0x6,-0x14(%rbp)
jmp    1485 <main+0x355>
lea    -0x22(%rbp),%rdi
lea    0xbe7(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1480 <main+0x350>
movl   $0x7,-0x14(%rbp)
jmp    1485 <main+0x355>
jmp    148a <main+0x35a>
jmp    148f <main+0x35f>
jmp    1494 <main+0x364>
jmp    1499 <main+0x369>
jmp    149e <main+0x36e>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    14f7 <main+0x3c7>
mov    -0x14(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x6,%edx
je     14db <main+0x3ab>
mov    -0x14(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    14e4 <main+0x3b4>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    14e9 <main+0x3b9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    14a7 <main+0x377>
mov    -0x10(%rbp),%esi
lea    0xb54(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <main+0x28>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1457 <main+0x327>
lea    0x13(%rsp),%rbx
lea    0xe(%rsp),%r15
xor    %r14d,%r14d
jmp    1195 <main+0x65>
nopl   0x0(%rax,%rax,1)
cmp    %eax,%r13d
cmovg  %r13d,%eax
mov    %eax,%r12d
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x1,%r14d
cmp    0x8(%rsp),%r14d
jge    1457 <main+0x327>
lea    0xe67(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
lea    0xe56(%rip),%rsi
call   1040 <strcmp@plt>
mov    $0x1f,%ebp
test   %rax,%rax
je     1300 <main+0x1d0>
mov    %rbx,%rdi
lea    0xe3d(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12f0 <main+0x1c0>
mov    %rbx,%rdi
lea    0xe29(%rip),%rsi
call   1040 <strcmp@plt>
mov    $0x1f,%ebp
test   %rax,%rax
je     1300 <main+0x1d0>
mov    %rbx,%rdi
lea    0xe10(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12f7 <main+0x1c7>
mov    %rbx,%rdi
lea    0xdfc(%rip),%rsi
call   1040 <strcmp@plt>
mov    $0x1f,%ebp
test   %rax,%rax
je     1300 <main+0x1d0>
mov    %rbx,%rdi
lea    0xde3(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12f7 <main+0x1c7>
mov    %rbx,%rdi
lea    0xdcf(%rip),%rsi
call   1040 <strcmp@plt>
mov    $0x1f,%ebp
test   %rax,%rax
je     1300 <main+0x1d0>
mov    %rbx,%rdi
lea    0xdb6(%rip),%rsi
call   1040 <strcmp@plt>
mov    $0x1f,%ebp
test   %rax,%rax
je     1300 <main+0x1d0>
mov    %rbx,%rdi
lea    0xd9d(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12f7 <main+0x1c7>
mov    %rbx,%rdi
lea    0xd8d(%rip),%rsi
call   1040 <strcmp@plt>
mov    $0x1f,%ebp
test   %rax,%rax
je     1300 <main+0x1d0>
mov    %rbx,%rdi
lea    0xd78(%rip),%rsi
call   1040 <strcmp@plt>
mov    $0x1e,%ebp
test   %rax,%rax
je     1300 <main+0x1d0>
mov    %rbx,%rdi
lea    0xd63(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
mov    $0x1f,%eax
cmove  %eax,%r13d
mov    %r13d,%ebp
jmp    1300 <main+0x1d0>
nopl   0x0(%rax,%rax,1)
mov    $0x1c,%ebp
jmp    1300 <main+0x1d0>
mov    $0x1e,%ebp
nopl   0x0(%rax)
mov    %r15,%rdi
lea    0xd2f(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     13a0 <main+0x270>
mov    %r15,%rdi
lea    0xd1b(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     13b0 <main+0x280>
mov    %r15,%rdi
lea    0xd07(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     13b8 <main+0x288>
mov    %r15,%rdi
lea    0xcf7(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     13c0 <main+0x290>
mov    %r15,%rdi
lea    0xce7(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     13c8 <main+0x298>
mov    %r15,%rdi
lea    0xcd7(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     13d0 <main+0x2a0>
mov    %r15,%rdi
lea    0xcc7(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
mov    $0x7,%eax
cmove  %eax,%r12d
jmp    13e0 <main+0x2b0>
nopl   (%rax)
mov    $0x1,%r12d
jmp    13e0 <main+0x2b0>
nopl   0x0(%rax,%rax,1)
mov    $0x2,%r12d
jmp    13e0 <main+0x2b0>
mov    $0x3,%r12d
jmp    13e0 <main+0x2b0>
mov    $0x4,%r12d
jmp    13e0 <main+0x2b0>
mov    $0x5,%r12d
jmp    13e0 <main+0x2b0>
mov    $0x6,%r12d
cs nopw 0x0(%rax,%rax,1)
lea    (%r12,%rbp,1),%r13d
test   %ebp,%ebp
jle    1450 <main+0x320>
lea    0x1(%r12),%eax
xor    %esi,%esi
jmp    1410 <main+0x2e0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%esi
add    $0x1,%r12d
cmp    %r13d,%r12d
jge    1170 <main+0x40>
movslq %r12d,%rcx
imul   $0xffffffff92492493,%rcx,%rcx
shr    $0x20,%rcx
add    %r12d,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %r12d,%ecx
cmp    $0x6,%ecx
je     1400 <main+0x2d0>
test   %ecx,%ecx
je     1400 <main+0x2d0>
jmp    1403 <main+0x2d3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %esi,%esi
jmp    117a <main+0x4a>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%s %s\00"
@.str.2 = [4 x i8] c"JAN\00"
@.str.3 = [4 x i8] c"FEB\00"
@.str.4 = [4 x i8] c"MAR\00"
@.str.5 = [4 x i8] c"APR\00"
@.str.6 = [4 x i8] c"MAY\00"
@.str.7 = [4 x i8] c"JUN\00"
@.str.8 = [4 x i8] c"JUL\00"
@.str.9 = [4 x i8] c"AUG\00"
@.str.10 = [4 x i8] c"SEP\00"
@.str.11 = [4 x i8] c"OCT\00"
@.str.12 = [4 x i8] c"NOV\00"
@.str.13 = [4 x i8] c"DEC\00"
@.str.14 = [4 x i8] c"SUN\00"
@.str.15 = [4 x i8] c"MON\00"
@.str.16 = [4 x i8] c"TUE\00"
@.str.17 = [4 x i8] c"WED\00"
@.str.18 = [4 x i8] c"THU\00"
@.str.19 = [4 x i8] c"FRI\00"
@.str.20 = [4 x i8] c"SAT\00"
@.str.21 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [5 x i8]
%8 = alloca [5 x i8]
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %10
10: ; preds = %156, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %159
14: ; preds = %10
store i32 0, i32* %4
%15 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %16)
%18 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %14
store i32 31, i32* %6
br label %88
22: ; preds = %14
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 28, i32* %6
br label %87
27: ; preds = %22
%28 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 31, i32* %6
br label %86
32: ; preds = %27
%33 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 30, i32* %6
br label %85
37: ; preds = %32
%38 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 31, i32* %6
br label %84
42: ; preds = %37
%43 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 30, i32* %6
br label %83
47: ; preds = %42
%48 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %47
store i32 31, i32* %6
br label %82
52: ; preds = %47
%53 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %57
56: ; preds = %52
store i32 31, i32* %6
br label %81
57: ; preds = %52
%58 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %57
store i32 30, i32* %6
br label %80
62: ; preds = %57
%63 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%64 = call i64 @strcmp(i8* %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %62
store i32 31, i32* %6
br label %79
67: ; preds = %62
%68 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%69 = call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %67
store i32 30, i32* %6
br label %78
72: ; preds = %67
%73 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%74 = call i64 @strcmp(i8* %73, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %72
store i32 31, i32* %6
br label %77
77: ; preds = %76, %72
br label %78
78: ; preds = %77, %71
br label %79
79: ; preds = %78, %66
br label %80
80: ; preds = %79, %61
br label %81
81: ; preds = %80, %56
br label %82
82: ; preds = %81, %51
br label %83
83: ; preds = %82, %46
br label %84
84: ; preds = %83, %41
br label %85
85: ; preds = %84, %36
br label %86
86: ; preds = %85, %31
br label %87
87: ; preds = %86, %26
br label %88
88: ; preds = %87, %21
%89 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%90 = call i64 @strcmp(i8* %89, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %93
92: ; preds = %88
store i32 1, i32* %5
br label %129
93: ; preds = %88
%94 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %98
97: ; preds = %93
store i32 2, i32* %5
br label %128
98: ; preds = %93
%99 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%100 = call i64 @strcmp(i8* %99, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
br i1 %101, label %102, label %103
102: ; preds = %98
store i32 3, i32* %5
br label %127
103: ; preds = %98
%104 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%105 = call i64 @strcmp(i8* %104, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%106 = icmp eq i64 %105, 0
br i1 %106, label %107, label %108
107: ; preds = %103
store i32 4, i32* %5
br label %126
108: ; preds = %103
%109 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%110 = call i64 @strcmp(i8* %109, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
%111 = icmp eq i64 %110, 0
br i1 %111, label %112, label %113
112: ; preds = %108
store i32 5, i32* %5
br label %125
113: ; preds = %108
%114 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%115 = call i64 @strcmp(i8* %114, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0))
%116 = icmp eq i64 %115, 0
br i1 %116, label %117, label %118
117: ; preds = %113
store i32 6, i32* %5
br label %124
118: ; preds = %113
%119 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%120 = call i64 @strcmp(i8* %119, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %123
122: ; preds = %118
store i32 7, i32* %5
br label %123
123: ; preds = %122, %118
br label %124
124: ; preds = %123, %117
br label %125
125: ; preds = %124, %112
br label %126
126: ; preds = %125, %107
br label %127
127: ; preds = %126, %102
br label %128
128: ; preds = %127, %97
br label %129
129: ; preds = %128, %92
%130 = load i32, i32* %6
%131 = load i32, i32* %5
%132 = add nsw i32 %130, %131
store i32 %132, i32* %6
%133 = load i32, i32* %5
br label %134
134: ; preds = %150, %129
%135 = load i32, i32* %5
%136 = load i32, i32* %6
%137 = icmp slt i32 %135, %136
br i1 %137, label %138, label %153
138: ; preds = %134
%139 = load i32, i32* %5
%140 = srem i32 %139, 7
%141 = icmp eq i32 %140, 6
br i1 %141, label %146, label %142
142: ; preds = %138
%143 = load i32, i32* %5
%144 = srem i32 %143, 7
%145 = icmp eq i32 %144, 0
br i1 %145, label %146, label %149
146: ; preds = %142, %138
%147 = load i32, i32* %4
%148 = add nsw i32 %147, 1
store i32 %148, i32* %4
br label %149
149: ; preds = %146, %142
br label %150
150: ; preds = %149
%151 = load i32, i32* %5
%152 = add nsw i32 %151, 1
store i32 %152, i32* %5
br label %134
153: ; preds = %134
%154 = load i32, i32* %4
%155 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), i32 %154)
br label %156
156: ; preds = %153
%157 = load i32, i32* %3
%158 = add nsw i32 %157, 1
store i32 %158, i32* %3
br label %10
159: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%s %s\00"
@.str.2 = [4 x i8] c"JAN\00"
@.str.3 = [4 x i8] c"FEB\00"
@.str.4 = [4 x i8] c"MAR\00"
@.str.5 = [4 x i8] c"APR\00"
@.str.6 = [4 x i8] c"MAY\00"
@.str.7 = [4 x i8] c"JUN\00"
@.str.8 = [4 x i8] c"JUL\00"
@.str.9 = [4 x i8] c"AUG\00"
@.str.10 = [4 x i8] c"SEP\00"
@.str.11 = [4 x i8] c"OCT\00"
@.str.12 = [4 x i8] c"NOV\00"
@.str.13 = [4 x i8] c"DEC\00"
@.str.14 = [4 x i8] c"SUN\00"
@.str.15 = [4 x i8] c"MON\00"
@.str.16 = [4 x i8] c"TUE\00"
@.str.17 = [4 x i8] c"WED\00"
@.str.18 = [4 x i8] c"THU\00"
@.str.19 = [4 x i8] c"FRI\00"
@.str.20 = [4 x i8] c"SAT\00"
@.str.21 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [5 x i8]
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %99
10: ; preds = %0, %92
%11 = phi i32 [ %76, %92 ], [ undef, %0 ]
%12 = phi i32 [ %94, %92 ], [ undef, %0 ]
%13 = phi i32 [ %96, %92 ], [ 0, %0 ]
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6)
%15 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %51, label %17
17: ; preds = %10
%18 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %51, label %20
20: ; preds = %17
%21 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %51, label %23
23: ; preds = %20
%24 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %51, label %26
26: ; preds = %23
%27 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %51, label %29
29: ; preds = %26
%30 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %51, label %32
32: ; preds = %29
%33 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %51, label %35
35: ; preds = %32
%36 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %51, label %38
38: ; preds = %35
%39 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %51, label %41
41: ; preds = %38
%42 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %51, label %44
44: ; preds = %41
%45 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %51, label %47
47: ; preds = %44
%48 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
%50 = select i1 %49, i32 31, i32 %11
br label %51
51: ; preds = %47, %44, %41, %38, %35, %32, %29, %26, %23, %20, %17, %10
%52 = phi i32 [ 31, %10 ], [ 28, %17 ], [ 31, %20 ], [ 30, %23 ], [ 31, %26 ], [ 30, %29 ], [ 31, %32 ], [ 31, %35 ], [ 30, %38 ], [ 31, %41 ], [ 30, %44 ], [ %50, %47 ]
%53 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %74, label %55
55: ; preds = %51
%56 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %74, label %58
58: ; preds = %55
%59 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %74, label %61
61: ; preds = %58
%62 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %74, label %64
64: ; preds = %61
%65 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %74, label %67
67: ; preds = %64
%68 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %74, label %70
70: ; preds = %67
%71 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
%73 = select i1 %72, i32 7, i32 %12
br label %74
74: ; preds = %70, %67, %64, %61, %58, %55, %51
%75 = phi i32 [ 1, %51 ], [ 2, %55 ], [ 3, %58 ], [ 4, %61 ], [ 5, %64 ], [ 6, %67 ], [ %73, %70 ]
%76 = add i32 %75, %52
%77 = icmp sgt i32 %52, 0
br i1 %77, label %78, label %92
78: ; preds = %74
%79 = add i32 %75, 1
br label %80
80: ; preds = %78, %86
%81 = phi i32 [ %88, %86 ], [ %75, %78 ]
%82 = phi i32 [ %87, %86 ], [ 0, %78 ]
%83 = srem i32 %81, 7
switch i32 %83, label %86 [
i32 6, label %84
i32 0, label %84
]
84: ; preds = %80, %80
%85 = add nsw i32 %82, 1
br label %86
86: ; preds = %80, %84
%87 = phi i32 [ %85, %84 ], [ %82, %80 ]
%88 = add nsw i32 %81, 1
%89 = icmp slt i32 %88, %76
br i1 %89, label %80, label %90
90: ; preds = %86
%91 = call i32 @llvm.smax.i32(i32 %76, i32 %79)
br label %92
92: ; preds = %90, %74
%93 = phi i32 [ 0, %74 ], [ %87, %90 ]
%94 = phi i32 [ %75, %74 ], [ %91, %90 ]
%95 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), i32 %93)
%96 = add nuw nsw i32 %13, 1
%97 = load i32, i32* %1
%98 = icmp slt i32 %96, %97
br i1 %98, label %10, label %99
99: ; preds = %92, %0
ret i32 0
}