// File: bonetblai[P]mdp-engine/ctp3/../engine/utils.h
// Function: Utils::tokenize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::multimap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&, char)
inline void tokenize(const std::string &parameter_str, std::multimap<std::string, std::string> &parameters, char separator = ',') {
    for( size_t i = 0; i < parameter_str.size(); ++i ) {
        size_t first = i;
        int nesting_level = 0;
        while( i < parameter_str.size() ) {
            if( (parameter_str[i] == separator) && (nesting_level == 0) ) {
                break;
            } else if( parameter_str[i] == ')' ) {
                assert(nesting_level > 0);
                --nesting_level;
            } else if( parameter_str[i] == '(' ) {
                ++nesting_level;
            }
            ++i;
        }
        assert(nesting_level == 0);
        std::string par = parameter_str.substr(first, i - first);
        //std::cout << "parameter=|" << par << "|" << std::endl;
        size_t equal = par.find_first_of("=");
        assert(equal != std::string::npos);
        std::string key = par.substr(0, equal);
        std::string value = par.substr(equal + 1);
        //std::cout << "key=|" << key << "|, value=|" << value << "|" << std::endl;
        parameters.insert(std::make_pair(key, value));
    }
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movb %dl, %al
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movb %al, 0x107(%rsp)
movq $0x0, 0xf8(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x110(%rsp), %rdi
callq 0x6250
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jae 0x9c26
movq 0xf8(%rsp), %rax
movq %rax, 0xf0(%rsp)
movl $0x0, 0xec(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x110(%rsp), %rdi
callq 0x6250
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x9a26
movq 0x110(%rsp), %rdi
movq 0xf8(%rsp), %rsi
callq 0x63b0
movsbl (%rax), %eax
movsbl 0x107(%rsp), %ecx
cmpl %ecx, %eax
jne 0x9980
cmpl $0x0, 0xec(%rsp)
jne 0x9980
jmp 0x9a26
movq 0x110(%rsp), %rdi
movq 0xf8(%rsp), %rsi
callq 0x63b0
movsbl (%rax), %eax
cmpl $0x29, %eax
jne 0x99db
cmpl $0x0, 0xec(%rsp)
jle 0x99a9
jmp 0x99c8
leaq 0x53cdb(%rip), %rdi     # 0x5d68b
leaq 0x53ce6(%rip), %rsi     # 0x5d69d
movl $0x62, %edx
leaq 0x53cec(%rip), %rcx     # 0x5d6af
callq 0x6220
movl 0xec(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xec(%rsp)
jmp 0x9a0b
movq 0x110(%rsp), %rdi
movq 0xf8(%rsp), %rsi
callq 0x63b0
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x9a09
movl 0xec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xec(%rsp)
jmp 0x9a0b
jmp 0x9a0d
movq 0xf8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xf8(%rsp)
jmp 0x9922
cmpl $0x0, 0xec(%rsp)
jne 0x9a32
jmp 0x9a51
leaq 0x53cd1(%rip), %rdi     # 0x5d70a
leaq 0x53c5d(%rip), %rsi     # 0x5d69d
movl $0x69, %edx
leaq 0x53c63(%rip), %rcx     # 0x5d6af
callq 0x6220
movq 0x110(%rsp), %rsi
movq 0xf0(%rsp), %rdx
movq 0xf8(%rsp), %rcx
subq 0xf0(%rsp), %rcx
leaq 0xc8(%rsp), %rdi
callq 0x6350
leaq 0xc8(%rsp), %rdi
leaq 0x53731(%rip), %rsi     # 0x5d1be
xorl %eax, %eax
movl %eax, %edx
callq 0x6190
movq %rax, 0xc0(%rsp)
cmpq $-0x1, 0xc0(%rsp)
je 0x9aab
jmp 0x9aca
leaq 0x53c6b(%rip), %rdi     # 0x5d71d
leaq 0x53be4(%rip), %rsi     # 0x5d69d
movl $0x6d, %edx
leaq 0x53bea(%rip), %rcx     # 0x5d6af
callq 0x6220
movq 0xc0(%rsp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0xa0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x6350
jmp 0x9aed
movq 0xc0(%rsp), %rdx
incq %rdx
leaq 0x70(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
movq $-0x1, %rcx
callq 0x6350
jmp 0x9b13
movq 0x108(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x1ad90
jmp 0x9b39
movq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x1ad60
movq %rax, 0x8(%rsp)
jmp 0x9b4f
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x1add0
leaq 0x70(%rsp), %rdi
callq 0x61f0
leaq 0xa0(%rsp), %rdi
callq 0x61f0
leaq 0xc8(%rsp), %rdi
callq 0x61f0
movq 0xf8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xf8(%rsp)
jmp 0x98dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x9c17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x9c0a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x9c00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x1add0
leaq 0x70(%rsp), %rdi
callq 0x61f0
leaq 0xa0(%rsp), %rdi
callq 0x61f0
leaq 0xc8(%rsp), %rdi
callq 0x61f0
jmp 0x9c2e
addq $0x118, %rsp            # imm = 0x118
retq
movq 0x98(%rsp), %rdi
callq 0x6520
nopl (%rax,%rax)