#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, ...);
main() {
  int day_of_year(int, int, int);
  void month_day(int, int, int *, int *);
  int m = 0;
  int d = 0;
  printf("%d\n", day_of_year(2005, 2, 28));
  month_day(2005, 60, &m, &d);
  printf("%d,%d\n", m, d);
  printf("%d\n", day_of_year(2005, 2, 100));
  printf("%d\n", day_of_year(2005, -1, 100));
  month_day(2005, -100, &m, &d);
  month_day(2005, 1000, &m, &d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x7d5,%edi
mov    $0x2,%esi
mov    $0x1c,%edx
call   1050 <day_of_year@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x7d5,%edi
mov    $0x3c,%esi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1030 <month_day@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x7d5,%edi
mov    $0x2,%esi
mov    $0x64,%edx
call   1050 <day_of_year@plt>
mov    %eax,%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x7d5,%edi
mov    $0xffffffff,%esi
mov    $0x64,%edx
call   1050 <day_of_year@plt>
mov    %eax,%esi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x7d5,%edi
mov    $0xffffff9c,%esi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1030 <month_day@plt>
mov    $0x7d5,%edi
mov    $0x3e8,%esi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1030 <month_day@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x7d5,%edi
mov    $0x2,%esi
mov    $0x1c,%edx
call   1050 <day_of_year@plt>
lea    0xe9f(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r14
mov    $0x7d5,%edi
mov    $0x3c,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <month_day@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xe62(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x7d5,%edi
mov    $0x2,%esi
mov    $0x64,%edx
call   1050 <day_of_year@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x7d5,%edi
mov    $0xffffffff,%esi
mov    $0x64,%edx
call   1050 <day_of_year@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x7d5,%edi
mov    $0xffffff9c,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <month_day@plt>
mov    $0x7d5,%edi
mov    $0x3e8,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <month_day@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"%d,%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @day_of_year(i32 2005, i32 2, i32 28)
%4 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 @day_of_year(i32 2005, i32 2, i32 100)
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @day_of_year(i32 2005, i32 -1, i32 100)
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"%d,%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 @day_of_year(i32 2005, i32 2, i32 28)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
%10 = call i32 @day_of_year(i32 2005, i32 2, i32 100)
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @day_of_year(i32 2005, i32 -1, i32 100)
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}