#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 /*<<< orphan*/ testPalindrome(char *);
int main(int argc, char *argv[]) {
  int c;
  for (c = 0; c < argc; ++c) {
    printf("%s ", argv[c]);
  }
  printf("(%d)\n", argc);
  testPalindrome("");
  testPalindrome("a");
  testPalindrome("ab");
  testPalindrome("aa");
  testPalindrome("aba");
  testPalindrome("abba");
  testPalindrome("adam");
  testPalindrome("adad");
  testPalindrome("abacus");
  testPalindrome("abaaba");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1171 <main+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe79(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe69(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe60(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe70(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe4b(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe44(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe3d(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe36(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe31(%rip),%rdi
call   1040 <testPalindrome@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%r14d
test   %edi,%edi
jle    1157 <main+0x37>
mov    %rsi,%r12
mov    %r14d,%ebp
lea    0xec4(%rip),%r15
xor    %ebx,%ebx
xchg   %ax,%ax
mov    (%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <main+0x20>
lea    0xea6(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe93(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe83(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe7a(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe8a(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe65(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe5e(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe57(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe50(%rip),%rdi
call   1040 <testPalindrome@plt>
lea    0xe4b(%rip),%rdi
call   1040 <testPalindrome@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [6 x i8] c"(%d)\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"a\00"
@.str.4 = [3 x i8] c"ab\00"
@.str.5 = [3 x i8] c"aa\00"
@.str.6 = [4 x i8] c"aba\00"
@.str.7 = [5 x i8] c"abba\00"
@.str.8 = [5 x i8] c"adam\00"
@.str.9 = [5 x i8] c"adad\00"
@.str.10 = [7 x i8] c"abacus\00"
@.str.11 = [7 x i8] c"abaaba\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
%22 = load i32, i32* %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = call i32 @testPalindrome(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 @testPalindrome(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @testPalindrome(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 @testPalindrome(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%28 = call i32 @testPalindrome(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 @testPalindrome(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%30 = call i32 @testPalindrome(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%31 = call i32 @testPalindrome(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%32 = call i32 @testPalindrome(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%33 = call i32 @testPalindrome(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@.str.1 = [6 x i8] c"(%d)\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"a\00"
@.str.4 = [3 x i8] c"ab\00"
@.str.5 = [3 x i8] c"aa\00"
@.str.6 = [4 x i8] c"aba\00"
@.str.7 = [5 x i8] c"abba\00"
@.str.8 = [5 x i8] c"adam\00"
@.str.9 = [5 x i8] c"adad\00"
@.str.10 = [7 x i8] c"abacus\00"
@.str.11 = [7 x i8] c"abaaba\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%15 = tail call i32 @testPalindrome(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%16 = tail call i32 @testPalindrome(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%17 = tail call i32 @testPalindrome(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%18 = tail call i32 @testPalindrome(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%19 = tail call i32 @testPalindrome(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%20 = tail call i32 @testPalindrome(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%21 = tail call i32 @testPalindrome(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%22 = tail call i32 @testPalindrome(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%23 = tail call i32 @testPalindrome(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%24 = tail call i32 @testPalindrome(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
ret i32 0
}