#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 palindrome_check(int *, int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_input(int *, int *);
int main(void) {
  int text[81] = {0};
  int num_chars = 0;
  int *len = &num_chars;
  read_input(text, len);
  if (palindrome_check(text, len) == true) {
    printf("Palindrome\n");
  } else {
    printf("Not a palindrome\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x150(%rbp),%rdi
xor    %esi,%esi
mov    $0x144,%edx
call   1050 <memset@plt>
movl   $0x0,-0x154(%rbp)
lea    -0x154(%rbp),%rax
mov    %rax,-0x160(%rbp)
lea    -0x150(%rbp),%rdi
mov    -0x160(%rbp),%rsi
call   1060 <read_input@plt>
lea    -0x150(%rbp),%rdi
mov    -0x160(%rbp),%rsi
call   1040 <palindrome_check@plt>
cmp    $0x1,%eax
jne    11bd <main+0x7d>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    11c9 <main+0x89>
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x158,%rsp
lea    0x10(%rsp),%rbx
mov    $0x144,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <read_input@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <palindrome_check@plt>
cmp    $0x1,%eax
lea    0xe86(%rip),%rax
lea    0xe6e(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x158,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Palindrome\0A\00"
@.str.1 = [18 x i8] c"Not a palindrome\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i32]
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
%5 = bitcast [81 x i32]* %2 to i8*
store i32 0, i32* %3
store i32* %3, i32** %4
%6 = getelementptr inbounds [81 x i32], [81 x i32]* %2, i64 0, i64 0
%7 = load i32*, i32** %4
%8 = call i32 @read_input(i32* %6, i32* %7)
%9 = getelementptr inbounds [81 x i32], [81 x i32]* %2, i64 0, i64 0
%10 = load i32*, i32** %4
%11 = call i32 @palindrome_check(i32* %9, i32* %10)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %17
15: ; preds = %0
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Not a palindrome\00"
@str.2 = [11 x i8] c"Palindrome\00"
define i32 @main() {
%1 = alloca [81 x i32]
%2 = alloca i32
%3 = bitcast [81 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = getelementptr inbounds [81 x i32], [81 x i32]* %1, i64 0, i64 0
%6 = call i32 @read_input(i32* %5, i32* %2)
%7 = call i32 @palindrome_check(i32* %5, i32* %2)
%8 = icmp eq i32 %7, 1
%9 = select i1 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}