// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_set_attr
SOAP_FMAC2
soap_set_attr(struct soap *soap, const char *name, const char *value)
{ register struct soap_attribute *tp;
  if (*name == '-')
    return SOAP_OK;
  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set attribute %s='%s'\n", name, value?value:SOAP_STR_EOS));
  for (tp = soap->attributes; tp; tp = tp->next)
  { if (!strcmp(tp->name, name))
      break;
  }
  if (!tp)
  { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute %s\n", name));
    if (!(tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + strlen(name))))
      return soap->error = SOAP_EOM;
    tp->ns = NULL;
#ifndef WITH_LEAN
    if (soap->mode & SOAP_XML_CANONICAL)
    { struct soap_attribute **tpp = &soap->attributes;
      const char *s = strchr(name, ':');
      DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inserting attribute %s for c14n\n", name))
      if (!strncmp(name, "xmlns", 5))
      { for (; *tpp; tpp = &(*tpp)->next)
          if (strncmp((*tpp)->name, "xmlns", 5) || strcmp((*tpp)->name + 5, name + 5) > 0)
            break;
      }
      else if (!s)
      { for (; *tpp; tpp = &(*tpp)->next)
          if (strncmp((*tpp)->name, "xmlns", 5) && ((*tpp)->ns || strcmp((*tpp)->name, name) > 0))
            break;
      }
      else
      { int k;
        for (; *tpp; tpp = &(*tpp)->next)
        { if (!strncmp((*tpp)->name, "xmlns:", 6) && !strncmp((*tpp)->name + 6, name, s - name) && !(*tpp)->name[6 + s - name])
          { if (!tp->ns)
            { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Canonicalization: prefix %s=%p (%s)\n", name, (*tpp)->ns, (*tpp)->ns));
              tp->ns = (*tpp)->ns;
            }
          }
          else if (strncmp((*tpp)->name, "xmlns", 5) && (*tpp)->ns && tp->ns && ((k = strcmp((*tpp)->ns, tp->ns)) > 0 || (!k && strcmp((*tpp)->name, name) > 0)))
            break;
        }
      }
      tp->next = *tpp;
      *tpp = tp;
    }
    else
#endif
    { tp->next = soap->attributes;
      soap->attributes = tp;
    }
    strcpy(tp->name, name);
    tp->value = NULL;
  }
  else if (tp->visible)
  { return SOAP_OK;
  }
  else if (value && tp->value && tp->size <= strlen(value))
  { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free attribute value of %s (free %p)\n", name, tp->value));
    SOAP_FREE(soap, tp->value);
    tp->value = NULL;
    tp->ns = NULL;
  }
  if (value)
  { if (!tp->value)
    { tp->size = strlen(value) + 1;
      if (!(tp->value = (char*)SOAP_MALLOC(soap, tp->size)))
        return soap->error = SOAP_EOM;
      DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute value for %s (%p)\n", tp->name, tp->value));
    }
    strcpy(tp->value, value);
    if (!strncmp(tp->name, "xmlns:", 6))
      tp->ns = tp->value;
    tp->visible = 2;
#ifndef WITH_LEAN
    if (!strcmp(name, "wsu:Id"))
    { soap->part = SOAP_BEGIN_SECURITY;
      strncpy(soap->id, value, sizeof(soap->id));
      soap->id[sizeof(soap->id)-1] = '\0';
    }
#endif
  }
  else
    tp->visible = 1;
  return SOAP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x60c5c
