#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*/ removeCaseAndPunctuation(char *, char *);
int strlen(char *);
int isPalindrome(char line[]) {
  char formattedLine[800000 + 1];
  int len, left, right;
  removeCaseAndPunctuation(line, formattedLine);
  len = strlen(formattedLine);
  left = 0;
  right = len - 1;
  while (left < right) {
    if (formattedLine[left] != formattedLine[right])
      return 0;
    left++;
    right--;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc3530,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0xc3520(%rbp),%rsi
call   1040 <removeCaseAndPunctuation@plt>
lea    -0xc3520(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc3524(%rbp)
movl   $0x0,-0xc3528(%rbp)
mov    -0xc3524(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc352c(%rbp)
mov    -0xc3528(%rbp),%eax
cmp    -0xc352c(%rbp),%eax
jge    11d1 <isPalindrome+0xb1>
movslq -0xc3528(%rbp),%rax
movsbl -0xc3520(%rbp,%rax,1),%eax
ff
movslq -0xc352c(%rbp),%rcx
movsbl -0xc3520(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
je     11ae <isPalindrome+0x8e>
movl   $0x0,-0x4(%rbp)
jmp    11d8 <isPalindrome+0xb8>
mov    -0xc3528(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc3528(%rbp)
mov    -0xc352c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc352c(%rbp)
jmp    116a <isPalindrome+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc3530,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
push   %rbx
sub    $0xc3510,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <removeCaseAndPunctuation@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jl     116e <isPalindrome+0x4e>
mov    %ecx,%ecx
add    $0xfffffffffffffffe,%rcx
xor    %edx,%edx
nop
movzbl (%rsp,%rdx,1),%ebx
cmp    0x1(%rsp,%rcx,1),%bl
jne    116c <isPalindrome+0x4c>
add    $0x1,%rdx
lea    -0x1(%rcx),%rsi
cmp    %rcx,%rdx
mov    %rsi,%rcx
jl     1150 <isPalindrome+0x30>
jmp    116e <isPalindrome+0x4e>
xor    %eax,%eax
add    $0xc3510,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isPalindrome(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [800001 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
%8 = load i8*, i8** %3
%9 = getelementptr inbounds [800001 x i8], [800001 x i8]* %4, i64 0, i64 0
%10 = call i32 @removeCaseAndPunctuation(i8* %8, i8* %9)
%11 = getelementptr inbounds [800001 x i8], [800001 x i8]* %4, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
store i32 %12, i32* %5
store i32 0, i32* %6
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %7
br label %15
15: ; preds = %32, %1
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %37
19: ; preds = %15
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [800001 x i8], [800001 x i8]* %4, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [800001 x i8], [800001 x i8]* %4, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %24, %29
br i1 %30, label %31, label %32
31: ; preds = %19
store i32 0, i32* %2
br label %38
32: ; preds = %19
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
%35 = load i32, i32* %7
%36 = add nsw i32 %35, -1
store i32 %36, i32* %7
br label %15
37: ; preds = %15
store i32 1, i32* %2
br label %38
38: ; preds = %37, %31
%39 = load i32, i32* %2
ret i32 %39
}

LLVM IR (-O2):
define i32 @isPalindrome(i8* %0) {
%2 = alloca [800001 x i8]
%3 = getelementptr inbounds [800001 x i8], [800001 x i8]* %2, i64 0, i64 0
%4 = call i32 @removeCaseAndPunctuation(i8* %0, i8* %3)
%5 = call i32 @strlen(i8* %3)
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %22
7: ; preds = %1
%8 = zext i32 %5 to i64
%9 = add nsw i64 %8, -1
br label %13
10: ; preds = %13
%11 = add nsw i64 %15, -1
%12 = icmp slt i64 %21, %11
br i1 %12, label %13, label %22
13: ; preds = %7, %10
%14 = phi i64 [ 0, %7 ], [ %21, %10 ]
%15 = phi i64 [ %9, %7 ], [ %11, %10 ]
%16 = getelementptr inbounds [800001 x i8], [800001 x i8]* %2, i64 0, i64 %14
%17 = load i8, i8* %16
%18 = getelementptr inbounds [800001 x i8], [800001 x i8]* %2, i64 0, i64 %15
%19 = load i8, i8* %18
%20 = icmp eq i8 %17, %19
%21 = add nuw nsw i64 %14, 1
br i1 %20, label %10, label %22
22: ; preds = %13, %10, %1
%23 = phi i32 [ 1, %1 ], [ 1, %10 ], [ 0, %13 ]
ret i32 %23
}