// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_vim.c
// Function: ce_vim_motion_visual
CeVimMotionResult_t ce_vim_motion_visual(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){
     if(vim->mode == CE_VIM_MODE_VISUAL || vim->mode == CE_VIM_MODE_VISUAL_LINE){
          motion_range->start = *cursor;
          motion_range->end = visual->point;
          ce_range_sort(motion_range);
          action->motion.integer = ce_buffer_range_len(view->buffer, motion_range->start, motion_range->end) - 1;

          if(vim->mode == CE_VIM_MODE_VISUAL_LINE){
               motion_range->start.x = 0;
               motion_range->end.x = ce_utf8_strlen(view->buffer->lines[motion_range->end.y]);
               action->yank_type = CE_VIM_YANK_TYPE_LINE;
               action->motion.integer = motion_range->end.y - motion_range->start.y;
          }
     }else if(vim->verb_last_action){
          switch(action->yank_type){
          default:
               break;
          case CE_VIM_YANK_TYPE_LINE:
               motion_range->start = (CePoint_t){0, cursor->y};
               motion_range->end.y = cursor->y + action->motion.integer;
               if(motion_range->end.y >= view->buffer->line_count){
                    motion_range->end.y = (view->buffer->line_count - 1);
               }
               if(motion_range->end.y < 0){
                    motion_range->end.y = 0;
               }
               motion_range->end.x = ce_utf8_strlen(view->buffer->lines[motion_range->end.y]);
               break;
          case CE_VIM_YANK_TYPE_STRING:
               motion_range->start = *cursor;
               motion_range->end = ce_buffer_advance_point(view->buffer, *cursor, action->motion.integer);
               break;
          }
     }

     return CE_VIM_MOTION_RESULT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
je 0x3489e
movq -0x8(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x34969
movq 0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq 0x18(%rbp), %rdi
callq 0x12840
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq 0x18(%rbp), %rcx
movq 0x18(%rbp), %rax
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
movq 0x10(%rax), %rcx
movq 0x18(%rax), %r8
callq 0xf510
subq $0x1, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x34964
movq 0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xea70
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl $0x2, 0x38(%rax)
movq 0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rbp), %rcx
subq 0x8(%rcx), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
jmp 0x34aaf
movq -0x8(%rbp), %rax
testb $0x1, 0x19d9(%rax)
je 0x34aad
movq -0x10(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x54(%rbp)
subl $0x1, %eax
je 0x34a4e
jmp 0x3498f
movl -0x54(%rbp), %eax
subl $0x2, %eax
je 0x3499e
jmp 0x34999
jmp 0x34aab
movq 0x18(%rbp), %rax
movq $0x0, -0x40(%rbp)
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, -0x38(%rbp)
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
addq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq 0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x40(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jl 0x34a0e
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rcx
subq $0x1, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq 0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jge 0x34a25
movq 0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xea70
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x34aab
movq 0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0xfaf0
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
movq -0x50(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x34aad
jmp 0x34aaf
movl $0x1, %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)