// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x508e(%rip), %rsi      # 0x7330
leaq 0x10(%rsp), %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x10c0
testq %r14, %r14
je 0x2405
cmpq $0x0, 0x20(%r14)
je 0x2405
leaq 0x18(%r14), %rax
movq %rax, 0x8(%rsp)
leaq 0x10(%r14), %rax
movq %rax, (%rsp)
leaq 0x1a(%rsp), %r15
movl 0x50(%r14), %edx
xorps %xmm0, %xmm0
movaps %xmm0, 0xa2e7(%rip)     # 0xc5d0
leaq 0xa2e0(%rip), %r12      # 0xc5d0
leaq 0x4da2(%rip), %r13      # 0x7099
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1100
movq %r15, %rdi
movq %r12, %rsi
callq 0x10f0
movq %r15, %rdi
callq 0x1070
movw $0x2c, %bp
movw %bp, 0x1a(%rsp,%rax)
movl 0x4c(%r14), %edx
xorps %xmm0, %xmm0
movaps %xmm0, 0xa2a2(%rip)     # 0xc5d0
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1100
movq %r15, %rdi
movq %r12, %rsi
callq 0x10f0
movq %r15, %rdi
callq 0x1070
xorl %ecx, %ecx
movb %cl, 0x1c(%rsp,%rax)
xorl %r13d, %r13d
movw $0x222c, 0x1a(%rsp,%rax) # imm = 0x222C
movq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x10f0
movq %r15, %rdi
callq 0x1070
movl $0x222c22, 0x1a(%rsp,%rax) # imm = 0x222C22
movq %r15, %rdi
movq %r14, %rsi
callq 0x10f0
movq %r15, %rdi
callq 0x1070
movb %r13b, 0x1c(%rsp,%rax)
movw $0x2c22, 0x1a(%rsp,%rax) # imm = 0x2C22
movq %r15, %rdi
movq (%rsp), %rsi
callq 0x10f0
movq %r15, %rdi
callq 0x1070
movw %bp, 0x1a(%rsp,%rax)
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq 0x10f0
movq %r15, %rdi
callq 0x1070
movw %bp, 0x1a(%rsp,%rax)
movl 0x48(%r14), %edx
xorps %xmm0, %xmm0
movaps %xmm0, 0xa1f6(%rip)     # 0xc5d0
movq %r12, %rdi
leaq 0x4cb5(%rip), %rsi      # 0x7099
xorl %eax, %eax
callq 0x1100
movq %r15, %rdi
movq %r12, %rsi
callq 0x10f0
movq %r15, %rdi
callq 0x1070
movw $0xd, 0x1a(%rsp,%rax)
cmpb $0x0, 0x61(%rbx)
leaq 0x57c2(%rip), %rax      # 0x7bd2
leaq 0x593b(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
movl $0x1f4, %r8d            # imm = 0x1F4
callq 0x12cc
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq