// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamHeaderValidator_p.cpp
// Function: BamTools::Internal::SamHeaderValidator::ValidateVersion()
bool SamHeaderValidator::ValidateVersion(void) {

    const string& version = m_header.Version;

    // warn if version not present
    if ( version.empty() ) {
        AddWarning("Version (VN) missing. Not required, but strongly recommended");
        return true;
    }

    // invalid if version does not contain a period
    const size_t periodFound = version.find(Constants::SAM_PERIOD);
    if ( periodFound == string::npos ) {
        AddError("Invalid version (VN) format: " + version);
        return false;
    }

    // invalid if major version is empty or contains non-digits
    const string majorVersion = version.substr(0, periodFound);
    if ( majorVersion.empty() || !ContainsOnlyDigits(majorVersion) ) {
        AddError("Invalid version (VN) format: " + version);
        return false;
    }

    // invalid if major version is empty or contains non-digits
    const string minorVersion = version.substr(periodFound + 1);
    if ( minorVersion.empty() || !ContainsOnlyDigits(minorVersion) ) {
        AddError("Invalid version (VN) format: " + version);
        return false;
    }

    // TODO: check if version is not just syntactically OK,
    // but is also a valid SAM version ( 1.0 .. CURRENT )

    // all checked out this far, then version is OK
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq (%rdi), %r14
cmpq $0x0, 0x8(%r14)
je 0x539ea
movq %r14, %rdi
movl $0x2e, %esi
xorl %edx, %edx
callq 0x27f00
cmpq $-0x1, %rax
je 0x53a2b
movq %rax, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x277f0
cmpq $0x0, 0x8(%r12)
je 0x5399f
movq 0x1abde(%rip), %rsi     # 0x6e560
movq 0x1abdf(%rip), %rcx     # 0x6e568
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x289b0
cmpq $-0x1, %rax
je 0x53a70
leaq 0x3b68(%rip), %rsi      # 0x5750e
leaq 0x28(%rsp), %rdi
movq %r14, %rdx
callq 0x273f0
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x27500
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x539d3
callq 0x27560
xorl %ebx, %ebx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53a62
callq 0x27560
jmp 0x53a62
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x3ad7(%rip), %rsi      # 0x574d1
leaq 0x3b0c(%rip), %rdx      # 0x5750d
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x26920
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x53a27
callq 0x27560
movb $0x1, %bl
jmp 0x53a62
leaq 0x3adc(%rip), %rsi      # 0x5750e
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x273f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27500
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53a60
callq 0x27560
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
incq %r15
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq $-0x1, %rcx
callq 0x277f0
cmpq $0x0, 0x30(%rsp)
je 0x53ab2
movq 0x1aac7(%rip), %rsi     # 0x6e560
movq 0x1aac8(%rip), %rcx     # 0x6e568
leaq 0x28(%rsp), %rdi
xorl %edx, %edx
callq 0x289b0
cmpq $-0x1, %rax
je 0x53aea
leaq 0x3a55(%rip), %rsi      # 0x5750e
leaq 0x48(%rsp), %rdi
movq %r14, %rdx
callq 0x273f0
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x27500
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53ae6
callq 0x27560
xorl %ebx, %ebx
jmp 0x53aec
movb $0x1, %bl
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x539d5
callq 0x27560
jmp 0x539d5
jmp 0x53b2a
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53b2d
callq 0x27560
jmp 0x53b2d
jmp 0x53b2a
jmp 0x53b42
jmp 0x53b42
jmp 0x53b42
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53b45
callq 0x27560
jmp 0x53b45
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x53b62
jmp 0x53b6c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x53b6c
callq 0x27560
jmp 0x53b6c
movq %rax, %rbx
movq %rbx, %rdi
callq 0x28c20