#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*/ assert(int);
int is_palindrome_iter(char *);
int is_palindrome_rec(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char *ord[] = {"regninger", "regning", "", "i", "aa", "er", "regnimger"};
  assert(1 == is_palindrome_iter(ord[0]));
  assert(1 == is_palindrome_rec(ord[0]));
  assert(0 == is_palindrome_iter(ord[1]));
  assert(0 == is_palindrome_rec(ord[1]));
  assert(1 == is_palindrome_iter(ord[2]));
  assert(1 == is_palindrome_rec(ord[2]));
  assert(1 == is_palindrome_iter(ord[3]));
  assert(1 == is_palindrome_rec(ord[3]));
  assert(1 == is_palindrome_iter(ord[4]));
  assert(1 == is_palindrome_rec(ord[4]));
  assert(0 == is_palindrome_iter(ord[5]));
  assert(0 == is_palindrome_rec(ord[5]));
  assert(0 == is_palindrome_iter(ord[6]));
  assert(0 == is_palindrome_rec(ord[6]));
  printf("All test passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0x2c76(%rip),%rsi
mov    $0x38,%edx
call   1060 <memcpy@plt>
mov    -0x40(%rbp),%rdi
call   1040 <is_palindrome_iter@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x40(%rbp),%rdi
call   1070 <is_palindrome_rec@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x38(%rbp),%rdi
call   1040 <is_palindrome_iter@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x38(%rbp),%rdi
call   1070 <is_palindrome_rec@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x30(%rbp),%rdi
call   1040 <is_palindrome_iter@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x30(%rbp),%rdi
call   1070 <is_palindrome_rec@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x28(%rbp),%rdi
call   1040 <is_palindrome_iter@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x28(%rbp),%rdi
call   1070 <is_palindrome_rec@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x20(%rbp),%rdi
call   1040 <is_palindrome_iter@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x20(%rbp),%rdi
call   1070 <is_palindrome_rec@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1040 <is_palindrome_iter@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1070 <is_palindrome_rec@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <is_palindrome_iter@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1070 <is_palindrome_rec@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xd06(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <is_palindrome_iter@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1060 <is_palindrome_rec@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe8f(%rip),%rbx
mov    %rbx,%rdi
call   1040 <is_palindrome_iter@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1060 <is_palindrome_rec@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe6a(%rip),%rbx
mov    %rbx,%rdi
call   1040 <is_palindrome_iter@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1060 <is_palindrome_rec@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe33(%rip),%rbx
mov    %rbx,%rdi
call   1040 <is_palindrome_iter@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1060 <is_palindrome_rec@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe02(%rip),%rbx
mov    %rbx,%rdi
call   1040 <is_palindrome_iter@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1060 <is_palindrome_rec@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xdd9(%rip),%rbx
mov    %rbx,%rdi
call   1040 <is_palindrome_iter@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1060 <is_palindrome_rec@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xda1(%rip),%rbx
mov    %rbx,%rdi
call   1040 <is_palindrome_iter@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1060 <is_palindrome_rec@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xd7a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"regninger\00"
@.str.1 = [8 x i8] c"regning\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"i\00"
@.str.4 = [3 x i8] c"aa\00"
@.str.5 = [3 x i8] c"er\00"
@.str.6 = [10 x i8] c"regnimger\00"
@__const.main.ord = [7 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i32 0, i32 0)]
@.str.7 = [17 x i8] c"All test passed\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8*]
store i32 0, i32* %1
%3 = bitcast [7 x i8*]* %2 to i8*
%4 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @is_palindrome_iter(i8* %5)
%7 = icmp eq i32 1, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @is_palindrome_rec(i8* %11)
%13 = icmp eq i32 1, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @is_palindrome_iter(i8* %17)
%19 = icmp eq i32 0, %18
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @is_palindrome_rec(i8* %23)
%25 = icmp eq i32 0, %24
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 2
%29 = load i8*, i8** %28
%30 = call i32 @is_palindrome_iter(i8* %29)
%31 = icmp eq i32 1, %30
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 2
%35 = load i8*, i8** %34
%36 = call i32 @is_palindrome_rec(i8* %35)
%37 = icmp eq i32 1, %36
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
%40 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 3
%41 = load i8*, i8** %40
%42 = call i32 @is_palindrome_iter(i8* %41)
%43 = icmp eq i32 1, %42
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 3
%47 = load i8*, i8** %46
%48 = call i32 @is_palindrome_rec(i8* %47)
%49 = icmp eq i32 1, %48
%50 = zext i1 %49 to i32
%51 = call i32 @assert(i32 %50)
%52 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 4
%53 = load i8*, i8** %52
%54 = call i32 @is_palindrome_iter(i8* %53)
%55 = icmp eq i32 1, %54
%56 = zext i1 %55 to i32
%57 = call i32 @assert(i32 %56)
%58 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 4
%59 = load i8*, i8** %58
%60 = call i32 @is_palindrome_rec(i8* %59)
%61 = icmp eq i32 1, %60
%62 = zext i1 %61 to i32
%63 = call i32 @assert(i32 %62)
%64 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 5
%65 = load i8*, i8** %64
%66 = call i32 @is_palindrome_iter(i8* %65)
%67 = icmp eq i32 0, %66
%68 = zext i1 %67 to i32
%69 = call i32 @assert(i32 %68)
%70 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 5
%71 = load i8*, i8** %70
%72 = call i32 @is_palindrome_rec(i8* %71)
%73 = icmp eq i32 0, %72
%74 = zext i1 %73 to i32
%75 = call i32 @assert(i32 %74)
%76 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 6
%77 = load i8*, i8** %76
%78 = call i32 @is_palindrome_iter(i8* %77)
%79 = icmp eq i32 0, %78
%80 = zext i1 %79 to i32
%81 = call i32 @assert(i32 %80)
%82 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 6
%83 = load i8*, i8** %82
%84 = call i32 @is_palindrome_rec(i8* %83)
%85 = icmp eq i32 0, %84
%86 = zext i1 %85 to i32
%87 = call i32 @assert(i32 %86)
%88 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"regninger\00"
@.str.1 = [8 x i8] c"regning\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"i\00"
@.str.4 = [3 x i8] c"aa\00"
@.str.5 = [3 x i8] c"er\00"
@.str.6 = [10 x i8] c"regnimger\00"
@str = [16 x i8] c"All test passed\00"
define i32 @main() {
%1 = tail call i32 @is_palindrome_iter(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @is_palindrome_rec(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @is_palindrome_iter(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @is_palindrome_rec(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 @is_palindrome_iter(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32 %17, 1
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @is_palindrome_rec(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i32 %21, 1
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call i32 @is_palindrome_iter(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i32 %25, 1
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
%29 = tail call i32 @is_palindrome_rec(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i32 %29, 1
%31 = zext i1 %30 to i32
%32 = tail call i32 @assert(i32 %31)
%33 = tail call i32 @is_palindrome_iter(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%34 = icmp eq i32 %33, 1
%35 = zext i1 %34 to i32
%36 = tail call i32 @assert(i32 %35)
%37 = tail call i32 @is_palindrome_rec(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp eq i32 %37, 1
%39 = zext i1 %38 to i32
%40 = tail call i32 @assert(i32 %39)
%41 = tail call i32 @is_palindrome_iter(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%42 = icmp eq i32 %41, 0
%43 = zext i1 %42 to i32
%44 = tail call i32 @assert(i32 %43)
%45 = tail call i32 @is_palindrome_rec(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
%47 = zext i1 %46 to i32
%48 = tail call i32 @assert(i32 %47)
%49 = tail call i32 @is_palindrome_iter(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%50 = icmp eq i32 %49, 0
%51 = zext i1 %50 to i32
%52 = tail call i32 @assert(i32 %51)
%53 = tail call i32 @is_palindrome_rec(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%54 = icmp eq i32 %53, 0
%55 = zext i1 %54 to i32
%56 = tail call i32 @assert(i32 %55)
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}