#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, int internal_nodes[],
                       int length_of_original_genome) {
  int i;
  fprintf(vcf_file_pointer, "##fileformat=VCFv4.2\n");
  fprintf(vcf_file_pointer, "##contig=<ID=1,length=%d>\n",
          length_of_original_genome);
  fprintf(vcf_file_pointer,
          "##FORMAT=<ID=AB,Number=1,Type=String,Description=\"Alt Base\">\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");
    if (internal_nodes[i] == 1) {
      continue;
    }
    fprintf(vcf_file_pointer, "%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    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf00(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11de <output_vcf_header+0xce>
mov    -0x8(%rbp),%rdi
lea    0xf09(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    11b2 <output_vcf_header+0xa2>
jmp    11d0 <output_vcf_header+0xc0>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xed6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    117d <output_vcf_header+0x6d>
mov    -0x8(%rbp),%rdi
lea    0xe2b(%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   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %rcx,%r14
mov    %edx,%r12d
mov    %rsi,%r15
mov    %rdi,%r13
lea    0xe9f(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1060 <fwrite@plt>
lea    0xe9c(%rip),%rsi
mov    %r13,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xea4(%rip),%rdi
mov    $0x3d,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1060 <fwrite@plt>
lea    0xec9(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1060 <fwrite@plt>
test   %r12d,%r12d
jle    11fb <output_vcf_header+0xbb>
mov    %r12d,%ebp
xor    %ebx,%ebx
jmp    11d9 <output_vcf_header+0x99>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %rbx,%rbp
je     11fb <output_vcf_header+0xbb>
mov    $0x9,%edi
mov    %r13,%rsi
call   1040 <fputc@plt>
cmpl   $0x1,(%r14,%rbx,4)
je     11d0 <output_vcf_header+0x90>
mov    (%r15,%rbx,8),%rdi
mov    %r13,%rsi
call   1030 <fputs@plt>
jmp    11d0 <output_vcf_header+0x90>
mov    $0xa,%edi
mov    %r13,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fputc@plt>

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

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