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

/* Variables and functions */
int daylight;
struct tm *gmtime(scalar_t__ *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ time(scalar_t__ *);
scalar_t__ timezone;
int /*<<< orphan*/ tzset();
int print_time() {
  char *tz;
  time_t rawtime;
  struct tm *localtime;
  time_t offset;
  setenv("TZ", "EST5EDT", 1);
  tzset();
  time(&rawtime);
  offset = (rawtime - timezone + (daylight * 3600));
  localtime = gmtime(&offset);
  printf("%02d/%02d/%02d %2d:%02d:%02d", localtime->tm_year + 1900,
         localtime->tm_mon + 1, localtime->tm_mday, localtime->tm_hour,
         localtime->tm_min, localtime->tm_sec);
  return (0);
}


x86 assembly (clang, -O0):
<print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xea1(%rip),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    $0x0,%al
call   1050 <tzset@plt>
lea    -0x10(%rbp),%rdi
call   1060 <time@plt>
mov    -0x10(%rbp),%rax
mov    0x2e55(%rip),%rcx
sub    (%rcx),%rax
mov    0x2e3b(%rip),%rcx
imul   $0xe10,(%rcx),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
call   1070 <gmtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
add    $0x76c,%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
add    $0x1,%edx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%eax
lea    0xe1e(%rip),%rdi
mov    %eax,(%rsp)
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time>:
sub    $0x18,%rsp
lea    0xea5(%rip),%rdi
lea    0xea1(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
xor    %eax,%eax
call   1050 <tzset@plt>
lea    0x10(%rsp),%rdi
call   1060 <time@plt>
mov    0x10(%rsp),%rax
mov    0x2e57(%rip),%rcx
sub    (%rcx),%rax
mov    0x2e3d(%rip),%rcx
movslq (%rcx),%rcx
imul   $0xe10,%rcx,%rcx
add    %rax,%rcx
mov    %rcx,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1070 <gmtime@plt>
mov    $0x76c,%esi
add    (%rax),%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    0xe37(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [3 x i8] c"TZ\00"
@.str.1 = [8 x i8] c"EST5EDT\00"
@timezone = global i64 0
@daylight = global i32 0
@.str.2 = [29 x i8] c"%02d/%02d/%02d %2d:%02d:%02d\00"
define i32 @print_time() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca %struct.tm*
%4 = alloca i64
%5 = call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = call i32 (...) @tzset()
%7 = call i32 @time(i64* %2)
%8 = load i64, i64* %2
%9 = load i64, i64* @timezone
%10 = sub nsw i64 %8, %9
%11 = load i32, i32* @daylight
%12 = mul nsw i32 %11, 3600
%13 = sext i32 %12 to i64
%14 = add nsw i64 %10, %13
store i64 %14, i64* %4
%15 = call %struct.tm* @gmtime(i64* %4)
store %struct.tm* %15, %struct.tm** %3
%16 = load %struct.tm*, %struct.tm** %3
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 0
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1900
%20 = load %struct.tm*, %struct.tm** %3
%21 = getelementptr inbounds %struct.tm, %struct.tm* %20, i32 0, i32 1
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 1
%24 = load %struct.tm*, %struct.tm** %3
%25 = getelementptr inbounds %struct.tm, %struct.tm* %24, i32 0, i32 2
%26 = load i32, i32* %25
%27 = load %struct.tm*, %struct.tm** %3
%28 = getelementptr inbounds %struct.tm, %struct.tm* %27, i32 0, i32 3
%29 = load i32, i32* %28
%30 = load %struct.tm*, %struct.tm** %3
%31 = getelementptr inbounds %struct.tm, %struct.tm* %30, i32 0, i32 4
%32 = load i32, i32* %31
%33 = load %struct.tm*, %struct.tm** %3
%34 = getelementptr inbounds %struct.tm, %struct.tm* %33, i32 0, i32 5
%35 = load i32, i32* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %23, i32 %26, i32 %29, i32 %32, i32 %35)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [3 x i8] c"TZ\00"
@.str.1 = [8 x i8] c"EST5EDT\00"
@timezone = global i64 0
@daylight = global i32 0
@.str.2 = [29 x i8] c"%02d/%02d/%02d %2d:%02d:%02d\00"
define i32 @print_time() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = tail call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = tail call i32 (...) @tzset()
%7 = call i32 @time(i64* %1)
%8 = load i64, i64* %1
%9 = load i64, i64* @timezone
%10 = sub i64 %8, %9
%11 = load i32, i32* @daylight
%12 = mul nsw i32 %11, 3600
%13 = sext i32 %12 to i64
%14 = add nsw i64 %10, %13
store i64 %14, i64* %2
%15 = call %struct.tm* @gmtime(i64* %2)
%16 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 0
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1900
%19 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 1
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1
%22 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 2
%23 = load i32, i32* %22
%24 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 3
%25 = load i32, i32* %24
%26 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 4
%27 = load i32, i32* %26
%28 = getelementptr inbounds %struct.tm, %struct.tm* %15, i64 0, i32 5
%29 = load i32, i32* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %18, i32 %21, i32 %23, i32 %25, i32 %27, i32 %29)
ret i32 0
}