#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*/ calendar(int, int);
int determinedaycode(int);
int /*<<< orphan*/ determineleapyear(int);
int inputyear();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int year, daycode, leapyear;
  year = inputyear();
  printf("\n\nCALENDAR FOR THE YEAR %d", year);
  printf("\n---------------------------\n");
  daycode = determinedaycode(year);
  determineleapyear(year);
  calendar(year, daycode);
  printf("\n\nThanks for using my Gregorian Calendar program.............");
  printf("\n\t\tWritten by ");
  printf("Alangi Derick");
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <inputyear@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <determinedaycode@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <determineleapyear@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <calendar@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <inputyear@plt>
mov    %eax,%ebx
lea    0xe7d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1070 <determinedaycode@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1080 <determineleapyear@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1090 <calendar@plt>
lea    0xe63(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\0A\0ACALENDAR FOR THE YEAR %d\00"
@.str.1 = [30 x i8] c"\0A---------------------------\0A\00"
@.str.2 = [62 x i8] c"\0A\0AThanks for using my Gregorian Calendar program.............\00"
@.str.3 = [15 x i8] c"\0A\09\09Written by \00"
@.str.4 = [14 x i8] c"Alangi Derick\00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @inputyear()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = call i32 @determinedaycode(i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = call i32 @determineleapyear(i32 %11)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @calendar(i32 %13, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0A\0ACALENDAR FOR THE YEAR %d\00"
@.str.2 = [62 x i8] c"\0A\0AThanks for using my Gregorian Calendar program.............\00"
@.str.3 = [15 x i8] c"\0A\09\09Written by \00"
@.str.4 = [14 x i8] c"Alangi Derick\00"
@str = [29 x i8] c"\0A---------------------------\00"
define i32 @main() {
%1 = tail call i32 (...) @inputyear()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @determinedaycode(i32 %1)
%5 = tail call i32 @determineleapyear(i32 %1)
%6 = tail call i32 @calendar(i32 %1, i32 %4)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @putchar(i32 10)
ret i32 0
}