#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 */
size_t calu(int, int, int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int main() {
  FILE *fin = fopen("friday.in", "r");
  FILE *fout = fopen("friday.out", "w");
  int n;
  fscanf(fin, "%d", &n);
  int start = 1900;
  int days[7] = {0};
  for (int i = 0; i < n; i++)
    for (int j = 1; j <= 12; j++)
      days[calu(start + i, j, 13)]++;
  fprintf(fout, "%d ", days[6]);
  for (int i = 0; i < 6; i++) {
    fprintf(fout, "%d", days[i]);
    if (i < 5)
      fprintf(fout, "%c", ' ');
    else
      fprintf(fout, "%c", '\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe8f(%rip),%rdi
lea    0xe93(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe81(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <fscanf@plt>
movl   $0x76c,-0x20(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   1030 <memset@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    121b <main+0xcb>
movl   $0x1,-0x48(%rbp)
cmpl   $0xc,-0x48(%rbp)
jg     1208 <main+0xb8>
mov    -0x20(%rbp),%edi
add    -0x44(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    $0xd,%edx
call   1050 <calu@plt>
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    11d2 <main+0x82>
jmp    120d <main+0xbd>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11bf <main+0x6f>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%eax
lea    0xdf3(%rip),%rsi
movsbl %al,%edx
call   1060 <fprintf@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0x6,-0x4c(%rbp)
jge    12a9 <main+0x159>
mov    -0x18(%rbp),%rdi
movslq -0x4c(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
lea    0xdc4(%rip),%rsi
movsbl %al,%edx
call   1060 <fprintf@plt>
cmpl   $0x5,-0x4c(%rbp)
jge    1281 <main+0x131>
mov    -0x18(%rbp),%rdi
lea    0xdae(%rip),%rsi
mov    $0x20,%edx
call   1060 <fprintf@plt>
jmp    1296 <main+0x146>
mov    -0x18(%rbp),%rdi
lea    0xd94(%rip),%rsi
mov    $0xa,%edx
call   1060 <fprintf@plt>
jmp    129b <main+0x14b>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1238 <main+0xe8>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xea1(%rip),%rdi
lea    0xea4(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbp
lea    0xe97(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r14
lea    0xe8e(%rip),%rsi
lea    0x1c(%rsp),%rdx
mov    %rbp,%rdi
call   1030 <fscanf@plt>
xorps  %xmm0,%xmm0
movups %xmm0,0xc(%rsp)
movaps %xmm0,(%rsp)
xor    %ebx,%ebx
cmpl   $0x0,0x1c(%rsp)
jle    12d3 <main+0x183>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x76c(%rbx),%ebp
mov    %ebp,%edi
mov    $0x1,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
mov    %ebp,%edi
mov    $0x2,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
mov    %ebp,%edi
mov    $0x3,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
mov    %ebp,%edi
mov    $0x4,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
mov    %ebp,%edi
mov    $0x5,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
mov    %ebp,%edi
mov    $0x6,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
mov    %ebp,%edi
mov    $0x7,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
mov    %ebp,%edi
mov    $0x8,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
mov    %ebp,%edi
mov    $0x9,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
mov    %ebp,%edi
mov    $0xa,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
mov    %ebp,%edi
mov    $0xb,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
mov    %ebp,%edi
mov    $0xc,%esi
mov    $0xd,%edx
call   1050 <calu@plt>
addl   $0x1,(%rsp,%rax,4)
add    $0x1,%ebx
cmp    0x1c(%rsp),%ebx
jl     11c0 <main+0x70>
mov    0x18(%rsp),%bl
movsbl %bl,%edx
lea    0xd3f(%rip),%rsi
mov    %r14,%rdi
call   1060 <fprintf@plt>
movsbl (%rsp),%edx
lea    0xd29(%rip),%rbp
mov    %r14,%rdi
mov    %rbp,%rsi
call   1060 <fprintf@plt>
mov    $0x20,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
movsbl 0x4(%rsp),%edx
mov    %r14,%rdi
mov    %rbp,%rsi
call   1060 <fprintf@plt>
mov    $0x20,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
movsbl 0x8(%rsp),%edx
mov    %r14,%rdi
mov    %rbp,%rsi
call   1060 <fprintf@plt>
mov    $0x20,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
movsbl 0xc(%rsp),%edx
mov    %r14,%rdi
mov    %rbp,%rsi
call   1060 <fprintf@plt>
mov    $0x20,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
movsbl 0x10(%rsp),%edx
mov    %r14,%rdi
mov    %rbp,%rsi
call   1060 <fprintf@plt>
mov    $0x20,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
movsbl 0x14(%rsp),%edx
mov    %r14,%rdi
mov    %rbp,%rsi
call   1060 <fprintf@plt>
mov    $0xa,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"friday.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"friday.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [4 x i8] c"%d \00"
@.str.6 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca [7 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %2
%11 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %11, i32** %3
%12 = load i32*, i32** %2
%13 = call i32 @fscanf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
store i32 1900, i32* %5
%14 = bitcast [7 x i32]* %6 to i8*
store i32 0, i32* %7
br label %15
15: ; preds = %36, %0
%16 = load i32, i32* %7
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %39
19: ; preds = %15
store i32 1, i32* %8
br label %20
20: ; preds = %32, %19
%21 = load i32, i32* %8
%22 = icmp sle i32 %21, 12
br i1 %22, label %23, label %35
23: ; preds = %20
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %8
%28 = call i64 @calu(i32 %26, i32 %27, i32 13)
%29 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = add nsw i32 %30, 1
store i32 %31, i32* %29
br label %32
32: ; preds = %23
%33 = load i32, i32* %8
%34 = add nsw i32 %33, 1
store i32 %34, i32* %8
br label %20
35: ; preds = %20
br label %36
36: ; preds = %35
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 1
store i32 %38, i32* %7
br label %15
39: ; preds = %15
%40 = load i32*, i32** %3
%41 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 6
%42 = load i32, i32* %41
%43 = trunc i32 %42 to i8
%44 = call i32 @fprintf(i32* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8 signext %43)
store i32 0, i32* %9
br label %45
45: ; preds = %65, %39
%46 = load i32, i32* %9
%47 = icmp slt i32 %46, 6
br i1 %47, label %48, label %68
48: ; preds = %45
%49 = load i32*, i32** %3
%50 = load i32, i32* %9
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = trunc i32 %53 to i8
%55 = call i32 @fprintf(i32* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8 signext %54)
%56 = load i32, i32* %9
%57 = icmp slt i32 %56, 5
br i1 %57, label %58, label %61
58: ; preds = %48
%59 = load i32*, i32** %3
%60 = call i32 @fprintf(i32* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8 signext 32)
br label %64
61: ; preds = %48
%62 = load i32*, i32** %3
%63 = call i32 @fprintf(i32* %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8 signext 10)
br label %64
64: ; preds = %61, %58
br label %65
65: ; preds = %64
%66 = load i32, i32* %9
%67 = add nsw i32 %66, 1
store i32 %67, i32* %9
br label %45
68: ; preds = %45
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"friday.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"friday.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%5 = bitcast i32* %1 to i8*
%6 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%7 = bitcast [7 x i32]* %2 to i8*
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %68
10: ; preds = %0, %10
%11 = phi i32 [ %61, %10 ], [ 0, %0 ]
%12 = add nuw nsw i32 %11, 1900
%13 = call i64 @calu(i32 %12, i32 1, i32 13)
%14 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
%17 = call i64 @calu(i32 %12, i32 2, i32 13)
%18 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %18
%21 = call i64 @calu(i32 %12, i32 3, i32 13)
%22 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 1
store i32 %24, i32* %22
%25 = call i64 @calu(i32 %12, i32 4, i32 13)
%26 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = add nsw i32 %27, 1
store i32 %28, i32* %26
%29 = call i64 @calu(i32 %12, i32 5, i32 13)
%30 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = add nsw i32 %31, 1
store i32 %32, i32* %30
%33 = call i64 @calu(i32 %12, i32 6, i32 13)
%34 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = add nsw i32 %35, 1
store i32 %36, i32* %34
%37 = call i64 @calu(i32 %12, i32 7, i32 13)
%38 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = add nsw i32 %39, 1
store i32 %40, i32* %38
%41 = call i64 @calu(i32 %12, i32 8, i32 13)
%42 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = add nsw i32 %43, 1
store i32 %44, i32* %42
%45 = call i64 @calu(i32 %12, i32 9, i32 13)
%46 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = add nsw i32 %47, 1
store i32 %48, i32* %46
%49 = call i64 @calu(i32 %12, i32 10, i32 13)
%50 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = add nsw i32 %51, 1
store i32 %52, i32* %50
%53 = call i64 @calu(i32 %12, i32 11, i32 13)
%54 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = add nsw i32 %55, 1
store i32 %56, i32* %54
%57 = call i64 @calu(i32 %12, i32 12, i32 13)
%58 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = add nsw i32 %59, 1
store i32 %60, i32* %58
%61 = add nuw nsw i32 %11, 1
%62 = load i32, i32* %1
%63 = icmp slt i32 %61, %62
br i1 %63, label %10, label %64
64: ; preds = %10
%65 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 6
%66 = load i32, i32* %65
%67 = trunc i32 %66 to i8
br label %68
68: ; preds = %64, %0
%69 = phi i8 [ %67, %64 ], [ 0, %0 ]
%70 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8 signext %69)
%71 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%72 = load i32, i32* %71
%73 = trunc i32 %72 to i8
%74 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8 signext %73)
%75 = call i32 @fputc(i32 32, i32* %4)
%76 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 1
%77 = load i32, i32* %76
%78 = trunc i32 %77 to i8
%79 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8 signext %78)
%80 = call i32 @fputc(i32 32, i32* %4)
%81 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 2
%82 = load i32, i32* %81
%83 = trunc i32 %82 to i8
%84 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8 signext %83)
%85 = call i32 @fputc(i32 32, i32* %4)
%86 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 3
%87 = load i32, i32* %86
%88 = trunc i32 %87 to i8
%89 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8 signext %88)
%90 = call i32 @fputc(i32 32, i32* %4)
%91 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 4
%92 = load i32, i32* %91
%93 = trunc i32 %92 to i8
%94 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8 signext %93)
%95 = call i32 @fputc(i32 32, i32* %4)
%96 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 5
%97 = load i32, i32* %96
%98 = trunc i32 %97 to i8
%99 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8 signext %98)
%100 = call i32 @fputc(i32 10, i32* %4)
ret i32 0
}