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

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
struct sll_node *sll_add_at_head(struct sll_node *, int);
int /*<<< orphan*/ sll_destroy(struct sll_node *);
int sll_palindrome(struct sll_node *);
int /*<<< orphan*/ sll_print(struct sll_node *);
void main() {
  struct sll_node *h = NULL;
  int status = 0;
  h = sll_add_at_head(h, 1);
  h = sll_add_at_head(h, 2);
  h = sll_add_at_head(h, 3);
  h = sll_add_at_head(h, 2);
  h = sll_add_at_head(h, 1);
  printf("ODD SLL : ");
  sll_print(h);
  status = sll_palindrome(h);
  if (status == 0)
    printf(" SLL is palindrome\n");
  else
    printf(" SLL is NOT palindrome\n");
  sll_destroy(h);
  h = NULL;
  h = sll_add_at_head(h, 11);
  h = sll_add_at_head(h, 22);
  h = sll_add_at_head(h, 33);
  h = sll_add_at_head(h, 33);
  h = sll_add_at_head(h, 22);
  h = sll_add_at_head(h, 11);
  printf("EVEN SLL : ");
  sll_print(h);
  status = sll_palindrome(h);
  if (status == 0)
    printf(" SLL is palindrome\n");
  else
    printf(" SLL is NOT palindrome\n");
  sll_destroy(h);
  h = NULL;
  h = sll_add_at_head(h, 11);
  h = sll_add_at_head(h, 22);
  h = sll_add_at_head(h, 33);
  h = sll_add_at_head(h, 44);
  h = sll_add_at_head(h, 22);
  h = sll_add_at_head(h, 11);
  printf("Negative SLL : ");
  sll_print(h);
  status = sll_palindrome(h);
  if (status == 0)
    printf(" SLL is palindrome\n");
  else
    printf(" SLL is NOT palindrome\n");
  sll_destroy(h);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <sll_print@plt>
mov    -0x8(%rbp),%rdi
call   1070 <sll_palindrome@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11fd <main+0xad>
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
jmp    1209 <main+0xb9>
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <sll_destroy@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x16,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x21,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x21,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x16,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
lea    0xdaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <sll_print@plt>
mov    -0x8(%rbp),%rdi
call   1070 <sll_palindrome@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    12c2 <main+0x172>
lea    0xd53(%rip),%rdi
call   1030 <printf@plt>
jmp    12ce <main+0x17e>
lea    0xd56(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <sll_destroy@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x16,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x21,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2c,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x16,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1060 <sll_add_at_head@plt>
mov    %rax,-0x8(%rbp)
lea    0xcf1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <sll_print@plt>
mov    -0x8(%rbp),%rdi
call   1070 <sll_palindrome@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1387 <main+0x237>
lea    0xc8e(%rip),%rdi
call   1030 <printf@plt>
jmp    1393 <main+0x243>
lea    0xc91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <sll_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %edi,%edi
mov    $0x1,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x3,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x1,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rbx
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <sll_print@plt>
mov    %rbx,%rdi
call   1080 <sll_palindrome@plt>
test   %eax,%eax
lea    0xe71(%rip),%r15
lea    0xe53(%rip),%r14
mov    %r14,%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <sll_destroy@plt>
xor    %edi,%edi
mov    $0xb,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x16,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x21,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x21,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x16,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0xb,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rbx
lea    0xdcc(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <sll_print@plt>
mov    %rbx,%rdi
call   1080 <sll_palindrome@plt>
test   %eax,%eax
mov    %r14,%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <sll_destroy@plt>
xor    %edi,%edi
mov    $0xb,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x16,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x21,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x2c,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0x16,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rdi
mov    $0xb,%esi
call   1070 <sll_add_at_head@plt>
mov    %rax,%rbx
lea    0xd56(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <sll_print@plt>
mov    %rbx,%rdi
call   1080 <sll_palindrome@plt>
test   %eax,%eax
cmove  %r15,%r14
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <sll_destroy@plt>

LLVM IR (-O0):
%struct.sll_node = type { i32 }
@.str = [11 x i8] c"ODD SLL : \00"
@.str.1 = [20 x i8] c" SLL is palindrome\0A\00"
@.str.2 = [24 x i8] c" SLL is NOT palindrome\0A\00"
@.str.3 = [12 x i8] c"EVEN SLL : \00"
@.str.4 = [16 x i8] c"Negative SLL : \00"
define void @main() {
%1 = alloca %struct.sll_node*
%2 = alloca i32
store %struct.sll_node* null, %struct.sll_node** %1
store i32 0, i32* %2
%3 = load %struct.sll_node*, %struct.sll_node** %1
%4 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %3, i32 1)
store %struct.sll_node* %4, %struct.sll_node** %1
%5 = load %struct.sll_node*, %struct.sll_node** %1
%6 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %5, i32 2)
store %struct.sll_node* %6, %struct.sll_node** %1
%7 = load %struct.sll_node*, %struct.sll_node** %1
%8 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %7, i32 3)
store %struct.sll_node* %8, %struct.sll_node** %1
%9 = load %struct.sll_node*, %struct.sll_node** %1
%10 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %9, i32 2)
store %struct.sll_node* %10, %struct.sll_node** %1
%11 = load %struct.sll_node*, %struct.sll_node** %1
%12 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %11, i32 1)
store %struct.sll_node* %12, %struct.sll_node** %1
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%14 = load %struct.sll_node*, %struct.sll_node** %1
%15 = call i32 @sll_print(%struct.sll_node* %14)
%16 = load %struct.sll_node*, %struct.sll_node** %1
%17 = call i32 @sll_palindrome(%struct.sll_node* %16)
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %24
22: ; preds = %0
%23 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
%25 = load %struct.sll_node*, %struct.sll_node** %1
%26 = call i32 @sll_destroy(%struct.sll_node* %25)
store %struct.sll_node* null, %struct.sll_node** %1
%27 = load %struct.sll_node*, %struct.sll_node** %1
%28 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %27, i32 11)
store %struct.sll_node* %28, %struct.sll_node** %1
%29 = load %struct.sll_node*, %struct.sll_node** %1
%30 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %29, i32 22)
store %struct.sll_node* %30, %struct.sll_node** %1
%31 = load %struct.sll_node*, %struct.sll_node** %1
%32 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %31, i32 33)
store %struct.sll_node* %32, %struct.sll_node** %1
%33 = load %struct.sll_node*, %struct.sll_node** %1
%34 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %33, i32 33)
store %struct.sll_node* %34, %struct.sll_node** %1
%35 = load %struct.sll_node*, %struct.sll_node** %1
%36 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %35, i32 22)
store %struct.sll_node* %36, %struct.sll_node** %1
%37 = load %struct.sll_node*, %struct.sll_node** %1
%38 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %37, i32 11)
store %struct.sll_node* %38, %struct.sll_node** %1
%39 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%40 = load %struct.sll_node*, %struct.sll_node** %1
%41 = call i32 @sll_print(%struct.sll_node* %40)
%42 = load %struct.sll_node*, %struct.sll_node** %1
%43 = call i32 @sll_palindrome(%struct.sll_node* %42)
store i32 %43, i32* %2
%44 = load i32, i32* %2
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %24
%47 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %50
48: ; preds = %24
%49 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %50
50: ; preds = %48, %46
%51 = load %struct.sll_node*, %struct.sll_node** %1
%52 = call i32 @sll_destroy(%struct.sll_node* %51)
store %struct.sll_node* null, %struct.sll_node** %1
%53 = load %struct.sll_node*, %struct.sll_node** %1
%54 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %53, i32 11)
store %struct.sll_node* %54, %struct.sll_node** %1
%55 = load %struct.sll_node*, %struct.sll_node** %1
%56 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %55, i32 22)
store %struct.sll_node* %56, %struct.sll_node** %1
%57 = load %struct.sll_node*, %struct.sll_node** %1
%58 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %57, i32 33)
store %struct.sll_node* %58, %struct.sll_node** %1
%59 = load %struct.sll_node*, %struct.sll_node** %1
%60 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %59, i32 44)
store %struct.sll_node* %60, %struct.sll_node** %1
%61 = load %struct.sll_node*, %struct.sll_node** %1
%62 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %61, i32 22)
store %struct.sll_node* %62, %struct.sll_node** %1
%63 = load %struct.sll_node*, %struct.sll_node** %1
%64 = call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %63, i32 11)
store %struct.sll_node* %64, %struct.sll_node** %1
%65 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%66 = load %struct.sll_node*, %struct.sll_node** %1
%67 = call i32 @sll_print(%struct.sll_node* %66)
%68 = load %struct.sll_node*, %struct.sll_node** %1
%69 = call i32 @sll_palindrome(%struct.sll_node* %68)
store i32 %69, i32* %2
%70 = load i32, i32* %2
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %50
%73 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %76
74: ; preds = %50
%75 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %76
76: ; preds = %74, %72
%77 = load %struct.sll_node*, %struct.sll_node** %1
%78 = call i32 @sll_destroy(%struct.sll_node* %77)
ret void
}

