#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 */
char getchar();
scalar_t__ isPalindrome(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, const char *argv[]) {
  char str[100];
  char c;
  int i = 0;
  while ((c = getchar()) != '\n') {
    str[i] = c;
    i++;
  }
  str[i] = '\n';
  printf("%s", isPalindrome(str) ? "TRUE\n" : "FALSE\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x88(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x81(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1191 <main+0x61>
mov    -0x81(%rbp),%cl
movslq -0x88(%rbp),%rax
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1153 <main+0x23>
movslq -0x88(%rbp),%rax
movb   $0xa,-0x80(%rbp,%rax,1)
lea    -0x80(%rbp),%rdi
call   1050 <isPalindrome@plt>
mov    %rax,%rcx
lea    0xe59(%rip),%rsi
lea    0xe4c(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     1164 <main+0x34>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1150 <main+0x20>
mov    %ebx,%ebx
movb   $0xa,(%rsp,%rbx,1)
mov    %rsp,%rdi
call   1050 <isPalindrome@plt>
test   %rax,%rax
lea    0xe8f(%rip),%rax
lea    0xe82(%rip),%rsi
cmove  %rax,%rsi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"TRUE\0A\00"
@.str.2 = [7 x i8] c"FALSE\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca i8
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
br label %9
9: ; preds = %13, %2
%10 = call signext i8 (...) @getchar()
store i8 %10, i8* %7
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load i8, i8* %7
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %16
store i8 %14, i8* %17
%18 = load i32, i32* %8
%19 = add nsw i32 %18, 1
store i32 %19, i32* %8
br label %9
20: ; preds = %9
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %22
store i8 10, i8* %23
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%25 = call i64 @isPalindrome(i8* %24)
%26 = icmp ne i64 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"TRUE\0A\00"
@.str.2 = [7 x i8] c"FALSE\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = tail call signext i8 (...) @getchar()
%6 = icmp eq i8 %5, 10
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %11, %7 ], [ 0, %2 ]
%9 = phi i8 [ %12, %7 ], [ %5, %2 ]
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %8
store i8 %9, i8* %10
%11 = add nuw i64 %8, 1
%12 = tail call signext i8 (...) @getchar()
%13 = icmp eq i8 %12, 10
br i1 %13, label %14, label %7
14: ; preds = %7
%15 = and i64 %11, 4294967295
br label %16
16: ; preds = %14, %2
%17 = phi i64 [ 0, %2 ], [ %15, %14 ]
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %17
store i8 10, i8* %18
%19 = call i64 @isPalindrome(i8* %4)
%20 = icmp eq i64 %19, 0
%21 = select i1 %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %21)
ret i32 0
}