// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_vim.c
// Function: ce_vim_motion_search_next
CeVimMotionResult_t ce_vim_motion_search_next(CeVim_t* vim, CeVimAction_t* action, const CeView_t* view, const CePoint_t* cursor,
                                              CeVimVisualData_t* visual, const CeConfigOptions_t* config_options,
                                              CeVimBufferData_t* buffer_data, CeRange_t* motion_range){
     const CeVimYank_t* yank = vim->yanks + ce_vim_register_index('/');
     if(!yank->text) return CE_VIM_MOTION_RESULT_FAIL;
     CePoint_t result = {-1, -1};
     switch(vim->search_mode){
     default:
          return CE_VIM_MOTION_RESULT_FAIL;
     case CE_VIM_SEARCH_MODE_FORWARD:
     {
          CePoint_t start = ce_buffer_advance_point(view->buffer, motion_range->end, 1);
          result = ce_buffer_search_forward(view->buffer, start, yank->text);
     } break;
     case CE_VIM_SEARCH_MODE_BACKWARD:
     {
          CePoint_t start = ce_buffer_advance_point(view->buffer, motion_range->end, -1);
          result = ce_buffer_search_backward(view->buffer, start, yank->text);
     } break;
     case CE_VIM_SEARCH_MODE_REGEX_FORWARD:
     {
          CePoint_t start = ce_buffer_advance_point(view->buffer, motion_range->end, 1);
          CeRegex_t regex = NULL;
          CeRegexResult_t regex_result = ce_regex_init(yank->text,
                                                       &regex);
          if(regex_result.error_message != NULL){
               ce_log("ce_regex_init() failed: '%s'", regex_result.error_message);
               free(regex_result.error_message);
          }else{
               CeRegexSearchResult_t search_result = ce_buffer_regex_search_forward(view->buffer, start, regex);
               result = search_result.point;
          }
          ce_regex_free(regex);
     } break;
     case CE_VIM_SEARCH_MODE_REGEX_BACKWARD:
     {
          CePoint_t start = ce_buffer_advance_point(view->buffer, motion_range->end, -1);
          CeRegex_t regex = NULL;
          CeRegexResult_t regex_result = ce_regex_init(yank->text,
                                                       &regex);
          if(regex_result.error_message != NULL){
               ce_log("ce_regex_init() failed: '%s'", regex_result.error_message);
               free(regex_result.error_message);
          }else{
               CeRegexSearchResult_t search_result = ce_buffer_regex_search_backward(view->buffer, start, regex);
               result = search_result.point;
          }
          ce_regex_free(regex);
     } break;
     }
     if(result.x < 0) return CE_VIM_MOTION_RESULT_FAIL;
     motion_range->end = result;
     return CE_VIM_MOTION_RESULT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
xorl %ebx, %ebx
cmpq $0x0, 0x11c0(%rdi)
je 0x27f81
movq %rdi, %r12
movl 0x19dc(%rdi), %eax
cmpq $0x3, %rax
ja 0x27f81
movq %rdx, %r14
movq 0x88(%rsp), %r13
leaq 0x93f7(%rip), %rcx      # 0x311d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x40(%r14), %rdi
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movl $0x1, %ecx
callq 0xeffa
movq 0x40(%r14), %rdi
movq 0x11c0(%r12), %rcx
movq %rax, %rsi
callq 0xe6f1
jmp 0x27f1a
movq 0x40(%r14), %rdi
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movl $0x1, %ecx
callq 0xeffa
movq %rax, %r15
movq %rdx, %rbp
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
movq 0x11c0(%r12), %rsi
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0x1f410
movq (%r12), %rsi
testq %rsi, %rsi
je 0x27f22
leaq 0x8709(%rip), %rdi      # 0x3056b
xorl %eax, %eax
callq 0xd954
movq 0x18(%rsp), %rdi
callq 0xd090
movq $-0x1, %r15
jmp 0x27ee5
movq 0x40(%r14), %rdi
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movq $-0x1, %r15
movq $-0x1, %rcx
callq 0xeffa
movq %rax, 0x10(%rsp)
movq %rdx, %rbp
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
movq 0x11c0(%r12), %rsi
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0x1f410
movq (%r12), %rsi
testq %rsi, %rsi
je 0x27f40
leaq 0x8697(%rip), %rdi      # 0x3056b
xorl %eax, %eax
callq 0xd954
movq 0x18(%rsp), %rdi
callq 0xd090
movq $-0x1, %r14
jmp 0x27f65
movq 0x40(%r14), %rdi
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movq $-0x1, %rcx
callq 0xeffa
movq 0x40(%r14), %rdi
movq 0x11c0(%r12), %rcx
movq %rax, %rsi
callq 0xe840
movq %rax, %r15
movq %rdx, %r14
jmp 0x27f6f
movq 0x40(%r14), %rsi
movq 0x8(%rsp), %r8
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r15, %rdx
movq %rbp, %rcx
callq 0xe990
jmp 0x27f5e
movq 0x40(%r14), %rsi
movq 0x8(%rsp), %r8
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq 0x10(%rsp), %rdx
movq %rbp, %rcx
callq 0xeab0
movq (%r14), %r15
movq 0x8(%r14), %r14
movq 0x8(%rsp), %rdi
callq 0x1f52e
testq %r15, %r15
js 0x27f81
movq %r15, 0x10(%r13)
movq %r14, 0x18(%r13)
movl $0x1, %ebx
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq