#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void output_vcf_header(FILE *vcf_file_pointer, char **sequence_names,
                       int number_of_samples, size_t length_of_genome) {
  int i;
  fprintf(vcf_file_pointer, "##fileformat=VCFv4.1\n");
  fprintf(vcf_file_pointer, "##contig=<ID=1,length=%i>\n",
          (int)length_of_genome);
  fprintf(vcf_file_pointer,
          "##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n");
  fprintf(vcf_file_pointer,
          "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT");
  for (i = 0; i < number_of_samples; i++) {
    fprintf(vcf_file_pointer, "\t%s", sequence_names[i]);
  }
  fprintf(vcf_file_pointer, "\n");
}


x86 assembly (clang, -O0):
<output_vcf_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %eax,%edx
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf01(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11b4 <output_vcf_header+0xa4>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xefe(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117c <output_vcf_header+0x6c>
mov    -0x8(%rbp),%rdi
lea    0xe55(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_vcf_header>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%rbp
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%r12
lea    0xeb5(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1050 <fwrite@plt>
lea    0xeb2(%rip),%rsi
mov    %r12,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xeba(%rip),%rdi
mov    $0x3d,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1050 <fwrite@plt>
lea    0xedf(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1050 <fwrite@plt>
test   %r15d,%r15d
jle    11da <output_vcf_header+0xaa>
mov    %r15d,%ebp
lea    0xeec(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14,%rbx,8),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11c0 <output_vcf_header+0x90>
mov    $0xa,%edi
mov    %r12,%rsi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"##fileformat=VCFv4.1\0A\00"
@.str.1 = [27 x i8] c"##contig=<ID=1,length=%i>\0A\00"
@.str.2 = [62 x i8] c"##FORMAT=<ID=GT,Number=1,Type=String,Description=\22Genotype\22>\0A\00"
@.str.3 = [46 x i8] c"#CHROM\09POS\09ID\09REF\09ALT\09QUAL\09FILTER\09INFO\09FORMAT\00"
@.str.4 = [4 x i8] c"\09%s\00"
@.str.5 = [2 x i8] c"\0A\00"
define void @output_vcf_header(i32* %0, i8** %1, i32 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i64
%9 = alloca i32
store i32* %0, i32** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%10 = load i32*, i32** %5
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%12 = load i32*, i32** %5
%13 = load i64, i64* %8
%14 = trunc i64 %13 to i32
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32*, i32** %5
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32*, i32** %5
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %9
br label %20
20: ; preds = %32, %4
%21 = load i32, i32* %9
%22 = load i32, i32* %7
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %35
24: ; preds = %20
%25 = load i32*, i32** %5
%26 = load i8**, i8*** %6
%27 = load i32, i32* %9
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %30)
br label %32
32: ; preds = %24
%33 = load i32, i32* %9
%34 = add nsw i32 %33, 1
store i32 %34, i32* %9
br label %20
35: ; preds = %20
%36 = load i32*, i32** %5
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"##fileformat=VCFv4.1\0A\00"
@.str.1 = [27 x i8] c"##contig=<ID=1,length=%i>\0A\00"
@.str.2 = [62 x i8] c"##FORMAT=<ID=GT,Number=1,Type=String,Description=\22Genotype\22>\0A\00"
@.str.3 = [46 x i8] c"#CHROM\09POS\09ID\09REF\09ALT\09QUAL\09FILTER\09INFO\09FORMAT\00"
@.str.4 = [4 x i8] c"\09%s\00"
define void @output_vcf_header(i32* nocapture %0, i8** nocapture %1, i32 %2, i64 %3) {
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 21, i64 1, i32* %0)
%6 = trunc i64 %3 to i32
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i64 61, i64 1, i32* %0)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i64 45, i64 1, i32* %0)
%10 = icmp sgt i32 %2, 0
br i1 %10, label %11, label %20
11: ; preds = %4
%12 = zext i32 %2 to i64
br label %13
13: ; preds = %11, %13
%14 = phi i64 [ 0, %11 ], [ %18, %13 ]
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%18 = add nuw nsw i64 %14, 1
%19 = icmp eq i64 %18, %12
br i1 %19, label %20, label %13
20: ; preds = %13, %4
%21 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}