// File: /workspace/github_c_makefile_star2_O3/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
movl $0x2, %edi
movl $0x23, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xd9a2
leaq 0x16171(%rip), %rcx     # 0x2076a
leaq 0x8(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
movl $0x7530, %edx           # imm = 0x7530
callq 0xa273
movl %eax, %ebp
testl %eax, %eax
sets %al
movq (%r14), %r12
testq %r12, %r12
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xa68d
movq 0x1f994(%rip), %rax     # 0x29fc0
movq (%rax), %rbx
callq 0xea3b
leaq 0x16146(%rip), %rsi     # 0x20781
leaq 0x16128(%rip), %rcx     # 0x2076a
movq %rbx, %rdi
movq %rax, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0x2064f(%rip), %rax     # 0x2aca8
movq (%rax), %rbx
testq %rbx, %rbx
je 0xa74e
callq 0xea3b
leaq 0x16110(%rip), %rsi     # 0x20781
leaq 0x160f2(%rip), %rcx     # 0x2076a
movq %rbx, %rdi
movq %rax, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x52c0
jmp 0xa74e
movzwl 0x10(%r12), %edi
callq 0xee73
testw %ax, %ax
jne 0xa6b1
movzwl 0x12(%r12), %edi
callq 0xee73
testw %ax, %ax
je 0xa75d
movzwl 0x12(%r12), %edi
callq 0xee73
movl %eax, %ebx
movq 0x1f8fb(%rip), %rax     # 0x29fc0
movq (%rax), %r14
callq 0xea3b
movq %rax, %r15
movzwl 0x10(%r12), %edi
callq 0xee73
movzwl %ax, %r8d
movzwl %bx, %ebp
leaq 0x160aa(%rip), %rsi     # 0x20793
leaq 0x1607a(%rip), %rcx     # 0x2076a
movq %r14, %rdi
movq %r15, %rdx
movl %ebp, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x205a1(%rip), %rax     # 0x2aca8
movq (%rax), %rbx
testq %rbx, %rbx
je 0xa744
callq 0xea3b
movq %rax, %r14
movzwl 0x10(%r12), %edi
callq 0xee73
movzwl %ax, %r8d
leaq 0x16066(%rip), %rsi     # 0x20793
leaq 0x16036(%rip), %rcx     # 0x2076a
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
movl $0x1, %esi
callq 0xa1f8
testq %rax, %rax
je 0xa82a
movq %rax, %r14
movzwl 0x1(%rax), %edi
callq 0xee73
testw %ax, %ax
je 0xa82a
addq $0x216, %rbx            # imm = 0x216
movzwl 0x1(%r14), %edi
callq 0xee73
cmpw $0x3f, %ax
movl $0x3f, %ecx
cmovbl %eax, %ecx
movzwl %cx, %r15d
testw %ax, %ax
je 0xa7c6
addq $0x3, %r14
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x52f0
movb $0x0, (%rbx,%r15)
movq 0x1f7ee(%rip), %rax     # 0x29fc0
movq (%rax), %r14
callq 0xea3b
leaq 0x15fdf(%rip), %rsi     # 0x207c0
leaq 0x15f82(%rip), %rcx     # 0x2076a
movq %r14, %rdi
movq %rax, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x52c0
leaq 0x204a9(%rip), %rax     # 0x2aca8
movq (%rax), %r14
testq %r14, %r14
je 0xa82a
callq 0xea3b
leaq 0x15fad(%rip), %rsi     # 0x207c0
leaq 0x15f50(%rip), %rcx     # 0x2076a
movq %r14, %rdi
movq %rax, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x52c0
movq 0x8(%rsp), %rdi
callq 0x5040
xorl %ebp, %ebp
jmp 0xa74e