#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 */

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
scalar_t__ strncmp(char *, char *, int);
int main(void) {
  char input_buffer[1024];
  int gotit = 0;
  while (fgets(input_buffer, 1023, stdin)) {
    if (strncmp(input_buffer, "Date", 4) == 0) {
      if (!gotit)
        gotit = 1;
      else
        continue;
    }
    printf("%s", input_buffer);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x414(%rbp)
lea    -0x410(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
mov    $0x3ff,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     11e0 <main+0xa0>
lea    -0x410(%rbp),%rdi
lea    0xe72(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11c8 <main+0x88>
cmpl   $0x0,-0x414(%rbp)
jne    11be <main+0x7e>
movl   $0x1,-0x414(%rbp)
jmp    11c3 <main+0x83>
jmp    115c <main+0x1c>
jmp    11c8 <main+0x88>
lea    -0x410(%rbp),%rsi
lea    0xe2f(%rip),%rdi
call   1040 <printf@plt>
jmp    115c <main+0x1c>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x400,%rsp
mov    0x2e92(%rip),%r12
mov    (%r12),%edx
mov    %rsp,%rdi
mov    $0x3ff,%esi
call   1050 <fgets@plt>
test   %rax,%rax
jne    1173 <main+0x33>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %ebp,%ebp
lea    0xe84(%rip),%r14
mov    %rsp,%rbx
lea    0xe7f(%rip),%r15
jmp    11b1 <main+0x71>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x3ff,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     116c <main+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1190 <main+0x50>
test   %ebp,%ebp
mov    $0x1,%ebp
jne    119b <main+0x5b>
jmp    1190 <main+0x50>

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [5 x i8] c"Date\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @fgets(i8* %2, i32 1023, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %0, %15
%7 = phi i32 [ %16, %15 ], [ 0, %0 ]
%8 = call i64 @strncmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = icmp eq i32 %7, 0
br i1 %11, label %12, label %15
12: ; preds = %10, %6
%13 = phi i32 [ %7, %6 ], [ 1, %10 ]
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %15
15: ; preds = %12, %10
%16 = phi i32 [ 1, %10 ], [ %13, %12 ]
%17 = load i32, i32* @stdin
%18 = call i64 @fgets(i8* %2, i32 1023, i32 %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %6
20: ; preds = %15, %0
%21 = call i32 @exit(i32 0)
unreachable
}