// File: /workspace/github_c_makefile_star2_O0/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_SocketOpen
cmError_t cellModem_SocketOpen(cmData_t *obj, socketData_t *config){
    cmError_t retVal;
    char str[256]="AT+QIOPEN=";
    char *ptr = NULL;

      if((config->serviceType != NULL) &&
        (config->remip != NULL)        &&
        (config->remPort != NULL)      &&
        (config->locPort != NULL) ){

        ptr = strcat(str +10, intToStr(config->contextId) );
        ptr = strcat(ptr ,"," );
        ptr = strcat(ptr , intToStr(config->connectId) );
        ptr = strcat(ptr ,",\"" );
        ptr = strcat(ptr , config->serviceType );
        ptr = strcat(ptr ,"\",\"" );
        ptr = strcat(ptr , config->remip );
        ptr = strcat(ptr ,"\"," );
        ptr = strcat(ptr , config->remPort);
        ptr = strcat(ptr ,"," );
        ptr = strcat(ptr , config->locPort);
        ptr = strcat(ptr ,"," );
        ptr = strcat(ptr , intToStr(config->accessMode));
        ptr = strcat(ptr ,"\r" );
      }else{
          retVal = CM_FAIL;
      }
    retVal = cmSendCmd(obj,str , (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE ,NULL ,500);

    return retVal;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x120(%rbp), %rdi
leaq 0x71ef(%rip), %rsi      # 0xa2f0
movl $0x100, %edx            # imm = 0x100
callq 0x10c0
movq $0x0, -0x128(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x330b
movq -0x10(%rbp), %rax
cmpq $0x0, %rax
je 0x330b
movq -0x10(%rbp), %rax
addq $0x10, %rax
cmpq $0x0, %rax
je 0x330b
movq -0x10(%rbp), %rax
addq $0x18, %rax
cmpq $0x0, %rax
je 0x330b
leaq -0x120(%rbp), %rax
addq $0xa, %rax
movq %rax, -0x140(%rbp)
movq -0x10(%rbp), %rax
movl 0x50(%rax), %edi
callq 0x3380
movq -0x140(%rbp), %rdi
movq %rax, %rsi
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
leaq 0x6f33(%rip), %rsi      # 0xa0cc
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x10(%rbp), %rax
movl 0x4c(%rax), %edi
callq 0x3380
movq -0x138(%rbp), %rdi
movq %rax, %rsi
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
leaq 0x6e32(%rip), %rsi      # 0xa015
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
leaq 0x6dfc(%rip), %rsi      # 0xa014
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
leaq 0x6e82(%rip), %rsi      # 0xa0cb
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
leaq 0x6e4e(%rip), %rsi      # 0xa0cc
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
leaq 0x6e19(%rip), %rsi      # 0xa0cc
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x10(%rbp), %rax
movl 0x48(%rax), %edi
callq 0x3380
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0x10f0
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
leaq 0x6dcc(%rip), %rsi      # 0xa0c9
callq 0x10f0
movq %rax, -0x128(%rbp)
jmp 0x3312
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0x120(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1cf0
movq -0x150(%rbp), %rdi
movq -0x148(%rbp), %rsi
movl %eax, %r8d
xorl %ecx, %ecx
leaq 0x7a04(%rip), %rdx      # 0xad52
leaq 0x787d(%rip), %rax      # 0xabd2
cmpl %r8d, %ecx
cmoveq %rax, %rdx
xorl %eax, %eax
movl %eax, %ecx
movl $0x1f4, %r8d            # imm = 0x1F4
callq 0x1390
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw (%rax,%rax)