#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_col6_printf_decimated(double *v1, double *v2, double *v3,
                                  double *v4, double *v5, double *v6,
                                  int length, char *format) {
  int stride = 1;
  int i;
  const int maxlen = 2000;
  if (length > maxlen)
    stride = length / maxlen;
  for (i = 0; i < length; i += stride) {
    printf(format, v1[i]);
    printf(" ");
    printf(format, v2[i]);
    printf(" ");
    printf(format, v3[i]);
    printf(" ");
    printf(format, v4[i]);
    printf(" ");
    printf(format, v5[i]);
    printf(" ");
    printf(format, v6[i]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<vector_col6_printf_decimated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
movl   $0x7d0,-0x3c(%rbp)
cmpl   $0x7d0,0x10(%rbp)
jle    1160 <vector_col6_printf_decimated+0x50>
mov    0x10(%rbp),%eax
mov    $0x7d0,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1265 <vector_col6_printf_decimated+0x155>
mov    0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x18(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x18(%rbp),%rdi
mov    -0x28(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x18(%rbp),%rdi
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1167 <vector_col6_printf_decimated+0x57>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_col6_printf_decimated>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbp
mov    0x60(%rsp),%edi
test   %edi,%edi
jle    123a <vector_col6_printf_decimated+0x11a>
mov    %rsi,%rbx
mov    %rdx,%r12
mov    $0x1,%eax
mov    %edi,%r15d
cmp    $0x7d1,%edi
jb     115e <vector_col6_printf_decimated+0x3e>
imul   $0x10624dd3,%r15,%rax
shr    $0x27,%rax
mov    0x68(%rsp),%r14
mov    %eax,%eax
mov    %rax,0x20(%rsp)
xor    %r13d,%r13d
mov    %r9,0x18(%rsp)
mov    %r8,0x10(%rsp)
mov    %rcx,0x8(%rsp)
nopl   0x0(%rax)
movsd  0x0(%rbp,%r13,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsd  (%rbx,%r13,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsd  (%r12,%r13,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%rax
movsd  (%rax,%r13,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%rax
movsd  (%rax,%r13,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%rax
movsd  (%rax,%r13,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    0x20(%rsp),%r13
cmp    %r15,%r13
jl     1180 <vector_col6_printf_decimated+0x60>
add    $0x28,%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_col6_printf_decimated(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, i32 %6, i8* %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store i32 %6, i32* %15
store i8* %7, i8** %16
store i32 1, i32* %17
store i32 2000, i32* %19
%20 = load i32, i32* %15
%21 = icmp sgt i32 %20, 2000
br i1 %21, label %22, label %25
22: ; preds = %8
%23 = load i32, i32* %15
%24 = sdiv i32 %23, 2000
store i32 %24, i32* %17
br label %25
25: ; preds = %22, %8
store i32 0, i32* %18
br label %26
26: ; preds = %79, %25
%27 = load i32, i32* %18
%28 = load i32, i32* %15
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %83
30: ; preds = %26
%31 = load i8*, i8** %16
%32 = load double*, double** %9
%33 = load i32, i32* %18
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
%36 = load double, double* %35
%37 = call i32 (i8*, ...) @printf(i8* %31, double %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%39 = load i8*, i8** %16
%40 = load double*, double** %10
%41 = load i32, i32* %18
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %40, i64 %42
%44 = load double, double* %43
%45 = call i32 (i8*, ...) @printf(i8* %39, double %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%47 = load i8*, i8** %16
%48 = load double*, double** %11
%49 = load i32, i32* %18
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %48, i64 %50
%52 = load double, double* %51
%53 = call i32 (i8*, ...) @printf(i8* %47, double %52)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%55 = load i8*, i8** %16
%56 = load double*, double** %12
%57 = load i32, i32* %18
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %56, i64 %58
%60 = load double, double* %59
%61 = call i32 (i8*, ...) @printf(i8* %55, double %60)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%63 = load i8*, i8** %16
%64 = load double*, double** %13
%65 = load i32, i32* %18
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %64, i64 %66
%68 = load double, double* %67
%69 = call i32 (i8*, ...) @printf(i8* %63, double %68)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%71 = load i8*, i8** %16
%72 = load double*, double** %14
%73 = load i32, i32* %18
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %72, i64 %74
%76 = load double, double* %75
%77 = call i32 (i8*, ...) @printf(i8* %71, double %76)
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %79
79: ; preds = %30
%80 = load i32, i32* %17
%81 = load i32, i32* %18
%82 = add nsw i32 %81, %80
store i32 %82, i32* %18
br label %26
83: ; preds = %26
ret void
}

LLVM IR (-O2):
define void @vector_col6_printf_decimated(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, i32 %6, i8* nocapture %7) {
%9 = icmp sgt i32 %6, 0
br i1 %9, label %10, label %44
10: ; preds = %8
%11 = icmp ugt i32 %6, 2000
%12 = udiv i32 %6, 2000
%13 = select i1 %11, i32 %12, i32 1
%14 = zext i32 %13 to i64
%15 = zext i32 %6 to i64
br label %16
16: ; preds = %10, %16
%17 = phi i64 [ 0, %10 ], [ %42, %16 ]
%18 = getelementptr inbounds double, double* %0, i64 %17
%19 = load double, double* %18
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7, double %19)
%21 = tail call i32 @putchar(i32 32)
%22 = getelementptr inbounds double, double* %1, i64 %17
%23 = load double, double* %22
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7, double %23)
%25 = tail call i32 @putchar(i32 32)
%26 = getelementptr inbounds double, double* %2, i64 %17
%27 = load double, double* %26
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7, double %27)
%29 = tail call i32 @putchar(i32 32)
%30 = getelementptr inbounds double, double* %3, i64 %17
%31 = load double, double* %30
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7, double %31)
%33 = tail call i32 @putchar(i32 32)
%34 = getelementptr inbounds double, double* %4, i64 %17
%35 = load double, double* %34
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7, double %35)
%37 = tail call i32 @putchar(i32 32)
%38 = getelementptr inbounds double, double* %5, i64 %17
%39 = load double, double* %38
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7, double %39)
%41 = tail call i32 @putchar(i32 10)
%42 = add i64 %17, %14
%43 = icmp slt i64 %42, %15
br i1 %43, label %16, label %44
44: ; preds = %16, %8
ret void
}