// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_file_report_changes
bool ce_clangd_file_report_changes(CeClangD_t* clangd, CeBuffer_t* buffer, CeBufferChangeNode_t* last_change){
     if(clangd->buffer == NULL){
          return true;
     }
     if(last_change == buffer->change_node){
          return true;
     }

     // TODO: We could take this as a parameter rather than calculating it each time.
     char file_uri[MAX_PATH_LEN + 1];
     if(!_calculate_filename_uri(buffer->name, file_uri, MAX_PATH_LEN)){
          return false;
     }

     CeJsonObj_t obj = {};
     ce_json_obj_set_string(&obj, "jsonrpc", "2.0");
     ce_json_obj_set_string(&obj, "method", "textDocument/didChange");
     CeJsonObj_t text_document_obj = {};
     ce_json_obj_set_string(&text_document_obj, "uri", file_uri);
     CeJsonObj_t param_obj = {};
     ce_json_obj_set_obj(&param_obj, "textDocument", &text_document_obj);

     char* buffer_str = ce_buffer_dupe(buffer);
     char* sanitized_buffer_str = _convert_string_to_json_string(buffer_str);

     CeJsonObj_t content_change_obj = {};
     ce_json_obj_set_string(&content_change_obj, "text", sanitized_buffer_str);

     CeJsonArray_t content_changes_array = {};
     ce_json_array_add_obj(&content_changes_array, &content_change_obj);

     ce_json_obj_set_array(&param_obj, "contentChanges", &content_changes_array);
     ce_json_obj_set_obj(&obj, "params", &param_obj);

     bool result = _send_json_obj(&obj, &clangd->proc);
     free(buffer_str);
     free(sanitized_buffer_str);
     ce_json_array_free(&content_changes_array);
     ce_json_obj_free(&content_change_obj);
     ce_json_obj_free(&param_obj);
     ce_json_obj_free(&text_document_obj);
     ce_json_obj_free(&obj);
     return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movb $0x1, %bl
cmpq $0x0, 0x28(%rdi)
je 0x15122
movq %rsi, %r13
cmpq %rdx, 0x40(%rsi)
je 0x15122
movq %rdi, %r14
movq 0x10(%r13), %rdi
leaq 0x50(%rsp), %rbx
movq %rbx, %rsi
callq 0x14e5d
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%r15)
leaq 0x1704b(%rip), %rsi     # 0x2c049
leaq 0x1704c(%rip), %rdx     # 0x2c051
movq %r15, %rdi
callq 0x1ab25
leaq 0x16cac(%rip), %rsi     # 0x2bcc0
leaq 0x170e3(%rip), %rdx     # 0x2c0fe
movq %r15, %rdi
callq 0x1ab25
leaq 0x20(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
leaq 0x16bcd(%rip), %rsi     # 0x2bc03
movq %r15, %rdi
movq %rbx, %rdx
callq 0x1ab25
leaq 0x40(%rsp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
leaq 0x17088(%rip), %rsi     # 0x2c0db
movq %rdi, %rbx
movq %r15, %rdx
callq 0x1a949
movq %r13, %rdi
callq 0xf570
movq %rax, %rbp
movq %rax, %rdi
callq 0x14b24
movq %rax, %r15
leaq 0x10(%rsp), %r13
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
leaq 0x1704e(%rip), %rsi     # 0x2c0d6
movq %r13, %rdi
movq %rax, %rdx
callq 0x1ab25
leaq 0x30(%rsp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
movq %r12, %rdi
movq %r13, %rsi
callq 0x1a6bc
leaq 0x17063(%rip), %rsi     # 0x2c115
movq %rbx, %r13
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1aa13
leaq 0x16b35(%rip), %rsi     # 0x2bbfc
movq %rsp, %rbx
movq %rbx, %rdi
movq %r13, %rdx
callq 0x1a949
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14c22
movl %eax, %ebx
movq %rbp, %rdi
callq 0xd090
movq %r15, %rdi
callq 0xd090
movq %r12, %rdi
callq 0x1a910
leaq 0x10(%rsp), %rdi
callq 0x1ad0b
movq %r13, %rdi
callq 0x1ad0b
leaq 0x20(%rsp), %rdi
callq 0x1ad0b
movq %rsp, %rdi
callq 0x1ad0b
movl %ebx, %eax
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq