// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_vim.c
// Function: ce_vim_verb_unindent
bool ce_vim_verb_unindent(CeVim_t* vim, const CeVimAction_t* action, CeRange_t motion_range, CeView_t* view,
                          CePoint_t* cursor, CeVimVisualData_t* visual, CeVimBufferData_t* buffer_data,
                          const CeConfigOptions_t* config_options){
     bool chain = false;
     ce_range_sort(&motion_range);
     CePoint_t end_cursor = {cursor->x - config_options->tab_width, cursor->y};
     if(end_cursor.x < 0) end_cursor.x = 0;
     for(int64_t i = motion_range.start.y; i <= motion_range.end.y; i++){
          // calc indentation
          CePoint_t indentation_point = {0, i};
          int64_t tab_width = 0;

          // figure out how much we can unindent
          for(int64_t s = 0; s < config_options->tab_width; s++){
               if(isblank((int)(view->buffer->lines[i][s]))){
                    tab_width++;
               }else{
                    break;
               }
          }

          if(tab_width && tab_width < 255){
               // build indentation string
               char remove_string[256];
               memset(remove_string, ' ', tab_width);
               remove_string[tab_width] = 0;

               ce_buffer_remove_string_change(view->buffer, indentation_point, strlen(remove_string), cursor, *cursor, chain);
               chain = true;
          }
     }

     if(vim->mode == CE_VIM_MODE_VISUAL_LINE) end_cursor.y = motion_range.start.y;
     if(chain) *cursor = end_cursor; // if we did any indentation at all, update the cursor
     vim->mode = CE_VIM_MODE_NORMAL;
     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rcx, %r14
movq %rdx, %r12
movq %rdi, %rbx
movq 0x190(%rsp), %r13
leaq 0x170(%rsp), %r15
movq %r15, %rdi
callq 0x10614
movq %r14, 0x10(%rsp)
movq (%r14), %rax
subq 0x8(%r13), %rax
xorl %ecx, %ecx
testq %rax, %rax
cmovgq %rax, %rcx
movq 0x8(%r15), %r13
movq 0x18(%r15), %r15
cmpq %r15, %r13
jg 0x292ca
movq %rcx, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
movq 0x190(%rsp), %rax
movq 0x8(%rax), %r14
testq %r14, %r14
jle 0x29288
callq 0xd720
movq (%rax), %rax
movq 0x40(%r12), %rcx
movq (%rcx), %rcx
movq (%rcx,%r13,8), %rcx
xorl %ebx, %ebx
movsbq (%rcx,%rbx), %rdx
testb $0x1, (%rax,%rdx,2)
je 0x29221
incq %rbx
cmpq %rbx, %r14
jne 0x2920b
movq %r14, %rbx
leaq -0x1(%rbx), %rax
cmpq $0xfd, %rax
ja 0x29288
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl $0x20, %esi
movq %rbx, %rdx
callq 0xd2a0
movb $0x0, 0x30(%rsp,%rbx)
movq 0x40(%r12), %rbx
movq %r14, %rdi
callq 0xd210
movq 0x10(%rsp), %r8
movups (%r8), %xmm0
movups %xmm0, (%rsp)
movzbl %bpl, %r9d
andl $0x1, %r9d
movq %rbx, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rax, %rcx
callq 0xfab0
leaq 0x170(%rsp), %rax
movq 0x18(%rax), %r15
movb $0x1, %bpl
leaq 0x1(%r13), %rax
cmpq %r15, %r13
movq %rax, %r13
jl 0x291e0
testb $0x1, %bpl
movq 0x28(%rsp), %rbx
movq 0x20(%rsp), %rcx
je 0x292ca
cmpl $0x3, (%rbx)
movq 0x18(%rsp), %rdx
jne 0x292be
leaq 0x170(%rsp), %rax
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq %rdx, 0x8(%rax)
movl $0x0, (%rbx)
movb $0x1, %al
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq