// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x2b0, %rsp            # imm = 0x2B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x89f3, -0x48(%rbp)    # imm = 0x89F3
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0xa4, %edx
callq 0x5200
movl $0x2, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x55a0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x14b25
jmp 0x14a87
movq 0x22552(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x260(%rbp)
callq 0x13930
movq %rax, -0x258(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x260(%rbp), %rdi
movq -0x258(%rbp), %rdx
movq %rax, %rcx
leaq 0x19555(%rip), %rsi     # 0x2e01d
movb $0x0, %al
callq 0x52c0
cmpq $0x0, 0x23391(%rip)     # 0x37e68
je 0x14b1e
movq 0x23388(%rip), %rax     # 0x37e68
movq %rax, -0x270(%rbp)
callq 0x13930
movq %rax, -0x268(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x270(%rbp), %rdi
movq -0x268(%rbp), %rdx
movq %rax, %rcx
leaq 0x19506(%rip), %rsi     # 0x2e01d
movb $0x0, %al
callq 0x52c0
jmp 0x14b20
jmp 0x14c98
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x5200
leaq -0x40(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xaa, %rsi
movl $0x10, %edx
callq 0x5080
movb $0x0, -0x31(%rbp)
leaq -0x250(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x14(%rbp), %edi
movslq -0x48(%rbp), %rsi
leaq -0x40(%rbp), %rdx
movb $0x0, %al
callq 0x5210
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jge 0x14c7b
callq 0x5070
cmpl $0x5f, (%rax)
je 0x14c79
jmp 0x14b8c
movq 0x2244d(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x288(%rbp)
callq 0x13930
movq %rax, -0x280(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x278(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x274(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x288(%rbp), %rdi
movq -0x280(%rbp), %rdx
movl -0x278(%rbp), %ecx
movl -0x274(%rbp), %r8d
movq %rax, %r9
movl -0x44(%rbp), %eax
leaq 0x19445(%rip), %rsi     # 0x2e038
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
cmpq $0x0, 0x23263(%rip)     # 0x37e68
je 0x14c75
movq 0x2325a(%rip), %rax     # 0x37e68
movq %rax, -0x2a0(%rbp)
callq 0x13930
movq %rax, -0x298(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x290(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x28c(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x2a0(%rbp), %rdi
movq -0x298(%rbp), %rdx
movl -0x290(%rbp), %ecx
movl -0x28c(%rbp), %r8d
movq %rax, %r9
movl -0x44(%rbp), %eax
leaq 0x193cd(%rip), %rsi     # 0x2e038
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
jmp 0x14c77
jmp 0x14c79
jmp 0x14c90
movq -0x10(%rbp), %rdi
leaq -0x250(%rbp), %rsi
movl $0xa4, %edx
callq 0x52f0
movl -0x14(%rbp), %edi
callq 0x5230
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbp
retq
nopw %cs:(%rax,%rax)