// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_vim.c
// Function: ce_vim_move_end_little_word
CePoint_t ce_vim_move_end_little_word(CeBuffer_t* buffer, CePoint_t start){
     start.x++;
     if(!ce_buffer_point_is_valid(buffer, start)){
          if(start.x == 1){
               // line is empty
               start.x = 0;
          }else{
               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 = 0;
     WordState_t state = WORD_INSIDE_OTHER;

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

          rune = ce_utf8_decode(itr, &rune_len);
          itr += rune_len;
          if(isspace(rune)) state = WORD_INSIDE_SPACE;
          else if(is_little_word_character(rune)) state = WORD_INSIDE_WORD;
          else return start;
     }else{
          rune = ce_utf8_decode(itr, &rune_len);

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

          itr += rune_len;
     }

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

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

          itr += rune_len;
          start.x++;

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

               rune = ce_utf8_decode(itr, &rune_len);
               itr += rune_len;
               if(isspace(rune)) state = WORD_INSIDE_SPACE;
               else if(is_little_word_character(rune)) state = WORD_INSIDE_WORD;
               else break;
          }
     }

END_LOOP:

     return start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
movq %rdi, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xeba0
cmpq $0x0, %rax
jne 0x3585f
cmpq $0x1, -0x20(%rbp)
jne 0x35848
movq $0x0, -0x20(%rbp)
jmp 0x3585d
movq $-0x1, -0x10(%rbp)
movq $-0x1, -0x8(%rbp)
jmp 0x35b72
jmp 0x3585f
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x20(%rbp), %rsi
callq 0xeca0
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x2, -0x40(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x35961
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jl 0x358cb
movq $-0x1, -0x10(%rbp)
movq $-0x1, -0x8(%rbp)
jmp 0x35b72
movq $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xedc0
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0xd700
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x35931
movl $0x1, -0x40(%rbp)
jmp 0x3595f
movl -0x3c(%rbp), %edi
callq 0x355c0
testb $0x1, %al
jne 0x3593f
jmp 0x35948
movl $0x0, -0x40(%rbp)
jmp 0x3595d
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x35b72
jmp 0x3595f
jmp 0x359b7
movq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xedc0
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %edi
callq 0x355c0
testb $0x1, %al
jne 0x3597f
jmp 0x35988
movl $0x0, -0x40(%rbp)
jmp 0x359ab
callq 0xd700
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x359a9
movl $0x1, -0x40(%rbp)
jmp 0x359ab
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x359b9
movq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xedc0
movl %eax, -0x3c(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x44(%rbp)
testl %eax, %eax
je 0x35a0c
jmp 0x359d5
movl -0x44(%rbp), %eax
subl $0x1, %eax
je 0x35a40
jmp 0x359df
movl -0x44(%rbp), %eax
subl $0x2, %eax
je 0x35a86
jmp 0x359ed
leaq 0xf2ca(%rip), %rdi      # 0x44cbe
leaq 0xfa04(%rip), %rsi      # 0x453ff
movl $0x373, %edx            # imm = 0x373
leaq 0xfac8(%rip), %rcx      # 0x454cf
callq 0xd270
callq 0xd700
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x35a2b
jmp 0x35b62
movl -0x3c(%rbp), %edi
callq 0x355c0
testb $0x1, %al
jne 0x35a3c
jmp 0x35b62
jmp 0x35a3e
jmp 0x35a8b
movl -0x3c(%rbp), %edi
callq 0x355c0
testb $0x1, %al
jne 0x35a4e
jmp 0x35a57
movl $0x0, -0x40(%rbp)
jmp 0x35a84
callq 0xd700
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x35a82
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x35b62
jmp 0x35a84
jmp 0x35a8b
jmp 0x35b62
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x35b5b
cmpl $0x0, -0x40(%rbp)
jne 0x35abe
jmp 0x35b60
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jl 0x35ad8
jmp 0x35b60
movq $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xedc0
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0xd700
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x35b3e
movl $0x1, -0x40(%rbp)
jmp 0x35b59
movl -0x3c(%rbp), %edi
callq 0x355c0
testb $0x1, %al
jne 0x35b4c
jmp 0x35b55
movl $0x0, -0x40(%rbp)
jmp 0x35b57
jmp 0x35b60
jmp 0x35b59
jmp 0x35b5b
jmp 0x359b9
jmp 0x35b62
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x50, %rsp
popq %rbp
retq