// File: /workspace/github_c_makefile_star2_O2/Carton32[P]quectel-CM/QMIThread.c
// Function: requestDeactivateDefaultPDP
static int requestDeactivateDefaultPDP(PROFILE_T *profile, int curIpFamily) {
    PQCQMIMSG pRequest;
    PQCQMIMSG pResponse;
    PQMUX_MSG pMUXMsg;
    int err;
    UCHAR QMIType = (curIpFamily == 0x04) ? QMUX_TYPE_WDS : QMUX_TYPE_WDS_IPV6;

    (void)profile;
    if (curIpFamily == IpFamilyV4 && WdsConnectionIPv4Handle == 0)
        return 0;
    if (curIpFamily == IpFamilyV6 && WdsConnectionIPv6Handle == 0)
        return 0;

    dbg_time("%s WdsConnectionIPv%dHandle", __func__, curIpFamily == IpFamilyV4 ? 4 : 6);

    pRequest = ComposeQMUXMsg(QMIType, QMIWDS_STOP_NETWORK_INTERFACE_REQ , WdsStopNwInterfaceReq, &curIpFamily);
    err = QmiThreadSendQMI(pRequest, &pResponse);
    qmi_rsp_check_and_return();

    if (curIpFamily == IpFamilyV4)
        WdsConnectionIPv4Handle = 0;
    else
         WdsConnectionIPv6Handle = 0;
    free(pResponse);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %ebx, %ebx
movl %esi, 0xc(%rsp)
cmpl $0x4, %esi
setne %bpl
jne 0xcc97
cmpl $0x0, 0x1cfab(%rip)     # 0x29c3c
je 0xce74
cmpl $0x6, %esi
jne 0xcca9
cmpl $0x0, 0x1cf9d(%rip)     # 0x29c40
je 0xce74
shlb $0x4, %bpl
incb %bpl
xorl %ebx, %ebx
cmpl $0x4, %esi
setne %bl
movq 0x1c2f9(%rip), %r15     # 0x28fb8
movq (%r15), %r14
callq 0xe343
leal 0x4(,%rbx,2), %ebx
leaq 0x11f91(%rip), %rsi     # 0x1ec66
leaq 0x11fac(%rip), %rcx     # 0x1ec88
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0x1cfb5(%rip), %r12     # 0x29ca8
movq (%r12), %r14
testq %r14, %r14
je 0xcd1f
callq 0xe343
leaq 0x11f5e(%rip), %rsi     # 0x1ec66
leaq 0x11f79(%rip), %rcx     # 0x1ec88
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
movzbl %bpl, %edi
leaq 0x13f4(%rip), %rdx      # 0xe11e
pushq $0x21
popq %rsi
leaq 0xc(%rsp), %rcx
callq 0xd53c
leaq 0x11f4a(%rip), %rcx     # 0x1ec88
leaq 0x10(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
movl $0x7530, %edx           # imm = 0x7530
callq 0x9e8b
movl %eax, %ebx
testl %eax, %eax
sets %al
movq (%r14), %r13
testq %r13, %r13
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xcdc5
movq (%r15), %r14
callq 0xe343
leaq 0x11a08(%rip), %rsi     # 0x1e781
leaq 0x11f08(%rip), %rcx     # 0x1ec88
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
movq (%r12), %r14
testq %r14, %r14
je 0xce74
callq 0xe343
leaq 0x119d8(%rip), %rsi     # 0x1e781
leaq 0x11ed8(%rip), %rcx     # 0x1ec88
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
jmp 0xce74
movzwl 0x10(%r13), %edi
callq 0xe73e
testw %ax, %ax
jne 0xcde7
movzwl 0x12(%r13), %edi
callq 0xe73e
testw %ax, %ax
je 0xce85
movzwl 0x12(%r13), %edi
callq 0xe73e
movl %eax, %ebx
movq (%r15), %r14
callq 0xe343
movq %rax, %r15
movzwl 0x10(%r13), %edi
callq 0xe73e
movzwl %ax, %r8d
movzwl %bx, %ebx
leaq 0x1197d(%rip), %rsi     # 0x1e793
leaq 0x11e6b(%rip), %rcx     # 0x1ec88
movq %r14, %rdi
movq %r15, %rdx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
movq (%r12), %r14
testq %r14, %r14
je 0xce6a
callq 0xe343
movq %rax, %r15
movzwl 0x10(%r13), %edi
callq 0xe73e
movzwl %ax, %r8d
leaq 0x11940(%rip), %rsi     # 0x1e793
leaq 0x11e2e(%rip), %rcx     # 0x1ec88
movq %r14, %rdi
movq %r15, %rdx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
movq 0x10(%rsp), %rdi
callq 0x5040
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x4, 0xc(%rsp)
leaq 0x1cdab(%rip), %rax     # 0x29c3c
leaq 0x1cda8(%rip), %rcx     # 0x29c40
cmoveq %rax, %rcx
andl $0x0, (%rcx)
movq 0x10(%rsp), %rdi
callq 0x5040
xorl %ebx, %ebx
jmp 0xce74