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

/* Variables and functions */
int /*<<< orphan*/ assertTrue(int, char *);
int backList(struct linkedList *);
int /*<<< orphan*/ printList(struct linkedList *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ removeBackList(struct linkedList *);
void backListTest(struct linkedList *lst) {
  printf("\nTesting backList...\nCalling backList(lst)\n");
  assertTrue(((backList(lst)) == (9)), "Testing the last link value == 9");
  printf("\nCall RemoveBackList Function\n");
  removeBackList(lst);
  printf("The list content should be: [3->2->5->7->1]\n");
  printList(lst);
  printf("\nCalling backList(lst)\n");
  assertTrue(((backList(lst)) == (1)), "Testing the last link value == 1");
  printf("\nCall RemoveBackList Function\n");
  removeBackList(lst);
  printf("The list content should be: [3->2->5->7]\n");
  printList(lst);
  printf("\nCalling backList(lst)\n");
  assertTrue(((backList(lst)) == (7)), "Testing the last link value == 7");
  printf("\nCall RemoveBackList Function\n");
  removeBackList(lst);
  printf("The list content should be: [3->2->5]\n");
  printList(lst);
  printf("\nCalling backList(lst)\n");
  assertTrue(((backList(lst)) == (5)), "Testing the last link value == 5");
  printf("\nCall RemoveBackList Function\n");
  removeBackList(lst);
  printf("The list content should be: [3->2]\n");
  printList(lst);
  printf("\nCalling backList(lst)\n");
  assertTrue(((backList(lst)) == (2)), "Testing the last link value == 2");
}


x86 assembly (clang, -O0):
<backListTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <backList@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xea9(%rip),%rsi
call   1050 <assertTrue@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <removeBackList@plt>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <printList@plt>
lea    0xe5b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <backList@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
call   1050 <assertTrue@plt>
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <removeBackList@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <printList@plt>
lea    0xe05(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <backList@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeb5(%rip),%rsi
call   1050 <assertTrue@plt>
lea    0xe12(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <removeBackList@plt>
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <printList@plt>
lea    0xdaf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <backList@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xea7(%rip),%rsi
call   1050 <assertTrue@plt>
lea    0xdbc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <removeBackList@plt>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <printList@plt>
lea    0xd59(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <backList@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe96(%rip),%rsi
call   1050 <assertTrue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backListTest>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xf46(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <backList@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xe84(%rip),%rsi
call   1050 <assertTrue@plt>
lea    0xfc3(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <removeBackList@plt>
lea    0xf31(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1070 <printList@plt>
lea    0xf06(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <backList@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
lea    0xe4e(%rip),%rsi
call   1050 <assertTrue@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <removeBackList@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1070 <printList@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <backList@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
lea    0xe26(%rip),%rsi
call   1050 <assertTrue@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <removeBackList@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1070 <printList@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <backList@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
lea    0xdfe(%rip),%rsi
call   1050 <assertTrue@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <removeBackList@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1070 <printList@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <backList@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
lea    0xdd6(%rip),%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <assertTrue@plt>

LLVM IR (-O0):
%struct.linkedList = type { i32 }
@.str = [44 x i8] c"\0ATesting backList...\0ACalling backList(lst)\0A\00"
@.str.1 = [33 x i8] c"Testing the last link value == 9\00"
@.str.2 = [31 x i8] c"\0ACall RemoveBackList Function\0A\00"
@.str.3 = [45 x i8] c"The list content should be: [3->2->5->7->1]\0A\00"
@.str.4 = [24 x i8] c"\0ACalling backList(lst)\0A\00"
@.str.5 = [33 x i8] c"Testing the last link value == 1\00"
@.str.6 = [42 x i8] c"The list content should be: [3->2->5->7]\0A\00"
@.str.7 = [33 x i8] c"Testing the last link value == 7\00"
@.str.8 = [39 x i8] c"The list content should be: [3->2->5]\0A\00"
@.str.9 = [33 x i8] c"Testing the last link value == 5\00"
@.str.10 = [36 x i8] c"The list content should be: [3->2]\0A\00"
@.str.11 = [33 x i8] c"Testing the last link value == 2\00"
define void @backListTest(%struct.linkedList* %0) {
%2 = alloca %struct.linkedList*
store %struct.linkedList* %0, %struct.linkedList** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.linkedList*, %struct.linkedList** %2
%5 = call i32 @backList(%struct.linkedList* %4)
%6 = icmp eq i32 %5, 9
%7 = zext i1 %6 to i32
%8 = call i32 @assertTrue(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%10 = load %struct.linkedList*, %struct.linkedList** %2
%11 = call i32 @removeBackList(%struct.linkedList* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%13 = load %struct.linkedList*, %struct.linkedList** %2
%14 = call i32 @printList(%struct.linkedList* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%16 = load %struct.linkedList*, %struct.linkedList** %2
%17 = call i32 @backList(%struct.linkedList* %16)
%18 = icmp eq i32 %17, 1
%19 = zext i1 %18 to i32
%20 = call i32 @assertTrue(i32 %19, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%22 = load %struct.linkedList*, %struct.linkedList** %2
%23 = call i32 @removeBackList(%struct.linkedList* %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0))
%25 = load %struct.linkedList*, %struct.linkedList** %2
%26 = call i32 @printList(%struct.linkedList* %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%28 = load %struct.linkedList*, %struct.linkedList** %2
%29 = call i32 @backList(%struct.linkedList* %28)
%30 = icmp eq i32 %29, 7
%31 = zext i1 %30 to i32
%32 = call i32 @assertTrue(i32 %31, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%33 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%34 = load %struct.linkedList*, %struct.linkedList** %2
%35 = call i32 @removeBackList(%struct.linkedList* %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0))
%37 = load %struct.linkedList*, %struct.linkedList** %2
%38 = call i32 @printList(%struct.linkedList* %37)
%39 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%40 = load %struct.linkedList*, %struct.linkedList** %2
%41 = call i32 @backList(%struct.linkedList* %40)
%42 = icmp eq i32 %41, 5
%43 = zext i1 %42 to i32
%44 = call i32 @assertTrue(i32 %43, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%45 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%46 = load %struct.linkedList*, %struct.linkedList** %2
%47 = call i32 @removeBackList(%struct.linkedList* %46)
%48 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0))
%49 = load %struct.linkedList*, %struct.linkedList** %2
%50 = call i32 @printList(%struct.linkedList* %49)
%51 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%52 = load %struct.linkedList*, %struct.linkedList** %2
%53 = call i32 @backList(%struct.linkedList* %52)
%54 = icmp eq i32 %53, 2
%55 = zext i1 %54 to i32
%56 = call i32 @assertTrue(i32 %55, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.linkedList = type { i32 }
@.str.1 = [33 x i8] c"Testing the last link value == 9\00"
@.str.5 = [33 x i8] c"Testing the last link value == 1\00"
@.str.7 = [33 x i8] c"Testing the last link value == 7\00"
@.str.9 = [33 x i8] c"Testing the last link value == 5\00"
@.str.11 = [33 x i8] c"Testing the last link value == 2\00"
@str = [43 x i8] c"\0ATesting backList...\0ACalling backList(lst)\00"
@str.13 = [44 x i8] c"The list content should be: [3->2->5->7->1]\00"
@str.16 = [41 x i8] c"The list content should be: [3->2->5->7]\00"
@str.19 = [38 x i8] c"The list content should be: [3->2->5]\00"
@str.21 = [30 x i8] c"\0ACall RemoveBackList Function\00"
@str.22 = [35 x i8] c"The list content should be: [3->2]\00"
@str.23 = [23 x i8] c"\0ACalling backList(lst)\00"
define void @backListTest(%struct.linkedList* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @backList(%struct.linkedList* %0)
%4 = icmp eq i32 %3, 9
%5 = zext i1 %4 to i32
%6 = tail call i32 @assertTrue(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.21, i64 0, i64 0))
%8 = tail call i32 @removeBackList(%struct.linkedList* %0)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.13, i64 0, i64 0))
%10 = tail call i32 @printList(%struct.linkedList* %0)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.23, i64 0, i64 0))
%12 = tail call i32 @backList(%struct.linkedList* %0)
%13 = icmp eq i32 %12, 1
%14 = zext i1 %13 to i32
%15 = tail call i32 @assertTrue(i32 %14, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.21, i64 0, i64 0))
%17 = tail call i32 @removeBackList(%struct.linkedList* %0)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.16, i64 0, i64 0))
%19 = tail call i32 @printList(%struct.linkedList* %0)
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.23, i64 0, i64 0))
%21 = tail call i32 @backList(%struct.linkedList* %0)
%22 = icmp eq i32 %21, 7
%23 = zext i1 %22 to i32
%24 = tail call i32 @assertTrue(i32 %23, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.21, i64 0, i64 0))
%26 = tail call i32 @removeBackList(%struct.linkedList* %0)
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.19, i64 0, i64 0))
%28 = tail call i32 @printList(%struct.linkedList* %0)
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.23, i64 0, i64 0))
%30 = tail call i32 @backList(%struct.linkedList* %0)
%31 = icmp eq i32 %30, 5
%32 = zext i1 %31 to i32
%33 = tail call i32 @assertTrue(i32 %32, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.21, i64 0, i64 0))
%35 = tail call i32 @removeBackList(%struct.linkedList* %0)
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.22, i64 0, i64 0))
%37 = tail call i32 @printList(%struct.linkedList* %0)
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.23, i64 0, i64 0))
%39 = tail call i32 @backList(%struct.linkedList* %0)
%40 = icmp eq i32 %39, 2
%41 = zext i1 %40 to i32
%42 = tail call i32 @assertTrue(i32 %41, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
ret void
}