// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/MPQMUX.c
// Function: dump_qmux
int dump_qmux(QMI_SERVICE_TYPE serviceType, PQCQMUX_HDR QMUXHdr) {
    PQCQMUX_MSG_HDR QMUXMsgHdr = (PQCQMUX_MSG_HDR) (QMUXHdr + 1);
    const char *tag;

    //dbg("QCQMUX--------------------------------------------\n");
    switch (QMUXHdr->CtlFlags&QMUX_CTL_FLAG_MASK_TYPE) {
        case QMUX_CTL_FLAG_TYPE_CMD: tag = "_REQ"; break;
        case QMUX_CTL_FLAG_TYPE_RSP: tag = "_RESP"; break;
        case QMUX_CTL_FLAG_TYPE_IND: tag = "_IND"; break;
        default: tag = 0; break;
    }
    //dbg("CtlFlags:           %02x\t\t%s\n", QMUXHdr->CtlFlags, QMUX_NAME(qmux_CtlFlags, QMUXHdr->CtlFlags, tag));
    dbg("TransactionId:    %04x\n", le16_to_cpu(QMUXHdr->TransactionId));

    //dbg("QCQMUX_MSG_HDR-----------------------------------\n");
    switch (serviceType) {
        case QMUX_TYPE_DMS:
            dbg("Type:               %04x\t%s\n", le16_to_cpu(QMUXMsgHdr->Type),
            QMUX_NAME(qmux_dms_Type, le16_to_cpu(QMUXMsgHdr->Type), tag));
        break;
        case QMUX_TYPE_NAS:
            dbg("Type:               %04x\t%s\n", le16_to_cpu(QMUXMsgHdr->Type),
            QMUX_NAME(qmux_nas_Type, le16_to_cpu(QMUXMsgHdr->Type), tag));
        break;
        case QMUX_TYPE_WDS:
        case QMUX_TYPE_WDS_IPV6:
            dbg("Type:               %04x\t%s\n", le16_to_cpu(QMUXMsgHdr->Type),
            QMUX_NAME(qmux_wds_Type, le16_to_cpu(QMUXMsgHdr->Type), tag));
        break;
        case QMUX_TYPE_WMS:
            dbg("Type:               %04x\t%s\n", le16_to_cpu(QMUXMsgHdr->Type),
            QMUX_NAME(qmux_wms_Type, le16_to_cpu(QMUXMsgHdr->Type), tag));
        break;
        case QMUX_TYPE_WDS_ADMIN:
            dbg("Type:               %04x\t%s\n", le16_to_cpu(QMUXMsgHdr->Type),
            QMUX_NAME(qmux_wds_admin_Type, le16_to_cpu(QMUXMsgHdr->Type), tag));
        break;
        case QMUX_TYPE_UIM:
            dbg("Type:               %04x\t%s\n", le16_to_cpu(QMUXMsgHdr->Type),
            QMUX_NAME(qmux_uim_Type, le16_to_cpu(QMUXMsgHdr->Type), tag));
        break;
        case QMUX_TYPE_PDS:
        case QMUX_TYPE_QOS:
        case QMUX_TYPE_CTL:                
        default:
            dbg("Type:               %04x\t%s\n", le16_to_cpu(QMUXMsgHdr->Type), "PDS/QOS/CTL/unknown!");
        break;    
    }
    dbg("Length:             %04x\n", le16_to_cpu(QMUXMsgHdr->Length));

    dump_tlv(QMUXMsgHdr);
    
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
andl $0x6, %eax
movl %eax, -0x24(%rbp)
je 0xbd53
jmp 0xbd3f
movl -0x24(%rbp), %eax
subl $0x2, %eax
je 0xbd60
jmp 0xbd49
movl -0x24(%rbp), %eax
subl $0x4, %eax
je 0xbd6d
jmp 0xbd7a
leaq 0x2090c(%rip), %rax     # 0x2c666
movq %rax, -0x20(%rbp)
jmp 0xbd82
leaq 0x2091d(%rip), %rax     # 0x2c684
movq %rax, -0x20(%rbp)
jmp 0xbd82
leaq 0x20502(%rip), %rax     # 0x2c276
movq %rax, -0x20(%rbp)
jmp 0xbd82
movq $0x0, -0x20(%rbp)
jmp 0xbd84
leaq 0x2bbf5(%rip), %rdi     # 0x37980
callq 0x5160
cmpq $0x400, %rax            # imm = 0x400
jae 0xbdf6
leaq 0x2bbe1(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
leaq 0x2bbd2(%rip), %rax     # 0x37980
addq %rcx, %rax
movq %rax, -0x38(%rbp)
leaq 0x2bbc4(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
movl $0x400, %eax            # imm = 0x400
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x1(%rax), %edi
callq 0x13ed0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movzwl %ax, %ecx
leaq 0x20275(%rip), %rdx     # 0x2c064
movb $0x0, %al
callq 0x51c0
jmp 0xbdf8
movl -0x4(%rbp), %eax
movq %rax, -0x40(%rbp)
subq $0x1a, %rax
ja 0xc25d
movq -0x40(%rbp), %rax
leaq 0x2017c(%rip), %rcx     # 0x2bf90
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0xbe1f
leaq 0x2bb5a(%rip), %rdi     # 0x37980
callq 0x5160
cmpq $0x400, %rax            # imm = 0x400
jae 0xbec1
leaq 0x2bb42(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
leaq 0x2bb33(%rip), %rax     # 0x37980
addq %rcx, %rax
movq %rax, -0x58(%rbp)
leaq 0x2bb25(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
movl $0x400, %eax            # imm = 0x400
subq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %edx
movq -0x20(%rbp), %rcx
leaq 0x298f5(%rip), %rdi     # 0x35790
movl $0x33, %esi
callq 0xbbf0
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x44(%rbp), %ecx
movq %rax, %r8
leaq 0x201c2(%rip), %rdx     # 0x2c07c
movb $0x0, %al
callq 0x51c0
jmp 0xbec3
jmp 0xc2e7
jmp 0xbeca
leaq 0x2baaf(%rip), %rdi     # 0x37980
callq 0x5160
cmpq $0x400, %rax            # imm = 0x400
jae 0xbf6c
leaq 0x2ba97(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
leaq 0x2ba88(%rip), %rax     # 0x37980
addq %rcx, %rax
movq %rax, -0x70(%rbp)
leaq 0x2ba7a(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
movl $0x400, %eax            # imm = 0x400
subq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
movl %eax, -0x5c(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %edx
movq -0x20(%rbp), %rcx
leaq 0x29b7a(%rip), %rdi     # 0x35ac0
movl $0x27, %esi
callq 0xbbf0
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
movl -0x5c(%rbp), %ecx
movq %rax, %r8
leaq 0x20117(%rip), %rdx     # 0x2c07c
movb $0x0, %al
callq 0x51c0
jmp 0xbf6e
jmp 0xc2e7
jmp 0xbf75
leaq 0x2ba04(%rip), %rdi     # 0x37980
callq 0x5160
cmpq $0x400, %rax            # imm = 0x400
jae 0xc01d
leaq 0x2b9ec(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
leaq 0x2b9dd(%rip), %rax     # 0x37980
addq %rcx, %rax
movq %rax, -0x88(%rbp)
leaq 0x2b9cc(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
movl $0x400, %eax            # imm = 0x400
subq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
movl %eax, -0x74(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %edx
movq -0x20(%rbp), %rcx
leaq 0x29d3c(%rip), %rdi     # 0x35d30
movl $0x23, %esi
callq 0xbbf0
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
movl -0x74(%rbp), %ecx
movq %rax, %r8
leaq 0x20066(%rip), %rdx     # 0x2c07c
movb $0x0, %al
callq 0x51c0
jmp 0xc01f
jmp 0xc2e7
jmp 0xc026
leaq 0x2b953(%rip), %rdi     # 0x37980
callq 0x5160
cmpq $0x400, %rax            # imm = 0x400
jae 0xc0da
leaq 0x2b93b(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
leaq 0x2b92c(%rip), %rax     # 0x37980
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
leaq 0x2b91b(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
movl $0x400, %eax            # imm = 0x400
subq %rcx, %rax
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
movl %eax, -0x8c(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %edx
movq -0x20(%rbp), %rcx
leaq 0x29eb5(%rip), %rdi     # 0x35f60
movl $0x17, %esi
callq 0xbbf0
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movl -0x8c(%rbp), %ecx
movq %rax, %r8
leaq 0x1ffa9(%rip), %rdx     # 0x2c07c
movb $0x0, %al
callq 0x51c0
jmp 0xc0dc
jmp 0xc2e7
jmp 0xc0e3
leaq 0x2b896(%rip), %rdi     # 0x37980
callq 0x5160
cmpq $0x400, %rax            # imm = 0x400
jae 0xc197
leaq 0x2b87e(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
leaq 0x2b86f(%rip), %rax     # 0x37980
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
leaq 0x2b85e(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
movl $0x400, %eax            # imm = 0x400
subq %rcx, %rax
movq %rax, -0xb0(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
movl %eax, -0xa4(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %edx
movq -0x20(%rbp), %rcx
leaq 0x29f68(%rip), %rdi     # 0x360d0
movl $0xb, %esi
callq 0xbbf0
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movl -0xa4(%rbp), %ecx
movq %rax, %r8
leaq 0x1feec(%rip), %rdx     # 0x2c07c
movb $0x0, %al
callq 0x51c0
jmp 0xc199
jmp 0xc2e7
jmp 0xc1a0
leaq 0x2b7d9(%rip), %rdi     # 0x37980
callq 0x5160
cmpq $0x400, %rax            # imm = 0x400
jae 0xc254
leaq 0x2b7c1(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
leaq 0x2b7b2(%rip), %rax     # 0x37980
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
leaq 0x2b7a1(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
movl $0x400, %eax            # imm = 0x400
subq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
movl %eax, -0xbc(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movzwl %ax, %edx
movq -0x20(%rbp), %rcx
leaq 0x29f5b(%rip), %rdi     # 0x36180
movl $0x1f, %esi
callq 0xbbf0
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movl -0xbc(%rbp), %ecx
movq %rax, %r8
leaq 0x1fe2f(%rip), %rdx     # 0x2c07c
movb $0x0, %al
callq 0x51c0
jmp 0xc256
jmp 0xc2e7
jmp 0xc25d
jmp 0xc25f
leaq 0x2b71a(%rip), %rdi     # 0x37980
callq 0x5160
cmpq $0x400, %rax            # imm = 0x400
jae 0xc2e3
leaq 0x2b706(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
leaq 0x2b6f7(%rip), %rax     # 0x37980
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
leaq 0x2b6e6(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
movl $0x400, %eax            # imm = 0x400
subq %rcx, %rax
movq %rax, -0xd8(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %edi
callq 0x13ed0
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movzwl %ax, %ecx
leaq 0x1fda7(%rip), %rdx     # 0x2c07c
leaq 0x1fdbd(%rip), %r8      # 0x2c099
movb $0x0, %al
callq 0x51c0
jmp 0xc2e5
jmp 0xc2e7
jmp 0xc2e9
leaq 0x2b690(%rip), %rdi     # 0x37980
callq 0x5160
cmpq $0x400, %rax            # imm = 0x400
jae 0xc367
leaq 0x2b67c(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
leaq 0x2b66d(%rip), %rax     # 0x37980
addq %rcx, %rax
movq %rax, -0xf0(%rbp)
leaq 0x2b65c(%rip), %rdi     # 0x37980
callq 0x5160
movq %rax, %rcx
movl $0x400, %eax            # imm = 0x400
subq %rcx, %rax
movq %rax, -0xe8(%rbp)
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x13ed0
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
movzwl %ax, %ecx
leaq 0x1fcea(%rip), %rdx     # 0x2c04a
movb $0x0, %al
callq 0x51c0
jmp 0xc369
movq -0x18(%rbp), %rdi
callq 0xb820
xorl %eax, %eax
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax)