// File: /workspace/github_c_makefile_star2_O0/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_GetCOPS
cmError_t cellModem_GetCOPS(cmData_t *obj, netOperatorStatus_t *netOperatorStat){
    cmError_t retVal;
    char bufferRecv[60];
    char cmd[10]="AT+COPS?\r";
    char *ptr =NULL;
    char  buffer[4] ={0};

    retVal = cmSendCmd(obj,cmd , (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE  ,bufferRecv ,180000); //180 sg
    
    if(CM_OK == retVal){
        if( (ptr = strstr(bufferRecv,"+COPS:")) != NULL ){
            if(netOperatorStat != NULL){
                ptr = extractBetween(bufferRecv,' ',',',buffer,0);
                netOperatorStat->mode = (int)atoi(buffer);
                memset(buffer,0,sizeof(buffer));
                
                ptr = extractBetween(ptr,',',',',buffer,0);
                netOperatorStat->format = (int)atoi(buffer);
                
                ptr = extractBetween(ptr,'"','"',netOperatorStat->operator,1);

                memset(buffer,0,sizeof(buffer));
                ptr = extractBetween(ptr,',','\r',buffer,0);
                netOperatorStat->act = (int)atoi(buffer);
            }
        }
    }
    
    return retVal;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x7781(%rip), %rax      # 0xa07b
movq %rax, -0x5a(%rbp)
movw 0x777e(%rip), %ax       # 0xa083
movw %ax, -0x52(%rbp)
movq $0x0, -0x68(%rbp)
leaq -0x6c(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x10a0
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x5a(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1cf0
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movl %eax, %r8d
xorl %ecx, %ecx
leaq 0x8404(%rip), %rdx      # 0xad52
leaq 0x827d(%rip), %rax      # 0xabd2
cmpl %r8d, %ecx
cmoveq %rax, %rdx
leaq -0x50(%rbp), %rcx
movl $0x2bf20, %r8d          # imm = 0x2BF20
callq 0x1390
movl %eax, -0x14(%rbp)
xorl %eax, %eax
cmpl -0x14(%rbp), %eax
jne 0x2a74
leaq -0x50(%rbp), %rdi
leaq 0x7701(%rip), %rsi      # 0xa085
callq 0x1110
movq %rax, -0x68(%rbp)
cmpq $0x0, %rax
je 0x2a72
cmpq $0x0, -0x10(%rbp)
je 0x2a70
leaq -0x50(%rbp), %rdi
leaq -0x6c(%rbp), %rcx
movl $0x20, %esi
movl $0x2c, %edx
xorl %r8d, %r8d
callq 0x1d10
movq %rax, -0x68(%rbp)
leaq -0x6c(%rbp), %rdi
callq 0x10e0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
leaq -0x6c(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x10a0
movq -0x68(%rbp), %rdi
leaq -0x6c(%rbp), %rcx
movl $0x2c, %edx
xorl %r8d, %r8d
movl %edx, %esi
callq 0x1d10
movq %rax, -0x68(%rbp)
leaq -0x6c(%rbp), %rdi
callq 0x10e0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rcx
addq $0xc, %rcx
movl $0x22, %edx
movl $0x1, %r8d
movl %edx, %esi
callq 0x1d10
movq %rax, -0x68(%rbp)
leaq -0x6c(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x10a0
movq -0x68(%rbp), %rdi
leaq -0x6c(%rbp), %rcx
movl $0x2c, %esi
movl $0xd, %edx
xorl %r8d, %r8d
callq 0x1d10
movq %rax, -0x68(%rbp)
leaq -0x6c(%rbp), %rdi
callq 0x10e0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x2a72
jmp 0x2a74
movl -0x14(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq