// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x227d0
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
jne 0x2264a
movb $0x0, -0x1(%rbp)
jmp 0x227bf
movl $0xd800, %eax           # imm = 0xD800
cmpl -0x1c(%rbp), %eax
jg 0x226f8
cmpl $0xdfff, -0x1c(%rbp)    # imm = 0xDFFF
jg 0x226f8
movl $0xdc00, %eax           # imm = 0xDC00
cmpl -0x1c(%rbp), %eax
jg 0x22678
movb $0x0, -0x1(%rbp)
jmp 0x227bf
movq -0x18(%rbp), %rdi
callq 0x21b10
cmpl $0x5c, %eax
jne 0x22694
movq -0x18(%rbp), %rdi
callq 0x21b10
cmpl $0x75, %eax
je 0x226a6
movq -0x18(%rbp), %rdi
callq 0x22000
movb $0x0, -0x1(%rbp)
jmp 0x227bf
movq -0x18(%rbp), %rdi
callq 0x227d0
movl %eax, -0x20(%rbp)
movl $0xdc00, %eax           # imm = 0xDC00
cmpl -0x20(%rbp), %eax
jg 0x226c5
cmpl $0xdfff, -0x20(%rbp)    # imm = 0xDFFF
jle 0x226ce
movb $0x0, -0x1(%rbp)
jmp 0x227bf
movl -0x1c(%rbp), %eax
subl $0xd800, %eax           # imm = 0xD800
shll $0xa, %eax
movl -0x20(%rbp), %ecx
subl $0xdc00, %ecx           # imm = 0xDC00
andl $0x3ff, %ecx            # imm = 0x3FF
orl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addl $0x10000, %eax          # imm = 0x10000
movl %eax, -0x1c(%rbp)
cmpl $0x80, -0x1c(%rbp)
jge 0x22715
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
movsbl %al, %esi
callq 0x63f0
jmp 0x227bb
cmpl $0x800, -0x1c(%rbp)     # imm = 0x800
jge 0x22737
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
sarl $0x6, %eax
orl $0xc0, %eax
movsbl %al, %esi
callq 0x63f0
jmp 0x227a4
cmpl $0x10000, -0x1c(%rbp)   # imm = 0x10000
jge 0x22759
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
sarl $0xc, %eax
orl $0xe0, %eax
movsbl %al, %esi
callq 0x63f0
jmp 0x2278a
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
sarl $0x12, %eax
orl $0xf0, %eax
movsbl %al, %esi
callq 0x63f0
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
sarl $0xc, %eax
andl $0x3f, %eax
orl $0x80, %eax
movsbl %al, %esi
callq 0x63f0
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
sarl $0x6, %eax
andl $0x3f, %eax
orl $0x80, %eax
movsbl %al, %esi
callq 0x63f0
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
andl $0x3f, %eax
orl $0x80, %eax
movsbl %al, %esi
callq 0x63f0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)