// File: /workspace/github_c_makefile_star2_O0/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/PCOptions.c
// Function: searchWordInTrie
nc_pair* searchWordInTrie(node* trie,char* word,int sorted,int max){//for min/maxcount
	int i=0;//character's index
	char c = word[i];
	node* temp=trie;
	int flag=1;
	//flag:if temp->next==NULL then create new next

	nc_pair* p = malloc(sizeof(nc_pair));
	p->name = NULL;//means word not exists
	p->counter = -1;

	while(1){//for all word's chars(has at least 1 char)
		while(1){//for all childs in temp's list(temp -> next -> next -> ...)
			if(c==getValue(temp)){
				flag=0;
				break;//check next char
			}
			else if((c<getValue(temp))&&sorted) break;
			if(getNext(temp)==NULL) return p;//word doesn't exists in trie :(
			temp = getNext(temp);//search until c found in trie
		}//or we reached the end of temp's list
		if(flag)//c not found in trie...exiting
			return p;

		//now temp has the 'c' value so we check its child
		if((c=word[++i])=='\0'){
			if(max)
				getMaxCounterEPL(temp,&(p->name),&(p->counter));
			else
				getMinCounterEPL(temp,&(p->name),&(p->counter));
			return p;
		}
		if(getChild(temp)==NULL) return p;//word not found
		temp=getChild(temp);//else continue with child
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x25(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
movl $0x10, %edi
callq 0x11e0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq $0x0, (%rax)
movq -0x40(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
jmp 0x71b0
movsbl -0x25(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x30(%rbp), %rdi
callq 0x21c0
movb %al, %cl
movl -0x44(%rbp), %eax
movsbl %cl, %ecx
cmpl %ecx, %eax
jne 0x71d5
movl $0x0, -0x34(%rbp)
jmp 0x7226
movsbl -0x25(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
callq 0x21c0
movb %al, %cl
movl -0x48(%rbp), %eax
movsbl %cl, %ecx
cmpl %ecx, %eax
jge 0x71f9
cmpl $0x0, -0x1c(%rbp)
je 0x71f9
jmp 0x7226
jmp 0x71fb
movq -0x30(%rbp), %rdi
callq 0x21f0
cmpq $0x0, %rax
jne 0x7217
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x72be
movq -0x30(%rbp), %rdi
callq 0x21f0
movq %rax, -0x30(%rbp)
jmp 0x71b0
cmpl $0x0, -0x34(%rbp)
je 0x7239
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x72be
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x25(%rbp)
movsbl %al, %eax
cmpl $0x0, %eax
jne 0x7293
cmpl $0x0, -0x20(%rbp)
je 0x7274
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq $0x8, %rdx
callq 0x2250
jmp 0x7289
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq $0x8, %rdx
callq 0x22a0
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x72be
movq -0x30(%rbp), %rdi
callq 0x2230
cmpq $0x0, %rax
jne 0x72ac
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x72be
movq -0x30(%rbp), %rdi
callq 0x2230
movq %rax, -0x30(%rbp)
jmp 0x71ae
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)