// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_set_endpoint
SOAP_FMAC2
soap_set_endpoint(struct soap *soap, const char *endpoint)
{ register const char *s;
  register size_t i, n;
  soap->endpoint[0] = '\0';
  soap->host[0] = '\0';
  soap->path[0] = '/';
  soap->path[1] = '\0';
  soap->port = 80;
  if (!endpoint || !*endpoint)
    return;
#ifdef WITH_OPENSSL
  if (!soap_tag_cmp(endpoint, "https:*"))
    soap->port = 443;
#endif
  strncpy(soap->endpoint, endpoint, sizeof(soap->endpoint) - 1);
  soap->endpoint[sizeof(soap->endpoint) - 1] = '\0';
  s = strchr(endpoint, ':');
  if (s && s[1] == '/' && s[2] == '/')
    s += 3;
  else
    s = endpoint;
  n = strlen(s);
  if (n >= sizeof(soap->host))
    n = sizeof(soap->host) - 1;
#ifdef WITH_IPV6
  if (s[0] == '[')
  { s++;
    for (i = 0; i < n; i++)
    { if (s[i] == ']')
      { s++;
        --n;
        break; 
      }
      soap->host[i] = s[i];
    }
  }
  else
  { for (i = 0; i < n; i++)
    { soap->host[i] = s[i];
      if (s[i] == '/' || s[i] == ':')
        break; 
    }
  }
#else
  for (i = 0; i < n; i++)
  { soap->host[i] = s[i];
    if (s[i] == '/' || s[i] == ':')
      break; 
  }
#endif
  soap->host[i] = '\0';
  if (s[i] == ':')
  { soap->port = (int)soap_strtol(s + i + 1, NULL, 10);
    for (i++; i < n; i++)
      if (s[i] == '/')
        break;
  }
  if (i < n && s[i])
  { strncpy(soap->path, s + i, sizeof(soap->path));
    soap->path[sizeof(soap->path) - 1] = '\0';
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, 0x185a8(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x18da8(%rax)
movq -0x8(%rbp), %rax
movb $0x2f, 0x189a8(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x189a9(%rax)
movq -0x8(%rbp), %rax
movl $0x50, 0x191c8(%rax)
cmpq $0x0, -0x10(%rbp)
je 0x6b7ca
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x6b7cf
jmp 0x6b980
movq -0x8(%rbp), %rdi
addq $0x185a8, %rdi          # imm = 0x185A8
movq -0x10(%rbp), %rsi
movl $0x3ff, %edx            # imm = 0x3FF
callq 0x3070
movq -0x8(%rbp), %rax
movb $0x0, 0x189a7(%rax)
movq -0x10(%rbp), %rdi
movl $0x3a, %esi
callq 0x3130
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x6b834
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2f, %eax
jne 0x6b834
movq -0x18(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x2f, %eax
jne 0x6b834
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
jmp 0x6b83c
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3100
movq %rax, -0x28(%rbp)
cmpq $0x400, -0x28(%rbp)     # imm = 0x400
jb 0x6b85b
movq $0x3ff, -0x28(%rbp)     # imm = 0x3FF
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x6b8bb
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movb %dl, 0x18da8(%rax,%rcx)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
je 0x6b8a9
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x6b8ab
jmp 0x6b8bb
jmp 0x6b8ad
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x6b863
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movb $0x0, 0x18da8(%rax,%rcx)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x6b93d
movq -0x18(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0x1, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x3230
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x191c8(%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x6b93b
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
jne 0x6b92b
jmp 0x6b93b
jmp 0x6b92d
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x6b90e
jmp 0x6b93d
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x6b980
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x6b980
movq -0x8(%rbp), %rdi
addq $0x189a8, %rdi          # imm = 0x189A8
movq -0x18(%rbp), %rsi
addq -0x20(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x3070
movq -0x8(%rbp), %rax
movb $0x0, 0x18da7(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)