#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 *);
int strlen(char *);
int palin(char str[], int i, int n) {
  n = strlen(str);
  if (i == n / 2) {
    printf("Yes");
    return 0;
  }
  if (str[i] == str[n - 1 - i])
    palin(str, i + 1, n);
  else {
    printf("No");
    return 0;
  }
}


x86 assembly (clang, -O0):
<palin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jne    1184 <palin+0x54>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11d6 <palin+0xa6>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
sub    -0x14(%rbp),%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    11c3 <palin+0x93>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
call   1050 <palin@plt>
jmp    11d6 <palin+0xa6>
lea    0xe3a(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<palin>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r12d
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
lea    0xeba(%rip),%r15
cmp    %r12d,%ecx
je     1193 <palin+0x73>
movslq %r12d,%rbx
mov    %r12d,%ebp
not    %ebp
add    %r14,%rbx
lea    0xea7(%rip),%r13
nopl   (%rax)
movzbl (%rbx),%ecx
add    %ebp,%eax
cltq
cmp    (%r14,%rax,1),%cl
jne    1190 <palin+0x70>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
add    $0xffffffff,%ebp
add    $0x1,%rbx
add    $0x1,%r12d
cmp    %ecx,%r12d
jne    1160 <palin+0x40>
jmp    1193 <palin+0x73>
mov    %r13,%r15
mov    %r15,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"Yes\00"
@.str.1 = [3 x i8] c"No\00"
define i32 @palin(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = sdiv i32 %4, 2
%6 = icmp eq i32 %5, %1
br i1 %6, label %27, label %7
7: ; preds = %3
%8 = sext i32 %1 to i64
br label %9
9: ; preds = %7, %21
%10 = phi i64 [ %8, %7 ], [ %22, %21 ]
%11 = phi i32 [ %4, %7 ], [ %23, %21 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %10
%13 = load i8, i8* %12
%14 = trunc i64 %10 to i32
%15 = xor i32 %14, -1
%16 = add i32 %11, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = load i8, i8* %18
%20 = icmp eq i8 %13, %19
br i1 %20, label %21, label %27
21: ; preds = %9
%22 = add i64 %10, 1
%23 = tail call i32 @strlen(i8* %0)
%24 = sdiv i32 %23, 2
%25 = trunc i64 %22 to i32
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %9
27: ; preds = %9, %21, %3
%28 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %21 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %9 ]
%29 = tail call i32 @printf(i8* dereferenceable(1) %28)
ret i32 0
}