#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 int /*<<< orphan*/ time_t;
struct tm {
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_hour;
  int tm_min;
  int tm_sec;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  time_t rawtime;
  struct tm *p_ti;
  time(&rawtime);
  p_ti = localtime(&rawtime);
  (void)printf("date is: %d/%d/%d\n", p_ti->tm_mday, p_ti->tm_mon,
               ((p_ti->tm_year) + 1900));
  (void)printf("time is: %02d:%02d:%02d\n", p_ti->tm_hour, p_ti->tm_min,
               p_ti->tm_sec);
  (void)printf("other info: weekday = %d, yearday = %d,"
               " daylight saving time = %d\n",
               p_ti->tm_wday, p_ti->tm_yday, p_ti->tm_isdst);
  exit(EXIT_SUCCESS);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <time@plt>
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%ecx
add    $0x76c,%ecx
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%edx
mov    -0x20(%rbp),%rax
mov    0x14(%rax),%ecx
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%esi
mov    -0x20(%rbp),%rax
mov    0x1c(%rax),%edx
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%ecx
lea    0xe5d(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e05(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    %rax,%rbx
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    $0x76c,%ecx
add    0x8(%rax),%ecx
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    0xc(%rbx),%esi
mov    0x10(%rbx),%edx
mov    0x14(%rbx),%ecx
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    0x18(%rbx),%esi
mov    0x1c(%rbx),%edx
mov    0x20(%rbx),%ecx
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [19 x i8] c"date is: %d/%d/%d\0A\00"
@.str.1 = [25 x i8] c"time is: %02d:%02d:%02d\0A\00"
@.str.2 = [67 x i8] c"other info: weekday = %d, yearday = %d, daylight saving time = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.tm*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @time(i32* %6)
%9 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %9, %struct.tm** %7
%10 = load %struct.tm*, %struct.tm** %7
%11 = getelementptr inbounds %struct.tm, %struct.tm* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load %struct.tm*, %struct.tm** %7
%14 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.tm*, %struct.tm** %7
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 2
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1900
%20 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %15, i32 %19)
%21 = load %struct.tm*, %struct.tm** %7
%22 = getelementptr inbounds %struct.tm, %struct.tm* %21, i32 0, i32 3
%23 = load i32, i32* %22
%24 = load %struct.tm*, %struct.tm** %7
%25 = getelementptr inbounds %struct.tm, %struct.tm* %24, i32 0, i32 4
%26 = load i32, i32* %25
%27 = load %struct.tm*, %struct.tm** %7
%28 = getelementptr inbounds %struct.tm, %struct.tm* %27, i32 0, i32 5
%29 = load i32, i32* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %26, i32 %29)
%31 = load %struct.tm*, %struct.tm** %7
%32 = getelementptr inbounds %struct.tm, %struct.tm* %31, i32 0, i32 6
%33 = load i32, i32* %32
%34 = load %struct.tm*, %struct.tm** %7
%35 = getelementptr inbounds %struct.tm, %struct.tm* %34, i32 0, i32 7
%36 = load i32, i32* %35
%37 = load %struct.tm*, %struct.tm** %7
%38 = getelementptr inbounds %struct.tm, %struct.tm* %37, i32 0, i32 8
%39 = load i32, i32* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), i32 %33, i32 %36, i32 %39)
%41 = load i32, i32* @EXIT_SUCCESS
%42 = call i32 @exit(i32 %41)
unreachable
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [19 x i8] c"date is: %d/%d/%d\0A\00"
@.str.1 = [25 x i8] c"time is: %02d:%02d:%02d\0A\00"
@.str.2 = [67 x i8] c"other info: weekday = %d, yearday = %d, daylight saving time = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 2
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1900
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10, i32 %13)
%15 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 3
%16 = load i32, i32* %15
%17 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 4
%18 = load i32, i32* %17
%19 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 5
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %18, i32 %20)
%22 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 6
%23 = load i32, i32* %22
%24 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 7
%25 = load i32, i32* %24
%26 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 8
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), i32 %23, i32 %25, i32 %27)
%29 = load i32, i32* @EXIT_SUCCESS
%30 = call i32 @exit(i32 %29)
unreachable
}