// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0xfcce(%rip), %rax      # 0x31d41
leaq 0x70(%rsp), %rsi
movq %rax, (%rsi)
leaq 0xfcc0(%rip), %rax      # 0x31d42
movq %rax, 0x8(%rsi)
leaq 0x40(%rsp), %rdi
callq 0x24216
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
movq %r14, %rsi
movl $0x1, %ecx
callq 0x23db7
cmpq $0x11, 0x50(%rsp)
jb 0x220be
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x220be
callq 0x6440
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rax
subq %rdi, %rax
cmpq $0x60, %rax
jne 0x220e5
addq $0x20, %rdi
leaq 0x13132(%rip), %rsi     # 0x3520e
callq 0x60d0
testl %eax, %eax
je 0x22140
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
movq (%r14), %rdx
leaq 0x10(%r14), %rax
cmpq %rax, %rdx
je 0x22104
movq %rdx, (%rbx)
movq (%rax), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x2210a
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, (%r14)
movq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
leaq 0x20(%rsp), %rdi
callq 0xd4b2
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x20(%rsp), %rax
leaq 0x40(%rax), %rsi
leaq 0x10e58(%rip), %rcx     # 0x32fa8
movq %rcx, 0x58(%rsp)
leaq 0x10e4d(%rip), %rcx     # 0x32fa9
movq %rcx, 0x60(%rsp)
movq 0x40(%rax), %rcx
movq 0x48(%rax), %rdx
leaq (%rcx,%rdx), %rax
testq %rdx, %rdx
je 0x2217f
cmpb $0x2e, (%rcx)
je 0x22184
incq %rcx
decq %rdx
jne 0x22172
movq %rax, %rcx
jmp 0x22188
leaq 0x1(%rcx), %rax
leaq 0x90(%rsp), %r8
movq %rcx, (%r8)
movq %rax, 0x8(%r8)
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xf213(%rip), %rcx      # 0x313c4
leaq 0x70(%rsp), %rdi
movq %rcx, %rdx
callq 0x255cc
leaq 0x80(%rsp), %r13
movq -0x10(%r13), %r12
movq %r12, %rdi
callq 0x6560
movl %eax, %r15d
cmpq %r13, %r12
je 0x221ed
movq 0x80(%rsp), %rsi
incq %rsi
movq %r12, %rdi
callq 0x6340
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
leal -0x32(%r15), %eax
cmpl $0xd, %eax
ja 0x22228
leaq 0x12f10(%rip), %rdx     # 0x35114
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
leaq 0x12f5b(%rip), %rsi     # 0x3516f
leaq 0x12f60(%rip), %rdx     # 0x3517b
movq %rbx, %rdi
callq 0xc690
jmp 0x22122
cmpl $0x64, %r15d
je 0x222fc
cmpl $0x1f5, %r15d           # imm = 0x1F5
jne 0x220ec
leaq 0x12f36(%rip), %rsi     # 0x3517c
leaq 0x12f51(%rip), %rdx     # 0x3519e
movq %rbx, %rdi
callq 0xc690
jmp 0x22122
leaq 0x12f60(%rip), %rsi     # 0x351c1
leaq 0x12f66(%rip), %rdx     # 0x351ce
movq %rbx, %rdi
callq 0xc690
jmp 0x22122
leaq 0x12f2e(%rip), %rsi     # 0x351aa
leaq 0x12f3d(%rip), %rdx     # 0x351c0
movq %rbx, %rdi
callq 0xc690
jmp 0x22122
leaq 0x12f08(%rip), %rsi     # 0x3519f
leaq 0x12f0b(%rip), %rdx     # 0x351a9
movq %rbx, %rdi
callq 0xc690
jmp 0x22122
leaq 0x12f31(%rip), %rsi     # 0x351e3
leaq 0x12f35(%rip), %rdx     # 0x351ee
movq %rbx, %rdi
callq 0xc690
jmp 0x22122
leaq 0x12f0c(%rip), %rsi     # 0x351d9
leaq 0x12f0e(%rip), %rdx     # 0x351e2
movq %rbx, %rdi
callq 0xc690
jmp 0x22122
leaq 0x12ee7(%rip), %rsi     # 0x351cf
leaq 0x12ee9(%rip), %rdx     # 0x351d8
movq %rbx, %rdi
callq 0xc690
jmp 0x22122
leaq 0x12eec(%rip), %rsi     # 0x351ef
leaq 0x12eef(%rip), %rdx     # 0x351f9
movq %rbx, %rdi
callq 0xc690
jmp 0x22122
jmp 0x22347
jmp 0x22347
jmp 0x22347
jmp 0x22347
jmp 0x22347
jmp 0x22347
jmp 0x22347
jmp 0x22347
jmp 0x22347
jmp 0x22347
movq %rax, %rbx
cmpq $0x11, 0x50(%rsp)
jb 0x2234a
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x2234a
callq 0x6440
jmp 0x2234a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xd4b2
movq %rbx, %rdi
callq 0x6630