#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, n, acum, aux, dig;
  char cad[300];
  float porcvoc;
  printf("Numeros de Pruebas\n ");
  scanf("%i", &n);
  for (j = 0; j < n; j++) {
    printf("Palabras\n");
    fflush(stdin);
    gets(cad);
    aux = 0;
    acum = 0;
    for (i = 0; i < strlen(cad); i++) {
      if (cad[i] == ' ') {
        aux = aux + 1;
        if (cad[i - 2] == cad[i + 1] && cad[i - 1] == cad[i + 2]) {
          acum = acum + 1;
        } else {
          acum = acum - 1;
        }
      }
    }
    if (aux == acum) {
      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,-0x158(%rbp)
lea    -0x150(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x158(%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 i32
%8 = alloca [300 x i8]
%9 = alloca float
store i32 0, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%11 = 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 %12
12: ; preds = %84, %0
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %87
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* @stdin
%19 = call i32 @fflush(i32 %18)
%20 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%21 = call i32 @gets(i8* %20)
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %2
br label %22
22: ; preds = %72, %16
%23 = load i32, i32* %2
%24 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%25 = call i32 @strlen(i8* %24)
%26 = icmp slt i32 %23, %25
br i1 %26, label %27, label %75
27: ; preds = %22
%28 = load i32, i32* %2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 32
br i1 %33, label %34, label %71
34: ; preds = %27
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
%37 = load i32, i32* %2
%38 = sub nsw i32 %37, 2
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %42, %48
br i1 %49, label %50, label %67
50: ; preds = %34
%51 = load i32, i32* %2
%52 = sub nsw i32 %51, 1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 %53
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = load i32, i32* %2
%58 = add nsw i32 %57, 2
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %56, %62
br i1 %63, label %64, label %67
64: ; preds = %50
%65 = load i32, i32* %5
%66 = add nsw i32 %65, 1
store i32 %66, i32* %5
br label %70
67: ; preds = %50, %34
%68 = load i32, i32* %5
%69 = sub nsw i32 %68, 1
store i32 %69, i32* %5
br label %70
70: ; preds = %67, %64
br label %71
71: ; preds = %70, %27
br label %72
72: ; preds = %71
%73 = load i32, i32* %2
%74 = add nsw i32 %73, 1
store i32 %74, i32* %2
br label %22
75: ; preds = %22
%76 = load i32, i32* %6
%77 = load i32, i32* %5
%78 = icmp eq i32 %76, %77
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %83
81: ; preds = %75
%82 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %83
83: ; preds = %81, %79
br label %84
84: ; preds = %83
%85 = load i32, i32* %3
%86 = add nsw i32 %85, 1
store i32 %86, i32* %3
br label %12
87: ; preds = %12
%88 = 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
}