#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_row_samples_bases(FILE *vcf_file_pointer, char reference_base,
                                  char *bases_for_snp, int number_of_samples,
                                  int internal_nodes[]) {
  int i;
  for (i = 0; i < number_of_samples; i++) {
    if (internal_nodes[i] == 1) {
      continue;
    }
    if (bases_for_snp[i] == reference_base) {
      fprintf(vcf_file_pointer, "%c", (char)reference_base);
    } else {
      fprintf(vcf_file_pointer, "%c", (char)bases_for_snp[i]);
    }
    if (i + 1 != number_of_samples) {
      fprintf(vcf_file_pointer, "\t");
    }
  }
}


x86 assembly (clang, -O0):
<output_vcf_row_samples_bases>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11dc <output_vcf_row_samples_bases+0xcc>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1157 <output_vcf_row_samples_bases+0x47>
jmp    11ce <output_vcf_row_samples_bases+0xbe>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    118a <output_vcf_row_samples_bases+0x7a>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%edx
lea    0xe82(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11a8 <output_vcf_row_samples_bases+0x98>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xe5f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cmp    -0x1c(%rbp),%eax
je     11c9 <output_vcf_row_samples_bases+0xb9>
mov    -0x8(%rbp),%rdi
lea    0xe41(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11ce <output_vcf_row_samples_bases+0xbe>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1134 <output_vcf_row_samples_bases+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_vcf_row_samples_bases>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %ecx,%ecx
jle    1165 <output_vcf_row_samples_bases+0x55>
mov    %r8,%r12
mov    %rdx,%r14
mov    %rdi,%r15
mov    %ecx,%r13d
xor    %ebx,%ebx
jmp    1139 <output_vcf_row_samples_bases+0x29>
nopl   (%rax)
add    $0x1,%rbx
cmp    %r13,%rbx
je     1165 <output_vcf_row_samples_bases+0x55>
cmpl   $0x1,(%r12,%rbx,4)
je     1130 <output_vcf_row_samples_bases+0x20>
movsbl (%r14,%rbx,1),%edi
mov    %r15,%rsi
call   1030 <fputc@plt>
add    $0x1,%rbx
cmp    %r13,%rbx
je     1134 <output_vcf_row_samples_bases+0x24>
mov    $0x9,%edi
mov    %r15,%rsi
call   1030 <fputc@plt>
jmp    1134 <output_vcf_row_samples_bases+0x24>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @output_vcf_row_samples_bases(i32* nocapture %0, i8 signext %1, i8* nocapture %2, i32 %3, i32* nocapture %4) {
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %28
7: ; preds = %5
%8 = zext i32 %3 to i64
br label %9
9: ; preds = %7, %25
%10 = phi i64 [ 0, %7 ], [ %26, %25 ]
%11 = getelementptr inbounds i32, i32* %4, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = add nuw nsw i64 %10, 1
br label %25
16: ; preds = %9
%17 = getelementptr inbounds i8, i8* %2, i64 %10
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = tail call i32 @fputc(i32 %19, i32* %0)
%21 = add nuw nsw i64 %10, 1
%22 = icmp eq i64 %21, %8
br i1 %22, label %25, label %23
23: ; preds = %16
%24 = tail call i32 @fputc(i32 9, i32* %0)
br label %25
25: ; preds = %14, %16, %23
%26 = phi i64 [ %15, %14 ], [ %21, %16 ], [ %21, %23 ]
%27 = icmp eq i64 %26, %8
br i1 %27, label %28, label %9
28: ; preds = %25, %5
ret void
}