// File: /workspace/github_c_makefile_star2_O3/Carton32[P]quectel-CM/util.c
// Function: ql_get_driver_rmnet_info
void ql_get_driver_rmnet_info(PROFILE_T *profile, RMNET_INFO *rmnet_info) {
    int ifc_ctl_sock;
    struct ifreq ifr;
    int rc;
    int request = 0x89F3;
    unsigned char data[512];

    memset(rmnet_info, 0x00, sizeof(*rmnet_info));

    ifc_ctl_sock = socket(AF_INET, SOCK_DGRAM, 0);
    if (ifc_ctl_sock <= 0) {
        dbg_time("socket() failed: %s\n", strerror(errno));
        return;
    }
    
    memset(&ifr, 0, sizeof(struct ifreq));
    strncpy(ifr.ifr_name, profile->usbnet_adapter, IFNAMSIZ);
    ifr.ifr_name[IFNAMSIZ - 1] = 0;    
    ifr.ifr_ifru.ifru_data = (void *)data;
        
    rc = ioctl(ifc_ctl_sock, request, &ifr);
    if (rc < 0) {
        if (errno != ENOTSUP)
            dbg_time("ioctl(0x%x, qmap_settings) errno:%d (%s), rc=%d", request, errno, strerror(errno), rc);
    }
    else {
        memcpy(rmnet_info, data, sizeof(*rmnet_info));
    }

    close(ifc_ctl_sock);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movq %rsi, %r14
movq %rdi, %r15
movl $0xa4, %edx
movq %rsi, %rdi
xorl %esi, %esi
callq 0x5200
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x55a0
testl %eax, %eax
jle 0xf547
movl %eax, %ebx
xorps %xmm0, %xmm0
leaq 0x8(%rsp), %r12
movups %xmm0, 0x18(%r12)
addq $0xaa, %r15
movl $0x10, %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x5080
movb $0x0, 0xf(%r12)
leaq 0x30(%rsp), %rax
movq %rax, 0x10(%r12)
movl $0x89f3, %esi           # imm = 0x89F3
movl %ebx, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x5210
testl %eax, %eax
js 0xf5c6
leaq 0x30(%rsp), %rsi
movl $0xa4, %edx
movq %r14, %rdi
callq 0x52f0
jmp 0xf65b
movq 0x1aa72(%rip), %rax     # 0x29fc0
movq (%rax), %r14
callq 0xea3b
callq 0x5070
movq %rax, %rbx
movl (%rax), %edi
callq 0x5530
leaq 0x118bb(%rip), %rsi     # 0x20e27
leaq 0x1b73d(%rip), %rdx     # 0x2acb0
movq %r14, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x52c0
movq 0x1b721(%rip), %r14     # 0x2aca8
testq %r14, %r14
je 0xf662
callq 0xea3b
movl (%rbx), %edi
callq 0x5530
leaq 0x11884(%rip), %rsi     # 0x20e27
leaq 0x1b706(%rip), %rdx     # 0x2acb0
movq %r14, %rdi
movq %rax, %rcx
xorl %eax, %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x52c0
movl %eax, %ebp
callq 0x5070
cmpl $0x5f, (%rax)
je 0xf65b
movq %rax, %r14
movq 0x1a9e0(%rip), %rax     # 0x29fc0
movq (%rax), %r15
callq 0xea3b
movl (%r14), %r12d
movl %r12d, %edi
callq 0x5530
movl %ebp, (%rsp)
leaq 0x11845(%rip), %rsi     # 0x20e42
leaq 0x1b6ac(%rip), %rdx     # 0x2acb0
movq %r15, %rdi
movl $0x89f3, %ecx           # imm = 0x89F3
movl %r12d, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0x52c0
movq 0x1b688(%rip), %r15     # 0x2aca8
testq %r15, %r15
je 0xf65b
callq 0xea3b
movl (%r14), %r14d
movl %r14d, %edi
callq 0x5530
movl %ebp, (%rsp)
leaq 0x11803(%rip), %rsi     # 0x20e42
leaq 0x1b66a(%rip), %rdx     # 0x2acb0
movq %r15, %rdi
movl $0x89f3, %ecx           # imm = 0x89F3
movl %r14d, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0x52c0
movl %ebx, %edi
callq 0x5230
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq