// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: requestSetProfile
static int requestSetProfile(PROFILE_T *profile) {
    PQCQMIMSG pRequest;
    PQCQMIMSG pResponse;
    PQMUX_MSG pMUXMsg;
    int err;
    const char *new_apn = profile->apn ? profile->apn : "";
    const char *new_user = profile->user ? profile->user : "";
    const char *new_password = profile->password ? profile->password : "";
    const char *ipStr[] = {"IPV4", "NULL", "IPV6", "IPV4V6"};

    dbg_time("%s[%d] %s/%s/%s/%d/%s", __func__, profile->pdp, profile->apn, profile->user, profile->password, profile->auth,ipStr[profile->iptype]);
    if (!profile->pdp)
        return 0;

    if ( !strcmp(profile->old_apn, new_apn) && !strcmp(profile->old_user, new_user)
        && !strcmp(profile->old_password, new_password)
        && profile->old_iptype == profile->iptype
        && profile->old_auth == profile->auth)
    {
        dbg_time("no need to set skip the rest");
        return 0;
    }

    pRequest = ComposeQMUXMsg(QMUX_TYPE_WDS, QMIWDS_MODIFY_PROFILE_SETTINGS_REQ, WdsModifyProfileSettingsReq, profile);
    err = QmiThreadSendQMI(pRequest, &pResponse);
    qmi_rsp_check_and_return();

    free(pResponse);
#ifdef REBOOT_SIM_CARD_WHEN_APN_CHANGE //enable at only when customer asked 
    if (qmi_request_ops.requestRadioPower) {
        qmi_request_ops.requestRadioPower(0);
        qmi_request_ops.requestRadioPower(1);
    }
#endif
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xf8, %rsp
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
je 0xe657
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0xe664
leaq 0x1d9ab(%rip), %rax     # 0x2c009
movq %rax, -0x80(%rbp)
jmp 0xe664
movq -0x80(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe688
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0xe698
leaq 0x1d97a(%rip), %rax     # 0x2c009
movq %rax, -0x88(%rbp)
jmp 0xe698
movq -0x88(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xe6bf
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0xe6cf
leaq 0x1d943(%rip), %rax     # 0x2c009
movq %rax, -0x90(%rbp)
jmp 0xe6cf
movq -0x90(%rbp), %rax
movq %rax, -0x50(%rbp)
movq 0x27d7f(%rip), %rax     # 0x36460
movq %rax, -0x70(%rbp)
movq 0x27d7c(%rip), %rax     # 0x36468
movq %rax, -0x68(%rbp)
movq 0x27d79(%rip), %rax     # 0x36470
movq %rax, -0x60(%rbp)
movq 0x27d76(%rip), %rax     # 0x36478
movq %rax, -0x58(%rbp)
movq 0x288d3(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x98(%rbp)
callq 0x13930
movq -0x98(%rbp), %rdi
movq %rax, %rdx
movq -0x18(%rbp), %rax
movl 0x48(%rax), %r8d
movq -0x18(%rbp), %rax
movq (%rax), %r9
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rbx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %r11
movq -0x18(%rbp), %rax
movl 0x18(%rax), %r10d
movq -0x18(%rbp), %rax
movslq 0x1c(%rax), %rax
movq -0x70(%rbp,%rax,8), %rax
leaq 0x1f447(%rip), %rsi     # 0x2dba8
leaq 0x1f45c(%rip), %rcx     # 0x2dbc4
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x52c0
leaq 0x296df(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xe80b
leaq 0x296d2(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
callq 0x13930
movq -0xa0(%rbp), %rdi
movq %rax, %rdx
movq -0x18(%rbp), %rax
movl 0x48(%rax), %r8d
movq -0x18(%rbp), %rax
movq (%rax), %r9
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rbx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %r11
movq -0x18(%rbp), %rax
movl 0x18(%rax), %r10d
movq -0x18(%rbp), %rax
movslq 0x1c(%rax), %rax
movq -0x70(%rbp,%rax,8), %rax
leaq 0x1f3be(%rip), %rsi     # 0x2dba8
leaq 0x1f3d3(%rip), %rcx     # 0x2dbc4
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x52c0
jmp 0xe80d
movq -0x18(%rbp), %rax
cmpl $0x0, 0x48(%rax)
jne 0xe823
movl $0x0, -0xc(%rbp)
jmp 0xeb20
movq -0x18(%rbp), %rdi
addq $0x256, %rdi            # imm = 0x256
movq -0x40(%rbp), %rsi
callq 0x52a0
cmpl $0x0, %eax
jne 0xe91d
movq -0x18(%rbp), %rdi
addq $0x296, %rdi            # imm = 0x296
movq -0x48(%rbp), %rsi
callq 0x52a0
cmpl $0x0, %eax
jne 0xe91d
movq -0x18(%rbp), %rdi
addq $0x2d6, %rdi            # imm = 0x2D6
movq -0x50(%rbp), %rsi
callq 0x52a0
cmpl $0x0, %eax
jne 0xe91d
movq -0x18(%rbp), %rax
movl 0x31a(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0xe91d
movq -0x18(%rbp), %rax
movl 0x316(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jne 0xe91d
jmp 0xe8a6
movq 0x28733(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
callq 0x13930
movq -0xa8(%rbp), %rdi
movq %rax, %rdx
leaq 0x1f309(%rip), %rsi     # 0x2dbd6
movb $0x0, %al
callq 0x52c0
leaq 0x2958d(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xe90f
leaq 0x29580(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
callq 0x13930
movq -0xb0(%rbp), %rdi
movq %rax, %rdx
leaq 0x1f2ce(%rip), %rsi     # 0x2dbd6
movb $0x0, %al
callq 0x52c0
jmp 0xe911
movl $0x0, -0xc(%rbp)
jmp 0xeb20
movq -0x18(%rbp), %rcx
movl $0x1, %edi
movl $0x28, %esi
leaq 0x33ce(%rip), %rdx      # 0x11d00
callq 0x11170
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x7530, %edx           # imm = 0x7530
leaq 0x1f275(%rip), %rcx     # 0x2dbc4
callq 0xc670
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0xe968
cmpq $0x0, -0x28(%rbp)
jne 0xe9f6
jmp 0xe96a
movq 0x2866f(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0xb8(%rbp)
callq 0x13930
movq -0xb8(%rbp), %rdi
movq %rax, %rdx
movl -0x34(%rbp), %r8d
leaq 0x1efcc(%rip), %rsi     # 0x2d961
leaq 0x1f228(%rip), %rcx     # 0x2dbc4
movb $0x0, %al
callq 0x52c0
leaq 0x294be(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xe9e9
leaq 0x294b1(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
callq 0x13930
movq -0xc0(%rbp), %rdi
movq %rax, %rdx
movl -0x34(%rbp), %r8d
leaq 0x1ef86(%rip), %rsi     # 0x2d961
leaq 0x1f1e2(%rip), %rcx     # 0x2dbc4
movb $0x0, %al
callq 0x52c0
jmp 0xe9eb
movl -0x34(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0xeb20
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 0xea30
movq -0x30(%rbp), %rax
movzwl 0xc(%rax), %edi
callq 0x13ed0
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xeb0e
movq -0x30(%rbp), %rax
movzwl 0xc(%rax), %edi
callq 0x13ed0
movw %ax, -0x72(%rbp)
movq 0x28598(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
callq 0x13930
movq %rax, -0xc8(%rbp)
movq -0x30(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x13ed0
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rdx
movzwl %ax, %r8d
movzwl -0x72(%rbp), %r9d
leaq 0x1eeea(%rip), %rsi     # 0x2d973
leaq 0x1f134(%rip), %rcx     # 0x2dbc4
movb $0x0, %al
callq 0x52c0
leaq 0x293ca(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xeafa
leaq 0x293bd(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
callq 0x13930
movq %rax, -0xd8(%rbp)
movq -0x30(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x13ed0
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rdx
movzwl %ax, %r8d
movzwl -0x72(%rbp), %r9d
leaq 0x1ee87(%rip), %rsi     # 0x2d973
leaq 0x1f0d1(%rip), %rcx     # 0x2dbc4
movb $0x0, %al
callq 0x52c0
jmp 0xeafc
movq -0x28(%rbp), %rdi
callq 0x5040
movzwl -0x72(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0xeb20
jmp 0xeb10
movq -0x28(%rbp), %rdi
callq 0x5040
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0xf8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)