#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*/ alternative_bases(char, char *, char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ output_vcf_row_samples_bases(int /*<<< orphan*/ *, char,
                                                char *, int, int *);
void output_vcf_row(FILE *vcf_file_pointer, char *bases_for_snp,
                    int snp_location, int number_of_samples,
                    int internal_nodes[], int offset) {
  char reference_base = bases_for_snp[0];
  char alt_bases[30];
  if (reference_base == '\0') {
    return;
  }
  fprintf(vcf_file_pointer, "1\t");
  fprintf(vcf_file_pointer, "%d\t", (int)snp_location + offset);
  fprintf(vcf_file_pointer, ".\t");
  fprintf(vcf_file_pointer, "%c\t", (char)reference_base);
  alternative_bases(reference_base, bases_for_snp, alt_bases,
                    number_of_samples);
  fprintf(vcf_file_pointer, "%s\t", alt_bases);
  fprintf(vcf_file_pointer, ".\t");
  fprintf(vcf_file_pointer, ".\t");
  fprintf(vcf_file_pointer, ".\t");
  fprintf(vcf_file_pointer, "AB\t");
  output_vcf_row_samples_bases(vcf_file_pointer, reference_base, bases_for_snp,
                               number_of_samples, internal_nodes);
  fprintf(vcf_file_pointer, "\n");
}


x86 assembly (clang, -O0):
<output_vcf_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x25(%rbp)
movsbl -0x25(%rbp),%eax
cmp    $0x0,%eax
jne    1169 <output_vcf_row+0x39>
jmp    125b <output_vcf_row+0x12b>
mov    -0x8(%rbp),%rdi
lea    0xe8c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
add    -0x24(%rbp),%edx
lea    0xe77(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
movsbl -0x25(%rbp),%edx
lea    0xe56(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x25(%rbp),%al
mov    -0x10(%rbp),%rsi
lea    -0x50(%rbp),%rdx
mov    -0x18(%rbp),%ecx
movsbl %al,%edi
call   1030 <alternative_bases@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xe2e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe15(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe03(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdf1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x25(%rbp),%al
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
movsbl %al,%esi
call   1050 <output_vcf_row_samples_bases@plt>
mov    -0x8(%rbp),%rdi
lea    0xdc2(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_vcf_row>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movsbl (%rsi),%r14d
test   %r14d,%r14d
je     1283 <output_vcf_row+0x133>
mov    %r9d,%ebp
mov    %ecx,%r15d
mov    %edx,%r13d
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0xe7f(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %r8,0x8(%rsp)
call   1060 <fwrite@plt>
add    %r13d,%ebp
lea    0xe61(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe52(%rip),%r13
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %rbx,%rcx
call   1060 <fwrite@plt>
lea    0xe39(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x10(%rsp),%rbp
mov    %r14d,%edi
mov    %r12,%rsi
mov    %rbp,%rdx
mov    %r15d,%ecx
call   1030 <alternative_bases@plt>
lea    0xe13(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %rbx,%rcx
call   1060 <fwrite@plt>
lea    0xdc4(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %r12,%rdx
mov    %r15d,%ecx
mov    0x8(%rsp),%r8
call   1070 <output_vcf_row_samples_bases@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"1\09\00"
@.str.1 = [4 x i8] c"%d\09\00"
@.str.2 = [3 x i8] c".\09\00"
@.str.3 = [4 x i8] c"%c\09\00"
@.str.4 = [4 x i8] c"%s\09\00"
@.str.5 = [4 x i8] c"AB\09\00"
@.str.6 = [2 x i8] c"\0A\00"
define void @output_vcf_row(i32* %0, i8* %1, i32 %2, i32 %3, i32* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i8
%14 = alloca [30 x i8]
store i32* %0, i32** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%15 = load i8*, i8** %8
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
store i8 %17, i8* %13
%18 = load i8, i8* %13
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %6
br label %60
22: ; preds = %6
%23 = load i32*, i32** %7
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%25 = load i32*, i32** %7
%26 = load i32, i32* %9
%27 = load i32, i32* %12
%28 = add nsw i32 %26, %27
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = load i32*, i32** %7
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%32 = load i32*, i32** %7
%33 = load i8, i8* %13
%34 = sext i8 %33 to i32
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %34)
%36 = load i8, i8* %13
%37 = load i8*, i8** %8
%38 = getelementptr inbounds [30 x i8], [30 x i8]* %14, i64 0, i64 0
%39 = load i32, i32* %10
%40 = call i32 @alternative_bases(i8 signext %36, i8* %37, i8* %38, i32 %39)
%41 = load i32*, i32** %7
%42 = getelementptr inbounds [30 x i8], [30 x i8]* %14, i64 0, i64 0
%43 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %42)
%44 = load i32*, i32** %7
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%46 = load i32*, i32** %7
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%48 = load i32*, i32** %7
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%50 = load i32*, i32** %7
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%52 = load i32*, i32** %7
%53 = load i8, i8* %13
%54 = load i8*, i8** %8
%55 = load i32, i32* %10
%56 = load i32*, i32** %11
%57 = call i32 @output_vcf_row_samples_bases(i32* %52, i8 signext %53, i8* %54, i32 %55, i32* %56)
%58 = load i32*, i32** %7
%59 = call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %60
60: ; preds = %22, %21
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"1\09\00"
@.str.1 = [4 x i8] c"%d\09\00"
@.str.2 = [3 x i8] c".\09\00"
@.str.3 = [4 x i8] c"%c\09\00"
@.str.4 = [4 x i8] c"%s\09\00"
@.str.5 = [4 x i8] c"AB\09\00"
define void @output_vcf_row(i32* %0, i8* %1, i32 %2, i32 %3, i32* %4, i32 %5) {
%7 = alloca [30 x i8]
%8 = load i8, i8* %1
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%10 = icmp eq i8 %8, 0
br i1 %10, label %26, label %11
11: ; preds = %6
%12 = sext i8 %8 to i32
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
%14 = add nsw i32 %5, %2
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 2, i64 1, i32* %0)
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%18 = call i32 @alternative_bases(i8 signext %8, i8* %1, i8* %9, i32 %3)
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %9)
%20 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 2, i64 1, i32* %0)
%21 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 2, i64 1, i32* %0)
%22 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 2, i64 1, i32* %0)
%23 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64 3, i64 1, i32* %0)
%24 = call i32 @output_vcf_row_samples_bases(i32* %0, i8 signext %8, i8* %1, i32 %3, i32* %4)
%25 = call i32 @fputc(i32 10, i32* %0)
br label %26
26: ; preds = %6, %11
ret void
}