// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_vim.c
// Function: change_number
static bool change_number(CeView_t* view, CePoint_t* cursor, CePoint_t point, int64_t delta){
     char* start = ce_utf8_iterate_to(view->buffer->lines[point.y], point.x);
     char* itr = start;
     while(*itr && !isdigit((int)(*itr))){
          itr++;
     }

     if(!(*itr)) return false;

     // loop backward if we are inside a number, checking for the beginning or for the negative sign
     while(itr > view->buffer->lines[point.y]){
          itr--;
          if(!isdigit((int)(*itr))){
               if(*itr == '-') break;
               itr++;
               break;
          }
     }

     if(itr < view->buffer->lines[point.y]) itr = view->buffer->lines[point.y];

     char* end = NULL;
     int64_t value = strtol(itr, &end, 10);
     value += delta;
     assert(end);

     int64_t distance_to_number = ce_utf8_strlen_between(view->buffer->lines[point.y], itr) - 1;

     int64_t number_len = 0;
     if(*end){
          number_len = ce_utf8_strlen_between(itr, end) - 1;
     }else{
          number_len = ce_utf8_strlen(itr);
     }

     CePoint_t change_point = {distance_to_number, point.y};
     CePoint_t change_point_save = change_point;

     int64_t digits = ce_count_digits(value);
     if(value < 0) digits++; // account for negative sign
     char* new_number_string = malloc(digits + 1);
     snprintf(new_number_string, digits + 1, "%" PRId64, value);
     new_number_string[digits] = 0;

     ce_buffer_remove_string_change(view->buffer, change_point, number_len, &change_point_save,
                                    change_point, false);
     change_point_save = change_point;
     ce_buffer_insert_string_change_at_cursor(view->buffer, new_number_string, &change_point_save, true);
     *cursor = change_point;
     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r12
movq %rcx, %rbp
movq %rsi, %r15
movq %rdi, %r13
movq 0x40(%rdi), %rax
movq (%rax), %rax
movq (%rax,%rcx,8), %rdi
movq %rdx, %rsi
callq 0xe4a6
movq %rax, %rbx
movsbq (%rbx), %r14
testq %r14, %r14
je 0x26d98
callq 0xd720
movq (%rax), %rcx
testb $0x8, 0x1(%rcx,%r14,2)
jne 0x26c33
incq %rbx
jmp 0x26c11
movq %r15, 0x38(%rsp)
movq 0x40(%r13), %rax
movq (%rax), %rax
movq %rbp, %r15
movq (%rax,%rbp,8), %rax
movq %r13, 0x28(%rsp)
movq %rbx, %rbp
cmpq %rax, %rbx
jbe 0x26c6a
leaq -0x1(%rbp), %rbx
movsbq -0x1(%rbp), %rdx
testb $0x8, 0x1(%rcx,%rdx,2)
jne 0x26c4b
cmpb $0x2d, %dl
cmoveq %rbx, %rbp
cmpq %rax, %rbp
cmovbq %rax, %rbp
leaq 0x50(%rsp), %rbx
andq $0x0, (%rbx)
pushq $0xa
popq %rdx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xd400
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x26dad
movq %rax, %r13
addq %r12, %r13
movq 0x28(%rsp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq (%rax,%r15,8), %rdi
movq %rbp, %rsi
callq 0xfc01
movq %rax, %r12
decq %r12
cmpb $0x0, (%rbx)
je 0x26ccd
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xfc01
decq %rax
jmp 0x26cd5
movq %rbp, %rdi
callq 0xe38c
movq %rax, 0x20(%rsp)
movq %r12, 0x10(%rsp)
movq %r15, 0x30(%rsp)
movq %r15, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
leaq 0x40(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
movq %r13, %rdi
callq 0x10259
movq %r13, %rcx
shrq $0x3f, %rcx
leaq (%rax,%rcx), %r15
leaq (%rax,%rcx), %rbp
incq %rbp
movq %rbp, %rdi
callq 0xd4c0
movq %rax, %rbx
leaq 0x590c(%rip), %rdx      # 0x2c637
movq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rcx
xorl %eax, %eax
callq 0xd260
movb $0x0, (%rbx,%r15)
movq 0x28(%rsp), %r15
movq 0x40(%r15), %rdi
movups 0x10(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rsi
movq 0x30(%rsp), %rdx
movq 0x20(%rsp), %rcx
leaq 0x40(%rsp), %r12
movq %r12, %r8
xorl %r9d, %r9d
callq 0xf77c
movups 0x10(%rsp), %xmm0
movaps %xmm0, (%r12)
movq 0x40(%r15), %rdi
pushq $0x1
popq %rcx
movq %rbx, %rsi
movq %r12, %rdx
callq 0xf6e4
movups 0x10(%rsp), %xmm0
movq 0x38(%rsp), %rax
movups %xmm0, (%rax)
testb %r14b, %r14b
setne %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3968(%rip), %rdi      # 0x2a71c
leaq 0x64a4(%rip), %rsi      # 0x2d25f
leaq 0x6674(%rip), %rcx      # 0x2d436
movl $0xdf1, %edx            # imm = 0xDF1
callq 0xd280