#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void vector_col3_printf(double *v1, double *v2, double *v3, int length,
                        char *format) {
  int i;
  for (i = 0; i < length; i++) {
    printf(format, v1[i]);
    printf(" ");
    printf(format, v2[i]);
    printf(" ");
    printf(format, v3[i]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<vector_col3_printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%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    11be <vector_col3_printf+0xae>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1132 <vector_col3_printf+0x22>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_col3_printf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %ecx,%ecx
jle    1197 <vector_col3_printf+0x77>
mov    %r8,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %ecx,%r13d
xor    %ebp,%ebp
movsd  (%r12,%rbp,8),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsd  (%r15,%rbp,8),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsd  (%r14,%rbp,8),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1140 <vector_col3_printf+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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