#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 day_of_year_pointer(int, int, int);
int /*<<< orphan*/ month_day(int, int, int *, int *);
int /*<<< orphan*/ month_day_pointer(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  int year, month, day, yearday;
  year = 2000;
  month = 3;
  day = 1;
  printf("The date is: %d-%02d-%02d\n", year, month, day);
  printf("day_of_year: %d\n", day_of_year(year, month, day));
  printf("day_of_year_pointer: %d\n", day_of_year_pointer(year, month, day));
  yearday = 61;
  month_day(year, yearday, &month, &day);
  printf("Yearday is %d\n", yearday);
  printf("month_day: %d %d\n", month, day);
  month_day_pointer(year, yearday, &month, &day);
  printf("month_day_pointer: %d %d\n", month, day);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7d0,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1070 <day_of_year@plt>
mov    %eax,%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <day_of_year_pointer@plt>
mov    %eax,%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x3d,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <month_day@plt>
mov    -0x14(%rbp),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <month_day_pointer@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x3,0x4(%rsp)
movl   $0x1,(%rsp)
lea    0xe96(%rip),%rdi
mov    $0x7d0,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x7d0,%edi
mov    $0x3,%esi
mov    $0x1,%edx
call   1070 <day_of_year@plt>
lea    0xe80(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x7d0,%edi
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <day_of_year_pointer@plt>
lea    0xe6d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    $0x7d0,%edi
mov    $0x3d,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1050 <month_day@plt>
lea    0xe59(%rip),%rdi
mov    $0x3d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe4e(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x7d0,%edi
mov    $0x3d,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <month_day_pointer@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe36(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"The date is: %d-%02d-%02d\0A\00"
@.str.1 = [17 x i8] c"day_of_year: %d\0A\00"
@.str.2 = [25 x i8] c"day_of_year_pointer: %d\0A\00"
@.str.3 = [15 x i8] c"Yearday is %d\0A\00"
@.str.4 = [18 x i8] c"month_day: %d %d\0A\00"
@.str.5 = [26 x i8] c"month_day_pointer: %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 2000, i32* %2
store i32 3, i32* %3
store i32 1, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @day_of_year(i32 %10, i32 %11, i32 %12)
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 @day_of_year_pointer(i32 %15, i32 %16, i32 %17)
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %18)
store i32 61, i32* %5
%20 = load i32, i32* %2
%21 = load i32, i32* %5
%22 = call i32 @month_day(i32 %20, i32 %21, i32* %3, i32* %4)
%23 = load i32, i32* %5
%24 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %25, i32 %26)
%28 = load i32, i32* %2
%29 = load i32, i32* %5
%30 = call i32 @month_day_pointer(i32 %28, i32 %29, i32* %3, i32* %4)
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %31, i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"The date is: %d-%02d-%02d\0A\00"
@.str.1 = [17 x i8] c"day_of_year: %d\0A\00"
@.str.2 = [25 x i8] c"day_of_year_pointer: %d\0A\00"
@.str.3 = [15 x i8] c"Yearday is %d\0A\00"
@.str.4 = [18 x i8] c"month_day: %d %d\0A\00"
@.str.5 = [26 x i8] c"month_day_pointer: %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 3, i32* %1
store i32 1, i32* %2
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2000, i32 3, i32 1)
%6 = tail call i32 @day_of_year(i32 2000, i32 3, i32 1)
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = tail call i32 @day_of_year_pointer(i32 2000, i32 3, i32 1)
%9 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = call i32 @month_day(i32 2000, i32 61, i32* %1, i32* %2)
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 61)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %12, i32 %13)
%15 = call i32 @month_day_pointer(i32 2000, i32 61, i32* %1, i32* %2)
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %16, i32 %17)
ret i32 0
}