// File: /workspace/github_c_makefile_star2_O1/DVaronos[P]AnLogProject1/list.c
// Function: AppendCList
CList* AppendCList(CList* L ,CList* N){
	CList* T=L;
	CList* Head;
	Head=N; //To head einai h kefali ths listas N

	int ncount = N->camera_count;
	L->camera_count += ncount; 	//enhmerwnoume to count

	N=N->Next; //O diktis N pleon dixnei ston porto komvo me dedomena ths listas N kai oxi stin kefali ths

	if(Head->Diffrend!=NULL){ //	Oles oi klikes pou htan diaforetikes ap to head twra tha einai diaforetikes me thn L
		TList* Temp=Head->Diffrend;
		while(Temp->Next!=NULL){	//Gia kathe klika diaforetikh ths Head
			Temp=Temp->Next;
			if(L->Diffrend==NULL) L->Diffrend=CreateTList();	//Ean h L den exei Diffrend List dimiourgei
			if(FindTList(L->Diffrend,Temp->node)){	//Ean h paron CList pou einai diaforetikh me thn Head den einai diaforetikh ths L
				InsertTList(L->Diffrend,Temp->node);	//Vale thn stis diaforetikes ths L
				ReplaceTList(Temp->node->Diffrend,Head,L);	//Sthn Diffrend list ths parousas CList antikatestise thn Head me thn L
			}else{	//Ean h paron CList pou einai diaforetikh me thn Head einai diaforetikh ths L diegrapse apo thn Diffrend ths thn  Head
				RemoveTList(Temp->node->Diffrend,Head);
			}
		}
		FreeTList(Head->Diffrend);
	}

	Head->Next=NULL;
	free(Head);	//Apodesmevo thn kefali ths listas N
	while(L->Next!=NULL){//Pigene ston telefteo komvo ths listas L
		L=L->Next;
	}
	L->Next=N;//Valethn lista N sto telos ths listas L
	while(L->Next!=NULL){//O diktis tou komvou pou einai apothikevmeno to kathe neo product na deixnei se afthn thn klika(diladi thn lista L)
		L=L->Next;
		L->Head->clique=T;
	}
	return T;//Epestrepse thn L
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x20(%rsi), %eax
addl %eax, 0x20(%rdi)
movq 0x10(%rsi), %rax
movq 0x18(%rsi), %r15
testq %rax, %rax
je 0x3497
movq 0x8(%rax), %r12
testq %r12, %r12
je 0x348e
movq %rbx, -0x30(%rbp)
cmpq $0x0, 0x10(%rbx)
jne 0x33fd
movl $0x10, %edi
callq 0x11a0
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x10(%rbx)
movq 0x10(%rbx), %r13
movq (%r12), %rbx
testq %r13, %r13
je 0x344a
movq %r13, %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x344a
cmpq %rbx, (%rax)
jne 0x340d
movq 0x10(%rbx), %rdi
movq -0x30(%rbp), %rbx
movq %rdi, %rax
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3480
cmpq %r14, (%rdi)
jne 0x3423
movq 0x8(%rdi), %rcx
movq %rcx, 0x8(%rax)
movq $0x0, (%rdi)
callq 0x1030
jmp 0x3480
movl $0x10, %edi
callq 0x11a0
movq %rbx, (%rax)
movq 0x8(%r13), %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x8(%r13)
movq (%r12), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rbx
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x3480
cmpq %r14, (%rax)
jne 0x346f
movq %rbx, (%rax)
movq 0x8(%r12), %r12
testq %r12, %r12
jne 0x33e2
movq 0x10(%r14), %rdi
callq 0x3522
movq $0x0, 0x18(%r14)
movq %r14, %rdi
callq 0x1030
movq %rbx, %rcx
movq %rcx, %rax
movq 0x18(%rcx), %rcx
testq %rcx, %rcx
jne 0x34aa
movq %r15, 0x18(%rax)
testq %r15, %r15
je 0x34cd
movq 0x8(%r15), %rax
movq %rbx, 0x10(%rax)
movq 0x18(%r15), %r15
jmp 0x34ba
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq