#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char word[100], sig[100], oldsig[100];
  int linenum = 0;
  strcpy(oldsig, "");
  while (scanf("%s %s", sig, word) != EOF) {
    if (strcmp(oldsig, sig) != 0 && linenum > 0)
      printf("\n");
    strcpy(oldsig, sig);
    linenum++;
    printf("%s ", word);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x154(%rbp)
lea    -0x150(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xe0(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    0xe7f(%rip),%rdi
call   1060 <scanf@plt>
mov    0x2e5b(%rip),%rcx
cmp    (%rcx),%rax
je     1207 <main+0xc7>
lea    -0x150(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11ce <main+0x8e>
cmpl   $0x0,-0x154(%rbp)
jle    11ce <main+0x8e>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x150(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    116f <main+0x2f>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
lea    0xea1(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcpy@plt>
lea    0xe89(%rip),%rdi
lea    0x70(%rsp),%rsi
lea    0xe0(%rsp),%rdx
call   1070 <scanf@plt>
mov    0x2e58(%rip),%rcx
cmp    (%rcx),%rax
jne    11b3 <main+0x63>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,%r14
lea    0x70(%rsp),%rbx
lea    0xe44(%rip),%r15
lea    0xe0(%rsp),%r12
lea    0xe2f(%rip),%r13
xor    %ebp,%ebp
jmp    1212 <main+0xc2>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1070 <scanf@plt>
mov    0x2ddb(%rip),%rcx
cmp    (%rcx),%rax
je     1195 <main+0x45>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
add    $0xffffffff,%ebp
setb   %cl
test   %rax,%rax
je     11e0 <main+0x90>
test   %cl,%cl
je     11e0 <main+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11e0 <main+0x90>

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [6 x i8] c"%s %s\00"
@EOF = global i64 0
@.str.3 = [4 x i8] c"%s \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %4)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %26, label %11
11: ; preds = %0, %19
%12 = phi i32 [ %21, %19 ], [ 0, %0 ]
%13 = call i64 @strcmp(i8* %6, i8* %5)
%14 = icmp ne i64 %13, 0
%15 = icmp ne i32 %12, 0
%16 = select i1 %14, i1 %15, i1 false
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 @putchar(i32 10)
br label %19
19: ; preds = %17, %11
%20 = call i32 @strcpy(i8* %6, i8* %5)
%21 = add nuw nsw i32 %12, 1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%23 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %4)
%24 = load i64, i64* @EOF
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %11
26: ; preds = %19, %0
%27 = call i32 @putchar(i32 10)
ret i32 0
}