// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_clangd.c
// Function: push_response
static bool _push_response(CeClangDResponseQueue_t* queue, CeJsonObj_t* obj){
     int64_t request_id = -1;
     CeJsonFindResult_t find = ce_json_obj_find(obj, "id");
     if(find.type == CE_JSON_TYPE_NUMBER){
          double* number = ce_json_obj_get_number(obj, &find);
          if(number){
               request_id = (int64_t)(*number);
          }
     }

#if defined(PLATFORM_WINDOWS)
     DWORD result = WaitForSingleObject(queue->mutex, INFINITE);
     if(result != WAIT_OBJECT_0){
          ce_log("Failed to acquire clangd response queue mutex: %d\n", GetLastError());
          return false;
     }
#else
     int rc = pthread_mutex_lock(&queue->mutex);
     if(rc != 0){
         ce_log("Failed to aquire clangd response queue mutex: %s", strerror(rc));
         return false;
     }
#endif

     int64_t new_size = queue->size + 1;
     queue->elements = realloc(queue->elements, new_size * sizeof(queue->elements[0]));
     memset(queue->elements + queue->size, 0, sizeof(queue->elements[0]));
     CeClangDResponse_t* new_response = queue->elements + queue->size;
     new_response->request_id = request_id;
     new_response->obj = obj;
     queue->size = new_size;

#if defined(PLATFORM_WINDOWS)
     ReleaseMutex(queue->mutex);
#else
     rc = pthread_mutex_unlock(&queue->mutex);
     if(rc != 0){
         ce_log("Failed to release clangd response queue mutex: %s", strerror(rc));
     }
#endif
     return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $-0x1, -0x20(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x29583(%rip), %rsi     # 0x45016
callq 0x25e70
movl %eax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
cmpl $0x4, -0x30(%rbp)
jne 0x1bacc
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x26000
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x1baca
movq -0x38(%rbp), %rax
cvttsd2si (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x1bacc
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0xd6e0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x1bb04
movl -0x3c(%rbp), %edi
callq 0xd630
movq %rax, %rsi
leaq 0x285dd(%rip), %rdi     # 0x440d1
movb $0x0, %al
callq 0xd8f0
movb $0x0, -0x1(%rbp)
jmp 0x1bbbb
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
imulq $0x18, -0x48(%rbp), %rsi
callq 0xd500
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
imulq $0x18, (%rax), %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0xd290
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
imulq $0x18, (%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0xd470
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x1bbb7
movl -0x3c(%rbp), %edi
callq 0xd630
movq %rax, %rsi
leaq 0x28552(%rip), %rdi     # 0x44102
movb $0x0, %al
callq 0xd8f0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)