#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*/ clean(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  char a[256];
  strcpy(a, argv[1]);
  clean(a);
  int len = strlen(a);
  int x, i;
  for (i = 0, x = len - 1; i < len / 2; i++, x--) {
    printf("%c %c\n", a[i], a[x]);
    if (a[i] != a[x]) {
      printf("Not a palindrome\n");
      return 0;
    }
  }
  printf("Palindrome\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
call   1060 <clean@plt>
lea    -0x110(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x114(%rbp)
movl   $0x0,-0x11c(%rbp)
mov    -0x114(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x118(%rbp)
mov    -0x11c(%rbp),%eax
mov    %eax,-0x120(%rbp)
mov    -0x114(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x120(%rbp),%eax
cmp    %ecx,%eax
jge    1262 <main+0x122>
movslq -0x11c(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%esi
ff
movslq -0x118(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%edx
ff
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movslq -0x11c(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
movslq -0x118(%rbp),%rcx
movsbl -0x110(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
je     123a <main+0xfa>
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1277 <main+0x137>
jmp    123f <main+0xff>
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
mov    -0x118(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x118(%rbp)
jmp    11a4 <main+0x64>
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    0x8(%rsi),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1070 <clean@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0xe80(%rip),%r14
cmp    $0x2,%eax
jl     11e3 <main+0x93>
mov    %eax,%r15d
mov    %eax,%eax
shr    %r15d
neg    %r15
lea    (%rax,%rbx,1),%r13
add    $0xffffffffffffffff,%r13
lea    0xe5a(%rip),%r12
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%esi
movsbl 0x0(%r13,%rbp,1),%edx
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl (%rbx),%eax
cmp    0x0(%r13,%rbp,1),%al
jne    11dc <main+0x8c>
add    $0x1,%rbx
add    $0xffffffffffffffff,%rbp
cmp    %rbp,%r15
jne    11b0 <main+0x60>
jmp    11e3 <main+0x93>
lea    0xe2f(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c %c\0A\00"
@str = [11 x i8] c"Palindrome\00"
@str.3 = [17 x i8] c"Not a palindrome\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
%8 = call i32 @clean(i8* %4)
%9 = call i32 @strlen(i8* %4)
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %32
11: ; preds = %2
%12 = lshr i32 %9, 1
%13 = zext i32 %9 to i64
%14 = zext i32 %12 to i64
br label %17
15: ; preds = %17
%16 = icmp eq i64 %31, %14
br i1 %16, label %32, label %17
17: ; preds = %11, %15
%18 = phi i64 [ 0, %11 ], [ %31, %15 ]
%19 = phi i64 [ %13, %11 ], [ %20, %15 ]
%20 = add nsw i64 %19, -1
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %18
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %20
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %26)
%28 = load i8, i8* %21
%29 = load i8, i8* %24
%30 = icmp eq i8 %28, %29
%31 = add nuw nsw i64 %18, 1
br i1 %30, label %15, label %32
32: ; preds = %15, %17, %2
%33 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0), %17 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0), %15 ]
%34 = call i32 @puts(i8* dereferenceable(1) %33)
ret i32 0
}