// File: karel-brinda[P]ococo/src/stats.h
// Function: ococo::stats_t<unsigned short, 3, 4>::print_vcf_header(_IO_FILE*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>) const
int stats_t<T, counter_size, refbase_size>::print_vcf_header(
    FILE *vcf_file, std::string cmd, std::string fasta) const {
    assert(check_allocation());
    assert(vcf_file != nullptr);

    std::time_t tt = std::time(nullptr);
    tm *tm         = localtime(&tt);

    fprintf(vcf_file,
            "##fileformat=VCFv4.3\n"
            "##fileDate=%04d%02d%02d\n"
            "##source=Ococo\n",
            tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday);

    if (!cmd.empty()) {
        fprintf(vcf_file, "##ococo_command=%s\n", cmd.c_str());
    }
    fprintf(vcf_file, "##ococo_stats_datatype_size=%zubits\n", 8 * sizeof(T));
    fprintf(vcf_file, "##ococo_counter_size=%dbits\n", counter_size);

    if (!fasta.empty()) {
        fprintf(vcf_file, "##reference=%s\n", fasta.c_str());
    }

    for (int seqid = 0; seqid < n_seqs; seqid++) {
        fprintf(vcf_file, "##contig=<ID=%s,length=%" PRId64 ">\n",
                seq_name[seqid].c_str(), seq_len[seqid]);
    }

    fprintf(vcf_file,
            "##INFO=<ID=AF,Number=A,Type=Float,Description="
            "\"Allele frequency for the ALT allele.\">\n");
    fprintf(vcf_file,
            "##INFO=<ID=CS,Number=4,Type=Integer,Description="
            "\"Values of A,C,G,T counters.\">\n");
    fprintf(vcf_file,
            "##INFO=<ID=COV,Number=1,Type=Integer,Description="
            "\"Coverage (correct if no shift has been performed so far and "
            "reference nucleotide was unambiguous).\">\n");
    fprintf(vcf_file, "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\n");

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdx, -0x50(%rbp)
movq %rcx, -0x48(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0x9440
testb $0x1, %al
jne 0x9cd3
jmp 0x9cd5
jmp 0x9cf4
leaq 0x6e6a3(%rip), %rdi     # 0x7837f
leaq 0x6e6af(%rip), %rsi     # 0x78392
movl $0x1cf, %edx            # imm = 0x1CF
leaq 0x6ea39(%rip), %rcx     # 0x78728
callq 0x4360
cmpq $0x0, -0x10(%rbp)
je 0x9cfd
jmp 0x9d1c
leaq 0x6eac0(%rip), %rdi     # 0x787c4
leaq 0x6e687(%rip), %rsi     # 0x78392
movl $0x1d0, %edx            # imm = 0x1D0
leaq 0x6ea11(%rip), %rcx     # 0x78728
callq 0x4360
xorl %eax, %eax
movl %eax, %edi
callq 0x4520
movq %rax, -0x28(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x43f0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movl 0x14(%rax), %edx
addl $0x76c, %edx            # imm = 0x76C
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movl 0xc(%rax), %r8d
leaq 0x6ea78(%rip), %rsi     # 0x787d8
movb $0x0, %al
callq 0x4830
movq -0x50(%rbp), %rdi
callq 0x49c0
testb $0x1, %al
jne 0x9d9a
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
callq 0x4200
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x6ea82(%rip), %rsi     # 0x78815
movb $0x0, %al
callq 0x4830
movq -0x10(%rbp), %rdi
leaq 0x6ea84(%rip), %rsi     # 0x78829
movl $0x10, %edx
movb $0x0, %al
callq 0x4830
movq -0x10(%rbp), %rdi
leaq 0x6ea92(%rip), %rsi     # 0x7884e
movl $0x3, %edx
movb $0x0, %al
callq 0x4830
movq -0x48(%rbp), %rdi
callq 0x49c0
testb $0x1, %al
jne 0x9dfb
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
callq 0x4200
movq -0x60(%rbp), %rdi
movq %rax, %rdx
leaq 0x6ea77(%rip), %rsi     # 0x7886b
movb $0x0, %al
callq 0x4830
movl $0x0, -0x34(%rbp)
movq -0x40(%rbp), %rcx
movl -0x34(%rbp), %eax
cmpl (%rcx), %eax
jge 0x9e5d
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x68(%rbp)
movq 0x18(%rax), %rdi
movslq -0x34(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x4200
movq -0x68(%rbp), %rdi
movq %rax, %rdx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0x6ea30(%rip), %rsi     # 0x7887b
movb $0x0, %al
callq 0x4830
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x9e02
movq -0x10(%rbp), %rdi
leaq 0x6ea30(%rip), %rsi     # 0x78898
movb $0x0, %al
callq 0x4830
movq -0x10(%rbp), %rdi
leaq 0x6ea75(%rip), %rsi     # 0x788ef
movb $0x0, %al
callq 0x4830
movq -0x10(%rbp), %rdi
leaq 0x6eab3(%rip), %rsi     # 0x7893f
movb $0x0, %al
callq 0x4830
movq -0x10(%rbp), %rdi
leaq 0x6eb39(%rip), %rsi     # 0x789d7
movb $0x0, %al
callq 0x4830
xorl %eax, %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)