// File: yayuntian[P]user_agent/operatingSystem.cpp
// Function: detectOS(UserAgent&, Section&, int)
void detectOS(UserAgent& p, Section& s, int slen) {
    if (s.name == "Mozilla") {
        p.platform = getPlatform(s.comment, slen);
        if (p.platform == "Windows" && slen > 0) {
            p.os = normalizeOS(s.comment[0]);
        }

        if (p.browser.Engine == "") {
            p.undecided = true;
        } else if(p.browser.Engine == "Gecko") {
            gecko(p, s.comment, slen);
        } else if (p.browser.Engine == "AppleWebKit") {
            webKit(p, s.comment, slen);
        } else if (p.browser.Engine == "Trident") {
            trident(p, s.comment, slen);
        }
    } else if (s.name == "Opera") {
        if (slen > 0) {
            opera(p, s.comment, slen);
        }
    } else if (s.name == "Dalvik") {
        if (slen > 0) {
            dalvik(p, s.comment, slen);
        }
    } else {
        p.undecided = true;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1911a(%rip), %rsi     # 0x6865b
callq 0x155a0
testb $0x1, %al
jne 0x4f54f
jmp 0x4f6e1
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
movl -0x14(%rbp), %edx
leaq -0x38(%rbp), %rdi
callq 0x4d790
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
leaq -0x38(%rbp), %rsi
callq 0x85b0
leaq -0x38(%rbp), %rdi
callq 0x89e8
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
leaq 0x1f017(%rip), %rsi     # 0x6e5a3
callq 0x155a0
testb $0x1, %al
jne 0x4f597
jmp 0x4f615
cmpl $0x0, -0x14(%rbp)
jle 0x4f615
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4f7a0
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x81c0
movq -0x90(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x4da10
jmp 0x4f5d3
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
leaq -0x58(%rbp), %rsi
callq 0x85b0
leaq -0x58(%rbp), %rdi
callq 0x89e8
leaq -0x78(%rbp), %rdi
callq 0x89e8
jmp 0x4f615
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x89e8
jmp 0x4f75d
movq -0x8(%rbp), %rdi
addq $0xa0, %rdi
leaq 0x1ade5(%rip), %rsi     # 0x6a40c
callq 0x155a0
testb $0x1, %al
jne 0x4f632
jmp 0x4f642
movq -0x8(%rbp), %rax
movb $0x1, 0x122(%rax)
jmp 0x4f6df
movq -0x8(%rbp), %rdi
addq $0xa0, %rdi
leaq 0x177da(%rip), %rsi     # 0x66e2e
callq 0x155a0
testb $0x1, %al
jne 0x4f65f
jmp 0x4f675
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
movl -0x14(%rbp), %edx
callq 0x4e450
jmp 0x4f6dd
movq -0x8(%rbp), %rdi
addq $0xa0, %rdi
leaq 0x1f00c(%rip), %rsi     # 0x6e693
callq 0x155a0
testb $0x1, %al
jne 0x4f692
jmp 0x4f6a8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
movl -0x14(%rbp), %edx
callq 0x4df80
jmp 0x4f6db
movq -0x8(%rbp), %rdi
addq $0xa0, %rdi
leaq 0x1efe5(%rip), %rsi     # 0x6e69f
callq 0x155a0
testb $0x1, %al
jne 0x4f6c5
jmp 0x4f6d9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
movl -0x14(%rbp), %edx
callq 0x4e7d0
jmp 0x4f6db
jmp 0x4f6dd
jmp 0x4f6df
jmp 0x4f754
movq -0x10(%rbp), %rdi
leaq 0x1efbb(%rip), %rsi     # 0x6e6a7
callq 0x155a0
testb $0x1, %al
jne 0x4f6f7
jmp 0x4f713
cmpl $0x0, -0x14(%rbp)
jle 0x4f711
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
movl -0x14(%rbp), %edx
callq 0x4e900
jmp 0x4f752
movq -0x10(%rbp), %rdi
leaq 0x1ef8f(%rip), %rsi     # 0x6e6ad
callq 0x155a0
testb $0x1, %al
jne 0x4f729
jmp 0x4f745
cmpl $0x0, -0x14(%rbp)
jle 0x4f743
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
movl -0x14(%rbp), %edx
callq 0x4eb00
jmp 0x4f750
movq -0x8(%rbp), %rax
movb $0x1, 0x122(%rax)
jmp 0x4f752
jmp 0x4f754
addq $0x90, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x88a0
nopw %cs:(%rax,%rax)