#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 isPalindrome(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  char *s1 = "A man, a plan, a canal: Panama";
  char *s2 = "race a car";
  char *s3 = "";
  char *s4 = ".:";
  printf("%s: %d\n", s1, isPalindrome(s1));
  printf("%s: %d\n", s2, isPalindrome(s2));
  printf("%s: %d\n", s3, isPalindrome(s3));
  printf("%s: %d\n", s4, isPalindrome(s4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xee8(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <isPalindrome@plt>
mov    -0x48(%rbp),%rsi
mov    %eax,%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <isPalindrome@plt>
mov    -0x40(%rbp),%rsi
mov    %eax,%edx
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <isPalindrome@plt>
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <isPalindrome@plt>
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
mov    %rbx,%rdi
call   1040 <isPalindrome@plt>
lea    0xef3(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
call   1040 <isPalindrome@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xeca(%rip),%rbx
mov    %rbx,%rdi
call   1040 <isPalindrome@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xea4(%rip),%rbx
mov    %rbx,%rdi
call   1040 <isPalindrome@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"A man, a plan, a canal: Panama\00"
@.str.1 = [11 x i8] c"race a car\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [3 x i8] c".:\00"
@.str.4 = [8 x i8] c"%s: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8** %4
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @isPalindrome(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %6, i32 %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @isPalindrome(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %10, i32 %12)
%14 = load i8*, i8** %4
%15 = load i8*, i8** %4
%16 = call i32 @isPalindrome(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %14, i32 %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %5
%20 = call i32 @isPalindrome(i8* %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %18, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"A man, a plan, a canal: Panama\00"
@.str.1 = [11 x i8] c"race a car\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [3 x i8] c".:\00"
@.str.4 = [8 x i8] c"%s: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @isPalindrome(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isPalindrome(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @isPalindrome(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @isPalindrome(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %7)
ret i32 0
}