#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 day_of_year(int, int, int);
int /*<<< orphan*/ month_day(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int y1 = 1986, yd1 = 115;
  int pm = 0, pd = 0;
  printf("%d, %d\n", day_of_year(1986, 12, 27), day_of_year(2014, 2, 17));
  month_day(y1, yd1, &pm, &pd);
  printf("%d, %d\n", pm, pd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7c2,-0x8(%rbp)
movl   $0x73,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x7c2,%edi
mov    $0xc,%esi
mov    $0x1b,%edx
call   1050 <day_of_year@plt>
mov    %eax,-0x18(%rbp)
mov    $0x7de,%edi
mov    $0x2,%esi
mov    $0x11,%edx
call   1050 <day_of_year@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <month_day@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    $0x7c2,%edi
mov    $0xc,%esi
mov    $0x1b,%edx
call   1050 <day_of_year@plt>
mov    %eax,%ebx
mov    $0x7de,%edi
mov    $0x2,%esi
mov    $0x11,%edx
call   1050 <day_of_year@plt>
lea    0xe8c(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x7c2,%edi
mov    $0x73,%esi
call   1030 <month_day@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 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 1986, i32 12, i32 27)
%6 = tail call i32 @day_of_year(i32 2014, i32 2, i32 17)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 @month_day(i32 1986, i32 115, i32* %1, i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}