#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 getchar();
int isReversible(char *, int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
scalar_t__ strlen(char *);
void main(void) {
  unsigned N;
  scanf("%u\n", &N);
  char s[81] = {'\0'};
  unsigned i;
  for (; N != 0; --N) {
    for (i = 0; s[i] = getchar(), s[i] != '\n'; ++i)
      ;
    s[i] = '\0';
    switch (isReversible(s, 0, strlen(s) - 1)) {
    case 0: {
      puts("No!");
      break;
    }
    case 1: {
      puts("Yes!");
      break;
    }
    default: {
      puts("This message should not appear!");
      break;
    }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xe91(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1080 <scanf@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1050 <memset@plt>
cmpl   $0x0,-0x4(%rbp)
je     1258 <main+0xf8>
movl   $0x0,-0x64(%rbp)
mov    $0x0,%al
call   1070 <getchar@plt>
mov    %al,%cl
mov    -0x64(%rbp),%eax
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0x64(%rbp),%eax
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0xa,%eax
je     11cd <main+0x6d>
jmp    11bf <main+0x5f>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1199 <main+0x39>
mov    -0x64(%rbp),%eax
movb   $0x0,-0x60(%rbp,%rax,1)
lea    -0x60(%rbp),%rdi
mov    %rdi,-0x70(%rbp)
call   1040 <strlen@plt>
mov    -0x70(%rbp),%rdi
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
xor    %esi,%esi
call   1060 <isReversible@plt>
mov    %eax,%ecx
mov    %ecx,-0x68(%rbp)
test   %eax,%eax
je     1217 <main+0xb7>
jmp    1206 <main+0xa6>
mov    -0x68(%rbp),%eax
sub    $0x1,%eax
je     1228 <main+0xc8>
jmp    1239 <main+0xd9>
lea    0xde6(%rip),%rdi
call   1030 <puts@plt>
jmp    1245 <main+0xe5>
lea    0xdd9(%rip),%rdi
call   1030 <puts@plt>
jmp    1245 <main+0xe5>
lea    0xdcd(%rip),%rdi
call   1030 <puts@plt>
jmp    124a <main+0xea>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <main+0x28>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x70,%rsp
lea    0xe9d(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x60(%rsp)
cmpl   $0x0,0xc(%rsp)
je     120d <main+0xbd>
lea    0x10(%rsp),%rbx
lea    0xe67(%rip),%r14
lea    0xe65(%rip),%r15
lea    0xe55(%rip),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %ebp,%ecx
mov    %al,0x10(%rsp,%rcx,1)
add    $0x1,%ebp
cmp    $0xa,%al
jne    11c0 <main+0x70>
movb   $0x0,0x10(%rsp,%rcx,1)
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    -0x1(%rax),%rdx
xor    %ebp,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <isReversible@plt>
cmp    $0x1,%eax
mov    %r15,%rdi
cmove  %r14,%rdi
test   %eax,%eax
cmove  %r12,%rdi
call   1030 <puts@plt>
addl   $0xffffffff,0xc(%rsp)
jne    11c0 <main+0x70>
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
@.str.1 = [4 x i8] c"No!\00"
@.str.2 = [5 x i8] c"Yes!\00"
@.str.3 = [32 x i8] c"This message should not appear!\00"
define void @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
%3 = alloca i32
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = bitcast [81 x i8]* %2 to i8*
br label %6
6: ; preds = %41, %0
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %44
9: ; preds = %6
store i32 0, i32* %3
br label %10
10: ; preds = %22, %9
%11 = call signext i8 (...) @getchar()
%12 = load i32, i32* %3
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 %13
store i8 %11, i8* %14
%15 = load i32, i32* %3
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 10
br i1 %20, label %21, label %25
21: ; preds = %10
br label %22
22: ; preds = %21
%23 = load i32, i32* %3
%24 = add i32 %23, 1
store i32 %24, i32* %3
br label %10
25: ; preds = %10
%26 = load i32, i32* %3
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 %27
store i8 0, i8* %28
%29 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%30 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%31 = call i64 @strlen(i8* %30)
%32 = sub nsw i64 %31, 1
%33 = call i32 @isReversible(i8* %29, i32 0, i64 %32)
switch i32 %33, label %38 [
i32 0, label %34
i32 1, label %36
]
34: ; preds = %25
%35 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %40
36: ; preds = %25
%37 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %40
38: ; preds = %25
%39 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %40
40: ; preds = %38, %36, %34
br label %41
41: ; preds = %40
%42 = load i32, i32* %1
%43 = add i32 %42, -1
store i32 %43, i32* %1
br label %6
44: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
@.str.1 = [4 x i8] c"No!\00"
@.str.2 = [5 x i8] c"Yes!\00"
@.str.3 = [32 x i8] c"This message should not appear!\00"
define void @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %31, label %8
8: ; preds = %0, %15
%9 = phi i32 [ %16, %15 ], [ 0, %0 ]
%10 = call signext i8 (...) @getchar()
%11 = zext i32 %9 to i64
%12 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 %11
store i8 %10, i8* %12
%13 = icmp eq i8 %10, 10
%14 = add i32 %9, 1
br i1 %13, label %17, label %15
15: ; preds = %8, %17
%16 = phi i32 [ %14, %8 ], [ 0, %17 ]
br label %8
17: ; preds = %8
%18 = zext i32 %9 to i64
%19 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 %18
store i8 0, i8* %19
%20 = call i64 @strlen(i8* %5)
%21 = add nsw i64 %20, -1
%22 = call i32 @isReversible(i8* %5, i32 0, i64 %21)
%23 = icmp eq i32 %22, 1
%24 = select i1 %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0)
%25 = icmp eq i32 %22, 0
%26 = select i1 %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %24
%27 = call i32 @puts(i8* dereferenceable(1) %26)
%28 = load i32, i32* %1
%29 = add i32 %28, -1
store i32 %29, i32* %1
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %15
31: ; preds = %17, %0
ret void
}