// File: /workspace/github_c_makefile_star2_O0/bobrippling[P]tim/motion.c
// Function: m_word1
static int m_word1(
		const buffer_t *buf, const int dir,
		const bool end, const bool big_words,
		point_t *to)
{
	list_t *l = list_seek(buf->head, to->y, false);

	enum word_state st = word_state(l, to->x, big_words);
	bool find_word = true;

	if(st & (W_KEYWORD | W_NON_KWORD)){
		/* we're on a word - if we're an end motion and not at the end,
		 * just need to move to the end */
		if(end == (dir > 0)){
			if(word_state(l, to->x + dir, big_words) != st){
				/* at the end - next */
			}else{
				/* seek to end and we're done */
				word_seek_to_end(l, dir, to, big_words);
				return MOTION_SUCCESS;
			}
		}

		/* skip to space or other word type */
		enum word_state other_word = ((W_KEYWORD | W_NON_KWORD) & ~st);

		l = word_seek(l, dir, to, W_SPACE | other_word, big_words);

		/* if we're on another word type, we're done */
		if(word_state(l, to->x, big_words) & other_word)
			find_word = false;
		else if(!l || !l->len_line)
			find_word = false; /* onto a new and empty - stop */
		/* else space - need to find the next word */

	}else{
		/* on space or none, go to next word */
	}

	if(find_word){
		l = word_seek(l, dir, to, W_KEYWORD | W_NON_KWORD, big_words);
		if(!l)
			return MOTION_FAILURE;
	}

	if(end == (dir > 0))
		word_seek_to_end(l, dir, to, big_words);

	return MOTION_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
andb $0x1, %cl
movb %cl, -0x15(%rbp)
andb $0x1, %al
movb %al, -0x16(%rbp)
movq %r8, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x4(%rax), %esi
xorl %edx, %edx
callq 0xcd50
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %esi
movb -0x16(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x12a20
movl %eax, -0x2c(%rbp)
movb $0x1, -0x2d(%rbp)
movl -0x2c(%rbp), %eax
andl $0x6, %eax
cmpl $0x0, %eax
je 0xf877
movb -0x15(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, -0x14(%rbp)
setg %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0xf809
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %esi
addl -0x14(%rbp), %esi
movb -0x16(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x12a20
cmpl -0x2c(%rbp), %eax
je 0xf7e3
jmp 0xf807
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movb -0x16(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x12b80
movl $0x1, -0x4(%rbp)
jmp 0xf8eb
jmp 0xf809
movl -0x2c(%rbp), %eax
xorl $-0x1, %eax
andl $0x6, %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x34(%rbp), %ecx
orl $0x1, %ecx
movb -0x16(%rbp), %al
andb $0x1, %al
movzbl %al, %r8d
callq 0x12af0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %esi
movb -0x16(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x12a20
andl -0x34(%rbp), %eax
cmpl $0x0, %eax
je 0xf85d
movb $0x0, -0x2d(%rbp)
jmp 0xf875
cmpq $0x0, -0x28(%rbp)
je 0xf86f
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xf873
movb $0x0, -0x2d(%rbp)
jmp 0xf875
jmp 0xf879
jmp 0xf879
testb $0x1, -0x2d(%rbp)
je 0xf8b3
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movb -0x16(%rbp), %al
movl $0x6, %ecx
andb $0x1, %al
movzbl %al, %r8d
callq 0x12af0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xf8b1
movl $0x0, -0x4(%rbp)
jmp 0xf8eb
jmp 0xf8b3
movb -0x15(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, -0x14(%rbp)
setg %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0xf8e4
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movb -0x16(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x12b80
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)