#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*/ printf(char *, char *);
int strlen(char *);
void isPalindrome(char str[]) {
  int l = 0;
  int h = strlen(str) - 1;
  while (h > l) {
    if (str[l++] != str[h--]) {
      printf("%s is Not Palindromen", str);
      return;
    }
  }
  printf("%s is palindromen", str);
}


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    119c <isPalindrome+0x7c>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%edx
mov    %edx,%esi
add    $0xffffffff,%esi
mov    %esi,-0x10(%rbp)
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1197 <isPalindrome+0x77>
mov    -0x8(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
jmp    11ac <isPalindrome+0x8c>
jmp    1142 <isPalindrome+0x22>
mov    -0x8(%rbp),%rsi
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %rcx,%rax
jle    1162 <isPalindrome+0x42>
movzbl (%rbx,%rcx,1),%edx
add    $0x1,%rcx
lea    -0x1(%rax),%rsi
cmp    (%rbx,%rax,1),%dl
mov    %rsi,%rax
je     1140 <isPalindrome+0x20>
lea    0xea0(%rip),%rdi
jmp    1169 <isPalindrome+0x49>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"%s is Not Palindromen\00"
@.str.1 = [18 x i8] c"%s is palindromen\00"
define void @isPalindrome(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %4
br label %8
8: ; preds = %31, %1
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %32
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = sext i32 %14 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8*, i8** %2
%21 = load i32, i32* %4
%22 = add nsw i32 %21, -1
store i32 %22, i32* %4
%23 = sext i32 %21 to i64
%24 = getelementptr inbounds i8, i8* %20, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %19, %26
br i1 %27, label %28, label %31
28: ; preds = %12
%29 = load i8*, i8** %2
%30 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %29)
br label %35
31: ; preds = %12
br label %8
32: ; preds = %8
%33 = load i8*, i8** %2
%34 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %33)
br label %35
35: ; preds = %32, %28
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s is Not Palindromen\00"
@.str.1 = [18 x i8] c"%s is palindromen\00"
define void @isPalindrome(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
br label %4
4: ; preds = %9, %1
%5 = phi i64 [ %7, %9 ], [ %3, %1 ]
%6 = phi i64 [ %10, %9 ], [ 0, %1 ]
%7 = add i64 %5, -1
%8 = icmp sgt i64 %7, %6
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = add nuw nsw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %6
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %7
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %9
%17 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %20
18: ; preds = %4
%19 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %20
20: ; preds = %18, %16
ret void
}