// File: /workspace/github_c_makefile_star2_O3/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 0x38d9d
movl $0x0, 0x6100(%r14)
jmp 0x38dfe
movq %r14, %rdi
callq 0x38565
movl %eax, %ebx
cmpl $0x80, %eax
jl 0x38dfe
testb $0x20, 0x4(%r14)
jne 0x38dfe
movq 0x60f0(%r14), %rdx
cmpq 0x60f8(%r14), %rdx
jb 0x38ddb
movq %r14, %rdi
callq 0x38046
movq 0x60f0(%r14), %rdx
movq %rdx, %rcx
testl %eax, %eax
jne 0x38df4
leaq 0x1(%rdx), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rdx), %ebp
testb %bpl, %bpl
js 0x38e0f
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 0x38e24
andl $0x1f, %ebx
shll $0x6, %ebx
orl %ebp, %ebx
jmp 0x38dfe
cmpq 0x60f8(%r14), %rcx
jb 0x38e46
movq %r14, %rdi
callq 0x38046
movl $0x3f, %r15d
testl %eax, %eax
jne 0x38e5e
movq 0x60f0(%r14), %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x60f0(%r14)
movzbl 0x6138(%r14,%rcx), %r15d
andl $0x3f, %r15d
cmpl $0xef, %ebx
ja 0x38e76
shll $0xc, %ebx
movzwl %bx, %eax
shll $0x6, %ebp
orl %eax, %ebp
orl %ebp, %r15d
jmp 0x38ed4
movq 0x60f0(%r14), %rax
cmpq 0x60f8(%r14), %rax
jb 0x38e9f
movq %r14, %rdi
callq 0x38046
movl $0x3f, %r12d
testl %eax, %eax
jne 0x38eb7
movq 0x60f0(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rax), %r12d
andl $0x3f, %r12d
cmpl $0xf7, %ebx
ja 0x38edc
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 0x38dfe
movq 0x60f0(%r14), %rax
cmpq 0x60f8(%r14), %rax
jb 0x38f05
movq %r14, %rdi
callq 0x38046
movl $0x3f, %r13d
testl %eax, %eax
jne 0x38f1d
movq 0x60f0(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%r14)
movzbl 0x6138(%r14,%rax), %r13d
andl $0x3f, %r13d
cmpl $0xfb, %ebx
ja 0x38f49
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 0x38dfe
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 0x38f91
movq %r14, %rdi
callq 0x38046
movl $0x3f, %ecx
testl %eax, %eax
jne 0x38fa8
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 0x38dfe