// File: /workspace/github_c_makefile_star2_O3/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, %r15
movq %rsi, %r13
movq %rdi, %r14
movq 0x40(%rdi), %rax
movq (%rax), %rax
movq (%rax,%rcx,8), %rdi
movq %rdx, %rsi
callq 0xe577
movb (%rax), %bpl
testb %bpl, %bpl
je 0x29c8f
movq %rax, %rbx
callq 0xd720
movq (%rax), %rax
movsbq %bpl, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x29c96
movb 0x1(%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0x29c78
xorl %eax, %eax
jmp 0x29df3
movq 0x40(%r14), %rcx
movq (%rcx), %rcx
movq (%rcx,%r15,8), %rcx
movq %r13, 0x38(%rsp)
movq %rbx, %rbp
cmpq %rcx, %rbx
jbe 0x29cc5
leaq -0x1(%rbp), %rbx
movsbq -0x1(%rbp), %rdx
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x29ca6
cmpb $0x2d, %dl
cmoveq %rbx, %rbp
cmpq %rcx, %rbp
cmovbq %rcx, %rbp
leaq 0x50(%rsp), %rbx
movq $0x0, (%rbx)
movq %rbp, %rdi
movq %rbx, %rsi
movl $0xa, %edx
callq 0xd400
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x29e02
movq %rax, %r13
addq %r12, %r13
movq 0x40(%r14), %rax
movq (%rax), %rax
movq (%rax,%r15,8), %rdi
movq %rbp, %rsi
callq 0xff7f
movq %rax, %r12
decq %r12
cmpb $0x0, (%rbx)
je 0x29d28
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xff7f
decq %rax
jmp 0x29d30
movq %rbp, %rdi
callq 0xe445
movq %rax, 0x28(%rsp)
movq %r12, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
leaq 0x40(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
movq %r13, %rdi
callq 0x1064e
movq %r13, %rcx
shrq $0x3f, %rcx
leaq (%rax,%rcx), %rdx
movq %rdx, 0x30(%rsp)
leaq (%rax,%rcx), %rbp
incq %rbp
movq %rbp, %rdi
callq 0xd4c0
movq %rax, %rbx
leaq 0x595b(%rip), %rdx      # 0x2f6e1
movq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rcx
xorl %eax, %eax
callq 0xd260
movq 0x30(%rsp), %rax
movb $0x0, (%rbx,%rax)
movq 0x40(%r14), %rdi
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rsi
movq %r15, %rdx
movq 0x28(%rsp), %rcx
leaq 0x40(%rsp), %r15
movq %r15, %r8
xorl %r9d, %r9d
callq 0xfab0
movups 0x18(%rsp), %xmm0
movaps %xmm0, (%r15)
movq 0x40(%r14), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl $0x1, %ecx
callq 0xfa15
movups 0x18(%rsp), %xmm0
movq 0x38(%rsp), %rax
movups %xmm0, (%rax)
movb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3913(%rip), %rdi      # 0x2d71c
leaq 0x64b7(%rip), %rsi      # 0x302c7
leaq 0x6687(%rip), %rcx      # 0x3049e
movl $0xdf1, %edx            # imm = 0xDF1
callq 0xd280