#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*/ addFrontList(struct linkedList *, int);
int /*<<< orphan*/ printList(struct linkedList *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ removeBackList(struct linkedList *);
void removeBackListTest(struct linkedList *lst) {
  printf("\n\nTesting removeBackList...\n");
  printf("Add 3 to the front of the list...\n");
  addFrontList(lst, 3);
  printf("Add 4 to the front of the list...\n");
  addFrontList(lst, 4);
  printf("Add 10 to the front of the list...\n");
  addFrontList(lst, 10);
  printf("The list content should be: [10<=>4<=>3]\n");
  printf("Call printList function...\n");
  printList(lst);
  printf("\n\nCalling removeBackList(lst)\n");
  removeBackList(lst);
  printf("The list content should be: [10<=>4]\n");
  printf("Call printList function...\n");
  printList(lst);
  printf("\n\nCalling removeBackList(lst)\n");
  removeBackList(lst);
  printf("The list content should be: [10]\n");
  printf("Call printList function...\n");
  printList(lst);
  printf("\n\nCalling removeBackList(lst)\n");
  removeBackList(lst);
  printf("The list content should be empty!\n");
  printf("Call printList function...\n");
  printList(lst);
}


x86 assembly (clang, -O0):
<removeBackListTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1050 <addFrontList@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1050 <addFrontList@plt>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1050 <addFrontList@plt>
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
lea    0xef8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <printList@plt>
lea    0xeff(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <removeBackList@plt>
lea    0xf09(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <printList@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <removeBackList@plt>
lea    0xef9(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <printList@plt>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <removeBackList@plt>
lea    0xee5(%rip),%rdi
call   1040 <printf@plt>
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <printList@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeBackListTest>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <addFrontList@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <addFrontList@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <addFrontList@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf80(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <printList@plt>
lea    0xf29(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <removeBackList@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <printList@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <removeBackList@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <printList@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <removeBackList@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <printList@plt>

LLVM IR (-O0):
%struct.linkedList = type { i32 }
@.str = [29 x i8] c"\0A\0ATesting removeBackList...\0A\00"
@.str.1 = [35 x i8] c"Add 3 to the front of the list...\0A\00"
@.str.2 = [35 x i8] c"Add 4 to the front of the list...\0A\00"
@.str.3 = [36 x i8] c"Add 10 to the front of the list...\0A\00"
@.str.4 = [42 x i8] c"The list content should be: [10<=>4<=>3]\0A\00"
@.str.5 = [28 x i8] c"Call printList function...\0A\00"
@.str.6 = [31 x i8] c"\0A\0ACalling removeBackList(lst)\0A\00"
@.str.7 = [38 x i8] c"The list content should be: [10<=>4]\0A\00"
@.str.8 = [34 x i8] c"The list content should be: [10]\0A\00"
@.str.9 = [35 x i8] c"The list content should be empty!\0A\00"
define void @removeBackListTest(%struct.linkedList* %0) {
%2 = alloca %struct.linkedList*
store %struct.linkedList* %0, %struct.linkedList** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%5 = load %struct.linkedList*, %struct.linkedList** %2
%6 = call i32 @addFrontList(%struct.linkedList* %5, i32 3)
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%8 = load %struct.linkedList*, %struct.linkedList** %2
%9 = call i32 @addFrontList(%struct.linkedList* %8, i32 4)
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%11 = load %struct.linkedList*, %struct.linkedList** %2
%12 = call i32 @addFrontList(%struct.linkedList* %11, i32 10)
%13 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%15 = load %struct.linkedList*, %struct.linkedList** %2
%16 = call i32 @printList(%struct.linkedList* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%18 = load %struct.linkedList*, %struct.linkedList** %2
%19 = call i32 @removeBackList(%struct.linkedList* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%22 = load %struct.linkedList*, %struct.linkedList** %2
%23 = call i32 @printList(%struct.linkedList* %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%25 = load %struct.linkedList*, %struct.linkedList** %2
%26 = call i32 @removeBackList(%struct.linkedList* %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
%28 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%29 = load %struct.linkedList*, %struct.linkedList** %2
%30 = call i32 @printList(%struct.linkedList* %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%32 = load %struct.linkedList*, %struct.linkedList** %2
%33 = call i32 @removeBackList(%struct.linkedList* %32)
%34 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0))
%35 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%36 = load %struct.linkedList*, %struct.linkedList** %2
%37 = call i32 @printList(%struct.linkedList* %36)
ret void
}

LLVM IR (-O2):
%struct.linkedList = type { i32 }
@str = [28 x i8] c"\0A\0ATesting removeBackList...\00"
@str.10 = [34 x i8] c"Add 3 to the front of the list...\00"
@str.11 = [34 x i8] c"Add 4 to the front of the list...\00"
@str.12 = [35 x i8] c"Add 10 to the front of the list...\00"
@str.13 = [41 x i8] c"The list content should be: [10<=>4<=>3]\00"
@str.16 = [37 x i8] c"The list content should be: [10<=>4]\00"
@str.19 = [33 x i8] c"The list content should be: [10]\00"
@str.21 = [30 x i8] c"\0A\0ACalling removeBackList(lst)\00"
@str.22 = [34 x i8] c"The list content should be empty!\00"
@str.23 = [27 x i8] c"Call printList function...\00"
define void @removeBackListTest(%struct.linkedList* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.10, i64 0, i64 0))
%4 = tail call i32 @addFrontList(%struct.linkedList* %0, i32 3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.11, i64 0, i64 0))
%6 = tail call i32 @addFrontList(%struct.linkedList* %0, i32 4)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.12, i64 0, i64 0))
%8 = tail call i32 @addFrontList(%struct.linkedList* %0, i32 10)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.13, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.23, i64 0, i64 0))
%11 = tail call i32 @printList(%struct.linkedList* %0)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.21, i64 0, i64 0))
%13 = tail call i32 @removeBackList(%struct.linkedList* %0)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.16, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.23, i64 0, i64 0))
%16 = tail call i32 @printList(%struct.linkedList* %0)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.21, i64 0, i64 0))
%18 = tail call i32 @removeBackList(%struct.linkedList* %0)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.19, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.23, i64 0, i64 0))
%21 = tail call i32 @printList(%struct.linkedList* %0)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.21, i64 0, i64 0))
%23 = tail call i32 @removeBackList(%struct.linkedList* %0)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.22, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.23, i64 0, i64 0))
%26 = tail call i32 @printList(%struct.linkedList* %0)
ret void
}