// File: 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
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jg 0x4e471
jmp 0x4e7b0
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x4f7a0
movq %rax, %rdi
leaq 0x20206(%rip), %rsi     # 0x6e68f
callq 0x155a0
testb $0x1, %al
jne 0x4e497
jmp 0x4e59b
cmpl $0x2, -0x14(%rbp)
jle 0x4e512
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x4f7a0
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x81c0
movq -0x130(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x4da10
jmp 0x4e4d0
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
leaq -0x38(%rbp), %rsi
callq 0x85b0
leaq -0x38(%rbp), %rdi
callq 0x89e8
leaq -0x58(%rbp), %rdi
callq 0x89e8
jmp 0x4e596
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x89e8
jmp 0x4e7b9
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x4f7a0
movq %rax, %rsi
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x81c0
movq -0x138(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x4da10
jmp 0x4e54b
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
leaq -0x88(%rbp), %rsi
callq 0x85b0
leaq -0x88(%rbp), %rdi
callq 0x89e8
leaq -0xa8(%rbp), %rdi
callq 0x89e8
jmp 0x4e596
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x89e8
jmp 0x4e7b9
jmp 0x4e768
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
leaq 0x19e45(%rip), %rsi     # 0x683ef
callq 0x155a0
testb $0x1, %al
jne 0x4e5b8
jmp 0x4e65e
movq -0x8(%rbp), %rax
movb $0x1, 0x121(%rax)
movq -0x8(%rbp), %rdi
movq %rdi, %rsi
addq $0x40, %rsi
addq $0x60, %rdi
callq 0x8060
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x4f7a0
movq %rax, %rsi
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x81c0
movq -0x140(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x4da10
jmp 0x4e610
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
leaq -0xc8(%rbp), %rsi
callq 0x85b0
leaq -0xc8(%rbp), %rdi
callq 0x89e8
leaq -0xe8(%rbp), %rdi
callq 0x89e8
jmp 0x4e766
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x89e8
jmp 0x4e7b9
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4f7a0
movq %rax, %rdi
leaq 0x1ffed(%rip), %rsi     # 0x6e662
callq 0x155a0
testb $0x1, %al
jne 0x4e6a0
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4f7a0
movq %rax, %rdi
leaq 0x19591(%rip), %rsi     # 0x67c26
callq 0x155a0
testb $0x1, %al
jne 0x4e6a0
jmp 0x4e6c4
movq -0x8(%rbp), %rax
movb $0x1, 0x121(%rax)
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
leaq 0x194bd(%rip), %rsi     # 0x67b77
callq 0x8670
jmp 0x4e764
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
leaq 0x1bd39(%rip), %rsi     # 0x6a40c
callq 0x155a0
testb $0x1, %al
jne 0x4e6e1
jmp 0x4e762
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x4f7a0
movq %rax, %rsi
leaq -0x128(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x81c0
movq -0x148(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x4da10
jmp 0x4e71a
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
leaq -0x108(%rbp), %rsi
callq 0x85b0
leaq -0x108(%rbp), %rdi
callq 0x89e8
leaq -0x128(%rbp), %rdi
callq 0x89e8
jmp 0x4e762
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x89e8
jmp 0x4e7b9
jmp 0x4e764
jmp 0x4e766
jmp 0x4e768
cmpl $0x3, -0x14(%rbp)
jle 0x4e7b0
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x4f7a0
movq %rax, %rdi
leaq 0x1fec7(%rip), %rsi     # 0x6e64d
callq 0x4fa50
testb $0x1, %al
jne 0x4e7b0
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x4f7a0
movq %rax, %rsi
movq -0x8(%rbp), %rdi
addq $0x80, %rdi
callq 0x8060
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x88a0
nopw %cs:(%rax,%rax)