// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/MPQMUX.c
// Function: dump_qmi
void dump_qmi(void *dataBuffer, int dataLen) 
{
    PQCQMI_HDR QMIHdr = (PQCQMI_HDR)dataBuffer;
    PQCQMUX_HDR QMUXHdr = (PQCQMUX_HDR) (QMIHdr + 1);
    PQCQMICTL_MSG_HDR CTLHdr =  (PQCQMICTL_MSG_HDR) (QMIHdr + 1);

    int i;

    if (!debug_qmi)
        return;

    pthread_mutex_lock(&dumpQMIMutex);
    line[0] = 0;
    for (i = 0; i < dataLen; i++) {
        dbg("%02x ", ((unsigned char *)dataBuffer)[i]);
    }
    dbg_time("%s", line);
    line[0] = 0;
    
    //dbg("QCQMI_HDR-----------------------------------------");
    //dbg("IFType:             %02x\t\t%s", QMIHdr->IFType, QMI_NAME(qmi_IFType, QMIHdr->IFType));
    //dbg("Length:             %04x", le16_to_cpu(QMIHdr->Length));
    //dbg("CtlFlags:           %02x\t\t%s", QMIHdr->CtlFlags, QMI_NAME(qmi_CtlFlags, QMIHdr->CtlFlags));
    //dbg("QMIType:            %02x\t\t%s", QMIHdr->QMIType, QMI_NAME(qmi_QMIType, QMIHdr->QMIType));
    //dbg("ClientId:           %02x", QMIHdr->ClientId);

    if (QMIHdr->QMIType == QMUX_TYPE_CTL) {
        dump_ctl(CTLHdr);
    } else {
        dump_qmux(QMIHdr->QMIType, QMUXHdr);
    }
    dbg_time("%s", line);
    pthread_mutex_unlock(&dumpQMIMutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x28(%rbp)
leaq 0x2b1d6(%rip), %rax     # 0x3758c
cmpl $0x0, (%rax)
jne 0xc3c0
jmp 0xc570
leaq 0x2b9b9(%rip), %rdi     # 0x37d80
callq 0x5570
movb $0x0, 0x2b5ad(%rip)     # 0x37980
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xc456
jmp 0xc3e4
leaq 0x2b595(%rip), %rdi     # 0x37980
callq 0x5160
cmpq $0x400, %rax            # imm = 0x400
jae 0xc447
leaq 0x2b581(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
leaq 0x2b572(%rip), %rax     # 0x37980
addq %rcx, %rax
movq %rax, -0x38(%rbp)
leaq 0x2b564(%rip), %rdi     # 0x37980
callq 0x5160
movq -0x38(%rbp), %rdi
movl $0x400, %esi            # imm = 0x400
subq %rax, %rsi
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
leaq 0x1fbca(%rip), %rdx     # 0x2c00a
movb $0x0, %al
callq 0x51c0
jmp 0xc449
jmp 0xc44b
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xc3da
jmp 0xc458
movq 0x2ab81(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
callq 0x13930
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x1fc35(%rip), %rsi     # 0x2c0ae
leaq 0x2b500(%rip), %rcx     # 0x37980
movb $0x0, %al
callq 0x52c0
leaq 0x2b9da(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xc4c3
leaq 0x2b9cd(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x48(%rbp)
callq 0x13930
movq -0x48(%rbp), %rdi
movq %rax, %rdx
leaq 0x1fbf9(%rip), %rsi     # 0x2c0ae
leaq 0x2b4c4(%rip), %rcx     # 0x37980
movb $0x0, %al
callq 0x52c0
jmp 0xc4c5
movb $0x0, 0x2b4b4(%rip)     # 0x37980
movq -0x18(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
jne 0xc4e4
movq -0x28(%rbp), %rdi
callq 0xb9f0
jmp 0xc4f5
movq -0x18(%rbp), %rax
movzbl 0x4(%rax), %edi
movq -0x20(%rbp), %rsi
callq 0xbd10
jmp 0xc4f7
movq 0x2aae2(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x13930
movq -0x50(%rbp), %rdi
movq %rax, %rdx
leaq 0x1fb96(%rip), %rsi     # 0x2c0ae
leaq 0x2b461(%rip), %rcx     # 0x37980
movb $0x0, %al
callq 0x52c0
leaq 0x2b93b(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xc562
leaq 0x2b92e(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x58(%rbp)
callq 0x13930
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x1fb5a(%rip), %rsi     # 0x2c0ae
leaq 0x2b425(%rip), %rcx     # 0x37980
movb $0x0, %al
callq 0x52c0
jmp 0xc564
leaq 0x2b815(%rip), %rdi     # 0x37d80
callq 0x5350
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)