// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: requestQueryDataCall
static int requestQueryDataCall(UCHAR  *pConnectionStatus, int curIpFamily) {
    PQCQMIMSG pRequest;
    PQCQMIMSG pResponse;
    PQMUX_MSG pMUXMsg;
    int err;
    PQMIWDS_PKT_SRVC_TLV pPktSrvc;
    UCHAR oldConnectionStatus = *pConnectionStatus;
    UCHAR QMIType = (curIpFamily == IpFamilyV4) ? QMUX_TYPE_WDS : QMUX_TYPE_WDS_IPV6;

    pRequest = ComposeQMUXMsg(QMIType, QMIWDS_GET_PKT_SRVC_STATUS_REQ, NULL, NULL);
    err = QmiThreadSendQMI(pRequest, &pResponse);
    qmi_rsp_check_and_return();

    *pConnectionStatus = QWDS_PKT_DATA_DISCONNECTED;
    pPktSrvc = (PQMIWDS_PKT_SRVC_TLV)GetTLV(&pResponse->MUXMsg.QMUXMsgHdr, 0x01);
    if (pPktSrvc) {
        *pConnectionStatus = pPktSrvc->ConnectionStatus;
        if ((le16_to_cpu(pPktSrvc->TLVLength) == 2) && (pPktSrvc->ReconfigReqd == 0x01))
            *pConnectionStatus = QWDS_PKT_DATA_DISCONNECTED;
    }

    if (*pConnectionStatus == QWDS_PKT_DATA_DISCONNECTED) {
        if (curIpFamily == IpFamilyV4)
            WdsConnectionIPv4Handle = 0;
        else
            WdsConnectionIPv6Handle = 0;
    }

    if (oldConnectionStatus != *pConnectionStatus || debug_qmi) {
        dbg_time("%s %sConnectionStatus: %s", __func__, (curIpFamily == IpFamilyV4) ? "IPv4" : "IPv6",
            (*pConnectionStatus == QWDS_PKT_DATA_CONNECTED) ? "CONNECTED" : "DISCONNECTED");
    }

    free(pResponse);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x41(%rbp)
movl -0x14(%rbp), %edx
movl $0x11, %eax
movl $0x1, %ecx
cmpl $0x4, %edx
cmovel %ecx, %eax
movb %al, -0x42(%rbp)
movl $0x22, %esi
xorl %eax, %eax
movl %eax, %ecx
movzbl -0x42(%rbp), %edi
movq %rcx, %rdx
callq 0x11170
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x7530, %edx           # imm = 0x7530
leaq 0x1de16(%rip), %rcx     # 0x2de04
callq 0xc670
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0x10007
cmpq $0x0, -0x28(%rbp)
jne 0x10089
jmp 0x10009
movq 0x26fd0(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x13930
movq -0x50(%rbp), %rdi
movq %rax, %rdx
movl -0x34(%rbp), %r8d
leaq 0x1d933(%rip), %rsi     # 0x2d961
leaq 0x1ddcf(%rip), %rcx     # 0x2de04
movb $0x0, %al
callq 0x52c0
leaq 0x27e25(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1007c
leaq 0x27e18(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x58(%rbp)
callq 0x13930
movq -0x58(%rbp), %rdi
movq %rax, %rdx
movl -0x34(%rbp), %r8d
leaq 0x1d8f3(%rip), %rsi     # 0x2d961
leaq 0x1dd8f(%rip), %rcx     # 0x2de04
movb $0x0, %al
callq 0x52c0
jmp 0x1007e
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x10326
movq -0x28(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x0, %eax
jne 0x100c3
movq -0x30(%rbp), %rax
movzwl 0xc(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x1018c
movq -0x30(%rbp), %rax
movzwl 0xc(%rax), %edi
callq 0x13ed0
movw %ax, -0x44(%rbp)
movq 0x26f05(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x68(%rbp)
callq 0x13930
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x13ed0
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rdx
movzwl %ax, %r8d
movzwl -0x44(%rbp), %r9d
leaq 0x1d863(%rip), %rsi     # 0x2d973
leaq 0x1dced(%rip), %rcx     # 0x2de04
movb $0x0, %al
callq 0x52c0
leaq 0x27d43(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x10175
leaq 0x27d36(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x78(%rbp)
callq 0x13930
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x13ed0
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rdx
movzwl %ax, %r8d
movzwl -0x44(%rbp), %r9d
leaq 0x1d80c(%rip), %rsi     # 0x2d973
leaq 0x1dc96(%rip), %rcx     # 0x2de04
movb $0x0, %al
callq 0x52c0
jmp 0x10177
movq -0x28(%rbp), %rdi
callq 0x5040
movzwl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x10326
jmp 0x1018e
movq -0x10(%rbp), %rax
movb $0x1, (%rax)
movq -0x28(%rbp), %rdi
addq $0x6, %rdi
addq $0x3, %rdi
movl $0x1, %esi
callq 0xc580
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x101ee
movq -0x40(%rbp), %rax
movb 0x3(%rax), %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movq -0x40(%rbp), %rax
movzwl 0x1(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x2, %eax
jne 0x101ec
movq -0x40(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
jne 0x101ec
movq -0x10(%rbp), %rax
movb $0x1, (%rax)
jmp 0x101ee
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x10218
cmpl $0x4, -0x14(%rbp)
jne 0x1020c
movl $0x0, 0x27bf6(%rip)     # 0x37e00
jmp 0x10216
movl $0x0, 0x27bee(%rip)     # 0x37e04
jmp 0x10218
movzbl -0x41(%rbp), %eax
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x10237
leaq 0x2735e(%rip), %rax     # 0x3758c
cmpl $0x0, (%rax)
je 0x10316
jmp 0x10239
movq 0x26da0(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x80(%rbp)
callq 0x13930
movq -0x80(%rbp), %rdi
movq %rax, %rdx
movl -0x14(%rbp), %ecx
leaq 0x1ef9f(%rip), %r8      # 0x2f1fc
leaq 0x1ef4d(%rip), %rax     # 0x2f1b1
cmpl $0x4, %ecx
cmoveq %rax, %r8
movq -0x10(%rbp), %rax
movzbl (%rax), %ecx
leaq 0x1dbc0(%rip), %r9      # 0x2de39
leaq 0x1dbbc(%rip), %rax     # 0x2de3c
cmpl $0x2, %ecx
cmoveq %rax, %r9
leaq 0x1db8b(%rip), %rsi     # 0x2de19
leaq 0x1db6f(%rip), %rcx     # 0x2de04
movb $0x0, %al
callq 0x52c0
leaq 0x27bc5(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x10312
leaq 0x27bb8(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x88(%rbp)
callq 0x13930
movq -0x88(%rbp), %rdi
movq %rax, %rdx
movl -0x14(%rbp), %ecx
leaq 0x1ef29(%rip), %r8      # 0x2f1fc
leaq 0x1eed7(%rip), %rax     # 0x2f1b1
cmpl $0x4, %ecx
cmoveq %rax, %r8
movq -0x10(%rbp), %rax
movzbl (%rax), %ecx
leaq 0x1db4a(%rip), %r9      # 0x2de39
leaq 0x1db46(%rip), %rax     # 0x2de3c
cmpl $0x2, %ecx
cmoveq %rax, %r9
leaq 0x1db15(%rip), %rsi     # 0x2de19
leaq 0x1daf9(%rip), %rcx     # 0x2de04
movb $0x0, %al
callq 0x52c0
jmp 0x10314
jmp 0x10316
movq -0x28(%rbp), %rdi
callq 0x5040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)