// File: momohatt[P]seccampDB/database.cpp
// Function: DataBase::deserialize(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::pair<ChangeMode, int>, 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::pair<ChangeMode, int>>>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
void DataBase::deserialize(DBDiff& diff, vector<string> buf) {
    for (const auto& line : buf) {
        vector<string> fields = words(line);
        if (fields.size() != 4) {
            diff = {};
            return;
        }
        // checksum validation
        string str = fields[1] + fields[2] + fields[3];
        if (((unsigned int) stol(fields[0])) != crc32(str)) {
            diff = {};
            return;
        }
        diff[fields[1]] = make_pair(
                stoi(fields[2]) ? Delete : New,
                stoi(fields[3]));
    }
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4f20
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4d60
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9370
testb $0x1, %al
jne 0x7b0b
jmp 0x7e0d
leaq -0x28(%rbp), %rdi
callq 0x53f0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x39b0
leaq -0x50(%rbp), %rdi
callq 0x4310
cmpq $0x4, %rax
je 0x7b6d
leaq -0x60(%rbp), %rdi
callq 0x9a70
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x9a90
jmp 0x7b50
movl $0x1, -0x70(%rbp)
jmp 0x7dd2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7e02
leaq -0x50(%rbp), %rdi
movq %rdi, -0x100(%rbp)
movl $0x1, %esi
callq 0x42f0
movq -0x100(%rbp), %rdi
movq %rax, -0xf8(%rbp)
movl $0x2, %esi
callq 0x42f0
movq -0xf8(%rbp), %rsi
movq %rax, %rdx
leaq -0xb0(%rbp), %rdi
callq 0xa400
jmp 0x7bb2
leaq -0x50(%rbp), %rdi
movl $0x3, %esi
callq 0x42f0
movq %rax, %rdx
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0xa3b0
jmp 0x7bd8
leaq -0xb0(%rbp), %rdi
callq 0x35f8
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x110(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x42f0
movq -0x110(%rbp), %rsi
movq %rax, %rdi
movl $0xa, %edx
callq 0xa480
movq %rax, -0x108(%rbp)
jmp 0x7c15
movq -0x108(%rbp), %rax
movl %eax, -0x114(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3150
jmp 0x7c37
leaq -0xd0(%rbp), %rdi
callq 0x40e0
movl %eax, -0x118(%rbp)
jmp 0x7c4b
leaq -0xd0(%rbp), %rdi
callq 0x35f8
movl -0x118(%rbp), %ecx
movl -0x114(%rbp), %eax
cmpl %ecx, %eax
je 0x7ce3
leaq -0xe0(%rbp), %rdi
callq 0x9a70
movq -0x10(%rbp), %rdi
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
callq 0x9a90
jmp 0x7c8c
movl $0x1, -0x70(%rbp)
jmp 0x7dc6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x35f8
jmp 0x7e02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7df6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x35f8
jmp 0x7df6
leaq -0x50(%rbp), %rdi
movl $0x2, %esi
callq 0x42f0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x4330
movl %eax, -0x11c(%rbp)
jmp 0x7d0a
movl -0x11c(%rbp), %eax
testl %eax, %eax
setne %al
movzbl %al, %eax
movl %eax, -0xec(%rbp)
leaq -0x50(%rbp), %rdi
movl $0x3, %esi
callq 0x42f0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x4330
movl %eax, -0x120(%rbp)
jmp 0x7d45
movl -0x120(%rbp), %eax
movl %eax, -0xf0(%rbp)
leaq -0xec(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x97b0
movq %rax, -0x128(%rbp)
jmp 0x7d6d
movq -0x128(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq -0x50(%rbp), %rdi
movl $0x1, %esi
callq 0x42f0
movq -0x138(%rbp), %rdi
movq %rax, %rsi
callq 0x9510
movq %rax, -0x130(%rbp)
jmp 0x7dac
movq -0x130(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x95f0
movl $0x0, -0x70(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x35f8
leaq -0x50(%rbp), %rdi
callq 0x41e0
movl -0x70(%rbp), %eax
testl %eax, %eax
je 0x7de6
jmp 0x7de4
jmp 0x7e0f
jmp 0x7de8
leaq -0x28(%rbp), %rdi
callq 0x93f0
jmp 0x7af5
leaq -0x90(%rbp), %rdi
callq 0x35f8
leaq -0x50(%rbp), %rdi
callq 0x41e0
jmp 0x7e18
jmp 0x7e0f
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x3540
nopw %cs:(%rax,%rax)