// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_clangd.c
// Function: ce_clangd_file_open
bool ce_clangd_file_open(CeClangD_t* clangd, CeBuffer_t* buffer){
     if(clangd->buffer == NULL){
          return true;
     }
     CeAppBufferData_t* buffer_data = buffer->app_data;
     if(buffer_data->syntax_function != ce_syntax_highlight_c &&
        buffer_data->syntax_function != ce_syntax_highlight_cpp){
          printf("skipping %s for clangd\n", buffer->name);
          return true;
     }
     char file_uri[MAX_PATH_LEN + 1];
     if(!_calculate_filename_uri(buffer->name, file_uri, MAX_PATH_LEN)){
          return false;
     }

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

     CeJsonObj_t obj = {};
     ce_json_obj_set_string(&obj, "jsonrpc", "2.0");
     ce_json_obj_set_string(&obj, "method", "textDocument/didOpen");

     CeJsonObj_t text_document_obj = {};
     ce_json_obj_set_string(&text_document_obj, "uri", file_uri);
     ce_json_obj_set_string(&text_document_obj, "languageId", "c");
     ce_json_obj_set_string(&text_document_obj, "text", sanitized_buffer_str);
     CeJsonObj_t param_obj = {};
     ce_json_obj_set_obj(&param_obj, "textDocument", &text_document_obj);
     ce_json_obj_set_obj(&obj, "params", &param_obj);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movb $0x1, %bpl
cmpq $0x0, 0x28(%rdi)
je 0x157db
movq %rsi, %r14
movq 0x58(%rsi), %rax
movq 0x600(%rax), %rax
cmpq 0x248c5(%rip), %rax     # 0x39f60
sete %cl
cmpq 0x248b3(%rip), %rax     # 0x39f58
sete %al
orb %cl, %al
je 0x157c9
movq %rdi, %rbx
movq 0x10(%r14), %rdi
leaq 0x40(%rsp), %rbp
movq %rbp, %rsi
callq 0x157ef
movq %r14, %rdi
callq 0xf88b
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x154a4
movq %rax, %r15
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r12
movaps %xmm0, (%r12)
leaq 0x19959(%rip), %rsi     # 0x2f049
leaq 0x1995a(%rip), %rdx     # 0x2f051
movq %r12, %rdi
callq 0x1c4b8
leaq 0x195ba(%rip), %rsi     # 0x2ecc0
leaq 0x199a9(%rip), %rdx     # 0x2f0b6
movq %r12, %rdi
callq 0x1c4b8
leaq 0x20(%rsp), %r13
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
leaq 0x194da(%rip), %rsi     # 0x2ec03
movq %r13, %rdi
movq %rbp, %rdx
callq 0x1c4b8
leaq 0x19990(%rip), %rsi     # 0x2f0cb
leaq 0x19f90(%rip), %rdx     # 0x2f6d2
movq %r13, %rdi
callq 0x1c4b8
leaq 0x19985(%rip), %rsi     # 0x2f0d6
movq %r13, %rdi
movq %r15, %rdx
callq 0x1c4b8
leaq 0x10(%rsp), %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
leaq 0x1996c(%rip), %rsi     # 0x2f0db
movq %r14, %rdi
movq %r13, %rdx
callq 0x1c1a3
leaq 0x1947b(%rip), %rsi     # 0x2ebfc
movq %r12, %rdi
movq %r14, %rdx
callq 0x1c1a3
addq $0x8, %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x155b2
movl %eax, %ebp
movq %r14, %rdi
callq 0x1c6aa
movq %r13, %rdi
callq 0x1c6aa
movq %r12, %rdi
callq 0x1c6aa
movq %r15, %rdi
callq 0xd090
movq 0x8(%rsp), %rdi
callq 0xd090
jmp 0x157db
movq 0x10(%r14), %rsi
leaq 0x198ca(%rip), %rdi     # 0x2f09e
xorl %eax, %eax
callq 0xd240
movl %ebp, %eax
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq