// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_vim.c
// Function: ce_vim_move_begin_big_word
CePoint_t ce_vim_move_begin_big_word(CeBuffer_t* buffer, CePoint_t start){
     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;
          }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);
     WordState_t state = WORD_INSIDE_OTHER;

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

     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;
               break;
          case WORD_INSIDE_SPACE:
               if(!isspace(rune)) state = WORD_INSIDE_WORD;
               break;
          case WORD_NEW_LINE:
               if(isspace(rune)) state = WORD_INSIDE_SPACE;
               else state = WORD_INSIDE_WORD;
               break;
          }

          itr -= rune_len;
          start.x--;

          if(itr < line_start){
               if(state == WORD_INSIDE_WORD) 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) break;
               line_start = buffer->lines[start.y];
               itr = ce_utf8_iterate_to(line_start, start.x);
               state = WORD_NEW_LINE;
               start.x++;
          }
     }

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 0x36255
cmpq $-0x1, -0x20(%rbp)
jne 0x3623e
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x361fa
movq $0x0, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
jmp 0x36486
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 0x36227
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x3623c
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x36486
jmp 0x36253
movq $-0x1, -0x10(%rbp)
movq $-0x1, -0x8(%rbp)
jmp 0x36486
jmp 0x36255
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xeca0
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x11c80
movl %eax, -0x44(%rbp)
movl $0x2, -0x48(%rbp)
callq 0xd700
movq (%rax), %rax
movslq -0x44(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x362bf
movl $0x1, -0x48(%rbp)
jmp 0x362e2
cmpq $0x0, -0x20(%rbp)
jne 0x362db
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x36486
movl $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x11c80
movl %eax, -0x44(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x4c(%rbp)
testl %eax, %eax
je 0x36349
jmp 0x36316
movl -0x4c(%rbp), %eax
subl $0x1, %eax
je 0x3636a
jmp 0x36320
movl -0x4c(%rbp), %eax
subl $0x3, %eax
je 0x3638d
jmp 0x3632a
leaq 0xe98d(%rip), %rdi      # 0x44cbe
leaq 0xf0c7(%rip), %rsi      # 0x453ff
movl $0x44a, %edx            # imm = 0x44A
leaq 0xf247(%rip), %rcx      # 0x4558b
callq 0xd270
callq 0xd700
movq (%rax), %rax
movslq -0x44(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x36368
jmp 0x36476
jmp 0x363b9
callq 0xd700
movq (%rax), %rax
movslq -0x44(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x3638b
movl $0x0, -0x48(%rbp)
jmp 0x363b9
callq 0xd700
movq (%rax), %rax
movslq -0x44(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x363b0
movl $0x1, -0x48(%rbp)
jmp 0x363b7
movl $0x0, -0x48(%rbp)
jmp 0x363b9
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x3646f
cmpl $0x0, -0x48(%rbp)
jne 0x363f2
jmp 0x36474
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x36417
movq $0x0, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
jmp 0x36486
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)
jne 0x36438
jmp 0x36474
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xeca0
movq %rax, -0x38(%rbp)
movl $0x3, -0x48(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x362f6
jmp 0x36476
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
nopw %cs:(%rax,%rax)