// File: /workspace/github_c_makefile_star2_O1/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_getutf8
SOAP_FMAC2
soap_getutf8(struct soap *soap)
{ register soap_wchar c, c1, c2, c3, c4;
  c = soap->ahead;
  if (c > 0x7F)
  { soap->ahead = 0;
    return c;
  }
  c = soap_get(soap);
  if (c < 0x80 || (soap->mode & SOAP_ENC_LATIN))
    return c;
  c1 = soap_get1(soap);
  if (c1 < 0x80)
  { soap_revget1(soap); /* doesn't look like this is UTF8 */
    return c;
  }
  c1 &= 0x3F;
  if (c < 0xE0)
    return ((soap_wchar)(c & 0x1F) << 6) | c1;
  c2 = (soap_wchar)soap_get1(soap) & 0x3F;
  if (c < 0xF0)
    return ((soap_wchar)(c & 0x0F) << 12) | (c1 << 6) | c2;
  c3 = (soap_wchar)soap_get1(soap) & 0x3F;
  if (c < 0xF8)
    return ((soap_wchar)(c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3;
  c4 = (soap_wchar)soap_get1(soap) & 0x3F;
  if (c < 0xFC)
    return ((soap_wchar)(c & 0x03) << 24) | (c1 << 18) | (c2 << 12) | (c3 << 6) | c4;
  return ((soap_wchar)(c & 0x01) << 30) | (c1 << 24) | (c2 << 18) | (c3 << 12) | (c4 << 6) | (soap_wchar)(soap_get1(soap) & 0x3F);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x6100(%rdi), %ebx
cmpl $0x80, %ebx
jl 0x38b72
movl $0x0, 0x6100(%r14)
jmp 0x38cb1
movq %r14, %rdi
callq 0x382e5
movl %eax, %ebx
cmpl $0x80, %eax
jl 0x38cb1
testb $0x20, 0x4(%r14)
jne 0x38cb1
movq 0x60f0(%r14), %rax
cmpq 0x60f8(%r14), %rax
jb 0x38bb3
movq %r14, %rdi
callq 0x37dbb
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x38bce
movq 0x60f0(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rax), %ebp
cmpl $0x7f, %ebp
jg 0x38bdf
decq 0x60f0(%r14)
jmp 0x38cb1
andl $0x3f, %ebp
cmpl $0xdf, %ebx
jg 0x38bf7
andl $0x1f, %ebx
shll $0x6, %ebx
orl %ebp, %ebx
jmp 0x38cb1
movq 0x60f0(%r14), %rax
cmpq 0x60f8(%r14), %rax
jb 0x38c19
movq %r14, %rdi
callq 0x37dbb
movl $0x3f, %r15d
testl %eax, %eax
jne 0x38c38
movq 0x60f0(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rax), %r15d
andl $0x3f, %r15d
cmpl $0xef, %ebx
jg 0x38c50
shll $0xc, %ebx
movzwl %bx, %eax
shll $0x6, %ebp
orl %eax, %ebp
orl %ebp, %r15d
jmp 0x38cae
movq 0x60f0(%r14), %rax
cmpq 0x60f8(%r14), %rax
jb 0x38c72
movq %r14, %rdi
callq 0x37dbb
movl $0x3f, %r12d
testl %eax, %eax
jne 0x38c91
movq 0x60f0(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rax), %r12d
andl $0x3f, %r12d
cmpl $0xf7, %ebx
jg 0x38cc2
andl $0x7, %ebx
shll $0x12, %ebx
shll $0xc, %ebp
orl %ebx, %ebp
shll $0x6, %r15d
orl %ebp, %r15d
orl %r12d, %r15d
movl %r15d, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x60f0(%r14), %rax
cmpq 0x60f8(%r14), %rax
jb 0x38ce4
movq %r14, %rdi
callq 0x37dbb
movl $0x3f, %r13d
testl %eax, %eax
jne 0x38d03
movq 0x60f0(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rax), %r13d
andl $0x3f, %r13d
cmpl $0xfb, %ebx
jg 0x38d2c
andl $0x3, %ebx
shll $0x18, %ebx
shll $0x12, %ebp
orl %ebx, %ebp
shll $0xc, %r15d
orl %ebp, %r15d
shll $0x6, %r12d
orl %r15d, %r12d
orl %r13d, %r12d
movl %r12d, %ebx
jmp 0x38cb1
andl $0x1, %ebx
shll $0x1e, %ebx
shll $0x18, %ebp
orl %ebx, %ebp
shll $0x12, %r15d
orl %ebp, %r15d
shll $0xc, %r12d
orl %r15d, %r12d
shll $0x6, %r13d
orl %r12d, %r13d
movq 0x60f0(%r14), %rax
cmpq 0x60f8(%r14), %rax
jb 0x38d6d
movq %r14, %rdi
callq 0x37dbb
movl $0x3f, %ecx
testl %eax, %eax
jne 0x38d8b
movq 0x60f0(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rax), %ecx
andl $0x3f, %ecx
orl %ecx, %r13d
movl %r13d, %ebx
jmp 0x38cb1