LLVM IR (-O2):
%struct.sll_node = type { i32 }
@.str = [11 x i8] c"ODD SLL : \00"
@.str.3 = [12 x i8] c"EVEN SLL : \00"
@.str.4 = [16 x i8] c"Negative SLL : \00"
@str.6 = [23 x i8] c" SLL is NOT palindrome\00"
@str.9 = [19 x i8] c" SLL is palindrome\00"
define void @main() {
%1 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* null, i32 1)
%2 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %1, i32 2)
%3 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %2, i32 3)
%4 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %3, i32 2)
%5 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %4, i32 1)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @sll_print(%struct.sll_node* %5)
%8 = tail call i32 @sll_palindrome(%struct.sll_node* %5)
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0)
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = tail call i32 @sll_destroy(%struct.sll_node* %5)
%13 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* null, i32 11)
%14 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %13, i32 22)
%15 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %14, i32 33)
%16 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %15, i32 33)
%17 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %16, i32 22)
%18 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %17, i32 11)
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%20 = tail call i32 @sll_print(%struct.sll_node* %18)
%21 = tail call i32 @sll_palindrome(%struct.sll_node* %18)
%22 = icmp eq i32 %21, 0
%23 = select i1 %22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0)
%24 = tail call i32 @puts(i8* dereferenceable(1) %23)
%25 = tail call i32 @sll_destroy(%struct.sll_node* %18)
%26 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* null, i32 11)
%27 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %26, i32 22)
%28 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %27, i32 33)
%29 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %28, i32 44)
%30 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %29, i32 22)
%31 = tail call %struct.sll_node* @sll_add_at_head(%struct.sll_node* %30, i32 11)
%32 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%33 = tail call i32 @sll_print(%struct.sll_node* %31)
%34 = tail call i32 @sll_palindrome(%struct.sll_node* %31)
%35 = icmp eq i32 %34, 0
%36 = select i1 %35, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0)
%37 = tail call i32 @puts(i8* dereferenceable(1) %36)
%38 = tail call i32 @sll_destroy(%struct.sll_node* %31)
ret void
}