// File: /workspace/github_cpp_makefile_star2_O3/istellartech[P]OpenTsiolkovsky/src/../lib/picojson.h
// Function: bool picojson::_parse_codepoint<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::istreambuf_iterator<char, std::char_traits<char>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, picojson::input<std::istreambuf_iterator<char, std::char_traits<char>>>&)
inline bool _parse_codepoint(String& out, input<Iter>& in) {
    int uni_ch;
    if ((uni_ch = _parse_quadhex(in)) == -1) {
      return false;
    }
    if (0xd800 <= uni_ch && uni_ch <= 0xdfff) {
      if (0xdc00 <= uni_ch) {
	// a second 16-bit of a surrogate pair appeared
	return false;
      }
      // first 16-bit of surrogate pair, get the next one
      if (in.getc() != '\\' || in.getc() != 'u') {
	in.ungetc();
	return false;
      }
      int second = _parse_quadhex(in);
      if (! (0xdc00 <= second && second <= 0xdfff)) {
	return false;
      }
      uni_ch = ((uni_ch - 0xd800) << 10) | ((second - 0xdc00) & 0x3ff);
      uni_ch += 0x10000;
    }
    if (uni_ch < 0x80) {
      out.push_back(uni_ch);
    } else {
      if (uni_ch < 0x800) {
	out.push_back(0xc0 | (uni_ch >> 6));
      } else {
	if (uni_ch < 0x10000) {
	  out.push_back(0xe0 | (uni_ch >> 12));
	} else {
	  out.push_back(0xf0 | (uni_ch >> 18));
	  out.push_back(0x80 | ((uni_ch >> 12) & 0x3f));
	}
	out.push_back(0x80 | ((uni_ch >> 6) & 0x3f));
      }
      out.push_back(0x80 | (uni_ch & 0x3f));
    }
    return true;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorl %r15d, %r15d
movl $0x4, %ebp
movq %r14, %rdi
callq 0x16b16
cmpl $-0x1, %eax
je 0x17196
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
jb 0x170bf
leal -0x41(%rax), %ecx
cmpl $0x5, %ecx
ja 0x170ae
addl $-0x37, %eax
jmp 0x170bd
leal -0x61(%rax), %ecx
cmpl $0x5, %ecx
ja 0x17191
addl $-0x57, %eax
movl %eax, %ecx
shll $0x4, %r15d
addl %ecx, %r15d
decl %ebp
jne 0x17088
cmpl $-0x1, %r15d
je 0x17196
movl %r15d, %eax
andl $0xfffff800, %eax       # imm = 0xFFFFF800
cmpl $0xd800, %eax           # imm = 0xD800
jne 0x17178
cmpl $0xdbff, %r15d          # imm = 0xDBFF
ja 0x17196
movq %r14, %rdi
callq 0x16b16
cmpl $0x5c, %eax
jne 0x17191
movq %r14, %rdi
callq 0x16b16
cmpl $0x75, %eax
jne 0x17191
xorl %r12d, %r12d
movl $0x4, %ebp
movq %r14, %rdi
callq 0x16b16
cmpl $-0x1, %eax
je 0x17196
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
jb 0x17149
leal -0x41(%rax), %ecx
cmpl $0x5, %ecx
ja 0x1713c
addl $-0x37, %eax
jmp 0x17147
leal -0x61(%rax), %ecx
cmpl $0x5, %ecx
ja 0x17191
addl $-0x57, %eax
movl %eax, %ecx
shll $0x4, %r12d
addl %ecx, %r12d
decl %ebp
jne 0x1711a
movl %r12d, %eax
andl $0xfffffc00, %eax       # imm = 0xFFFFFC00
cmpl $0xdc00, %eax           # imm = 0xDC00
jne 0x17196
shll $0xa, %r15d
andl $0x3ff, %r12d           # imm = 0x3FF
addl %r12d, %r15d
addl $0xfca10000, %r15d      # imm = 0xFCA10000
cmpl $0x7f, %r15d
jle 0x171f3
movl %r15d, %eax
cmpl $0x7ff, %r15d           # imm = 0x7FF
ja 0x171a1
shrl $0x6, %eax
orb $-0x40, %al
jmp 0x171e0
movb $0x0, 0x20(%r14)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xffff, %r15d          # imm = 0xFFFF
ja 0x171b1
shrl $0xc, %eax
orb $-0x20, %al
jmp 0x171cb
shrl $0x12, %eax
orb $-0x10, %al
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5330
movl %r15d, %eax
shrl $0xc, %eax
andb $0x3f, %al
orb $-0x80, %al
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5330
movl %r15d, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5330
andb $0x3f, %r15b
orb $-0x80, %r15b
movsbl %r15b, %esi
movq %rbx, %rdi
callq 0x5330
movb $0x1, %al
jmp 0x17198
nop