#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_col5_printf_decimated(double *v1, double *v2, double *v3,
                                  double *v4, double *v5, 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("\n");
  }
}


x86 assembly (clang, -O0):
<vector_col5_printf_decimated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
movl   $0x7d0,-0x38(%rbp)
cmpl   $0x7d0,-0x2c(%rbp)
jle    115d <vector_col5_printf_decimated+0x4d>
mov    -0x2c(%rbp),%eax
mov    $0x7d0,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    123c <vector_col5_printf_decimated+0x12c>
mov    0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x10(%rbp),%rdi
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1164 <vector_col5_printf_decimated+0x54>
add    $0x40,%rsp
pop    %rbp
ret

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

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