// File: /workspace/github_c_makefile_star2_O1/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 0x1079c
movq (%r14), %rax
subq 0x8(%r13), %rax
xorl %ecx, %ecx
testq %rax, %rax
cmovgq %rax, %rcx
movq 0x8(%r15), %r13
cmpq 0x18(%r15), %r13
jg 0x293bb
movq %rcx, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq 0x8(%r14), %rax
movq %rax, 0x18(%rsp)
xorl %r15d, %r15d
movq 0x190(%rsp), %rax
movq 0x8(%rax), %rbp
testq %rbp, %rbp
jle 0x2931a
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 0x2931c
incq %rbx
cmpq %rbx, %rbp
jne 0x29302
movq %rbp, %rbx
jmp 0x2931c
xorl %ebx, %ebx
leaq -0x1(%rbx), %rax
cmpq $0xfd, %rax
ja 0x29375
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
movl $0x20, %esi
movq %rbx, %rdx
callq 0xd2a0
movb $0x0, 0x30(%rsp,%rbx)
movq 0x40(%r12), %rbx
movq %rbp, %rdi
callq 0xd210
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movzbl %r15b, %r9d
andl $0x1, %r9d
movq %rbx, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rax, %rcx
movq %r14, %r8
callq 0xfc21
movb $0x1, %r15b
leaq 0x1(%r13), %rax
leaq 0x170(%rsp), %rcx
cmpq 0x18(%rcx), %r13
movq %rax, %r13
jl 0x292db
testb $0x1, %r15b
movq 0x28(%rsp), %rbx
movq 0x20(%rsp), %rcx
je 0x293bb
cmpl $0x3, (%rbx)
movq 0x18(%rsp), %rax
jne 0x293b4
leaq 0x170(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%r14)
movq %rax, 0x8(%r14)
movl $0x0, (%rbx)
movb $0x1, %al
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq