#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ str_reverse(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  int n, i;
  char var[101][5], string[51], string1[51];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s", string);
    strcpy(string1, string);
    str_reverse(string);
    if (strcmp(string, string1) == 0)
      strcpy(var[i], "Sim");
    else
      strcpy(var[i], "Nao");
  }
  printf("%d\n", n);
  for (i = 0; i < n; i++)
    printf("%s\n", var[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x290,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    122c <main+0xdc>
lea    -0x250(%rbp),%rsi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x290(%rbp),%rdi
lea    -0x250(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x250(%rbp),%rdi
call   1050 <str_reverse@plt>
lea    -0x250(%rbp),%rdi
lea    -0x290(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11fb <main+0xab>
movslq -0xc(%rbp),%rax
lea    -0x210(%rbp),%rdi
imul   $0x5,%rax,%rax
add    %rax,%rdi
lea    0xe15(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1219 <main+0xc9>
movslq -0xc(%rbp),%rax
lea    -0x210(%rbp),%rdi
imul   $0x5,%rax,%rax
add    %rax,%rdi
lea    0xdf6(%rip),%rsi
call   1030 <strcpy@plt>
jmp    121e <main+0xce>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117b <main+0x2b>
mov    -0x8(%rbp),%esi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    127e <main+0x12e>
movslq -0xc(%rbp),%rax
lea    -0x210(%rbp),%rsi
imul   $0x5,%rax,%rax
add    %rax,%rsi
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1244 <main+0xf4>
xor    %eax,%eax
add    $0x290,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x298,%rsp
lea    0xe88(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    1203 <main+0xa3>
lea    0x90(%rsp),%rbx
lea    0x50(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xe61(%rip),%r13
lea    0xe5e(%rip),%rbp
xor    %r14d,%r14d
nop
lea    0xe4c(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
call   1060 <str_reverse@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
mov    %rbp,%rsi
cmove  %r13,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
add    $0x1,%r14
movslq 0xc(%rsp),%rsi
add    $0x5,%rbx
cmp    %rsi,%r14
jl     11b0 <main+0x50>
lea    0xe04(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    124a <main+0xea>
lea    0x90(%rsp),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <puts@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
add    $0x5,%rbx
cmp    %rax,%rbp
jl     1230 <main+0xd0>
xor    %eax,%eax
add    $0x298,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"Sim\00"
@.str.3 = [4 x i8] c"Nao\00"
@.str.4 = [4 x i8] c"%d\0A\00"
@.str.5 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [101 x [5 x i8]]
%5 = alloca [51 x i8]
%6 = alloca [51 x i8]
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %8
8: ; preds = %37, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %40
12: ; preds = %8
%13 = getelementptr inbounds [51 x i8], [51 x i8]* %5, i64 0, i64 0
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [51 x i8], [51 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds [51 x i8], [51 x i8]* %5, i64 0, i64 0
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = getelementptr inbounds [51 x i8], [51 x i8]* %5, i64 0, i64 0
%19 = call i32 @str_reverse(i8* %18)
%20 = getelementptr inbounds [51 x i8], [51 x i8]* %5, i64 0, i64 0
%21 = getelementptr inbounds [51 x i8], [51 x i8]* %6, i64 0, i64 0
%22 = call i64 @strcmp(i8* %20, i8* %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %12
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [101 x [5 x i8]], [101 x [5 x i8]]* %4, i64 0, i64 %26
%28 = getelementptr inbounds [5 x i8], [5 x i8]* %27, i64 0, i64 0
%29 = call i32 @strcpy(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %36
30: ; preds = %12
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [101 x [5 x i8]], [101 x [5 x i8]]* %4, i64 0, i64 %32
%34 = getelementptr inbounds [5 x i8], [5 x i8]* %33, i64 0, i64 0
%35 = call i32 @strcpy(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %36
36: ; preds = %30, %24
br label %37
37: ; preds = %36
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %8
40: ; preds = %8
%41 = load i32, i32* %2
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %41)
store i32 0, i32* %3
br label %43
43: ; preds = %53, %40
%44 = load i32, i32* %3
%45 = load i32, i32* %2
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %56
47: ; preds = %43
%48 = load i32, i32* %3
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [101 x [5 x i8]], [101 x [5 x i8]]* %4, i64 0, i64 %49
%51 = getelementptr inbounds [5 x i8], [5 x i8]* %50, i64 0, i64 0
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %51)
br label %53
53: ; preds = %47
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %43
56: ; preds = %43
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"Sim\00"
@.str.3 = [4 x i8] c"Nao\00"
@.str.4 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x [5 x i8]]
%3 = alloca [51 x i8]
%4 = alloca [51 x i8]
%5 = bitcast i32* %1 to i8*
%6 = getelementptr inbounds [101 x [5 x i8]], [101 x [5 x i8]]* %2, i64 0, i64 0, i64 0
%7 = getelementptr inbounds [51 x i8], [51 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [51 x i8], [51 x i8]* %4, i64 0, i64 0
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %26
12: ; preds = %0, %12
%13 = phi i64 [ %22, %12 ], [ 0, %0 ]
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%15 = call i32 @strcpy(i8* %8, i8* %7)
%16 = call i32 @str_reverse(i8* %7)
%17 = call i64 @strcmp(i8* %7, i8* %8)
%18 = icmp eq i64 %17, 0
%19 = getelementptr inbounds [101 x [5 x i8]], [101 x [5 x i8]]* %2, i64 0, i64 %13, i64 0
%20 = select i1 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%21 = call i32 @strcpy(i8* %19, i8* %20)
%22 = add nuw nsw i64 %13, 1
%23 = load i32, i32* %1
%24 = sext i32 %23 to i64
%25 = icmp slt i64 %22, %24
br i1 %25, label %12, label %26
26: ; preds = %12, %0
%27 = phi i32 [ %10, %0 ], [ %23, %12 ]
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %1
%30 = icmp sgt i32 %29, 0
br i1 %30, label %31, label %39
31: ; preds = %26, %31
%32 = phi i64 [ %35, %31 ], [ 0, %26 ]
%33 = getelementptr inbounds [101 x [5 x i8]], [101 x [5 x i8]]* %2, i64 0, i64 %32, i64 0
%34 = call i32 @puts(i8* %33)
%35 = add nuw nsw i64 %32, 1
%36 = load i32, i32* %1
%37 = sext i32 %36 to i64
%38 = icmp slt i64 %35, %37
br i1 %38, label %31, label %39
39: ; preds = %31, %26
ret i32 0
}