// File: /workspace/github_cpp_makefile_star2_O3/yayuntian[P]user_agent/operatingSystem.cpp
// Function: gecko(UserAgent&, 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>>>>&, int)
void gecko(UserAgent& p, vector<string>& comment, int slen) {
    if (slen <= 1) {
        return;
    }

    if (comment[1] == "U") {
        if (slen > 2) {
            p.os = normalizeOS(comment[2]);
        } else {
            p.os = normalizeOS(comment[1]);
        }
    } else {
        if (p.platform == "Android") {
            p.mobile = true;
            p.os = p.platform;
            p.platform = normalizeOS(comment[1]);
        } else if (comment[0] == "Mobile" || comment[0] == "Tablet") {
            p.mobile = true;
            p.os = "FirefoxOS";
        } else {
            if (p.os == "") {
                p.os = normalizeOS(comment[1]);
            }
        }
    }

    if (slen > 3 && !starts_with(comment[3], "rv:")) {
        p.localization = comment[3];
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
cmpl $0x2, %edx
jl 0x22a8b
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
addq $0x20, %rdi
leaq 0x12ab9(%rip), %rsi     # 0x35253
callq 0x60d0
testl %eax, %eax
je 0x2287f
leaq 0x40(%rbx), %r15
leaq 0xcbf5(%rip), %rsi      # 0x2f3a7
movq %r15, %rdi
callq 0x60d0
testl %eax, %eax
je 0x2292f
movq (%r14), %rdi
leaq 0x12a5a(%rip), %rsi     # 0x35226
callq 0x60d0
testl %eax, %eax
je 0x22907
movq (%r14), %rdi
leaq 0xc3fb(%rip), %rsi      # 0x2ebde
callq 0x60d0
testl %eax, %eax
je 0x22907
leaq 0x60(%rbx), %r15
leaq 0xebc9(%rip), %rsi      # 0x313c4
movq %r15, %rdi
callq 0x60d0
testl %eax, %eax
jne 0x22a33
movq (%r14), %rax
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0xc5fa
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x22045
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x6410
movq (%r12), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x22867
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6340
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x22a33
movq 0x38(%rsp), %rsi
jmp 0x22a2b
cmpl $0x2, %ebp
jne 0x229b3
movq (%r14), %rax
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0xc5fa
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x22045
addq $0x60, %rbx
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6410
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x228e7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6340
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x22a8b
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x6340
jmp 0x22a8b
movb $0x1, 0x121(%rbx)
leaq 0x60(%rbx), %rdi
movq 0x68(%rbx), %rdx
leaq 0xc212(%rip), %rcx      # 0x2eb2f
movl $0x9, %r8d
xorl %esi, %esi
callq 0x6550
jmp 0x22a33
movb $0x1, 0x121(%rbx)
leaq 0x60(%rbx), %rdi
movq %r15, %rsi
callq 0x61f0
movq (%r14), %rax
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %r12
movq %r12, %rdi
callq 0xc5fa
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x22045
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x6410
movq (%r12), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2299e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6340
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x22a33
movq 0x58(%rsp), %rsi
jmp 0x22a2b
movq (%r14), %rax
leaq 0x98(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %r15
movq %r15, %rdi
callq 0xc5fa
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x22045
leaq 0x60(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x6410
movq (%r15), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x22a16
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6340
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x22a33
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6340
cmpl $0x4, %ebp
jb 0x22a8b
movq (%r14), %rsi
movq 0x68(%rsi), %rax
addq $0x60, %rsi
testq %rax, %rax
je 0x22a7f
decq %rax
cmpq $0x2, %rax
movl $0x2, %ecx
cmovbq %rax, %rcx
movq (%rsi), %rdx
incq %rcx
xorl %edi, %edi
leaq 0x127aa(%rip), %r8      # 0x35211
movb (%rdx,%rdi), %r9b
cmpb (%rdi,%r8), %r9b
jne 0x22a7f
incq %rdi
cmpq %rdi, %rcx
jne 0x22a67
cmpq $0x1, %rax
ja 0x22a8b
subq $-0x80, %rbx
movq %rbx, %rdi
callq 0x61f0
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x22af9
movq 0x38(%rsp), %rsi
jmp 0x22af1
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x22af9
movq 0x98(%rsp), %rsi
jmp 0x22af1
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x22af9
movq 0x78(%rsp), %rsi
jmp 0x22af1
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x22af9
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6340
movq %rbx, %rdi
callq 0x6630