#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 */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addNewNode(struct node *, int);
struct node *initNode(int);
char *isPalindromeIterate(struct node *);
char *isPalindromeReverse(struct node *);
int /*<<< orphan*/ printList(struct node *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  struct node *ptr = initNode(6);
  addNewNode(ptr, 3);
  addNewNode(ptr, 4);
  addNewNode(ptr, 4);
  addNewNode(ptr, 3);
  addNewNode(ptr, 6);
  printList(ptr);
  printf("Is a palindrome reverse: %s\n", isPalindromeReverse(ptr));
  printf("Is a palindrome iterate: %s\n", isPalindromeIterate(ptr));
  addNewNode(ptr, 7);
  printList(ptr);
  printf("Is a palindrome reverse: %s\n", isPalindromeReverse(ptr));
  printf("Is a palindrome iterate: %s\n", isPalindromeIterate(ptr));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6,%edi
call   1030 <initNode@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1040 <addNewNode@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <addNewNode@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <addNewNode@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1040 <addNewNode@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1040 <addNewNode@plt>
mov    -0x8(%rbp),%rdi
call   1080 <printList@plt>
mov    -0x8(%rbp),%rdi
call   1060 <isPalindromeReverse@plt>
mov    %rax,%rsi
lea    0xe28(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <isPalindromeIterate@plt>
mov    %rax,%rsi
lea    0xe2d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
call   1040 <addNewNode@plt>
mov    -0x8(%rbp),%rdi
call   1080 <printList@plt>
mov    -0x8(%rbp),%rdi
call   1060 <isPalindromeReverse@plt>
mov    %rax,%rsi
lea    0xde1(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <isPalindromeIterate@plt>
mov    %rax,%rsi
lea    0xde6(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x6,%edi
call   1030 <initNode@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x3,%esi
call   1040 <addNewNode@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <addNewNode@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <addNewNode@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <addNewNode@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <addNewNode@plt>
mov    %rbx,%rdi
call   1080 <printList@plt>
mov    %rbx,%rdi
call   1060 <isPalindromeReverse@plt>
lea    0xe36(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1070 <isPalindromeIterate@plt>
lea    0xe39(%rip),%r15
mov    %r15,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <addNewNode@plt>
mov    %rbx,%rdi
call   1080 <printList@plt>
mov    %rbx,%rdi
call   1060 <isPalindromeReverse@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1070 <isPalindromeIterate@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [29 x i8] c"Is a palindrome reverse: %s\0A\00"
@.str.1 = [29 x i8] c"Is a palindrome iterate: %s\0A\00"
define i32 @main() {
%1 = alloca %struct.node*
%2 = call %struct.node* @initNode(i32 6)
store %struct.node* %2, %struct.node** %1
%3 = load %struct.node*, %struct.node** %1
%4 = call i32 @addNewNode(%struct.node* %3, i32 3)
%5 = load %struct.node*, %struct.node** %1
%6 = call i32 @addNewNode(%struct.node* %5, i32 4)
%7 = load %struct.node*, %struct.node** %1
%8 = call i32 @addNewNode(%struct.node* %7, i32 4)
%9 = load %struct.node*, %struct.node** %1
%10 = call i32 @addNewNode(%struct.node* %9, i32 3)
%11 = load %struct.node*, %struct.node** %1
%12 = call i32 @addNewNode(%struct.node* %11, i32 6)
%13 = load %struct.node*, %struct.node** %1
%14 = call i32 @printList(%struct.node* %13)
%15 = load %struct.node*, %struct.node** %1
%16 = call i8* @isPalindromeReverse(%struct.node* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load %struct.node*, %struct.node** %1
%19 = call i8* @isPalindromeIterate(%struct.node* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = load %struct.node*, %struct.node** %1
%22 = call i32 @addNewNode(%struct.node* %21, i32 7)
%23 = load %struct.node*, %struct.node** %1
%24 = call i32 @printList(%struct.node* %23)
%25 = load %struct.node*, %struct.node** %1
%26 = call i8* @isPalindromeReverse(%struct.node* %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = load %struct.node*, %struct.node** %1
%29 = call i8* @isPalindromeIterate(%struct.node* %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %29)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [29 x i8] c"Is a palindrome reverse: %s\0A\00"
@.str.1 = [29 x i8] c"Is a palindrome iterate: %s\0A\00"
define i32 @main() {
%1 = tail call %struct.node* @initNode(i32 6)
%2 = tail call i32 @addNewNode(%struct.node* %1, i32 3)
%3 = tail call i32 @addNewNode(%struct.node* %1, i32 4)
%4 = tail call i32 @addNewNode(%struct.node* %1, i32 4)
%5 = tail call i32 @addNewNode(%struct.node* %1, i32 3)
%6 = tail call i32 @addNewNode(%struct.node* %1, i32 6)
%7 = tail call i32 @printList(%struct.node* %1)
%8 = tail call i8* @isPalindromeReverse(%struct.node* %1)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i8* @isPalindromeIterate(%struct.node* %1)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = tail call i32 @addNewNode(%struct.node* %1, i32 7)
%13 = tail call i32 @printList(%struct.node* %1)
%14 = tail call i8* @isPalindromeReverse(%struct.node* %1)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = tail call i8* @isPalindromeIterate(%struct.node* %1)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %16)
ret i32 0
}