#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 ListNode {
  int dummy;
};

/* Variables and functions */
int isPalindrome(struct ListNode *);
struct ListNode *newNode(int, struct ListNode *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct ListNode *l1;
  l1 = newNode(1, newNode(2, newNode(4, newNode(2, newNode(1, NULL)))));
  printf("%d\n", isPalindrome(l1) == true);
  l1 = newNode(1, newNode(2, newNode(2, newNode(1, NULL))));
  printf("%d\n", isPalindrome(l1) == true);
  l1 = newNode(1, newNode(3, newNode(2, newNode(1, NULL))));
  printf("%d\n", isPalindrome(l1) == true);
  l1 = newNode(1, newNode(1, NULL));
  printf("%d\n", isPalindrome(l1) == true);
  l1 = newNode(1, newNode(2, NULL));
  printf("%d\n", isPalindrome(l1) == true);
  l1 = newNode(1, NULL);
  printf("%d\n", isPalindrome(l1) == true);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x2,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x4,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x2,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x1,%edi
call   1050 <newNode@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <isPalindrome@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x2,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x2,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x1,%edi
call   1050 <newNode@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <isPalindrome@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe0e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x2,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x3,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x1,%edi
call   1050 <newNode@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <isPalindrome@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xdb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x1,%edi
call   1050 <newNode@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <isPalindrome@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xd76(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x1,%edi
call   1050 <newNode@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <isPalindrome@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xd37(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <newNode@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <isPalindrome@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xd05(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <newNode@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x4,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x1,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rax,%rdi
call   1040 <isPalindrome@plt>
xor    %esi,%esi
cmp    $0x1,%eax
sete   %sil
lea    0xe77(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <newNode@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x1,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rax,%rdi
call   1040 <isPalindrome@plt>
xor    %esi,%esi
cmp    $0x1,%eax
sete   %sil
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <newNode@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x3,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x1,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rax,%rdi
call   1040 <isPalindrome@plt>
xor    %esi,%esi
cmp    $0x1,%eax
sete   %sil
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <newNode@plt>
mov    $0x1,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rax,%rdi
call   1040 <isPalindrome@plt>
xor    %esi,%esi
cmp    $0x1,%eax
sete   %sil
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1050 <newNode@plt>
mov    $0x1,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rax,%rdi
call   1040 <isPalindrome@plt>
xor    %esi,%esi
cmp    $0x1,%eax
sete   %sil
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <newNode@plt>
mov    %rax,%rdi
call   1040 <isPalindrome@plt>
xor    %esi,%esi
cmp    $0x1,%eax
sete   %sil
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca %struct.ListNode*
%2 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* null)
%3 = call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %2)
%4 = call %struct.ListNode* @newNode(i32 4, %struct.ListNode* %3)
%5 = call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %4)
%6 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %5)
store %struct.ListNode* %6, %struct.ListNode** %1
%7 = load %struct.ListNode*, %struct.ListNode** %1
%8 = call i32 @isPalindrome(%struct.ListNode* %7)
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* null)
%13 = call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %12)
%14 = call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %13)
%15 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %14)
store %struct.ListNode* %15, %struct.ListNode** %1
%16 = load %struct.ListNode*, %struct.ListNode** %1
%17 = call i32 @isPalindrome(%struct.ListNode* %16)
%18 = icmp eq i32 %17, 1
%19 = zext i1 %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* null)
%22 = call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %21)
%23 = call %struct.ListNode* @newNode(i32 3, %struct.ListNode* %22)
%24 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %23)
store %struct.ListNode* %24, %struct.ListNode** %1
%25 = load %struct.ListNode*, %struct.ListNode** %1
%26 = call i32 @isPalindrome(%struct.ListNode* %25)
%27 = icmp eq i32 %26, 1
%28 = zext i1 %27 to i32
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* null)
%31 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %30)
store %struct.ListNode* %31, %struct.ListNode** %1
%32 = load %struct.ListNode*, %struct.ListNode** %1
%33 = call i32 @isPalindrome(%struct.ListNode* %32)
%34 = icmp eq i32 %33, 1
%35 = zext i1 %34 to i32
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = call %struct.ListNode* @newNode(i32 2, %struct.ListNode* null)
%38 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %37)
store %struct.ListNode* %38, %struct.ListNode** %1
%39 = load %struct.ListNode*, %struct.ListNode** %1
%40 = call i32 @isPalindrome(%struct.ListNode* %39)
%41 = icmp eq i32 %40, 1
%42 = zext i1 %41 to i32
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %42)
%44 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* null)
store %struct.ListNode* %44, %struct.ListNode** %1
%45 = load %struct.ListNode*, %struct.ListNode** %1
%46 = call i32 @isPalindrome(%struct.ListNode* %45)
%47 = icmp eq i32 %46, 1
%48 = zext i1 %47 to i32
%49 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %48)
ret i32 0
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* null)
%2 = tail call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %1)
%3 = tail call %struct.ListNode* @newNode(i32 4, %struct.ListNode* %2)
%4 = tail call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %3)
%5 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %4)
%6 = tail call i32 @isPalindrome(%struct.ListNode* %5)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* null)
%11 = tail call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %10)
%12 = tail call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %11)
%13 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %12)
%14 = tail call i32 @isPalindrome(%struct.ListNode* %13)
%15 = icmp eq i32 %14, 1
%16 = zext i1 %15 to i32
%17 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* null)
%19 = tail call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %18)
%20 = tail call %struct.ListNode* @newNode(i32 3, %struct.ListNode* %19)
%21 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %20)
%22 = tail call i32 @isPalindrome(%struct.ListNode* %21)
%23 = icmp eq i32 %22, 1
%24 = zext i1 %23 to i32
%25 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* null)
%27 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %26)
%28 = tail call i32 @isPalindrome(%struct.ListNode* %27)
%29 = icmp eq i32 %28, 1
%30 = zext i1 %29 to i32
%31 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = tail call %struct.ListNode* @newNode(i32 2, %struct.ListNode* null)
%33 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %32)
%34 = tail call i32 @isPalindrome(%struct.ListNode* %33)
%35 = icmp eq i32 %34, 1
%36 = zext i1 %35 to i32
%37 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* null)
%39 = tail call i32 @isPalindrome(%struct.ListNode* %38)
%40 = icmp eq i32 %39, 1
%41 = zext i1 %40 to i32
%42 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %41)
ret i32 0
}