#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*/ wchar_t;
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
size_t wcsftime(int /*<<< orphan*/ *, int, char *, struct tm *);
int /*<<< orphan*/ wprintf(char *, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  wchar_t buf[200];
  time_t t;
  struct tm *tp;
  int result = 0;
  size_t n;
  time(&t);
  tp = gmtime(&t);
  n = wcsftime(buf, sizeof(buf) / sizeof(buf[0]), L"%H:%M:%S  %Y-%m-%d\n", tp);
  if (n != 21)
    result = 1;
  wprintf(L"It is now %ls", buf);
  wcsftime(buf, sizeof(buf) / sizeof(buf[0]), L"%A\n", tp);
  wprintf(L"The weekday is %ls", buf);
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x344(%rbp)
lea    -0x334(%rbp),%rdi
call   1040 <time@plt>
lea    -0x334(%rbp),%rdi
call   1060 <gmtime@plt>
mov    %rax,-0x340(%rbp)
lea    -0x330(%rbp),%rdi
mov    -0x340(%rbp),%rcx
mov    $0xc8,%esi
lea    0xe64(%rip),%rdx
call   1030 <wcsftime@plt>
mov    %rax,-0x350(%rbp)
cmpq   $0x15,-0x350(%rbp)
15
je     11c0 <main+0x80>
movl   $0x1,-0x344(%rbp)
lea    -0x330(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1050 <wprintf@plt>
lea    -0x330(%rbp),%rdi
mov    -0x340(%rbp),%rcx
mov    $0xc8,%esi
lea    0xe9b(%rip),%rdx
call   1030 <wcsftime@plt>
lea    -0x330(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1050 <wprintf@plt>
mov    -0x344(%rbp),%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x330,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1060 <gmtime@plt>
mov    %rax,%rbx
lea    0xe96(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0xc8,%esi
mov    %rax,%rcx
call   1030 <wcsftime@plt>
xor    %ebp,%ebp
cmp    $0x15,%rax
setne  %bpl
lea    0xec0(%rip),%rdi
mov    %r14,%rsi
call   1050 <wprintf@plt>
lea    0xee9(%rip),%rdx
mov    %r14,%rdi
mov    $0xc8,%esi
mov    %rbx,%rcx
call   1030 <wcsftime@plt>
lea    0xee2(%rip),%rdi
mov    %r14,%rsi
call   1050 <wprintf@plt>
mov    %ebp,%eax
add    $0x330,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [20 x i32] [i32 37, i32 72, i32 58, i32 37, i32 77, i32 58, i32 37, i32 83, i32 32, i32 32, i32 37, i32 89, i32 45, i32 37, i32 109, i32 45, i32 37, i32 100, i32 10, i32 0]
@.str.1 = [14 x i32] [i32 73, i32 116, i32 32, i32 105, i32 115, i32 32, i32 110, i32 111, i32 119, i32 32, i32 37, i32 108, i32 115, i32 0]
@.str.2 = [4 x i32] [i32 37, i32 65, i32 10, i32 0]
@.str.3 = [19 x i32] [i32 84, i32 104, i32 101, i32 32, i32 119, i32 101, i32 101, i32 107, i32 100, i32 97, i32 121, i32 32, i32 105, i32 115, i32 32, i32 37, i32 108, i32 115, i32 0]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [200 x i32]
%7 = alloca i32
%8 = alloca %struct.tm*
%9 = alloca i32
%10 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
%11 = call i32 @time(i32* %7)
%12 = call %struct.tm* @gmtime(i32* %7)
store %struct.tm* %12, %struct.tm** %8
%13 = getelementptr inbounds [200 x i32], [200 x i32]* %6, i64 0, i64 0
%14 = load %struct.tm*, %struct.tm** %8
%15 = call i64 @wcsftime(i32* %13, i32 200, i8* bitcast ([20 x i32]* @.str to i8*), %struct.tm* %14)
store i64 %15, i64* %10
%16 = load i64, i64* %10
%17 = icmp ne i64 %16, 21
br i1 %17, label %18, label %19
18: ; preds = %2
store i32 1, i32* %9
br label %19
19: ; preds = %18, %2
%20 = getelementptr inbounds [200 x i32], [200 x i32]* %6, i64 0, i64 0
%21 = call i32 @wprintf(i8* bitcast ([14 x i32]* @.str.1 to i8*), i32* %20)
%22 = getelementptr inbounds [200 x i32], [200 x i32]* %6, i64 0, i64 0
%23 = load %struct.tm*, %struct.tm** %8
%24 = call i64 @wcsftime(i32* %22, i32 200, i8* bitcast ([4 x i32]* @.str.2 to i8*), %struct.tm* %23)
%25 = getelementptr inbounds [200 x i32], [200 x i32]* %6, i64 0, i64 0
%26 = call i32 @wprintf(i8* bitcast ([19 x i32]* @.str.3 to i8*), i32* %25)
%27 = load i32, i32* %9
ret i32 %27
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [20 x i32] [i32 37, i32 72, i32 58, i32 37, i32 77, i32 58, i32 37, i32 83, i32 32, i32 32, i32 37, i32 89, i32 45, i32 37, i32 109, i32 45, i32 37, i32 100, i32 10, i32 0]
@.str.1 = [14 x i32] [i32 73, i32 116, i32 32, i32 105, i32 115, i32 32, i32 110, i32 111, i32 119, i32 32, i32 37, i32 108, i32 115, i32 0]
@.str.2 = [4 x i32] [i32 37, i32 65, i32 10, i32 0]
@.str.3 = [19 x i32] [i32 84, i32 104, i32 101, i32 32, i32 119, i32 101, i32 101, i32 107, i32 100, i32 97, i32 121, i32 32, i32 105, i32 115, i32 32, i32 37, i32 108, i32 115, i32 0]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [200 x i32]
%4 = alloca i32
%5 = bitcast [200 x i32]* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @time(i32* %4)
%8 = call %struct.tm* @gmtime(i32* %4)
%9 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 0
%10 = call i64 @wcsftime(i32* %9, i32 200, i8* bitcast ([20 x i32]* @.str to i8*), %struct.tm* %8)
%11 = icmp ne i64 %10, 21
%12 = zext i1 %11 to i32
%13 = call i32 @wprintf(i8* bitcast ([14 x i32]* @.str.1 to i8*), i32* %9)
%14 = call i64 @wcsftime(i32* %9, i32 200, i8* bitcast ([4 x i32]* @.str.2 to i8*), %struct.tm* %8)
%15 = call i32 @wprintf(i8* bitcast ([19 x i32]* @.str.3 to i8*), i32* %9)
ret i32 %12
}