// File: /workspace/github_c_makefile_star2_O3/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 0xd0d2
cmpl $0x0, 0x1db70(%rip)     # 0x2ac3c
je 0xd2b1
cmpl $0x6, %esi
jne 0xd0e4
cmpl $0x0, 0x1db62(%rip)     # 0x2ac40
je 0xd2b1
shlb $0x4, %bpl
incb %bpl
xorl %ebx, %ebx
cmpl $0x4, %esi
setne %bl
movq 0x1cec6(%rip), %r15     # 0x29fc0
movq (%r15), %r14
callq 0xea3b
leal 0x4(,%rbx,2), %ebx
leaq 0x13b40(%rip), %rsi     # 0x20c50
leaq 0x13b5b(%rip), %rcx     # 0x20c72
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0x1db7a(%rip), %r12     # 0x2aca8
movq (%r12), %r14
testq %r14, %r14
je 0xd15a
callq 0xea3b
leaq 0x13b0d(%rip), %rsi     # 0x20c50
leaq 0x13b28(%rip), %rcx     # 0x20c72
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
movzbl %bpl, %edi
leaq 0x169b(%rip), %rdx      # 0xe800
leaq 0xc(%rsp), %rcx
movl $0x21, %esi
callq 0xd9a2
leaq 0x13af7(%rip), %rcx     # 0x20c72
leaq 0x10(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
movl $0x7530, %edx           # imm = 0x7530
callq 0xa273
movl %eax, %ebx
testl %eax, %eax
sets %al
movq (%r14), %r13
testq %r13, %r13
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xd202
movq (%r15), %r14
callq 0xea3b
leaq 0x135cb(%rip), %rsi     # 0x20781
leaq 0x13ab5(%rip), %rcx     # 0x20c72
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
movq (%r12), %r14
testq %r14, %r14
je 0xd2b1
callq 0xea3b
leaq 0x1359b(%rip), %rsi     # 0x20781
leaq 0x13a85(%rip), %rcx     # 0x20c72
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x52c0
jmp 0xd2b1
movzwl 0x10(%r13), %edi
callq 0xee73
testw %ax, %ax
jne 0xd224
movzwl 0x12(%r13), %edi
callq 0xee73
testw %ax, %ax
je 0xd2c2
movzwl 0x12(%r13), %edi
callq 0xee73
movl %eax, %ebx
movq (%r15), %r14
callq 0xea3b
movq %rax, %r15
movzwl 0x10(%r13), %edi
callq 0xee73
movzwl %ax, %r8d
movzwl %bx, %ebx
leaq 0x13540(%rip), %rsi     # 0x20793
leaq 0x13a18(%rip), %rcx     # 0x20c72
movq %r14, %rdi
movq %r15, %rdx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x52c0
movq (%r12), %r14
testq %r14, %r14
je 0xd2a7
callq 0xea3b
movq %rax, %r15
movzwl 0x10(%r13), %edi
callq 0xee73
movzwl %ax, %r8d
leaq 0x13503(%rip), %rsi     # 0x20793
leaq 0x139db(%rip), %rcx     # 0x20c72
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 0x1d96e(%rip), %rax     # 0x2ac3c
leaq 0x1d96b(%rip), %rcx     # 0x2ac40
cmoveq %rax, %rcx
movl $0x0, (%rcx)
movq 0x10(%rsp), %rdi
callq 0x5040
xorl %ebx, %ebx
jmp 0xd2b1