#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_hour;
  int tm_min;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  time_t time1;
  time(&time1);
  struct tm *info = gmtime(&time1);
  printf("当前的世界时钟：\n");
  printf("伦敦：%2d:%02d\n", (info->tm_hour + (+1)) % 24, info->tm_min);
  printf("中国：%2d:%02d\n", (info->tm_hour + (+8)) % 24, info->tm_min);
  char buffer[8];
  strftime(buffer, 80, "%Y-%m-%d %H:%M:%S", info);
  printf("%s", buffer);
  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)
lea    -0x14(%rbp),%rdi
call   1040 <time@plt>
lea    -0x14(%rbp),%rdi
call   1060 <gmtime@plt>
mov    %rax,-0x20(%rbp)
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
add    $0x8,%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x50,%esi
lea    0xe62(%rip),%rdx
call   1050 <strftime@plt>
lea    -0x28(%rbp),%rsi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1070 <gmtime@plt>
mov    %rax,%rbx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%eax
mov    0x4(%rbx),%edx
mov    %eax,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x2aaaaaab,%rcx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
shr    $0x22,%rcx
add    %esi,%ecx
shl    $0x3,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe4f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%eax
mov    0x4(%rbx),%edx
mov    %eax,%ecx
add    $0x8,%ecx
movslq %ecx,%rcx
imul   $0x2aaaaaab,%rcx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
shr    $0x22,%rcx
add    %esi,%ecx
shl    $0x3,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x8,%esi
lea    0xe25(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe2a(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x50,%esi
mov    %rbx,%rcx
call   1060 <strftime@plt>
lea    0xe20(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
@.str = [26 x i8] c"\E5\BD\93\E5\89\8D\E7\9A\84\E4\B8\96\E7\95\8C\E6\97\B6\E9\92\9F\EF\BC\9A\0A\00"
@.str.1 = [19 x i8] c"\E4\BC\A6\E6\95\A6\EF\BC\9A%2d:%02d\0A\00"
@.str.2 = [19 x i8] c"\E4\B8\AD\E5\9B\BD\EF\BC\9A%2d:%02d\0A\00"
@.str.3 = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
@.str.4 = [3 x i8] c"%s\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 [8 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @time(i32* %6)
%10 = call %struct.tm* @gmtime(i32* %6)
store %struct.tm* %10, %struct.tm** %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = load %struct.tm*, %struct.tm** %7
%13 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
%16 = srem i32 %15, 24
%17 = load %struct.tm*, %struct.tm** %7
%18 = getelementptr inbounds %struct.tm, %struct.tm* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %19)
%21 = load %struct.tm*, %struct.tm** %7
%22 = getelementptr inbounds %struct.tm, %struct.tm* %21, i32 0, i32 0
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 8
%25 = srem i32 %24, 24
%26 = load %struct.tm*, %struct.tm** %7
%27 = getelementptr inbounds %struct.tm, %struct.tm* %26, i32 0, i32 1
%28 = load i32, i32* %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %25, i32 %28)
%30 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%31 = load %struct.tm*, %struct.tm** %7
%32 = call i32 @strftime(i8* %30, i32 80, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), %struct.tm* %31)
%33 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %33)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
@.str.1 = [19 x i8] c"\E4\BC\A6\E6\95\A6\EF\BC\9A%2d:%02d\0A\00"
@.str.2 = [19 x i8] c"\E4\B8\AD\E5\9B\BD\EF\BC\9A%2d:%02d\0A\00"
@.str.3 = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
@.str.4 = [3 x i8] c"%s\00"
@str = [25 x i8] c"\E5\BD\93\E5\89\8D\E7\9A\84\E4\B8\96\E7\95\8C\E6\97\B6\E9\92\9F\EF\BC\9A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [8 x i8]
%5 = bitcast i32* %3 to i8*
%6 = call i32 @time(i32* %3)
%7 = call %struct.tm* @gmtime(i32* %3)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%9 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 0
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
%12 = srem i32 %11, 24
%13 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 1
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %14)
%16 = load i32, i32* %9
%17 = add nsw i32 %16, 8
%18 = srem i32 %17, 24
%19 = load i32, i32* %13
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %18, i32 %19)
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%22 = call i32 @strftime(i8* %21, i32 80, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), %struct.tm* %7)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %21)
ret i32 0
}