#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*/ addBackList(struct linkedList *, int);
int /*<<< orphan*/ printList(struct linkedList *);
int /*<<< orphan*/ printf(char *);
void addBackListTest(struct linkedList *lst) {
  printf("\n\nTesting addBackList...\n");
  printf("Add 2 to the back of the list...\n");
  addBackList(lst, 2);
  printf("Add 5 to the back of the list...\n");
  addBackList(lst, 5);
  printf("Add 7 to the back of the list...\n");
  addBackList(lst, 7);
  printf("Add 1 to the back of the list...\n");
  addBackList(lst, 1);
  printf("Add 9 to the back of the list...\n");
  addBackList(lst, 9);
  printf(
      "The list content should be: [6<=>5<=>10<=>4<=>3<=>2<=>5<=>7<=>1<=>9]\n");
  printf("Call printList function...\n");
  printList(lst);
}


x86 assembly (clang, -O0):
<addBackListTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <addBackList@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
call   1040 <addBackList@plt>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
call   1040 <addBackList@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <addBackList@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x9,%esi
call   1040 <addBackList@plt>
lea    0xef3(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <printList@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addBackListTest>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <addBackList@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <addBackList@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <addBackList@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <addBackList@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <addBackList@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf33(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <printList@plt>

LLVM IR (-O0):
%struct.linkedList = type { i32 }
@.str = [26 x i8] c"\0A\0ATesting addBackList...\0A\00"
@.str.1 = [34 x i8] c"Add 2 to the back of the list...\0A\00"
@.str.2 = [34 x i8] c"Add 5 to the back of the list...\0A\00"
@.str.3 = [34 x i8] c"Add 7 to the back of the list...\0A\00"
@.str.4 = [34 x i8] c"Add 1 to the back of the list...\0A\00"
@.str.5 = [34 x i8] c"Add 9 to the back of the list...\0A\00"
@.str.6 = [70 x i8] c"The list content should be: [6<=>5<=>10<=>4<=>3<=>2<=>5<=>7<=>1<=>9]\0A\00"
@.str.7 = [28 x i8] c"Call printList function...\0A\00"
define void @addBackListTest(%struct.linkedList* %0) {
%2 = alloca %struct.linkedList*
store %struct.linkedList* %0, %struct.linkedList** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%5 = load %struct.linkedList*, %struct.linkedList** %2
%6 = call i32 @addBackList(%struct.linkedList* %5, i32 2)
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%8 = load %struct.linkedList*, %struct.linkedList** %2
%9 = call i32 @addBackList(%struct.linkedList* %8, i32 5)
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%11 = load %struct.linkedList*, %struct.linkedList** %2
%12 = call i32 @addBackList(%struct.linkedList* %11, i32 7)
%13 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%14 = load %struct.linkedList*, %struct.linkedList** %2
%15 = call i32 @addBackList(%struct.linkedList* %14, i32 1)
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%17 = load %struct.linkedList*, %struct.linkedList** %2
%18 = call i32 @addBackList(%struct.linkedList* %17, i32 9)
%19 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.6, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%21 = load %struct.linkedList*, %struct.linkedList** %2
%22 = call i32 @printList(%struct.linkedList* %21)
ret void
}

LLVM IR (-O2):
%struct.linkedList = type { i32 }
@str = [25 x i8] c"\0A\0ATesting addBackList...\00"
@str.8 = [33 x i8] c"Add 2 to the back of the list...\00"
@str.9 = [33 x i8] c"Add 5 to the back of the list...\00"
@str.10 = [33 x i8] c"Add 7 to the back of the list...\00"
@str.11 = [33 x i8] c"Add 1 to the back of the list...\00"
@str.12 = [33 x i8] c"Add 9 to the back of the list...\00"
@str.13 = [69 x i8] c"The list content should be: [6<=>5<=>10<=>4<=>3<=>2<=>5<=>7<=>1<=>9]\00"
@str.14 = [27 x i8] c"Call printList function...\00"
define void @addBackListTest(%struct.linkedList* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.8, i64 0, i64 0))
%4 = tail call i32 @addBackList(%struct.linkedList* %0, i32 2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.9, i64 0, i64 0))
%6 = tail call i32 @addBackList(%struct.linkedList* %0, i32 5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.10, i64 0, i64 0))
%8 = tail call i32 @addBackList(%struct.linkedList* %0, i32 7)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.11, i64 0, i64 0))
%10 = tail call i32 @addBackList(%struct.linkedList* %0, i32 1)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.12, i64 0, i64 0))
%12 = tail call i32 @addBackList(%struct.linkedList* %0, i32 9)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str.13, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.14, i64 0, i64 0))
%15 = tail call i32 @printList(%struct.linkedList* %0)
ret void
}