// File: /workspace/github_cpp_makefile_star2_O1/yayuntian[P]user_agent/operatingSystem.cpp
// Function: getOSInfo(UserAgent&)
OSInfo getOSInfo(UserAgent& p) {

    string os = replace_first_copy(p.os, "like Mac OS X", "");
    os = replace_first_copy(os, "CPU", "");
    os = trim_copy_if(os, is_any_of(" "));

    vector<string> osSplit;
    split(osSplit, os, is_any_of(" "));

    if (os == "Windows XP x64 Edition") {
        osSplit = split_v(osSplit, 0, 1);
    }

    string name, version;
    osName(osSplit, name, version);

    if (contains(name, "/")) {
        int s = name.size();
        char buf[64] = {0,};
        if (s < 64) {
            strncpy(buf, name.c_str(), name.size());
            char *ver = NULL;
            char *ptr = strtok_r(buf, "/", &ver);
            remove_rchar(buf);
            name = buf;
            if (ptr) {
                version = ver;
            }
        }
    }
    version = replace_all_copy(version, "_", ".");

    return OSInfo {
        .FUllName = p.os,
        .Name = name,
        .Version = version
    };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %rbp
movq %rdi, %rbx
addq $0x60, %rsi
leaq 0x119f0(%rip), %rax     # 0x37293
movq %rax, 0x40(%rsp)
leaq 0x119f1(%rip), %rax     # 0x372a0
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xdaf6(%rip), %rcx      # 0x333c4
leaq 0xb8(%rsp), %r15
movq %r15, %rdi
movq %rcx, %rdx
callq 0x27b77
movq (%r15), %rcx
movq 0x8(%r15), %rax
leaq (%rcx,%rax), %rdx
movq %rdx, %r15
movq %rdx, %r8
testq %rax, %rax
je 0x25946
decq %rax
leaq 0x119a0(%rip), %rsi     # 0x372a1
movq %rcx, %r8
xorl %edi, %edi
movb (%r8,%rdi), %r9b
cmpb (%rdi,%rsi), %r9b
jne 0x25928
leaq 0x1(%rdi), %r9
cmpq %rdi, %rax
je 0x25922
cmpq $0x2, %rdi
movq %r9, %rdi
jne 0x25906
leaq (%r8,%r9), %r15
jmp 0x2592f
leaq (%r8,%rdi), %r15
movq %rdi, %r9
cmpq $0x3, %r9
je 0x25946
incq %r8
decq %rax
cmpq %rdx, %r8
jne 0x25904
movq %rdx, %r15
movq %rdx, %r8
leaq 0x50(%rsp), %r13
leaq 0x40(%rsp), %rdi
cmpq %r15, %r8
je 0x259b2
movq %r13, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
subq %rcx, %r8
xorl %esi, %esi
xorl %edx, %edx
callq 0x73b0
leaq 0x40(%rsp), %rdi
movq 0x8(%rdi), %rsi
leaq 0xda44(%rip), %rcx      # 0x333c4
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x73b0
leaq 0x40(%rsp), %rdi
movq 0x8(%rdi), %rsi
movq 0xb8(%rsp), %r8
addq 0xc0(%rsp), %r8
subq %r15, %r8
xorl %edx, %edx
movq %r15, %rcx
callq 0x73b0
jmp 0x259bd
movq %r13, (%rdi)
movq %rcx, %rsi
callq 0xe87a
leaq 0xb8(%rsp), %rdi
leaq 0x40(%rsp), %r15
movq %r15, %rsi
callq 0x7410
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x259e7
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x7340
leaq 0xe39f(%rip), %r14      # 0x33d8d
leaq 0x20(%rsp), %rsi
movq %r14, (%rsi)
leaq 0xe391(%rip), %r12      # 0x33d8e
movq %r12, 0x8(%rsi)
leaq 0xf8(%rsp), %rdi
callq 0x26606
leaq 0x40(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x2641a
leaq 0xb8(%rsp), %rdi
leaq 0x40(%rsp), %r15
movq %r15, %rsi
callq 0x7410
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x25a52
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x7340
cmpq $0x11, 0x108(%rsp)
jb 0x25a6f
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x25a6f
callq 0x7440
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
leaq 0x40(%rsp), %rsi
movq %r14, (%rsi)
movq %r12, 0x8(%rsi)
leaq 0xe0(%rsp), %rdi
callq 0x26606
leaq 0x80(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0xe0(%rsp), %rdx
movl $0x1, %ecx
callq 0x261ad
cmpq $0x11, 0xf0(%rsp)
jb 0x25ade
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x25ade
callq 0x7440
leaq 0x11715(%rip), %rsi     # 0x371fa
leaq 0xb8(%rsp), %rdi
callq 0x70d0
testl %eax, %eax
jne 0x25b6a
leaq 0x20(%rsp), %rdi
leaq 0x80(%rsp), %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x2531d
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps 0x80(%rsp), %xmm0
movq 0x90(%rsp), %rax
leaq 0x20(%rsp), %r15
movups (%r15), %xmm1
movaps %xmm1, 0x80(%rsp)
movq 0x10(%r15), %rcx
movq %rcx, 0x90(%rsp)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movups %xmm1, (%r15)
movq $0x0, 0x10(%r15)
callq 0xf6ee
movq %r15, %rdi
callq 0xf6ee
leaq 0x30(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xa8(%rsp), %r14
movq %r14, -0x10(%r14)
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq 0x80(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x253a7
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq (%rsi,%rdx), %rax
testq %rdx, %rdx
je 0x25bce
movq %rdx, %rdi
movq %rsi, %rcx
cmpb $0x2f, (%rcx)
je 0x25bd3
incq %rcx
decq %rdi
jne 0x25bc1
movq %rax, %rcx
jmp 0x25bd7
leaq 0x1(%rcx), %rax
cmpq %rax, %rcx
je 0x25cc9
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
cmpl $0x3f, %edx
jg 0x25cc9
movq %rbp, 0xd8(%rsp)
leaq 0x40(%rsp), %r12
movq %r12, %rdi
callq 0x71d0
leaq 0x110(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0xddd5(%rip), %rsi      # 0x33a00
movq %r12, %rdi
callq 0x7660
movq %rax, %r15
movq %r12, %rdi
callq 0x7160
decl %eax
cltq
cmpb $0x5c, 0x40(%rsp,%rax)
jne 0x25c5d
addq %rsp, %rax
addq $0x40, %rax
movb $0x0, (%rax)
cmpb $0x5c, -0x1(%rax)
leaq -0x1(%rax), %rax
je 0x25c50
leaq 0x20(%rsp), %r12
movq 0x8(%r12), %r13
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
callq 0x7160
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rbp, %rcx
movq %rax, %r8
callq 0x7550
testq %r15, %r15
je 0x25cbc
movq 0x110(%rsp), %r15
leaq 0x98(%rsp), %r12
movq 0x8(%r12), %r13
movq %r15, %rdi
callq 0x7160
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x7550
movq 0xd8(%rsp), %rbp
leaq 0x50(%rsp), %r13
leaq 0x115d5(%rip), %rax     # 0x372a5
movq %rax, 0x110(%rsp)
leaq 0x115c7(%rip), %rax     # 0x372a6
movq %rax, 0x118(%rsp)
movq 0x98(%rsp), %rcx
movq 0xa0(%rsp), %rdx
leaq (%rcx,%rdx), %rax
testq %rdx, %rdx
je 0x25d0d
cmpb $0x5f, (%rcx)
je 0x25d12
incq %rcx
decq %rdx
jne 0x25d00
movq %rax, %rcx
jmp 0x25d16
leaq 0x1(%rcx), %rax
leaq 0x128(%rsp), %r8
movq %rcx, (%r8)
movq %rax, 0x8(%r8)
movq 0x120(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x110(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xf2af(%rip), %rdx      # 0x34ff4
leaq 0xf2a9(%rip), %rcx      # 0x34ff5
leaq 0x40(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x2799e
leaq 0x98(%rsp), %rdi
leaq 0x40(%rsp), %r15
movq %r15, %rsi
callq 0x7410
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x25d88
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x7340
leaq 0x10(%rbx), %r13
movq %r13, (%rbx)
movq 0x60(%rbp), %rsi
movq 0x68(%rbp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0xe87a
leaq 0x20(%rbx), %r15
leaq 0x30(%rbx), %rbp
movq %rbp, 0x20(%rbx)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0xe87a
leaq 0x40(%rbx), %rdi
leaq 0x50(%rbx), %rax
movq %rax, 0x40(%rbx)
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdx
addq %rsi, %rdx
callq 0xe87a
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x25e04
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7340
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x25e20
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7340
leaq 0x80(%rsp), %rdi
callq 0xf6ee
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25e4e
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x7340
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x25ed4
jmp 0x25efb
jmp 0x25f1c
movq %rax, %r12
movq (%r15), %rdi
cmpq %rbp, %rdi
je 0x25e8b
movq (%rbp), %rsi
incq %rsi
callq 0x7340
jmp 0x25e8b
movq %rax, %r12
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x25f1f
movq (%r13), %rsi
incq %rsi
callq 0x7340
jmp 0x25f1f
jmp 0x25f1c
movq %rax, %r12
cmpq $0x11, 0xf0(%rsp)
jb 0x25f58
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x25f58
callq 0x7440
jmp 0x25f58
movq %rax, %r12
jmp 0x25f58
movq %rax, %r12
cmpq $0x11, 0x108(%rsp)
jb 0x25f65
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x25f65
callq 0x7440
jmp 0x25f65
movq %rax, %r12
jmp 0x25f65
movq %rax, %r12
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x25f65
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x7340
jmp 0x25f65
movq %rax, %r12
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x25f3c
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7340
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x25f58
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7340
leaq 0x80(%rsp), %rdi
callq 0xf6ee
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25f86
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x7340
movq %r12, %rdi
callq 0x7630