// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_vim.c
// Function: ce_vim_verb_flip_case
bool ce_vim_verb_flip_case(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_undo = false;
     while(!ce_points_equal(motion_range.start, motion_range.end)){
          // do nothing if we aren't on the buffer, or the line is empty
          if(!ce_buffer_contains_point(view->buffer, motion_range.start)){
               motion_range.start = ce_buffer_advance_point(view->buffer, motion_range.start, 1);
               continue;
          }else if(view->buffer->lines[motion_range.start.y][0] == 0){
               motion_range.start = ce_buffer_advance_point(view->buffer, motion_range.start, 1);
               continue;
          }

          CeRune_t flipped = ce_buffer_get_rune(view->buffer, motion_range.start);
          if(flipped == CE_UTF8_INVALID) return false;

          if(isupper(flipped)){
               flipped = tolower(flipped);
          }else{
               flipped = toupper(flipped);
          }

          if(!change_character(view, cursor, motion_range.start, flipped, chain_undo)) return false;

          motion_range.start = ce_buffer_advance_point(view->buffer, motion_range.start, 1);
          if(motion_range.start.x == -1) return false;
          chain_undo = true;
     }

     *cursor = motion_range.end;
     return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq 0x30(%rbp), %rax
leaq 0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movb $0x0, -0x39(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq 0x18(%rax), %rcx
callq 0xfec0
xorb $-0x1, %al
testb $0x1, %al
jne 0x3afb6
jmp 0x3b14b
movq -0x80(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0xe9e0
testb $0x1, %al
jne 0x3b00f
movq -0x80(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl $0x1, %ecx
callq 0xfaf0
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
movq -0x50(%rbp), %rcx
movq %rcx, (%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x3af93
movq -0x80(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x3b06e
movq -0x80(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl $0x1, %ecx
callq 0xfaf0
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
movq -0x60(%rbp), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x3af93
jmp 0x3b070
movq -0x80(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0xec20
movl %eax, -0x64(%rbp)
cmpl $-0x1, -0x64(%rbp)
jne 0x3b09a
movb $0x0, -0x1(%rbp)
jmp 0x3b166
callq 0xd700
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x3b0c1
movl -0x64(%rbp), %edi
callq 0xd460
movl %eax, -0x64(%rbp)
jmp 0x3b0cc
movl -0x64(%rbp), %edi
callq 0xd110
movl %eax, -0x64(%rbp)
movq -0x80(%rbp), %rcx
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x64(%rbp), %r8d
movb -0x39(%rbp), %al
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
andb $0x1, %al
movzbl %al, %r9d
callq 0x3b6e0
testb $0x1, %al
jne 0x3b0fb
movb $0x0, -0x1(%rbp)
jmp 0x3b166
movq -0x80(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl $0x1, %ecx
callq 0xfaf0
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, -0x78(%rbp)
movq %rdx, -0x70(%rbp)
movq -0x78(%rbp), %rcx
movq %rcx, (%rax)
movq -0x70(%rbp), %rcx
movq %rcx, 0x8(%rax)
cmpq $-0x1, (%rax)
jne 0x3b142
movb $0x0, -0x1(%rbp)
jmp 0x3b166
movb $0x1, -0x39(%rbp)
jmp 0x3af93
movq -0x80(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0x10(%rcx), %rdx
movq %rdx, (%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)