// File: /workspace/github_c_makefile_star2_O1/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 0xda86
leaq 0x160df(%rip), %rcx     # 0x2076e
leaq 0x8(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
movl $0x7530, %edx           # imm = 0x7530
callq 0xa317
movl %eax, %ebp
testl %eax, %eax
sets %al
movq (%r14), %r12
testq %r12, %r12
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xa723
movq 0x1f8fe(%rip), %rax     # 0x29fc0
movq (%rax), %rbx
callq 0xeb2f
leaq 0x160b4(%rip), %rsi     # 0x20785
leaq 0x16096(%rip), %rcx     # 0x2076e
movq %rbx, %rdi
movq %rax, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0x205b9(%rip), %rax     # 0x2aca8
movq (%rax), %rbx
testq %rbx, %rbx
je 0xa7e4
callq 0xeb2f
leaq 0x1607e(%rip), %rsi     # 0x20785
leaq 0x16060(%rip), %rcx     # 0x2076e
movq %rbx, %rdi
movq %rax, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x52c0
jmp 0xa7e4
movzwl 0x10(%r12), %edi
callq 0xef61
testw %ax, %ax
jne 0xa747
movzwl 0x12(%r12), %edi
callq 0xef61
testw %ax, %ax
je 0xa7f3
movzwl 0x12(%r12), %edi
callq 0xef61
movl %eax, %ebx
movq 0x1f865(%rip), %rax     # 0x29fc0
movq (%rax), %r14
callq 0xeb2f
movq %rax, %r15
movzwl 0x10(%r12), %edi
callq 0xef61
movzwl %ax, %r8d
movzwl %bx, %ebp
leaq 0x16018(%rip), %rsi     # 0x20797
leaq 0x15fe8(%rip), %rcx     # 0x2076e
movq %r14, %rdi
movq %r15, %rdx
movl %ebp, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x2050b(%rip), %rax     # 0x2aca8
movq (%rax), %rbx
testq %rbx, %rbx
je 0xa7da
callq 0xeb2f
movq %rax, %r14
movzwl 0x10(%r12), %edi
callq 0xef61
movzwl %ax, %r8d
leaq 0x15fd4(%rip), %rsi     # 0x20797
leaq 0x15fa4(%rip), %rcx     # 0x2076e
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 0xa29c
testq %rax, %rax
je 0xa8c0
movq %rax, %r14
movzwl 0x1(%rax), %edi
callq 0xef61
testw %ax, %ax
je 0xa8c0
addq $0x216, %rbx            # imm = 0x216
movzwl 0x1(%r14), %edi
callq 0xef61
cmpw $0x3f, %ax
movl $0x3f, %ecx
cmovbl %eax, %ecx
movzwl %cx, %r15d
testw %ax, %ax
je 0xa85c
addq $0x3, %r14
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x52f0
movb $0x0, (%rbx,%r15)
movq 0x1f758(%rip), %rax     # 0x29fc0
movq (%rax), %r14
callq 0xeb2f
leaq 0x15f4d(%rip), %rsi     # 0x207c4
leaq 0x15ef0(%rip), %rcx     # 0x2076e
movq %r14, %rdi
movq %rax, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x52c0
leaq 0x20413(%rip), %rax     # 0x2aca8
movq (%rax), %r14
testq %r14, %r14
je 0xa8c0
callq 0xeb2f
leaq 0x15f1b(%rip), %rsi     # 0x207c4
leaq 0x15ebe(%rip), %rcx     # 0x2076e
movq %r14, %rdi
movq %rax, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x52c0
movq 0x8(%rsp), %rdi
callq 0x5040
xorl %ebp, %ebp
jmp 0xa7e4