// File: /workspace/github_c_makefile_star2_O3/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x20894(%rip), %rdi     # 0x2ac50
callq 0x5560
testq %rbx, %rbx
je 0xa41e
movzwl 0x1(%rbx), %edi
callq 0xee73
movzwl %ax, %esi
incl %esi
movq %rbx, %rdi
callq 0xa094
movq 0x20835(%rip), %rax     # 0x2ac18
testq %rax, %rax
je 0xa4b7
movb 0x4(%rax), %cl
cmpb 0x4(%rbx), %cl
jne 0xa4b7
movb 0x5(%rax), %dl
cmpb 0x5(%rbx), %dl
jne 0xa4b7
testb %cl, %cl
je 0xa454
movzwl 0x7(%rax), %edi
callq 0xee73
movl %eax, %ebp
movzwl 0x7(%rbx), %edi
callq 0xee73
jmp 0xa45c
movq 0x207f3(%rip), %rdi     # 0x2ac18
testq %rdi, %rdi
je 0xa52a
callq 0x5040
xorl %eax, %eax
movq %rax, 0x207dc(%rip)     # 0x2ac18
movq %rax, 0x207dd(%rip)     # 0x2ac20
leaq 0x2082e(%rip), %rdi     # 0x2ac78
callq 0x5280
jmp 0xa52a
movzbl 0x7(%rax), %ebp
movzbl 0x7(%rbx), %eax
cmpw %ax, %bp
jne 0xa4b7
movq 0x207b0(%rip), %rdi     # 0x2ac18
callq 0x5040
movq $0x0, 0x207a0(%rip) # 0x2ac18
movzwl 0x1(%rbx), %edi
callq 0xee73
movzwl %ax, %edi
incq %rdi
callq 0x5360
movq %rax, 0x2078d(%rip)     # 0x2ac20
testq %rax, %rax
je 0xa443
movq %rax, %r14
movzwl 0x1(%rbx), %edi
callq 0xee73
movzwl %ax, %edx
incq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x52f0
jmp 0xa443
movb 0x4(%rbx), %al
testb %al, %al
je 0xa4ee
cmpb $0x3, %al
jne 0xa4d4
movzwl 0x9(%rbx), %edi
callq 0xee73
cmpw $0x24, %ax
je 0xa520
movb 0x4(%rbx), %al
cmpb $0x1, %al
jne 0xa50d
movzwl 0x9(%rbx), %edi
callq 0xee73
cmpw $0x22, %ax
jne 0xa50a
movl $0x1005, %edi           # imm = 0x1005
jmp 0xa525
xorl %edi, %edi
cmpw $0x24, 0x8(%rbx)
sete %dil
callq 0xee73
testw %ax, %ax
je 0xa53a
movl $0x1006, %edi           # imm = 0x1006
jmp 0xa525
movb 0x4(%rbx), %al
cmpb $0x3, %al
jne 0xa545
movzwl 0x9(%rbx), %edi
callq 0xee73
cmpw $0x4d, %ax
jne 0xa542
movl $0x1004, %edi           # imm = 0x1004
callq 0x7354
leaq 0x2071f(%rip), %rdi     # 0x2ac50
popq %rbx
popq %r14
popq %rbp
jmp 0x5340
movb 0x4(%rbx), %al
jmp 0xa4be
movb 0x4(%rbx), %al
cmpb $0x1a, %al
jne 0xa570
movzwl 0x9(%rbx), %edi
callq 0xee73
cmpw $0x2f, %ax
jne 0xa570
addq $0x9, %rbx
movl $0x1007, %edi           # imm = 0x1007
movq %rbx, %rsi
movl $0xf, %edx
callq 0x736e
jmp 0xa52a
leaq 0x1fe59(%rip), %rax     # 0x2a3d0
cmpl $0x0, (%rax)
je 0xa52a
movq 0x1fa3d(%rip), %rax     # 0x29fc0
movq (%rax), %rbx
callq 0xea3b
leaq 0x161b7(%rip), %rsi     # 0x20749
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x20702(%rip), %rax     # 0x2aca8
movq (%rax), %rbx
testq %rbx, %rbx
je 0xa52a
callq 0xea3b
leaq 0x1618b(%rip), %rsi     # 0x20749
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
jmp 0xa52a