// File: SYZYGYfpga[P]brain-tools/include/json.hpp
// Function: nlohmann::detail::serializer<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>>::throw_if_invalid_utf8(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static void throw_if_invalid_utf8(const std::string& str)
    {
        // start with state 0 (= accept)
        uint8_t state = 0;

        for (size_t i = 0; i < str.size(); ++i)
        {
            const auto byte = static_cast<uint8_t>(str[i]);
            decode(state, byte);
            if (state == 1)
            {
                // state 1 means reject
                std::stringstream ss;
                ss << std::setw(2) << std::uppercase << std::setfill('0') << std::hex << static_cast<int>(byte);
                JSON_THROW(type_error::create(316, "invalid UTF-8 byte at index " + std::to_string(i) + ": 0x" + ss.str()));
            }
        }

        if (state != 0)
        {
            // we finish reading, but do not accept: string was incomplete
            std::stringstream ss;
            ss << std::setw(2) << std::uppercase << std::setfill('0') << std::hex << static_cast<int>(static_cast<uint8_t>(str.back()));
            JSON_THROW(type_error::create(316, "incomplete UTF-8 string; last byte: 0x" + ss.str()));
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4d0, %rsp            # imm = 0x4D0
movq %rdi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x448(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3200
movq %rax, %rcx
movq -0x448(%rbp), %rax
cmpq %rcx, %rax
jae 0x9251
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x32f0
movb (%rax), %al
movb %al, -0x19(%rbp)
leaq -0x9(%rbp), %rdi
movzbl -0x19(%rbp), %esi
callq 0x9a90
movzbl -0x9(%rbp), %eax
cmpl $0x1, %eax
jne 0x923e
leaq -0x1a8(%rbp), %rdi
callq 0x3210
leaq -0x198(%rbp), %rax
movq %rax, -0x458(%rbp)
movl $0x2, %edi
callq 0x9af0
movl %eax, -0x44c(%rbp)
jmp 0x8fca
movq -0x458(%rbp), %rdi
movl -0x44c(%rbp), %eax
movl %eax, -0x1ac(%rbp)
movl -0x1ac(%rbp), %esi
callq 0x3300
movq %rax, -0x460(%rbp)
jmp 0x8ff1
movq -0x460(%rbp), %rdi
leaq 0xb11(%rip), %rsi       # 0x9b10
callq 0x30c0
movq %rax, -0x468(%rbp)
jmp 0x900d
movl $0x30, %edi
callq 0x9b40
movb %al, -0x469(%rbp)
jmp 0x901f
movq -0x468(%rbp), %rdi
movb -0x469(%rbp), %al
movb %al, -0x1bd(%rbp)
movzbl -0x1bd(%rbp), %esi
callq 0x33e0
movq %rax, -0x478(%rbp)
jmp 0x9047
movq -0x478(%rbp), %rdi
leaq 0xb0b(%rip), %rsi       # 0x9b60
callq 0x30c0
movq %rax, -0x480(%rbp)
jmp 0x9063
movq -0x480(%rbp), %rdi
movzbl -0x19(%rbp), %esi
callq 0x3440
jmp 0x9075
movb $0x1, -0x261(%rbp)
movl $0x20, %edi
callq 0x3160
movq %rax, -0x488(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x240(%rbp), %rdi
callq 0x9e50
jmp 0x909f
leaq 0xbcc8(%rip), %rsi      # 0x14d6e
leaq -0x220(%rbp), %rdi
leaq -0x240(%rbp), %rdx
callq 0x9e00
jmp 0x90bb
leaq 0xbceb(%rip), %rdx      # 0x14dad
leaq -0x200(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x9db0
jmp 0x90d7
leaq -0x260(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x32a0
jmp 0x90ec
leaq -0x1e0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
leaq -0x260(%rbp), %rdx
callq 0x9ce0
jmp 0x9108
movq -0x488(%rbp), %rdi
movl $0x13c, %esi            # imm = 0x13C
leaq -0x1e0(%rbp), %rdx
callq 0x9b90
jmp 0x9122
movq -0x488(%rbp), %rdi
movb $0x0, -0x261(%rbp)
leaq 0x16bc9(%rip), %rsi     # 0x1fd00
leaq 0xdf2(%rip), %rdx       # 0x9f30
callq 0x3420
jmp 0x9468
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x922d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x9214
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x9208
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x91fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x91f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x91e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x31c0
leaq -0x260(%rbp), %rdi
callq 0x31c0
leaq -0x200(%rbp), %rdi
callq 0x31c0
leaq -0x220(%rbp), %rdi
callq 0x31c0
leaq -0x240(%rbp), %rdi
callq 0x31c0
testb $0x1, -0x261(%rbp)
jne 0x921f
jmp 0x922b
movq -0x488(%rbp), %rdi
callq 0x3220
jmp 0x922d
leaq -0x1a8(%rbp), %rdi
callq 0x3240
jmp 0x945c
jmp 0x9240
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x8f4b
movzbl -0x9(%rbp), %eax
cmpl $0x0, %eax
je 0x9453
leaq -0x3f0(%rbp), %rdi
callq 0x3210
leaq -0x3e0(%rbp), %rax
movq %rax, -0x498(%rbp)
movl $0x2, %edi
callq 0x9af0
movl %eax, -0x48c(%rbp)
jmp 0x928a
movq -0x498(%rbp), %rdi
movl -0x48c(%rbp), %eax
movl %eax, -0x3f4(%rbp)
movl -0x3f4(%rbp), %esi
callq 0x3300
movq %rax, -0x4a0(%rbp)
jmp 0x92b1
movq -0x4a0(%rbp), %rdi
leaq 0x851(%rip), %rsi       # 0x9b10
callq 0x30c0
movq %rax, -0x4a8(%rbp)
jmp 0x92cd
movl $0x30, %edi
callq 0x9b40
movb %al, -0x4a9(%rbp)
jmp 0x92df
movq -0x4a8(%rbp), %rdi
movb -0x4a9(%rbp), %al
movb %al, -0x3f5(%rbp)
movzbl -0x3f5(%rbp), %esi
callq 0x33e0
movq %rax, -0x4b8(%rbp)
jmp 0x9307
movq -0x4b8(%rbp), %rdi
leaq 0x84b(%rip), %rsi       # 0x9b60
callq 0x30c0
movq %rax, -0x4c0(%rbp)
jmp 0x9323
movq -0x8(%rbp), %rdi
callq 0x3150
movq -0x4c0(%rbp), %rdi
movzbl (%rax), %esi
callq 0x3440
jmp 0x933d
movb $0x1, -0x439(%rbp)
movl $0x20, %edi
callq 0x3160
movq %rax, -0x4c8(%rbp)
leaq -0x438(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x32a0
jmp 0x936a
leaq 0xba1a(%rip), %rsi      # 0x14d8b
leaq -0x418(%rbp), %rdi
leaq -0x438(%rbp), %rdx
callq 0x9e00
jmp 0x9386
movq -0x4c8(%rbp), %rdi
movl $0x13c, %esi            # imm = 0x13C
leaq -0x418(%rbp), %rdx
callq 0x9b90
jmp 0x93a0
movq -0x4c8(%rbp), %rdi
movb $0x0, -0x439(%rbp)
leaq 0x1694b(%rip), %rsi     # 0x1fd00
leaq 0xb74(%rip), %rdx       # 0x9f30
callq 0x3420
jmp 0x9468
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x9445
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x942c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x9420
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x418(%rbp), %rdi
callq 0x31c0
leaq -0x438(%rbp), %rdi
callq 0x31c0
testb $0x1, -0x439(%rbp)
jne 0x9437
jmp 0x9443
movq -0x4c8(%rbp), %rdi
callq 0x3220
jmp 0x9445
leaq -0x3f0(%rbp), %rdi
callq 0x3240
jmp 0x945c
addq $0x4d0, %rsp            # imm = 0x4D0
popq %rbp
retq
movq -0x1b8(%rbp), %rdi
callq 0x3450
nopl (%rax,%rax)