// File: /workspace/github_c_makefile_star2_O2/Carton32[P]quectel-CM/QMIThread.c
// Function: requestBaseBandVersion
static int requestBaseBandVersion(PROFILE_T *profile) {
    PQCQMIMSG pRequest;
    PQCQMIMSG pResponse;
    PQMUX_MSG pMUXMsg;
    PDEVICE_REV_ID revId;
    int err;

    pRequest = ComposeQMUXMsg(QMUX_TYPE_DMS, QMIDMS_GET_DEVICE_REV_ID_REQ, NULL, NULL);
    err = QmiThreadSendQMI(pRequest, &pResponse);
    qmi_rsp_check_and_return();

    revId = (PDEVICE_REV_ID)GetTLV(&pResponse->MUXMsg.QMUXMsgHdr, 0x01);

    if (revId && le16_to_cpu(revId->TLVLength))
    {
        uchar2char(profile->BaseBandVersion, sizeof(profile->BaseBandVersion), &revId->RevisionID, le16_to_cpu(revId->TLVLength));
        dbg_time("%s %s", __func__, profile->BaseBandVersion);
    }

    free(pResponse);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
pushq $0x2
popq %rdi
pushq $0x23
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xd53c
leaq 0x1456d(%rip), %rcx     # 0x1e76a
leaq 0x8(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
movl $0x7530, %edx           # imm = 0x7530
callq 0x9e8b
movl %eax, %ebp
testl %eax, %eax
sets %al
movq (%r14), %r12
testq %r12, %r12
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xa291
movq 0x1ed88(%rip), %rax     # 0x28fb8
movq (%rax), %rbx
callq 0xe343
leaq 0x14542(%rip), %rsi     # 0x1e781
leaq 0x14524(%rip), %rcx     # 0x1e76a
movq %rbx, %rdi
movq %rax, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0x1fa4b(%rip), %rax     # 0x29ca8
movq (%rax), %rbx
testq %rbx, %rbx
je 0xa352
callq 0xe343
leaq 0x1450c(%rip), %rsi     # 0x1e781
leaq 0x144ee(%rip), %rcx     # 0x1e76a
movq %rbx, %rdi
movq %rax, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x52c0
jmp 0xa352
movzwl 0x10(%r12), %edi
callq 0xe73e
testw %ax, %ax
jne 0xa2b5
movzwl 0x12(%r12), %edi
callq 0xe73e
testw %ax, %ax
je 0xa361
movzwl 0x12(%r12), %edi
callq 0xe73e
movl %eax, %ebx
movq 0x1ecef(%rip), %rax     # 0x28fb8
movq (%rax), %r14
callq 0xe343
movq %rax, %r15
movzwl 0x10(%r12), %edi
callq 0xe73e
movzwl %ax, %r8d
movzwl %bx, %ebp
leaq 0x144a6(%rip), %rsi     # 0x1e793
leaq 0x14476(%rip), %rcx     # 0x1e76a
movq %r14, %rdi
movq %r15, %rdx
movl %ebp, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x1f99d(%rip), %rax     # 0x29ca8
movq (%rax), %rbx
testq %rbx, %rbx
je 0xa348
callq 0xe343
movq %rax, %r14
movzwl 0x10(%r12), %edi
callq 0xe73e
movzwl %ax, %r8d
leaq 0x14462(%rip), %rsi     # 0x1e793
leaq 0x14432(%rip), %rcx     # 0x1e76a
movq %rbx, %rdi
movq %r14, %rdx
movl %ebp, %r9d
xorl %eax, %eax
callq 0x52c0
movq 0x8(%rsp), %rdi
callq 0x5040
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
addq $0x9, %rdi
pushq $0x1
popq %rsi
callq 0x9e14
testq %rax, %rax
je 0xa42a
movq %rax, %r14
movzwl 0x1(%rax), %edi
callq 0xe73e
testw %ax, %ax
je 0xa42a
addq $0x216, %rbx            # imm = 0x216
movzwl 0x1(%r14), %edi
callq 0xe73e
cmpw $0x3f, %ax
pushq $0x3f
popq %rcx
cmovbl %eax, %ecx
movzwl %cx, %r15d
testw %ax, %ax
je 0xa3c6
addq $0x3, %r14
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x52f0
movb $0x0, (%rbx,%r15)
movq 0x1ebe6(%rip), %rax     # 0x28fb8
movq (%rax), %r14
callq 0xe343
leaq 0x143df(%rip), %rsi     # 0x1e7c0
leaq 0x14382(%rip), %rcx     # 0x1e76a
movq %r14, %rdi
movq %rax, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x52c0
leaq 0x1f8a9(%rip), %rax     # 0x29ca8
movq (%rax), %r14
testq %r14, %r14
je 0xa42a
callq 0xe343
leaq 0x143ad(%rip), %rsi     # 0x1e7c0
leaq 0x14350(%rip), %rcx     # 0x1e76a
movq %r14, %rdi
movq %rax, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x52c0
movq 0x8(%rsp), %rdi
callq 0x5040
xorl %ebp, %ebp
jmp 0xa352