// File: /workspace/github_c_makefile_star2_O2/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 0x35a5c
andl $0x0, 0x6100(%r14)
jmp 0x35abd
movq %r14, %rdi
callq 0x352a1
movl %eax, %ebx
cmpl $0x80, %eax
jl 0x35abd
testb $0x20, 0x4(%r14)
jne 0x35abd
movq 0x60f0(%r14), %rdx
cmpq 0x60f8(%r14), %rdx
jb 0x35a9a
movq %r14, %rdi
callq 0x34dd5
movq 0x60f0(%r14), %rdx
movq %rdx, %rcx
testl %eax, %eax
jne 0x35ab3
leaq 0x1(%rdx), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rdx), %ebp
testb %bpl, %bpl
js 0x35ace
decq %rcx
movq %rcx, 0x60f0(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
andl $0x3f, %ebp
cmpl $0xdf, %ebx
ja 0x35ae3
andl $0x1f, %ebx
shll $0x6, %ebx
orl %ebp, %ebx
jmp 0x35abd
cmpq 0x60f8(%r14), %rcx
jb 0x35b05
movq %r14, %rdi
callq 0x34dd5
testl %eax, %eax
je 0x35afe
pushq $0x3f
popq %r15
jmp 0x35b1d
movq 0x60f0(%r14), %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x60f0(%r14)
movzbl 0x6138(%r14,%rcx), %r15d
andl $0x3f, %r15d
cmpl $0xef, %ebx
ja 0x35b35
shll $0xc, %ebx
movzwl %bx, %eax
shll $0x6, %ebp
orl %eax, %ebp
orl %ebp, %r15d
jmp 0x35b93
movq 0x60f0(%r14), %rax
cmpq 0x60f8(%r14), %rax
jb 0x35b5e
movq %r14, %rdi
callq 0x34dd5
testl %eax, %eax
je 0x35b57
pushq $0x3f
popq %r12
jmp 0x35b76
movq 0x60f0(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rax), %r12d
andl $0x3f, %r12d
cmpl $0xf7, %ebx
ja 0x35b9b
andl $0x7, %ebx
shll $0x12, %ebx
shll $0xc, %ebp
orl %ebx, %ebp
shll $0x6, %r15d
orl %ebp, %r15d
orl %r12d, %r15d
movl %r15d, %ebx
jmp 0x35abd
movq 0x60f0(%r14), %rax
cmpq 0x60f8(%r14), %rax
jb 0x35bc4
movq %r14, %rdi
callq 0x34dd5
testl %eax, %eax
je 0x35bbd
pushq $0x3f
popq %r13
jmp 0x35bdc
movq 0x60f0(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rax), %r13d
andl $0x3f, %r13d
cmpl $0xfb, %ebx
ja 0x35c08
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 0x35abd
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 0x35c50
movq %r14, %rdi
callq 0x34dd5
testl %eax, %eax
je 0x35c49
pushq $0x3f
popq %rax
jmp 0x35c67
movq 0x60f0(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rax), %eax
andl $0x3f, %eax
orl %eax, %r13d
movl %r13d, %ebx
jmp 0x35abd