#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 main() {
  int cycle[48] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
                   31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
                   31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
                   31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int count = 0;
  int dow = 2;
  int i;
  for (i = 0; i < 25; ++i) {
    int j;
    for (j = 0; j < 48; ++j) {
      if (!dow)
        count++;
      dow = (dow + cycle[j]) % 7;
    }
  }
  printf("%d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0xc0,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0xd4(%rbp)
movl   $0x2,-0xd8(%rbp)
movl   $0x0,-0xdc(%rbp)
cmpl   $0x19,-0xdc(%rbp)
jge    11f7 <main+0xd7>
movl   $0x0,-0xe0(%rbp)
cmpl   $0x30,-0xe0(%rbp)
jge    11de <main+0xbe>
cmpl   $0x0,-0xd8(%rbp)
jne    11a8 <main+0x88>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
mov    -0xd8(%rbp),%eax
movslq -0xe0(%rbp),%rcx
add    -0xd0(%rbp,%rcx,4),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0xd8(%rbp)
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    117f <main+0x5f>
jmp    11e3 <main+0xc3>
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    1168 <main+0x48>
mov    -0xd4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
xor    %r8d,%r8d
lea    0xee0(%rip),%r9
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x1,%edi
adc    $0x0,%esi
add    -0x4(%r9,%rdx,4),%edi
movslq %edi,%rdi
imul   $0xffffffff92492493,%rdi,%rax
shr    $0x20,%rax
add    %edi,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x2,%eax
add    %ecx,%eax
lea    0x0(,%rax,8),%ecx
sub    %ecx,%eax
add    %edi,%eax
cmp    $0x1,%eax
adc    $0x0,%esi
add    (%r9,%rdx,4),%eax
cltq
imul   $0xffffffff92492493,%rax,%rdi
shr    $0x20,%rdi
add    %eax,%edi
mov    %edi,%ecx
shr    $0x1f,%ecx
sar    $0x2,%edi
add    %ecx,%edi
lea    0x0(,%rdi,8),%ecx
sub    %ecx,%edi
add    %eax,%edi
add    $0x2,%rdx
cmp    $0x31,%rdx
jne    1140 <main+0x30>
add    $0x1,%r8d
cmp    $0x19,%r8d
jne    1130 <main+0x20>
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.cycle = [48 x i32] [i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [48 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [48 x i32]* %2 to i8*
store i32 0, i32* %3
store i32 2, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %33, %0
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 25
br i1 %10, label %11, label %36
11: ; preds = %8
store i32 0, i32* %6
br label %12
12: ; preds = %29, %11
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 48
br i1 %14, label %15, label %32
15: ; preds = %12
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %21
21: ; preds = %18, %15
%22 = load i32, i32* %4
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [48 x i32], [48 x i32]* %2, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = add nsw i32 %22, %26
%28 = srem i32 %27, 7
store i32 %28, i32* %4
br label %29
29: ; preds = %21
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %12
32: ; preds = %12
br label %33
33: ; preds = %32
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %8
36: ; preds = %8
%37 = load i32, i32* %3
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %37)
ret i32 0
}

LLVM IR (-O2):
@__const.main.cycle = [48 x i32] [i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %26
%2 = phi i32 [ 0, %0 ], [ %27, %26 ]
%3 = phi i32 [ 2, %0 ], [ %23, %26 ]
%4 = phi i32 [ 0, %0 ], [ %19, %26 ]
br label %5
5: ; preds = %5, %1
%6 = phi i64 [ 0, %1 ], [ %24, %5 ]
%7 = phi i32 [ %3, %1 ], [ %23, %5 ]
%8 = phi i32 [ %4, %1 ], [ %19, %5 ]
%9 = icmp eq i32 %7, 0
%10 = zext i1 %9 to i32
%11 = add nsw i32 %8, %10
%12 = getelementptr inbounds [48 x i32], [48 x i32]* @__const.main.cycle, i64 0, i64 %6
%13 = load i32, i32* %12
%14 = add nsw i32 %13, %7
%15 = srem i32 %14, 7
%16 = or i64 %6, 1
%17 = icmp eq i32 %15, 0
%18 = zext i1 %17 to i32
%19 = add nsw i32 %11, %18
%20 = getelementptr inbounds [48 x i32], [48 x i32]* @__const.main.cycle, i64 0, i64 %16
%21 = load i32, i32* %20
%22 = add nsw i32 %21, %15
%23 = srem i32 %22, 7
%24 = add nuw nsw i64 %6, 2
%25 = icmp eq i64 %24, 48
br i1 %25, label %26, label %5
26: ; preds = %5
%27 = add nuw nsw i32 %2, 1
%28 = icmp eq i32 %27, 25
br i1 %28, label %29, label %1
29: ; preds = %26
%30 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}