// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_app.c
// Function: extract_diagnostics_from_response
CeClangDDiagnostics_t _extract_diagnostics_from_response(CeJsonObj_t* obj){
     CeClangDDiagnostics_t result = {};

     CeJsonFindResult_t params_find = ce_json_obj_find(obj, "params");
     if(params_find.type != CE_JSON_TYPE_OBJECT){
         return result;
     }
     CeJsonObj_t* params_obj = ce_json_obj_get_obj(obj, &params_find);
     if(params_obj == NULL){
         return result;
     }

     CeJsonFindResult_t uri_find = ce_json_obj_find(params_obj, "uri");
     if(uri_find.type != CE_JSON_TYPE_STRING){
         return result;
     }

     const char* file_uri = ce_json_obj_get_string(params_obj, &uri_find);
     if(file_uri == NULL){
         return result;
     }
     result.filepath = strdup(file_uri);
#if defined(PLATFORM_WINDOWS)
     _convert_uri_to_windows_path(result.filepath);
#else
     _convert_uri_to_linux_path(result.filepath);
#endif

     CeJsonFindResult_t diagnostics_find = ce_json_obj_find(params_obj, "diagnostics");
     if(diagnostics_find.type != CE_JSON_TYPE_ARRAY){
         return result;
     }

     CeJsonArray_t* diagnostics_array = ce_json_obj_get_array(params_obj, &diagnostics_find);
     if(diagnostics_array == NULL){
         return result;
     }

     for(int64_t i = 0; i < diagnostics_array->count; i++){
          CeJsonValue_t* value = diagnostics_array->values + i;
          if(value->type != CE_JSON_TYPE_OBJECT){
               continue;
          }

          CeJsonFindResult_t message_find = ce_json_obj_find(&value->obj, "message");
          if(message_find.type != CE_JSON_TYPE_STRING){
              continue;
          }
          CeClangDDiagnostic_t diag = {};
          diag.message = (char*)(ce_json_obj_get_string(&value->obj, &message_find));
          if(diag.message == NULL){
              continue;
          }

          CeJsonFindResult_t range_find = ce_json_obj_find(&value->obj, "range");
          if(range_find.type != CE_JSON_TYPE_OBJECT){
              continue;
          }

          CeJsonObj_t* range_obj = ce_json_obj_get_obj(&value->obj, &range_find);
          if(range_obj == NULL){
              continue;
          }

          // This logic can be compressed.
          {
              CeJsonFindResult_t start_find = ce_json_obj_find(range_obj, "start");
              if(start_find.type != CE_JSON_TYPE_OBJECT){
                   continue;
              }
              CeJsonObj_t* start_obj = ce_json_obj_get_obj(range_obj, &start_find);
              if(start_obj == NULL){
                   continue;
              }
              CeJsonFindResult_t line_find = ce_json_obj_find(start_obj, "line");
              if(line_find.type != CE_JSON_TYPE_NUMBER){
                   continue;
              }
              CeJsonFindResult_t character_find = ce_json_obj_find(start_obj, "character");
              if(character_find.type != CE_JSON_TYPE_NUMBER){
                   continue;
              }
              diag.start.x = (int64_t)(*ce_json_obj_get_number(start_obj, &character_find));
              diag.start.y = (int64_t)(*ce_json_obj_get_number(start_obj, &line_find));
          }
          {
              CeJsonFindResult_t end_find = ce_json_obj_find(range_obj, "end");
              if(end_find.type != CE_JSON_TYPE_OBJECT){
                   continue;
              }
              CeJsonObj_t* end_obj = ce_json_obj_get_obj(range_obj, &end_find);
              if(end_obj == NULL){
                   continue;
              }
              CeJsonFindResult_t line_find = ce_json_obj_find(end_obj, "line");
              if(line_find.type != CE_JSON_TYPE_NUMBER){
                   continue;
              }
              CeJsonFindResult_t character_find = ce_json_obj_find(end_obj, "character");
              if(character_find.type != CE_JSON_TYPE_NUMBER){
                   continue;
              }
              diag.end.x = (int64_t)(*ce_json_obj_get_number(end_obj, &character_find));
              diag.end.y = (int64_t)(*ce_json_obj_get_number(end_obj, &line_find));
          }

          ce_clangd_diag_add(&result, &diag);
     }

     return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x130(%rbp)
movq %rdi, %rax
movq %rax, -0x128(%rbp)
movq %rsi, -0x8(%rbp)
xorl %esi, %esi
movl $0x18, %edx
callq 0xd290
movq -0x8(%rbp), %rdi
leaq 0x2d136(%rip), %rsi     # 0x43bad
callq 0x25e70
movl %eax, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
cmpl $0x1, -0x18(%rbp)
je 0x16a8e
jmp 0x16e36
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x25f10
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x16aab
jmp 0x16e36
movq -0x20(%rbp), %rdi
leaq 0x2d0fe(%rip), %rsi     # 0x43bb4
callq 0x25e70
movl %eax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
cmpl $0x3, -0x30(%rbp)
je 0x16acd
jmp 0x16e36
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x25fb0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x16aea
jmp 0x16e36
movq -0x38(%rbp), %rdi
callq 0xd620
movq %rax, %rcx
movq -0x130(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rax), %rdi
callq 0x16e50
movq -0x20(%rbp), %rdi
leaq 0x2d0a3(%rip), %rsi     # 0x43bb8
callq 0x25e70
movl %eax, -0x48(%rbp)
movq %rdx, -0x40(%rbp)
cmpl $0x2, -0x48(%rbp)
je 0x16b2c
jmp 0x16e36
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x25f60
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x16b49
jmp 0x16e36
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x16e34
movq -0x50(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpl $0x1, (%rax)
je 0x16b84
jmp 0x16e23
movq -0x60(%rbp), %rdi
addq $0x8, %rdi
leaq 0x2d031(%rip), %rsi     # 0x43bc4
callq 0x25e70
movl %eax, -0x70(%rbp)
movq %rdx, -0x68(%rbp)
cmpl $0x3, -0x70(%rbp)
je 0x16baa
jmp 0x16e23
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0xd290
movq -0x60(%rbp), %rdi
addq $0x8, %rdi
leaq -0x70(%rbp), %rsi
callq 0x25fb0
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x16bde
jmp 0x16e23
movq -0x60(%rbp), %rdi
addq $0x8, %rdi
leaq 0x2cfb0(%rip), %rsi     # 0x43b9d
callq 0x25e70
movl %eax, -0xa8(%rbp)
movq %rdx, -0xa0(%rbp)
cmpl $0x1, -0xa8(%rbp)
je 0x16c0d
jmp 0x16e23
movq -0x60(%rbp), %rdi
addq $0x8, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x25f10
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
jne 0x16c37
jmp 0x16e23
movq -0xb0(%rbp), %rdi
leaq 0x2ba20(%rip), %rsi     # 0x42665
callq 0x25e70
movl %eax, -0xc0(%rbp)
movq %rdx, -0xb8(%rbp)
cmpl $0x1, -0xc0(%rbp)
je 0x16c65
jmp 0x16e23
movq -0xb0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x25f10
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0xc8(%rbp)
jne 0x16c8e
jmp 0x16e23
movq -0xc8(%rbp), %rdi
leaq 0x2bfd2(%rip), %rsi     # 0x42c6e
callq 0x25e70
movl %eax, -0xd8(%rbp)
movq %rdx, -0xd0(%rbp)
cmpl $0x4, -0xd8(%rbp)
je 0x16cbc
jmp 0x16e23
movq -0xc8(%rbp), %rdi
leaq 0x2ced9(%rip), %rsi     # 0x43ba3
callq 0x25e70
movl %eax, -0xe8(%rbp)
movq %rdx, -0xe0(%rbp)
cmpl $0x4, -0xe8(%rbp)
je 0x16cea
jmp 0x16e23
movq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x26000
cvttsd2si (%rax), %rax
movq %rax, -0x98(%rbp)
movq -0xc8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x26000
cvttsd2si (%rax), %rax
movq %rax, -0x90(%rbp)
movq -0xb0(%rbp), %rdi
leaq 0x2b982(%rip), %rsi     # 0x426b8
callq 0x25e70
movl %eax, -0xf8(%rbp)
movq %rdx, -0xf0(%rbp)
cmpl $0x1, -0xf8(%rbp)
je 0x16d56
jmp 0x16e23
movq -0xb0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x25f10
movq %rax, -0x100(%rbp)
cmpq $0x0, -0x100(%rbp)
jne 0x16d7f
jmp 0x16e23
movq -0x100(%rbp), %rdi
leaq 0x2bee1(%rip), %rsi     # 0x42c6e
callq 0x25e70
movl %eax, -0x110(%rbp)
movq %rdx, -0x108(%rbp)
cmpl $0x4, -0x110(%rbp)
je 0x16daa
jmp 0x16e23
movq -0x100(%rbp), %rdi
leaq 0x2cdeb(%rip), %rsi     # 0x43ba3
callq 0x25e70
movl %eax, -0x120(%rbp)
movq %rdx, -0x118(%rbp)
cmpl $0x4, -0x120(%rbp)
je 0x16dd5
jmp 0x16e23
movq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x26000
cvttsd2si (%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x100(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x26000
movq -0x130(%rbp), %rdi
cvttsd2si (%rax), %rax
movq %rax, -0x80(%rbp)
leaq -0x98(%rbp), %rsi
callq 0x1b620
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x16b51
jmp 0x16e36
movq -0x128(%rbp), %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw %cs:(%rax,%rax)