#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 write_geno_line(FILE *File, int *line, int N) {
  int i = 0;
  for (i = 0; i < N; i++) {
    if (i < N - 1)
      fprintf(File, "%d ", line[i]);
    if (i == (N - 1))
      fprintf(File, "%d", line[i]);
  }
  fprintf(File, "\n");
}


x86 assembly (clang, -O0):
<write_geno_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ac <write_geno_line+0x9c>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    116b <write_geno_line+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe9c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1199 <write_geno_line+0x89>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe72(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    119e <write_geno_line+0x8e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1131 <write_geno_line+0x21>
mov    -0x8(%rbp),%rdi
lea    0xe50(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_geno_line>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r13
test   %edx,%edx
jle    118b <write_geno_line+0x6b>
mov    %rsi,%r14
lea    -0x1(%rdx),%ebx
mov    %edx,%ebp
lea    0xec3(%rip),%r12
xor    %r15d,%r15d
jmp    1159 <write_geno_line+0x39>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    %r15,%rbp
je     118b <write_geno_line+0x6b>
cmp    %rbx,%r15
jae    1173 <write_geno_line+0x53>
mov    (%r14,%r15,4),%edx
mov    %r13,%rdi
lea    0xe94(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
cmp    %r15,%rbx
jne    1150 <write_geno_line+0x30>
mov    (%r14,%rbx,4),%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1150 <write_geno_line+0x30>
mov    $0xa,%edi
mov    %r13,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @write_geno_line(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
store i32 0, i32* %7
br label %8
8: ; preds = %39, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %42
12: ; preds = %8
%13 = load i32, i32* %7
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %25
17: ; preds = %12
%18 = load i32*, i32** %4
%19 = load i32*, i32** %5
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %17, %12
%26 = load i32, i32* %7
%27 = load i32, i32* %6
%28 = sub nsw i32 %27, 1
%29 = icmp eq i32 %26, %28
br i1 %29, label %30, label %38
30: ; preds = %25
%31 = load i32*, i32** %4
%32 = load i32*, i32** %5
%33 = load i32, i32* %7
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
%36 = load i32, i32* %35
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %30, %25
br label %39
39: ; preds = %38
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
br label %8
42: ; preds = %8
%43 = load i32*, i32** %4
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

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