#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 calculate_day_number(int, int, int);
int /*<<< orphan*/ display_day_number(int, int, int, int);
int is_leap_year(int);
int prompt_day();
int prompt_month();
int prompt_year();
int main(void) {
  int month = 0, day = 0, year = 0, leap_year = 0, day_number = 0;
  month = prompt_month();
  day = prompt_day();
  year = prompt_year();
  leap_year = is_leap_year(year);
  day_number = calculate_day_number(month, day, leap_year);
  display_day_number(month, day, year, day_number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1080 <prompt_month@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <prompt_day@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <prompt_year@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1070 <is_leap_year@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <calculate_day_number@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <display_day_number@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1080 <prompt_month@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <prompt_day@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <prompt_year@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1070 <is_leap_year@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <calculate_day_number@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
call   1040 <display_day_number@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = call i32 (...) @prompt_month()
store i32 %7, i32* %2
%8 = call i32 (...) @prompt_day()
store i32 %8, i32* %3
%9 = call i32 (...) @prompt_year()
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 @is_leap_year(i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = call i32 @calculate_day_number(i32 %12, i32 %13, i32 %14)
store i32 %15, i32* %6
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = load i32, i32* %6
%20 = call i32 @display_day_number(i32 %16, i32 %17, i32 %18, i32 %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @prompt_month()
%2 = tail call i32 (...) @prompt_day()
%3 = tail call i32 (...) @prompt_year()
%4 = tail call i32 @is_leap_year(i32 %3)
%5 = tail call i32 @calculate_day_number(i32 %1, i32 %2, i32 %4)
%6 = tail call i32 @display_day_number(i32 %1, i32 %2, i32 %3, i32 %5)
ret i32 0
}