movl $0x0, -0x4(%rbp)
jmp 0x6110b
movq -0x10(%rbp), %rax
movq 0x18580(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x60c99
movq -0x28(%rbp), %rdi
addq $0x22, %rdi
movq -0x18(%rbp), %rsi
callq 0x3210
cmpl $0x0, %eax
jne 0x60c8a
jmp 0x60c99
jmp 0x60c8c
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x60c6b
cmpq $0x0, -0x28(%rbp)
jne 0x60f91
movq -0x18(%rbp), %rdi
callq 0x3100
movq %rax, %rdi
addq $0x28, %rdi
callq 0x3290
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x60cdd
movq -0x10(%rbp), %rax
movl $0x14, 0x19214(%rax)
movl $0x14, -0x4(%rbp)
jmp 0x6110b
movq -0x28(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x60f51
movq -0x10(%rbp), %rax
addq $0x18580, %rax          # imm = 0x18580
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movl $0x3a, %esi
callq 0x3130
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x19be5(%rip), %rsi     # 0x7a90e
movl $0x5, %edx
callq 0x3080
cmpl $0x0, %eax
jne 0x60d9c
jmp 0x60d3a
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x60d97
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x22, %rdi
leaq 0x19bb8(%rip), %rsi     # 0x7a90e
movl $0x5, %edx
callq 0x3080
cmpl $0x0, %eax
jne 0x60d86
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x22, %rdi
addq $0x5, %rdi
movq -0x18(%rbp), %rsi
addq $0x5, %rsi
callq 0x3210
cmpl $0x0, %eax
jle 0x60d88
jmp 0x60d97
jmp 0x60d8a
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x60d3a
jmp 0x60f36
cmpq $0x0, -0x38(%rbp)
jne 0x60e0d
jmp 0x60da5
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x60e08
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x22, %rdi
leaq 0x19b4d(%rip), %rsi     # 0x7a90e
movl $0x5, %edx
callq 0x3080
cmpl $0x0, %eax
je 0x60df9
movq -0x30(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x18(%rax)
jne 0x60df7
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x22, %rdi
movq -0x18(%rbp), %rsi
callq 0x3210
cmpl $0x0, %eax
jle 0x60df9
jmp 0x60e08
jmp 0x60dfb
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x60da5
jmp 0x60f34
jmp 0x60e0f
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x60f32
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x22, %rdi
leaq 0x19bdc(%rip), %rsi     # 0x7aa0b
movl $0x6, %edx
callq 0x3080
cmpl $0x0, %eax
jne 0x60ea3
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x22, %rdi
addq $0x6, %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x18(%rbp), %rax
subq %rax, %rdx
callq 0x3080
cmpl $0x0, %eax
jne 0x60ea3
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
addq $0x6, %rcx
movq -0x18(%rbp), %rdx
subq %rdx, %rcx
cmpb $0x0, 0x22(%rax,%rcx)
jne 0x60ea3
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x60ea1
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x60f20
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x22, %rdi
leaq 0x19a59(%rip), %rsi     # 0x7a90e
movl $0x5, %edx
callq 0x3080
cmpl $0x0, %eax
je 0x60f1e
movq -0x30(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x60f1e
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x60f1e
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x3210
movl %eax, -0x3c(%rbp)
cmpl $0x0, %eax
jg 0x60f1c
cmpl $0x0, -0x3c(%rbp)
jne 0x60f1e
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x22, %rdi
movq -0x18(%rbp), %rsi
callq 0x3210
cmpl $0x0, %eax
jle 0x60f1e
jmp 0x60f32
jmp 0x60f20
jmp 0x60f22
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x60e0f
jmp 0x60f34
jmp 0x60f36
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x60f72
movq -0x10(%rbp), %rax
movq 0x18580(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18580(%rax)
movq -0x28(%rbp), %rdi
addq $0x22, %rdi
movq -0x18(%rbp), %rsi
callq 0x3090
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
jmp 0x61004
movq -0x28(%rbp), %rax
cmpw $0x0, 0x20(%rax)
je 0x60fa8
movl $0x0, -0x4(%rbp)
jmp 0x6110b
cmpq $0x0, -0x20(%rbp)
je 0x61000
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x61000
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3100
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
ja 0x61000
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3030
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x18(%rax)
jmp 0x61002
jmp 0x61004
cmpq $0x0, -0x20(%rbp)
je 0x610fa
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x61069
movq -0x20(%rbp), %rdi
callq 0x3100
movq %rax, %rcx
addq $0x1, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x3290
movq -0x28(%rbp), %rcx
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
jne 0x61067
movq -0x10(%rbp), %rax
movl $0x14, 0x19214(%rax)
movl $0x14, -0x4(%rbp)
jmp 0x6110b
jmp 0x61069
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x3090
movq -0x28(%rbp), %rdi
addq $0x22, %rdi
leaq 0x19982(%rip), %rsi     # 0x7aa0b
movl $0x6, %edx
callq 0x3080
cmpl $0x0, %eax
jne 0x610a8
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movw $0x2, 0x20(%rax)
movq -0x18(%rbp), %rdi
leaq 0x19955(%rip), %rsi     # 0x7aa12
callq 0x3210
cmpl $0x0, %eax
jne 0x610f8
movq -0x10(%rbp), %rax
movw $0xa, 0x18590(%rax)
movq -0x10(%rbp), %rdi
addq $0x16d38, %rdi          # imm = 0x16D38
movq -0x20(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x3070
movq -0x10(%rbp), %rax
movb $0x0, 0x17137(%rax)
jmp 0x61104
movq -0x28(%rbp), %rax
movw $0x1, 0x20(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)