#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 char *time_t;
struct tm {
  int tm_mon;
  int tm_mday;
  int tm_year;
  int tm_hour;
  int tm_min;
  int tm_sec;
  scalar_t__ tm_isdst;
};
typedef int /*<<< orphan*/ sdate;
typedef int /*<<< orphan*/ fmt;

/* Variables and functions */
char *asctime(struct tm *);
char *ctime(char **);
scalar_t__ daylight;
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ free(struct tm *);
struct tm *gmtime(char **);
struct tm *localtime(char **);
struct tm *malloc(int);
char *mktime(struct tm *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
char *strchr(char *, char);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(char **);
char *timezone;
char **tzname;
int /*<<< orphan*/ tzset();
int main(int argc, char *argv[]) {
  time_t td;
  struct tm *dc;
  char sdate[64];
  char fmt[128];
  char *cp;
  time(&td);
  printf("Today is: %s", ctime(&td));
  dc = localtime(&td);
  printf("%02d/%02d/%04d %02d:%02d:%02d\n", dc->tm_mon + 1, dc->tm_mday,
         dc->tm_year + 1900, dc->tm_hour, dc->tm_min, dc->tm_sec);
  free(dc);
  dc = gmtime(&td);
  printf("%02d/%02d/%04d %02d:%02d:%02d\n", dc->tm_mon + 1, dc->tm_mday,
         dc->tm_year + 1900, dc->tm_hour, dc->tm_min, dc->tm_sec);
  printf("Today is: %s", asctime(dc));
  free(dc);
  int i;
  tzset();
  i = (daylight != 0 ? 1 : 0);
  printf("Zone is %ld, its name is '%s'\n", timezone, tzname[i]);
  dc = gmtime(&td);
  time_t tmp = mktime(dc);
  free(dc);
  printf("td = %ld, while tmp = %ld\n", td, tmp);
  dc = malloc(sizeof(*dc));
  dc->tm_mon = 0;
  dc->tm_mday = 1;
  dc->tm_year = 100;
  dc->tm_hour = 0;
  dc->tm_min = 0;
  dc->tm_sec = 0;
  dc->tm_isdst = 0;
  td = mktime(dc);
  printf("Date: %s", ctime(&td));
  free(dc);
  dc = malloc(sizeof(*dc));
  dc->tm_mon = 3;
  dc->tm_mday = 1;
  dc->tm_year = 100;
  dc->tm_hour = 11;
  dc->tm_min = 59;
  dc->tm_sec = 30;
  dc->tm_isdst = 0;
  td = mktime(dc);
  while (fgets(fmt, sizeof(fmt), stdin) != NULL) {
    if ((cp = strchr(fmt, '\n')) != NULL) {
      *cp = '\0';
    }
    strftime(sdate, sizeof(sdate), fmt, dc);
    printf("Format='%s':\n%s\n\n", fmt, sdate);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   10b0 <time@plt>
lea    -0x18(%rbp),%rdi
call   1050 <ctime@plt>
mov    %rax,%rsi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x18(%rbp),%rdi
call   1040 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%ecx
add    $0x76c,%ecx
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x20(%rbp),%rax
mov    0x14(%rax),%eax
lea    0xdb9(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
lea    -0x18(%rbp),%rdi
call   10f0 <gmtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%ecx
add    $0x76c,%ecx
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x20(%rbp),%rax
mov    0x14(%rax),%eax
lea    0xd5e(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1060 <asctime@plt>
mov    %rax,%rsi
lea    0xd34(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   10a0 <tzset@plt>
mov    0x2cd6(%rip),%rax
mov    (%rax),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0xec(%rbp)
mov    0x2cd0(%rip),%rax
mov    (%rax),%rsi
mov    0x2cbe(%rip),%rax
mov    (%rax),%rax
movslq -0xec(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xd05(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x18(%rbp),%rdi
call   10f0 <gmtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   10d0 <mktime@plt>
mov    %rax,-0xf8(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rsi
mov    -0xf8(%rbp),%rdx
lea    0xce5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x20,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x20(%rbp),%rax
movl   $0x64,0x8(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,0x10(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,0x14(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x20(%rbp),%rdi
call   10d0 <mktime@plt>
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1050 <ctime@plt>
mov    %rax,%rsi
lea    0xc7e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    $0x20,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x20(%rbp),%rax
movl   $0x64,0x8(%rax)
mov    -0x20(%rbp),%rax
movl   $0xb,0xc(%rax)
mov    -0x20(%rbp),%rax
movl   $0x3b,0x10(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1e,0x14(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x20(%rbp),%rdi
call   10d0 <mktime@plt>
mov    %rax,-0x18(%rbp)
lea    -0xe0(%rbp),%rdi
mov    0x2b7a(%rip),%rax
mov    (%rax),%edx
mov    $0x80,%esi
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     14e7 <main+0x317>
lea    -0xe0(%rbp),%rdi
mov    $0xa,%esi
call   1070 <strchr@plt>
mov    %rax,-0xe8(%rbp)
cmp    $0x0,%rax
je     14b0 <main+0x2e0>
mov    -0xe8(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x60(%rbp),%rdi
lea    -0xe0(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x40,%esi
call   10e0 <strftime@plt>
lea    -0xe0(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    0xb94(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1460 <main+0x290>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xd0,%rsp
lea    0x8(%rsp),%r15
mov    %r15,%rdi
call   10b0 <time@plt>
mov    %r15,%rdi
call   1050 <ctime@plt>
lea    0xe15(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
call   1040 <localtime@plt>
mov    %rax,%rbx
mov    (%rax),%esi
mov    0x4(%rax),%edx
add    $0x1,%esi
mov    $0x76c,%ebp
mov    0x8(%rax),%ecx
add    %ebp,%ecx
mov    0xc(%rax),%r8d
mov    0x10(%rax),%r9d
mov    0x14(%rax),%eax
mov    %eax,(%rsp)
lea    0xde3(%rip),%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   10f0 <gmtime@plt>
mov    %rax,%rbx
mov    (%rax),%esi
mov    0x4(%rax),%edx
add    0x8(%rax),%ebp
add    $0x1,%esi
mov    0xc(%rax),%r8d
mov    0x10(%rax),%r9d
mov    0x14(%rax),%eax
mov    %eax,(%rsp)
mov    %r12,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1060 <asctime@plt>
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   10a0 <tzset@plt>
mov    0x2d19(%rip),%rax
xor    %ecx,%ecx
cmpq   $0x0,(%rax)
setne  %cl
mov    0x2d21(%rip),%rax
mov    (%rax),%rsi
mov    0x2d0f(%rip),%rax
mov    (%rax),%rax
mov    (%rax,%rcx,8),%rdx
lea    0xd6d(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
call   10f0 <gmtime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10d0 <mktime@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rsi
lea    0xd5b(%rip),%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x20,%edi
call   10c0 <malloc@plt>
mov    %rax,%rbx
movabs $0x100000000,%rax
mov    %rax,(%rbx)
movl   $0x64,0x8(%rbx)
xorps  %xmm0,%xmm0
movups %xmm0,0xc(%rbx)
movl   $0x0,0x1c(%rbx)
mov    %rbx,%rdi
call   10d0 <mktime@plt>
mov    %rax,0x8(%rsp)
mov    %r15,%rdi
call   1050 <ctime@plt>
lea    0xd21(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x20,%edi
call   10c0 <malloc@plt>
mov    %rax,%r14
movaps 0xc85(%rip),%xmm0
movups %xmm0,(%rax)
movabs $0x1e0000003b,%rax
mov    %rax,0x10(%r14)
movq   $0x0,0x18(%r14)
mov    %r14,%rdi
call   10d0 <mktime@plt>
mov    %rax,0x8(%rsp)
mov    0x2c40(%rip),%r12
mov    (%r12),%edx
lea    0x10(%rsp),%rdi
mov    $0x80,%esi
call   1090 <fgets@plt>
test   %rax,%rax
je     1430 <main+0x260>
lea    0x10(%rsp),%rbx
lea    0x90(%rsp),%r15
lea    0xcab(%rip),%rbp
jmp    1419 <main+0x249>
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x40,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   10e0 <strftime@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1090 <fgets@plt>
test   %rax,%rax
je     1430 <main+0x260>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     13e0 <main+0x210>
movb   $0x0,(%rax)
jmp    13e0 <main+0x210>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i64 }
@.str = [13 x i8] c"Today is: %s\00"
@.str.1 = [31 x i8] c"%02d/%02d/%04d %02d:%02d:%02d\0A\00"
@daylight = global i64 0
@.str.2 = [31 x i8] c"Zone is %ld, its name is '%s'\0A\00"
@timezone = global i8* null
@tzname = global i8** null
@.str.3 = [27 x i8] c"td = %ld, while tmp = %ld\0A\00"
@.str.4 = [9 x i8] c"Date: %s\00"
@stdin = global i32 0
@.str.5 = [18 x i8] c"Format='%s':\0A%s\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca %struct.tm*
%8 = alloca [64 x i8]
%9 = alloca [128 x i8]
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = call i32 @time(i8** %6)
%14 = call i8* @ctime(i8** %6)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = call %struct.tm* @localtime(i8** %6)
store %struct.tm* %16, %struct.tm** %7
%17 = load %struct.tm*, %struct.tm** %7
%18 = getelementptr inbounds %struct.tm, %struct.tm* %17, i32 0, i32 0
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
%21 = load %struct.tm*, %struct.tm** %7
%22 = getelementptr inbounds %struct.tm, %struct.tm* %21, i32 0, i32 1
%23 = load i32, i32* %22
%24 = load %struct.tm*, %struct.tm** %7
%25 = getelementptr inbounds %struct.tm, %struct.tm* %24, i32 0, i32 2
%26 = load i32, i32* %25
%27 = add nsw i32 %26, 1900
%28 = load %struct.tm*, %struct.tm** %7
%29 = getelementptr inbounds %struct.tm, %struct.tm* %28, i32 0, i32 3
%30 = load i32, i32* %29
%31 = load %struct.tm*, %struct.tm** %7
%32 = getelementptr inbounds %struct.tm, %struct.tm* %31, i32 0, i32 4
%33 = load i32, i32* %32
%34 = load %struct.tm*, %struct.tm** %7
%35 = getelementptr inbounds %struct.tm, %struct.tm* %34, i32 0, i32 5
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %23, i32 %27, i32 %30, i32 %33, i32 %36)
%38 = load %struct.tm*, %struct.tm** %7
%39 = call i32 @free(%struct.tm* %38)
%40 = call %struct.tm* @gmtime(i8** %6)
store %struct.tm* %40, %struct.tm** %7
%41 = load %struct.tm*, %struct.tm** %7
%42 = getelementptr inbounds %struct.tm, %struct.tm* %41, i32 0, i32 0
%43 = load i32, i32* %42
%44 = add nsw i32 %43, 1
%45 = load %struct.tm*, %struct.tm** %7
%46 = getelementptr inbounds %struct.tm, %struct.tm* %45, i32 0, i32 1
%47 = load i32, i32* %46
%48 = load %struct.tm*, %struct.tm** %7
%49 = getelementptr inbounds %struct.tm, %struct.tm* %48, i32 0, i32 2
%50 = load i32, i32* %49
%51 = add nsw i32 %50, 1900
%52 = load %struct.tm*, %struct.tm** %7
%53 = getelementptr inbounds %struct.tm, %struct.tm* %52, i32 0, i32 3
%54 = load i32, i32* %53
%55 = load %struct.tm*, %struct.tm** %7
%56 = getelementptr inbounds %struct.tm, %struct.tm* %55, i32 0, i32 4
%57 = load i32, i32* %56
%58 = load %struct.tm*, %struct.tm** %7
%59 = getelementptr inbounds %struct.tm, %struct.tm* %58, i32 0, i32 5
%60 = load i32, i32* %59
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %44, i32 %47, i32 %51, i32 %54, i32 %57, i32 %60)
%62 = load %struct.tm*, %struct.tm** %7
%63 = call i8* @asctime(%struct.tm* %62)
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %63)
%65 = load %struct.tm*, %struct.tm** %7
%66 = call i32 @free(%struct.tm* %65)
%67 = call i32 (...) @tzset()
%68 = load i64, i64* @daylight
%69 = icmp ne i64 %68, 0
%70 = zext i1 %69 to i64
%71 = select i1 %69, i32 1, i32 0
store i32 %71, i32* %11
%72 = load i8*, i8** @timezone
%73 = load i8**, i8*** @tzname
%74 = load i32, i32* %11
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %73, i64 %75
%77 = load i8*, i8** %76
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %72, i8* %77)
%79 = call %struct.tm* @gmtime(i8** %6)
store %struct.tm* %79, %struct.tm** %7
%80 = load %struct.tm*, %struct.tm** %7
%81 = call i8* @mktime(%struct.tm* %80)
store i8* %81, i8** %12
%82 = load %struct.tm*, %struct.tm** %7
%83 = call i32 @free(%struct.tm* %82)
%84 = load i8*, i8** %6
%85 = load i8*, i8** %12
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %84, i8* %85)
%87 = call %struct.tm* @malloc(i32 32)
store %struct.tm* %87, %struct.tm** %7
%88 = load %struct.tm*, %struct.tm** %7
%89 = getelementptr inbounds %struct.tm, %struct.tm* %88, i32 0, i32 0
store i32 0, i32* %89
%90 = load %struct.tm*, %struct.tm** %7
%91 = getelementptr inbounds %struct.tm, %struct.tm* %90, i32 0, i32 1
store i32 1, i32* %91
%92 = load %struct.tm*, %struct.tm** %7
%93 = getelementptr inbounds %struct.tm, %struct.tm* %92, i32 0, i32 2
store i32 100, i32* %93
%94 = load %struct.tm*, %struct.tm** %7
%95 = getelementptr inbounds %struct.tm, %struct.tm* %94, i32 0, i32 3
store i32 0, i32* %95
%96 = load %struct.tm*, %struct.tm** %7
%97 = getelementptr inbounds %struct.tm, %struct.tm* %96, i32 0, i32 4
store i32 0, i32* %97
%98 = load %struct.tm*, %struct.tm** %7
%99 = getelementptr inbounds %struct.tm, %struct.tm* %98, i32 0, i32 5
store i32 0, i32* %99
%100 = load %struct.tm*, %struct.tm** %7
%101 = getelementptr inbounds %struct.tm, %struct.tm* %100, i32 0, i32 6
store i64 0, i64* %101
%102 = load %struct.tm*, %struct.tm** %7
%103 = call i8* @mktime(%struct.tm* %102)
store i8* %103, i8** %6
%104 = call i8* @ctime(i8** %6)
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* %104)
%106 = load %struct.tm*, %struct.tm** %7
%107 = call i32 @free(%struct.tm* %106)
%108 = call %struct.tm* @malloc(i32 32)
store %struct.tm* %108, %struct.tm** %7
%109 = load %struct.tm*, %struct.tm** %7
%110 = getelementptr inbounds %struct.tm, %struct.tm* %109, i32 0, i32 0
store i32 3, i32* %110
%111 = load %struct.tm*, %struct.tm** %7
%112 = getelementptr inbounds %struct.tm, %struct.tm* %111, i32 0, i32 1
store i32 1, i32* %112
%113 = load %struct.tm*, %struct.tm** %7
%114 = getelementptr inbounds %struct.tm, %struct.tm* %113, i32 0, i32 2
store i32 100, i32* %114
%115 = load %struct.tm*, %struct.tm** %7
%116 = getelementptr inbounds %struct.tm, %struct.tm* %115, i32 0, i32 3
store i32 11, i32* %116
%117 = load %struct.tm*, %struct.tm** %7
%118 = getelementptr inbounds %struct.tm, %struct.tm* %117, i32 0, i32 4
store i32 59, i32* %118
%119 = load %struct.tm*, %struct.tm** %7
%120 = getelementptr inbounds %struct.tm, %struct.tm* %119, i32 0, i32 5
store i32 30, i32* %120
%121 = load %struct.tm*, %struct.tm** %7
%122 = getelementptr inbounds %struct.tm, %struct.tm* %121, i32 0, i32 6
store i64 0, i64* %122
%123 = load %struct.tm*, %struct.tm** %7
%124 = call i8* @mktime(%struct.tm* %123)
store i8* %124, i8** %6
br label %125
125: ; preds = %136, %2
%126 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%127 = load i32, i32* @stdin
%128 = call i32* @fgets(i8* %126, i32 128, i32 %127)
%129 = icmp ne i32* %128, null
br i1 %129, label %130, label %144
130: ; preds = %125
%131 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%132 = call i8* @strchr(i8* %131, i8 signext 10)
store i8* %132, i8** %10
%133 = icmp ne i8* %132, null
br i1 %133, label %134, label %136
134: ; preds = %130
%135 = load i8*, i8** %10
store i8 0, i8* %135
br label %136
136: ; preds = %134, %130
%137 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%138 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%139 = load %struct.tm*, %struct.tm** %7
%140 = call i32 @strftime(i8* %137, i32 64, i8* %138, %struct.tm* %139)
%141 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%142 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %141, i8* %142)
br label %125
144: ; preds = %125
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i64 }
@.str = [13 x i8] c"Today is: %s\00"
@.str.1 = [31 x i8] c"%02d/%02d/%04d %02d:%02d:%02d\0A\00"
@daylight = global i64 0
@.str.2 = [31 x i8] c"Zone is %ld, its name is '%s'\0A\00"
@timezone = global i8* null
@tzname = global i8** null
@.str.3 = [27 x i8] c"td = %ld, while tmp = %ld\0A\00"
@.str.4 = [9 x i8] c"Date: %s\00"
@stdin = global i32 0
@.str.5 = [18 x i8] c"Format='%s':\0A%s\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = alloca [64 x i8]
%5 = alloca [128 x i8]
%6 = bitcast i8** %3 to i8*
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%9 = call i32 @time(i8** %3)
%10 = call i8* @ctime(i8** %3)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call %struct.tm* @localtime(i8** %3)
%13 = getelementptr inbounds %struct.tm, %struct.tm* %12, i64 0, i32 0
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
%16 = getelementptr inbounds %struct.tm, %struct.tm* %12, i64 0, i32 1
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.tm, %struct.tm* %12, i64 0, i32 2
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1900
%21 = getelementptr inbounds %struct.tm, %struct.tm* %12, i64 0, i32 3
%22 = load i32, i32* %21
%23 = getelementptr inbounds %struct.tm, %struct.tm* %12, i64 0, i32 4
%24 = load i32, i32* %23
%25 = getelementptr inbounds %struct.tm, %struct.tm* %12, i64 0, i32 5
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %17, i32 %20, i32 %22, i32 %24, i32 %26)
%28 = call i32 @free(%struct.tm* %12)
%29 = call %struct.tm* @gmtime(i8** %3)
%30 = getelementptr inbounds %struct.tm, %struct.tm* %29, i64 0, i32 0
%31 = load i32, i32* %30
%32 = add nsw i32 %31, 1
%33 = getelementptr inbounds %struct.tm, %struct.tm* %29, i64 0, i32 1
%34 = load i32, i32* %33
%35 = getelementptr inbounds %struct.tm, %struct.tm* %29, i64 0, i32 2
%36 = load i32, i32* %35
%37 = add nsw i32 %36, 1900
%38 = getelementptr inbounds %struct.tm, %struct.tm* %29, i64 0, i32 3
%39 = load i32, i32* %38
%40 = getelementptr inbounds %struct.tm, %struct.tm* %29, i64 0, i32 4
%41 = load i32, i32* %40
%42 = getelementptr inbounds %struct.tm, %struct.tm* %29, i64 0, i32 5
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %32, i32 %34, i32 %37, i32 %39, i32 %41, i32 %43)
%45 = call i8* @asctime(%struct.tm* %29)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %45)
%47 = call i32 @free(%struct.tm* %29)
%48 = call i32 (...) @tzset()
%49 = load i64, i64* @daylight
%50 = icmp ne i64 %49, 0
%51 = load i8*, i8** @timezone
%52 = load i8**, i8*** @tzname
%53 = zext i1 %50 to i64
%54 = getelementptr inbounds i8*, i8** %52, i64 %53
%55 = load i8*, i8** %54
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %51, i8* %55)
%57 = call %struct.tm* @gmtime(i8** %3)
%58 = call i8* @mktime(%struct.tm* %57)
%59 = call i32 @free(%struct.tm* %57)
%60 = load i8*, i8** %3
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %60, i8* %58)
%62 = call %struct.tm* @malloc(i32 32)
%63 = getelementptr inbounds %struct.tm, %struct.tm* %62, i64 0, i32 0
store i32 0, i32* %63
%64 = getelementptr inbounds %struct.tm, %struct.tm* %62, i64 0, i32 1
store i32 1, i32* %64
%65 = getelementptr inbounds %struct.tm, %struct.tm* %62, i64 0, i32 2
store i32 100, i32* %65
%66 = getelementptr inbounds %struct.tm, %struct.tm* %62, i64 0, i32 3
%67 = bitcast i32* %66 to i8*
%68 = call i8* @mktime(%struct.tm* %62)
store i8* %68, i8** %3
%69 = call i8* @ctime(i8** %3)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* %69)
%71 = call i32 @free(%struct.tm* %62)
%72 = call %struct.tm* @malloc(i32 32)
%73 = bitcast %struct.tm* %72 to <4 x i32>*
store <4 x i32> <i32 3, i32 1, i32 100, i32 11>, <4 x i32>* %73
%74 = getelementptr inbounds %struct.tm, %struct.tm* %72, i64 0, i32 4
store i32 59, i32* %74
%75 = getelementptr inbounds %struct.tm, %struct.tm* %72, i64 0, i32 5
store i32 30, i32* %75
%76 = getelementptr inbounds %struct.tm, %struct.tm* %72, i64 0, i32 6
store i64 0, i64* %76
%77 = call i8* @mktime(%struct.tm* %72)
store i8* %77, i8** %3
%78 = load i32, i32* @stdin
%79 = call i32* @fgets(i8* %8, i32 128, i32 %78)
%80 = icmp eq i32* %79, null
br i1 %80, label %91, label %81
81: ; preds = %2, %85
%82 = call i8* @strchr(i8* %8, i8 signext 10)
%83 = icmp eq i8* %82, null
br i1 %83, label %85, label %84
84: ; preds = %81
store i8 0, i8* %82
br label %85
85: ; preds = %84, %81
%86 = call i32 @strftime(i8* %7, i32 64, i8* %8, %struct.tm* %72)
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %8, i8* %7)
%88 = load i32, i32* @stdin
%89 = call i32* @fgets(i8* %8, i32 128, i32 %88)
%90 = icmp eq i32* %89, null
br i1 %90, label %91, label %81
91: ; preds = %85, %2
ret i32 0
}