// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x5fe7
movq %rdi, %rbx
movq (%rdi), %rcx
xorl %r14d, %r14d
leaq 0x430a(%rip), %rdx      # 0xa2bc
xorl %esi, %esi
movzbl (%rcx,%r14), %r15d
movzbl (%r15,%rdx), %edi
movzbl %sil, %esi
shll $0x4, %esi
addq %rdi, %rsi
movb 0x100(%rsi,%rdx), %sil
cmpb $0x1, %sil
je 0x5ff5
incq %r14
cmpq %r14, %rax
jne 0x5fb4
testb %sil, %sil
jne 0x60fa
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0x3170
movq 0x10(%rbx), %rax
movq -0x18(%rax), %rcx
movq $0x2, 0xc0(%rsp,%rcx)
movq -0x18(%rax), %rcx
orl $0x4000, 0xc8(%rsp,%rcx) # imm = 0x4000
movq -0x18(%rax), %rcx
leaq (%rsp,%rcx), %rbx
addq $0xb0, %rbx
cmpb $0x0, 0xe1(%rbx)
jne 0x605c
movq %rbx, %rdi
movl $0x20, %esi
callq 0x3210
movb $0x1, 0xe1(%rbx)
movq 0xb0(%rsp), %rax
leaq 0xb0(%rsp), %rdi
movb $0x30, 0xe0(%rbx)
movq -0x18(%rax), %rax
movl 0xc8(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0xc8(%rsp,%rax)
movl %r15d, %esi
callq 0x3380
movl $0x20, %edi
callq 0x3120
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x6835
leaq 0x33f0(%rip), %rsi      # 0x949c
leaq 0x80(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x67c5
leaq 0x3416(%rip), %rsi      # 0x94db
leaq 0x80(%rsp), %rdi
callq 0x33d0
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x61fc
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x6208
leaq 0xa0(%rsp), %r14
movq %r14, %rdi
callq 0x3170
movq 0x10(%r14), %rax
movq -0x18(%rax), %rcx
movq $0x2, 0xc0(%rsp,%rcx)
movq -0x18(%rax), %rcx
orl $0x4000, 0xc8(%rsp,%rcx) # imm = 0x4000
movq -0x18(%rax), %rcx
leaq (%rsp,%rcx), %r14
addq $0xb0, %r14
cmpb $0x0, 0xe1(%r14)
jne 0x6163
movq %r14, %rdi
movl $0x20, %esi
callq 0x3210
movb $0x1, 0xe1(%r14)
movq 0xb0(%rsp), %rax
leaq 0xb0(%rsp), %rdi
movb $0x30, 0xe0(%r14)
movq -0x18(%rax), %rax
movl 0xc8(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0xc8(%rsp,%rax)
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movzbl -0x1(%rax,%rcx), %esi
callq 0x3380
movl $0x20, %edi
callq 0x3120
movq %rax, %rbx
leaq 0xb8(%rsp), %rsi
movq %rsp, %rdi
callq 0x3340
leaq 0x32f9(%rip), %rsi      # 0x94b9
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x67c5
movb $0x1, %bpl
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
movl $0x13c, %esi            # imm = 0x13C
callq 0x65e4
xorl %ebp, %ebp
leaq 0x7b0d(%rip), %rsi      # 0xdcf8
leaq 0xf4c(%rip), %rdx       # 0x713e
movq %rbx, %rdi
callq 0x3370
jmp 0x6271
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xb8(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0x3340
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
leaq 0x60(%rsp), %rdx
callq 0x671d
movb $0x1, %bpl
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
movl $0x13c, %esi            # imm = 0x13C
callq 0x65e4
xorl %ebp, %ebp
leaq 0x7a96(%rip), %rsi      # 0xdcf8
leaq 0xed5(%rip), %rdx       # 0x713e
movq %rbx, %rdi
callq 0x3370
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6287
callq 0x3200
leaq 0x10(%rsp), %rax
jmp 0x630c
movq %rax, %r14
leaq 0x10(%rsp), %rax
jmp 0x6329
jmp 0x6339
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x62be
callq 0x3200
jmp 0x62be
movq %rax, %r14
movb $0x1, %bpl
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x62db
callq 0x3200
jmp 0x62db
jmp 0x6346
movq %rax, %r14
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x62f1
callq 0x3200
jmp 0x62f1
movq %rax, %r14
movb $0x1, %bpl
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6307
callq 0x3200
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x631a
callq 0x3200
testb %bpl, %bpl
jne 0x633c
jmp 0x6349
movq %rax, %r14
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x633c
callq 0x3200
jmp 0x633c
movq %rax, %r14
movq %rbx, %rdi
callq 0x3190
jmp 0x6349
movq %rax, %r14
movq 0x7c68(%rip), %rsi      # 0xdfb8
leaq 0xa0(%rsp), %rdi
callq 0x31b0
leaq 0x120(%rsp), %rdi
callq 0x30b0
movq %r14, %rdi
callq 0x3390