#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int /*<<< orphan*/ system(char *);
int main() {
  int i, j, x, espacio, aux;
  char palabra[300];
  printf("numeros de pruebas\n ");
  scanf("%i", &x);
  for (j = 0; j < x; j++) {
    printf("palabras\n");
    fflush(stdin);
    gets(palabra);
    aux = 0;
    espacio = 0;
    for (i = 0; i < strlen(palabra); i++) {
      if (palabra[i] == ' ') {
        aux = aux + 1;
        if (palabra[i - 2] == palabra[i + 1] &&
            palabra[i - 1] == palabra[i + 2]) {
          espacio = espacio + 1;
        } else {
          espacio = espacio - 1;
        }
      }
    }
    if (aux == espacio) {
      printf("SI\n");
    } else {
      printf("NO\n");
    }
  }
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
lea    0xe90(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    12dc <main+0x17c>
lea    0xe70(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
lea    -0x150(%rbp),%rdi
call   1060 <gets@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x154(%rbp)
lea    -0x150(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x154(%rbp),%eax
cmp    %ecx,%eax
jge    12a0 <main+0x140>
movslq -0x8(%rbp),%rax
movsbl -0x150(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    128d <main+0x12d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
cltq
movsbl -0x150(%rbp,%rax,1),%eax
ff
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl -0x150(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    127f <main+0x11f>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x150(%rbp,%rax,1),%eax
ff
mov    -0x8(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl -0x150(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    127f <main+0x11f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1288 <main+0x128>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    128d <main+0x12d>
jmp    1292 <main+0x132>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11dc <main+0x7c>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    12bd <main+0x15d>
lea    0xd6f(%rip),%rdi
call   1050 <printf@plt>
jmp    12c9 <main+0x169>
lea    0xd62(%rip),%rdi
call   1050 <printf@plt>
jmp    12ce <main+0x16e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1195 <main+0x35>
lea    0xd47(%rip),%rdi
call   1040 <system@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    0xe78(%rip),%rdi
call   1060 <printf@plt>
lea    0xe81(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1090 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1276 <main+0x106>
xor    %ebp,%ebp
lea    0x10(%rsp),%rbx
lea    0xe73(%rip),%r12
jmp    11e0 <main+0x70>
nopl   0x0(%rax)
cmp    %r15d,%r13d
lea    0xe5d(%rip),%rdi
cmove  %r12,%rdi
call   1030 <puts@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jge    1276 <main+0x106>
lea    0xe37(%rip),%rdi
call   1030 <puts@plt>
mov    0x2df5(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    %rbx,%rdi
call   1070 <gets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r12,%rdi
test   %eax,%eax
jle    11ce <main+0x5e>
xor    %eax,%eax
xor    %r13d,%r13d
xor    %r15d,%r15d
jmp    123a <main+0xca>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <strlen@plt>
movslq %eax,%rcx
mov    %r14,%rax
cmp    %rcx,%r14
jge    11c0 <main+0x50>
cmpb   $0x20,0x10(%rsp,%rax,1)
jne    1220 <main+0xb0>
add    $0x1,%r13d
movzbl -0x2(%rax,%rbx,1),%ecx
lea    0x1(%rax),%r14
cmp    0x11(%rsp,%rax,1),%cl
jne    1270 <main+0x100>
movzbl -0x1(%rax,%rbx,1),%ecx
add    $0x2,%eax
cmp    0x10(%rsp,%rax,1),%cl
jne    1270 <main+0x100>
add    $0x1,%r15d
jmp    1227 <main+0xb7>
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%r15d
jmp    1227 <main+0xb7>
lea    0xd9b(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"numeros de pruebas\0A \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [10 x i8] c"palabras\0A\00"
@stdin = global i32 0
@.str.3 = [4 x i8] c"SI\0A\00"
@.str.4 = [4 x i8] c"NO\0A\00"
@.str.5 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [300 x i8]
store i32 0, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
store i32 0, i32* %3
br label %10
10: ; preds = %82, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %85
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* @stdin
%17 = call i32 @fflush(i32 %16)
%18 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 0
%19 = call i32 @gets(i8* %18)
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %2
br label %20
20: ; preds = %70, %14
%21 = load i32, i32* %2
%22 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 0
%23 = call i32 @strlen(i8* %22)
%24 = icmp slt i32 %21, %23
br i1 %24, label %25, label %73
25: ; preds = %20
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 32
br i1 %31, label %32, label %69
32: ; preds = %25
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
%35 = load i32, i32* %2
%36 = sub nsw i32 %35, 2
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %40, %46
br i1 %47, label %48, label %65
48: ; preds = %32
%49 = load i32, i32* %2
%50 = sub nsw i32 %49, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 2
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %54, %60
br i1 %61, label %62, label %65
62: ; preds = %48
%63 = load i32, i32* %5
%64 = add nsw i32 %63, 1
store i32 %64, i32* %5
br label %68
65: ; preds = %48, %32
%66 = load i32, i32* %5
%67 = sub nsw i32 %66, 1
store i32 %67, i32* %5
br label %68
68: ; preds = %65, %62
br label %69
69: ; preds = %68, %25
br label %70
70: ; preds = %69
%71 = load i32, i32* %2
%72 = add nsw i32 %71, 1
store i32 %72, i32* %2
br label %20
73: ; preds = %20
%74 = load i32, i32* %6
%75 = load i32, i32* %5
%76 = icmp eq i32 %74, %75
br i1 %76, label %77, label %79
77: ; preds = %73
%78 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %81
79: ; preds = %73
%80 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %81
81: ; preds = %79, %77
br label %82
82: ; preds = %81
%83 = load i32, i32* %3
%84 = add nsw i32 %83, 1
store i32 %84, i32* %3
br label %10
85: ; preds = %10
%86 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"numeros de pruebas\0A \00"
@.str.1 = [3 x i8] c"%i\00"
@stdin = global i32 0
@.str.5 = [6 x i8] c"PAUSE\00"
@str = [9 x i8] c"palabras\00"
@str.6 = [3 x i8] c"NO\00"
@str.7 = [3 x i8] c"SI\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [300 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [300 x i8], [300 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %64
9: ; preds = %0, %58
%10 = phi i32 [ %61, %58 ], [ 0, %0 ]
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* @stdin
%13 = call i32 @fflush(i32 %12)
%14 = call i32 @gets(i8* %4)
%15 = call i32 @strlen(i8* %4)
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %58
17: ; preds = %9, %48
%18 = phi i64 [ %49, %48 ], [ 0, %9 ]
%19 = phi i32 [ %51, %48 ], [ 0, %9 ]
%20 = phi i32 [ %50, %48 ], [ 0, %9 ]
%21 = getelementptr inbounds [300 x i8], [300 x i8]* %2, i64 0, i64 %18
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 32
br i1 %23, label %26, label %24
24: ; preds = %17
%25 = add nuw nsw i64 %18, 1
br label %48
26: ; preds = %17
%27 = add nsw i32 %19, 1
%28 = add nsw i64 %18, -2
%29 = getelementptr inbounds [300 x i8], [300 x i8]* %2, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = add nuw nsw i64 %18, 1
%32 = getelementptr inbounds [300 x i8], [300 x i8]* %2, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = icmp eq i8 %30, %33
br i1 %34, label %35, label %46
35: ; preds = %26
%36 = add nsw i64 %18, -1
%37 = getelementptr inbounds [300 x i8], [300 x i8]* %2, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = add i64 %18, 2
%40 = and i64 %39, 4294967295
%41 = getelementptr inbounds [300 x i8], [300 x i8]* %2, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = icmp eq i8 %38, %42
br i1 %43, label %44, label %46
44: ; preds = %35
%45 = add nsw i32 %20, 1
br label %48
46: ; preds = %35, %26
%47 = add nsw i32 %20, -1
br label %48
48: ; preds = %24, %46, %44
%49 = phi i64 [ %25, %24 ], [ %31, %46 ], [ %31, %44 ]
%50 = phi i32 [ %20, %24 ], [ %47, %46 ], [ %45, %44 ]
%51 = phi i32 [ %19, %24 ], [ %27, %46 ], [ %27, %44 ]
%52 = call i32 @strlen(i8* %4)
%53 = sext i32 %52 to i64
%54 = icmp slt i64 %49, %53
br i1 %54, label %17, label %55
55: ; preds = %48
%56 = icmp eq i32 %51, %50
%57 = select i1 %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.6, i64 0, i64 0)
br label %58
58: ; preds = %55, %9
%59 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.7, i64 0, i64 0), %9 ], [ %57, %55 ]
%60 = call i32 @puts(i8* dereferenceable(1) %59)
%61 = add nuw nsw i32 %10, 1
%62 = load i32, i32* %1
%63 = icmp slt i32 %61, %62
br i1 %63, label %9, label %64
64: ; preds = %58, %0
%65 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}