#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*/ assertTrue(int, char *);
int isEmptyList(struct linkedList *);
int /*<<< orphan*/ printList(struct linkedList *);
int /*<<< orphan*/ printf(char *);
void emptyTest(struct linkedList *lst) {
  printf("\n\nTesting isEmptyList...\n");
  assertTrue(isEmptyList(lst), "Testing the linked list is empty!");
  printf("\nAdd 3 to the linked list...\n");
  addBackList(lst, 3);
  printf("The linked list content should be: [3]\n");
  printf("Call printList function...\n");
  printList(lst);
  assertTrue(!isEmptyList(lst), "\nTesting the linked list is NOT empty!");
}


x86 assembly (clang, -O0):
<emptyTest>:
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   1030 <isEmptyList@plt>
mov    %eax,%edi
lea    0xea0(%rip),%rsi
call   1050 <assertTrue@plt>
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1060 <addBackList@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <printList@plt>
mov    -0x8(%rbp),%rdi
call   1030 <isEmptyList@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
lea    0xec7(%rip),%rsi
call   1050 <assertTrue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emptyTest>:
push   %rbx
mov    %rdi,%rbx
lea    0xeee(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <isEmptyList@plt>
lea    0xe91(%rip),%rsi
mov    %eax,%edi
call   1050 <assertTrue@plt>
lea    0xee5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <addBackList@plt>
lea    0xee9(%rip),%rdi
call   1040 <puts@plt>
lea    0xf04(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1070 <printList@plt>
mov    %rbx,%rdi
call   1030 <isEmptyList@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xe5c(%rip),%rsi
pop    %rbx
jmp    1050 <assertTrue@plt>

LLVM IR (-O0):
%struct.linkedList = type { i32 }
@.str = [26 x i8] c"\0A\0ATesting isEmptyList...\0A\00"
@.str.1 = [34 x i8] c"Testing the linked list is empty!\00"
@.str.2 = [30 x i8] c"\0AAdd 3 to the linked list...\0A\00"
@.str.3 = [40 x i8] c"The linked list content should be: [3]\0A\00"
@.str.4 = [28 x i8] c"Call printList function...\0A\00"
@.str.5 = [39 x i8] c"\0ATesting the linked list is NOT empty!\00"
define void @emptyTest(%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 = load %struct.linkedList*, %struct.linkedList** %2
%5 = call i32 @isEmptyList(%struct.linkedList* %4)
%6 = call i32 @assertTrue(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%8 = load %struct.linkedList*, %struct.linkedList** %2
%9 = call i32 @addBackList(%struct.linkedList* %8, i32 3)
%10 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%12 = load %struct.linkedList*, %struct.linkedList** %2
%13 = call i32 @printList(%struct.linkedList* %12)
%14 = load %struct.linkedList*, %struct.linkedList** %2
%15 = call i32 @isEmptyList(%struct.linkedList* %14)
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = call i32 @assertTrue(i32 %18, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.linkedList = type { i32 }
@.str.1 = [34 x i8] c"Testing the linked list is empty!\00"
@.str.5 = [39 x i8] c"\0ATesting the linked list is NOT empty!\00"
@str = [25 x i8] c"\0A\0ATesting isEmptyList...\00"
@str.6 = [29 x i8] c"\0AAdd 3 to the linked list...\00"
@str.7 = [39 x i8] c"The linked list content should be: [3]\00"
@str.8 = [27 x i8] c"Call printList function...\00"
define void @emptyTest(%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 @isEmptyList(%struct.linkedList* %0)
%4 = tail call i32 @assertTrue(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%6 = tail call i32 @addBackList(%struct.linkedList* %0, i32 3)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.7, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.8, i64 0, i64 0))
%9 = tail call i32 @printList(%struct.linkedList* %0)
%10 = tail call i32 @isEmptyList(%struct.linkedList* %0)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = tail call i32 @assertTrue(i32 %12, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
ret void
}