// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x6100(%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x7f, -0x14(%rbp)
jle 0x51178
movq -0x10(%rbp), %rax
movl $0x0, 0x6100(%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x51491
movq -0x10(%rbp), %rdi
callq 0x503c0
movl %eax, -0x14(%rbp)
cmpl $0x80, -0x14(%rbp)
jl 0x5119c
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x511a7
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x51491
movq -0x10(%rbp), %rax
movq 0x60f0(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x60f8(%rcx), %rax
jb 0x511d7
movq -0x10(%rbp), %rdi
callq 0x4f9f0
cmpl $0x0, %eax
je 0x511d7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x28(%rbp)
jmp 0x511ff
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rdx
movq 0x60f0(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x60f0(%rdx)
movzbl 0x6138(%rax,%rcx), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x80, -0x18(%rbp)
jge 0x5122f
movq -0x10(%rbp), %rax
movq 0x60f0(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x60f0(%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x51491
movl -0x18(%rbp), %eax
andl $0x3f, %eax
movl %eax, -0x18(%rbp)
cmpl $0xe0, -0x14(%rbp)
jge 0x51255
movl -0x14(%rbp), %eax
andl $0x1f, %eax
shll $0x6, %eax
orl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x51491
movq -0x10(%rbp), %rax
movq 0x60f0(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x60f8(%rcx), %rax
jb 0x51285
movq -0x10(%rbp), %rdi
callq 0x4f9f0
cmpl $0x0, %eax
je 0x51285
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x2c(%rbp)
jmp 0x512ad
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rdx
movq 0x60f0(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x60f0(%rdx)
movzbl 0x6138(%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
andl $0x3f, %eax
movl %eax, -0x1c(%rbp)
cmpl $0xf0, -0x14(%rbp)
jge 0x512db
movl -0x14(%rbp), %eax
andl $0xf, %eax
shll $0xc, %eax
movl -0x18(%rbp), %ecx
shll $0x6, %ecx
orl %ecx, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x51491
movq -0x10(%rbp), %rax
movq 0x60f0(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x60f8(%rcx), %rax
jb 0x5130b
movq -0x10(%rbp), %rdi
callq 0x4f9f0
cmpl $0x0, %eax
je 0x5130b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x30(%rbp)
jmp 0x51333
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rdx
movq 0x60f0(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x60f0(%rdx)
movzbl 0x6138(%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
andl $0x3f, %eax
movl %eax, -0x20(%rbp)
cmpl $0xf8, -0x14(%rbp)
jge 0x51369
movl -0x14(%rbp), %eax
andl $0x7, %eax
shll $0x12, %eax
movl -0x18(%rbp), %ecx
shll $0xc, %ecx
orl %ecx, %eax
movl -0x1c(%rbp), %ecx
shll $0x6, %ecx
orl %ecx, %eax
orl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x51491
movq -0x10(%rbp), %rax
movq 0x60f0(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x60f8(%rcx), %rax
jb 0x51399
movq -0x10(%rbp), %rdi
callq 0x4f9f0
cmpl $0x0, %eax
je 0x51399
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x34(%rbp)
jmp 0x513c1
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rdx
movq 0x60f0(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x60f0(%rdx)
movzbl 0x6138(%rax,%rcx), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
andl $0x3f, %eax
movl %eax, -0x24(%rbp)
cmpl $0xfc, -0x14(%rbp)
jge 0x513ff
movl -0x14(%rbp), %eax
andl $0x3, %eax
shll $0x18, %eax
movl -0x18(%rbp), %ecx
shll $0x12, %ecx
orl %ecx, %eax
movl -0x1c(%rbp), %ecx
shll $0xc, %ecx
orl %ecx, %eax
movl -0x20(%rbp), %ecx
shll $0x6, %ecx
orl %ecx, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x51491
movl -0x14(%rbp), %eax
andl $0x1, %eax
shll $0x1e, %eax
movl -0x18(%rbp), %ecx
shll $0x18, %ecx
orl %ecx, %eax
movl -0x1c(%rbp), %ecx
shll $0x12, %ecx
orl %ecx, %eax
movl -0x20(%rbp), %ecx
shll $0xc, %ecx
orl %ecx, %eax
movl -0x24(%rbp), %ecx
shll $0x6, %ecx
orl %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x60f0(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x60f8(%rcx), %rax
jb 0x5145b
movq -0x10(%rbp), %rdi
callq 0x4f9f0
cmpl $0x0, %eax
je 0x5145b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x3c(%rbp)
jmp 0x51483
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rdx
movq 0x60f0(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x60f0(%rdx)
movzbl 0x6138(%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %eax
movl -0x3c(%rbp), %ecx
andl $0x3f, %ecx
orl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)