#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main() {
  int i = 0, l = 0, j, k, space = 0, count = 0, init = 0, min = 0, max = 0,
      len = 0, flag;
  char a[100], b[30][20], c[30], d[30], minP[30], maxP[30];
  printf("Read a string:\n");
  fflush(stdin);
  scanf("%[^\n]s", a);
  for (i = 0; a[i] != '\0'; i++) {
    if (a[i] == ' ')
      space++;
  }
  i = 0;
  for (j = 0; j < (space + 1); i++, j++) {
    k = 0;
    while (a[i] != '\0') {
      if (a[i] == ' ') {
        break;
      } else {
        b[j][k++] = a[i];
        i++;
      }
    }
    b[j][k] = '\0';
  }
  for (j = 0; j < space + 1; j++)
    printf("%s ", b[j]);
  printf("\n");
  for (i = 0; i < space + 1; i++) {
    strcpy(c, b[i]);
    count = strlen(b[i]);
    k = 0;
    for (l = count - 1; l >= 0; l--)
      d[k++] = b[i][l];
    d[k] = '\0';
    if (strcmp(d, c) == 0) {
      flag = 1;
      if (init < 1) {
        strcpy(minP, d);
        strcpy(maxP, d);
        min = strlen(minP);
        max = strlen(maxP);
        init++;
      }
      printf("String %s is a Palindrome\n", d);
      len = strlen(d);
      if (len >= max)
        strcpy(maxP, d);
      else if (len <= min)
        strcpy(minP, d);
      else
        printf("");
    }
  }
  if (flag == 1) {
    printf("The minimum palindrome is %s\n", minP);
    printf("The maximum palindrome is %s\n", maxP);
  } else
    printf("given string has no pallindrome\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x380,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe3c(%rip),%rdi
call   1080 <scanf@plt>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0xa0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     1226 <main+0xc6>
movslq -0x8(%rbp),%rax
movsbl -0xa0(%rbp,%rax,1),%eax
cmp    $0x20,%eax
jne    1213 <main+0xb3>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1218 <main+0xb8>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e0 <main+0x80>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    12e8 <main+0x188>
movl   $0x0,-0x14(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0xa0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     12b7 <main+0x157>
movslq -0x8(%rbp),%rax
movsbl -0xa0(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    127b <main+0x11b>
jmp    12b7 <main+0x157>
movslq -0x8(%rbp),%rax
mov    -0xa0(%rbp,%rax,1),%dl
movslq -0x10(%rbp),%rcx
lea    -0x300(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    124c <main+0xec>
movslq -0x10(%rbp),%rcx
lea    -0x300(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1234 <main+0xd4>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    132e <main+0x1ce>
movslq -0x10(%rbp),%rax
lea    -0x300(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12ef <main+0x18f>
lea    0xcd9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    14ff <main+0x39f>
lea    -0x320(%rbp),%rdi
movslq -0x8(%rbp),%rax
lea    -0x300(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
movslq -0x8(%rbp),%rax
lea    -0x300(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     13e1 <main+0x281>
movslq -0x8(%rbp),%rcx
lea    -0x300(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x14(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
cltq
mov    %cl,-0x340(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    139c <main+0x23c>
movslq -0x14(%rbp),%rax
movb   $0x0,-0x340(%rbp,%rax,1)
lea    -0x340(%rbp),%rdi
lea    -0x320(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    14ec <main+0x38c>
movl   $0x1,-0x30(%rbp)
cmpl   $0x1,-0x20(%rbp)
jge    1468 <main+0x308>
lea    -0x360(%rbp),%rdi
lea    -0x340(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x380(%rbp),%rdi
lea    -0x340(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x360(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
lea    -0x380(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
lea    -0x340(%rbp),%rsi
lea    0xba5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x340(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jl     14b0 <main+0x350>
lea    -0x380(%rbp),%rdi
lea    -0x340(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    14e7 <main+0x387>
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     14d4 <main+0x374>
lea    -0x360(%rbp),%rdi
lea    -0x340(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    14e2 <main+0x382>
lea    0xb34(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14e7 <main+0x387>
jmp    14ec <main+0x38c>
jmp    14f1 <main+0x391>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1343 <main+0x1e3>
cmpl   $0x1,-0x30(%rbp)
jne    1538 <main+0x3d8>
lea    -0x360(%rbp),%rsi
lea    0xb1f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x380(%rbp),%rsi
lea    0xb28(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1546 <main+0x3e6>
lea    0xb33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x380,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x358,%rsp
lea    0xeca(%rip),%rdi
call   1050 <puts@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
lea    0xe4e(%rip),%rdi
lea    0x90(%rsp),%rbx
mov    %rbx,%rsi
call   10a0 <scanf@plt>
xor    %r15d,%r15d
jmp    11d8 <main+0x58>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15d
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x20,%al
je     11d0 <main+0x50>
test   %al,%al
jne    11d4 <main+0x54>
test   %r15d,%r15d
js     159f <main+0x41f>
lea    0x1(%r15),%r12d
lea    0x100(%rsp),%rax
xor    %ecx,%ecx
xor    %edx,%edx
jmp    1229 <main+0xa9>
xchg   %ax,%ax
mov    %esi,%edi
lea    (%rcx,%rcx,4),%rbp
lea    (%rsp,%rbp,4),%rbp
add    $0x100,%rbp
movb   $0x0,(%rdi,%rbp,1)
add    %rsi,%rdx
add    $0x1,%rdx
add    $0x1,%rcx
add    $0x14,%rax
cmp    %r12,%rcx
je     1252 <main+0xd2>
movslq %edx,%rdx
lea    (%rsp,%rdx,1),%rdi
add    $0x90,%rdi
xor    %esi,%esi
nopl   0x0(%rax)
movzbl (%rdi,%rsi,1),%ebx
test   $0xdf,%bl
je     1200 <main+0x80>
mov    %bl,(%rax,%rsi,1)
add    $0x1,%rsi
jmp    1240 <main+0xc0>
test   %r15d,%r15d
js     159f <main+0x41f>
lea    0x100(%rsp),%rbx
lea    0xd9d(%rip),%r14
mov    %r12,%rbp
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x14,%rbx
add    $0xffffffffffffffff,%rbp
jne    1270 <main+0xf0>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r15d,%r15d
js     15a9 <main+0x429>
lea    0x70(%rsp),%rbp
lea    0x10(%rsp),%r14
xor    %r13d,%r13d
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
xor    %ebx,%ebx
jmp    12da <main+0x15a>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    $0x1,%ebx
add    $0x1,%r13
cmp    %r12,%r13
je     15a9 <main+0x429>
lea    0x0(,%r13,4),%rax
add    %r13,%rax
lea    (%rsp,%rax,4),%r15
add    $0x100,%r15
mov    %rbp,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    $0x0,%ecx
test   %eax,%eax
jle    13ec <main+0x26c>
mov    %eax,%r8d
cmp    $0x8,%eax
jae    1330 <main+0x1b0>
xor    %ecx,%ecx
mov    %r8,%r9
test   $0x1,%r8b
jne    1370 <main+0x1f0>
mov    %rcx,%rdi
jmp    1386 <main+0x206>
nopl   0x0(%rax,%rax,1)
lea    -0x1(%r8),%rdi
lea    -0x1(%rax),%ecx
cmp    %edi,%ecx
jb     1318 <main+0x198>
mov    %rdi,%rcx
shr    $0x20,%rcx
mov    $0x0,%ecx
mov    %r8,%r9
pxor   %xmm3,%xmm3
jne    131d <main+0x19d>
cmp    $0x20,%eax
jae    1484 <main+0x304>
mov    %ebx,%esi
xor    %ecx,%ecx
jmp    152a <main+0x3aa>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0xffffffffffffffff,%r9
mov    %r9d,%edx
mov    (%rdx,%r15,1),%dl
mov    %rcx,%rdi
or     $0x1,%rdi
mov    %dl,0x10(%rsp,%rcx,1)
not    %rcx
add    %r8,%rcx
jne    13a0 <main+0x220>
mov    %eax,%ecx
jmp    13ec <main+0x26c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%r11d
mov    %rbp,%r10
lea    0x11(%rsp),%rcx
lea    (%rcx,%rdi,1),%rdx
sub    %r8,%rdi
lea    -0x2(%r9),%rsi
mov    $0xffffffff,%ecx
add    %rcx,%r9
xor    %ebx,%ebx
lea    (%r9,%rbx,1),%ebp
movzbl 0x0(%rbp,%r15,1),%ecx
mov    %cl,-0x1(%rdx)
lea    (%rsi,%rbx,1),%ecx
movzbl (%rcx,%r15,1),%ecx
mov    %cl,(%rdx)
add    $0xfffffffffffffffe,%rbx
add    $0x2,%rdx
cmp    %rbx,%rdi
jne    13c0 <main+0x240>
mov    %eax,%ecx
mov    %r10,%rbp
mov    %r11d,%ebx
mov    %ecx,%eax
movb   $0x0,0x10(%rsp,%rax,1)
mov    %r14,%rdi
mov    %rbp,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    12cd <main+0x14d>
test   %ebx,%ebx
jg     1443 <main+0x2c3>
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
lea    0x30(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %eax,0x8(%rsp)
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    %eax,0xc(%rsp)
lea    0xbc1(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
lea    0x30(%rsp),%rdi
cmp    0xc(%rsp),%eax
jge    12c0 <main+0x140>
mov    $0x1,%ebx
lea    0x50(%rsp),%rdi
cmp    0x8(%rsp),%eax
jle    12c0 <main+0x140>
jmp    12cd <main+0x14d>
mov    %r8d,%ecx
and    $0xffffffe0,%ecx
xor    %esi,%esi
nopl   0x0(%rax)
mov    %edi,%edx
movdqu -0x1f(%rdx,%r15,1),%xmm0
movdqu -0xf(%rdx,%r15,1),%xmm1
movdqa %xmm1,%xmm2
punpcklbw %xmm3,%xmm2
pshufd $0x4e,%xmm2,%xmm2
pshuflw $0x1b,%xmm2,%xmm2
pshufhw $0x1b,%xmm2,%xmm2
punpckhbw %xmm3,%xmm1
pshufd $0x4e,%xmm1,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
packuswb %xmm2,%xmm1
movdqa %xmm0,%xmm2
punpcklbw %xmm3,%xmm2
pshufd $0x4e,%xmm2,%xmm2
pshuflw $0x1b,%xmm2,%xmm2
pshufhw $0x1b,%xmm2,%xmm2
punpckhbw %xmm3,%xmm0
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
packuswb %xmm2,%xmm0
movdqa %xmm1,0x10(%rsp,%rsi,1)
movdqa %xmm0,0x20(%rsp,%rsi,1)
add    $0x20,%rsi
add    $0xffffffffffffffe0,%rdi
cmp    %rsi,%rcx
jne    1490 <main+0x310>
cmp    %r8,%rcx
je     138e <main+0x20e>
test   $0x18,%r8b
je     1593 <main+0x413>
mov    %ebx,%esi
mov    %rcx,%rdx
mov    %r8d,%ecx
and    $0xfffffff8,%ecx
mov    %r8,%r9
sub    %rcx,%r9
mov    %rdx,%rdi
not    %rdi
add    %r8,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%ebx
movq   -0x7(%rbx,%r15,1),%xmm0
punpcklbw %xmm3,%xmm0
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
packuswb %xmm0,%xmm0
movq   %xmm0,0x10(%rsp,%rdx,1)
add    $0x8,%rdx
add    $0xfffffffffffffff8,%rdi
cmp    %rdx,%rcx
jne    1550 <main+0x3d0>
cmp    %r8,%rcx
mov    %esi,%ebx
jne    131d <main+0x19d>
jmp    138e <main+0x20e>
mov    %r8d,%r9d
and    $0x1f,%r9d
jmp    131d <main+0x19d>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xa76(%rip),%rdi
lea    0x50(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xa81(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x358,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Read a string:\0A\00"
@stdin = global i32 0
@.str.1 = [7 x i8] c"%[^\0A]s\00"
@.str.2 = [4 x i8] c"%s \00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [27 x i8] c"String %s is a Palindrome\0A\00"
@.str.5 = [1 x i8] zeroinitializer
@.str.6 = [30 x i8] c"The minimum palindrome is %s\0A\00"
@.str.7 = [30 x i8] c"The maximum palindrome is %s\0A\00"
@.str.8 = [33 x i8] c"given string has no pallindrome\0A\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 i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [100 x i8]
%14 = alloca [30 x [20 x i8]]
%15 = alloca [30 x i8]
%16 = alloca [30 x i8]
%17 = alloca [30 x i8]
%18 = alloca [30 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%20 = load i32, i32* @stdin
%21 = call i32 @fflush(i32 %20)
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%23 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %22)
store i32 0, i32* %2
br label %24
24: ; preds = %42, %0
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %45
31: ; preds = %24
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 32
br i1 %37, label %38, label %41
38: ; preds = %31
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %41
41: ; preds = %38, %31
br label %42
42: ; preds = %41
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %24
45: ; preds = %24
store i32 0, i32* %2
store i32 0, i32* %4
br label %46
46: ; preds = %89, %45
%47 = load i32, i32* %4
%48 = load i32, i32* %6
%49 = add nsw i32 %48, 1
%50 = icmp slt i32 %47, %49
br i1 %50, label %51, label %94
51: ; preds = %46
store i32 0, i32* %5
br label %52
52: ; preds = %81, %51
%53 = load i32, i32* %2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %82
59: ; preds = %52
%60 = load i32, i32* %2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %64, 32
br i1 %65, label %66, label %67
66: ; preds = %59
br label %82
67: ; preds = %59
%68 = load i32, i32* %2
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 %69
%71 = load i8, i8* %70
%72 = load i32, i32* %4
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %14, i64 0, i64 %73
%75 = load i32, i32* %5
%76 = add nsw i32 %75, 1
store i32 %76, i32* %5
%77 = sext i32 %75 to i64
%78 = getelementptr inbounds [20 x i8], [20 x i8]* %74, i64 0, i64 %77
store i8 %71, i8* %78
%79 = load i32, i32* %2
%80 = add nsw i32 %79, 1
store i32 %80, i32* %2
br label %81
81: ; preds = %67
br label %52
82: ; preds = %66, %52
%83 = load i32, i32* %4
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %14, i64 0, i64 %84
%86 = load i32, i32* %5
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [20 x i8], [20 x i8]* %85, i64 0, i64 %87
store i8 0, i8* %88
br label %89
89: ; preds = %82
%90 = load i32, i32* %2
%91 = add nsw i32 %90, 1
store i32 %91, i32* %2
%92 = load i32, i32* %4
%93 = add nsw i32 %92, 1
store i32 %93, i32* %4
br label %46
94: ; preds = %46
store i32 0, i32* %4
br label %95
95: ; preds = %106, %94
%96 = load i32, i32* %4
%97 = load i32, i32* %6
%98 = add nsw i32 %97, 1
%99 = icmp slt i32 %96, %98
br i1 %99, label %100, label %109
100: ; preds = %95
%101 = load i32, i32* %4
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %14, i64 0, i64 %102
%104 = getelementptr inbounds [20 x i8], [20 x i8]* %103, i64 0, i64 0
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %104)
br label %106
106: ; preds = %100
%107 = load i32, i32* %4
%108 = add nsw i32 %107, 1
store i32 %108, i32* %4
br label %95
109: ; preds = %95
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %111
111: ; preds = %197, %109
%112 = load i32, i32* %2
%113 = load i32, i32* %6
%114 = add nsw i32 %113, 1
%115 = icmp slt i32 %112, %114
br i1 %115, label %116, label %200
116: ; preds = %111
%117 = getelementptr inbounds [30 x i8], [30 x i8]* %15, i64 0, i64 0
%118 = load i32, i32* %2
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %14, i64 0, i64 %119
%121 = getelementptr inbounds [20 x i8], [20 x i8]* %120, i64 0, i64 0
%122 = call i32 @strcpy(i8* %117, i8* %121)
%123 = load i32, i32* %2
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %14, i64 0, i64 %124
%126 = getelementptr inbounds [20 x i8], [20 x i8]* %125, i64 0, i64 0
%127 = call i32 @strlen(i8* %126)
store i32 %127, i32* %7
store i32 0, i32* %5
%128 = load i32, i32* %7
%129 = sub nsw i32 %128, 1
store i32 %129, i32* %3
br label %130
130: ; preds = %145, %116
%131 = load i32, i32* %3
%132 = icmp sge i32 %131, 0
br i1 %132, label %133, label %148
133: ; preds = %130
%134 = load i32, i32* %2
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %14, i64 0, i64 %135
%137 = load i32, i32* %3
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [20 x i8], [20 x i8]* %136, i64 0, i64 %138
%140 = load i8, i8* %139
%141 = load i32, i32* %5
%142 = add nsw i32 %141, 1
store i32 %142, i32* %5
%143 = sext i32 %141 to i64
%144 = getelementptr inbounds [30 x i8], [30 x i8]* %16, i64 0, i64 %143
store i8 %140, i8* %144
br label %145
145: ; preds = %133
%146 = load i32, i32* %3
%147 = add nsw i32 %146, -1
store i32 %147, i32* %3
br label %130
148: ; preds = %130
%149 = load i32, i32* %5
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [30 x i8], [30 x i8]* %16, i64 0, i64 %150
store i8 0, i8* %151
%152 = getelementptr inbounds [30 x i8], [30 x i8]* %16, i64 0, i64 0
%153 = getelementptr inbounds [30 x i8], [30 x i8]* %15, i64 0, i64 0
%154 = call i64 @strcmp(i8* %152, i8* %153)
%155 = icmp eq i64 %154, 0
br i1 %155, label %156, label %196
156: ; preds = %148
store i32 1, i32* %12
%157 = load i32, i32* %8
%158 = icmp slt i32 %157, 1
br i1 %158, label %159, label %172
159: ; preds = %156
%160 = getelementptr inbounds [30 x i8], [30 x i8]* %17, i64 0, i64 0
%161 = getelementptr inbounds [30 x i8], [30 x i8]* %16, i64 0, i64 0
%162 = call i32 @strcpy(i8* %160, i8* %161)
%163 = getelementptr inbounds [30 x i8], [30 x i8]* %18, i64 0, i64 0
%164 = getelementptr inbounds [30 x i8], [30 x i8]* %16, i64 0, i64 0
%165 = call i32 @strcpy(i8* %163, i8* %164)
%166 = getelementptr inbounds [30 x i8], [30 x i8]* %17, i64 0, i64 0
%167 = call i32 @strlen(i8* %166)
store i32 %167, i32* %9
%168 = getelementptr inbounds [30 x i8], [30 x i8]* %18, i64 0, i64 0
%169 = call i32 @strlen(i8* %168)
store i32 %169, i32* %10
%170 = load i32, i32* %8
%171 = add nsw i32 %170, 1
store i32 %171, i32* %8
br label %172
172: ; preds = %159, %156
%173 = getelementptr inbounds [30 x i8], [30 x i8]* %16, i64 0, i64 0
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %173)
%175 = getelementptr inbounds [30 x i8], [30 x i8]* %16, i64 0, i64 0
%176 = call i32 @strlen(i8* %175)
store i32 %176, i32* %11
%177 = load i32, i32* %11
%178 = load i32, i32* %10
%179 = icmp sge i32 %177, %178
br i1 %179, label %180, label %184
180: ; preds = %172
%181 = getelementptr inbounds [30 x i8], [30 x i8]* %18, i64 0, i64 0
%182 = getelementptr inbounds [30 x i8], [30 x i8]* %16, i64 0, i64 0
%183 = call i32 @strcpy(i8* %181, i8* %182)
br label %195
184: ; preds = %172
%185 = load i32, i32* %11
%186 = load i32, i32* %9
%187 = icmp sle i32 %185, %186
br i1 %187, label %188, label %192
188: ; preds = %184
%189 = getelementptr inbounds [30 x i8], [30 x i8]* %17, i64 0, i64 0
%190 = getelementptr inbounds [30 x i8], [30 x i8]* %16, i64 0, i64 0
%191 = call i32 @strcpy(i8* %189, i8* %190)
br label %194
192: ; preds = %184
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
br label %194
194: ; preds = %192, %188
br label %195
195: ; preds = %194, %180
br label %196
196: ; preds = %195, %148
br label %197
197: ; preds = %196
%198 = load i32, i32* %2
%199 = add nsw i32 %198, 1
store i32 %199, i32* %2
br label %111
200: ; preds = %111
%201 = load i32, i32* %12
%202 = icmp eq i32 %201, 1
br i1 %202, label %203, label %208
203: ; preds = %200
%204 = getelementptr inbounds [30 x i8], [30 x i8]* %17, i64 0, i64 0
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %204)
%206 = getelementptr inbounds [30 x i8], [30 x i8]* %18, i64 0, i64 0
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i8* %206)
br label %210
208: ; preds = %200
%209 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0))
br label %210
210: ; preds = %208, %203
%211 = load i32, i32* %1
ret i32 %211
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [7 x i8] c"%[^\0A]s\00"
@.str.2 = [4 x i8] c"%s \00"
@.str.4 = [27 x i8] c"String %s is a Palindrome\0A\00"
@.str.6 = [30 x i8] c"The minimum palindrome is %s\0A\00"
@.str.7 = [30 x i8] c"The maximum palindrome is %s\0A\00"
@str = [15 x i8] c"Read a string:\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [30 x [20 x i8]]
%3 = alloca [30 x i8]
%4 = alloca [30 x i8]
%5 = alloca [30 x i8]
%6 = alloca [30 x i8]
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %2, i64 0, i64 0, i64 0
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%14 = load i32, i32* @stdin
%15 = tail call i32 @fflush(i32 %14)
%16 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %17
17: ; preds = %29, %0
%18 = phi i64 [ %31, %29 ], [ 0, %0 ]
%19 = phi i32 [ %30, %29 ], [ 0, %0 ]
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %18
%21 = load i8, i8* %20
switch i8 %21, label %29 [
i8 0, label %22
i8 32, label %27
]
22: ; preds = %17
%23 = icmp slt i32 %19, 0
br i1 %23, label %62, label %24
24: ; preds = %22
%25 = add nuw i32 %19, 1
%26 = zext i32 %25 to i64
br label %32
27: ; preds = %17
%28 = add nsw i32 %19, 1
br label %29
29: ; preds = %17, %27
%30 = phi i32 [ %28, %27 ], [ %19, %17 ]
%31 = add nuw i64 %18, 1
br label %17
32: ; preds = %24, %50
%33 = phi i64 [ 0, %24 ], [ %54, %50 ]
%34 = phi i64 [ 0, %24 ], [ %53, %50 ]
%35 = shl i64 %34, 32
%36 = ashr exact i64 %35, 32
br label %41
37: ; preds = %50
br i1 %23, label %62, label %38
38: ; preds = %37
%39 = add nuw i32 %19, 1
%40 = zext i32 %39 to i64
br label %56
41: ; preds = %32, %46
%42 = phi i64 [ %36, %32 ], [ %49, %46 ]
%43 = phi i64 [ 0, %32 ], [ %47, %46 ]
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %42
%45 = load i8, i8* %44
switch i8 %45, label %46 [
i8 0, label %50
i8 32, label %50
]
46: ; preds = %41
%47 = add nuw i64 %43, 1
%48 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %2, i64 0, i64 %33, i64 %43
store i8 %45, i8* %48
%49 = add i64 %42, 1
br label %41
50: ; preds = %41, %41
%51 = and i64 %43, 4294967295
%52 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %2, i64 0, i64 %33, i64 %51
store i8 0, i8* %52
%53 = add i64 %42, 1
%54 = add nuw nsw i64 %33, 1
%55 = icmp eq i64 %54, %26
br i1 %55, label %37, label %32
56: ; preds = %38, %56
%57 = phi i64 [ 0, %38 ], [ %60, %56 ]
%58 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %2, i64 0, i64 %57, i64 0
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %58)
%60 = add nuw nsw i64 %57, 1
%61 = icmp eq i64 %60, %40
br i1 %61, label %64, label %56
62: ; preds = %37, %22
%63 = call i32 @putchar(i32 10)
br label %203
64: ; preds = %56
%65 = call i32 @putchar(i32 10)
br i1 %23, label %203, label %66
66: ; preds = %64
%67 = add nuw i32 %19, 1
%68 = zext i32 %67 to i64
br label %69
69: ; preds = %66, %197
%70 = phi i64 [ 0, %66 ], [ %201, %197 ]
%71 = phi i32 [ 0, %66 ], [ %200, %197 ]
%72 = phi i32 [ 0, %66 ], [ %199, %197 ]
%73 = phi i32 [ 0, %66 ], [ %198, %197 ]
%74 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %2, i64 0, i64 %70, i64 0
%75 = call i32 @strcpy(i8* %9, i8* %74)
%76 = call i32 @strlen(i8* %74)
%77 = icmp sgt i32 %76, 0
br i1 %77, label %78, label %173
78: ; preds = %69
%79 = zext i32 %76 to i64
%80 = icmp ult i32 %76, 8
br i1 %80, label %139, label %81
81: ; preds = %78
%82 = add nsw i64 %79, -1
%83 = add i32 %76, -1
%84 = trunc i64 %82 to i32
%85 = icmp ult i32 %83, %84
%86 = icmp ugt i64 %82, 4294967295
%87 = or i1 %85, %86
br i1 %87, label %139, label %88
88: ; preds = %81
%89 = icmp ult i32 %76, 32
br i1 %89, label %118, label %90
90: ; preds = %88
%91 = and i64 %79, 4294967264
br label %92
92: ; preds = %92, %90
%93 = phi i64 [ 0, %90 ], [ %110, %92 ]
%94 = xor i64 %93, -1
%95 = add i64 %94, %79
%96 = and i64 %95, 4294967295
%97 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %2, i64 0, i64 %70, i64 %96
%98 = getelementptr inbounds i8, i8* %97, i64 -15
%99 = bitcast i8* %98 to <16 x i8>*
%100 = load <16 x i8>, <16 x i8>* %99
%101 = shufflevector <16 x i8> %100, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%102 = getelementptr inbounds i8, i8* %97, i64 -31
%103 = bitcast i8* %102 to <16 x i8>*
%104 = load <16 x i8>, <16 x i8>* %103
%105 = shufflevector <16 x i8> %104, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%106 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 %93
%107 = bitcast i8* %106 to <16 x i8>*
store <16 x i8> %101, <16 x i8>* %107
%108 = getelementptr inbounds i8, i8* %106, i64 16
%109 = bitcast i8* %108 to <16 x i8>*
store <16 x i8> %105, <16 x i8>* %109
%110 = add nuw i64 %93, 32
%111 = icmp eq i64 %110, %91
br i1 %111, label %112, label %92
112: ; preds = %92
%113 = icmp eq i64 %91, %79
br i1 %113, label %173, label %114
114: ; preds = %112
%115 = and i64 %79, 31
%116 = and i64 %79, 24
%117 = icmp eq i64 %116, 0
br i1 %117, label %139, label %118
118: ; preds = %88, %114
%119 = phi i64 [ %91, %114 ], [ 0, %88 ]
%120 = zext i32 %76 to i64
%121 = and i64 %120, 4294967288
%122 = sub nsw i64 %79, %121
br label %123
123: ; preds = %123, %118
%124 = phi i64 [ %119, %118 ], [ %135, %123 ]
%125 = xor i64 %124, -1
%126 = add i64 %125, %79
%127 = and i64 %126, 4294967295
%128 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %2, i64 0, i64 %70, i64 %127
%129 = getelementptr inbounds i8, i8* %128, i64 -7
%130 = bitcast i8* %129 to <8 x i8>*
%131 = load <8 x i8>, <8 x i8>* %130
%132 = shufflevector <8 x i8> %131, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%133 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 %124
%134 = bitcast i8* %133 to <8 x i8>*
store <8 x i8> %132, <8 x i8>* %134
%135 = add nuw i64 %124, 8
%136 = icmp eq i64 %135, %121
br i1 %136, label %137, label %123
137: ; preds = %123
%138 = icmp eq i64 %121, %120
br i1 %138, label %173, label %139
139: ; preds = %81, %78, %114, %137
%140 = phi i64 [ 0, %78 ], [ 0, %81 ], [ %91, %114 ], [ %121, %137 ]
%141 = phi i64 [ %79, %78 ], [ %79, %81 ], [ %115, %114 ], [ %122, %137 ]
%142 = xor i64 %140, -1
%143 = and i64 %79, 1
%144 = icmp eq i64 %143, 0
br i1 %144, label %152, label %145
145: ; preds = %139
%146 = add nsw i64 %141, -1
%147 = and i64 %146, 4294967295
%148 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %2, i64 0, i64 %70, i64 %147
%149 = load i8, i8* %148
%150 = or i64 %140, 1
%151 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 %140
store i8 %149, i8* %151
br label %152
152: ; preds = %145, %139
%153 = phi i64 [ %140, %139 ], [ %150, %145 ]
%154 = phi i64 [ %141, %139 ], [ %146, %145 ]
%155 = sub nsw i64 0, %79
%156 = icmp eq i64 %142, %155
br i1 %156, label %173, label %157
157: ; preds = %152, %157
%158 = phi i64 [ %170, %157 ], [ %153, %152 ]
%159 = phi i64 [ %166, %157 ], [ %154, %152 ]
%160 = add i64 %159, 4294967295
%161 = and i64 %160, 4294967295
%162 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %2, i64 0, i64 %70, i64 %161
%163 = load i8, i8* %162
%164 = add nuw nsw i64 %158, 1
%165 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 %158
store i8 %163, i8* %165
%166 = add nsw i64 %159, -2
%167 = and i64 %166, 4294967295
%168 = getelementptr inbounds [30 x [20 x i8]], [30 x [20 x i8]]* %2, i64 0, i64 %70, i64 %167
%169 = load i8, i8* %168
%170 = add nuw nsw i64 %158, 2
%171 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 %164
store i8 %169, i8* %171
%172 = icmp eq i64 %170, %79
br i1 %172, label %173, label %157
173: ; preds = %152, %157, %112, %137, %69
%174 = phi i32 [ 0, %69 ], [ %76, %137 ], [ %76, %112 ], [ %76, %157 ], [ %76, %152 ]
%175 = zext i32 %174 to i64
%176 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 %175
store i8 0, i8* %176
%177 = call i64 @strcmp(i8* %10, i8* %9)
%178 = icmp eq i64 %177, 0
br i1 %178, label %179, label %197
179: ; preds = %173
%180 = icmp slt i32 %73, 1
br i1 %180, label %181, label %186
181: ; preds = %179
%182 = call i32 @strcpy(i8* %11, i8* %10)
%183 = call i32 @strcpy(i8* %12, i8* %10)
%184 = call i32 @strlen(i8* %11)
%185 = call i32 @strlen(i8* %12)
br label %186
186: ; preds = %181, %179
%187 = phi i32 [ %184, %181 ], [ %72, %179 ]
%188 = phi i32 [ %185, %181 ], [ %71, %179 ]
%189 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%190 = call i32 @strlen(i8* %10)
%191 = icmp slt i32 %190, %188
br i1 %191, label %192, label %194
192: ; preds = %186
%193 = icmp sgt i32 %190, %187
br i1 %193, label %197, label %194
194: ; preds = %192, %186
%195 = phi i8* [ %12, %186 ], [ %11, %192 ]
%196 = call i32 @strcpy(i8* %195, i8* %10)
br label %197
197: ; preds = %194, %192, %173
%198 = phi i32 [ %73, %173 ], [ 1, %192 ], [ 1, %194 ]
%199 = phi i32 [ %72, %173 ], [ %187, %192 ], [ %187, %194 ]
%200 = phi i32 [ %71, %173 ], [ %188, %192 ], [ %188, %194 ]
%201 = add nuw nsw i64 %70, 1
%202 = icmp eq i64 %201, %68
br i1 %202, label %203, label %69
203: ; preds = %197, %62, %64
%204 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %11)
%205 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i8* %12)
ret i32 0
}