#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 */
struct tm {
  int tm_year;
  int tm_mon;
  int tm_mday;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main() {
  struct tm t = {0};
  int yyyy, mm, dd, days;
  scanf("%d %d %d %d", &yyyy, &mm, &dd, &days);
  t.tm_year = yyyy - 1900, t.tm_mon = mm - 1, t.tm_mday = dd - days;
  mktime(&t);
  printf("%d %d %d", t.tm_year + 1900, t.tm_mon + 1, t.tm_mday);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    0xea1(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1060 <scanf@plt>
mov    -0x14(%rbp),%eax
sub    $0x76c,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1050 <mktime@plt>
mov    -0x10(%rbp),%esi
add    $0x76c,%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%ecx
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movl   $0x0,0x14(%rsp)
lea    0xebd(%rip),%rdi
lea    0x24(%rsp),%rsi
lea    0x20(%rsp),%rdx
lea    0x1c(%rsp),%rcx
lea    0x18(%rsp),%r8
call   1050 <scanf@plt>
mov    $0xfffff894,%eax
add    0x24(%rsp),%eax
mov    %eax,0x8(%rsp)
mov    0x20(%rsp),%eax
add    $0xffffffff,%eax
mov    %eax,0xc(%rsp)
mov    0x1c(%rsp),%eax
sub    0x18(%rsp),%eax
mov    %eax,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <mktime@plt>
mov    $0x76c,%esi
add    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x10(%rsp),%ecx
add    $0x1,%edx
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32 }
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast %struct.tm* %1 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1900
%10 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 0
store i32 %9, i32* %10
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 1
store i32 %12, i32* %13
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = sub nsw i32 %14, %15
%17 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 2
store i32 %16, i32* %17
%18 = call i32 @mktime(%struct.tm* %1)
%19 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 0
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1900
%22 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 1
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 1
%25 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 2
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %21, i32 %24, i32 %26)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32 }
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast %struct.tm* %1 to i8*
%7 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 3
store i32 0, i32* %7
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%13 = load i32, i32* %2
%14 = add nsw i32 %13, -1900
%15 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 0
store i32 %14, i32* %15
%16 = load i32, i32* %3
%17 = add nsw i32 %16, -1
%18 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 1
store i32 %17, i32* %18
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = sub nsw i32 %19, %20
%22 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 2
store i32 %21, i32* %22
%23 = call i32 @mktime(%struct.tm* %1)
%24 = load i32, i32* %15
%25 = add nsw i32 %24, 1900
%26 = load i32, i32* %18
%27 = add nsw i32 %26, 1
%28 = load i32, i32* %22
%29 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %27, i32 %28)
ret i32 0
}