// File: sehe[P]spirit-v2-json/json.cpp
// Function: bool JSON::tryParseJson<boost::spirit::basic_istream_iterator<char, std::char_traits<char>>>(boost::spirit::basic_istream_iterator<char, std::char_traits<char>>&, boost::spirit::basic_istream_iterator<char, std::char_traits<char>>, boost::variant<JSON::Literal<JSON::tag_undefined>, JSON::Literal<JSON::tag_null>, JSON::Bool, boost::recursive_wrapper<JSON::Object>, boost::recursive_wrapper<JSON::Array>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, long, long double>&)
bool tryParseJson(It& f, It l, Value& value) // note: first iterator gets updated
    {
        static const skipper<It> s = {};
        static const parser<It, skipper<It> > p;

        try
        {
            return qi::phrase_parse(f,l,p,s,value);
        } catch(const qi::expectation_failure<It>& e)
        {
            std::string msg;

            boost::utf8_output_iterator<std::back_insert_iterator<std::string>> to_utf8(std::back_inserter(msg));
            // expectation points not currently used, but we could tidy up the
            // grammar to bail on unexpected tokens (future)
            std::copy(e.first, e.last, to_utf8); 

            std::cerr << e.what() << "'" << msg << "'\n";
            return false;
        }
    }

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rsi, 0x40(%rsp)
movq %rdi, 0xf8(%rsp)
movq %rsi, 0xf0(%rsp)
movq %rdx, 0xe8(%rsp)
cmpb $0x0, 0xec2b5(%rip)     # 0x10ce00
jne 0x20b92
leaq 0xec2ac(%rip), %rdi     # 0x10ce00
callq 0x5650
cmpl $0x0, %eax
je 0x20b92
leaq 0xec22b(%rip), %rdi     # 0x10cd90
callq 0x92eb0
jmp 0x20b6c
leaq 0x733ad(%rip), %rdi     # 0x93f20
leaq 0xec216(%rip), %rsi     # 0x10cd90
leaq 0xeb7ef(%rip), %rdx     # 0x10c370
callq 0x5300
leaq 0xec273(%rip), %rdi     # 0x10ce00
callq 0x5200
cmpb $0x0, 0xec51f(%rip)     # 0x10d0b8
jne 0x20be0
leaq 0xec516(%rip), %rdi     # 0x10d0b8
callq 0x5650
cmpl $0x0, %eax
je 0x20be0
leaq 0xec255(%rip), %rdi     # 0x10ce08
callq 0x93f50
jmp 0x20bba
leaq 0x7a06f(%rip), %rdi     # 0x9ac30
leaq 0xec240(%rip), %rsi     # 0x10ce08
leaq 0xeb7a1(%rip), %rdx     # 0x10c370
callq 0x5300
leaq 0xec4dd(%rip), %rdi     # 0x10d0b8
callq 0x5200
movq 0x40(%rsp), %rsi
movq 0xf8(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x20ed0
jmp 0x20c01
movq 0x38(%rsp), %rdi
movq 0xe8(%rsp), %r8
leaq 0xec1f3(%rip), %rdx     # 0x10ce08
leaq 0xec174(%rip), %rcx     # 0x10cd90
leaq 0xc0(%rsp), %rsi
callq 0x9ace0
movb %al, 0x37(%rsp)
jmp 0x20c2f
movb 0x37(%rsp), %al
andb $0x1, %al
movb %al, 0x107(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x20f00
jmp 0x20ea3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
leaq 0xec197(%rip), %rdi     # 0x10ce00
callq 0x51f0
jmp 0x20eb4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
leaq 0xec42a(%rip), %rdi     # 0x10d0b8
callq 0x51f0
jmp 0x20eb4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
jmp 0x20ccf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x20f00
movl 0xdc(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x20eb4
movq 0xe0(%rsp), %rdi
callq 0x5100
movq %rax, 0xb8(%rsp)
leaq 0x98(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x54b0
movq 0x20(%rsp), %rdi
callq 0x17810
movq %rax, 0x28(%rsp)
jmp 0x20d1b
movq 0x28(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x66e10
jmp 0x20d3f
movq 0xb8(%rsp), %rsi
addq $0x10, %rsi
leaq 0x70(%rsp), %rdi
callq 0x20ed0
jmp 0x20d57
movq 0xb8(%rsp), %rsi
addq $0x28, %rsi
leaq 0x58(%rsp), %rdi
callq 0x20ed0
jmp 0x20d6f
leaq 0x50(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x66ec0
jmp 0x20d83
leaq 0x48(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x50(%rsp), %rcx
callq 0x9ad80
jmp 0x20d9e
leaq 0x58(%rsp), %rdi
callq 0x20f00
leaq 0x70(%rsp), %rdi
callq 0x20f00
movq 0xb8(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, %rsi
movq 0xeb223(%rip), %rdi     # 0x10bff0
callq 0x5350
movq %rax, 0x18(%rsp)
jmp 0x20dd9
movq 0x18(%rsp), %rdi
leaq 0xa478f(%rip), %rsi     # 0xc5574
callq 0x5350
movq %rax, 0x10(%rsp)
jmp 0x20df1
movq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x5310
movq %rax, 0x8(%rsp)
jmp 0x20e0a
movq 0x8(%rsp), %rdi
leaq 0xa4760(%rip), %rsi     # 0xc5576
callq 0x5350
jmp 0x20e1d
movb $0x0, 0x107(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x51d0
callq 0x5580
jmp 0x20ea3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
jmp 0x20e8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
jmp 0x20e83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x20f00
leaq 0x70(%rsp), %rdi
callq 0x20f00
leaq 0x98(%rsp), %rdi
callq 0x51d0
callq 0x5580
jmp 0x20ea1
jmp 0x20eb4
movb 0x107(%rsp), %al
andb $0x1, %al
addq $0x108, %rsp            # imm = 0x108
retq
movq 0xe0(%rsp), %rdi
callq 0x5620
movq %rax, %rdi
callq 0x63c0
nopl (%rax)