#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 */
typedef scalar_t__ time_t;
struct tm {
  int tm_mon;
  int tm_mday;
  int tm_year;
  char *tm_zone;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(scalar_t__ *, struct tm *);
int /*<<< orphan*/ printf(char *, int, int, int, char *);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, const char *argv[]) {
  time_t current = time(NULL);
  time_t then = current + 4000000;
  struct tm tm_then;
  localtime_r(&then, &tm_then);
  printf("The date will be %02d-%02d-%d %s in 4 million seconds.\n",
         tm_then.tm_mon + 1, tm_then.tm_mday, tm_then.tm_year + 1900,
         tm_then.tm_zone);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x3d0900,%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x38(%rbp),%esi
add    $0x1,%esi
mov    -0x34(%rbp),%edx
mov    -0x30(%rbp),%ecx
add    $0x76c,%ecx
mov    -0x28(%rbp),%r8
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xor    %edi,%edi
call   1050 <time@plt>
add    $0x3d0900,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <localtime_r@plt>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
add    $0x1,%esi
mov    $0x76c,%ecx
add    0x18(%rsp),%ecx
mov    0x20(%rsp),%r8
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i8* }
@.str = [56 x i8] c"The date will be %02d-%02d-%d %s in 4 million seconds.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca %struct.tm
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i64 @time(i32* null)
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = add nsw i64 %10, 4000000
store i64 %11, i64* %7
%12 = call i32 @localtime_r(i64* %7, %struct.tm* %8)
%13 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 0
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
%16 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 1
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 2
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1900
%21 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 3
%22 = load i8*, i8** %21
%23 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %17, i32 %20, i8* %22)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i8* }
@.str = [56 x i8] c"The date will be %02d-%02d-%d %s in 4 million seconds.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca %struct.tm
%5 = tail call i64 @time(i32* null)
%6 = bitcast i64* %3 to i8*
%7 = add nsw i64 %5, 4000000
store i64 %7, i64* %3
%8 = bitcast %struct.tm* %4 to i8*
%9 = call i32 @localtime_r(i64* %3, %struct.tm* %4)
%10 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
%13 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 2
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1900
%18 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 3
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %14, i32 %17, i8* %19)
ret i32 0
}