#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*/ PrintCalendarMonth(int, int);
int /*<<< orphan*/ printf(char *);
void PrintCalendar(int year) {
  int month;
  for (month = 1; month <= 12; month++) {
    PrintCalendarMonth(month, year);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<PrintCalendar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jg     1161 <PrintCalendar+0x41>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <PrintCalendarMonth@plt>
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <PrintCalendar+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintCalendar>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x3,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x4,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x5,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x6,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x7,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x8,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x9,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xb,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xc,%edi
mov    %ebx,%esi
call   1040 <PrintCalendarMonth@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @PrintCalendar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 12
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = call i32 @PrintCalendarMonth(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @PrintCalendar(i32 %0) {
%2 = tail call i32 @PrintCalendarMonth(i32 1, i32 %0)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @PrintCalendarMonth(i32 2, i32 %0)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @PrintCalendarMonth(i32 3, i32 %0)
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @PrintCalendarMonth(i32 4, i32 %0)
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @PrintCalendarMonth(i32 5, i32 %0)
%11 = tail call i32 @putchar(i32 10)
%12 = tail call i32 @PrintCalendarMonth(i32 6, i32 %0)
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 @PrintCalendarMonth(i32 7, i32 %0)
%15 = tail call i32 @putchar(i32 10)
%16 = tail call i32 @PrintCalendarMonth(i32 8, i32 %0)
%17 = tail call i32 @putchar(i32 10)
%18 = tail call i32 @PrintCalendarMonth(i32 9, i32 %0)
%19 = tail call i32 @putchar(i32 10)
%20 = tail call i32 @PrintCalendarMonth(i32 10, i32 %0)
%21 = tail call i32 @putchar(i32 10)
%22 = tail call i32 @PrintCalendarMonth(i32 11, i32 %0)
%23 = tail call i32 @putchar(i32 10)
%24 = tail call i32 @PrintCalendarMonth(i32 12, i32 %0)
%25 = tail call i32 @putchar(i32 10)
ret void
}