// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl $0x2, %edi
movl $0x23, %esi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x11170
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x7530, %edx           # imm = 0x7530
leaq 0x20d7d(%rip), %rcx     # 0x2d94a
callq 0xc670
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0xcbe6
cmpq $0x0, -0x20(%rbp)
jne 0xcc68
jmp 0xcbe8
movq 0x2a3f1(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
callq 0x13930
movq -0x40(%rbp), %rdi
movq %rax, %rdx
movl -0x34(%rbp), %r8d
leaq 0x20d54(%rip), %rsi     # 0x2d961
leaq 0x20d36(%rip), %rcx     # 0x2d94a
movb $0x0, %al
callq 0x52c0
leaq 0x2b246(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xcc5b
leaq 0x2b239(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x48(%rbp)
callq 0x13930
movq -0x48(%rbp), %rdi
movq %rax, %rdx
movl -0x34(%rbp), %r8d
leaq 0x20d14(%rip), %rsi     # 0x2d961
leaq 0x20cf6(%rip), %rcx     # 0x2d94a
movb $0x0, %al
callq 0x52c0
jmp 0xcc5d
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xce84
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x0, %eax
jne 0xcca2
movq -0x28(%rbp), %rax
movzwl 0xc(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xcd6b
movq -0x28(%rbp), %rax
movzwl 0xc(%rax), %edi
callq 0x13ed0
movw %ax, -0x36(%rbp)
movq 0x2a326(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x58(%rbp)
callq 0x13930
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x13ed0
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rdx
movzwl %ax, %r8d
movzwl -0x36(%rbp), %r9d
leaq 0x20c84(%rip), %rsi     # 0x2d973
leaq 0x20c54(%rip), %rcx     # 0x2d94a
movb $0x0, %al
callq 0x52c0
leaq 0x2b164(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xcd54
leaq 0x2b157(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x68(%rbp)
callq 0x13930
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x13ed0
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rdx
movzwl %ax, %r8d
movzwl -0x36(%rbp), %r9d
leaq 0x20c2d(%rip), %rsi     # 0x2d973
leaq 0x20bfd(%rip), %rcx     # 0x2d94a
movb $0x0, %al
callq 0x52c0
jmp 0xcd56
movq -0x20(%rbp), %rdi
callq 0x5040
movzwl -0x36(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xce84
jmp 0xcd6d
movq -0x20(%rbp), %rdi
addq $0x6, %rdi
addq $0x3, %rdi
movl $0x1, %esi
callq 0xc580
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xce74
movq -0x30(%rbp), %rax
movzwl 0x1(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xce74
movq -0x10(%rbp), %rax
addq $0x216, %rax            # imm = 0x216
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movzwl 0x1(%rax), %edi
callq 0x13ed0
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rdx
movzwl %ax, %eax
movl %eax, %ecx
movl $0x40, %esi
callq 0x11380
movq 0x2a1f0(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x80(%rbp)
callq 0x13930
movq -0x80(%rbp), %rdi
movq %rax, %rdx
movq -0x10(%rbp), %r8
addq $0x216, %r8             # imm = 0x216
leaq 0x20b8b(%rip), %rsi     # 0x2d9a0
leaq 0x20b2e(%rip), %rcx     # 0x2d94a
movb $0x0, %al
callq 0x52c0
leaq 0x2b03e(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xce70
leaq 0x2b031(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x88(%rbp)
callq 0x13930
movq -0x88(%rbp), %rdi
movq %rax, %rdx
movq -0x10(%rbp), %r8
addq $0x216, %r8             # imm = 0x216
leaq 0x20b3e(%rip), %rsi     # 0x2d9a0
leaq 0x20ae1(%rip), %rcx     # 0x2d94a
movb $0x0, %al
callq 0x52c0
jmp 0xce72
jmp 0xce74
movq -0x20(%rbp), %rdi
callq 0x5040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq