// File: /workspace/github_cpp_makefile_star2_O3/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 0x53912
movq %r14, %rdi
movl $0x2e, %esi
xorl %edx, %edx
callq 0x27ef0
cmpq $-0x1, %rax
je 0x53953
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 0x538c7
movq 0x1acae(%rip), %rsi     # 0x6e558
movq 0x1acaf(%rip), %rcx     # 0x6e560
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x289a0
cmpq $-0x1, %rax
je 0x53998
leaq 0x3c40(%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 0x538fb
callq 0x27560
xorl %ebx, %ebx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5398a
callq 0x27560
jmp 0x5398a
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x3baf(%rip), %rsi      # 0x574d1
leaq 0x3be4(%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 0x5394f
callq 0x27560
movb $0x1, %bl
jmp 0x5398a
leaq 0x3bb4(%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 0x53988
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 0x539da
movq 0x1ab97(%rip), %rsi     # 0x6e558
movq 0x1ab98(%rip), %rcx     # 0x6e560
leaq 0x28(%rsp), %rdi
xorl %edx, %edx
callq 0x289a0
cmpq $-0x1, %rax
je 0x53a12
leaq 0x3b2d(%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 0x53a0e
callq 0x27560
xorl %ebx, %ebx
jmp 0x53a14
movb $0x1, %bl
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x538fd
callq 0x27560
jmp 0x538fd
jmp 0x53a52
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53a55
callq 0x27560
jmp 0x53a55
jmp 0x53a52
jmp 0x53a6a
jmp 0x53a6a
jmp 0x53a6a
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53a6d
callq 0x27560
jmp 0x53a6d
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x53a8a
jmp 0x53a94
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x53a94
callq 0x27560
jmp 0x53a94
movq %rax, %rbx
movq %rbx, %rdi
callq 0x28c10