// File: /workspace/github_cpp_makefile_star2_O3/momohatt[P]seccampDB/utils.cpp
// Function: parse_query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Query parse_query(string input) {
    Query q = Query();
    vector<string> fields = words(input);

    if (fields[0] == "set") {
        assert(fields.size() == 3);
        q.cmd = Query::Set;
        q.arg1 = fields[1];
        q.arg2 = stoi(fields[2]);
    } else if (fields[0] == "get") {
        assert(fields.size() == 2);
        q.cmd = Query::Get;
        q.arg1 = fields[1];
    } else if (fields[0] == "del") {
        assert(fields.size() == 2);
        q.cmd = Query::Del;
        q.arg1 = fields[1];
    } else if (fields[0] == "begin") {
        assert(fields.size() == 1);
        q.cmd = Query::Begin;
    } else if (fields[0] == "commit") {
        assert(fields.size() == 1);
        q.cmd = Query::Commit;
    } else if (fields[0] == "abort") {
        assert(fields.size() == 2);
        q.cmd = Query::Abort;
    } else if (fields[0] == "keys") {
        assert(fields.size() == 1);
        q.cmd = Query::Keys;
    } else {
        q.cmd = Query::Unknown;
    }
    return q;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, 0x20(%rdi)
movl $0x7, (%rdi)
leaq 0x8(%rdi), %r14
leaq 0x18(%rdi), %rbp
movq %rbp, 0x8(%rdi)
movb $0x0, 0x18(%rdi)
movq %rsp, %rdi
callq 0x399c
movq (%rsp), %rdi
leaq 0x83c7(%rip), %rsi      # 0xc004
callq 0x30b0
testl %eax, %eax
je 0x3ce5
movq (%rsp), %rdi
leaq 0x83ea(%rip), %rsi      # 0xc03f
callq 0x30b0
testl %eax, %eax
je 0x3d71
movq (%rsp), %rdi
leaq 0x83e9(%rip), %rsi      # 0xc056
callq 0x30b0
testl %eax, %eax
je 0x3da7
movq (%rsp), %rdi
leaq 0x83d5(%rip), %rsi      # 0xc05a
callq 0x30b0
testl %eax, %eax
je 0x3dea
movq (%rsp), %rdi
leaq 0x83d6(%rip), %rsi      # 0xc073
callq 0x30b0
testl %eax, %eax
je 0x3e05
movq (%rsp), %rdi
leaq 0x83c5(%rip), %rsi      # 0xc07a
callq 0x30b0
testl %eax, %eax
je 0x3e20
movq (%rsp), %rdi
leaq 0x83b3(%rip), %rsi      # 0xc080
callq 0x30b0
testl %eax, %eax
je 0x3e3b
movl $0x7, (%rbx)
jmp 0x3dd0
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
subq %rsi, %rax
cmpq $0x60, %rax
jne 0x3e59
movl $0x0, (%rbx)
addq $0x20, %rsi
movq %r14, %rdi
callq 0x3160
movq (%rsp), %rax
movq 0x40(%rax), %r12
callq 0x3050
movq %rax, %r15
movl (%rax), %eax
movl %eax, 0x1c(%rsp)
movl $0x0, (%r15)
leaq 0x20(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x3350
cmpq %r12, (%r13)
je 0x3e78
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x3e84
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x3e84
testl %ecx, %ecx
jne 0x3d6c
movl 0x1c(%rsp), %ecx
movl %ecx, (%r15)
movl %eax, 0x28(%rbx)
jmp 0x3dd0
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
subq %rsi, %rcx
movl $0x1, %eax
cmpq $0x40, %rcx
je 0x3dc2
leaq 0x82b4(%rip), %rdi      # 0xc043
leaq 0x8285(%rip), %rsi      # 0xc01b
leaq 0x8288(%rip), %rcx      # 0xc025
movl $0x36, %edx
callq 0x31a0
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
subq %rsi, %rcx
movl $0x2, %eax
cmpq $0x40, %rcx
jne 0x3e90
movl %eax, (%rbx)
addq $0x20, %rsi
movq %r14, %rdi
callq 0x3160
movq %rsp, %rdi
callq 0x3fa6
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cmpq $0x20, %rax
jne 0x3eaf
movl $0x3, (%rbx)
jmp 0x3dd0
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cmpq $0x20, %rax
jne 0x3ece
movl $0x4, (%rbx)
jmp 0x3dd0
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cmpq $0x40, %rax
jne 0x3eed
movl $0x5, (%rbx)
jmp 0x3dd0
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cmpq $0x20, %rax
jne 0x3f0c
movl $0x6, (%rbx)
jmp 0x3dd0
leaq 0x81a8(%rip), %rdi      # 0xc008
leaq 0x81b4(%rip), %rsi      # 0xc01b
leaq 0x81b7(%rip), %rcx      # 0xc025
movl $0x31, %edx
callq 0x31a0
leaq 0x8206(%rip), %rdi      # 0xc085
callq 0x3190
leaq 0x81fa(%rip), %rdi      # 0xc085
callq 0x3380
leaq 0x81ac(%rip), %rdi      # 0xc043
leaq 0x817d(%rip), %rsi      # 0xc01b
leaq 0x8180(%rip), %rcx      # 0xc025
movl $0x3a, %edx
callq 0x31a0
leaq 0x81aa(%rip), %rdi      # 0xc060
leaq 0x815e(%rip), %rsi      # 0xc01b
leaq 0x8161(%rip), %rcx      # 0xc025
movl $0x3e, %edx
callq 0x31a0
leaq 0x818b(%rip), %rdi      # 0xc060
leaq 0x813f(%rip), %rsi      # 0xc01b
leaq 0x8142(%rip), %rcx      # 0xc025
movl $0x41, %edx
callq 0x31a0
leaq 0x814f(%rip), %rdi      # 0xc043
leaq 0x8120(%rip), %rsi      # 0xc01b
leaq 0x8123(%rip), %rcx      # 0xc025
movl $0x44, %edx
callq 0x31a0
leaq 0x814d(%rip), %rdi      # 0xc060
leaq 0x8101(%rip), %rsi      # 0xc01b
leaq 0x8104(%rip), %rcx      # 0xc025
movl $0x47, %edx
callq 0x31a0
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x3f40
movl 0x1c(%rsp), %eax
movl %eax, (%r15)
jmp 0x3f40
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3fa6
jmp 0x3f4d
movq %rax, %rbx
movq (%r14), %rdi
cmpq %rbp, %rdi
je 0x3f61
movq (%rbp), %rsi
incq %rsi
callq 0x32a0
movq %rbx, %rdi
callq 0x3410