#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 *);
int checker(char con[100]) {
  int fl = 0, i;
  if (strlen(con) == 1)
    return 1;
  for (i = 0; i < strlen(con) / 2; i++) {
    if (con[i] == con[strlen(con) - 1 - i]) {
      fl++;
    }
  }
  if (fl == strlen(con) / 2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<checker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    1141 <checker+0x31>
movl   $0x1,-0x4(%rbp)
jmp    11fd <checker+0xed>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    11c6 <checker+0xb6>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rcx
mov    %eax,%edx
mov    -0x20(%rbp),%eax
sub    $0x1,%edx
sub    -0x18(%rbp),%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    11b3 <checker+0xa3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b8 <checker+0xa8>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1148 <checker+0x38>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jne    11f6 <checker+0xe6>
movl   $0x1,-0x4(%rbp)
jmp    11fd <checker+0xed>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     11a6 <checker+0x96>
mov    %r14,%rdi
call   1030 <strlen@plt>
xor    %r15d,%r15d
cmp    $0x2,%eax
jl     118d <checker+0x7d>
xor    %ebx,%ebx
mov    $0xffffffff,%ebp
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%r12d
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %ebp,%eax
cltq
xor    %ecx,%ecx
cmp    (%r14,%rax,1),%r12b
sete   %cl
add    %ecx,%r15d
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
add    $0xffffffff,%ebp
cmp    %rax,%rbx
jl     1150 <checker+0x40>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xor    %eax,%eax
cmp    %ecx,%r15d
sete   %al
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @checker(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %50
10: ; preds = %1
store i32 0, i32* %5
br label %11
11: ; preds = %39, %10
%12 = load i32, i32* %5
%13 = load i8*, i8** %3
%14 = call i32 @strlen(i8* %13)
%15 = sdiv i32 %14, 2
%16 = icmp slt i32 %12, %15
br i1 %16, label %17, label %42
17: ; preds = %11
%18 = load i8*, i8** %3
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = load i8*, i8** %3
%25 = load i8*, i8** %3
%26 = call i32 @strlen(i8* %25)
%27 = sub nsw i32 %26, 1
%28 = load i32, i32* %5
%29 = sub nsw i32 %27, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %24, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %23, %33
br i1 %34, label %35, label %38
35: ; preds = %17
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %38
38: ; preds = %35, %17
br label %39
39: ; preds = %38
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %11
42: ; preds = %11
%43 = load i32, i32* %4
%44 = load i8*, i8** %3
%45 = call i32 @strlen(i8* %44)
%46 = sdiv i32 %45, 2
%47 = icmp eq i32 %43, %46
br i1 %47, label %48, label %49
48: ; preds = %42
store i32 1, i32* %2
br label %50
49: ; preds = %42
store i32 0, i32* %2
br label %50
50: ; preds = %49, %48, %9
%51 = load i32, i32* %2
ret i32 %51
}

LLVM IR (-O2):
define i32 @checker(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %33, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %27
7: ; preds = %4, %7
%8 = phi i64 [ %22, %7 ], [ 0, %4 ]
%9 = phi i32 [ %21, %7 ], [ 0, %4 ]
%10 = trunc i64 %8 to i32
%11 = getelementptr inbounds i8, i8* %0, i64 %8
%12 = load i8, i8* %11
%13 = tail call i32 @strlen(i8* %0)
%14 = xor i32 %10, -1
%15 = add i32 %13, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %12, %18
%20 = zext i1 %19 to i32
%21 = add nuw nsw i32 %9, %20
%22 = add nuw nsw i64 %8, 1
%23 = tail call i32 @strlen(i8* %0)
%24 = sdiv i32 %23, 2
%25 = sext i32 %24 to i64
%26 = icmp slt i64 %22, %25
br i1 %26, label %7, label %27
27: ; preds = %7, %4
%28 = phi i32 [ 0, %4 ], [ %21, %7 ]
%29 = tail call i32 @strlen(i8* %0)
%30 = sdiv i32 %29, 2
%31 = icmp eq i32 %28, %30
%32 = zext i1 %31 to i32
br label %33
33: ; preds = %27, %1
%34 = phi i32 [ 1, %1 ], [ %32, %27 ]
ret i32 %34
}