// File: yayuntian[P]user_agent/operatingSystem.cpp
// Function: normalizeOS(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string normalizeOS(string name) {
    vector<string> sp;
    split(sp, name, is_any_of(" "));

    if (sp.size() != 3 || sp[1] != "NT") {
        return name;
    }

    int version = atoi(replace_all_copy(sp[2], ".", "").c_str());
    switch (version) {
        case 50:
            return "Windows 2000";
        case 501:
            return "Windows 2000, Service Pack 1 (SP1)";
        case 51:
            return "Windows XP";
        case 52:
            return "Windows XP x64 Edition";
        case 60:
            return "Windows Vista";
        case 61:
            return "Windows 7";
        case 62:
            return "Windows 8";
        case 63:
            return "Windows 8.1";
        case 100:
            return "Windows 10";
    }
    return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rsi, -0xa0(%rbp)
movq %rdi, -0x98(%rbp)
movq %rdi, %rax
movq %rax, -0x90(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x15710
leaq 0x1d78e(%rip), %rsi     # 0x6b1d9
leaq -0x40(%rbp), %rdi
callq 0x4f8f0
jmp 0x4da56
movq -0xa0(%rbp), %rsi
leaq -0x28(%rbp), %rdi
leaq -0x40(%rbp), %rdx
movl $0x1, %ecx
callq 0x4f820
jmp 0x4da71
leaq -0x40(%rbp), %rdi
callq 0x4f940
leaq -0x28(%rbp), %rdi
callq 0x15690
cmpq $0x3, %rax
jne 0x4daba
leaq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x4f7a0
movq %rax, %rdi
leaq 0x20ba9(%rip), %rsi     # 0x6e64a
callq 0x4f770
movb %al, -0xa1(%rbp)
jmp 0x4daae
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x4daba
jmp 0x4db04
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdi
callq 0x82a0
movl $0x1, -0x50(%rbp)
jmp 0x4df4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4df67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x4f940
jmp 0x4df67
leaq -0x28(%rbp), %rdi
movl $0x2, %esi
callq 0x4f7a0
movq %rax, %rsi
leaq 0x1e8db(%rip), %rdx     # 0x6c3f7
leaq 0x1c8e9(%rip), %rcx     # 0x6a40c
leaq -0x78(%rbp), %rdi
callq 0x4f990
jmp 0x4db2e
leaq -0x78(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x81a0
movq %rax, %rdi
callq 0x8750
movq -0xb8(%rbp), %rdi
movl %eax, -0xac(%rbp)
callq 0x89e8
movl -0xac(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0xa8(%rbp)
subl $0x32, %eax
je 0x4dbfe
jmp 0x4db75
movl -0xa8(%rbp), %eax
subl $0x33, %eax
je 0x4dcb4
jmp 0x4db86
movl -0xa8(%rbp), %eax
subl $0x34, %eax
je 0x4dd0f
jmp 0x4db97
movl -0xa8(%rbp), %eax
subl $0x3c, %eax
je 0x4dd6a
jmp 0x4dba8
movl -0xa8(%rbp), %eax
subl $0x3d, %eax
je 0x4ddc5
jmp 0x4dbb9
movl -0xa8(%rbp), %eax
subl $0x3e, %eax
je 0x4de20
jmp 0x4dbca
movl -0xa8(%rbp), %eax
subl $0x3f, %eax
je 0x4de7b
jmp 0x4dbdb
movl -0xa8(%rbp), %eax
subl $0x64, %eax
je 0x4ded6
jmp 0x4dbec
movl -0xa8(%rbp), %eax
subl $0x1f5, %eax            # imm = 0x1F5
je 0x4dc59
jmp 0x4df34
leaq -0x79(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x88c0
movq -0x98(%rbp), %rdi
movq -0xc0(%rbp), %rdx
leaq 0x20988(%rip), %rsi     # 0x6e5ab
callq 0x13330
jmp 0x4dc2a
leaq -0x79(%rbp), %rdi
callq 0x8510
movl $0x1, -0x50(%rbp)
jmp 0x4df4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x79(%rbp), %rdi
callq 0x8510
jmp 0x4df67
leaq -0x7a(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x88c0
movq -0x98(%rbp), %rdi
movq -0xc8(%rbp), %rdx
leaq 0x2093a(%rip), %rsi     # 0x6e5b8
callq 0x13330
jmp 0x4dc85
leaq -0x7a(%rbp), %rdi
callq 0x8510
movl $0x1, -0x50(%rbp)
jmp 0x4df4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x7a(%rbp), %rdi
callq 0x8510
jmp 0x4df67
leaq -0x7b(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x88c0
movq -0x98(%rbp), %rdi
movq -0xd0(%rbp), %rdx
leaq 0x20902(%rip), %rsi     # 0x6e5db
callq 0x13330
jmp 0x4dce0
leaq -0x7b(%rbp), %rdi
callq 0x8510
movl $0x1, -0x50(%rbp)
jmp 0x4df4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x7b(%rbp), %rdi
callq 0x8510
jmp 0x4df67
leaq -0x7c(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x88c0
movq -0x98(%rbp), %rdi
movq -0xd8(%rbp), %rdx
leaq 0x208b2(%rip), %rsi     # 0x6e5e6
callq 0x13330
jmp 0x4dd3b
leaq -0x7c(%rbp), %rdi
callq 0x8510
movl $0x1, -0x50(%rbp)
jmp 0x4df4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x7c(%rbp), %rdi
callq 0x8510
jmp 0x4df67
leaq -0x7d(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x88c0
movq -0x98(%rbp), %rdi
movq -0xe0(%rbp), %rdx
leaq 0x2086e(%rip), %rsi     # 0x6e5fd
callq 0x13330
jmp 0x4dd96
leaq -0x7d(%rbp), %rdi
callq 0x8510
movl $0x1, -0x50(%rbp)
jmp 0x4df4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x7d(%rbp), %rdi
callq 0x8510
jmp 0x4df67
leaq -0x7e(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x88c0
movq -0x98(%rbp), %rdi
movq -0xe8(%rbp), %rdx
leaq 0x20821(%rip), %rsi     # 0x6e60b
callq 0x13330
jmp 0x4ddf1
leaq -0x7e(%rbp), %rdi
callq 0x8510
movl $0x1, -0x50(%rbp)
jmp 0x4df4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x7e(%rbp), %rdi
callq 0x8510
jmp 0x4df67
leaq -0x7f(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x88c0
movq -0x98(%rbp), %rdi
movq -0xf0(%rbp), %rdx
leaq 0x207d0(%rip), %rsi     # 0x6e615
callq 0x13330
jmp 0x4de4c
leaq -0x7f(%rbp), %rdi
callq 0x8510
movl $0x1, -0x50(%rbp)
jmp 0x4df4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x7f(%rbp), %rdi
callq 0x8510
jmp 0x4df67
leaq -0x80(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x88c0
movq -0x98(%rbp), %rdi
movq -0xf8(%rbp), %rdx
leaq 0x2077f(%rip), %rsi     # 0x6e61f
callq 0x13330
jmp 0x4dea7
leaq -0x80(%rbp), %rdi
callq 0x8510
movl $0x1, -0x50(%rbp)
jmp 0x4df4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x8510
jmp 0x4df67
leaq -0x81(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x88c0
movq -0x98(%rbp), %rdi
movq -0x100(%rbp), %rdx
leaq 0x2072d(%rip), %rsi     # 0x6e62b
callq 0x13330
jmp 0x4df05
leaq -0x81(%rbp), %rdi
callq 0x8510
movl $0x1, -0x50(%rbp)
jmp 0x4df4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x81(%rbp), %rdi
callq 0x8510
jmp 0x4df67
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdi
callq 0x82a0
movl $0x1, -0x50(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x15790
movq -0x90(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x15790
movq -0x48(%rbp), %rdi
callq 0x88a0
nopl (%rax)