#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) {
  i = 0;
  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)
movl   $0x0,-0x14(%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    118b <palin+0x5b>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11dd <palin+0xad>
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    11ca <palin+0x9a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
call   1050 <palin@plt>
jmp    11dd <palin+0xad>
lea    0xe33(%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   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%ecx
lea    0xec9(%rip),%r14
cmp    $0x3,%ecx
jb     1172 <palin+0x52>
lea    0xec1(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%ecx
cltq
cmp    -0x1(%rax,%rbx,1),%cl
jne    116f <palin+0x4f>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
add    $0x1,%ecx
cmp    $0x2,%ecx
ja     1150 <palin+0x30>
jmp    1172 <palin+0x52>
mov    %r15,%r14
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
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
store i32 0, i32* %6
%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 = add i32 %4, 1
%6 = icmp ult i32 %5, 3
br i1 %6, label %19, label %7
7: ; preds = %3, %15
%8 = phi i32 [ %16, %15 ], [ %4, %3 ]
%9 = load i8, i8* %0
%10 = add nsw i32 %8, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %9, %13
br i1 %14, label %15, label %19
15: ; preds = %7
%16 = tail call i32 @strlen(i8* %0)
%17 = add i32 %16, 1
%18 = icmp ult i32 %17, 3
br i1 %18, label %19, label %7
19: ; preds = %7, %15, %3
%20 = 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), %15 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %7 ]
%21 = tail call i32 @printf(i8* dereferenceable(1) %20)
ret i32 0
}