// File: /workspace/github_c_makefile_star2_O0/stefpant[P]TCPserver/PantoulasStefanosProject2/trie/trieInsertion.c
// Function: nextWord
int nextWord(char* text,char** word,int start){
	if(text==NULL) return -2;//error
	if(start>strlen(text) || start<=-1) return -2;//error or END
	while(text[start]==' ' || text[start]=='\t') start++;//skip ws
	//now in text[start] starts the word which we return
	if(text[start]=='\0') return -2;//or maybe we reached '\0'
	int temp=start;//if not return the word
	while(text[temp]!=' ' && text[temp]!='\t' && text[temp]!='\0') temp++;
	if((*word = malloc((temp-start+1)*sizeof(char)))==NULL){
		printf("Allocation Error!\n");
		return -3;
	}
	strncpy(*word,text+start,temp-start);
	(*word)[temp-start] = '\0';
	while(text[temp]==' ' || text[temp]=='\t') temp++;//again skip ws
	if(text[temp]=='\0')//if after this word we reached the end
		return -1;
	return temp;//first char to check next time
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2456
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x260d
movslq -0x1c(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1110
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
ja 0x2479
cmpl $-0x1, -0x1c(%rbp)
jg 0x2485
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x260d
jmp 0x2487
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x29(%rbp)
je 0x24b2
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x24bb
jmp 0x24c6
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2487
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x24e3
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x260d
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0x2a(%rbp)
je 0x252a
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x9, %ecx
movb %al, -0x2a(%rbp)
je 0x252a
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %al
testb $0x1, %al
jne 0x2533
jmp 0x253e
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x24e9
movl -0x20(%rbp), %eax
subl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x11e0
movq -0x18(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x257a
leaq 0x5bda(%rip), %rdi      # 0x8141
movb $0x0, %al
callq 0x1120
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x260d
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movslq -0x1c(%rbp), %rax
addq %rax, %rsi
movl -0x20(%rbp), %eax
subl -0x1c(%rbp), %eax
movslq %eax, %rdx
callq 0x1070
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl -0x20(%rbp), %ecx
subl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x2b(%rbp)
je 0x25d9
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x2b(%rbp)
movb -0x2b(%rbp), %al
testb $0x1, %al
jne 0x25e2
jmp 0x25ed
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x25ae
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x2607
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x260d
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)