#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_ptr(int, int, int);
int /*<<< orphan*/ month_day_ptr(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(void) {
  int year = 2015;
  int month = 3;
  int day = 8;
  int yearday = 67;
  int pmonth = 0;
  int pday = 0;
  printf("day (%d) month (%d) of year (%d) = %d\n", day, month, year,
         day_of_year_ptr(year, month, day));
  month_day_ptr(year, yearday, &pmonth, &pday);
  printf("yearday (%d) of year (%d) = %d day %d month\n", yearday, year, pday,
         pmonth);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7df,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x8,-0x10(%rbp)
movl   $0x43,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <day_of_year_ptr@plt>
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    %eax,%r8d
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1050 <month_day_ptr@plt>
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    $0x7df,%edi
mov    $0x3,%esi
mov    $0x8,%edx
call   1030 <day_of_year_ptr@plt>
lea    0xea5(%rip),%rdi
mov    $0x8,%esi
mov    $0x3,%edx
mov    $0x7df,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x7df,%edi
mov    $0x43,%esi
call   1050 <month_day_ptr@plt>
mov    (%rsp),%ecx
mov    0x4(%rsp),%r8d
lea    0xe8f(%rip),%rdi
mov    $0x43,%esi
mov    $0x7df,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"day (%d) month (%d) of year (%d) = %d\0A\00"
@.str.1 = [45 x i8] c"yearday (%d) of year (%d) = %d day %d month\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 2015, i32* %2
store i32 3, i32* %3
store i32 8, i32* %4
store i32 67, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @day_of_year_ptr(i32 %11, i32 %12, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10, i32 %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %5
%18 = call i32 @month_day_ptr(i32 %16, i32 %17, i32* %6, i32* %7)
%19 = load i32, i32* %5
%20 = load i32, i32* %2
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %20, i32 %21, i32 %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"day (%d) month (%d) of year (%d) = %d\0A\00"
@.str.1 = [45 x i8] c"yearday (%d) of year (%d) = %d day %d month\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_ptr(i32 2015, i32 3, i32 8)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 8, i32 3, i32 2015, i32 %5)
%7 = call i32 @month_day_ptr(i32 2015, i32 67, i32* %1, i32* %2)
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i32 67, i32 2015, i32 %8, i32 %9)
ret i32 0
}