// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_vim.c
// Function: ce_vim_move_little_word
CePoint_t ce_vim_move_little_word(CeBuffer_t* buffer, CePoint_t start){
     if(!ce_buffer_point_is_valid(buffer, start)) return (CePoint_t){-1, -1};

     char* itr = ce_utf8_iterate_to(buffer->lines[start.y], start.x);

     int64_t rune_len = 0;
     CeRune_t rune = ce_utf8_decode(itr, &rune_len);
     WordState_t state = WORD_INSIDE_OTHER;

     if(is_little_word_character(rune)){
          state = WORD_INSIDE_WORD;
     }else if(isspace(rune)){
          state = WORD_INSIDE_SPACE;
     }

     itr += rune_len;
     start.x++;

     if(*itr == 0){
          if(start.y >= buffer->line_count - 1){
               start.x--;
               return start;
          }
          start.x = 0;
          start.y++;
          itr = buffer->lines[start.y];
          state = WORD_NEW_LINE;
     }

     while(true){
          rune = ce_utf8_decode(itr, &rune_len);

          switch(state){
          default:
               assert(0);
               break;
          case WORD_INSIDE_WORD:
               if(isspace(rune)) state = WORD_INSIDE_SPACE;
               else if(!is_little_word_character(rune)) goto END_LOOP;
               break;
          case WORD_INSIDE_SPACE:
               if(is_little_word_character(rune) || !isspace(rune)) goto END_LOOP;
               break;
          case WORD_INSIDE_OTHER:
               if(isspace(rune)) state = WORD_INSIDE_SPACE;
               else if(is_little_word_character(rune)) goto END_LOOP;
               break;
          case WORD_NEW_LINE:
               if(isspace(rune)) state = WORD_INSIDE_SPACE;
               else goto END_LOOP;
               break;
          }

          if(*itr == 0){
               if(start.y >= buffer->line_count - 1) break;
               start.x = 0;
               start.y++;
               itr = buffer->lines[start.y];
               state = WORD_NEW_LINE;
          }else{
               itr += rune_len;
               start.x++;
          }
     }

END_LOOP:

     return start;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rbp
callq 0xe4d4
testq %rax, %rax
je 0x260c0
movq (%rbp), %rax
movq (%rax,%rbx,8), %rdi
movq %r14, %rsi
callq 0xe577
movq %rax, %r13
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
movq %rax, %rdi
callq 0xe602
movl %eax, %r15d
callq 0xd720
movq %rax, %r12
movq (%rax), %rax
movslq %r15d, %rcx
movzwl (%rax,%rcx,2), %eax
btl $0xd, %eax
movq %rbx, %rsi
movl $0x1, %ebx
sbbl $-0x1, %ebx
xorl %edx, %edx
testb $0x8, %al
cmovnel %edx, %ebx
cmpl $0x5f, %ecx
cmovel %edx, %ebx
leaq 0x8(%rsp), %rax
movq (%rax), %rax
cmpb $0x0, (%r13,%rax)
movq %rbp, 0x10(%rsp)
je 0x260d3
movq %rsi, (%rsp)
addq %rax, %r13
incq %r14
jmp 0x260fe
movq $-0x1, %r14
movq $-0x1, %rdx
jmp 0x261d3
movq 0x8(%rbp), %rax
decq %rax
cmpq %rsi, %rax
movq %rsi, %rdx
jle 0x261d3
movq (%rbp), %rax
movq 0x8(%rax,%rdx,8), %r13
incq %rdx
movq %rdx, (%rsp)
movl $0x3, %ebx
xorl %r14d, %r14d
leaq 0x8(%rsp), %rbp
leaq 0xa136(%rip), %r15      # 0x30240
movq %r13, %rdi
movq %rbp, %rsi
callq 0xe602
movq (%r12), %rcx
movslq %eax, %rdx
movzwl (%rcx,%rdx,2), %ecx
movl %ebx, %edx
movslq (%r15,%rdx,4), %rdx
addq %r15, %rdx
jmpq *%rdx
movl $0x1, %ebx
btl $0xd, %ecx
jb 0x2618a
xorl %ebx, %ebx
cmpl $0x5f, %eax
je 0x2618a
andl $0x8, %ecx
jne 0x2618a
jmp 0x261cf
movl $0x1, %ebx
btl $0xd, %ecx
jb 0x2618a
cmpl $0x5f, %eax
je 0x261cf
movl $0x2, %ebx
andl $0x8, %ecx
je 0x2618a
jmp 0x261cf
movl $0x1, %ebx
btl $0xd, %ecx
jb 0x2618a
jmp 0x261cf
cmpl $0x5f, %eax
je 0x261cf
andl $0x2008, %ecx           # imm = 0x2008
movl $0x1, %ebx
movzwl %cx, %eax
cmpl $0x2000, %eax           # imm = 0x2000
jne 0x261cf
cmpb $0x0, (%r13)
je 0x2619e
addq 0x8(%rsp), %r13
incq %r14
jmp 0x2610a
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rax
decq %rax
movq (%rsp), %rdx
cmpq %rax, %rdx
jge 0x261d3
movq (%rcx), %rax
movq 0x8(%rax,%rdx,8), %r13
incq %rdx
movq %rdx, (%rsp)
movl $0x3, %ebx
xorl %r14d, %r14d
jmp 0x2610a
movq (%rsp), %rdx
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq