#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*/ free(char *);
int /*<<< orphan*/ make_palindrome(char *, char **, int *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
void test_make_palindrome() {
  char *output = NULL;
  int output_len;
  printf("Testing make_palindrome\n\n");
  make_palindrome("hello", &output, &output_len);
  printf("make_palindrome \"hello\" with NULL buffer"
         " returns \"%s\" with len %d (%s)\n",
         output, output_len,
         strcmp(output, "hellolleh") == 0 && output_len == 10 ? "Correct"
                                                              : "Failed");
  make_palindrome("abc", &output, &output_len);
  printf("make_palindrome \"abc\" with previous buffer"
         " returns \"%s\" with len %d (%s)\n",
         output, output_len,
         strcmp(output, "abcba") == 0 && output_len == 10 ? "Correct"
                                                          : "Failed");
  make_palindrome("hello", &output, &output_len);
  printf("make_palindrome \"hello\" with previous buffer"
         " returns \"%s\" with len %d (%s)\n",
         output, output_len,
         strcmp(output, "hellolleh") == 0 && output_len == 10 ? "Correct"
                                                              : "Failed");
  make_palindrome("helloX", &output, &output_len);
  printf("make_palindrome \"helloX\" with previous buffer"
         " returns \"%s\" with len %d (%s)\n",
         output, output_len,
         strcmp(output, "helloXolleh") == 0 && output_len == 12 ? "Correct"
                                                                : "Failed");
  free(output);
  output = NULL;
  make_palindrome("", &output, &output_len);
  printf("make_palindrome \"\" with NULL buffer"
         " returns \"%s\" with len %d (%s)\n",
         output, output_len,
         strcmp(output, "") == 0 && output_len == 1 ? "Correct" : "Failed");
  free(output);
  output = NULL;
  make_palindrome("a", &output, &output_len);
  printf("make_palindrome \"\" with NULL buffer"
         " returns \"%s\" with len %d (%s)\n",
         output, output_len,
         strcmp(output, "a") == 0 && output_len == 2 ? "Correct" : "Failed");
  free(output);
  output = NULL;
}


x86 assembly (clang, -O0):
<test_make_palindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <make_palindrome@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xedd(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xd(%rbp)
jne    11ac <test_make_palindrome+0x6c>
cmpl   $0xa,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rsi
mov    -0xd(%rbp),%dil
lea    0xebc(%rip),%rcx
lea    0xead(%rip),%rax
test   $0x1,%dil
cmovne %rax,%rcx
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9f(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <make_palindrome@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x21(%rbp)
jne    1229 <test_make_palindrome+0xe9>
cmpl   $0xa,-0xc(%rbp)
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x28(%rbp),%edx
mov    -0x30(%rbp),%rsi
mov    -0x21(%rbp),%dil
lea    0xe3f(%rip),%rcx
lea    0xe30(%rip),%rax
test   $0x1,%dil
cmovne %rax,%rcx
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdbb(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <make_palindrome@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xde3(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x31(%rbp)
jne    12a6 <test_make_palindrome+0x166>
cmpl   $0xa,-0xc(%rbp)
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x38(%rbp),%edx
mov    -0x40(%rbp),%rsi
mov    -0x31(%rbp),%dil
lea    0xdc2(%rip),%rcx
lea    0xdb3(%rip),%rax
test   $0x1,%dil
cmovne %rax,%rcx
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe45(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <make_palindrome@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x41(%rbp)
jne    1323 <test_make_palindrome+0x1e3>
cmpl   $0xc,-0xc(%rbp)
sete   %al
mov    %al,-0x41(%rbp)
mov    -0x48(%rbp),%edx
mov    -0x50(%rbp),%rsi
mov    -0x41(%rbp),%dil
lea    0xd45(%rip),%rcx
lea    0xd36(%rip),%rax
test   $0x1,%dil
cmovne %rax,%rcx
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
lea    0xcaf(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <make_palindrome@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xc89(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x51(%rbp)
jne    13b1 <test_make_palindrome+0x271>
cmpl   $0x1,-0xc(%rbp)
sete   %al
mov    %al,-0x51(%rbp)
mov    -0x58(%rbp),%edx
mov    -0x60(%rbp),%rsi
mov    -0x51(%rbp),%dil
lea    0xcb7(%rip),%rcx
lea    0xca8(%rip),%rax
test   $0x1,%dil
cmovne %rax,%rcx
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
lea    0xcdb(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <make_palindrome@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xcb5(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x61(%rbp)
jne    143f <test_make_palindrome+0x2ff>
cmpl   $0x2,-0xc(%rbp)
sete   %al
mov    %al,-0x61(%rbp)
mov    -0x68(%rbp),%edx
mov    -0x70(%rbp),%rsi
mov    -0x61(%rbp),%dil
lea    0xc29(%rip),%rcx
lea    0xc1a(%rip),%rax
test   $0x1,%dil
cmovne %rax,%rcx
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_make_palindrome>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
lea    0x103c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe86(%rip),%rdi
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%r13
mov    %r14,%rsi
mov    %r13,%rdx
call   1070 <make_palindrome@plt>
mov    0x10(%rsp),%rbp
mov    0xc(%rsp),%r12d
lea    0xeae(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strcmp@plt>
cmpl   $0xa,0xc(%rsp)
lea    0xea4(%rip),%rbx
lea    0xea5(%rip),%r15
mov    %r15,%rcx
cmove  %rbx,%rcx
test   %rax,%rax
cmovne %r15,%rcx
lea    0xe36(%rip),%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe83(%rip),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   1070 <make_palindrome@plt>
mov    0x10(%rsp),%rbp
mov    0xc(%rsp),%r12d
lea    0xeb5(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strcmp@plt>
cmpl   $0xa,0xc(%rsp)
mov    %r15,%rcx
cmove  %rbx,%rcx
test   %rax,%rax
cmovne %r15,%rcx
lea    0xe49(%rip),%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdca(%rip),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   1070 <make_palindrome@plt>
mov    0x10(%rsp),%rbp
mov    0xc(%rsp),%r12d
mov    %rbp,%rdi
lea    0xdf9(%rip),%rsi
call   1060 <strcmp@plt>
cmpl   $0xa,0xc(%rsp)
mov    %r15,%rcx
cmove  %rbx,%rcx
test   %rax,%rax
cmovne %r15,%rcx
lea    0xe47(%rip),%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   1070 <make_palindrome@plt>
mov    0x10(%rsp),%rbp
mov    0xc(%rsp),%r12d
lea    0xeb7(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strcmp@plt>
cmpl   $0xc,0xc(%rsp)
mov    %r15,%rcx
cmove  %rbx,%rcx
test   %rax,%rax
cmovne %r15,%rcx
lea    0xe48(%rip),%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
movq   $0x0,0x10(%rsp)
lea    0xebc(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   1070 <make_palindrome@plt>
mov    0x10(%rsp),%rbp
mov    0xc(%rsp),%r13d
mov    %rbp,%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
cmpl   $0x1,0xc(%rsp)
mov    %r15,%rcx
cmove  %rbx,%rcx
test   %rax,%rax
cmovne %r15,%rcx
lea    0xe3d(%rip),%r12
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
movq   $0x0,0x10(%rsp)
lea    0xd65(%rip),%r13
mov    %r13,%rdi
mov    %r14,%rsi
lea    0xc(%rsp),%rdx
call   1070 <make_palindrome@plt>
mov    0x10(%rsp),%rbp
mov    0xc(%rsp),%r14d
mov    %rbp,%rdi
mov    %r13,%rsi
call   1060 <strcmp@plt>
cmpl   $0x2,0xc(%rsp)
cmovne %r15,%rbx
test   %rax,%rax
cmovne %r15,%rbx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Testing make_palindrome\0A\0A\00"
@.str.1 = [6 x i8] c"hello\00"
@.str.2 = [72 x i8] c"make_palindrome \22hello\22 with NULL buffer returns \22%s\22 with len %d (%s)\0A\00"
@.str.3 = [10 x i8] c"hellolleh\00"
@.str.4 = [8 x i8] c"Correct\00"
@.str.5 = [7 x i8] c"Failed\00"
@.str.6 = [4 x i8] c"abc\00"
@.str.7 = [74 x i8] c"make_palindrome \22abc\22 with previous buffer returns \22%s\22 with len %d (%s)\0A\00"
@.str.8 = [6 x i8] c"abcba\00"
@.str.9 = [76 x i8] c"make_palindrome \22hello\22 with previous buffer returns \22%s\22 with len %d (%s)\0A\00"
@.str.10 = [7 x i8] c"helloX\00"
@.str.11 = [77 x i8] c"make_palindrome \22helloX\22 with previous buffer returns \22%s\22 with len %d (%s)\0A\00"
@.str.12 = [12 x i8] c"helloXolleh\00"
@.str.13 = [1 x i8] zeroinitializer
@.str.14 = [67 x i8] c"make_palindrome \22\22 with NULL buffer returns \22%s\22 with len %d (%s)\0A\00"
@.str.15 = [2 x i8] c"a\00"
define void @test_make_palindrome() {
%1 = alloca i8*
%2 = alloca i32
store i8* null, i8** %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @make_palindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %1, i32* %2)
%5 = load i8*, i8** %1
%6 = load i32, i32* %2
%7 = load i8*, i8** %1
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 10
br label %13
13: ; preds = %10, %0
%14 = phi i1 [ false, %0 ], [ %12, %10 ]
%15 = zext i1 %14 to i64
%16 = select i1 %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0), i8* %5, i32 %6, i8* %16)
%18 = call i32 @make_palindrome(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8** %1, i32* %2)
%19 = load i8*, i8** %1
%20 = load i32, i32* %2
%21 = load i8*, i8** %1
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %13
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 10
br label %27
27: ; preds = %24, %13
%28 = phi i1 [ false, %13 ], [ %26, %24 ]
%29 = zext i1 %28 to i64
%30 = select i1 %28, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.7, i64 0, i64 0), i8* %19, i32 %20, i8* %30)
%32 = call i32 @make_palindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %1, i32* %2)
%33 = load i8*, i8** %1
%34 = load i32, i32* %2
%35 = load i8*, i8** %1
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %27
%39 = load i32, i32* %2
%40 = icmp eq i32 %39, 10
br label %41
41: ; preds = %38, %27
%42 = phi i1 [ false, %27 ], [ %40, %38 ]
%43 = zext i1 %42 to i64
%44 = select i1 %42, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.9, i64 0, i64 0), i8* %33, i32 %34, i8* %44)
%46 = call i32 @make_palindrome(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8** %1, i32* %2)
%47 = load i8*, i8** %1
%48 = load i32, i32* %2
%49 = load i8*, i8** %1
%50 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %41
%53 = load i32, i32* %2
%54 = icmp eq i32 %53, 12
br label %55
55: ; preds = %52, %41
%56 = phi i1 [ false, %41 ], [ %54, %52 ]
%57 = zext i1 %56 to i64
%58 = select i1 %56, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.11, i64 0, i64 0), i8* %47, i32 %48, i8* %58)
%60 = load i8*, i8** %1
%61 = call i32 @free(i8* %60)
store i8* null, i8** %1
%62 = call i32 @make_palindrome(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.13, i64 0, i64 0), i8** %1, i32* %2)
%63 = load i8*, i8** %1
%64 = load i32, i32* %2
%65 = load i8*, i8** %1
%66 = call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.13, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %55
%69 = load i32, i32* %2
%70 = icmp eq i32 %69, 1
br label %71
71: ; preds = %68, %55
%72 = phi i1 [ false, %55 ], [ %70, %68 ]
%73 = zext i1 %72 to i64
%74 = select i1 %72, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.14, i64 0, i64 0), i8* %63, i32 %64, i8* %74)
%76 = load i8*, i8** %1
%77 = call i32 @free(i8* %76)
store i8* null, i8** %1
%78 = call i32 @make_palindrome(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8** %1, i32* %2)
%79 = load i8*, i8** %1
%80 = load i32, i32* %2
%81 = load i8*, i8** %1
%82 = call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %71
%85 = load i32, i32* %2
%86 = icmp eq i32 %85, 2
br label %87
87: ; preds = %84, %71
%88 = phi i1 [ false, %71 ], [ %86, %84 ]
%89 = zext i1 %88 to i64
%90 = select i1 %88, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.14, i64 0, i64 0), i8* %79, i32 %80, i8* %90)
%92 = load i8*, i8** %1
%93 = call i32 @free(i8* %92)
store i8* null, i8** %1
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"hello\00"
@.str.2 = [72 x i8] c"make_palindrome \22hello\22 with NULL buffer returns \22%s\22 with len %d (%s)\0A\00"
@.str.3 = [10 x i8] c"hellolleh\00"
@.str.4 = [8 x i8] c"Correct\00"
@.str.5 = [7 x i8] c"Failed\00"
@.str.6 = [4 x i8] c"abc\00"
@.str.7 = [74 x i8] c"make_palindrome \22abc\22 with previous buffer returns \22%s\22 with len %d (%s)\0A\00"
@.str.8 = [6 x i8] c"abcba\00"
@.str.9 = [76 x i8] c"make_palindrome \22hello\22 with previous buffer returns \22%s\22 with len %d (%s)\0A\00"
@.str.10 = [7 x i8] c"helloX\00"
@.str.11 = [77 x i8] c"make_palindrome \22helloX\22 with previous buffer returns \22%s\22 with len %d (%s)\0A\00"
@.str.12 = [12 x i8] c"helloXolleh\00"
@.str.13 = [1 x i8] zeroinitializer
@.str.14 = [67 x i8] c"make_palindrome \22\22 with NULL buffer returns \22%s\22 with len %d (%s)\0A\00"
@.str.15 = [2 x i8] c"a\00"
@str = [25 x i8] c"Testing make_palindrome\0A\00"
define void @test_make_palindrome() {
%1 = alloca i8*
%2 = alloca i32
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = call i32 @make_palindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %1, i32* %2)
%7 = load i8*, i8** %1
%8 = load i32, i32* %2
%9 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 10
%13 = select i1 %10, i1 %12, i1 false
%14 = select i1 %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0), i8* %7, i32 %8, i8* %14)
%16 = call i32 @make_palindrome(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8** %1, i32* %2)
%17 = load i8*, i8** %1
%18 = load i32, i32* %2
%19 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 10
%23 = select i1 %20, i1 %22, i1 false
%24 = select i1 %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.7, i64 0, i64 0), i8* %17, i32 %18, i8* %24)
%26 = call i32 @make_palindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %1, i32* %2)
%27 = load i8*, i8** %1
%28 = load i32, i32* %2
%29 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
%31 = load i32, i32* %2
%32 = icmp eq i32 %31, 10
%33 = select i1 %30, i1 %32, i1 false
%34 = select i1 %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.9, i64 0, i64 0), i8* %27, i32 %28, i8* %34)
%36 = call i32 @make_palindrome(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8** %1, i32* %2)
%37 = load i8*, i8** %1
%38 = load i32, i32* %2
%39 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, 12
%43 = select i1 %40, i1 %42, i1 false
%44 = select i1 %43, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.11, i64 0, i64 0), i8* %37, i32 %38, i8* %44)
%46 = load i8*, i8** %1
%47 = call i32 @free(i8* %46)
store i8* null, i8** %1
%48 = call i32 @make_palindrome(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.13, i64 0, i64 0), i8** %1, i32* %2)
%49 = load i8*, i8** %1
%50 = load i32, i32* %2
%51 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.13, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
%53 = load i32, i32* %2
%54 = icmp eq i32 %53, 1
%55 = select i1 %52, i1 %54, i1 false
%56 = select i1 %55, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.14, i64 0, i64 0), i8* %49, i32 %50, i8* %56)
%58 = load i8*, i8** %1
%59 = call i32 @free(i8* %58)
store i8* null, i8** %1
%60 = call i32 @make_palindrome(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8** %1, i32* %2)
%61 = load i8*, i8** %1
%62 = load i32, i32* %2
%63 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
%65 = load i32, i32* %2
%66 = icmp eq i32 %65, 2
%67 = select i1 %64, i1 %66, i1 false
%68 = select i1 %67, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.14, i64 0, i64 0), i8* %61, i32 %62, i8* %68)
%70 = load i8*, i8** %1
%71 = call i32 @free(i8* %70)
ret void
}