#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 strlen(char *);
char *strCheck(char *s) {
  char *b = s;
  char *e = s + strlen(s) - 1;
  if (*e == '\n')
    --e;
  for (; e > b; --e, ++b) {
    if (*e ^ *b)
      return "Not a palindrome\n";
  }
  return "Is a palindrome\n";
}


x86 assembly (clang, -O0):
<strCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1165 <strCheck+0x55>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    116a <strCheck+0x5a>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    11c3 <strCheck+0xb3>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
je     11a1 <strCheck+0x91>
lea    0xe68(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ce <strCheck+0xbe>
jmp    11a6 <strCheck+0x96>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116a <strCheck+0x5a>
lea    0xe48(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strCheck>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rcx
add    $0xffffffffffffffff,%rcx
xor    %edx,%edx
cmpb   $0xa,-0x1(%rbx,%rax,1)
sete   %dl
sub    %rdx,%rcx
lea    0xedb(%rip),%rax
cmp    %rbx,%rcx
jbe    1168 <strCheck+0x58>
add    $0x1,%rbx
lea    0xeb9(%rip),%rsi
nopw   0x0(%rax,%rax,1)
movzbl (%rcx),%edx
cmp    -0x1(%rbx),%dl
jne    116a <strCheck+0x5a>
add    $0xffffffffffffffff,%rcx
lea    0x1(%rbx),%rdx
cmp    %rbx,%rcx
mov    %rdx,%rbx
ja     1150 <strCheck+0x40>
pop    %rbx
ret
mov    %rsi,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Not a palindrome\0A\00"
@.str.1 = [17 x i8] c"Is a palindrome\0A\00"
define i8* @strCheck(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
store i8* %6, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = getelementptr inbounds i8, i8* %11, i64 -1
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %20
17: ; preds = %1
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i32 -1
store i8* %19, i8** %5
br label %20
20: ; preds = %17, %1
br label %21
21: ; preds = %36, %20
%22 = load i8*, i8** %5
%23 = load i8*, i8** %4
%24 = icmp ugt i8* %22, %23
br i1 %24, label %25, label %41
25: ; preds = %21
%26 = load i8*, i8** %5
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = xor i32 %28, %31
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %25
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %2
br label %42
35: ; preds = %25
br label %36
36: ; preds = %35
%37 = load i8*, i8** %5
%38 = getelementptr inbounds i8, i8* %37, i32 -1
store i8* %38, i8** %5
%39 = load i8*, i8** %4
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %4
br label %21
41: ; preds = %21
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %42
42: ; preds = %41, %34
%43 = load i8*, i8** %2
ret i8* %43
}

LLVM IR (-O2):
@.str = [18 x i8] c"Not a palindrome\0A\00"
@.str.1 = [17 x i8] c"Is a palindrome\0A\00"
define i8* @strCheck(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
%8 = sext i1 %7 to i64
%9 = getelementptr i8, i8* %5, i64 %8
%10 = icmp ugt i8* %9, %0
br i1 %10, label %11, label %21
11: ; preds = %1, %17
%12 = phi i8* [ %18, %17 ], [ %9, %1 ]
%13 = phi i8* [ %19, %17 ], [ %0, %1 ]
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = getelementptr inbounds i8, i8* %12, i64 -1
%19 = getelementptr inbounds i8, i8* %13, i64 1
%20 = icmp ugt i8* %18, %19
br i1 %20, label %11, label %21
21: ; preds = %11, %17, %1
%22 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %1 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %17 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %11 ]
ret i8* %22
}