#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 /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char string[20][50];
  char token[50];
  printf("Enter the paragraph :\n");
  int no_token = 0;
  while (scanf("%s", token) != EOF) {
    strcpy(string[no_token], token);
    no_token++;
  }
  int flag = 0;
  for (int i = 0; i < (no_token / 2); i++) {
    if (strcmp(string[i], string[no_token - (i + 1)]) == 0)
      flag++;
  }
  if (flag == (no_token / 2))
    printf("Given paragraph is palindrome.\n");
  else
    printf("Given paragraph is NOT palindrome.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x434(%rbp)
lea    -0x430(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1060 <scanf@plt>
mov    0x2e66(%rip),%rcx
cmp    (%rcx),%rax
je     11c0 <main+0x80>
movslq -0x434(%rbp),%rax
lea    -0x3f0(%rbp),%rdi
imul   $0x32,%rax,%rax
add    %rax,%rdi
lea    -0x430(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x434(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x434(%rbp)
jmp    1168 <main+0x28>
movl   $0x0,-0x438(%rbp)
movl   $0x0,-0x43c(%rbp)
mov    -0x43c(%rbp),%eax
mov    %eax,-0x440(%rbp)
mov    -0x434(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x440(%rbp),%eax
cmp    %ecx,%eax
jge    126b <main+0x12b>
movslq -0x43c(%rbp),%rax
lea    -0x3f0(%rbp),%rdi
imul   $0x32,%rax,%rax
add    %rax,%rdi
mov    -0x434(%rbp),%eax
mov    -0x43c(%rbp),%ecx
add    $0x1,%ecx
sub    %ecx,%eax
cltq
lea    -0x3f0(%rbp),%rsi
imul   $0x32,%rax,%rax
add    %rax,%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1252 <main+0x112>
mov    -0x438(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x438(%rbp)
jmp    1257 <main+0x117>
mov    -0x43c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x43c(%rbp)
jmp    11d4 <main+0x94>
mov    -0x438(%rbp),%eax
mov    %eax,-0x444(%rbp)
mov    -0x434(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x444(%rbp),%eax
cmp    %ecx,%eax
jne    12a6 <main+0x166>
lea    0xd7e(%rip),%rdi
call   1040 <printf@plt>
jmp    12b2 <main+0x172>
lea    0xd8d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9c(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
mov    0x2e75(%rip),%r12
cmp    (%r12),%rax
jne    1185 <main+0x45>
lea    0xebc(%rip),%rdi
jmp    1236 <main+0xf6>
xor    %ebp,%ebp
lea    0x40(%rsp),%rbx
mov    %rsp,%r14
lea    0xe6a(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
add    $0x1,%ebp
add    $0x32,%rbx
cmp    (%r12),%rax
jne    11a0 <main+0x60>
mov    %ebp,%r15d
shr    %r15d
xor    %r12d,%r12d
cmp    $0x2,%ebp
jb     1221 <main+0xe1>
cmp    $0x2,%r15d
mov    $0x1,%r13d
cmovae %r15d,%r13d
movslq %ebp,%rax
imul   $0x32,%rax,%rax
lea    (%rsp,%rax,1),%r14
add    $0xe,%r14
xor    %r12d,%r12d
lea    0x40(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
cmp    $0x1,%rax
adc    $0x0,%r12d
add    $0x32,%rbx
add    $0xffffffffffffffce,%r14
add    $0xffffffffffffffff,%r13
jne    1200 <main+0xc0>
cmp    %r15d,%r12d
lea    0xe11(%rip),%rax
lea    0xde7(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@EOF = global i64 0
@str = [22 x i8] c"Enter the paragraph :\00"
@str.4 = [35 x i8] c"Given paragraph is NOT palindrome.\00"
@str.5 = [31 x i8] c"Given paragraph is palindrome.\00"
define i32 @main() {
%1 = alloca [20 x [50 x i8]]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [20 x [50 x i8]], [20 x [50 x i8]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %42, label %18
9: ; preds = %18
%10 = trunc i64 %22 to i32
%11 = lshr i32 %10, 1
%12 = icmp ult i32 %10, 2
br i1 %12, label %26, label %13
13: ; preds = %9
%14 = shl i64 %22, 32
%15 = ashr exact i64 %14, 32
%16 = call i32 @llvm.umax.i32(i32 %11, i32 1)
%17 = zext i32 %16 to i64
br label %30
18: ; preds = %0, %18
%19 = phi i64 [ %22, %18 ], [ 0, %0 ]
%20 = getelementptr inbounds [20 x [50 x i8]], [20 x [50 x i8]]* %1, i64 0, i64 %19, i64 0
%21 = call i32 @strcpy(i8* %20, i8* %4)
%22 = add nuw i64 %19, 1
%23 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%24 = load i64, i64* @EOF
%25 = icmp eq i64 %23, %24
br i1 %25, label %9, label %18
26: ; preds = %30, %9
%27 = phi i32 [ 0, %9 ], [ %40, %30 ]
%28 = icmp eq i32 %27, %11
%29 = select i1 %28, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0)
br label %42
30: ; preds = %13, %30
%31 = phi i64 [ 0, %13 ], [ %34, %30 ]
%32 = phi i32 [ 0, %13 ], [ %40, %30 ]
%33 = getelementptr inbounds [20 x [50 x i8]], [20 x [50 x i8]]* %1, i64 0, i64 %31, i64 0
%34 = add nuw nsw i64 %31, 1
%35 = sub nsw i64 %15, %34
%36 = getelementptr inbounds [20 x [50 x i8]], [20 x [50 x i8]]* %1, i64 0, i64 %35, i64 0
%37 = call i64 @strcmp(i8* %33, i8* %36)
%38 = icmp eq i64 %37, 0
%39 = zext i1 %38 to i32
%40 = add nuw nsw i32 %32, %39
%41 = icmp eq i64 %34, %17
br i1 %41, label %26, label %30
42: ; preds = %26, %0
%43 = phi i8* [ getelementptr inbounds ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0), %0 ], [ %29, %26 ]
%44 = call i32 @puts(i8* dereferenceable(1) %43)
ret i32 0
}