// File: /workspace/github_cpp_makefile_star2_O1/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)
movq $0x0, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
movl $0x0, 0x28(%rdi)
movq %rsp, %rdi
callq 0x397c
movq (%rsp), %rdi
leaq 0x83c5(%rip), %rsi      # 0xc004
callq 0x30b0
testl %eax, %eax
je 0x3ce7
movq (%rsp), %rdi
leaq 0x83e8(%rip), %rsi      # 0xc03f
callq 0x30b0
testl %eax, %eax
je 0x3d73
movq (%rsp), %rdi
leaq 0x83e7(%rip), %rsi      # 0xc056
callq 0x30b0
testl %eax, %eax
je 0x3da9
movq (%rsp), %rdi
leaq 0x83d3(%rip), %rsi      # 0xc05a
callq 0x30b0
testl %eax, %eax
je 0x3dec
movq (%rsp), %rdi
leaq 0x83d4(%rip), %rsi      # 0xc073
callq 0x30b0
testl %eax, %eax
je 0x3e07
movq (%rsp), %rdi
leaq 0x83c3(%rip), %rsi      # 0xc07a
callq 0x30b0
testl %eax, %eax
je 0x3e22
movq (%rsp), %rdi
leaq 0x83b1(%rip), %rsi      # 0xc080
callq 0x30b0
testl %eax, %eax
je 0x3e3d
movl $0x7, (%rbx)
jmp 0x3dd2
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
subq %rsi, %rax
cmpq $0x60, %rax
jne 0x3e5b
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 0x3e7a
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x3e86
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x3e86
testl %ecx, %ecx
jne 0x3d6e
movl 0x1c(%rsp), %ecx
movl %ecx, (%r15)
movl %eax, 0x28(%rbx)
jmp 0x3dd2
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
subq %rsi, %rcx
movl $0x1, %eax
cmpq $0x40, %rcx
je 0x3dc4
leaq 0x82b2(%rip), %rdi      # 0xc043
leaq 0x8283(%rip), %rsi      # 0xc01b
leaq 0x8286(%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 0x3e92
movl %eax, (%rbx)
addq $0x20, %rsi
movq %r14, %rdi
callq 0x3160
movq %rsp, %rdi
callq 0x3fa8
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 0x3eb1
movl $0x3, (%rbx)
jmp 0x3dd2
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cmpq $0x20, %rax
jne 0x3ed0
movl $0x4, (%rbx)
jmp 0x3dd2
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cmpq $0x40, %rax
jne 0x3eef
movl $0x5, (%rbx)
jmp 0x3dd2
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cmpq $0x20, %rax
jne 0x3f0e
movl $0x6, (%rbx)
jmp 0x3dd2
leaq 0x81a6(%rip), %rdi      # 0xc008
leaq 0x81b2(%rip), %rsi      # 0xc01b
leaq 0x81b5(%rip), %rcx      # 0xc025
movl $0x31, %edx
callq 0x31a0
leaq 0x8204(%rip), %rdi      # 0xc085
callq 0x3190
leaq 0x81f8(%rip), %rdi      # 0xc085
callq 0x3380
leaq 0x81aa(%rip), %rdi      # 0xc043
leaq 0x817b(%rip), %rsi      # 0xc01b
leaq 0x817e(%rip), %rcx      # 0xc025
movl $0x3a, %edx
callq 0x31a0
leaq 0x81a8(%rip), %rdi      # 0xc060
leaq 0x815c(%rip), %rsi      # 0xc01b
leaq 0x815f(%rip), %rcx      # 0xc025
movl $0x3e, %edx
callq 0x31a0
leaq 0x8189(%rip), %rdi      # 0xc060
leaq 0x813d(%rip), %rsi      # 0xc01b
leaq 0x8140(%rip), %rcx      # 0xc025
movl $0x41, %edx
callq 0x31a0
leaq 0x814d(%rip), %rdi      # 0xc043
leaq 0x811e(%rip), %rsi      # 0xc01b
leaq 0x8121(%rip), %rcx      # 0xc025
movl $0x44, %edx
callq 0x31a0
leaq 0x814b(%rip), %rdi      # 0xc060
leaq 0x80ff(%rip), %rsi      # 0xc01b
leaq 0x8102(%rip), %rcx      # 0xc025
movl $0x47, %edx
callq 0x31a0
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x3f42
movl 0x1c(%rsp), %eax
movl %eax, (%r15)
jmp 0x3f42
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3fa8
jmp 0x3f4f
movq %rax, %rbx
movq (%r14), %rdi
cmpq %rbp, %rdi
je 0x3f63
movq (%rbp), %rsi
incq %rsi
callq 0x32a0
movq %rbx, %rdi
callq 0x3410