// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_move_point
CePoint_t ce_buffer_move_point(CeBuffer_t* buffer, CePoint_t point, CePoint_t delta, int64_t tab_width, CeClampX_t clamp_x){
     if(delta.y){
          CE_CLAMP(point.y, 0, (buffer->line_count - 1));

          // figure out where we are visibly (due to tabs being variable length)
          int64_t cur_visible_index = ce_util_string_index_to_visible_index(buffer->lines[point.y], point.x, tab_width);

          // move to the new line
          point.y += delta.y;

          // always clamp y
          CE_CLAMP(point.y, 0, (buffer->line_count - 1));

          // convert the x from visible index to a string index
          point.x = ce_util_visible_index_to_string_index(buffer->lines[point.y], cur_visible_index, tab_width);
     }

     point.x += delta.x;
     int64_t line_len = ce_buffer_line_len(buffer, point.y);

     switch(clamp_x){
     case CE_CLAMP_X_NONE:
          break;
     case CE_CLAMP_X_ON:
          CE_CLAMP(point.x, 0, line_len);
          break;
     case CE_CLAMP_X_INSIDE:
          if(line_len == 0){
               point.x = 0;
          }else{
               CE_CLAMP(point.x, 0, (line_len - 1));
          }
          break;
     }

     return point;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl 0x10(%rbp), %eax
movq %rsi, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x30(%rbp)
movq %r8, -0x28(%rbp)
movq %rdi, -0x38(%rbp)
movq %r9, -0x40(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xf859
cmpq $0x0, -0x18(%rbp)
jge 0xf780
xorl %eax, %eax
movq %rax, -0x58(%rbp)
jmp 0xf7b7
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jle 0xf7a7
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
subq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0xf7af
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x20(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0xf970
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0xf7fa
xorl %eax, %eax
movq %rax, -0x68(%rbp)
jmp 0xf831
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jle 0xf821
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
subq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0xf829
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0xfa30
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xf6e0
movq %rax, -0x50(%rbp)
movl 0x10(%rbp), %eax
movl %eax, -0x74(%rbp)
testl %eax, %eax
je 0xf89c
jmp 0xf885
movl -0x74(%rbp), %eax
subl $0x1, %eax
je 0xf8a1
jmp 0xf88f
movl -0x74(%rbp), %eax
subl $0x2, %eax
je 0xf8e7
jmp 0xf952
jmp 0xf952
cmpq $0x0, -0x20(%rbp)
jge 0xf8b0
xorl %eax, %eax
movq %rax, -0x80(%rbp)
jmp 0xf8dd
movq -0x20(%rbp), %rax
cmpq -0x50(%rbp), %rax
jle 0xf8c7
movq -0x50(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0xf8d2
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xf952
cmpq $0x0, -0x50(%rbp)
jne 0xf8f8
movq $0x0, -0x20(%rbp)
jmp 0xf950
cmpq $0x0, -0x20(%rbp)
jge 0xf90a
xorl %eax, %eax
movq %rax, -0x90(%rbp)
jmp 0xf945
movq -0x20(%rbp), %rax
movq -0x50(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jle 0xf92c
movq -0x50(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0xf937
movq -0x20(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xf952
movups -0x20(%rbp), %xmm0
movaps %xmm0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)