// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: QmiThreadRecvQMI
void QmiThreadRecvQMI(PQCQMIMSG pResponse) {
    pthread_mutex_lock(&cm_command_mutex);
    if (pResponse == NULL) {
        if (s_pRequest) {
            free(s_pRequest);
            s_pRequest = NULL;
            s_pResponse = NULL;
            pthread_cond_signal(&cm_command_cond);
        }
        pthread_mutex_unlock(&cm_command_mutex);
        return;
    }
    dump_qmi(pResponse, le16_to_cpu(pResponse->QMIHdr.Length) + 1);
    if (s_pRequest && is_response(s_pRequest, pResponse)) {
        free(s_pRequest);
        s_pRequest = NULL;
        s_pResponse = malloc(le16_to_cpu(pResponse->QMIHdr.Length) + 1);
        if (s_pResponse != NULL) {
            memcpy(s_pResponse, pResponse, le16_to_cpu(pResponse->QMIHdr.Length) + 1);
        }
        pthread_cond_signal(&cm_command_cond);
    } else if ((pResponse->QMIHdr.QMIType == QMUX_TYPE_CTL)
                    && (le16_to_cpu(pResponse->CTLMsg.QMICTLMsgHdrRsp.QMICTLType == QMICTL_REVOKE_CLIENT_ID_IND))) {
        qmidevice_send_event_to_main(MODEM_REPORT_RESET_EVENT);
    } else if ((pResponse->QMIHdr.QMIType == QMUX_TYPE_NAS)
                    && (le16_to_cpu(pResponse->MUXMsg.QMUXMsgHdrResp.Type) == QMINAS_SERVING_SYSTEM_IND)) {
        qmidevice_send_event_to_main(RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED);
    } else if ((pResponse->QMIHdr.QMIType == QMUX_TYPE_WDS)
                    && (le16_to_cpu(pResponse->MUXMsg.QMUXMsgHdrResp.Type) == QMIWDS_GET_PKT_SRVC_STATUS_IND)) {
        qmidevice_send_event_to_main(RIL_UNSOL_DATA_CALL_LIST_CHANGED);
    } else if ((pResponse->QMIHdr.QMIType == QMUX_TYPE_NAS)
                    && (le16_to_cpu(pResponse->MUXMsg.QMUXMsgHdrResp.Type) == QMINAS_SYS_INFO_IND)) {
        qmidevice_send_event_to_main(RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED);
    } else if ((pResponse->QMIHdr.QMIType == QMUX_TYPE_WDS_ADMIN)
                    && (le16_to_cpu(pResponse->MUXMsg.QMUXMsgHdrResp.Type) == QMI_WDA_SET_LOOPBACK_CONFIG_IND)) {
    	qmidevice_send_event_to_main_ext(RIL_UNSOL_LOOPBACK_CONFIG_IND,
            &pResponse->MUXMsg.SetLoopBackInd, sizeof(pResponse->MUXMsg.SetLoopBackInd));
    } else {
        if (debug_qmi)
            dbg_time("nobody care this qmi msg!!");
    }
    pthread_mutex_unlock(&cm_command_mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x2b5fd(%rip), %rdi     # 0x37e10
callq 0x5570
cmpq $0x0, -0x8(%rbp)
jne 0xc868
cmpq $0x0, 0x2b5b1(%rip)     # 0x37dd8
je 0xc857
movq 0x2b5a8(%rip), %rdi     # 0x37dd8
callq 0x5040
movq $0x0, 0x2b598(%rip) # 0x37dd8
movq $0x0, 0x2b595(%rip) # 0x37de0
leaq 0x2b5e6(%rip), %rdi     # 0x37e38
callq 0x5280
leaq 0x2b5b2(%rip), %rdi     # 0x37e10
callq 0x5350
jmp 0xcad5
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x1(%rax), %edi
callq 0x13ed0
movq -0x10(%rbp), %rdi
movzwl %ax, %esi
addl $0x1, %esi
callq 0xc380
cmpq $0x0, 0x2b544(%rip)     # 0x37dd8
je 0xc93d
movq 0x2b537(%rip), %rdi     # 0x37dd8
movq -0x8(%rbp), %rsi
callq 0xcae0
cmpl $0x0, %eax
je 0xc93d
movq 0x2b51e(%rip), %rdi     # 0x37dd8
callq 0x5040
movq $0x0, 0x2b50e(%rip) # 0x37dd8
movq -0x8(%rbp), %rax
movzwl 0x1(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x5370
movq %rax, 0x2b4f4(%rip)     # 0x37de0
cmpq $0x0, 0x2b4ec(%rip)     # 0x37de0
je 0xc92c
movq 0x2b4e3(%rip), %rax     # 0x37de0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x1(%rax), %edi
callq 0x13ed0
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzwl %ax, %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x52f0
leaq 0x2b505(%rip), %rdi     # 0x37e38
callq 0x5280
jmp 0xcac9
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
jne 0xc97c
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
cmpl $0x24, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movzwl %ax, %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xc97c
movl $0x1006, %edi           # imm = 0x1006
callq 0x8240
jmp 0xcac7
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x3, %eax
jne 0xc9ad
movq -0x8(%rbp), %rax
movzwl 0x9(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x24, %eax
jne 0xc9ad
movl $0x1004, %edi           # imm = 0x1004
callq 0x8240
jmp 0xcac5
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
jne 0xc9de
movq -0x8(%rbp), %rax
movzwl 0x9(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x22, %eax
jne 0xc9de
movl $0x1005, %edi           # imm = 0x1005
callq 0x8240
jmp 0xcac3
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x3, %eax
jne 0xca0f
movq -0x8(%rbp), %rax
movzwl 0x9(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x4d, %eax
jne 0xca0f
movl $0x1004, %edi           # imm = 0x1004
callq 0x8240
jmp 0xcac1
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1a, %eax
jne 0xca4e
movq -0x8(%rbp), %rax
movzwl 0x9(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x2f, %eax
jne 0xca4e
movq -0x8(%rbp), %rsi
addq $0x6, %rsi
addq $0x3, %rsi
movl $0x1007, %edi           # imm = 0x1007
movl $0xf, %edx
callq 0x8270
jmp 0xcabf
leaq 0x2ab37(%rip), %rax     # 0x3758c
cmpl $0x0, (%rax)
je 0xcabd
jmp 0xca5c
movq 0x2a57d(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x13930
movq -0x28(%rbp), %rdi
movq %rax, %rdx
leaq 0x20eac(%rip), %rsi     # 0x2d929
movb $0x0, %al
callq 0x52c0
leaq 0x2b3dd(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xcab9
leaq 0x2b3d0(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x30(%rbp)
callq 0x13930
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x20e77(%rip), %rsi     # 0x2d929
movb $0x0, %al
callq 0x52c0
jmp 0xcabb
jmp 0xcabd
jmp 0xcabf
jmp 0xcac1
jmp 0xcac3
jmp 0xcac5
jmp 0xcac7
jmp 0xcac9
leaq 0x2b340(%rip), %rdi     # 0x37e10
callq 0x5350
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)