#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 tm_sec;
};

/* Variables and functions */
int date(int, int, int);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  time_t rawtime;
  struct tm *timeinfo;
  int i, n = 0;
  for (i = 0; i < 10; i++) {
    system("clear");
    time(&rawtime);
    timeinfo = localtime(&rawtime);
    printf("ÏÖÔÚÊÇ%4dÄê%02dÔÂ%02dÈÕ%02dÊ±%02d·Ö%02dÃë\n",
           1900 + timeinfo->tm_year, 1 + timeinfo->tm_mon, timeinfo->tm_mday,
           timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
    printf("Àë2014Äê¸ß¿¼»¹ÓÐ%2dÌì\n",
           date(1900 + timeinfo->tm_year, 1 + timeinfo->tm_mon,
                timeinfo->tm_mday));
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    123f <main+0xdf>
lea    0xe6b(%rip),%rdi
call   1040 <system@plt>
lea    -0x14(%rbp),%rdi
call   1070 <time@plt>
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
add    $0x76c,%esi
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edx
add    $0x1,%edx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%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    0xe1b(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
add    $0x76c,%edi
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%esi
add    $0x1,%esi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%edx
call   1060 <date@plt>
mov    %eax,%esi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1184 <main+0x24>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0xa,%ebp
lea    0x14(%rsp),%r13
mov    $0x76c,%r14d
lea    0xe81(%rip),%r15
lea    0xeb7(%rip),%r12
nopl   0x0(%rax)
lea    0xe69(%rip),%rdi
call   1040 <system@plt>
mov    %r13,%rdi
call   1070 <time@plt>
mov    %r13,%rdi
call   1030 <localtime@plt>
mov    %rax,%rbx
mov    (%rax),%esi
add    %r14d,%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)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%edi
add    %r14d,%edi
mov    0x4(%rbx),%esi
mov    0x8(%rbx),%edx
add    $0x1,%esi
call   1060 <date@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x30>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [6 x i8] c"clear\00"
@.str.1 = [61 x i8] c"\C3\8F\C3\96\C3\94\C3\9A\C3\8A\C3\87%4d\C3\84\C3\AA%02d\C3\94\C3\82%02d\C3\88\C3\95%02d\C3\8A\C2\B1%02d\C2\B7\C3\96%02d\C3\83\C3\AB\0A\00"
@.str.2 = [37 x i8] c"\C3\80\C3\AB2014\C3\84\C3\AA\C2\B8\C3\9F\C2\BF\C2\BC\C2\BB\C2\B9\C3\93\C3\90%2d\C3\8C\C3\AC\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.tm*
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
store i32 0, i32* %8
br label %10
10: ; preds = %52, %2
%11 = load i32, i32* %8
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %55
13: ; preds = %10
%14 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @time(i32* %6)
%16 = call %struct.tm* @localtime(i32* %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 1900, %19
%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 = add nsw i32 1, %23
%25 = load %struct.tm*, %struct.tm** %7
%26 = getelementptr inbounds %struct.tm, %struct.tm* %25, i32 0, i32 2
%27 = load i32, i32* %26
%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*, i32, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %24, i32 %27, i32 %30, i32 %33, i32 %36)
%38 = load %struct.tm*, %struct.tm** %7
%39 = getelementptr inbounds %struct.tm, %struct.tm* %38, i32 0, i32 0
%40 = load i32, i32* %39
%41 = add nsw i32 1900, %40
%42 = load %struct.tm*, %struct.tm** %7
%43 = getelementptr inbounds %struct.tm, %struct.tm* %42, i32 0, i32 1
%44 = load i32, i32* %43
%45 = add nsw i32 1, %44
%46 = load %struct.tm*, %struct.tm** %7
%47 = getelementptr inbounds %struct.tm, %struct.tm* %46, i32 0, i32 2
%48 = load i32, i32* %47
%49 = call i32 @date(i32 %41, i32 %45, i32 %48)
%50 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %49)
%51 = call i32 @sleep(i32 1)
br label %52
52: ; preds = %13
%53 = load i32, i32* %8
%54 = add nsw i32 %53, 1
store i32 %54, i32* %8
br label %10
55: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [6 x i8] c"clear\00"
@.str.1 = [61 x i8] c"\C3\8F\C3\96\C3\94\C3\9A\C3\8A\C3\87%4d\C3\84\C3\AA%02d\C3\94\C3\82%02d\C3\88\C3\95%02d\C3\8A\C2\B1%02d\C2\B7\C3\96%02d\C3\83\C3\AB\0A\00"
@.str.2 = [37 x i8] c"\C3\80\C3\AB2014\C3\84\C3\AA\C2\B8\C3\9F\C2\BF\C2\BC\C2\BB\C2\B9\C3\93\C3\90%2d\C3\8C\C3\AC\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ 0, %2 ], [ %33, %5 ]
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @time(i32* %3)
%9 = call %struct.tm* @localtime(i32* %3)
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 0
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1900
%13 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 1
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
%16 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 2
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 3
%19 = load i32, i32* %18
%20 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 4
%21 = load i32, i32* %20
%22 = getelementptr inbounds %struct.tm, %struct.tm* %9, i64 0, i32 5
%23 = load i32, i32* %22
%24 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %15, i32 %17, i32 %19, i32 %21, i32 %23)
%25 = load i32, i32* %10
%26 = add nsw i32 %25, 1900
%27 = load i32, i32* %13
%28 = add nsw i32 %27, 1
%29 = load i32, i32* %16
%30 = call i32 @date(i32 %26, i32 %28, i32 %29)
%31 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = call i32 @sleep(i32 1)
%33 = add nuw nsw i32 %6, 1
%34 = icmp eq i32 %33, 10
br i1 %34, label %35, label %5
35: ; preds = %5
ret i32 0
}