// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_pututf8
SOAP_FMAC2
soap_pututf8(struct soap *soap, register unsigned long c)
{ char tmp[16];
  if (c < 0x80 && c > 0)
  { *tmp = (char)c;
    return soap_send_raw(soap, tmp, 1);
  }
#ifndef WITH_LEAN
  if (c >= 0x80)
  { register char *t = tmp;
    if (c < 0x0800)
      *t++ = (char)(0xC0 | ((c >> 6) & 0x1F));
    else
    { if (c < 0x010000)
        *t++ = (char)(0xE0 | ((c >> 12) & 0x0F));
      else
      { if (c < 0x200000)
          *t++ = (char)(0xF0 | ((c >> 18) & 0x07));
        else
        { if (c < 0x04000000)
            *t++ = (char)(0xF8 | ((c >> 24) & 0x03));
          else
          { *t++ = (char)(0xFC | ((c >> 30) & 0x01));
            *t++ = (char)(0x80 | ((c >> 24) & 0x3F));
          }
          *t++ = (char)(0x80 | ((c >> 18) & 0x3F));
        }     
        *t++ = (char)(0x80 | ((c >> 12) & 0x3F));
      }
      *t++ = (char)(0x80 | ((c >> 6) & 0x3F));
    }
    *t++ = (char)(0x80 | (c & 0x3F));
    *t = '\0';
  }
#else
  sprintf(tmp, "&#%lu;", c);
#endif
  return soap_send(soap, tmp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x80, -0x18(%rbp)
jae 0x50f62
cmpq $0x0, -0x18(%rbp)
jbe 0x50f62
movq -0x18(%rbp), %rax
movb %al, -0x30(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x1, %edx
callq 0x4eeb0
movl %eax, -0x4(%rbp)
jmp 0x51136
cmpq $0x80, -0x18(%rbp)
jb 0x51126
leaq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x800, -0x18(%rbp)     # imm = 0x800
jae 0x50fac
movq -0x18(%rbp), %rax
shrq $0x6, %rax
andq $0x1f, %rax
orq $0xc0, %rax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x510fe
cmpq $0x10000, -0x18(%rbp)   # imm = 0x10000
jae 0x50fe0
movq -0x18(%rbp), %rax
shrq $0xc, %rax
andq $0xf, %rax
orq $0xe0, %rax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x510d9
cmpq $0x200000, -0x18(%rbp)  # imm = 0x200000
jae 0x51014
movq -0x18(%rbp), %rax
shrq $0x12, %rax
andq $0x7, %rax
orq $0xf0, %rax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x510b4
cmpq $0x4000000, -0x18(%rbp) # imm = 0x4000000
jae 0x51045
movq -0x18(%rbp), %rax
shrq $0x18, %rax
andq $0x3, %rax
orq $0xf8, %rax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x5108f
movq -0x18(%rbp), %rax
shrq $0x1e, %rax
andq $0x1, %rax
orq $0xfc, %rax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x18(%rbp), %rax
shrq $0x18, %rax
andq $0x3f, %rax
orq $0x80, %rax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x18(%rbp), %rax
shrq $0x12, %rax
andq $0x3f, %rax
orq $0x80, %rax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x18(%rbp), %rax
shrq $0xc, %rax
andq $0x3f, %rax
orq $0x80, %rax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x18(%rbp), %rax
shrq $0x6, %rax
andq $0x3f, %rax
orq $0x80, %rax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x18(%rbp), %rax
andq $0x3f, %rax
orq $0x80, %rax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x38(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4f310
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop