// File: /workspace/github_c_makefile_star2_O1/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, 0x30(%rsp)
movq %rcx, %r15
movq %rsi, %r14
movq %rdi, %r12
movq 0x40(%rdi), %rax
movq (%rax), %rax
movq (%rax,%rcx,8), %rdi
movq %rdx, %rsi
callq 0xe5be
movq %rax, %r13
movb (%rax), %bl
testb %bl, %bl
je 0x29e83
callq 0xd720
movq (%rax), %rax
movsbq %bl, %rcx
movb 0x1(%rax,%rcx,2), %bpl
andb $0x8, %bpl
shrb $0x3, %bpl
jne 0x29e85
movb 0x1(%r13), %bl
incq %r13
testb %bl, %bl
jne 0x29e63
jmp 0x29e85
xorl %ebp, %ebp
testb %bpl, %bpl
je 0x29ffd
movq %r14, 0x28(%rsp)
movq 0x40(%r12), %rax
movq (%rax), %rax
movq (%rax,%r15,8), %r14
movq %r12, 0x20(%rsp)
movq %r13, %rbx
cmpq %r14, %r13
jbe 0x29eca
leaq -0x1(%rbx), %r13
callq 0xd720
movq (%rax), %rcx
movsbq -0x1(%rbx), %rax
testb $0x8, 0x1(%rcx,%rax,2)
jne 0x29ea4
cmpb $0x2d, %al
cmoveq %r13, %rbx
cmpq %r14, %rbx
cmovbq %r14, %rbx
leaq 0x38(%rsp), %r12
movq $0x0, (%r12)
movq %rbx, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0xd400
cmpq $0x0, (%r12)
je 0x2a00e
movq %rax, %r13
addq 0x30(%rsp), %r13
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0x10101
movq %rax, %r12
decq %r12
movq 0x38(%rsp), %rsi
cmpb $0x0, (%rsi)
je 0x29f39
movq %rbx, %rdi
callq 0x10101
movq %rax, %rbx
decq %rbx
jmp 0x29f44
movq %rbx, %rdi
callq 0xe485
movq %rax, %rbx
movq %r12, 0x10(%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 0x107d9
movq %r13, %rcx
shrq $0x3f, %rcx
leaq (%rax,%rcx), %r15
leaq (%rax,%rcx), %r14
incq %r14
movq %r14, %rdi
callq 0xd4c0
movq %rax, %r12
leaq 0x66c5(%rip), %rdx      # 0x30655
movq %rax, %rdi
movq %r14, %rsi
movq %r13, %rcx
xorl %eax, %eax
callq 0xd260
movb $0x0, (%r12,%r15)
movq 0x20(%rsp), %r14
movq 0x40(%r14), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movups 0x10(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rcx
leaq 0x40(%rsp), %rbx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0xfc21
movups 0x10(%rsp), %xmm0
movaps %xmm0, (%rbx)
movq 0x40(%r14), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0xfb7d
movups 0x10(%rsp), %xmm0
movq 0x28(%rsp), %rax
movups %xmm0, (%rax)
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4707(%rip), %rdi      # 0x2e71c
leaq 0x71fb(%rip), %rsi      # 0x31217
leaq 0x73cb(%rip), %rcx      # 0x313ee
movl $0xdf1, %edx            # imm = 0xDF1
callq 0xd280