// File: stacksmith[P]picoasm/cassembler.cpp
// Function: CAssembler::getWord(char*, char*)
char * CAssembler::getWord( char *s, char *word ) {
	char *start, *end ;
	
	*word = '\0' ;
	
	while ( *s == ' ' || *s == '\t' )							// skip whitespaces
		s++ ;
	
	start = s ;
	
	if ( *start == '\0' || *start == '\r' || *start == '\n' || *start == ';' )	// end of line
		return NULL ;
		
	while ( *s != ' ' && *s != '\t' && *s != '\0' && *s != '\r' && *s != '\n' && 
	        *s != ';'  && *s != ',' && *s != ':' && *s != '(' && *s != ')' )
		s++ ;
	
	end = s ;
	
	if ( start != end ) {
		while ( start < end )
			*word++ = *start++ ;
		*word = '\0' ;
		return end ;
	} else if ( *s == ',' || *s == ':' || *s == '(' || *s == ')' ) {
		*word++ = *s ;
		*word = '\0' ;
		return end + 1 ;
	} else
		return NULL ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x31(%rbp)
je 0x409f08
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x409f11
jmp 0x409f1f
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x409ee7
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x409f57
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
je 0x409f57
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
je 0x409f57
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0x409f64
movq $0x0, -0x8(%rbp)
jmp 0x40a0e8
jmp 0x409f66
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0x32(%rbp)
je 0x40a017
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x9, %ecx
movb %al, -0x32(%rbp)
je 0x40a017
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x32(%rbp)
je 0x40a017
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0xd, %ecx
movb %al, -0x32(%rbp)
je 0x40a017
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, -0x32(%rbp)
je 0x40a017
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x3b, %ecx
movb %al, -0x32(%rbp)
je 0x40a017
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x2c, %ecx
movb %al, -0x32(%rbp)
je 0x40a017
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x3a, %ecx
movb %al, -0x32(%rbp)
je 0x40a017
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x28, %ecx
movb %al, -0x32(%rbp)
je 0x40a017
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
setne %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0x40a020
jmp 0x40a031
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x409f66
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x40a084
jmp 0x40a045
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x40a073
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb (%rax), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
jmp 0x40a045
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x40a0e8
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
je 0x40a0b4
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
je 0x40a0b4
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
je 0x40a0b4
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
jne 0x40a0e0
movq -0x18(%rbp), %rax
movb (%rax), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x40a0e8
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop