#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*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void print_branch_snp_details(FILE *branch_snps_file_pointer,
                              char *current_node_id, char *parent_node_id,
                              int *branches_snp_sites,
                              int number_of_branch_snps,
                              char *branch_snp_sequence,
                              char *branch_snp_ancestor_sequence,
                              char *taxon_names) {
  int i = 0;
  for (i = 0; i < number_of_branch_snps; i++) {
    fprintf(branch_snps_file_pointer, "FT   variation       %d\n",
            branches_snp_sites[i]);
    fprintf(branch_snps_file_pointer, "FT                   /node=\"%s->%s\"\n",
            parent_node_id, current_node_id);
    fprintf(branch_snps_file_pointer, "FT                   /colour=\"4\"\n");
    fprintf(branch_snps_file_pointer, "FT                   /taxa=\"%s\"\n",
            taxon_names);
    fprintf(branch_snps_file_pointer,
            "FT                   /parent_base=\"%c\"\n",
            branch_snp_ancestor_sequence[i]);
    fprintf(branch_snps_file_pointer, "FT                   /replace=\"%c\"\n",
            branch_snp_sequence[i]);
    fflush(branch_snps_file_pointer);
  }
}


x86 assembly (clang, -O0):
<print_branch_snp_details>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1214 <print_branch_snp_details+0xf4>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    0x18(%rbp),%rdx
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xeb3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1156 <print_branch_snp_details+0x36>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_branch_snp_details>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
test   %r8d,%r8d
jle    1205 <print_branch_snp_details+0xd5>
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
mov    %r8d,%ebp
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    (%r15,%r14,4),%edx
mov    %rbx,%rdi
lea    0xe92(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
lea    0xe9a(%rip),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x21,%esi
mov    $0x1,%edx
lea    0xea1(%rip),%rdi
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
lea    0xeb1(%rip),%rsi
mov    0x48(%rsp),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x40(%rsp),%rax
movsbl (%rax,%r14,1),%edx
mov    %rbx,%rdi
lea    0xeb2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rsp),%rax
movsbl (%rax,%r14,1),%edx
mov    %rbx,%rdi
lea    0xec0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fflush@plt>
add    $0x1,%r14
cmp    %r14,%rbp
jne    1160 <print_branch_snp_details+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"FT variation %d\0A\00"
@.str.1 = [37 x i8] c"FT /node=\22%s->%s\22\0A\00"
@.str.2 = [34 x i8] c"FT /colour=\224\22\0A\00"
@.str.3 = [33 x i8] c"FT /taxa=\22%s\22\0A\00"
@.str.4 = [40 x i8] c"FT /parent_base=\22%c\22\0A\00"
@.str.5 = [36 x i8] c"FT /replace=\22%c\22\0A\00"
define void @print_branch_snp_details(i32* nocapture %0, i8* %1, i8* %2, i32* nocapture %3, i32 %4, i8* nocapture %5, i8* nocapture %6, i8* %7) {
%9 = icmp sgt i32 %4, 0
br i1 %9, label %10, label %31
10: ; preds = %8
%11 = zext i32 %4 to i64
br label %12
12: ; preds = %10, %12
%13 = phi i64 [ 0, %10 ], [ %29, %12 ]
%14 = getelementptr inbounds i32, i32* %3, i64 %13
%15 = load i32, i32* %14
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %1)
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i64 33, i64 1, i32* %0)
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %7)
%20 = getelementptr inbounds i8, i8* %6, i64 %13
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds i8, i8* %5, i64 %13
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %26)
%28 = tail call i32 @fflush(i32* %0)
%29 = add nuw nsw i64 %13, 1
%30 = icmp eq i64 %29, %11
br i1 %30, label %31, label %12
31: ; preds = %12, %8
ret void
}