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

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ parsedate(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strncmp(char *, char *, int);
main() {
  char ptr1[256], *ptr = ptr1;
  time_t ti;
  fgets(ptr, 255, stdin);
  if (!strncmp("Date: ", ptr, 6))
    ptr += 6;
  ti = parsedate(ptr, 0);
  printf("%s\n", ctime(&ti));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    -0x118(%rbp),%rdi
mov    0x2e6a(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   1060 <fgets@plt>
mov    -0x118(%rbp),%rsi
lea    0xe68(%rip),%rdi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11bd <main+0x6d>
mov    -0x118(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x118(%rbp)
mov    -0x118(%rbp),%rdi
xor    %esi,%esi
call   1070 <parsedate@plt>
mov    %eax,-0x11c(%rbp)
lea    -0x11c(%rbp),%rdi
call   1040 <ctime@plt>
mov    %rax,%rsi
lea    0xe20(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x110,%rsp
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1060 <fgets@plt>
lea    0xe86(%rip),%rdi
mov    %rbx,%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
lea    0x16(%rsp),%rdi
cmovne %rbx,%rdi
xor    %esi,%esi
call   1070 <parsedate@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <ctime@plt>
lea    0xe59(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [7 x i8] c"Date: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 255, i32 %7)
%9 = load i8*, i8** %3
%10 = call i32 @strncmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9, i32 6)
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %0
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 6
store i8* %14, i8** %3
br label %15
15: ; preds = %12, %0
%16 = load i8*, i8** %3
%17 = call i32 @parsedate(i8* %16, i32 0)
store i32 %17, i32* %4
%18 = call i8* @ctime(i32* %4)
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [7 x i8] c"Date: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %3, i32 255, i32 %5)
%7 = call i32 @strncmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i32 6)
%8 = icmp eq i32 %7, 0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 6
%10 = select i1 %8, i8* %9, i8* %3
%11 = call i32 @parsedate(i8* %10, i32 0)
store i32 %11, i32* %2
%12 = call i8* @ctime(i32* %2)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret i32 0
}