#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 */
scalar_t__ EOF;
int EXIT_SUCCESS;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
long ispalindrome(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, ...);
int /*<<< orphan*/ stdin;
int main(void) {
  int n;
  char string[50] = {0};
  long int ans;
  printf("½Ð¿é¤J´ú¸êªº¼Æ¶q¡G\n");
  fflush(stdin);
  while (scanf("%d", &n) != EOF) {
    while (n--) {
      printf("½Ð¿é¤Jªø«×¦Ü¤Ö¬°1¥B¤£¶W¹L20ªº¦r¦ê¡G\n");
      scanf("%s", string);
      ans = ispalindrome(string);
      printf("¦s¦b%ldºØ°j¤å®æ¦¡\n", ans);
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <memset@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xe91(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    0x2e3c(%rip),%rcx
cmp    (%rcx),%rax
je     120f <main+0xbf>
jmp    11b2 <main+0x62>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     120a <main+0xba>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <ispalindrome@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b2 <main+0x62>
jmp    118b <main+0x3b>
mov    0x2dba(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movw   $0x0,0x40(%rsp)
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xe68(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0x2e35(%rip),%r14
cmp    (%r14),%rax
je     1227 <main+0xd7>
lea    0xc(%rsp),%r15
lea    0xe8a(%rip),%r12
lea    0xe40(%rip),%r13
lea    0x10(%rsp),%rbx
lea    0xe37(%rip),%rbp
jmp    120a <main+0xba>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1050 <ispalindrome@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
subl   $0x1,0xc(%rsp)
jae    11e0 <main+0x90>
lea    0xde8(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
cmp    (%r14),%rax
jne    120a <main+0xba>
mov    0x2da2(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\C2\BD\C3\90\C2\BF\C3\A9\C2\A4J\C2\B4\C3\BA\C2\B8\C3\AA\C2\AA\C2\BA\C2\BC\C3\86\C2\B6q\C2\A1G\0A\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.2 = [63 x i8] c"\C2\BD\C3\90\C2\BF\C3\A9\C2\A4J\C2\AA\C3\B8\C2\AB\C3\97\C2\A6\C3\9C\C2\A4\C3\96\C2\AC\C2\B01\C2\A5B\C2\A4\C2\A3\C2\B6W\C2\B9L20\C2\AA\C2\BA\C2\A6r\C2\A6\C3\AA\C2\A1G\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [30 x i8] c"\C2\A6s\C2\A6b%ld\C2\BA\C3\98\C2\B0j\C2\A4\C3\A5\C2\AE\C3\A6\C2\A6\C2\A1\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [50 x i8]
%4 = alloca i64
store i32 0, i32* %1
%5 = bitcast [50 x i8]* %3 to i8*
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdin
%8 = call i32 @fflush(i32 %7)
br label %9
9: ; preds = %26, %0
%10 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
br label %14
14: ; preds = %18, %13
%15 = load i32, i32* %2
%16 = add nsw i32 %15, -1
store i32 %16, i32* %2
%17 = icmp ne i32 %15, 0
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%20 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%21 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%23 = call i64 @ispalindrome(i8* %22)
store i64 %23, i64* %4
%24 = load i64, i64* %4
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i64 %24)
br label %14
26: ; preds = %14
br label %9
27: ; preds = %9
%28 = load i32, i32* @EXIT_SUCCESS
ret i32 %28
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [30 x i8] c"\C2\A6s\C2\A6b%ld\C2\BA\C3\98\C2\B0j\C2\A4\C3\A5\C2\AE\C3\A6\C2\A6\C2\A1\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [34 x i8] c"\C2\BD\C3\90\C2\BF\C3\A9\C2\A4J\C2\B4\C3\BA\C2\B8\C3\AA\C2\AA\C2\BA\C2\BC\C3\86\C2\B6q\C2\A1G\00"
@str.5 = [62 x i8] c"\C2\BD\C3\90\C2\BF\C3\A9\C2\A4J\C2\AA\C3\B8\C2\AB\C3\97\C2\A6\C3\9C\C2\A4\C3\96\C2\AC\C2\B01\C2\A5B\C2\A4\C2\A3\C2\B6W\C2\B9L20\C2\AA\C2\BA\C2\A6r\C2\A6\C3\AA\C2\A1G\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = tail call i32 @fflush(i32 %6)
%8 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %27, label %15
11: ; preds = %19, %15
%12 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = load i64, i64* @EOF
%14 = icmp eq i64 %12, %13
br i1 %14, label %27, label %15
15: ; preds = %0, %11
%16 = load i32, i32* %1
%17 = add nsw i32 %16, -1
store i32 %17, i32* %1
%18 = icmp eq i32 %16, 0
br i1 %18, label %11, label %19
19: ; preds = %15, %19
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.5, i64 0, i64 0))
%21 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%22 = call i64 @ispalindrome(i8* %4)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i64 %22)
%24 = load i32, i32* %1
%25 = add nsw i32 %24, -1
store i32 %25, i32* %1
%26 = icmp eq i32 %24, 0
br i1 %26, label %11, label %19
27: ; preds = %11, %0
%28 = load i32, i32* @EXIT_SUCCESS
ret i32 %28
}