#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_year;
  int tm_mon;
  int tm_mday;
  int tm_hour;
  int tm_min;
  int /*<<< orphan*/ tm_sec;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  struct tm *ptr;
  time_t timeptr;
  time(&timeptr);
  ptr = gmtime(&timeptr);
  printf("The UTC time is:   %i-%i-%i %i:%i\n", 1990 + ptr->tm_year,
         1 + ptr->tm_mon, ptr->tm_mday, ptr->tm_hour, ptr->tm_min, ptr->tm_sec);
  ptr = localtime(&timeptr);
  printf("The local time is: %i-%i-%i %i:%i\n", 1990 + ptr->tm_year,
         1 + ptr->tm_mon, ptr->tm_mday, ptr->tm_hour, ptr->tm_min, ptr->tm_sec);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <time@plt>
lea    -0x14(%rbp),%rdi
call   1060 <gmtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
add    $0x7c6,%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
add    $0x1,%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%eax
lea    0xe60(%rip),%rdi
mov    %eax,(%rsp)
call   1040 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
add    $0x7c6,%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
add    $0x1,%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%eax
lea    0xe33(%rip),%rdi
mov    %eax,(%rsp)
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0x14(%rsp),%r14
mov    %r14,%rdi
call   1050 <time@plt>
mov    %r14,%rdi
call   1060 <gmtime@plt>
mov    $0x7c6,%ebx
mov    (%rax),%esi
add    %ebx,%esi
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
add    $0x1,%edx
mov    0xc(%rax),%r8d
mov    0x10(%rax),%r9d
mov    0x14(%rax),%eax
mov    %eax,(%rsp)
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
add    (%rax),%ebx
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
add    $0x1,%edx
mov    0xc(%rax),%r8d
mov    0x10(%rax),%r9d
mov    0x14(%rax),%eax
mov    %eax,(%rsp)
lea    0xe73(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [35 x i8] c"The UTC time is: %i-%i-%i %i:%i\0A\00"
@.str.1 = [35 x i8] c"The local time is: %i-%i-%i %i:%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* %3)
%5 = call %struct.tm* @gmtime(i32* %3)
store %struct.tm* %5, %struct.tm** %2
%6 = load %struct.tm*, %struct.tm** %2
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 1990, %8
%10 = load %struct.tm*, %struct.tm** %2
%11 = getelementptr inbounds %struct.tm, %struct.tm* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = add nsw i32 1, %12
%14 = load %struct.tm*, %struct.tm** %2
%15 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 2
%16 = load i32, i32* %15
%17 = load %struct.tm*, %struct.tm** %2
%18 = getelementptr inbounds %struct.tm, %struct.tm* %17, i32 0, i32 3
%19 = load i32, i32* %18
%20 = load %struct.tm*, %struct.tm** %2
%21 = getelementptr inbounds %struct.tm, %struct.tm* %20, i32 0, i32 4
%22 = load i32, i32* %21
%23 = load %struct.tm*, %struct.tm** %2
%24 = getelementptr inbounds %struct.tm, %struct.tm* %23, i32 0, i32 5
%25 = load i32, i32* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %13, i32 %16, i32 %19, i32 %22, i32 %25)
%27 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %27, %struct.tm** %2
%28 = load %struct.tm*, %struct.tm** %2
%29 = getelementptr inbounds %struct.tm, %struct.tm* %28, i32 0, i32 0
%30 = load i32, i32* %29
%31 = add nsw i32 1990, %30
%32 = load %struct.tm*, %struct.tm** %2
%33 = getelementptr inbounds %struct.tm, %struct.tm* %32, i32 0, i32 1
%34 = load i32, i32* %33
%35 = add nsw i32 1, %34
%36 = load %struct.tm*, %struct.tm** %2
%37 = getelementptr inbounds %struct.tm, %struct.tm* %36, i32 0, i32 2
%38 = load i32, i32* %37
%39 = load %struct.tm*, %struct.tm** %2
%40 = getelementptr inbounds %struct.tm, %struct.tm* %39, i32 0, i32 3
%41 = load i32, i32* %40
%42 = load %struct.tm*, %struct.tm** %2
%43 = getelementptr inbounds %struct.tm, %struct.tm* %42, i32 0, i32 4
%44 = load i32, i32* %43
%45 = load %struct.tm*, %struct.tm** %2
%46 = getelementptr inbounds %struct.tm, %struct.tm* %45, i32 0, i32 5
%47 = load i32, i32* %46
%48 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %31, i32 %35, i32 %38, i32 %41, i32 %44, i32 %47)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [35 x i8] c"The UTC time is: %i-%i-%i %i:%i\0A\00"
@.str.1 = [35 x i8] c"The local time is: %i-%i-%i %i:%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @gmtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1990
%8 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
%11 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 2
%12 = load i32, i32* %11
%13 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 3
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 4
%16 = load i32, i32* %15
%17 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 5
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %10, i32 %12, i32 %14, i32 %16, i32 %18)
%20 = call %struct.tm* @localtime(i32* %1)
%21 = getelementptr inbounds %struct.tm, %struct.tm* %20, i64 0, i32 0
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 1990
%24 = getelementptr inbounds %struct.tm, %struct.tm* %20, i64 0, i32 1
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
%27 = getelementptr inbounds %struct.tm, %struct.tm* %20, i64 0, i32 2
%28 = load i32, i32* %27
%29 = getelementptr inbounds %struct.tm, %struct.tm* %20, i64 0, i32 3
%30 = load i32, i32* %29
%31 = getelementptr inbounds %struct.tm, %struct.tm* %20, i64 0, i32 4
%32 = load i32, i32* %31
%33 = getelementptr inbounds %struct.tm, %struct.tm* %20, i64 0, i32 5
%34 = load i32, i32* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %26, i32 %28, i32 %30, i32 %32, i32 %34)
ret i32 0
}