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

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int,
                          unsigned int, unsigned int, unsigned int,
                          unsigned int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  time_t current = time(NULL);
  const struct tm *t = localtime(&current);
  unsigned buildnum =
      (unsigned)((t->tm_year % 100) * 1000 + (t->tm_mon + 1) * 64 +
                 t->tm_mday * 2 + t->tm_hour / 12) &
      65535;
  printf("%u %u/%02u/%02u %02u:%02u:%02u", buildnum,
         (unsigned)t->tm_year + 1900, (unsigned)t->tm_mon + 1,
         (unsigned)t->tm_mday, (unsigned)t->tm_hour, (unsigned)t->tm_min,
         (unsigned)t->tm_sec);
  (void)argc, (void)argv;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
mov    -0x20(%rbp),%rcx
mov    0x4(%rcx),%ecx
add    $0x1,%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0x20(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
add    %ecx,%eax
and    $0xffff,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
add    $0x76c,%edx
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%r9d
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rax
mov    %eax,%r10d
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
lea    0xe0e(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
movslq (%rax),%rcx
imul   $0x51eb851f,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x25,%rdx
add    %esi,%edx
imul   $0x64,%edx,%esi
lea    0x76c(%rcx),%edx
sub    %esi,%ecx
imul   $0x3e8,%ecx,%esi
mov    0x4(%rax),%ecx
mov    0x8(%rax),%r8d
add    $0x1,%ecx
mov    %ecx,%edi
shl    $0x6,%edi
add    %esi,%edi
lea    (%rdi,%r8,2),%r10d
movslq 0xc(%rax),%r9
imul   $0x2aaaaaab,%r9,%rdi
mov    %rdi,%rsi
shr    $0x3f,%rsi
shr    $0x21,%rdi
add    %esi,%edi
add    %r10d,%edi
movzwl %di,%esi
mov    0x18(%rax),%r10d
mov    0x10(%rax),%eax
lea    0xe51(%rip),%rdi
push   %rax
push   %r10
call   1040 <printf@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i64, i64 }
@.str = [31 x i8] c"%u %u/%02u/%02u %02u:%02u:%02u\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @time(i32* null)
store i32 %9, i32* %6
%10 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %10, %struct.tm** %7
%11 = load %struct.tm*, %struct.tm** %7
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = srem i32 %13, 100
%15 = mul nsw i32 %14, 1000
%16 = load %struct.tm*, %struct.tm** %7
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
%20 = mul nsw i32 %19, 64
%21 = add nsw i32 %15, %20
%22 = load %struct.tm*, %struct.tm** %7
%23 = getelementptr inbounds %struct.tm, %struct.tm* %22, i32 0, i32 2
%24 = load i32, i32* %23
%25 = mul nsw i32 %24, 2
%26 = add nsw i32 %21, %25
%27 = load %struct.tm*, %struct.tm** %7
%28 = getelementptr inbounds %struct.tm, %struct.tm* %27, i32 0, i32 3
%29 = load i32, i32* %28
%30 = sdiv i32 %29, 12
%31 = add nsw i32 %26, %30
%32 = and i32 %31, 65535
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = load %struct.tm*, %struct.tm** %7
%35 = getelementptr inbounds %struct.tm, %struct.tm* %34, i32 0, i32 0
%36 = load i32, i32* %35
%37 = add i32 %36, 1900
%38 = load %struct.tm*, %struct.tm** %7
%39 = getelementptr inbounds %struct.tm, %struct.tm* %38, i32 0, i32 1
%40 = load i32, i32* %39
%41 = add i32 %40, 1
%42 = load %struct.tm*, %struct.tm** %7
%43 = getelementptr inbounds %struct.tm, %struct.tm* %42, i32 0, i32 2
%44 = load i32, i32* %43
%45 = load %struct.tm*, %struct.tm** %7
%46 = getelementptr inbounds %struct.tm, %struct.tm* %45, i32 0, i32 3
%47 = load i32, i32* %46
%48 = load %struct.tm*, %struct.tm** %7
%49 = getelementptr inbounds %struct.tm, %struct.tm* %48, i32 0, i32 5
%50 = load i64, i64* %49
%51 = trunc i64 %50 to i32
%52 = load %struct.tm*, %struct.tm** %7
%53 = getelementptr inbounds %struct.tm, %struct.tm* %52, i32 0, i32 4
%54 = load i64, i64* %53
%55 = trunc i64 %54 to i32
%56 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %33, i32 %37, i32 %41, i32 %44, i32 %47, i32 %51, i32 %55)
%57 = load i32, i32* %4
%58 = load i8**, i8*** %5
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i64, i64 }
@.str = [31 x i8] c"%u %u/%02u/%02u %02u:%02u:%02u\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = srem i32 %8, 100
%10 = mul nsw i32 %9, 1000
%11 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 1
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
%14 = shl nsw i32 %13, 6
%15 = add nsw i32 %14, %10
%16 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 2
%17 = load i32, i32* %16
%18 = shl nsw i32 %17, 1
%19 = add nsw i32 %15, %18
%20 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 3
%21 = load i32, i32* %20
%22 = sdiv i32 %21, 12
%23 = add nsw i32 %19, %22
%24 = and i32 %23, 65535
%25 = add i32 %8, 1900
%26 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 5
%27 = load i64, i64* %26
%28 = trunc i64 %27 to i32
%29 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 4
%30 = load i64, i64* %29
%31 = trunc i64 %30 to i32
%32 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25, i32 %13, i32 %17, i32 %21, i32 %28, i32 %31)
ret i32 0
}