#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 EOF;
int /*<<< orphan*/ printf(char *, char *);
int readl(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  int nb_chars;
  char line[81];
  char last_line[81];
  nb_chars = readl(line);
  strcpy(last_line, line);
  while ((nb_chars = readl(line)) != EOF) {
    if (strcmp(line, last_line) != 0) {
      printf("%s\n", last_line);
      strcpy(last_line, line);
    }
  }
  printf("%s\n", last_line);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
call   1050 <readl@plt>
mov    %eax,-0x8(%rbp)
lea    -0xc0(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x60(%rbp),%rdi
call   1050 <readl@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e67(%rip),%rcx
cmp    (%rcx),%eax
je     11cb <main+0x8b>
lea    -0x60(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11c6 <main+0x86>
lea    -0xc0(%rbp),%rsi
lea    0xe4f(%rip),%rdi
call   1040 <printf@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    116e <main+0x2e>
lea    -0xc0(%rbp),%rsi
lea    0xe27(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xb8,%rsp
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <readl@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <readl@plt>
mov    0x2e73(%rip),%r12
cmp    (%r12),%eax
jne    119b <main+0x5b>
lea    0xe7e(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0x60(%rsp),%rbx
mov    %rsp,%r14
lea    0xe56(%rip),%r15
jmp    11be <main+0x7e>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <readl@plt>
cmp    (%r12),%eax
je     117b <main+0x3b>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11b0 <main+0x70>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    11b0 <main+0x70>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [81 x i8]
%4 = alloca [81 x i8]
store i32 0, i32* %1
%5 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%6 = call i32 @readl(i8* %5)
store i32 %6, i32* %2
%7 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%9 = call i32 @strcpy(i8* %7, i8* %8)
br label %10
10: ; preds = %26, %0
%11 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%12 = call i32 @readl(i8* %11)
store i32 %12, i32* %2
%13 = load i32, i32* @EOF
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %27
15: ; preds = %10
%16 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%17 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%18 = call i64 @strcmp(i8* %16, i8* %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%24 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%25 = call i32 @strcpy(i8* %23, i8* %24)
br label %26
26: ; preds = %20, %15
br label %10
27: ; preds = %10
%28 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %28)
%30 = load i32, i32* %1
ret i32 %30
}

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