// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_vim.c
// Function: ce_vim_move_begin_little_word
CePoint_t ce_vim_move_begin_little_word(CeBuffer_t* buffer, CePoint_t start){
     WordState_t state = WORD_INSIDE_OTHER;

     start.x--;
     if(!ce_buffer_point_is_valid(buffer, start)){
          if(start.x == -1){
               start.y--;
               if(start.y < 0) return (CePoint_t){0, 0};
               start.x = ce_utf8_strlen(buffer->lines[start.y]);
               if(start.x > 0) start.x--;
               else return start;
               state = WORD_NEW_LINE;
          }else{
               return (CePoint_t){-1, -1};
          }
     }


     char* line_start = buffer->lines[start.y];
     char* itr = ce_utf8_iterate_to(line_start, start.x); // start one character back

     int64_t rune_len = 0;
     CeRune_t rune = ce_utf8_decode_reverse(itr, line_start, &rune_len);

     if(is_little_word_character(rune)){
          if(start.x == 0) return start;
          state = WORD_INSIDE_WORD;
     }else if(isspace(rune)){
          state = WORD_INSIDE_SPACE;
     }else{
          if(start.x == 0) return start;
     }

     itr -= rune_len;

     while(true){
          rune = ce_utf8_decode_reverse(itr, line_start, &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)) state = WORD_INSIDE_OTHER;;
               break;
          case WORD_INSIDE_OTHER:
               if(isspace(rune)) goto END_LOOP;
               else if(is_little_word_character(rune)) goto END_LOOP;
               break;
          case WORD_NEW_LINE:
               if(is_little_word_character(rune)) state = WORD_INSIDE_WORD;
               if(isspace(rune)) state = WORD_INSIDE_SPACE;
               goto END_LOOP;
          }

          itr -= rune_len;
          start.x--;

          if(itr < line_start){
               if(state == WORD_INSIDE_WORD || state == WORD_INSIDE_OTHER) break;

               start.y--;
               if(start.y < 0) return (CePoint_t){0, 0};
               start.x = ce_utf8_strlen(buffer->lines[start.y]);
               if(start.x > 0) start.x--;
               else break;
               line_start = buffer->lines[start.y];
               itr = ce_utf8_iterate_to(line_start, start.x); // start one character back
               state = WORD_NEW_LINE;
          }
     }

END_LOOP:
     return start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rsi, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
movq %rdi, -0x28(%rbp)
movl $0x2, -0x2c(%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 0x35ea3
cmpq $-0x1, -0x20(%rbp)
jne 0x35e8c
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x35e41
movq $0x0, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
jmp 0x3617a
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xea70
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jle 0x35e6e
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x35e83
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3617a
movl $0x3, -0x2c(%rbp)
jmp 0x35ea1
movq $-0x1, -0x10(%rbp)
movq $-0x1, -0x8(%rbp)
jmp 0x3617a
jmp 0x35ea3
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xeca0
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x11c80
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %edi
callq 0x355c0
testb $0x1, %al
jne 0x35ef1
jmp 0x35f16
cmpq $0x0, -0x20(%rbp)
jne 0x35f0d
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3617a
movl $0x0, -0x2c(%rbp)
jmp 0x35f59
callq 0xd700
movq (%rax), %rax
movslq -0x4c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x35f39
movl $0x1, -0x2c(%rbp)
jmp 0x35f57
cmpq $0x0, -0x20(%rbp)
jne 0x35f55
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3617a
jmp 0x35f57
jmp 0x35f59
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x11c80
movl %eax, -0x4c(%rbp)
movl -0x2c(%rbp), %eax
movq %rax, -0x58(%rbp)
subq $0x3, %rax
ja 0x35fa2
movq -0x58(%rbp), %rax
leaq 0xf247(%rip), %rcx      # 0x451e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xed15(%rip), %rdi      # 0x44cbe
leaq 0xf44f(%rip), %rsi      # 0x453ff
movl $0x3fe, %edx            # imm = 0x3FE
leaq 0xf58e(%rip), %rcx      # 0x4554a
callq 0xd270
callq 0xd700
movq (%rax), %rax
movslq -0x4c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x35fe0
jmp 0x3616a
movl -0x4c(%rbp), %edi
callq 0x355c0
testb $0x1, %al
jne 0x35ff1
jmp 0x3616a
jmp 0x35ff3
jmp 0x360a5
movl -0x4c(%rbp), %edi
callq 0x355c0
testb $0x1, %al
jne 0x36006
jmp 0x3600f
movl $0x0, -0x2c(%rbp)
jmp 0x36032
callq 0xd700
movq (%rax), %rax
movslq -0x4c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x36030
movl $0x2, -0x2c(%rbp)
jmp 0x36032
jmp 0x360a5
callq 0xd700
movq (%rax), %rax
movslq -0x4c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x36053
jmp 0x3616a
movl -0x4c(%rbp), %edi
callq 0x355c0
testb $0x1, %al
jne 0x36061
jmp 0x36066
jmp 0x3616a
jmp 0x36068
jmp 0x360a5
movl -0x4c(%rbp), %edi
callq 0x355c0
testb $0x1, %al
jne 0x36078
jmp 0x3607f
movl $0x0, -0x2c(%rbp)
callq 0xd700
movq (%rax), %rax
movslq -0x4c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x360a0
movl $0x1, -0x2c(%rbp)
jmp 0x3616a
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x36163
cmpl $0x0, -0x2c(%rbp)
je 0x360df
cmpl $0x2, -0x2c(%rbp)
jne 0x360e4
jmp 0x36168
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x36109
movq $0x0, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
jmp 0x3617a
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xea70
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jle 0x36136
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x36138
jmp 0x36168
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xeca0
movq %rax, -0x40(%rbp)
movl $0x3, -0x2c(%rbp)
jmp 0x35f6d
jmp 0x3616a
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 $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)