#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, int);
int /*<<< orphan*/ scanf(char *, int *, int *, ...);
int main(void) {
  int year, month, day, yearday;
  scanf("%d %d %d", &year, &month, &day);
  yearday = day_of_year(year, month, day);
  printf("%d-%d-%d:%d\n", year, month, day, yearday);
  scanf("%d %d", &year, &yearday);
  month_day(year, yearday, &month, &day);
  printf("%d's %d days is %d-%d\n", year, yearday, month, day);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <day_of_year@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
lea    0xe69(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <month_day@plt>
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xe46(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb0(%rip),%rdi
mov    %rsp,%rbx
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r14
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1060 <scanf@plt>
mov    (%rsp),%edi
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
call   1050 <day_of_year@plt>
mov    %eax,0x4(%rsp)
mov    (%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
lea    0xe76(%rip),%rdi
mov    %eax,%r8d
call   1040 <printf@plt>
lea    0xe61(%rip),%rdi
lea    0x4(%rsp),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <month_day@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
lea    0xe3c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [13 x i8] c"%d-%d-%d:%d\0A\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [23 x i8] c"%d's %d days is %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
%6 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @day_of_year(i32 %7, i32 %8, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14)
%16 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %5)
%17 = load i32, i32* %2
%18 = load i32, i32* %5
%19 = call i32 @month_day(i32 %17, i32 %18, i32* %3, i32* %4)
%20 = load i32, i32* %2
%21 = load i32, i32* %5
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %20, i32 %21, i32 %22, i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [13 x i8] c"%d-%d-%d:%d\0A\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [23 x i8] c"%d's %d days is %d-%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @day_of_year(i32 %10, i32 %11, i32 %12)
store i32 %13, i32* %4
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15, i32 %16, i32 %13)
%18 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %4)
%19 = load i32, i32* %1
%20 = load i32, i32* %4
%21 = call i32 @month_day(i32 %19, i32 %20, i32* %2, i32* %3)
%22 = load i32, i32* %1
%23 = load i32, i32* %4
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %22, i32 %23, i32 %24, i32 %25)
ret i32 0
}