#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*/ time(int /*<<< orphan*/ *);
int main() {
  time_t rawtime;
  struct tm *info;
  time(&rawtime);
  info = gmtime(&rawtime);
  printf("Current world clock:\n");
  printf("London : %2d:%02d\n", (info->tm_hour + (+1)) % 24, info->tm_min);
  printf("China  : %2d:%02d\n", (info->tm_hour + (+8)) % 24, info->tm_min);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <time@plt>
lea    -0x8(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,-0x10(%rbp)
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x8,%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1060 <gmtime@plt>
mov    %rax,%rbx
lea    0xec2(%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    0xe61(%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    0xe37(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
@.str = [22 x i8] c"Current world clock:\0A\00"
@.str.1 = [19 x i8] c"London : %2d:%02d\0A\00"
@.str.2 = [19 x i8] c"China : %2d:%02d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.tm*
store i32 0, i32* %1
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @gmtime(i32* %2)
store %struct.tm* %5, %struct.tm** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = load %struct.tm*, %struct.tm** %3
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %10, 24
%12 = load %struct.tm*, %struct.tm** %3
%13 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %14)
%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, 8
%20 = srem i32 %19, 24
%21 = load %struct.tm*, %struct.tm** %3
%22 = getelementptr inbounds %struct.tm, %struct.tm* %21, i32 0, i32 1
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %20, i32 %23)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
@.str.1 = [19 x i8] c"London : %2d:%02d\0A\00"
@.str.2 = [19 x i8] c"China : %2d:%02d\0A\00"
@str = [21 x i8] c"Current world clock:\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 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
%9 = srem i32 %8, 24
%10 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%11 = load i32, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %11)
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 8
%15 = srem i32 %14, 24
%16 = load i32, i32* %10
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %16)
ret i32 0
}