#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 */
char gets(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  int temp = 0;
  int location = 0;
  int counter = 0;
  int number = 0;
  int NumberOfRow = 0;
  char str[100][100] = {{'\0'}};
  char OutPut[100][100] = {{'\0'}};
  printf("Please enter some strs each end of \"Enter\" \nBut the number of "
         "strs must smaller than 100 .You have \nto make sure the length of "
         "each str smaller than 100character !\n\n");
  while (gets(str[NumberOfRow]) != '\0' && (NumberOfRow < 100)) {
    NumberOfRow++;
  }
  for (temp = 0; (temp < 100 - 1); temp++) {
    if (strcmp(str[temp], str[temp + 1]) == 0) {
      for (location = temp, number = 1;
           strcmp(str[location], str[location + 1]) == 0; location++) {
        number++;
      }
      if (number > 0) {
        strcpy(OutPut[counter], str[temp]);
        temp += number - 1;
        counter++;
      }
    }
  }
  temp = 0;
  while (temp < counter) {
    printf("%s\n", OutPut[temp]);
    temp++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4e50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x2730(%rbp),%rdi
xor    %esi,%esi
mov    $0x2710,%edx
call   1050 <memset@plt>
lea    -0x4e40(%rbp),%rdi
xor    %esi,%esi
mov    $0x2710,%edx
call   1050 <memset@plt>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x18(%rbp),%rax
lea    -0x2730(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
call   1070 <gets@plt>
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x4e41(%rbp)
je     11f1 <main+0xa1>
cmpl   $0x64,-0x18(%rbp)
setl   %al
mov    %al,-0x4e41(%rbp)
mov    -0x4e41(%rbp),%al
test   $0x1,%al
jne    1204 <main+0xb4>
jmp    1212 <main+0xc2>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b9 <main+0x69>
movl   $0x0,-0x8(%rbp)
cmpl   $0x63,-0x8(%rbp)
jge    1315 <main+0x1c5>
movslq -0x8(%rbp),%rax
lea    -0x2730(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x2730(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1302 <main+0x1b2>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x14(%rbp)
movslq -0xc(%rbp),%rax
lea    -0x2730(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x2730(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12b5 <main+0x165>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1267 <main+0x117>
cmpl   $0x0,-0x14(%rbp)
jle    12fd <main+0x1ad>
movslq -0x10(%rbp),%rax
lea    -0x4e40(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
movslq -0x8(%rbp),%rax
lea    -0x2730(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1302 <main+0x1b2>
jmp    1307 <main+0x1b7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1219 <main+0xc9>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1356 <main+0x206>
movslq -0x8(%rbp),%rax
lea    -0x4e40(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    131c <main+0x1cc>
xor    %eax,%eax
add    $0x4e50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4e20,%rsp
mov    %rsp,%rbx
xor    %r15d,%r15d
mov    $0x2710,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0x2710(%rsp),%r14
mov    $0x2710,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe6d(%rip),%rdi
call   1040 <puts@plt>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1070 <gets@plt>
test   %al,%al
je     11bd <main+0x6d>
lea    0x1(%r15),%rax
add    $0x64,%rbx
cmp    $0x64,%r15
mov    %rax,%r15
jb     11a0 <main+0x50>
xor    %r12d,%r12d
xor    %r13d,%r13d
jmp    11d9 <main+0x89>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x62,%r13d
mov    %ebx,%r13d
jge    1255 <main+0x105>
movslq %r13d,%rbx
imul   $0x64,%rbx,%rax
lea    (%rsp,%rax,1),%r15
add    $0x1,%ebx
movslq %ebx,%rax
imul   $0x64,%rax,%rax
lea    (%rsp,%rax,1),%rsi
mov    %r15,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11d0 <main+0x80>
mov    %r15,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x64(%rdi),%rbx
mov    %rbx,%rsi
call   1060 <strcmp@plt>
add    $0x1,%r13d
mov    %rbx,%rdi
test   %rax,%rax
je     1210 <main+0xc0>
movslq %r12d,%r12
imul   $0x64,%r12,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x2710,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r13d,%ebx
lea    -0x1(%r13),%eax
add    $0x1,%r12d
mov    %eax,%r13d
jmp    11d0 <main+0x80>
test   %r12d,%r12d
jle    1272 <main+0x122>
mov    %r12d,%ebx
nopl   (%rax)
mov    %r14,%rdi
call   1040 <puts@plt>
add    $0x64,%r14
add    $0xffffffffffffffff,%rbx
jne    1260 <main+0x110>
xor    %eax,%eax
add    $0x4e20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [166 x i8] c"Please enter some strs each end of \22Enter\22 \0ABut the number of strs must smaller than 100 .You have \0Ato make sure the length of each str smaller than 100character !\0A\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [100 x [100 x i8]]
%8 = alloca [100 x [100 x i8]]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%9 = bitcast [100 x [100 x i8]]* %7 to i8*
%10 = bitcast [100 x [100 x i8]]* %8 to i8*
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %25, %0
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %7, i64 0, i64 %14
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %15, i64 0, i64 0
%17 = call signext i8 @gets(i8* %16)
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %12
%21 = load i32, i32* %6
%22 = icmp slt i32 %21, 100
br label %23
23: ; preds = %20, %12
%24 = phi i1 [ false, %12 ], [ %22, %20 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %12
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %85, %28
%30 = load i32, i32* %2
%31 = icmp slt i32 %30, 99
br i1 %31, label %32, label %88
32: ; preds = %29
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %7, i64 0, i64 %34
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %35, i64 0, i64 0
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %7, i64 0, i64 %39
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %40, i64 0, i64 0
%42 = call i64 @strcmp(i8* %36, i8* %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %84
44: ; preds = %32
%45 = load i32, i32* %2
store i32 %45, i32* %3
store i32 1, i32* %5
br label %46
46: ; preds = %61, %44
%47 = load i32, i32* %3
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %7, i64 0, i64 %48
%50 = getelementptr inbounds [100 x i8], [100 x i8]* %49, i64 0, i64 0
%51 = load i32, i32* %3
%52 = add nsw i32 %51, 1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %7, i64 0, i64 %53
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %54, i64 0, i64 0
%56 = call i64 @strcmp(i8* %50, i8* %55)
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %64
58: ; preds = %46
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 1
store i32 %60, i32* %5
br label %61
61: ; preds = %58
%62 = load i32, i32* %3
%63 = add nsw i32 %62, 1
store i32 %63, i32* %3
br label %46
64: ; preds = %46
%65 = load i32, i32* %5
%66 = icmp sgt i32 %65, 0
br i1 %66, label %67, label %83
67: ; preds = %64
%68 = load i32, i32* %4
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %8, i64 0, i64 %69
%71 = getelementptr inbounds [100 x i8], [100 x i8]* %70, i64 0, i64 0
%72 = load i32, i32* %2
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %7, i64 0, i64 %73
%75 = getelementptr inbounds [100 x i8], [100 x i8]* %74, i64 0, i64 0
%76 = call i32 @strcpy(i8* %71, i8* %75)
%77 = load i32, i32* %5
%78 = sub nsw i32 %77, 1
%79 = load i32, i32* %2
%80 = add nsw i32 %79, %78
store i32 %80, i32* %2
%81 = load i32, i32* %4
%82 = add nsw i32 %81, 1
store i32 %82, i32* %4
br label %83
83: ; preds = %67, %64
br label %84
84: ; preds = %83, %32
br label %85
85: ; preds = %84
%86 = load i32, i32* %2
%87 = add nsw i32 %86, 1
store i32 %87, i32* %2
br label %29
88: ; preds = %29
store i32 0, i32* %2
br label %89
89: ; preds = %93, %88
%90 = load i32, i32* %2
%91 = load i32, i32* %4
%92 = icmp slt i32 %90, %91
br i1 %92, label %93, label %101
93: ; preds = %89
%94 = load i32, i32* %2
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %8, i64 0, i64 %95
%97 = getelementptr inbounds [100 x i8], [100 x i8]* %96, i64 0, i64 0
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %97)
%99 = load i32, i32* %2
%100 = add nsw i32 %99, 1
store i32 %100, i32* %2
br label %89
101: ; preds = %89
ret i32 0
}

LLVM IR (-O2):
@str = [165 x i8] c"Please enter some strs each end of \22Enter\22 \0ABut the number of strs must smaller than 100 .You have \0Ato make sure the length of each str smaller than 100character !\0A\00"
define i32 @main() {
%1 = alloca [100 x [100 x i8]]
%2 = alloca [100 x [100 x i8]]
%3 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %2, i64 0, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([165 x i8], [165 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %6, %0
%7 = phi i64 [ %13, %6 ], [ 0, %0 ]
%8 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 %7, i64 0
%9 = call signext i8 @gets(i8* %8)
%10 = icmp ne i8 %9, 0
%11 = icmp ult i64 %7, 100
%12 = select i1 %10, i1 %11, i1 false
%13 = add nuw nsw i64 %7, 1
br i1 %12, label %6, label %18
14: ; preds = %45
%15 = icmp sgt i32 %48, 0
br i1 %15, label %16, label %56
16: ; preds = %14
%17 = zext i32 %48 to i64
br label %50
18: ; preds = %6, %45
%19 = phi i32 [ %48, %45 ], [ 0, %6 ]
%20 = phi i32 [ %46, %45 ], [ 0, %6 ]
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 %21, i64 0
%23 = add nsw i32 %20, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 %24, i64 0
%26 = call i64 @strcmp(i8* %22, i8* %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %45
28: ; preds = %18, %28
%29 = phi i64 [ %32, %28 ], [ %21, %18 ]
%30 = phi i32 [ %36, %28 ], [ 1, %18 ]
%31 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 %29, i64 0
%32 = add i64 %29, 1
%33 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 %32, i64 0
%34 = call i64 @strcmp(i8* %31, i8* %33)
%35 = icmp eq i64 %34, 0
%36 = add nuw nsw i32 %30, 1
br i1 %35, label %28, label %37
37: ; preds = %28
%38 = sext i32 %19 to i64
%39 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %2, i64 0, i64 %38, i64 0
%40 = call i32 @strcpy(i8* %39, i8* %22)
%41 = add i32 %20, -1
%42 = add i32 %41, %30
%43 = add nsw i32 %19, 1
%44 = add i32 %20, %30
br label %45
45: ; preds = %18, %37
%46 = phi i32 [ %23, %18 ], [ %44, %37 ]
%47 = phi i32 [ %20, %18 ], [ %42, %37 ]
%48 = phi i32 [ %19, %18 ], [ %43, %37 ]
%49 = icmp slt i32 %47, 98
br i1 %49, label %18, label %14
50: ; preds = %16, %50
%51 = phi i64 [ 0, %16 ], [ %54, %50 ]
%52 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %2, i64 0, i64 %51, i64 0
%53 = call i32 @puts(i8* %52)
%54 = add nuw nsw i64 %51, 1
%55 = icmp eq i64 %54, %17
br i1 %55, label %56, label %50
56: ; preds = %50, %14
ret i32 0
}